Agent Instructions Optimizer
Behavioral Classification: Guided Decision (ASK, THEN EXECUTE)
This skill analyzes CLAUDE.md files and proposes optimizations using progressive disclosure patterns. It NEVER makes destructive changes without explicit user approval. Always present the plan, get confirmation, then execute.
Quick Start
Phase 1: Detect & Analyze
- Scan the repo for agent instruction files:
./CLAUDE.md or ./.claude/CLAUDE.md (Claude Code)
./AGENTS.md and any nested AGENTS.md in subdirectories (OpenAI Codex / GitHub Copilot)
.github/copilot-instructions.md and .github/instructions/*.instructions.md (GitHub Copilot)
- Report each file found with its line count and the format's optimization threshold (see Supported Formats)
- If multiple files need optimization, confirm with the user which to address first
- Parse the selected file into sections and categorize each:
- Essential - Required for every session (build commands, test patterns, security rules)
- Reference - Needed occasionally (architecture docs, API references, troubleshooting)
- Redundant - Duplicates existing docs or overly verbose
Phase 2: Detect Constraints
- Check
.gitattributes for filter=git-crypt diff=git-crypt patterns
- Identify encrypted paths (docs/, .claude/, etc.)
- Find safe unencrypted directory for sub-documents (prefer project root or subdirs)
- Scan for CI machine-readable dependencies (see constraints.md)
- Identify the format's native sub-doc mechanism (see Supported Formats and constraints.md)
Phase 3: Plan
Present categorization table to user:
| Section | Lines | Category | Target | Rationale |
|---------|-------|----------|--------|-----------|
| Docker Commands | 45 | Reference | docker-guide.md | Used <10% of sessions |
| CI Health | 120 | Reference | ci-reference.md | Detailed reference rarely needed |
| Git-Crypt Setup | 30 | Essential | Keep inline | Unlock instructions (chicken-and-egg) |
For CLAUDE.md: also show whether sections can use @import or move to .claude/rules/.
For copilot-instructions.md: show whether sections are candidates for path-scoped .instructions.md files.
Wait for user approval before proceeding.
Phase 4: Review
User confirms:
- Categorization is correct
- Sub-document names make sense
- Essential content remains inline
- Safe directory for sub-docs identified
Phase 5: Execute
- Create sub-documents in safe directory (verbatim extraction, NO summarization)
- For CLAUDE.md: use
@path/to/file imports or .claude/rules/*.md as the extraction target when possible — these are native to the format and load at session start
- For AGENTS.md: use nested
AGENTS.md files in subdirectories for subsystem-specific content; use .agents/instructions/<ref>.md + "For <reason>, see [.agents/instructions/<ref>.md]" links for general reference content
- For copilot-instructions.md: extract language/framework rules to
.github/instructions/NAME.instructions.md with applyTo: frontmatter; use .github/copilot/<ref>.md + "For <reason>, see [.github/copilot/<ref>.md]" links for reference content that isn't path-specific
- Rewrite the main file: replace each extracted section with a rich inline synopsis followed by a link (Pattern 2). The synopsis must contain enough concrete specifics (framework names, thresholds, ports, naming conventions) that an agent can answer common questions without opening the sub-doc. The link is a trapdoor for when more detail is needed.
- Optionally add a reference table at the end of the file if there are many sub-docs and an index adds navigational value (see Pattern 1)
- Preserve all Essential content inline
Phase 6: Validate
- Count lines before/after, report reduction vs. format target (see Supported Formats)
- Diff all extracted content to verify zero information loss
- Confirm encryption constraints respected
- Present validation report to user
Supported Formats
| Format |
Primary Location |
Optimize If |
Native Sub-Doc Mechanism |
| CLAUDE.md |
./CLAUDE.md or ./.claude/CLAUDE.md |
>200 lines |
@path/to/file imports; .claude/rules/*.md |
| AGENTS.md |
./AGENTS.md (hierarchical) |
>200 lines |
Nested AGENTS.md in subdirectories; .agents/instructions/<ref>.md with contextual links |
| copilot-instructions.md |
.github/copilot-instructions.md |
>150 lines |
.github/instructions/NAME.instructions.md; .github/copilot/<ref>.md with contextual links |
CLAUDE.md
Anthropic recommends <200 lines — above this, instruction adherence degrades. Two native extraction paths avoid the overhead of linked sub-docs:
@path/to/file imports: Add @docs/development/docker-guide.md anywhere in CLAUDE.md; the file loads into context at session start, equivalent to inline content
.claude/rules/*.md: Topic-specific rule files with optional paths: frontmatter to scope rules to file types (only loads when Claude works with matching files, saving context)
AGENTS.md
Plain Markdown, no required schema. Codex and GitHub Copilot load files hierarchically (global → repo root → subdirectory → CWD); files closer to CWD take precedence. Codex truncates the combined chain at a configurable budget (project_doc_max_bytes, default 32 KiB), so keep the chain within that budget. In Codex, AGENTS.override.md at any level takes precedence over AGENTS.md at the same level (Codex-specific, not part of the cross-tool agents.md spec).
Two progressive disclosure strategies:
- Nested
AGENTS.md files: move subsystem-specific rules into services/payments/AGENTS.md etc. — auto-discovered when working in that directory
.agents/instructions/<ref>.md + contextual link: for reference content that doesn't belong to a specific subsystem, extract to .agents/instructions/<ref>.md and link with "For <reason>, see .agents/instructions/<ref>.md." — the link text carries intent so the agent knows when to follow it. Each sub-doc should include a description: frontmatter field (a one-line summary).
copilot-instructions.md
Repository-wide instructions in .github/copilot-instructions.md (no frontmatter required). Two progressive disclosure strategies:
- Path-scoped
.instructions.md files: extract language/framework rules to .github/instructions/NAME.instructions.md with applyTo: frontmatter — load automatically for matching files, no link-following. applyTo: is required; also include a description: field. If the rules are also scoped to specific directories (not just file types), add directory globs to applyTo: or include a paths: field alongside it.
.github/copilot/<ref>.md + contextual link: for reference content that isn't path-specific, extract to .github/copilot/<ref>.md and link with "For <reason>, see .github/copilot/<ref>.md."
Path-scoped files supplement the repo-wide file — both apply when a file matches.
Sub-Documentation
| Document |
Description |
| analysis.md |
Content categorization methodology, format thresholds, and format-specific extraction strategies |
| patterns.md |
Progressive disclosure patterns including @import, .claude/rules/, and path-scoped instructions |
| constraints.md |
Encryption detection, safe path selection, and format-specific placement constraints |
| validation.md |
Before/after diffing, per-format pass criteria, and information loss verification |
Essential Rules
Safety First
- ALWAYS present the plan before making changes
- NEVER make destructive edits without explicit user approval
- ALWAYS validate zero information loss after optimization
Format Awareness
- ALWAYS identify the file format before choosing an extraction strategy
- PREFER the format's native sub-doc mechanism (imports, nested files, path-scoped instructions) over generic markdown links
- NEVER move content that is consulted in >50% of sessions
Content Preservation
- NEVER summarize or paraphrase content — verbatim extraction only
- ALWAYS keep encryption unlock instructions in main file (chicken-and-egg problem)
- ALWAYS keep security rules, test file patterns, behavioral reminders inline
- NEVER move content that is consulted in >50% of sessions
- ALWAYS keep content that CI scripts parse via regex (see CI Machine-Readable Content below)
Encryption Safety
- Sub-documents MUST be in unencrypted directories
- Check
.gitattributes for filter=git-crypt patterns
- If entire project is encrypted, warn user and recommend decrypted subdirectory
CI Machine-Readable Content
- CI audit scripts may use regex to scan CLAUDE.md for specific literal strings
- ALWAYS scan for scripts that
readFileSync('CLAUDE.md') or grep CLAUDE.md
- Common patterns: deploy commands, function lists, config references
- Content matched by CI regex MUST remain in CLAUDE.md — extraction breaks CI
- See constraints.md for detection methodology
Progressive Disclosure
- Replace extracted sections with a rich inline synopsis + link (Pattern 2): 3–5 sentences with concrete specifics (names, thresholds, commands) followed by the link
- The synopsis is the primary value — most agent questions should be answerable from it without opening the sub-doc
- The link is a trapdoor for detail: include what extra information the sub-doc contains so the agent can judge whether to follow it
- Avoid a table of all sub-docs at the top; an upfront index doesn't convey when each file is needed
- Target: >50% line reduction with zero information loss
Quick Reference
Content Tiers
| Tier |
Criteria |
Action |
| Essential |
Used every session, unlocks workflow, defines behavior |
Keep inline |
| Reference |
Used occasionally, detailed specs, troubleshooting |
Extract to sub-doc |
| Redundant |
Duplicates existing docs, overly verbose, historical |
Extract or remove |
Sub-Document Naming
- Use kebab-case domain names:
docker-guide.md, ci-reference.md, api-docs.md
- Group related content:
troubleshooting/native-modules.md
- Avoid generic names:
reference.md, docs.md
Progressive Disclosure Patterns
- Sub-Documentation Table - Optional reference index (place at end, not top)
- Rich Abstract+Link - 3–5 sentence synopsis with concrete specifics + link; agent answers most questions from synopsis alone
- Compressed Table+Link - Condensed table with full version in sub-doc
- Summary+Link - Brief paragraph + link to comprehensive guide
Target Metrics
| Format |
Goal |
Information Loss |
| CLAUDE.md |
<200 lines (Anthropic guideline) |
0% (content moved, not deleted) |
| AGENTS.md |
Meaningful reduction; stay within Codex's project_doc_max_bytes budget (32 KiB default) |
0% |
| copilot-instructions.md |
100 lines (2 pages) |
0% |
- Essential content remains accessible (inline or via format-native import/reference)
- Session impact: minimal friction for common tasks
Example Output
CLAUDE.md: 850 lines → 175 lines (79% reduction)
- Build commands, security rules, test patterns: kept inline
- Docker guide: extracted to
docs/development/docker-guide.md, imported with @docs/development/docker-guide.md
- CI rules: moved to
.claude/rules/ci.md (path-scoped to **/.github/**)
- Architecture links: replaced with single index link
AGENTS.md: 420 lines → 110 lines root + nested subdirectory files (74% reduction)
- Root: core conventions, build commands, PR rules
services/payments/AGENTS.md: payments-specific rules (65 lines)
services/auth/AGENTS.md: auth-specific rules (45 lines)
copilot-instructions.md: 300 lines → 85 lines root + path-scoped files (72% reduction)
- Root: project overview, build commands, PR conventions
.github/instructions/typescript.instructions.md (applyTo: **/*.ts,**/*.tsx)
.github/instructions/python.instructions.md (applyTo: **/*.py)
Validation Checklist
Error Handling
Entire project is encrypted: Warn user, suggest creating docs/claude/ or similar unencrypted subdirectory.
User rejects plan: Ask for feedback, iterate on categorization.
Information loss detected: Abort optimization, present diff to user, do not commit changes.
Ambiguous categorization: Default to Essential (keep inline), ask user to review.
File already at target size: Report analysis but decline to optimize. Thresholds: CLAUDE.md <200 lines, AGENTS.md <200 lines, copilot-instructions.md <150 lines.
Notes
- This skill is project-agnostic and works with any of the three supported instruction file formats
- Always read the full file before categorizing (context matters)
- Encryption constraints are project-specific, always check
.gitattributes
- Validation is mandatory, never skip Phase 6
- For CLAUDE.md: prefer
@import and .claude/rules/ over generic markdown sub-docs — they're the format's native mechanism
- For AGENTS.md: nested AGENTS.md files in subdirectories keep subsystem context close to the code
- For copilot-instructions.md: path-scoped
.instructions.md files reduce noise by only loading rules relevant to the file being edited
1---2name: claude-md-optimizer3description: Optimize oversized agent instruction files using progressive disclosure. Handles CLAUDE.md (Claude Code), AGENTS.md (OpenAI Codex / GitHub Copilot agents), and copilot-instructions.md (GitHub Copilot). Auto-detects all three formats in your repo, analyzes content tiers, creates sub-documents using each format's native mechanism, and rewrites the main file with zero information loss. Triggers: optimize CLAUDE.md, AGENTS.md too long, reduce copilot-instructions.md, agent instructions file too large, shrink context file, apply progressive disclosure, instructions file bloated4---56# Agent Instructions Optimizer78**Behavioral Classification: Guided Decision (ASK, THEN EXECUTE)**910This skill analyzes CLAUDE.md files and proposes optimizations using progressive disclosure patterns. It NEVER makes destructive changes without explicit user approval. Always present the plan, get confirmation, then execute.1112## Quick Start1314### Phase 1: Detect & Analyze151. Scan the repo for agent instruction files:16 - `./CLAUDE.md` or `./.claude/CLAUDE.md` (Claude Code)17 - `./AGENTS.md` and any nested `AGENTS.md` in subdirectories (OpenAI Codex / GitHub Copilot)18 - `.github/copilot-instructions.md` and `.github/instructions/*.instructions.md` (GitHub Copilot)192. Report each file found with its line count and the format's optimization threshold (see [Supported Formats](#supported-formats))203. If multiple files need optimization, confirm with the user which to address first214. Parse the selected file into sections and categorize each:22 - **Essential** - Required for every session (build commands, test patterns, security rules)23 - **Reference** - Needed occasionally (architecture docs, API references, troubleshooting)24 - **Redundant** - Duplicates existing docs or overly verbose2526### Phase 2: Detect Constraints271. Check `.gitattributes` for `filter=git-crypt diff=git-crypt` patterns282. Identify encrypted paths (docs/, .claude/, etc.)293. Find safe unencrypted directory for sub-documents (prefer project root or subdirs)304. **Scan for CI machine-readable dependencies** (see [constraints.md](./constraints.md))315. **Identify the format's native sub-doc mechanism** (see [Supported Formats](#supported-formats) and [constraints.md](./constraints.md))3233### Phase 3: Plan34Present categorization table to user:35```36| Section | Lines | Category | Target | Rationale |37|---------|-------|----------|--------|-----------|38| Docker Commands | 45 | Reference | docker-guide.md | Used <10% of sessions |39| CI Health | 120 | Reference | ci-reference.md | Detailed reference rarely needed |40| Git-Crypt Setup | 30 | Essential | Keep inline | Unlock instructions (chicken-and-egg) |41```4243For **CLAUDE.md**: also show whether sections can use `@import` or move to `.claude/rules/`.44For **copilot-instructions.md**: show whether sections are candidates for path-scoped `.instructions.md` files.4546Wait for user approval before proceeding.4748### Phase 4: Review49User confirms:50- Categorization is correct51- Sub-document names make sense52- Essential content remains inline53- Safe directory for sub-docs identified5455### Phase 5: Execute561. Create sub-documents in safe directory (verbatim extraction, NO summarization)572. For **CLAUDE.md**: use `@path/to/file` imports or `.claude/rules/*.md` as the extraction target when possible — these are native to the format and load at session start583. For **AGENTS.md**: use nested `AGENTS.md` files in subdirectories for subsystem-specific content; use `.agents/instructions/<ref>.md` + "For `<reason>`, see [.agents/instructions/\<ref>.md]" links for general reference content594. For **copilot-instructions.md**: extract language/framework rules to `.github/instructions/NAME.instructions.md` with `applyTo:` frontmatter; use `.github/copilot/<ref>.md` + "For `<reason>`, see [.github/copilot/\<ref>.md]" links for reference content that isn't path-specific605. Rewrite the main file: replace each extracted section with a **rich inline synopsis** followed by a link (Pattern 2). The synopsis must contain enough concrete specifics (framework names, thresholds, ports, naming conventions) that an agent can answer common questions without opening the sub-doc. The link is a trapdoor for when more detail is needed.616. Optionally add a reference table at the **end** of the file if there are many sub-docs and an index adds navigational value (see Pattern 1)627. Preserve all Essential content inline6364### Phase 6: Validate651. Count lines before/after, report reduction vs. format target (see [Supported Formats](#supported-formats))662. Diff all extracted content to verify zero information loss673. Confirm encryption constraints respected684. Present validation report to user6970## Supported Formats7172| Format | Primary Location | Optimize If | Native Sub-Doc Mechanism |73|--------|-----------------|-------------|--------------------------|74| CLAUDE.md | `./CLAUDE.md` or `./.claude/CLAUDE.md` | >200 lines | `@path/to/file` imports; `.claude/rules/*.md` |75| AGENTS.md | `./AGENTS.md` (hierarchical) | >200 lines | Nested `AGENTS.md` in subdirectories; `.agents/instructions/<ref>.md` with contextual links |76| copilot-instructions.md | `.github/copilot-instructions.md` | >150 lines | `.github/instructions/NAME.instructions.md`; `.github/copilot/<ref>.md` with contextual links |7778### CLAUDE.md79Anthropic recommends **<200 lines** — above this, instruction adherence degrades. Two native extraction paths avoid the overhead of linked sub-docs:80- **`@path/to/file` imports**: Add `@docs/development/docker-guide.md` anywhere in CLAUDE.md; the file loads into context at session start, equivalent to inline content81- **`.claude/rules/*.md`**: Topic-specific rule files with optional `paths:` frontmatter to scope rules to file types (only loads when Claude works with matching files, saving context)8283### AGENTS.md84Plain Markdown, no required schema. Codex and GitHub Copilot load files hierarchically (global → repo root → subdirectory → CWD); files closer to CWD take precedence. Codex truncates the combined chain at a configurable budget (`project_doc_max_bytes`, default 32 KiB), so keep the chain within that budget. In Codex, `AGENTS.override.md` at any level takes precedence over `AGENTS.md` at the same level (Codex-specific, not part of the cross-tool agents.md spec).8586Two progressive disclosure strategies:87- **Nested `AGENTS.md` files**: move subsystem-specific rules into `services/payments/AGENTS.md` etc. — auto-discovered when working in that directory88- **`.agents/instructions/<ref>.md` + contextual link**: for reference content that doesn't belong to a specific subsystem, extract to `.agents/instructions/<ref>.md` and link with "For `<reason>`, see [.agents/instructions/\<ref>.md](.agents/instructions/\<ref>.md)." — the link text carries intent so the agent knows when to follow it. Each sub-doc should include a `description:` frontmatter field (a one-line summary).8990### copilot-instructions.md91Repository-wide instructions in `.github/copilot-instructions.md` (no frontmatter required). Two progressive disclosure strategies:92- **Path-scoped `.instructions.md` files**: extract language/framework rules to `.github/instructions/NAME.instructions.md` with `applyTo:` frontmatter — load automatically for matching files, no link-following. `applyTo:` is required; also include a `description:` field. If the rules are also scoped to specific directories (not just file types), add directory globs to `applyTo:` or include a `paths:` field alongside it.93- **`.github/copilot/<ref>.md` + contextual link**: for reference content that isn't path-specific, extract to `.github/copilot/<ref>.md` and link with "For `<reason>`, see [.github/copilot/\<ref>.md](.github/copilot/\<ref>.md)."9495Path-scoped files **supplement** the repo-wide file — both apply when a file matches.9697## Sub-Documentation9899| Document | Description |100|----------|-------------|101| [analysis.md](./analysis.md) | Content categorization methodology, format thresholds, and format-specific extraction strategies |102| [patterns.md](./patterns.md) | Progressive disclosure patterns including @import, .claude/rules/, and path-scoped instructions |103| [constraints.md](./constraints.md) | Encryption detection, safe path selection, and format-specific placement constraints |104| [validation.md](./validation.md) | Before/after diffing, per-format pass criteria, and information loss verification |105106## Essential Rules107108### Safety First109- **ALWAYS** present the plan before making changes110- **NEVER** make destructive edits without explicit user approval111- **ALWAYS** validate zero information loss after optimization112113### Format Awareness114- **ALWAYS** identify the file format before choosing an extraction strategy115- **PREFER** the format's native sub-doc mechanism (imports, nested files, path-scoped instructions) over generic markdown links116- **NEVER** move content that is consulted in >50% of sessions117118### Content Preservation119- **NEVER** summarize or paraphrase content — verbatim extraction only120- **ALWAYS** keep encryption unlock instructions in main file (chicken-and-egg problem)121- **ALWAYS** keep security rules, test file patterns, behavioral reminders inline122- **NEVER** move content that is consulted in >50% of sessions123- **ALWAYS** keep content that CI scripts parse via regex (see CI Machine-Readable Content below)124125### Encryption Safety126- Sub-documents **MUST** be in unencrypted directories127- Check `.gitattributes` for `filter=git-crypt` patterns128- If entire project is encrypted, warn user and recommend decrypted subdirectory129130### CI Machine-Readable Content131- CI audit scripts may use regex to scan CLAUDE.md for specific literal strings132- **ALWAYS** scan for scripts that `readFileSync('CLAUDE.md')` or `grep` CLAUDE.md133- Common patterns: deploy commands, function lists, config references134- Content matched by CI regex MUST remain in CLAUDE.md — extraction breaks CI135- See [constraints.md](./constraints.md) for detection methodology136137### Progressive Disclosure138- Replace extracted sections with a **rich inline synopsis + link** (Pattern 2): 3–5 sentences with concrete specifics (names, thresholds, commands) followed by the link139- The synopsis is the primary value — most agent questions should be answerable from it without opening the sub-doc140- The link is a trapdoor for detail: include what extra information the sub-doc contains so the agent can judge whether to follow it141- Avoid a table of all sub-docs at the top; an upfront index doesn't convey when each file is needed142- Target: >50% line reduction with zero information loss143144## Quick Reference145146### Content Tiers147| Tier | Criteria | Action |148|------|----------|--------|149| Essential | Used every session, unlocks workflow, defines behavior | Keep inline |150| Reference | Used occasionally, detailed specs, troubleshooting | Extract to sub-doc |151| Redundant | Duplicates existing docs, overly verbose, historical | Extract or remove |152153### Sub-Document Naming154- Use kebab-case domain names: `docker-guide.md`, `ci-reference.md`, `api-docs.md`155- Group related content: `troubleshooting/native-modules.md`156- Avoid generic names: `reference.md`, `docs.md`157158### Progressive Disclosure Patterns1591. **Sub-Documentation Table** - Optional reference index (place at *end*, not top)1602. **Rich Abstract+Link** - 3–5 sentence synopsis with concrete specifics + link; agent answers most questions from synopsis alone1613. **Compressed Table+Link** - Condensed table with full version in sub-doc1624. **Summary+Link** - Brief paragraph + link to comprehensive guide163164### Target Metrics165| Format | Goal | Information Loss |166|--------|------|-----------------|167| CLAUDE.md | <200 lines (Anthropic guideline) | 0% (content moved, not deleted) |168| AGENTS.md | Meaningful reduction; stay within Codex's `project_doc_max_bytes` budget (32 KiB default) | 0% |169| copilot-instructions.md | ~100 lines (~2 pages) | 0% |170171- Essential content remains accessible (inline or via format-native import/reference)172- Session impact: minimal friction for common tasks173174## Example Output175176**CLAUDE.md**: 850 lines → 175 lines (79% reduction)177- Build commands, security rules, test patterns: kept inline178- Docker guide: extracted to `docs/development/docker-guide.md`, imported with `@docs/development/docker-guide.md`179- CI rules: moved to `.claude/rules/ci.md` (path-scoped to `**/.github/**`)180- Architecture links: replaced with single index link181182**AGENTS.md**: 420 lines → 110 lines root + nested subdirectory files (74% reduction)183- Root: core conventions, build commands, PR rules184- `services/payments/AGENTS.md`: payments-specific rules (65 lines)185- `services/auth/AGENTS.md`: auth-specific rules (45 lines)186187**copilot-instructions.md**: 300 lines → 85 lines root + path-scoped files (72% reduction)188- Root: project overview, build commands, PR conventions189- `.github/instructions/typescript.instructions.md` (applyTo: `**/*.ts,**/*.tsx`)190- `.github/instructions/python.instructions.md` (applyTo: `**/*.py`)191192## Validation Checklist193194- [ ] All extracted content is byte-for-byte identical (verified via diff)195- [ ] Sub-documents are in unencrypted directory (or use format's native mechanism)196- [ ] Essential content remains accessible (inline or imported/linked)197- [ ] Extracted sections replaced with inline contextual references ("For `<reason>`, see [file.md]") at the point of relevance198- [ ] All relative links and `@import` paths work199- [ ] User approved the plan before execution200- [ ] Line count is within format target (see Supported Formats)201- [ ] No chicken-and-egg problems (encryption, authentication)202- [ ] CI scripts that regex-scan the instruction file still pass (see CI Machine-Readable Content)203204## Error Handling205206**Entire project is encrypted**: Warn user, suggest creating `docs/claude/` or similar unencrypted subdirectory.207208**User rejects plan**: Ask for feedback, iterate on categorization.209210**Information loss detected**: Abort optimization, present diff to user, do not commit changes.211212**Ambiguous categorization**: Default to Essential (keep inline), ask user to review.213214**File already at target size**: Report analysis but decline to optimize. Thresholds: CLAUDE.md <200 lines, AGENTS.md <200 lines, copilot-instructions.md <150 lines.215216## Notes217218- This skill is project-agnostic and works with any of the three supported instruction file formats219- Always read the full file before categorizing (context matters)220- Encryption constraints are project-specific, always check `.gitattributes`221- Validation is mandatory, never skip Phase 6222- For CLAUDE.md: prefer `@import` and `.claude/rules/` over generic markdown sub-docs — they're the format's native mechanism223- For AGENTS.md: nested AGENTS.md files in subdirectories keep subsystem context close to the code224- For copilot-instructions.md: path-scoped `.instructions.md` files reduce noise by only loading rules relevant to the file being edited