From claude-md-improver
USE WHEN: check/audit/update/improve/fix CLAUDE.md or AGENTS.md, CLAUDE.md maintenance, AGENTS.md review, project memory optimization, agent documentation. Audits agent instruction files against modern harness engineering principles (leanness, discoverability, anti-staleness), then applies targeted improvements after approval.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-md-improver:claude-md-improverThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Audit, evaluate, and improve agent instruction files (CLAUDE.md, AGENTS.md) using modern harness engineering principles. Also detects fast-moving frameworks (Next.js, Tailwind, React 19, etc.) and recommends training-cutoff-honesty blocks that point agents to local package docs.
Audit, evaluate, and improve agent instruction files (CLAUDE.md, AGENTS.md) using modern harness engineering principles. Also detects fast-moving frameworks (Next.js, Tailwind, React 19, etc.) and recommends training-cutoff-honesty blocks that point agents to local package docs.
This skill can write to instruction files. After presenting a quality report and getting user approval, it updates files with targeted improvements.
Research from OpenAI's harness engineering team (1M+ lines shipped by agents) and analysis of 2,500+ repositories established clear principles:
The ideal instruction file is ~100-150 lines serving as a table of contents with pointers to deeper sources of truth. It tells agents how this project thinks, not what every file contains.
Before assessment, establish the repository's work-tracking authority. Agents need to know where work actually lives so the instruction file can point there instead of inventing a local task workflow.
Prefer existing repo evidence before asking the user:
docs/agents/issue-tracker.mddocs/agents/workflow.mdAGENTS.md / CLAUDE.mdgit remote -vgh repo view --json nameWithOwner,url (if gh is available)gh project list --owner <owner> --limit 20 (if the project uses GitHub Projects)Ask the user only when the primary tracker is missing or ambiguous from repo evidence. Respect whatever the repo declares as authoritative: do not impose a tracker the project doesn't use. Capture:
Format for instruction-file injection (when applicable):
## Project Tracking
- Primary tracker: <system> (<url>)
- Board / Project: <owner/number-or-title> (<url>)
- Mirror: <secondary tool> receives a one-way sync for visibility only; do not file or update work there unless explicitly asked.
Omit any line you can't confirm: empty pointers (TBD, none, blank
placeholders) are noise. If there is no board, omit the Board line. If there is
no mirror, omit the Mirror line entirely.
Do not proceed to Phase 1 until the primary tracker is captured or explicitly declined.
Find all instruction files in the repository:
fd -t f '(CLAUDE|AGENTS|\.claude)\.md$' --exclude node_modules | head -50
Also check for .claude.local.md files.
File Types & Locations:
| Type | Location | Purpose |
|---|---|---|
| Project root | ./CLAUDE.md or ./AGENTS.md | Primary agent context (checked into git, shared with team) |
| Local overrides | ./.claude.local.md | Personal/local settings (gitignored, not shared) |
| Global defaults | ~/.claude/CLAUDE.md | User-wide defaults across all projects |
| Subsystem-specific | ./packages/*/CLAUDE.md | Module-level context in monorepos (keep these minimal) |
Claude auto-discovers instruction files in parent directories.
Also read the root package.json to detect fast-moving frameworks. Check dependencies and devDependencies for: next, tailwindcss, react, react-router, @remix-run/*, astro, @sveltejs/kit, drizzle-orm, vite. Also check for components.json or a components/ui/ directory (shadcn/ui detection). Record which fast-moving frameworks are present, for use in the Phase 3 report and Phase 4 updates. See references/training-cutoff-honesty.md for the full detection heuristic.
Evaluate each file against quality criteria. See references/quality-criteria.md for detailed rubrics.
Quick Assessment, the Six Questions:
| Question | Weight | What to check |
|---|---|---|
| Does it teach how the project thinks? | Critical | Architectural intent, conventions, constraints, why-not-just rationale |
| Is volatile data absent? | Critical | No hardcoded counts, no duplicating package.json scripts, no directory listings that will drift |
| Is it lean enough? | High | Under ~150 lines? Every line earning its place? No filler? |
| Does it surface non-obvious gotchas? | High | Concrete past failures, workarounds, edge cases agents would hit |
| Does it point rather than repeat? | Medium | References to docs/, config files, or code rather than restating their contents |
| Is it failure-driven? | Medium | Each item addresses a concrete agent or developer mistake, not theoretical advice |
Quality Grades:
ALWAYS output the quality report BEFORE making any updates.
## Agent Instruction File Quality Report
### Summary
- Files found: X
- Average score: X/100
- Primary concern: [leanness | staleness | missing intent | etc.]
### File-by-File Assessment
#### 1. ./CLAUDE.md (Project Root)
**Score: XX/100 (Grade: X) | ~N lines**
| Criterion | Score | Notes |
|-----------|-------|-------|
| Project intent & conventions | X/25 | ... |
| Anti-staleness | X/25 | ... |
| Leanness | X/20 | ... |
| Non-obvious gotchas | X/15 | ... |
| Discoverability & pointers | X/15 | ... |
**Staleness risks:**
- [Lines that WILL go stale and should be removed or made discoverable]
**Missing signal:**
- [Non-obvious knowledge that would prevent agent failures]
**Recommended cuts:**
- [Content that duplicates discoverable information]
### Training Cutoff Honesty
- Detected fast-moving frameworks: [list or "none"]
- Training cutoff block present in CLAUDE.md/AGENTS.md: [yes/no]
- Recommendation: [add block | already present | n/a]
### Work Tracking
- Primary tracker (Phase 0 capture): [system of record | "user declined"]
- Repo: [owner/name + URL | "unknown"]
- Board / Project: [owner/number/title + URL | "none confirmed"]
- Mirror / sync: [secondary tool one-way sync | "none confirmed" | "not applicable"]
- Project Tracking block present in CLAUDE.md/AGENTS.md: [yes/no]
- Recommendation: [add/update block | already present | n/a (user declined)]
After outputting the quality report, ask user for confirmation before updating.
The Three Update Types:
Cut: Remove content that duplicates discoverable info or will go stale
Point: Replace verbose content with pointers to source of truth
.env.example"docs/ARCHITECTURE.md for system design"cat package.json | jq .scripts for all available commands"Add: Inject knowledge agents can't infer from code alone
## Project Tracking block so future agents know which tracker and board are the primary work hub.references/training-cutoff-honesty.md), insert a block acknowledging the model's training cutoff and pointing to local package docs. This prevents the agent from inventing outdated APIs.Show diffs for each change with rationale.
After user approval, apply changes using the Edit tool. Preserve existing content structure.
YES, agents can't infer this:
docs/agents/:
docs/agents/issue-tracker.md, docs/agents/workflow.md,
docs/agents/triage-labels.md, and docs/agents/domain.md.NO, agents can discover this themselves:
Trigger this recommendation when ANY of these are true:
Recommend the layered approach from OpenAI's harness engineering:
CLAUDE.md <- lean index (~100 lines): intent, conventions, gotchas, pointers
docs/
├── ARCHITECTURE.md <- system design, domain map
├── CONVENTIONS.md <- code style, patterns, naming
├── WORKFLOWS.md <- development workflows, CI/CD
├── agents/ <- issue tracker, project board, triage, context docs
└── references/ <- external docs reformatted for agents
The root file becomes a table of contents. Agents read only the docs they need for the current task.
See references/templates.md for instruction file templates by project type.
See references/update-guidelines.md for detailed guidance on what to add, cut, and point.
See references/training-cutoff-honesty.md for detection heuristics and template blocks.
# key shortcut: During a Claude session, press # to auto-incorporate learnings into CLAUDE.md.claude.local.md: For personal preferences not shared with teamGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.
Dispatches multiple subagents concurrently for independent tasks without shared state. Use when facing 2+ unrelated failures or subsystems that can be investigated in parallel.
npx claudepluginhub aojdevstudio/agentic-utilities --plugin claude-md-improver