agentleFS
peopleforresterpeopleforrester/claude-dotfiles/skills/development/project-guidelines-example/SKILL.md

project-guidelines-example

Skill3 starsChanged 7 months agoMITView on GitHub

Reference template for creating project-specific CLAUDE.md files. Shows how to structure project guidelines with stack info, commands, directory structure, code standards, and gotchas sections for optimal Claude usage.

We split this skill into the rules it gives an agent

3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 16 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every CLAUDE.md should contain these sections in order:

    line 25
  2. Distinctive:

    Keep it concise. List only primary technologies, not every dependency.

    line 56
  3. Distinctive:

    Document non-obvious behaviors and common pitfalls.

    line 116

“Common” is measured: kept by at least 6 in 10 of the 16 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Project Guidelines Example

A reference for crafting effective project-level CLAUDE.md files.

Template Structure

Every CLAUDE.md should contain these sections in order:

<!-- Tokens: ~X | Lines: Y | Compatibility: Claude Code 2.1+ -->
# Project Name

Brief one-line description of what this project does.

## Stack
## Commands
## Key Directories
## Code Standards
## Gotchas

Section: Stack

Define the technology choices upfront so Claude knows the ecosystem.

## Stack

- **Language**: TypeScript 5.x (strict mode)
- **Runtime**: Node.js 20 LTS
- **Framework**: Next.js 14 (App Router)
- **Database**: PostgreSQL 16 via Prisma ORM
- **Testing**: Vitest + Testing Library + Playwright
- **Package Manager**: pnpm
- **Deployment**: Vercel (production), Railway (staging)

Keep it concise. List only primary technologies, not every dependency.

Section: Commands

List the commands Claude will need most often.

## Commands

| Command | Purpose |
|---------|---------|
| `pnpm dev` | Start development server |
| `pnpm test` | Run unit tests |
| `pnpm test:e2e` | Run Playwright E2E tests |
| `pnpm lint` | Lint with ESLint + Prettier |
| `pnpm typecheck` | TypeScript type checking |
| `pnpm db:migrate` | Run Prisma migrations |
| `pnpm db:seed` | Seed development database |

Include database, deployment, and CI commands if relevant.

Section: Key Directories

Help Claude navigate the codebase.

## Key Directories

| Path | Purpose |
|------|---------|
| `src/app/` | Next.js App Router pages and layouts |
| `src/components/` | Shared React components |
| `src/lib/` | Utility functions and shared logic |
| `src/server/` | Server-side code (API routes, services) |
| `src/server/db/` | Prisma schema and migrations |
| `tests/` | Test files mirroring src/ structure |
| `e2e/` | Playwright E2E test specs |

Section: Code Standards

Define patterns Claude should follow.

## Code Standards

- All files start with a 2-line `// ABOUTME:` comment
- Use `const` by default, `let` only when reassignment is needed
- Prefer named exports over default exports
- Error handling: explicit try/catch, no silent swallowing
- Database queries go in `src/server/services/`, never in components
- API responses use `{ data, error, meta }` envelope pattern
- Tests follow Arrange-Act-Assert pattern with descriptive names

Include only project-specific rules. Generic best practices are handled by rules.

Section: Gotchas

Document non-obvious behaviors and common pitfalls.

## Gotchas

- `pnpm test` requires PostgreSQL running locally (`docker compose up db`)
- The `NEXT_PUBLIC_` prefix is required for client-side env vars
- Prisma Client must be regenerated after schema changes (`pnpm db:generate`)
- E2E tests require `pnpm build` first (tests against production build)
- The `/api/webhooks/` routes bypass auth middleware intentionally
- File uploads go to S3, not local filesystem (even in development)

Anti-Patterns to Avoid

Too verbose (wastes tokens)

## Stack
We use TypeScript because it provides type safety which helps catch bugs
at compile time. Our team decided on Next.js 14 after evaluating several
frameworks including Remix and SvelteKit...

Too vague (not actionable)

## Commands
Use the standard commands for development.

Duplicating language rules

## Code Standards
- Use camelCase for variables (already in rules/typescript/coding-style.md)
- Write tests for all code (already in rules/common/testing.md)

Token Budget Guidelines

Project SizeTarget LinesTarget Tokens
Small (1-5 files)30-50~500
Medium (5-50 files)60-100~1,000
Large (50+ files)80-150~1,500

Claude reads CLAUDE.md on every message. Keep it under 150 lines.

Combining with Rules

Project CLAUDE.md should complement, not duplicate, rules:

~/.claude/rules/         <- Global coding standards (shared across projects)
.claude/rules/           <- Project-specific rules (e.g., this API always returns JSON)
CLAUDE.md                <- Project context (stack, commands, structure, gotchas)

Checklist

  • Token count documented in header comment
  • Stack section lists primary technologies only
  • Commands section includes all common development tasks
  • Key Directories maps the most-used paths
  • Code Standards covers project-specific patterns only
  • Gotchas documents non-obvious behaviors
  • Total file under 150 lines
  • No duplication with global rules

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.