[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CD055CKSKY0QAAG6RMH0PK":3,"skill-same:01M6CD055CKSKY0QAAG6RMH0PK":103},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":35,"linkOnly":36,"markdownContent":37,"markdownBody":38,"frontMatter":39,"refName":50,"commitSha":51,"skillDirectory":52,"forksCount":14,"repositoryHtmlUrl":53,"repositoryHomepageUrl":6,"ownerHtmlUrl":54,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":55,"install":56,"resources":68},"01M6CD055CKSKY0QAAG6RMH0PK","context-optimizer",null,"Analyze skill content for optimal placement (Skill vs Passive Context vs Hybrid), compress markdown to pipe-delimited format (60-80% token reduction), and validate compliance against the decision framework. Based on Vercel research showing passive context achieves 100% pass rates vs 53-79% for skills.","loriensleafs\u002Fbrain","loriensleafs","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F315385?v=4","01M6CCYZETMCJPTHNS258YRCBC","Peter Kloss","01M6CCYZK25T8516A39S9PCJT7",0,"MIT","https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fcontext-optimizer\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"context","context optimizer","research","validate","framework","content","compliance","architect","Bash","markdown","format","compress","analyze","decision","read","vercel","2026-11-10 10:12:30",false,"---\nname: context-optimizer\ndescription: Analyze skill content for optimal placement (Skill vs Passive Context vs Hybrid), compress markdown to pipe-delimited format (60-80% token reduction), and validate compliance against the decision framework. Based on Vercel research showing passive context achieves 100% pass rates vs 53-79% for skills.\nlicense: MIT\nagents:\n  - analyst\n  - architect\nuser-invocable: true\nallowed-tools:\n  - Read\n  - Bash\n  - Glob\nmodel: claude-sonnet-4-6\nmetadata:\n  version: 1.1.0\n  timelessness: 8\u002F10\n---\n\n# Context Optimizer\n\nTooling suite for optimizing Claude Code context placement. Passive context (AGENTS.md, @imports) achieves 100% pass rates versus 53-79% for skills by eliminating decision points.\n\n## Triggers\n\n- `analyze skill placement` - classify content as Skill vs Passive Context\n- `compress markdown` - reduce token count for context files\n- `validate compliance` - check skill\u002Fpassive context placement decisions\n- `optimize context` - lower API costs and improve agent performance\n- `extract and index` - split markdown into detail files with compact index\n\n## Process\n\n1. **Analyze**: Run `analyze_skill_placement.ts` to classify content\n2. **Compress**: Run `compress_markdown_content.ts` to reduce token counts\n3. **Validate**: Run `test_skill_passive_compliance.ts` to check compliance\n4. **Verify**: Confirm output JSON contains expected classification and metrics\n\n## Verification\n\n- [ ] Classification matches expected type (Skill\u002FPassiveContext\u002FHybrid)\n- [ ] Compression achieves target reduction (40-80% depending on level)\n- [ ] Compliance validator returns exit code 0\n- [ ] Output JSON is valid and contains all required fields\n\n## Scripts\n\n| Script                             | Purpose                                                      | Exit Codes                               |\n| ---------------------------------- | ------------------------------------------------------------ | ---------------------------------------- |\n| `analyze_skill_placement.ts`       | Classify content as Skill\u002FPassiveContext\u002FHybrid              | 0=success, 1=error                       |\n| `compress_markdown_content.ts`     | Compress markdown with token reduction metrics               | 0=success, 1=error, 2=config, 3=external |\n| `test_skill_passive_compliance.ts` | Validate compliance with decision framework                  | 0=pass, 1=violations                     |\n| `extract_and_index.ts`             | Extract sections into detail files with pipe-delimited index | 0=success, 1=error, 2=config, 3=external |\n| `path_validation.ts`               | Shared CWE-22 repo-root-anchored path validation             | N\u002FA (library module)                     |\n\n## Prerequisites\n\nBun runtime with `js-tiktoken` for token counting:\n\n```bash\nbun add js-tiktoken\n```\n\n`js-tiktoken` is an offline tokenizer (cl100k_base encoding) that approximates Claude tokenization. No API key is required.\n\n## Decision Framework\n\n### Use Passive Context For\n\n- Framework knowledge (APIs, patterns, conventions)\n- Always-needed information (constraints, protocols, gates)\n- Domain concepts (terminology, relationships)\n- Routing rules (comment classification, agent selection)\n- Reference data (memory indexes, skill catalogs)\n\n### Use Skills For\n\n- Tool-based actions (file modification, API calls, git operations)\n- User-triggered workflows (PR creation, issue management)\n- Multi-step procedures (conflict resolution, session completion)\n- Actions requiring validation (security scans, linting)\n- Versioned, team-reviewed instructions across projects\n\n### Hybrid Pattern\n\n- Knowledge in passive context (routing, classification)\n- Actions in skill (script execution, state changes)\n- Example: pr-comment-responder has routing in passive context, scripts in skill\n\n## Why This Matters\n\n| Configuration                 | Pass Rate |\n| ----------------------------- | --------- |\n| Baseline (no docs)            | 53%       |\n| Skill (default)               | 53%       |\n| Skill + explicit instructions | 79%       |\n| **AGENTS.md passive context** | **100%**  |\n\nSkills create decision points where agents must choose whether to retrieve documentation. These introduce 4 failure modes: late retrieval, partial retrieval, integration failure, and instruction fragility. Passive context eliminates all four by being always-available.\n\n## References\n\n- [Vercel: AGENTS.md outperforms skills](https:\u002F\u002Fvercel.com\u002Fblog\u002Fagents-md-outperforms-skills-in-our-agent-evals)\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Tool Details: Skill\u002FPassive Content Analyzer\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n**Script**: `scripts\u002Fanalyze_skill_placement.ts`\n\nAnalyzes skill content and recommends Skill, Passive Context, or Hybrid placement.\n\n**Classification Logic**:\n\n- **Tool Calls**: Bash, Read, Write, Edit, gh, git, pwsh commands -> Skill\n- **Action Verbs**: create, update, delete, execute, run -> Skill\n- **Reference Content**: Tables, lists, code blocks -> Passive\n- **User Triggers**: \"when user\", slash commands, explicit requests -> Skill\n- **Always-Needed**: \"always\", \"mandatory\", \"framework knowledge\" -> Passive\n\n**Usage**:\n\n```bash\n# Analyze a skill directory (from repo root)\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fanalyze_skill_placement.ts -p .claude\u002Fskills\u002Fgithub\n\n# Analyze a specific SKILL.md\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fanalyze_skill_placement.ts -p .claude\u002Fskills\u002Fgithub\u002FSKILL.md\n\n# Get detailed metrics\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fanalyze_skill_placement.ts -p .claude\u002Fskills\u002Fgithub -d\n```\n\n**Output**:\n\n```json\n{\n  \"classification\": \"Hybrid\",\n  \"confidence\": 85,\n  \"reasoning\": \"High tool execution (12 calls); High reference content ratio (0.75)\",\n  \"recommendations\": {\n    \"Passive\": [\"Routing Rules\", \"Classification Framework\"],\n    \"Skill\": [\"get-unaddressed-comments.ts\", \"post-pr-comment-reply.ts\"]\n  }\n}\n```\n\n**Classification Thresholds**:\n\n| Classification     | Criteria                            | Confidence |\n| ------------------ | ----------------------------------- | ---------- |\n| **Skill**          | skillScore > passiveScore + 3       | 70-90%     |\n| **PassiveContext** | passiveScore > skillScore + 3       | 70-90%     |\n| **Hybrid**         | abs(skillScore - passiveScore) \u003C= 3 | 50-70%     |\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Tool Details: Content Compression Utility\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n**Script**: `scripts\u002Fcompress_markdown_content.ts`\n\nCompress markdown to pipe-delimited format achieving 60-80% token reduction while maintaining 100% information density.\n\n**Compression Techniques**:\n\n- Convert tables to pipe-delimited: `|key: value|key2: value2|`\n- Extract headings to index: `[Section] |item1 |item2`\n- Strip redundant words (the, a, an, is, are)\n- Collapse whitespace and abbreviate common terms\n- Preserve code blocks\n\n**Usage**:\n\n```bash\n# Basic compression (JSON output to stdout)\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fcompress_markdown_content.ts -i README.md -l medium\n\n# Save to file with aggressive compression\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fcompress_markdown_content.ts -i CRITICAL-CONTEXT.md -l aggressive -o compressed.txt\n\n# With verbose metrics\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fcompress_markdown_content.ts -i input.md -l medium -v\n```\n\n**Compression Levels**:\n\n| Level      | Reduction | Techniques                             |\n| ---------- | --------- | -------------------------------------- |\n| Light      | 40-50%    | Headers, tables, whitespace            |\n| Medium     | 50-60%    | + redundant words, tighter whitespace  |\n| Aggressive | 60-80%    | + H3 compression, lists, abbreviations |\n\n**Example** (26 tokens -> 18 tokens, 31% reduction):\n\nBefore:\n\n```text\n## Session Protocol\n\nThe session protocol has multiple phases:\n\n1. Serena Activation - You must activate Serena\n```\n\nAfter:\n\n```text\n[Session Protocol]\nsession protocol has multiple phases:\n1. Serena Activation - activate Serena\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Tool Details: Extract-and-Index Utility\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n**Script**: `scripts\u002Fextract_and_index.ts`\n\nImplements the Vercel extract-and-index pattern for 60-80% token reduction. Splits markdown by headings into detail files, generates a compact pipe-delimited index.\n\n**Usage**:\n\n```bash\n# Extract sections and output JSON to stdout\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fextract_and_index.ts -i AGENTS.md -d .agents-details\n\n# Write index to a file\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fextract_and_index.ts -i AGENTS.md -d .agents-details -o AGENTS-INDEX.md\n\n# Custom reference path in index\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fextract_and_index.ts -i AGENTS.md -d .agents-details -r .agents-docs -o AGENTS-INDEX.md\n```\n\n**Output Index Format** (Vercel pattern):\n\n```text\n[Architecture]\n|Layered design with separation of concerns (see: .agents-details\u002Farchitecture.md)\n[Testing]\n|80% coverage required for business logic (see: .agents-details\u002Ftesting.md)\n```\n\nWorks with CLAUDE.md @import mechanism. Reference via `@AGENTS-INDEX.md`.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Tool Details: Compliance Validator\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n**Script**: `scripts\u002Ftest_skill_passive_compliance.ts`\n\nValidates content placement against the skill vs passive context decision framework.\n\n**6 Compliance Checks**:\n\n1. Skills contain actions (verbs, tool execution, scripts)\n2. Passive context is knowledge-only (no action patterns)\n3. CLAUDE.md under 200 lines (Anthropic recommendation)\n4. @imported files exist and are readable\n5. Skills have frontmatter (`name` and `description`)\n6. No duplicate content between skills and passive context\n\n**Usage**:\n\n```bash\n# Scan .claude directory (JSON output)\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Ftest_skill_passive_compliance.ts\n\n# Scan specific directory with table output\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Ftest_skill_passive_compliance.ts --path .claude\u002Fskills\u002Fgithub --format table\n```\n\n**Exit Codes**: 0 = all passed, 1 = violations detected\n\n**Common Violations**:\n\n| Violation                 | Fix                                             |\n| ------------------------- | ----------------------------------------------- |\n| CLAUDE.md too long        | Split into separate files, add @imports         |\n| Missing @import file      | Create file or remove @import directive         |\n| Skill missing frontmatter | Add `---` block with `name:` and `description:` |\n| Skill has no actions      | Add scripts or move to passive context          |\n| Passive has actions       | Extract executable content to a skill           |\n| Duplicate content         | Remove redundant content from skill or passive  |\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Classification Examples\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n### Clear Skill Classification\n\n**Input**: GitHub skill with gh pr create, gh issue close commands\n\n{\"classification\": \"Skill\", \"confidence\": 85, \"reasoning\": \"High tool execution (8 calls); Many action verbs (12)\"}\n\n### Clear Passive Classification\n\n**Input**: Memory hierarchy reference with tables and always-needed patterns\n\n```json\n{\"classification\": \"PassiveContext\", \"confidence\": 90, \"reasoning\": \"High reference content ratio (0.85); Always-needed information (5 indicators)\"}\n```\n\n### Hybrid Classification\n\n**Input**: PR comment responder with routing rules + script execution\n\n```json\n{\n  \"classification\": \"Hybrid\",\n  \"confidence\": 65,\n  \"reasoning\": \"High reference content ratio (0.72); Some tool execution (4 calls)\",\n  \"recommendations\": {\n    \"Passive\": [\"Routing Rules\", \"Classification Framework\"],\n    \"Skill\": [\"get-unaddressed-comments.ts\", \"post-pr-comment-reply.ts\"]\n  }\n}\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Testing\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n```bash\nbun test\n```\n\n**Coverage Summary**:\n\n| Component            | Tests       | Key Areas                                                          |\n| -------------------- | ----------- | ------------------------------------------------------------------ |\n| Compliance Validator | 19\u002F20 (95%) | Line count, @imports, frontmatter, duplicates, exit codes          |\n| Analyzer             | Full        | Tool calls, action verbs, classification logic, confidence scoring |\n| Extract-and-Index    | 36          | Slug generation, parsing, index format, 60%+ reduction targets     |\n| Compressor           | Full        | All levels, code block preservation, 40-80% reduction targets      |\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Implementation Notes\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n- **Language**: TypeScript (Bun runtime)\n- **Testing**: bun:test\n- **Exit codes**: Standardized (0 = success, non-zero = failure)\n- **Type safety**: Full TypeScript types and interfaces\n- **Cross-platform**: path module for platform-independent path handling\n\n### Marketplace Value\n\n- **Automated optimization**: Compress context without manual editing\n- **Quality gates**: Enforce best practices in CI\u002FCD\n- **Token savings**: 60-80% reduction = lower API costs\n\n\u003C\u002Fdetails>\n","# Context Optimizer\n\nTooling suite for optimizing Claude Code context placement. Passive context (AGENTS.md, @imports) achieves 100% pass rates versus 53-79% for skills by eliminating decision points.\n\n## Triggers\n\n- `analyze skill placement` - classify content as Skill vs Passive Context\n- `compress markdown` - reduce token count for context files\n- `validate compliance` - check skill\u002Fpassive context placement decisions\n- `optimize context` - lower API costs and improve agent performance\n- `extract and index` - split markdown into detail files with compact index\n\n## Process\n\n1. **Analyze**: Run `analyze_skill_placement.ts` to classify content\n2. **Compress**: Run `compress_markdown_content.ts` to reduce token counts\n3. **Validate**: Run `test_skill_passive_compliance.ts` to check compliance\n4. **Verify**: Confirm output JSON contains expected classification and metrics\n\n## Verification\n\n- [ ] Classification matches expected type (Skill\u002FPassiveContext\u002FHybrid)\n- [ ] Compression achieves target reduction (40-80% depending on level)\n- [ ] Compliance validator returns exit code 0\n- [ ] Output JSON is valid and contains all required fields\n\n## Scripts\n\n| Script                             | Purpose                                                      | Exit Codes                               |\n| ---------------------------------- | ------------------------------------------------------------ | ---------------------------------------- |\n| `analyze_skill_placement.ts`       | Classify content as Skill\u002FPassiveContext\u002FHybrid              | 0=success, 1=error                       |\n| `compress_markdown_content.ts`     | Compress markdown with token reduction metrics               | 0=success, 1=error, 2=config, 3=external |\n| `test_skill_passive_compliance.ts` | Validate compliance with decision framework                  | 0=pass, 1=violations                     |\n| `extract_and_index.ts`             | Extract sections into detail files with pipe-delimited index | 0=success, 1=error, 2=config, 3=external |\n| `path_validation.ts`               | Shared CWE-22 repo-root-anchored path validation             | N\u002FA (library module)                     |\n\n## Prerequisites\n\nBun runtime with `js-tiktoken` for token counting:\n\n```bash\nbun add js-tiktoken\n```\n\n`js-tiktoken` is an offline tokenizer (cl100k_base encoding) that approximates Claude tokenization. No API key is required.\n\n## Decision Framework\n\n### Use Passive Context For\n\n- Framework knowledge (APIs, patterns, conventions)\n- Always-needed information (constraints, protocols, gates)\n- Domain concepts (terminology, relationships)\n- Routing rules (comment classification, agent selection)\n- Reference data (memory indexes, skill catalogs)\n\n### Use Skills For\n\n- Tool-based actions (file modification, API calls, git operations)\n- User-triggered workflows (PR creation, issue management)\n- Multi-step procedures (conflict resolution, session completion)\n- Actions requiring validation (security scans, linting)\n- Versioned, team-reviewed instructions across projects\n\n### Hybrid Pattern\n\n- Knowledge in passive context (routing, classification)\n- Actions in skill (script execution, state changes)\n- Example: pr-comment-responder has routing in passive context, scripts in skill\n\n## Why This Matters\n\n| Configuration                 | Pass Rate |\n| ----------------------------- | --------- |\n| Baseline (no docs)            | 53%       |\n| Skill (default)               | 53%       |\n| Skill + explicit instructions | 79%       |\n| **AGENTS.md passive context** | **100%**  |\n\nSkills create decision points where agents must choose whether to retrieve documentation. These introduce 4 failure modes: late retrieval, partial retrieval, integration failure, and instruction fragility. Passive context eliminates all four by being always-available.\n\n## References\n\n- [Vercel: AGENTS.md outperforms skills](https:\u002F\u002Fvercel.com\u002Fblog\u002Fagents-md-outperforms-skills-in-our-agent-evals)\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Tool Details: Skill\u002FPassive Content Analyzer\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n**Script**: `scripts\u002Fanalyze_skill_placement.ts`\n\nAnalyzes skill content and recommends Skill, Passive Context, or Hybrid placement.\n\n**Classification Logic**:\n\n- **Tool Calls**: Bash, Read, Write, Edit, gh, git, pwsh commands -> Skill\n- **Action Verbs**: create, update, delete, execute, run -> Skill\n- **Reference Content**: Tables, lists, code blocks -> Passive\n- **User Triggers**: \"when user\", slash commands, explicit requests -> Skill\n- **Always-Needed**: \"always\", \"mandatory\", \"framework knowledge\" -> Passive\n\n**Usage**:\n\n```bash\n# Analyze a skill directory (from repo root)\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fanalyze_skill_placement.ts -p .claude\u002Fskills\u002Fgithub\n\n# Analyze a specific SKILL.md\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fanalyze_skill_placement.ts -p .claude\u002Fskills\u002Fgithub\u002FSKILL.md\n\n# Get detailed metrics\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fanalyze_skill_placement.ts -p .claude\u002Fskills\u002Fgithub -d\n```\n\n**Output**:\n\n```json\n{\n  \"classification\": \"Hybrid\",\n  \"confidence\": 85,\n  \"reasoning\": \"High tool execution (12 calls); High reference content ratio (0.75)\",\n  \"recommendations\": {\n    \"Passive\": [\"Routing Rules\", \"Classification Framework\"],\n    \"Skill\": [\"get-unaddressed-comments.ts\", \"post-pr-comment-reply.ts\"]\n  }\n}\n```\n\n**Classification Thresholds**:\n\n| Classification     | Criteria                            | Confidence |\n| ------------------ | ----------------------------------- | ---------- |\n| **Skill**          | skillScore > passiveScore + 3       | 70-90%     |\n| **PassiveContext** | passiveScore > skillScore + 3       | 70-90%     |\n| **Hybrid**         | abs(skillScore - passiveScore) \u003C= 3 | 50-70%     |\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Tool Details: Content Compression Utility\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n**Script**: `scripts\u002Fcompress_markdown_content.ts`\n\nCompress markdown to pipe-delimited format achieving 60-80% token reduction while maintaining 100% information density.\n\n**Compression Techniques**:\n\n- Convert tables to pipe-delimited: `|key: value|key2: value2|`\n- Extract headings to index: `[Section] |item1 |item2`\n- Strip redundant words (the, a, an, is, are)\n- Collapse whitespace and abbreviate common terms\n- Preserve code blocks\n\n**Usage**:\n\n```bash\n# Basic compression (JSON output to stdout)\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fcompress_markdown_content.ts -i README.md -l medium\n\n# Save to file with aggressive compression\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fcompress_markdown_content.ts -i CRITICAL-CONTEXT.md -l aggressive -o compressed.txt\n\n# With verbose metrics\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fcompress_markdown_content.ts -i input.md -l medium -v\n```\n\n**Compression Levels**:\n\n| Level      | Reduction | Techniques                             |\n| ---------- | --------- | -------------------------------------- |\n| Light      | 40-50%    | Headers, tables, whitespace            |\n| Medium     | 50-60%    | + redundant words, tighter whitespace  |\n| Aggressive | 60-80%    | + H3 compression, lists, abbreviations |\n\n**Example** (26 tokens -> 18 tokens, 31% reduction):\n\nBefore:\n\n```text\n## Session Protocol\n\nThe session protocol has multiple phases:\n\n1. Serena Activation - You must activate Serena\n```\n\nAfter:\n\n```text\n[Session Protocol]\nsession protocol has multiple phases:\n1. Serena Activation - activate Serena\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Tool Details: Extract-and-Index Utility\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n**Script**: `scripts\u002Fextract_and_index.ts`\n\nImplements the Vercel extract-and-index pattern for 60-80% token reduction. Splits markdown by headings into detail files, generates a compact pipe-delimited index.\n\n**Usage**:\n\n```bash\n# Extract sections and output JSON to stdout\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fextract_and_index.ts -i AGENTS.md -d .agents-details\n\n# Write index to a file\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fextract_and_index.ts -i AGENTS.md -d .agents-details -o AGENTS-INDEX.md\n\n# Custom reference path in index\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fextract_and_index.ts -i AGENTS.md -d .agents-details -r .agents-docs -o AGENTS-INDEX.md\n```\n\n**Output Index Format** (Vercel pattern):\n\n```text\n[Architecture]\n|Layered design with separation of concerns (see: .agents-details\u002Farchitecture.md)\n[Testing]\n|80% coverage required for business logic (see: .agents-details\u002Ftesting.md)\n```\n\nWorks with CLAUDE.md @import mechanism. Reference via `@AGENTS-INDEX.md`.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Tool Details: Compliance Validator\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n**Script**: `scripts\u002Ftest_skill_passive_compliance.ts`\n\nValidates content placement against the skill vs passive context decision framework.\n\n**6 Compliance Checks**:\n\n1. Skills contain actions (verbs, tool execution, scripts)\n2. Passive context is knowledge-only (no action patterns)\n3. CLAUDE.md under 200 lines (Anthropic recommendation)\n4. @imported files exist and are readable\n5. Skills have frontmatter (`name` and `description`)\n6. No duplicate content between skills and passive context\n\n**Usage**:\n\n```bash\n# Scan .claude directory (JSON output)\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Ftest_skill_passive_compliance.ts\n\n# Scan specific directory with table output\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Ftest_skill_passive_compliance.ts --path .claude\u002Fskills\u002Fgithub --format table\n```\n\n**Exit Codes**: 0 = all passed, 1 = violations detected\n\n**Common Violations**:\n\n| Violation                 | Fix                                             |\n| ------------------------- | ----------------------------------------------- |\n| CLAUDE.md too long        | Split into separate files, add @imports         |\n| Missing @import file      | Create file or remove @import directive         |\n| Skill missing frontmatter | Add `---` block with `name:` and `description:` |\n| Skill has no actions      | Add scripts or move to passive context          |\n| Passive has actions       | Extract executable content to a skill           |\n| Duplicate content         | Remove redundant content from skill or passive  |\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Classification Examples\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n### Clear Skill Classification\n\n**Input**: GitHub skill with gh pr create, gh issue close commands\n\n{\"classification\": \"Skill\", \"confidence\": 85, \"reasoning\": \"High tool execution (8 calls); Many action verbs (12)\"}\n\n### Clear Passive Classification\n\n**Input**: Memory hierarchy reference with tables and always-needed patterns\n\n```json\n{\"classification\": \"PassiveContext\", \"confidence\": 90, \"reasoning\": \"High reference content ratio (0.85); Always-needed information (5 indicators)\"}\n```\n\n### Hybrid Classification\n\n**Input**: PR comment responder with routing rules + script execution\n\n```json\n{\n  \"classification\": \"Hybrid\",\n  \"confidence\": 65,\n  \"reasoning\": \"High reference content ratio (0.72); Some tool execution (4 calls)\",\n  \"recommendations\": {\n    \"Passive\": [\"Routing Rules\", \"Classification Framework\"],\n    \"Skill\": [\"get-unaddressed-comments.ts\", \"post-pr-comment-reply.ts\"]\n  }\n}\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Testing\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n```bash\nbun test\n```\n\n**Coverage Summary**:\n\n| Component            | Tests       | Key Areas                                                          |\n| -------------------- | ----------- | ------------------------------------------------------------------ |\n| Compliance Validator | 19\u002F20 (95%) | Line count, @imports, frontmatter, duplicates, exit codes          |\n| Analyzer             | Full        | Tool calls, action verbs, classification logic, confidence scoring |\n| Extract-and-Index    | 36          | Slug generation, parsing, index format, 60%+ reduction targets     |\n| Compressor           | Full        | All levels, code block preservation, 40-80% reduction targets      |\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Implementation Notes\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n- **Language**: TypeScript (Bun runtime)\n- **Testing**: bun:test\n- **Exit codes**: Standardized (0 = success, non-zero = failure)\n- **Type safety**: Full TypeScript types and interfaces\n- **Cross-platform**: path module for platform-independent path handling\n\n### Marketplace Value\n\n- **Automated optimization**: Compress context without manual editing\n- **Quality gates**: Enforce best practices in CI\u002FCD\n- **Token savings**: 60-80% reduction = lower API costs\n\n\u003C\u002Fdetails>\n",{"name":5,"model":40,"agents":41,"license":15,"metadata":43,"description":7,"allowed-tools":46,"user-invocable":49},"claude-sonnet-4-6",[42,26],"analyst",{"version":44,"timelessness":45},"1.1.0","8\u002F10",[47,27,48],"Read","Glob",true,"main","2bd10cb7ca989f88dbf338b57957763718eda59b","templates\u002Fskills\u002Fcontext-optimizer","https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain","https:\u002F\u002Fgithub.com\u002Floriensleafs","2026-03-11 23:51:59",{"source":8,"skillName":5,"commands":57,"prompt":67,"zipAvailable":49},[58,61,64],{"tool":59,"command":60},"npx","npx skills add loriensleafs\u002Fbrain --skill context-optimizer",{"tool":62,"command":63},"bunx","bunx skills add loriensleafs\u002Fbrain --skill context-optimizer",{"tool":65,"command":66},"pnpm","pnpm dlx skills add loriensleafs\u002Fbrain --skill context-optimizer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fcontext-optimizer\u002FSKILL.md",[69,75,81,87,91,95,99],{"path":70,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":74},"assets\u002Fnetwork-policy-template.yaml","ASSET","资产文件",3157,"https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fexternal_plugins\u002Fkubernetes-operations\u002Fskills\u002Fk8s-security-policies\u002Fassets\u002Fnetwork-policy-template.yaml",{"path":76,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":79,"sourceHtmlUrl":80},"references\u002Frbac-patterns.md","REFERENCE","参考文档",4076,"https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fexternal_plugins\u002Fkubernetes-operations\u002Fskills\u002Fk8s-security-policies\u002Freferences\u002Frbac-patterns.md",{"path":82,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":85,"sourceHtmlUrl":86},"scripts\u002Fanalyze_skill_placement.ts","SCRIPT","脚本",10105,"https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fcontext-optimizer\u002Fscripts\u002Fanalyze_skill_placement.ts",{"path":88,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":89,"sourceHtmlUrl":90},"scripts\u002Fcompress_markdown_content.ts",12313,"https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fcontext-optimizer\u002Fscripts\u002Fcompress_markdown_content.ts",{"path":92,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":93,"sourceHtmlUrl":94},"scripts\u002Fextract_and_index.ts",8485,"https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fcontext-optimizer\u002Fscripts\u002Fextract_and_index.ts",{"path":96,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":97,"sourceHtmlUrl":98},"scripts\u002Fpath_validation.ts",2750,"https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fcontext-optimizer\u002Fscripts\u002Fpath_validation.ts",{"path":100,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":101,"sourceHtmlUrl":102},"scripts\u002Ftest_skill_passive_compliance.ts",17954,"https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fcontext-optimizer\u002Fscripts\u002Ftest_skill_passive_compliance.ts",[104,120,135,157,173,196],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":35},"01M6CD3KHDHPR633RVP95G4XWN","validation-authority","Treat upstream validators as authoritative. Align local config to them. Use when validation fails unexpectedly, before modifying validator behavior, or when tempted to change upstream tool code.","https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fvalidation-authority\u002FSKILL.md",[],[111,112,113,114,115,116,117,26,118,119],"validation authority","validation","config","use","implementer","behavior","tool","code","change",{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":35},"01M6CD3H29Q8FWN9YETT8YVQTS","using-brain-memory","Guidance for using Brain semantic memory effectively. Applies Zettelkasten atomic note principles with observations and relations. Use when deciding whether to query or create notes, structuring note content, or understanding the semantic knowledge graph.","https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fusing-forgetful-memory\u002FSKILL.md",[],[127,128,24,129,130,131,132,114,19,133,134],"using brain memory","memory","create","notes","graph","guidance","knowledge","knowledge graph",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":35},"01M6CD3E2KTTMNSWXRJAAZA7D1","threat-modeling","Structured security analysis using OWASP Four-Question Framework and STRIDE methodology. Generates threat matrices with risk ratings, mitigations, and prioritization. Use for attack surface analysis, security architecture review, or when asking what can go wrong.","https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fthreat-modeling\u002FSKILL.md",[],[142,143,144,114,145,26,146,147,148,149,150,151,23,152,153,154,155,156],"threat","threat modeling","prioritization","question","architecture review","stride","analysis","risk","owasp","methodology","security analysis","architecture","security","go","review",{"skillNo":158,"name":159,"nameZh":6,"description":160,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":163,"publishedAt":35},"01M6CD3BC6G0Q2MDNW6X51XHBQ","taste-lints","Custom lints with agent-readable remediation instructions. Enforces taste invariants (file size, naming conventions, structured logging, complexity) and surfaces errors that agents can act on directly. Use when writing or reviewing code to catch style violations early.","https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Ftaste-lints\u002FSKILL.md",[],[164,115,165,166,114,167,168,169,170,171,118,172],"taste lints","surfaces","complexity","instructions","remediation","file","logging","qa","writing",{"skillNo":174,"name":175,"nameZh":6,"description":176,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":177,"categories":178,"keywords":179,"publishedAt":35},"01M6CD37Z7VD22BH42TG0GM66V","style-enforcement","Validate code against style rules from .editorconfig, StyleCop.json, and Directory.Build.props. Detects line ending violations, naming convention issues, indentation problems, and charset mismatches across C#, Python, TypeScript, and JavaScript. Produces JSON reports for pre-commit hooks and CI pipelines.","https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fstyle-enforcement\u002FSKILL.md",[],[180,181,182,183,184,185,115,186,187,188,189,190,171,191,118,22,192,193,194,195],"style enforcement","enforcement","ci","pipelines","directory","hooks","Rules","json","pre-commit","editorconfig","reports","issues","commit","javascript","python","typescript",{"skillNo":197,"name":198,"nameZh":199,"description":200,"descriptionZh":201,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":202,"categories":203,"keywords":214,"publishedAt":35},"01M6CD35JW73TPMCZBF9DTDEE8","steering-matcher","引导规则路径匹配","Match file paths against steering file glob patterns to determine applicable steering guidance. Use when orchestrator needs to inject context-aware guidance based on files being modified.","将文件路径与引导文件的 glob 模式进行匹配，以确定适用的引导规范。适用于编排器需要根据被修改的文件注入上下文感知的指导时。","https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fsteering-matcher\u002FSKILL.md",[204,209],{"categoryNo":205,"categoryName":206,"taxonomyType":207,"taxonomyTypeDesc":208},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":210,"categoryName":211,"taxonomyType":212,"taxonomyTypeDesc":213},"01M8BSAA4FBTWZP6X98STEHG99","智能体开发","SCENARIO","使用场景",[215,114,216,217,19,218,132,169],"steering matcher","files","haiku","orchestrator"]