improve-agents-md
БесплатноБез исполняемых скриптовНе проверенImprove (or bootstrap) an AGENTS.md / CLAUDE.md file using `<important if>` conditional blocks so the agent actually attends to the right guidance at the…
от desplega-ai★ 38 звёзд на GitHubОб этом скилле
improve-agents-md
Progressively improve (or bootstrap from scratch) a project's agent-instruction file. Works on both AGENTS.md (vendor-neutral convention from OpenAI Codex, also read by Cursor, Claude Code, and others) and CLAUDE.md (Claude-specific). Keeps one canonical file on disk and symlinks the other, so every agent reads the same source of truth.
When to Use
- User invokes
/improve-agents-md(or/improve-claude-mdpointed here) - User asks you to "clean up", "shorten", "audit", or "rewrite" their CLAUDE.md / AGENTS.md
- User complains that Claude (or another agent) keeps ignoring their project rules
- User is about to onboard a new agent and wants to check their instructions are any good
- No AGENTS.md / CLAUDE.md exists and the user wants to set one up properly
The Core Problem
Claude Code (and most other agents) inject the project agent-file with a system reminder that says:
"this context may or may not be relevant to your tasks. You should not respond to this context unless it is highly relevant to your task."
So the agent will ignore parts it deems irrelevant. The more content that isn't applicable to the current task, the more likely the agent is to ignore the entire file — including the parts that matter right now. Long, undifferentiated agent files are self-defeating.
Two levers fix this:
- Cut ruthlessly. Anything a linter, formatter, or pre-commit hook can enforce does not belong here. Anything discoverable from existing code patterns (LLMs are in-context learners) does not belong here. Anything vague ("write clean code", "follow best practices") does not belong here.
- Wrap conditionally. Domain-specific guidance gets wrapped in
<important if="...">blocks with narrow, specific conditions. This piggybacks on the same XML tag pattern Claude Code uses in its own system prompt, giving the model an explicit relevance signal that cuts through the "may or may not be relevant" framing.
The result is a short file where foundational context is always visible and domain guidance only "lights up" when it matches the task at hand.
File Resolution: which file is canonical?
The skill runs inside Claude Code, so the canonical on-disk file is CLAUDE.md. AGENTS.md exists as a symlink pointing to CLAUDE.md so vendor-neutral agents (Codex, Cursor, Copilot workspace) read the same source of truth.
Resolution logic at the start of every run:
- Check for
CLAUDE.mdandAGENTS.mdat the repo root (and in subdirectory if the user invokes from one). - Branch on what's present:
- Only
CLAUDE.md→ operate on it; at the end, offer to createAGENTS.mdas a symlink →CLAUDE.md. - Only
AGENTS.md(real file, not a symlink) → offer to rename it toCLAUDE.mdand createAGENTS.md→CLAUDE.mdsymlink. If user declines the rename, editAGENTS.mddirectly. - Both exist, one is a symlink → edit the real file; leave the symlink alone.
- Both exist, both are real files → this is a drift bug. Use AskUserQuestion to ask which one is canonical; offer to replace the other with a symlink after the edit.
- Neither exists → use AskUserQuestion: 1. Bootstrap a new
CLAUDE.mdfrom the codebase, 2. Abort.
- Only
Always use ls -la (or equivalent) to detect symlinks; never assume from the filename.
Interactive Flow
This skill is progressive, not one-shot. Use AskUserQuestion at decision points so the user stays in control. The flow below is the default; skip steps if the input file is already clean or the user asks to go faster.
Step 1 — Resolve the target file
Follow the resolution logic above. State clearly which file you'll be editing and why.
Step 2 — Read and categorize
Read the full file. Categorize every top-level section into one of:
| Category | Examples | Treatment |
|---|---|---|
| Foundational (always relevant) | project identity (1 sentence), project map (directory listing), tech stack (1-2 lines) | Leave bare at top. |
| Commands | build/test/lint/dev commands | Wrap in a single <important if="you need to run commands to build, test, lint, or generate code"> block. Keep all commands. |
| Conditional rule | "use Zod for request validation", "API routes go in X" | Wrap in its own <important if> block with a narrow trigger. |
| Domain section | testing setup, state management, i18n, auth | Wrap in one <important if> per section. |
| Lint/formatter territory | camelCase, const over let, strict equality, JSDoc |
Delete. Suggest a pre-commit hook instead. |
| Vague exhortation | "follow best practices", "leverage the X agent", "think carefully" | Delete. |
| Stale code snippet | 20-line example of a component | Delete. Replace with a file path reference (see src/utils/example.ts). |
Step 3 — Propose cuts
Before rewriting, use AskUserQuestion to confirm the deletions that might be controversial. Don't ask about every cut — o
Установить improve-agents-md в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл improve-agents-md?
Improve (or bootstrap) an AGENTS.md / CLAUDE.md file using `<important if>` conditional blocks so the agent actually attends to the right guidance at the right time. Use this skill whenever the user mentions AGENTS.md, CLAUDE.md, agent instructions, project rules for AI, "my claude config", onboarding docs for agents, or asks to tighten / shorten / audit / rewrite an existing one — even if they don't explicitly say the filename. Also use when the user complains that an agent keeps ignoring their project rules.
Как установить скилл improve-agents-md?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл improve-agents-md запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic