maintaining-instruction-files
БесплатноБез исполняемых скриптовНе проверенUse when creating, updating, or validating CLAUDE.md or AGENTS.md files - ensures size limits, progressive disclosure via docs/ references, multi-agent…
от cipherstash★ 17 звёзд на GitHubОб этом скилле
Maintaining Instruction Files
Overview
Specialized workflow for AI instruction files (CLAUDE.md, AGENTS.md). Different from general documentation:
- Size-constrained: <200 lines ideal, <300 max
- AI-audience: Directive style, third-person
- Progressive disclosure: Reference docs/, don't include content
- Multi-agent: AGENTS.md standard works with any AI assistant
Why this matters: Quality instruction files create a virtuous cycle - better context leads to better AI output, which builds trust, which leads to more investment in refined guidance. Poorly maintained instruction files cause the opposite: AI makes mistakes, trust erodes, teams abandon the approach.
Announce at start: "I'm using the maintaining-instruction-files skill to work on this instruction file."
Critical Infrastructure Warning: Instruction files are NOT documentation - they're critical infrastructure that shapes every AI interaction. A single poorly-thought-out line can mislead the AI in every session. Never accept auto-generated instruction files without careful manual review and curation.
Terminology note: These files are sometimes called "memory files" in multi-agent literature (as in agents-md-best-practices.md), but we use "instruction files" to emphasize their directive role in shaping AI behavior rather than storing information.
When to Use
Use this skill when:
- Creating new CLAUDE.md or AGENTS.md
- Instruction file exceeds 200 lines (warning) or 300 lines (action required)
- Adding content to instruction files
- Migrating CLAUDE.md to AGENTS.md standard
- Auditing instruction file quality
- Reviewing PRs that modify instruction files
When NOT to use:
- General documentation updates (use maintaining-docs-after-changes)
- Creating docs/ content (use organizing-documentation)
- Trivial typo fixes
Quick Reference
| Size | Status | Action |
|---|---|---|
| <200 lines | ✅ Good | Maintain quality |
| 200-300 lines | ⚠️ Warning | Consider extraction |
| >300 lines | ❌ Action required | Run extraction workflow |
| Principle | Implementation |
|---|---|
| Size discipline | Count lines, extract if >300 |
| Universal relevance | Remove edge cases |
| Tool-first | Reference skills/linters, not rules |
| Reference, don't include | Link to docs/, don't duplicate |
| Multi-agent neutral | No "Claude should...", use AGENTS.md |
Core Principles
0. Context Window is Precious
The AI's context window is limited and valuable - fill it with high-value information, not exhaustive minutiae. Every token spent on instruction files is a token not available for actual work context.
Research finding: As instruction count increases, model performance in following them degrades linearly. Even frontier models show this effect. Smaller models are especially prone to instruction overload.
Claude Code behavior: Claude's system actively tells the model to skip context files unless they're highly relevant to the current task. If most content appears irrelevant, the model may ignore the entire file. This means bloated instruction files can be worse than no instruction file at all.
1. Size Discipline
# Check current size
wc -l AGENTS.md CLAUDE.md 2>/dev/null || wc -l CLAUDE.md
Thresholds:
- <200 lines: Ideal, focused and effective
- 200-300 lines: Warning, review for extraction opportunities
300 lines: Must extract content to docs/
Optimization target: Minimize instruction count, not just line count. Fewer well-chosen instructions outperform many rules. Aim for the minimum guidance that covers essential context.
What counts as "one instruction"?
Multiple instructions (counted separately by AI):
- Always run tests before committing
- Always run linting before committing
- Always run type checking before committing
Single instruction (counted as one):
- Run all quality checks before committing: `npm run test && npm run lint && npm run typecheck`
Consolidation strategies:
- Combine related checks into one command
- Group by workflow stage instead of tool
- Use scripts that run multiple checks
- Reference skills instead of listing steps
2. Universal Relevance
Every line must apply to most tasks. Test each section:
- "Does this apply when fixing bugs?" → Must be Yes
- "Does this apply when adding features?" → Must be Yes
- "Is this only relevant for [specific scenario]?" → If Yes, extract to docs/
3. Tool-First Content
Wrong: Listing style rules in instruction file
## Code Style
- Use camelCase for variables
- 2-space indentation
- No trailing whitespace
Right: Reference tools
## Code Style
Use project linters and formatters. Run `npm run lint` before commits.
4. Reference, Don't Include (Progressive Disclosure)
This principle implements progressive disclosure - a pattern where detailed information is available but not lo
Установить maintaining-instruction-files в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл maintaining-instruction-files?
Use when creating, updating, or validating CLAUDE.md or AGENTS.md files - ensures size limits, progressive disclosure via docs/ references, multi-agent compatibility, and tool-first content
Как установить скилл maintaining-instruction-files?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл maintaining-instruction-files запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic