Claude-skill-registry agents-md-improver
Keeps repo-local agent instructions consistent by proposing updates to AGENTS.md when a user corrects the coding agent or asks to change AGENTS.md, CLAUDE.md, .claude/CLAUDE.md, or GEMINI.md.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/agents-md-improver" ~/.claude/skills/majiayu000-claude-skill-registry-agents-md-improver && rm -rf "$T"
skills/data/agents-md-improver/SKILL.mdAGENTS.md improver
This skill helps keep repository instructions accurate and consistent. When a user corrects the coding agent's behavior, treat it as a potential update to the repo's instruction files and propose a clean, integrated edit to
AGENTS.md.
Usage
Use this skill anytime the user:
- Corrects the agent ("don't do X", "do Y instead", "from now on...").
- Asks to update instruction files like
,AGENTS.md
,CLAUDE.md
, or.claude/CLAUDE.md
.GEMINI.md - Notices contradictions between instructions.
Requirements
- Repo-local file access to read and edit
.AGENTS.md - If present in the repo, read access to
and/orCLAUDE.md
..claude/CLAUDE.md
What It Does
- Proposes a patch to incorporate the user's correction into
seamlessly.AGENTS.md - Looks for contradictions and resolves them in the proposal (or asks for clarification when needed).
- If repo-local
orCLAUDE.md
exists, proposes consolidating instructions into.claude/CLAUDE.md
, then offers follow-up options to delete, symlink, or stub those files.AGENTS.md
How It Works
Scope
This skill is repo-specific.
- Only consider repo-local instruction files:
AGENTS.md
(repo root)CLAUDE.md.claude/CLAUDE.md
(repo root and/or repo subdirectories if present)GEMINI.md
- Ignore system-wide instructions and files under the user's home directory (for example
,~/.claude/
,~/.gemini/
, etc.).~/.config/
Propose-first workflow (do not auto-edit)
- Read
.AGENTS.md - Identify the user's correction and translate it into a durable, repo-specific instruction.
- Decide where it belongs:
- Prefer editing the most relevant existing section.
- If it introduces a genuinely new topic, propose a new
section near related content.##
- Draft the exact text change(s) as a small patch/snippet.
- Ask for confirmation before applying:
- "Apply these changes to
? (y/n)"AGENTS.md
- "Apply these changes to
Only apply edits after the user confirms.
Seamless integration rules
- Do not add dated changelog entries like "YYYY-MM-DD: correction".
- Update the existing prose/bullets/steps so the rule reads like it has always been part of the document.
- Keep formatting consistent with the surrounding
style.AGENTS.md
Contradiction checks
Before proposing a patch:
- Scan
for conflicts with the new correction.AGENTS.md - If a conflict exists, include conflict resolution in the proposed patch by rewriting/removing the conflicting lines.
- If resolution is ambiguous, ask a single targeted question before proposing a patch.
Then scan repo-local guidance (if present):
- Compare
againstAGENTS.md
andCLAUDE.md
..claude/CLAUDE.md - Flag duplication and conflicts.
- Prefer consolidating into
as the canonical source of truth.AGENTS.md
Consolidation flow for CLAUDE.md files (if present)
If
CLAUDE.md and/or .claude/CLAUDE.md exists in the repo:
- Propose a consolidation patch to
.AGENTS.md - After the user approves the
patch, propose what to do for each CLAUDE file:AGENTS.md- Delete the file.
- Replace the file with a symlink pointing to
.AGENTS.md - Replace the file contents with a small stub that points humans/tools to
(fallback when symlinks are undesirable).AGENTS.md
- Confirm destructive actions (deletes) in a separate prompt.
Symlink directions (when chosen):
->CLAUDE.mdAGENTS.md
->.claude/CLAUDE.md../AGENTS.md
Notes for multi-instruction environments
Some harnesses merge multiple instruction sources and may apply conflicting rules non-deterministically. Prefer a single canonical source (
AGENTS.md) and reduce parallel instruction files via consolidation + delete/symlink/stub.