agentleFS
kienbui1995kienbui1995/magic-powers/skills/claude-md-authoring/SKILL.md

claude-md-authoring

Skill0 starsChanged 8 months agoMITView on GitHub

Use when writing or improving CLAUDE.md files — project context that Claude Code reads every session, global vs project rules, what to include for maximum AI effectiveness, and memory-aware documentation patterns.

  • Reads credentials

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Update CLAUDE.md as the project evolves:

    line 93
  2. Distinctive:

    After major architectural decisions: document the "why"

    line 94
  3. Distinctive:

    After Claude makes a repeated mistake: add a "Do Not" rule

    line 95
  4. Distinctive:

    After onboarding: add what was confusing (to help future Claude sessions)

    line 96
  5. Distinctive:

    Before a sprint: add "Current Focus" section

    line 97
  6. Very specific:

    Use with claude-project-settings for complete Claude Code configuration

    line 135
  7. Very specific:

    Use with claude-hooks (document hook behaviors in CLAUDE.md so team understands them)

    line 136

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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.

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

CLAUDE.md Authoring

Overview

CLAUDE.md is the most powerful lever for making Claude Code effective on your project. It's read at the start of every session — think of it as the briefing document Claude reads before doing any work. A well-written CLAUDE.md means Claude follows your conventions without being asked, and a missing or stale one means Claude reinvents conventions every session.

When to Use

  • Starting a new project and want Claude Code to understand context from day 1
  • Claude keeps asking the same questions or making the same mistakes
  • Onboarding Claude Code to an existing codebase
  • Wanting Claude to follow specific conventions consistently

Core Jobs

1. CLAUDE.md Hierarchy

Claude Code reads files in priority order:

1. ~/.claude/CLAUDE.md          (global — applies to all projects)
2. /project/CLAUDE.md           (project root — main project context)
3. /project/subdir/CLAUDE.md    (subdirectory — specific area rules)

Higher priority overrides lower. Use global for personal preferences, project for team conventions.

2. What to Put in CLAUDE.md

High-value content:

# Project: [Name]

## What This Is
[2-3 sentences: what the project does, who uses it, tech stack]

## Architecture
[Key architectural decisions Claude should know: monorepo, microservices, etc.]
- API: FastAPI on port 8000, PostgreSQL via SQLAlchemy
- Frontend: Next.js 14 App Router, Tailwind CSS, shadcn/ui
- Auth: Clerk (not custom auth — never implement auth yourself)

## Conventions
- Python: use `ruff` for formatting, type hints required on all functions
- Commits: conventional commits (feat:, fix:, chore:)
- Never use print() — always use the logger: `from app.core.logger import logger`

## Do Not
- Never modify migrations directly — always use `alembic revision --autogenerate`
- Never commit .env files
- Never use synchronous DB calls in async functions

## Current Focus
[Optional: what's being built right now, context for current sprint]

Low-value content (don't include):

  • File-by-file documentation (Claude reads the code)
  • Obvious conventions (PEP8, etc.)
  • History of decisions (use ADRs for that)
  • Todo lists (use task management tools)

3. Global CLAUDE.md (~/.claude/CLAUDE.md)

Personal preferences that apply across all projects:

## My Preferences
- I'm [role] working primarily in [languages]
- Communication style: concise, direct, minimal explanation unless asked
- When in doubt, ask before making large changes
- Always run tests before declaring done

## Tools I Use
- Package manager: uv (Python), pnpm (Node)
- Formatter: ruff (Python), prettier (JS/TS)
- Testing: pytest (Python), vitest (JS/TS)

## Workflow
- Read existing code patterns before suggesting new approaches
- Prefer editing existing files over creating new ones
- Commit frequently with conventional commit messages

4. Dynamic CLAUDE.md Updates

Update CLAUDE.md as the project evolves:

  • After major architectural decisions: document the "why"
  • After Claude makes a repeated mistake: add a "Do Not" rule
  • After onboarding: add what was confusing (to help future Claude sessions)
  • Before a sprint: add "Current Focus" section

Key Concepts

  • CLAUDE.md — markdown file Claude Code reads at session start for project context
  • Global CLAUDE.md — ~/.claude/CLAUDE.md — personal preferences across all projects
  • Project CLAUDE.md — /project/CLAUDE.md — shared team conventions
  • Subdirectory CLAUDE.md — /subdir/CLAUDE.md — area-specific rules (e.g., /frontend/CLAUDE.md)

Checklist

  • Project CLAUDE.md exists in repo root?
  • Tech stack and key dependencies documented?
  • Critical "Do Not" rules added (the things Claude gets wrong)?
  • Current focus/sprint context updated (not stale)?
  • Global CLAUDE.md configured with personal preferences?
  • Conventions documented with examples (not just rules)?

Key Outputs

  • Project CLAUDE.md: architecture, conventions, do-nots, current focus
  • Global CLAUDE.md: personal preferences, tools, workflow style

Output Format

  • 🔴 Critical — no CLAUDE.md (Claude reinvents conventions each session), CLAUDE.md outdated by months
  • 🟡 Warning — CLAUDE.md too generic (no project-specific content), missing "Do Not" rules for known pitfalls
  • 🟢 Suggestion — add subdirectory CLAUDE.md for complex areas (frontend/, api/), update "Current Focus" weekly

Anti-Patterns

  • Copying generic CLAUDE.md templates without project-specific content
  • Documenting things Claude can read from the code (file structure, imports)
  • "Current Focus" section that's 3 months old (stale context is worse than no context)
  • No "Do Not" section (the most valuable part — captures hard-learned lessons)

Integration

  • Use with claude-project-settings for complete Claude Code configuration
  • Use with claude-hooks (document hook behaviors in CLAUDE.md so team understands them)
  • Agent: @architect helps write the architecture section of CLAUDE.md

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.

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.