claude-md-writer
Skill243 starsChanged 3 months agoMITView on GitHub
Use when creating or refactoring CLAUDE.md files - enforces best practices for size, structure, and content organization
2 other projects use a version of this.
Adopted by
Most recently taken up by
- OneWave-AI/claude-skillstheir own version, first seen Sep 21, 2026
- serejaris/personal-corp-osword for word, first seen Aug 6, 2026
Other versions2 projects use a version of this.
Word for word · 1
- serejaris/personal-corp-os★ 243100% same
Edited · 0
None found.
Wrote their own version · 1
- OneWave-AI/claude-skills★ 378same name
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.
In this repository31 other files it gives its agents.
- AGENTS.mdAGENTS.md
- art-directorSkill
- audit-agent-rulesSkill
- avatarSkill
- benchmarkSkill
- cc-analyticsSkill
- ceo-councilSkill
- claude-sessions-syncSkill
- corp-doctorSkill
- corp-newSkill
- dailySkill
- fable-ruki-agentySkill
- gh-issuesSkill
- grill-meSkill
- harnessSkill
- html-draftSkill
- ideaSkill
- it-ram-doctorSkill
- make-3dSkill
- make-landingSkill
- managerSkill
- meeting-copilotSkill
- readme-generatorSkill
- retroSkill
- safe-public-releaseSkill
- sdlc-milestonesSkill
- tg-bot-opsSkill
- to-issuesSkill
- to-prdSkill
- weekly-planningSkill
- weekly-retroSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 34
Use /memory command to see currently loaded files.
- Distinctive: line 101
Use YAML frontmatter for file-type-specific rules:
- Very specific: line 139
Run /init for base CLAUDE.md
- Very specific: line 142
Create .claude/rules/ for domain-specific docs
- Distinctive: line 143
Keep main file < 100 lines
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md Writer
Creates and refactors CLAUDE.md files following official Anthropic best practices (2025).
Golden Rules
| Rule | Why |
| CLAUDE.md < 200 lines | Loads on EVERY request, costs tokens |
| Rules files < 500 lines each | Official recommendation per file |
| Critical rules FIRST | Top = highest priority |
Modular rules → .claude/rules/ | Conditional loading, organized |
Use paths: frontmatter | Load rules only for matching files |
| No linting rules | Use ESLint/Prettier/Biome instead |
| Pointers over copies | Files change, references stay valid |
Memory Hierarchy
Claude Code loads memory in this order (higher = higher priority):
| Priority | Type | Location |
| Highest | Enterprise | /Library/Application Support/ClaudeCode/CLAUDE.md |
| ↓ | Project | ./CLAUDE.md or ./.claude/CLAUDE.md |
| ↓ | Rules | ./.claude/rules/*.md (conditional) |
| ↓ | User | ~/.claude/CLAUDE.md |
| Lowest | Local | ./CLAUDE.local.md (gitignored) |
Use /memory command to see currently loaded files.
3-Tier Documentation System
Official recommendation for large projects:
| Tier | Location | Loads | Target |
| 1. Foundation | CLAUDE.md | Always | < 200 lines |
| 2. Component | .claude/rules/{component}/ | When working in component | < 500 lines |
| 3. Feature | Co-located with code | When working on feature | As needed |
Example structure:
.claude/
├── CLAUDE.md # Tier 1: always loaded
└── rules/
├── database.md # Tier 2: SQL, migrations
├── api.md # Tier 2: API patterns
└── frontend/ # Tier 2: subdirectory
├── components.md # paths: src/**/*.tsx
├── layout.md # paths: src/pages/**/*.tsx
└── tokens.md # paths: **/*.tsxStructure Template
# Project Name
One-line description.
## Commands
- `npm run dev` - Development
- `npm run build` - Production
- `npm run test` - Tests
## Architecture
| Path | Purpose |
|------|---------|
| `lib/` | Core logic |
| `app/api/` | API routes |
## Key Patterns
**Pattern Name**: One-line explanation.
## Database (if applicable)
| Table | Key Fields |
|-------|------------|
## Modular Docs
See `.claude/rules/` for:
- `database.md` - queries, schema
- `deploy.md` - deployment
## Tech Stack
One line: Next.js 15, PostgreSQL, TypeScriptConditional Rules (Path-Specific)
Use YAML frontmatter for file-type-specific rules:
---
paths: "src/api/**/*.ts"
---
# API Rules
- All endpoints must validate input
- Use standard error formatGlob Patterns
| Pattern | Matches |
**/*.ts | All .ts files anywhere |
src/**/* | All files under src/ |
*.md | Markdown in project root |
src/components/*.tsx | Components in specific dir |
Combining Patterns
# Multiple extensions
paths: "src/**/*.{ts,tsx}"
# Multiple directories
paths: "{src,lib}/**/*.ts, tests/**/*.test.ts"Note: Wrap patterns in quotes for YAML safety.
Rules with paths: only load when working with matching files → saves tokens.
Workflow: New Project
- Run
/initfor base CLAUDE.md - Review and trim generated content
- Identify critical rules — what breaks if ignored?
- Create
.claude/rules/for domain-specific docs - Keep main file < 100 lines
Workflow: Refactor Existing
- Count lines — if > 300, must split
- Find task-specific content — SQL, debugging, deploy → extract
- Create
.claude/rules/:database.md- queries, schema, connectiondeploy.md- deployment processmessaging.md- integrations (Telegram, etc.)
- Use
@filereferences — don't duplicate - Keep in CLAUDE.md — only what applies to EVERY task
What Goes Where
| Content | Location |
| Project description | CLAUDE.md |
| Critical constraints | CLAUDE.md (top!) |
| Quick start (3 commands) | CLAUDE.md |
| Architecture overview | CLAUDE.md |
| Key patterns (1-liners) | CLAUDE.md |
| SQL queries/schema | .claude/rules/database.md |
| Deployment steps | .claude/rules/deploy.md |
| API documentation | .claude/rules/api.md |
| Git workflow | .claude/rules/git.md |
| Personal preferences | CLAUDE.local.md (gitignored) |
| Code style rules | .eslintrc / biome.json (NOT docs) |
Import Syntax
Reference files instead of duplicating:
@README.md
@docs/architecture.md
@~/.claude/snippets/common.md- Relative:
@docs/file.md - Absolute:
@~/path/file.md - Max depth: 5 hops
CLAUDE.local.md
Personal project settings (auto-gitignored):
# My Local Settings
- Prefer verbose output
- Run tests after every change
- My worktree location: .trees/Common Mistakes
| Mistake | Fix |
| 500+ lines | Split into .claude/rules/ |
| SQL examples inline | → rules/database.md |
| "Run prettier" rules | Use tool config files |
| Full API docs | → rules/api.md |
| Deployment instructions | → rules/deploy.md |
| Code in CLAUDE.md | Use @file:line references |
| Negative rules only | Add alternatives: "Don't X; use Y instead" |
Quality Checklist
Before finishing:
- CLAUDE.md < 200 lines?
- Each rules file < 500 lines?
- Critical rules at top?
- No task-specific content in main file?
- No code style rules (use ESLint/Prettier)?
.claude/rules/for domain-specific docs?- Subdirectories for components (frontend/, backend/)?
paths:frontmatter for conditional loading?@references instead of duplication?- CLAUDE.local.md for personal prefs?
Useful Commands
| Command | Purpose |
/init | Generate initial CLAUDE.md |
/memory | View loaded memory files |
Sources
Official:
- code.claude.com/docs/en/memory (Memory management, paths, globs)
- anthropic.com/engineering/claude-code-best-practices
- claude.com/blog/using-claude-md-files
Community:
- thedocumentation.org/claude-code-development-kit (3-Tier System)
- claudefa.st/blog/guide/mechanics/rules-directory
- humanlayer.dev/blog/writing-a-good-claude-md
Updated: Jan 2026
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

