/nlsmdn:improve-agent-instructionsfrom nlsmdn
Audit and improve the always-loaded agent instruction files (AGENTS.md, CLAUDE.md, GEMINI.md). Triggers "check/audit/update/improve/fix/revise CLAUDE.md or AGENTS.md", "project memory optimization", "trim my instruction file". Not for general docs.
Ships in nlsmdn. 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 the instruction files that load into every agent session —
AGENTS.md, CLAUDE.md, GEMINI.md, and their package-level equivalents. Can also capture
session learnings into them.
The governing idea: this file is a permanent, per-session token cost paid by every agent
that reads it. Keep it lightweight, spend most of its budget on gotchas, and push depth
behind pointers (skills, docs/) that load only when relevant. Restating what the agent can
see for itself — the directory tree, the dependency list, the catalog of available skills —
costs tokens in every session and buys nothing.
~/.claude/ is symlinked — changes to the global instruction file here affect all projects. Warn about cross-project impact before proposing changes to a committed, shared file.AGENTS.md is read by Codex, Pi and OpenCode; CLAUDE.md by Claude Code. Advice that leans on one tool's specific mechanisms doesn't belong in the shared file. Prefer AGENTS.md as canonical with CLAUDE.md a one-line @AGENTS.md bridge.Find all instruction files:
find . \( -name "AGENTS.md" -o -name "CLAUDE.md" -o -name "GEMINI.md" -o -name ".claude.local.md" \) 2>/dev/null | head -50
Also check ~/.claude/CLAUDE.md and ~/.codex/AGENTS.md for global defaults — they matter
because project rules that merely repeat a global rule are pure duplication.
| Type | Location | Purpose |
|---|---|---|
| Project root (canonical) | ./AGENTS.md | Primary context, read by every harness |
| Claude bridge | ./CLAUDE.md | Ideally one line: @AGENTS.md (+ Claude-only overrides) |
| Local overrides | ./.claude.local.md | Personal settings (gitignored) |
| Global defaults | ~/.claude/CLAUDE.md, ~/.codex/AGENTS.md | User-wide defaults |
| Package-specific | ./packages/*/AGENTS.md | Module-level context in monorepos |
Evaluate each file against six criteria (see references/quality-criteria.md for detailed rubrics):
| Criterion | Weight | What to check |
|---|---|---|
| Gotchas & non-obvious knowledge | 25pts | Quirks, footguns, invariants — what can't be read off the repo? |
| Commands & divergent conventions | 20pts | Build/test/deploy present? Conventions that actually differ from tool defaults? |
| Non-derivable & non-duplicated | 20pts | Directory trees, dependency lists, skill/tool catalogs, rules repeated from the global file? |
| Progressive disclosure | 15pts | Are long procedures extracted into skills/docs/ and referenced, or inlined? |
| Currency | 10pts | Reflects current codebase? |
| Internal consistency | 10pts | Any rule contradicting another rule or the tool's own defaults? |
Grades: A (90-100), B (70-89), C (50-69), D (30-49), F (0-29).
Cross-reference with the actual codebase: check that referenced files exist, that commands would work, and that described behavior matches the code.
Also record the line count — the target is roughly <200 lines. Over that, the finding is usually "extract into skills/docs", not "write more tersely".
Always output the report BEFORE making changes. Format:
## CLAUDE.md Quality Report
### Summary
- Files found: X
- Average score: X/100
- Files needing update: X
### File-by-File Assessment
#### 1. ./AGENTS.md (Project Root) — NNN lines
**Score: XX/100 (Grade: X)**
| Criterion | Score | Notes |
|-----------|-------|-------|
| Gotchas & non-obvious knowledge | X/25 | ... |
| ... | ... | ... |
**Issues:** [specific problems]
**Recommended additions:** [what should be added]
**Recommended removals:** [derivable / duplicated / extractable content, with where it should go instead]
**Conflicts:** [rules that contradict each other or the tool's defaults — both sides named]
After the report, ask for user confirmation before editing.
Follow references/update-guidelines.md strictly. Auditing is not only additive — a
good audit usually proposes cuts as well as additions:
Use references/templates.md for section formatting guidance.
After user approval, apply changes with the Edit tool. Preserve existing content structure.
If invoked at end of session or with "revise AGENTS.md" / "revise CLAUDE.md":
AGENTS.md for team-shared info, .claude.local.md for personal
preferences, a skill or docs/ file when the learning is a procedure rather than a factAGENTS.md as the canonical file with CLAUDE.md as a @AGENTS.md bridge — every harness reads the former.claude.local.md for personal preferences (add to .gitignore)~/.claude/CLAUDE.md / ~/.codex/AGENTS.mddocs/, referenced from hereUser says: "Check if my CLAUDE.md is up to date"
Actions:
src/legacy/ dir; the git policy repeated verbatim from ~/.claude/CLAUDE.mdUser says: "audit AGENTS.md"
Actions:
User says: "/improve-agent-instructions" or "revise AGENTS.md" at end of session
Actions:
npm test -- --runInBand is needed, found that src/config.ts must be imported before any DB calls./AGENTS.mdCause: New project, or none created yet.
Solution: Offer to create one using the minimal template from references/templates.md. Ask about project type (standard, monorepo, package) to pick the right template.
Cause: Assessment may not have cross-referenced enough of the codebase. Solution: Read key files (package.json, main config, CI config) to verify commands and described behavior before scoring. Re-run assessment with deeper codebase analysis.
Cause: Treating the file as a place to accumulate rather than curate — the most common failure mode of this skill. Solution: Re-run the Non-derivable, Progressive-disclosure, and Internal-consistency criteria specifically. A file over ~200 lines that produced zero removal candidates was not really audited.
Cause: Changes may be too generic, not project-specific, or the audit proposed cutting a rule the user holds deliberately. Solution: Ask what specific areas the user wants improved. Preferences stay; only derivable, duplicated, or extractable content is on the table.
What SKILL.md sets; muted values are Claude Code's defaults
highOther plugins' skills for the same job
npx claudepluginhub nielsmadan/skills --plugin nlsmdn65 skills in this plugin
/blind-spotsSurface consequential decisions a plan, design, or research brief left silently assumed, by interviewing the user in dependency order. Use when the user says "blind spots", "grill me", "stress-test this plan", "poke holes in this", "what am I missing", "interrogate this design", "what haven't I decided", or needs a loose idea or research brief clarified before work begins. Do NOT use for a clear factual lookup, to explain a previous reply in more detail (use `huh`), to generate ideas when it is unclear what to build (use `ideation`), or to review an already-written plan with agents (use `review-plan`)./brainstormWork out how to solve a problem the user can already name — interview them with `blind-spots` to understand it, generate structurally different approaches, validate each with an independent critic, then present the survivors with trade-offs and a recommendation. Use when the user says "brainstorm", "brainstorm approaches", "how should we solve/approach/tackle X", "what are our options", "compare approaches", "think this through with me", or wants solutions weighed before committing. Works on any topic, with codebase recon when a repo is involved; `--debate` adds external advisors for high-stakes calls. Do NOT use when stuck on what to build or what the problem is (use `ideation`), to probe an already-chosen plan (use `blind-spots`), or to pick a library or service (use `evaluate-tech`)./check-agent-logsSearch past Claude Code, Codex, Cursor CLI, Devin CLI, Droid, and Pi session logs to recover context from earlier work across the current project and sibling checkouts. Use when a bug, topic, or decision was handled in a previous session but its agent or checkout is unknown; when the user says "we fixed/discussed this before", "find the session where", "recover prior context", "check agent logs", "check Claude projects", "search past sessions/transcripts", or "which checkout was that in". Do not use for aggregate failure-pattern analysis; use review-logs for that./codebase-reviewReview a whole codebase aspect by aspect, with aspects fitted to the project type (mobile, desktop, web frontend, static site, CLI, backend, library) — docs truth-check, architecture, tests, security, the type's foundations, feature deep dives, consistency, roadmap — writing a doc per aspect and a verified findings ledger that doubles as the TODO. Plans first (recon, `blind-spots`, `review-plan`, plan approval), then walks the plan with the user aspect by aspect — agents review and verify in the background, the user confirms rulings and decides judgment calls one at a time. `--auto` runs independently after the gate, with decision waves at the end. `--fix` hands settled findings through `crew` to worker sessions, integrated locally, never pushed. Use for "codebase review", "review the whole codebase", "onboard me to this repo", "deep dive this app", "audit the code base", "review and fix everything". Not for a diff or PR (code-review), a CLI release pass (release-review), or building a feature (longshot)./codebase-review-typescriptSupply TypeScript and JavaScript structural evidence to codebase-review using dependency-cruiser, ESLint complexity, and Git churn. Use for whole-codebase import-cycle and complexity-hotspot investigation, or when discovered as a project-local codebase-review extension. Does not replace review-typescript's type-design checks or review a diff./code-guideCoach the user through writing a feature themselves, one small step at a time, the way an experienced developer would build it. Each step comes with the code to type and a checkpoint that proves it works, such as logging the endpoint's response shape before typing it, or rendering a hardcoded value before wiring the real one. After each step the agent reads the user's diff and verifies it. The happy path comes first and edge cases come last. Use when the user says "code-guide", "guide me to write", "help me write this myself", "I want to code it myself", "coach me through implementing", "walk me through building this feature", "don't write it for me", or wants to learn by typing the code. Do NOT use for console or dashboard setup (use guide), explaining existing code (use code-tour), or when the agent should implement the change itself (use plan or longshot).