coding-best-practices

Provides canonical folder structure, dependency, and testing conventions for multiple language stacks.

Updated Sep 7, 2026
One-click install
npx skills add https://github.com/deriye/.agents-work --skill coding-best-practices-deriye
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: coding-best-practices
Source: https://github.com/deriye/.agents-work/tree/main/skills/coding-best-practices
Command: npx skills add https://github.com/deriye/.agents-work --skill coding-best-practices-deriye

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams and AI agents often invent inconsistent project layouts, misplace hooks and tests, or skip researching conventions for each stack in a change. This Skill acts as a single source of truth for how to structure and write code across Python, React + Vite + TypeScript, PostgreSQL, Express, Better Auth, Docker, and S3-compatible object storage. ## Core Features & Use Cases - Per-stack convention files: Each stack file records sources, folder trees, dependency direction, where hooks/components/API code live, testing defaults, and what not to add. - Mandatory lookup workflow: Requires checking every stack in a change, researching and adding missing stack files or missing Testing sections before writing code. - Concrete guardrails: Covers exclusive-arc CHECK constraints in Postgres, multer upload limits in Express, Vitest/Playwright test placement in React, and multi-stage Dockerfiles. - Use Case: When implementing a feature that touches React, Express, and PostgreSQL, load this Skill to look up all three stack files and write code, migrations, and tests that follow recorded conventions instead of improvising a folder tree. ## Quick Start Ask the AI to load the coding-best-practices skill and follow the matching stack files before writing or changing any application code or tests.

Frequently Asked Questions about coding-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a React + Vite + TypeScript project?▼

Organize by feature under src/features/, keep shared UI in src/components/ with no domain imports, and compose screens in src/app/. Place unit and component tests in sibling __tests__/ folders using Vitest, and e2e tests in a root e2e/ folder with Playwright.

How do I model a row owned by exactly one of several parents in PostgreSQL?▼

Use an exclusive arc: one nullable foreign key per parent with ON DELETE CASCADE, plus a CHECK constraint using num_nonnulls to enforce exactly one owner. Add partial indexes WHERE the FK IS NOT NULL for list-by-parent queries, and avoid owner_type/owner_id polymorphic columns.

What testing tools should I use for a Vite React app?▼

Use Vitest for unit and component tests with jsdom and React Testing Library, placing files in sibling __tests__/ folders. Use Playwright in a root e2e/ directory for user-visible journeys, and do not add a second test framework if one already exists.

Does this skill cover stacks not listed in its index?▼

Yes. If a stack file is missing, the workflow requires researching current practice from official docs first, adding a new stack file with sources, folder tree, dependency direction, and testing guidance, then writing code against that file.

Why should Express file uploads use multer memoryStorage instead of disk?▼

When files go to object storage, memoryStorage avoids writing temp files to disk before the put call. Always cap fileSize and files limits since the default fileSize is unlimited, and handle MulterError LIMIT_FILE_SIZE with a 413 response.

When should I not create folders like hooks/, utils/, or store/?▼

Do not create empty folders for later or copy enterprise starter directories. Create src/hooks/ only when a generic shared hook exists, and add shared modules only when roughly three consumers need them.