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
- Distinctive: line 25
Every CLAUDE.md should contain these sections in order:
- Distinctive: line 56
Keep it concise. List only primary technologies, not every dependency.
- Distinctive: line 116
Document non-obvious behaviors and common pitfalls.
“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.
Files
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
## GotchasSection: 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 namesInclude 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 Size | Target Lines | Target 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
Other versions17 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 17
- loulanyue/awesome-claude-notes★ 272same name
- cloudnative-co/claude-code-starter-kit★ 153same name
- xfstudio/skills★ 9same name
- Lukasbrujula/claude-code-framework★ 4same name
- XD3an/cc-plus★ 4same name
- PatriotAgenticLLC/better_claude_skillz★ 3same name
- junimnjw/everything-claude-code★ 1same name
- mstuder-slalom/everything-claude-code★ 1same name
- royaluniondesign-sys/claude-os★ 1same name
- TironFox/everything-claude-code★ 1same name
7 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use configure-ecc, ralphinho-rfc-pipeline and 5 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
royaluniondesign-sysSkillconfigure-ecc
Interactive installer for Everything Claude Code — guides users through selecting and installing skills and rules to user-level or project-level directories, verifies paths, and optionally optimizes installed files.
Also in 7 projects that use this
junimnjwSkillralphinho-rfc-pipeline
RFC-driven multi-agent DAG execution pattern with quality gates, merge queues, and work unit orchestration.
Also in 6 projects that use this
junimnjwSkillcarrier-relationship-management
Codified expertise for managing carrier portfolios, negotiating freight rates, tracking carrier performance, allocating freight, and maintaining strategic carrier relationships. Informed by transportation managers with 15+ years experience. Includes scorecarding frameworks, RFP processes, market intelligence, and compliance vetting. Use when managing carriers, negotiating rates, evaluating carrier performance, or building freight strategies.
Also in 5 projects that use this
royaluniondesign-sysSkillcontent-hash-cache-pattern
Cache expensive file processing results using SHA-256 content hashes — path-independent, auto-invalidating, with service layer separation.
Also in 7 projects that use this
loulanyueSkillnuxt4-patterns
Nuxt 4 app patterns for hydration safety, performance, route rules, lazy loading, and SSR-safe data fetching with useFetch and useAsyncData.
Also in 4 projects that use this
mstuder-slalomSkilljpa-patterns
JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot.
Also in 8 projects that use this
- +1 more from royaluniondesign-sys
In this repository72 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- api-designerSkill
- backend-patternsSkill
- code-reviewerSkill
- debugging-assistantSkill
- golang-testingSkill
- python-testingSkill
- refactoring-guideSkill
- spec-driven-developmentSkill
- tdd-workflowSkill
- verification-loopSkill
- update-docsSkill
- api-docsSkill
- changelog-writerSkill
- readme-generatorSkill
- django-patternsSkill
- django-securitySkill
- django-tddSkill
- django-verificationSkill
- fastapi-patternsSkill
- nextjs-patternsSkill
- react-patternsSkill
- springboot-patternsSkill
- springboot-securitySkill
- springboot-tddSkill
- branch-strategySkill
- changelogSkill
- commit-helperSkill
- pr-creatorSkill
- prSkill
- evolveSkill
- instinct-exportSkill
- instinct-importSkill
- instinct-statusSkill
- cleanupSkill
- lint-fixSkill
- refactor-cleanSkill
- update-depsSkill
- continuous-learningSkill
- continuous-learning-v2Skill
- eval-harnessSkill
- iterative-retrievalSkill
- strategic-compactSkill
- golang-patternsSkill
- python-patternsSkill
- rust-patternsSkill
- typescript-patternsSkill
- accessibility-checkerSkill
- build-fixSkill
- code-reviewSkill
- e2eSkill
- performance-reviewerSkill
- security-auditorSkill
- security-reviewSkill
- test-coverageSkill
- checkpointSkill
- deploySkill
- evalSkill
- The first 60 shown.
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.

