/agent-system-management:improving-instructionsfrom agent-system-management
Audit and improve AGENTS.md and CLAUDE.md files across project and user scopes. Use when the user wants an instruction file checked, scored or fixed, or wants an overlong AGENTS.md or CLAUDE.md cut down, trimmed or shortened. To save what was learned in this session, use capturing-session-learnings instead.
Ships in agent-system-management. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Audit, evaluate, and improve agent-instruction files (AGENTS.md, CLAUDE.md, and variants) across a codebase to ensure the host agent has optimal project context.
This skill can write to agent-instruction files. After presenting a quality report and getting user approval, it updates files with targeted improvements.
| Capability | Claude Code | Codex |
|---|---|---|
| Find files | Glob / Grep | shell (find, grep) |
| Read a file | Read | shell (cat) |
| Edit a file | Edit | apply_patch / shell heredoc |
| User confirmation | AskUserQuestion | ask_user / built-in approval prompt |
| Shell commands | Bash | shell |
The skill body refers to actions abstractly ("read the file", "apply the diff"). The host agent maps to its own tool inventory.
Find every agent-instruction file in scope (project + user-global), dedupe symlinked pairs via realpath:
{
find . \( \
-name "AGENTS.md" \
-o -name "AGENTS.local.md" \
-o -name "CLAUDE.md" \
-o -name "CLAUDE.local.md" \
-o -name ".claude.md" \
-o -name ".claude.local.md" \
\) -not -path '*/node_modules/*' -not -path '*/.git/*' 2>/dev/null
ls ~/.claude/CLAUDE.md ~/.codex/AGENTS.md 2>/dev/null
} | xargs -I{} realpath {} | sort -u
File Types & Locations:
| Type | Location | Purpose |
|---|---|---|
| Project-shared | ./AGENTS.md, ./CLAUDE.md, ./.claude.md | Primary project context, in git, shared with team |
| Project-local | ./AGENTS.local.md, ./CLAUDE.local.md, ./.claude.local.md | Personal overrides, gitignored |
| User-global | ~/.claude/CLAUDE.md, ~/.codex/AGENTS.md | User-wide defaults across all projects |
| Package-specific | ./packages/*/AGENTS.md, ./packages/*/CLAUDE.md | Module-level context in monorepos |
| Subdirectory | Any nested location | Feature/domain-specific context |
Note: The host agent auto-discovers agent-instruction files in parent directories, making monorepo setups work automatically. When two paths share the same realpath (typical when CLAUDE.md is a symlink to AGENTS.md), audit them as one logical file and edit the canonical realpath target.
For each unique file, evaluate against quality criteria. See references/quality-criteria.md for detailed rubrics.
Scope-aware lens: the assessment lens shifts per scope. For project files: "is this codebase well-documented for an agent?". For user-global files: "are these rules organized, non-contradictory, at the right abstraction level, and not duplicated across projects?".
Quick Assessment Checklist:
| Criterion | Weight | Check |
|---|---|---|
| Commands/workflows documented | High | Are build/test/deploy commands present? |
| Architecture clarity | High | Can the host agent understand the codebase structure? |
| Non-obvious patterns | Medium | Are gotchas and quirks documented? |
| Conciseness | Medium | No verbose explanations or obvious info? |
| Currency | High | Does it reflect current codebase state? |
| Actionability | High | Are instructions executable, not vague? |
Quality Scores:
ALWAYS output the quality report BEFORE making any updates.
Format:
## Agents.md Quality Report
### Summary
- Files found: X (Y unique after realpath dedup)
- Average score: X/100
- Files needing update: X
### File-by-File Assessment
#### 1. ./AGENTS.md (Project-shared, also reachable as ./CLAUDE.md symlink)
**Score: XX/100 (Grade: X)**
| Criterion | Score | Notes |
|-----------|-------|-------|
| Commands/workflows | X/20 | ... |
| Architecture clarity | X/20 | ... |
| Non-obvious patterns | X/15 | ... |
| Conciseness | X/15 | ... |
| Currency | X/15 | ... |
| Actionability | X/15 | ... |
**Issues:**
- [List specific problems]
**Recommended changes:**
- [Lines to add, rewrite or remove]
#### 2. ./packages/api/AGENTS.md (Package-specific)
...
After outputting the quality report, ask user for confirmation before updating.
Update Guidelines (Critical):
Propose additions, rewrites and removals in every audit. Narrow or delete a line before adding one beside it: a stale rule, a rule a hook or CI job now enforces, or a bare "never X" that blocked real work. A caution that stays says when it applies and why. For additions (unless the user asked for a trim, see item 4), focus on genuinely useful info:
Keep it minimal: avoid:
Show diffs: for each change, show:
Trim on request: when the user asks to cut, trim or shorten a file, propose removals instead of additions:
- lines and the same Why: line; apply only after approval, as with additionsDiff Format:
### Update: ./AGENTS.md
**Why:** The build command was missing, and `make` no longer builds the project.
````diff
- Run `make` before testing.
+ ## Quick Start
+
+ ```bash
+ npm install
+ npm run dev # Start development server on port 3000
+ ```
````
After user approval, apply changes (see Platform Adaptation for the right edit tool). Preserve existing content structure. Edit the canonical realpath target only; symlinks update automatically.
See references/templates.md for templates by project type.
See references/update-guidelines.md for full do's and don'ts.
When presenting recommendations, remind users:
# key shortcut (Claude Code): during a Claude Code session, press # to have Claude auto-incorporate learnings into the project memory file*.local.md: for personal preferences not shared with team (add to .gitignore)~/.claude/CLAUDE.md or ~/.codex/AGENTS.mdCLAUDE.md → AGENTS.md so a single file serves bothKey principles:
Recommended sections (use only what's relevant):
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
3 skills in this plugin
/capturing-session-learningsSave what we learned this session into AGENTS.md or CLAUDE.md. Use when the user wants today's lessons, gotchas or commands written into an instruction file, also when worded as improving CLAUDE.md with what we learned. Triggers on /revise-agents-md and /revise-claude-md./creating-skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. Also use when the user asks to cut, trim, shorten, or de-slop a skill (a SKILL.md and its references, not an AGENTS.md or CLAUDE.md), or to make it trigger less eagerly.npx claudepluginhub pgoell/pgoell-claude-tools --plugin agent-system-management