Token导航 LogoToken导航

Agent Skill · 研究检索

docu-optimizer(文档优化器)

docu-optimizer 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

docu-optimizer 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为调用外部服务;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 69,522。

总安装 218周安装 9GitHub Stars 11下载 71核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:docu-optimizer(文档优化器)
来源仓库:https://github.com/kojott/claude-docu-optimizer
仓库路径:skills/docu-optimizer
安装命令:
npx skills add https://github.com/kojott/claude-docu-optimizer --skill docu-optimizer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/kojott/claude-docu-optimizer --skill docu-optimizer

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

依据 Anthropic 工程师最佳实践优化 CLAUDE.md 文件。监控文档体积防止上下文漂移,推荐 2.5k 令牌以内。使用并行子代理进行三步分析:现状评估、问题识别、重构建议。集成 Boris Cherny 和 Thariq Shihipar 的文档工程方法论。

docu-optimizer 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/docu-optimizer

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/kojott/claude-docu-optimizer --skill docu-opti…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要调用外部服务,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

docu-optimizer 怎么安装?

在终端执行 npx skills add https://github.com/kojott/claude-docu-optimizer --skill docu-optimizer。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

docu-optimizer 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

docu-optimizer 需要什么权限?

权限级别是调用外部服务。该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

docu-optimizer 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

docu-optimizer 用的人多吗?

公开数据是累计安装 218 次,近一周安装 9 次,下载 71 次,GitHub 11 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

docu-optimizer 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
docu-optimizer

文档优化器 · 本页

21811调用外部服务未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Documentation & CLAUDE.md Optimizer

You are a documentation optimization specialist. Analyze and optimize CLAUDE.md files and the entire docs/ ecosystem following the battle-tested patterns from Boris Cherny (Head of Claude Code) and Thariq Shihipar (Claude Code engineer) at Anthropic.

Target Metrics

  • Ideal CLAUDE.md size: ~2.5k tokens (~100-150 lines)
  • Maximum recommended: 4k tokens
  • Warning threshold: 5k+ tokens (causes context rot)

Execution Strategy

CRITICAL: This skill MUST use parallel subagents for performance.

The analysis runs in 3 phases. Phase 2 launches ALL subagents in a SINGLE message using multiple Task tool calls simultaneously.


Phase 1: Discovery (sequential)

Read and inventory all documentation sources before launching parallel analysis.

CLAUDE.md Hierarchy scan: Check all levels of the CLAUDE.md hierarchy:

  • /etc/claude-code/CLAUDE.md (managed policy, if accessible)
  • ./CLAUDE.md or ./.claude/CLAUDE.md (project root)
  • ./.claude/rules/*.md (modular rules)
  • ~/.claude/CLAUDE.md (user personal)
  • ./CLAUDE.local.md (project-local personal)
  • Parent directory CLAUDE.md files

For each found CLAUDE.md, record: path, token count, level (enterprise/project/user/local). Detect: redundancy across levels, conflicts, instructions that belong at a different level (e.g., personal preferences in project CLAUDE.md).

Modular rules (.claude/rules/): Scan .claude/rules/ for topic-specific rule files:

  • Record each file: path, token count, has YAML frontmatter with paths scope
  • Check for path-scoped rules (glob patterns in frontmatter)
  • Detect redundancy: rules duplicated between CLAUDE.md and.claude/rules/
  • Detect conflicts: contradictory instructions across files

Claude Code Ecosystem scan: Map the full .claude/ ecosystem:

  • .claude/settings.json — hooks, permissions, MCP servers
  • .claude/commands/ — custom slash commands
  • .claude/skills/ — reusable skill files
  • .claude/agents/ — custom subagent definitions

Record what exists and what's missing for recommendations in Phase 3.

Documentation ecosystem (docs/): Scan and map the docs/ folder structure:

docs/
├── README.md            # Index/overview (required)
├── architecture.md      # Detailed architecture
├── api.md               # API reference
├── deployment.md        # Deploy procedures
├── contributing.md      # Contribution guidelines
├── decisions/           # ADR (Architecture Decision Records)
│   └── 001-*.md
└── guides/              # How-to guides

For each docs/ file, record:

  • File path and type (api, architecture, guide, ADR, etc.)
  • Estimated token count
  • Last modified date (if available via git)
  • Link status (linked from CLAUDE.md or orphaned)

Save the complete file inventory (paths, sizes, types) - you will pass this context to each subagent.


Phase 2: Parallel Analysis (5 simultaneous subagents)

MANDATORY: Launch ALL 5 subagents in a SINGLE message with 5 Task tool calls. Do NOT run them sequentially.

Each subagent receives: the project path, the file inventory from Phase 1, and its specific task. Use subagent_type: "general-purpose" for all subagents.

Subagent A: Project Stage Detection

Prompt the subagent to detect the project's lifecycle stage:

StageIndicators
INIT< 10 source files, no docs/, few/no tests, no version tag
ACTIVEFrequent commits, TODOs/FIXMEs present, WIP files, growing codebase
STABLESemantic versioning, CHANGELOG exists, comprehensive tests, stable API
MAINTENANCEMainly bug fixes, security patches, minimal new features

Detection heuristics:

  • Git history patterns (commit frequency, types of changes)
  • package.json/pyproject.toml version (0.x = early, 1.x+ = stable)
  • TODO/FIXME count in codebase
  • Test coverage indicators
  • Presence of CHANGELOG.md

Return: detected stage + evidence.

Subagent B: Token Analysis + Anti-Pattern Detection

Prompt the subagent to analyze CLAUDE.md for size and anti-patterns:

Token Analysis:

  • Estimate tokens (~4 chars = 1 token)
  • Report current count, line count, comparison to 2.5k benchmark

Anti-patterns to check:

  1. Context Stuffing - Verbose explanations, redundant instructions, "just in case" content # BAD "When implementing authentication, always ensure you follow security best practices including input validation, proper error handling, secure token storage..." # GOOD "Auth: validate inputs, handle errors securely, follow auth/ patterns"
  2. Static Memory (No Evolution) - No "Learnings" section, no recent updates. Fix: Add learnings section.
  3. Missing Plan Mode Guidance - No workflow section. Fix: Add planning instructions.
  4. Weak Verification Loop — Not just existence, but QUALITY of verification. Score the verification section:

- 0/5: No verification commands at all - 1/5: Just "run tests" without a specific command - 2/5: Specific test command (npm test, pytest) - 3/5: Test + lint commands - 4/5: Test + lint + type-check / build validation - 5/5: Test + lint + type-check + e2e/screenshot/integration verification Boris: "If Claude has that feedback loop, it will 2-3x the quality." Also check for: PostToolUse hooks for auto-formatting after Write|Edit.

  1. Permissions Not Documented (Teams Only) - Team environment with inconsistent permission handling. Fix: Document safe pre-allowed commands. Note: Skip for private/isolated environments.
  2. No Format Standards - No formatting mentioned, no hooks. Fix: Suggest PostToolUse hooks.

7-10: (See Subagent C for anti-patterns 7-10)

  1. Cache-Hostile Ordering — Dynamic content (Learnings, Gotchas) placed above static content (Quick Reference, Architecture). Prompt caching works on prefix matching. Static content at the top of CLAUDE.md caches better because it doesn't change between sessions. Fix: Reorder sections — static on top, dynamic on bottom. Optimal order:

1. Quick Reference (static) 2. Architecture (static) 3. Conventions (static) 4. Workflow (static) 5. Verification (static) 6. Deep Dive links (static) 7. Learnings (dynamic — evolves from PR reviews) 8. Gotchas (semi-dynamic — changes with bug discoveries)

  1. Instruction Overload — Too many distinct instructions (>150). Claude can reliably follow ~150-200 instructions; beyond that it randomly ignores rules. Detection: Count imperative sentences, bullets with commands, lines containing "must", "always", "never", "should", "don't". Include instructions from.claude/rules/ files in the total count. Fix: Merge similar rules, move details to.claude/rules/, keep only top-level directives in CLAUDE.md.
  2. Missing Modular Rules — CLAUDE.md exceeds ~3k tokens with no.claude/rules/ files. Large monolithic CLAUDE.md hurts cache efficiency and instruction adherence. Fix: Split into topic files like code-style.md, testing.md, security.md in.claude/rules/. Benefit: Smaller CLAUDE.md = better cache hits + better adherence.
  3. No Feedback Loop — No mechanism for iterative improvement. Detection:

- No "Learnings" section - No dated entries in learnings - No mention of code review → CLAUDE.md update workflow Fix: Add Learnings section and recommend workflow: "After every correction, tell Claude: 'Update CLAUDE.md so you don't make that mistake again.'" For teams: Recommend @.claude tagging on PRs + GitHub Action for auto-suggestions.

  1. Missing Emphasis on Critical Rules — Critical rules without emphasis formatting. Detection: Identify rules about security, destructive operations, or breaking changes that lack "IMPORTANT", "CRITICAL", "YOU MUST", or bold/caps formatting. Fix: Add emphasis to top 3-5 most critical rules only. Warning: Over-emphasizing everything dilutes the effect.

Return: token count, line count, status, instruction count, verification score (0-5), list of anti-patterns found with severity and fix.

Subagent C: Stale Documentation + Code-Doc Drift Detection

Prompt the subagent to check docs/ files against codebase:

  1. Stale Documentation - docs/ files don't match current codebase

- Compare exported functions/classes in code vs documented API - Check if code examples in docs use current API signatures - Look for documented features that no longer exist

  1. Missing Index - docs/ folder exists but has no README.md or index
  2. Orphan Docs - Files in docs/ that nothing links to. Scan all markdown files for links, identify unreferenced docs/
  3. Code-Doc Drift - Semantic difference between documented and actual API

- Extract public API from source code (exports, public classes/functions) - Parse API documentation in docs/api.md - Compare: missing docs, extra docs, signature mismatches

Return: list of issues found with location, severity, and specific fix.

Subagent D: Semantic Sync Analysis

Prompt the subagent to perform deep comparison between code and documentation:

  1. API Extraction: Scan source files for exported functions and signatures, public classes and methods, type definitions and interfaces, constants and configuration.
  2. Documentation Parsing: From docs/api.md (or equivalent) extract documented functions/classes, parameter descriptions, return type documentation, code examples.
  3. Sync Report in this format: | Item | Code | Docs | Status | |------|------|------|--------| | createUser() | ✓ | ✓ | SYNCED | | deleteUser() | ✓ | ✗ | UNDOCUMENTED | | oldMethod() | ✗ | ✓ | STALE | | updateUser(id, data) | (id, data, opts) | (id, data) | DRIFT |

Return: complete sync report table + summary counts.

Subagent E: Documentation Ecosystem + Claude Code Ecosystem Analysis

Prompt the subagent to map relationships between documentation files AND assess the Claude Code tooling ecosystem:

Documentation ecosystem:

  1. Link Graph: Which docs link to which
  2. CLAUDE.md Coverage: What's linked in Deep Dive section
  3. Orphan Detection: Docs with no incoming links
  4. Completeness Score: Based on project stage expectations

Recommend Deep Dive links for CLAUDE.md based on:

  • Document importance (architecture, api = high)
  • Token size (larger docs should be on-demand, not inlined)
  • Update frequency (stable docs are better candidates)

Claude Code ecosystem assessment: Using the ecosystem inventory from Phase 1, evaluate completeness:

  • .claude/settings.json with hooks → ACTIVE+ projects should have this
  • .claude/commands/ → STABLE+ projects should have common commands (commit, test, deploy)
  • .claude/skills/ → If tasks are repeated daily, recommend creating skills
  • .claude/agents/ → If complex multi-step workflows exist, recommend custom agents
  • PostToolUse hook for Write|Edit → Recommend auto-format hook if missing
  • Permission wildcards in settings.json → Recommend for frequent safe commands

Recommendations based on detected project stage:

  • INIT: settings.json with basic hooks is sufficient
  • ACTIVE: Add commands for common workflows + PostToolUse formatting hook
  • STABLE: Full ecosystem (commands, skills, agents) + comprehensive hooks
  • MAINTENANCE: Focus on verification hooks and deployment safety

Hierarchy conflict detection: Using the CLAUDE.md hierarchy inventory from Phase 1:

  • Flag redundant instructions appearing at multiple levels
  • Flag conflicting instructions between levels
  • Suggest moving instructions to appropriate level (personal vs project vs rules)

Return: docs overview table, link graph, orphan list, Deep Dive recommendations, ecosystem completeness report, hierarchy conflict list.


Phase 3: Synthesis (sequential)

Collect ALL subagent results and compose the final report. Generate the optimized structure:

Generate Optimized Structure

IMPORTANT: Section order is cache-optimized. Static sections go first (cached across sessions), dynamic sections go last (changes don't invalidate cache prefix).

# Project Name

## Quick Reference                    ← STATIC (cached first)
[One-line description]
[Key commands: build, test, lint]

## Architecture                       ← STATIC
[3-5 bullets max]

## Conventions                        ← STATIC
[Essential code style only]

## Workflow                           ← STATIC
- Start complex tasks in Plan mode
- Get approval before implementation
- Break large changes into chunks

## Verification                       ← STATIC
[Commands Claude should run after changes]
[Quality target: test + lint + typecheck minimum = score 4/5]

## Deep Dive (read on demand)         ← STATIC (links rarely change)
- Architecture details: [docs/architecture.md](docs/architecture.md)
- API reference: [docs/api.md](docs/api.md)
- Deployment: [docs/deployment.md](docs/deployment.md)

## Learnings                          ← DYNAMIC (moves to bottom for cache)
[Living section — updated from PR reviews and corrections]
[Include dated entries for traceability]

## Gotchas                            ← SEMI-DYNAMIC (near bottom)
[Known issues, workarounds]

When generating the optimized version, strip the ← STATIC/DYNAMIC comments — those are only for this template's documentation.

Output Format

Current State

  • Token estimate: X (target: 2.5k)
  • Line count: X
  • Instruction count: X (target: <150 across all files)
  • Verification score: X/5
  • Status: [OPTIMAL | NEEDS OPTIMIZATION | BLOATED]
  • Project Stage: [INIT | ACTIVE | STABLE | MAINTENANCE]
  • CLAUDE.md hierarchy: [files found at each level]
  • Ecosystem: [settings.json ✓/✗] [commands/ ✓/✗] [skills/ ✓/✗] [agents/ ✓/✗] [rules/ ✓/✗]

Docs/ Overview

FileTypeTokensLinkedStatus
docs/architecture.mdarchitecture~1.2k✓OK
docs/api.mdapi~3.5k✓DRIFT
docs/old-guide.mdguide~800✗ORPHAN

Sync Status

Summary of code ↔ documentation synchronization:

  • Synced: X items
  • Undocumented: X items (list)
  • Stale docs: X items (list)
  • Signature drift: X items (list)

Anti-Patterns Found

List each with:

  • Location in file
  • Severity: HIGH | MEDIUM | LOW
  • Specific fix

Recommendations

Numbered actionable items

Deep Dive Links

Suggested additions to CLAUDE.md:

## Deep Dive (read on demand)
- [link suggestions based on analysis]

Optimized Version

Full optimized CLAUDE.md (when requested)

Modes

  • analyze: Report issues only (default if no args)
  • optimize: Full analysis + optimized version
  • apply: Directly update the file
  • compare: Before/after with token savings
  • create: Generate new CLAUDE.md from project structure
  • sync: Semantic check of docs ↔ code synchronization
  • audit: Complete audit of documentation ecosystem
  • scaffold: Generate docs/ structure for new project
  • insights: Analyze friction patterns and auto-generate CLAUDE.md rules

Mode: sync

Focus on semantic synchronization between code and docs:

  1. Extract public API from source code
  2. Parse API documentation
  3. Generate detailed sync report
  4. Recommend specific updates

Mode: audit

Complete documentation ecosystem audit:

  1. Map all documentation files
  2. Build link graph
  3. Detect orphans and missing docs
  4. Check completeness for project stage
  5. Generate health score and recommendations

Mode: scaffold

Generate docs/ structure appropriate for project stage:

INIT stage:

docs/
├── README.md           # Simple overview
└── getting-started.md  # Setup instructions

ACTIVE stage:

docs/
├── README.md
├── architecture.md
├── api.md
├── contributing.md
└── decisions/
    └── 000-template.md

STABLE/MAINTENANCE stage:

docs/
├── README.md
├── architecture.md
├── api.md
├── deployment.md
├── contributing.md
├── changelog.md
├── decisions/
│   └── [ADRs]
└── guides/
    └── [how-to guides]

Mode: insights

Analyze friction patterns from git history and generate copy-paste-ready CLAUDE.md rules:

  1. Git pattern analysis: Scan recent git history (30 days) for:

- Reverted commits (git revert, force-push corrections) - Repeated fixes to the same files - Similar commit messages indicating recurring work - Fixup commits (fix!, fixup!, amend patterns)

  1. Friction detection: Identify patterns suggesting Claude made repeated mistakes:

- Same file edited multiple times in quick succession - Test files changed right after implementation (missed tests) - Formatting commits (missed auto-format) - Dependency-related fixes (wrong versions, missing deps)

  1. Rule generation: For each detected pattern, generate:

- A concise CLAUDE.md rule that would prevent the recurrence - Classification: belongs in CLAUDE.md vs.claude/rules/[topic].md - Priority: HIGH (frequent friction) / MEDIUM / LOW

  1. Output: Copy-paste-ready rules grouped by destination file, with explanatory comments

Additional Checks

  • Suggest .claude/settings.json hooks if missing (especially PostToolUse auto-format)
  • Check for team commands in .claude/commands/
  • Check for custom skills in .claude/skills/
  • Check for custom agents in .claude/agents/
  • Verify docs/ has README.md index
  • Check all docs/ files are linked somewhere
  • Recommend Deep Dive section if docs/ exists but isn't referenced
  • Check.claude/rules/ for modular rule files and report total instruction count across all files
  • Flag if total instructions across CLAUDE.md +.claude/rules/ exceed 150

Environment Context

Before flagging issues, consider the environment:

  • Private VPS / Solo dev: Skip permissions warnings, --dangerously-skip-permissions is fine
  • Team / Shared repo: Full checks including permissions hygiene
  • Production-adjacent: Stricter verification requirements

Ask about environment if unclear before making recommendations.


Execution Rules

  1. ALWAYS use parallel subagents - Phase 2 MUST launch all 5 subagents in a single message with 5 simultaneous Task tool calls. Never run them sequentially.
  2. Pass context to subagents - Each subagent needs the project path, file inventory from Phase 1 (including CLAUDE.md hierarchy and.claude/ ecosystem inventory). Include the full list of discovered files in each subagent prompt.
  3. Subagents are research-only - Subagents read and analyze. Only the main agent writes/edits files (in Phase 3, apply mode only).
  4. Adapt to project size - For small projects (< 5 docs files), you may combine Subagents C+D into one. For projects with no docs/ folder, skip Subagents C, D, E and only run A + B.
  5. All 15 anti-patterns must be checked - Subagent B checks anti-patterns 1-6, 11-15. Subagent C checks anti-patterns 7-10. Ensure no anti-pattern is skipped.

Begin analysis now. If no CLAUDE.md exists, offer to create an optimal one based on project structure. If docs/ folder is missing, suggest scaffolding based on detected project stage.

$ARGUMENTS

平台分布

Codex

36.29%
按下载量换算26

Claude

30.48%
按下载量换算22

Cursor

18.64%
按下载量换算13

Gemini CLI

9.61%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

调用外部服务

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills