Agent skill
claude-md-authoring
Creates and reviews CLAUDE.md configuration files for Claude Code. Applies HumanLayer guidelines including instruction budgets (~50 user-level, ~100 project-level), WHAT/WHY/HOW framework, and progressive disclosure. Identifies anti-patterns like using Claude as a linter for style rules.
Install this agent skill to your Project
npx add-skill https://github.com/ratacat/claude-skills/tree/main/skills/claude-md-authoring
SKILL.md
CLAUDE.md Authoring
Quickstart
- Determine scope: User-level (
~/.claude/) or project-level (.claude/)? - Apply WHAT/WHY/HOW framework (project-level only)
- Keep instructions under budget: ~50 for user-level, ~100 for project-level
- Never use Claude as a linter: Style rules belong in tooling, not CLAUDE.md
- Validate with quality checklist before finalizing
Core Principle
"The only thing that the model knows about your codebase is the tokens you put into it."
CLAUDE.md is the highest-leverage point for context transfer. Every instruction competes for limited attention. Include only what Claude cannot infer and must apply universally.
Scope Decision
User-Level (~/.claude/CLAUDE.md)
Applies to ALL projects. Include only:
- Personal working style preferences
- Relationship dynamics (pushback, honesty, communication)
- Universal philosophy (YAGNI, root-cause debugging)
- Proactiveness boundaries
Never include:
- Project-specific commands (build, test, lint)
- Tech stack details
- Style rules that vary by project
- Tool/framework references that don't exist everywhere
Project-Level (.claude/CLAUDE.md)
Applies to ONE project. Use the WHAT/WHY/HOW framework:
WHAT (2-5 lines)
- Project purpose in one sentence
- Primary language/framework
- Key directories and their purposes
WHY (optional, 2-3 lines)
- Non-obvious architectural decisions
- Constraints that affect implementation choices
HOW (3-7 lines)
- Essential commands: build, test, lint, run
- Any project-specific workflows
- Where to find more documentation
Instruction Budget
LLMs reliably follow ~150-200 instructions. Claude Code's system prompt uses ~50, leaving limited budget.
| Scope | Target | Maximum |
|---|---|---|
| User-level | ~30-40 | 60 |
| Project-level | ~50-80 | 120 |
| Combined | ~80-120 | 150 |
Counting instructions: Each actionable directive counts as one instruction.
- "NEVER skip tests" = 1 instruction
- "Use TypeScript for new files" = 1 instruction
- A 5-item list = 5 instructions
Anti-Pattern: Claude as Linter
❌ Never rely on Claude for style enforcement:
- Naming conventions with specific examples
- Comment formatting rules
- Whitespace/indentation requirements
- File header requirements (ABOUTME, copyright)
✓ Use deterministic tools instead:
- ESLint/Biome for JavaScript/TypeScript style
- Black/Ruff for Python formatting
- Pre-commit hooks for file headers
- Claude Code Hooks to run formatters
Why this matters: LLMs follow style rules inconsistently. A linter fails deterministically; Claude fails silently and unpredictably.
Exception: High-level philosophy is acceptable:
- ✓ "Names should describe purpose, not implementation"
- ❌ "Never use names like ZodValidator or MCPWrapper"
Progressive Disclosure
For complex guidance, don't embed everything in CLAUDE.md.
Pattern: Reference external docs, let Claude decide relevance.
## Reference Documentation
- Code conventions: See `docs/conventions.md`
- API patterns: See `docs/api-design.md`
- Testing philosophy: See `docs/testing.md`
Read these when the task involves the relevant area.
Benefits:
- Keeps CLAUDE.md focused
- Claude reads docs only when relevant
- Easier to maintain separate concerns
Structure Template
User-Level
[Opening persona/philosophy - 1-2 lines]
## Working Together
[Relationship dynamics, communication preferences]
## Proactiveness
[When to proceed vs. pause for confirmation]
## Development Philosophy
[Universal principles: YAGNI, debugging approach, etc.]
## Guardrails
[Version control, testing principles - kept brief]
Project-Level
## Project Overview
[WHAT: Purpose, stack, structure]
## Development
[HOW: Build, test, lint commands]
## Architecture
[WHY: Key decisions, constraints - if non-obvious]
## Conventions
[Brief pointers to detailed docs if needed]
Quality Checklist
Before finalizing, verify:
Universal Applicability
- Every instruction applies to every session (user-level) or every task in project (project-level)
- No project-specific commands in user-level config
- No tool references that may not exist
Instruction Economy
- Under instruction budget (count them)
- No redundancy with Claude Code's built-in behaviors
- Examples trimmed or moved to reference docs
No LLM-as-Linter
- No specific naming convention examples
- No comment formatting rules
- No file header requirements
- Style guidance limited to philosophy, not specifics
Progressive Disclosure
- Complex topics reference external docs
- Main file under 100 lines (user) or 150 lines (project)
- Examples in reference files, not inline
Clarity
- Consistent heading hierarchy
- No conflicting instructions
- Actionable directives, not vague guidance
Common Pitfalls
- Over-specification: Including every preference instead of universally critical ones
- Style enforcement: Detailed naming/comment rules that Claude follows inconsistently
- Stale commands: Build/test commands that drift from actual tooling
- Auto-generation: Using
/initinstead of hand-crafting - Tool assumptions: Referencing MCP servers or tools that aren't always available
- Conflicting rules: "Match surrounding style" + "Never use X pattern"
- Instruction inflation: Adding rules after each frustration instead of fixing root cause
When to Skip This Skill
- Quick one-off projects (just use defaults)
- Projects with existing, well-maintained CLAUDE.md
- When the team already has established patterns
Example: Before/After
Before (problematic user-level):
## Naming
NEVER use names like ZodValidator, MCPWrapper, JSONParser...
[20 more lines of specific examples]
## Comments
All files MUST start with ABOUTME: header...
After (improved user-level):
## Code Style
Names should describe purpose, not implementation details.
Use project linters for formatting; don't rely on manual enforcement.
Why better: Philosophy over specifics. Linter handles enforcement deterministically.
Integration
After authoring CLAUDE.md:
- User-level: Symlink to
~/.claude/CLAUDE.mdor place directly - Project-level: Commit to
.claude/CLAUDE.mdin repository root - Validation: Start a new Claude Code session and observe if instructions are followed
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
brave-search
Use when user asks to search the web, look something up online, find current/recent/latest information, or needs cited answers. Triggers on "search", "look up", "find out about", "what is the current/latest", image searches, news lookups. NOT for searching code/files—only for web/internet searches.
bug-reproduction-validator
Use this agent when you receive a bug report or issue description and need to verify whether the reported behavior is actually a bug. This agent will attempt to reproduce the issue systematically, validate the steps to reproduce, and confirm whether the behavior deviates from expected functionality. <example>\nContext: The user has reported a potential bug in the application.\nuser: "Users are reporting that the email processing fails when there are special characters in the subject line"\nassistant: "I'll use the bug-reproduction-validator agent to verify if this is an actual bug by attempting to reproduce it"\n<commentary>\nSince there's a bug report about email processing with special characters, use the bug-reproduction-validator agent to systematically reproduce and validate the issue.\n</commentary>\n</example>\n<example>\nContext: An issue has been raised about unexpected behavior.\nuser: "There's a report that the brief summary isn't including all emails from today"\nassistant: "Let me launch the b...
agent-native-audit
Run comprehensive agent-native architecture review with scored principles
brainstorming
This skill should be used before implementing features, building components, or making changes. It guides exploring user intent, approaches, and design decisions before planning. Triggers on "let's brainstorm", "help me think through", "what should we build", "explore approaches", ambiguous feature requests, or when the user's request has multiple valid interpretations that need clarification.
performance-oracle
Use this agent when you need to analyze code for performance issues, optimize algorithms, identify bottlenecks, or ensure scalability. This includes reviewing database queries, memory usage, caching strategies, and overall system performance. The agent should be invoked after implementing features or when performance concerns arise.\n\n<example>\nContext: The user has just implemented a new feature that processes user data.\nuser: "I've implemented the user analytics feature. Can you check if it will scale?"\nassistant: "I'll use the performance-oracle agent to analyze the scalability and performance characteristics of your implementation."\n<commentary>\nSince the user is concerned about scalability, use the Task tool to launch the performance-oracle agent to analyze the code for performance issues.\n</commentary>\n</example>\n\n<example>\nContext: The user is experiencing slow API responses.\nuser: "The API endpoint for fetching reports is taking over 2 seconds to respond"\nassistant: "Let me invoke the...
triage
Triage and categorize findings for the CLI todo system
Didn't find tool you were looking for?