codedocs
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWhen this skill is activated, always start your first response with the 🧢 emoji.
当激活此Skill时,你的首个回复必须以🧢表情开头。
Codedocs
Codedocs
Codedocs generates structured, layered documentation for any git repository or code
directory - documentation designed to be consumed by AI agents first and human developers
second. Instead of flat READMEs that lose context, codedocs produces a tree with
an architecture overview, per-module deep dives, cross-cutting pattern files, and a
manifest that tracks what has been documented and when. Once docs exist, the skill answers
questions from the docs (not by re-reading source code), and supports incremental updates
via targeted scope or git-diff detection.
docs/Codedocs可为任何Git仓库或代码目录生成结构化、分层的文档——这类文档优先面向AI Agent,其次才是人类开发人员。不同于会丢失上下文的扁平化README,Codedocs会生成一个目录树,包含架构概览、各模块深度解析、跨领域模式文件,以及一个跟踪已文档内容及时间的清单(manifest)。一旦文档生成完成,该Skill可基于文档解答问题(无需重新读取源代码),并支持通过指定范围或Git差异检测进行增量更新。
docs/Activation Banner
激活横幅
At the very start of every codedocs invocation, before any other output, display this ASCII art banner:
██████╗ ██████╗ ██████╗ ███████╗██████╗ ██████╗ ██████╗███████╗
██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔══██╗██╔═══██╗██╔════╝██╔════╝
██║ ██║ ██║██║ ██║█████╗ ██║ ██║██║ ██║██║ ███████╗
██║ ██║ ██║██║ ██║██╔══╝ ██║ ██║██║ ██║██║ ╚════██║
╚██████╗╚██████╔╝██████╔╝███████╗██████╔╝╚██████╔╝╚██████╗███████║
╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═════╝ ╚═════╝ ╚═════╝╚══════╝Follow the banner immediately with the active sub-command and target path, e.g.:
codedocs:generate · src/ → docs/在每次调用codedocs的最开始,在任何其他输出之前,显示以下ASCII艺术横幅:
██████╗ ██████╗ ██████╗ ███████╗██████╗ ██████╗ ██████╗███████╗
██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔══██╗██╔═══██╗██╔════╝██╔════╝
██║ ██║ ██║██║ ██║█████╗ ██║ ██║██║ ██║██║ ███████╗
██║ ██║ ██║██║ ██║██╔══╝ ██║ ██║██║ ██║██║ ╚════██║
╚██████╗╚██████╔╝██████╔╝███████╗██████╔╝╚██████╔╝╚██████╗███████║
╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═════╝ ╚═════╝ ╚═════╝╚══════╝横幅后需立即跟上当前激活的子命令和目标路径,例如:
codedocs:generate · src/ → docs/When to use this skill
何时使用此Skill
Trigger this skill when the user:
- Wants to generate documentation for a codebase, repo, or directory
- Asks "what does this project do" or "explain this codebase"
- Needs onboarding docs for new team members joining a project
- Wants AI-agent-readable documentation for a repo
- Asks a question about a codebase that already has codedocs output
- Needs to update existing docs after code changes or a new feature
- Wants to document only a specific module or subdirectory
- Asks to refresh docs based on recent git commits or a diff
Do NOT trigger this skill for:
- Writing standalone technical documents (RFCs, ADRs, runbooks) - use
internal-docs - API reference docs for external consumers - use
technical-writing - README creation for open-source packaging - use
open-source-management
当用户有以下需求时触发此Skill:
- 想要为代码库、仓库或目录生成文档
- 询问「这个项目是做什么的」或「解释一下这个代码库」
- 需要为加入项目的新团队成员提供入门文档
- 想要为仓库生成AI Agent可读的文档
- 针对已有Codedocs输出的代码库提出问题
- 需要在代码变更或新增功能后更新现有文档
- 只想为特定模块或子目录生成文档
- 要求基于最近的Git提交或差异刷新文档
请勿在以下场景触发此Skill:
- 撰写独立技术文档(RFC、ADR、运行手册)——请使用
internal-docs - 为外部消费者提供API参考文档——请使用
technical-writing - 为开源打包创建README——请使用
open-source-management
Key principles
核心原则
-
Docs-first answers - Once codedocs output exists, always answer questions from the docs before falling back to source code. The docs are the cached, structured knowledge layer. Only read source code when docs are missing, stale, or insufficient for the specific question.
-
Language-agnostic detection - Detect the tech stack from manifest files (package.json, Cargo.toml, go.mod, requirements.txt, pyproject.toml, composer.json, pom.xml, build.gradle, Gemfile, mix.exs, etc.) and directory conventions. Never assume a specific language.
-
Modules map to code, patterns cut across - Module docs correspond to distinct code directories or bounded contexts (auth, api, database). Pattern docs capture cross-cutting concerns (error handling, testing strategy, logging conventions) that span multiple modules. This split prevents duplication and matches how developers think about code.
-
Manifest-driven incremental updates - Themanifest tracks every documented module, its source path, and the git SHA at documentation time. Updates use this manifest to know what changed, what to re-scan, and what to skip.
.codedocs.json -
Output is configurable, structure is not - The output directory (default) is configurable. The internal structure (OVERVIEW.md, INDEX.md, .codedocs.json, modules/, patterns/) is fixed. Consistency across repos means any agent or developer knows where to look.
docs/ -
Coverage is a first-class metric - Documentation that covers 40% of a codebase is often worse than none - it gives a false sense of completeness. Always run coverage verification before presenting the plan. Target 70%+ for mid-size repos. Report coverage percentage in OVERVIEW.md and the manifest. Seefor targets.
references/coverage-strategy.md -
Go deep, not just wide - For large repos, top-level modules are just the starting point. Any module with 15+ source files must be analyzed for sub-modules. Scan recursively through the full directory tree - a huge repo should generate 30-80 doc files, not 8-12.
-
文档优先的解答 - 一旦Codedocs输出存在,必须优先基于文档解答问题,之后再回退到源代码。文档是经过缓存的结构化知识层。仅当文档缺失、过时或无法满足特定问题需求时,才读取源代码。
-
语言无关检测 - 从清单文件(package.json、Cargo.toml、go.mod、requirements.txt、pyproject.toml、composer.json、pom.xml、build.gradle、Gemfile、mix.exs等)和目录约定中检测技术栈。绝不假设特定语言。
-
模块映射代码,模式跨领域覆盖 - 模块文档对应不同的代码目录或有界上下文(认证、API、数据库)。模式文档记录跨领域关注点(错误处理、测试策略、日志约定),这些内容会跨越多个模块。这种拆分避免了重复,符合开发人员对代码的思考方式。
-
基于清单的增量更新 -清单会跟踪每个已文档化的模块、其源路径以及文档生成时的Git SHA。更新操作会利用此清单了解变更内容、需要重新扫描的部分以及可以跳过的部分。
.codedocs.json -
输出可配置,结构固定 - 输出目录(默认)可配置。内部结构(OVERVIEW.md、INDEX.md、.codedocs.json、modules/、patterns/)是固定的。跨仓库的一致性意味着任何Agent或开发人员都知道在哪里查找内容。
docs/ -
覆盖率是首要指标 - 覆盖代码库40%的文档往往不如没有文档——它会给人一种完整的错觉。在呈现计划之前,始终要进行覆盖率验证。中型仓库的目标覆盖率为70%以上。在OVERVIEW.md和清单中报告覆盖率百分比。有关目标请参阅。
references/coverage-strategy.md -
深入而非宽泛 - 对于大型仓库,顶层模块只是起点。任何包含15个以上源文件的模块都必须分析其子模块。递归扫描整个目录树——一个庞大的仓库应生成30-80个文档文件,而非8-12个。
Core concepts
核心概念
Output structure - Codedocs always produces the same directory tree. OVERVIEW.md is the
entry point covering architecture, tech stack, project structure tree, and module map.
GETTING_STARTED.md is the authoritative local development guide with every runnable command
in the repo. INDEX.md is the file-to-module lookup table. The modules/ directory contains one
markdown file per major code module (with optional sub-module directories for large modules).
The patterns/ directory contains cross-cutting concern docs. The manifest
tracks metadata, coverage stats, and SHAs for incremental updates. See
for the full spec.
.codedocs.jsonreferences/output-structure.mdFour sub-commands - The skill exposes four operations: for full or scoped
documentation creation, for docs-first Q&A, for incremental refresh, and
for coverage reporting. Each has its own workflow and parameters. See the common
tasks below and the corresponding reference files for detailed workflows.
generateaskupdatestatusSub-modules - When a module directory has 15+ source files with distinct internal groupings,
it is split into sub-modules. The parent module doc becomes an index; sub-module docs live at
. This keeps docs focused and prevents any single file from
becoming an unreadably long catch-all.
modules/<parent>/<child>.mdCoverage verification - Before presenting the generation plan, codedocs computes what
percentage of source files are covered by the proposed module set. If below target, it
expands the scan to find additional modules. Coverage is tracked in the manifest and reported
in OVERVIEW.md. See .
references/coverage-strategy.mdDiscovery phase - Before writing any docs, the generate command runs a discovery phase:
scan the directory tree, identify the tech stack from manifest files, map module boundaries
from directory structure and import graphs, and detect cross-cutting patterns from shared
utilities and conventions. This phase produces the plan that drives doc generation.
Staleness detection - The update command compares the current git SHA against the SHA
recorded in for each module. Modules with changed files since last
documentation are flagged as stale. The flag uses to identify exactly
which files changed, enabling surgical updates to only the affected module docs.
.codedocs.json--diffgit diff输出结构 - Codedocs始终生成相同的目录树。OVERVIEW.md是入口文件,涵盖架构、技术栈、项目结构树和模块映射。GETTING_STARTED.md是权威的本地开发指南,包含仓库中所有可运行的命令。INDEX.md是文件到模块的查找表。modules/目录包含每个主要代码模块的Markdown文件(大型模块可包含可选的子模块目录)。patterns/目录包含跨领域关注点文档。清单跟踪元数据、覆盖率统计和用于增量更新的SHA。完整规范请参阅。
.codedocs.jsonreferences/output-structure.md四个子命令 - 该Skill提供四种操作:用于创建完整或指定范围的文档,用于基于文档的问答,用于增量刷新,用于覆盖率报告。每个操作都有自己的工作流和参数。请参阅下面的常见任务和相应的参考文件以获取详细工作流。
generateaskupdatestatus子模块 - 当模块目录包含15个以上源文件且有明确的内部分组时,会拆分为子模块。父模块文档会变成索引;子模块文档位于。这使文档保持聚焦,避免单个文件变得过长而无法阅读。
modules/<parent>/<child>.md覆盖率验证 - 在呈现生成计划之前,Codedocs会计算拟议模块集覆盖的源文件百分比。如果低于目标,会扩展扫描范围以找到更多模块。覆盖率会跟踪在清单中,并在OVERVIEW.md中报告。请参阅。
references/coverage-strategy.md发现阶段 - 在撰写任何文档之前,generate命令会运行发现阶段:扫描目录树,从清单文件中识别技术栈,从目录结构和导入图映射模块边界,从共享工具和约定中检测跨领域模式。此阶段会生成驱动文档生成的计划。
过时检测 - update命令会将当前Git SHA与中记录的每个模块的SHA进行比较。自上次文档生成以来文件有变更的模块会被标记为过时。标志使用来准确识别哪些文件已变更,从而仅对受影响的模块文档进行精准更新。
.codedocs.json--diffgit diffCommon tasks
常见任务
1. Generate full codebase documentation
1. 生成完整代码库文档
Command:
codedocs:generate [path] [--output docs/]Workflow:
- Discover - Scan the target path (default: repo root). Identify language/framework from manifest files. Map directory structure to candidate modules. Detect entry points (main files, index files, route definitions, CLI entry points).
- Plan - Present the user with a proposed doc plan: list of modules to document, patterns detected, estimated scope, and coverage percentage. Confirm before proceeding if the plan is large or ambiguous.
- Write OVERVIEW.md - Architecture summary, tech stack, annotated project structure tree, entry points, key concepts, and module map with one-line descriptions.
- Write GETTING_STARTED.md - Full local development guide: prerequisites, installation, environment setup, dev server, test commands, build commands, lint/format, database workflow, common dev tasks, and how to reproduce CI locally. Sourced from package.json scripts, Makefile targets, CI config, and any existing README setup sections.
- Write module docs - For each module: purpose, public API/exports, internal structure, dependencies (what it imports), dependents (what imports it), and key implementation notes.
- Write pattern docs - For each cross-cutting pattern: description, where it appears, conventions to follow, and examples from the codebase.
- Write manifest - Create with module list, source paths, git SHA, generation timestamp, coverage stats, and config. See
.codedocs.json.references/output-structure.md
See for the complete discovery heuristics, module
boundary detection logic, and OVERVIEW.md template.
references/generate-workflow.md命令:
codedocs:generate [path] [--output docs/]工作流:
- 发现 - 扫描目标路径(默认:仓库根目录)。从清单文件中识别语言/框架。将目录结构映射到候选模块。检测入口点(主文件、索引文件、路由定义、CLI入口点)。
- 计划 - 向用户展示拟议的文档计划:要文档化的模块列表、检测到的模式、预估范围和覆盖率百分比。如果计划较大或存在歧义,需先确认再继续。
- 撰写OVERVIEW.md - 架构摘要、技术栈、带注释的项目结构树、入口点、核心概念以及带有单行描述的模块映射。
- 撰写GETTING_STARTED.md - 完整的本地开发指南:前置要求、安装步骤、环境设置、开发服务器、测试命令、构建命令、 lint/格式化、数据库工作流、常见开发任务以及如何在本地重现CI流程。内容来源于package.json脚本、Makefile目标、CI配置以及现有README中的设置部分。
- 撰写模块文档 - 每个模块包含:用途、公共API/导出、内部结构、依赖项(它导入的内容)、依赖它的模块(导入它的内容)以及关键实现说明。
- 撰写模式文档 - 每个跨领域模式包含:描述、出现位置、需遵循的约定以及代码库中的示例。
- 撰写清单 - 创建,包含模块列表、源路径、Git SHA、生成时间戳、覆盖率统计和配置。请参阅
.codedocs.json。references/output-structure.md
完整的发现启发式算法、模块边界检测逻辑和OVERVIEW.md模板请参阅。
references/generate-workflow.md2. Ask a question about the codebase
2. 询问代码库相关问题
Command:
codedocs:ask "<question>"Workflow:
- Check for docs - Look for in the output directory. If missing, suggest running
.codedocs.jsonfirst.codedocs:generate - Route the question - Determine which doc file(s) are relevant. Architecture questions go to OVERVIEW.md. Module-specific questions go to the relevant module doc. Cross-cutting questions go to pattern docs.
- Read docs first - Load the relevant doc file(s) and attempt to answer from them.
- Fall back to source - If the docs don't contain enough detail, read the relevant
source files. Flag in the response: "Note: this answer required reading source code -
consider running to capture this in the docs."
codedocs:update - Cite sources - Always cite which doc file or source file the answer came from.
See for the question routing logic and fallback strategy.
references/ask-workflow.md命令:
codedocs:ask "<question>"工作流:
- 检查文档是否存在 - 在输出目录中查找。如果缺失,建议先运行
.codedocs.json。codedocs:generate - 路由问题 - 确定哪些文档文件相关。架构问题指向OVERVIEW.md。模块特定问题指向相关模块文档。跨领域问题指向模式文档。
- 优先读取文档 - 加载相关文档文件并尝试从中解答。
- 回退到源代码 - 如果文档中没有足够的细节,读取相关源代码。在回复中标记:「注意:此答案需要读取源代码——请考虑运行将此内容纳入文档。」
codedocs:update - 引用来源 - 始终说明答案来自哪个文档文件或源代码文件。
问题路由逻辑和回退策略请参阅。
references/ask-workflow.md3. Update docs incrementally (targeted scope)
3. 增量更新文档(指定范围)
Command:
codedocs:update --scope path/to/moduleWorkflow:
- Read manifest - Load to find the existing module mapping.
.codedocs.json - Re-scan the scoped path - Run the discovery phase only on the specified path.
- Diff against existing docs - Compare the new discovery against the current module doc. Identify new exports, removed functions, changed dependencies.
- Update the module doc - Rewrite only the sections that changed.
- Update OVERVIEW.md - If the module's one-line description or dependency graph changed, update the module map in OVERVIEW.md.
- Update manifest - Bump the git SHA and timestamp for the updated module.
命令:
codedocs:update --scope path/to/module工作流:
- 读取清单 - 加载以找到现有的模块映射。
.codedocs.json - 重新扫描指定路径 - 仅在指定路径上运行发现阶段。
- 与现有文档比较差异 - 将新的发现结果与当前模块文档进行比较。识别新的导出、已移除的函数、已变更的依赖项。
- 更新模块文档 - 仅重写已变更的部分。
- 更新OVERVIEW.md - 如果模块的单行描述或依赖图有变更,更新OVERVIEW.md中的模块映射。
- 更新清单 - 更新已更新模块的Git SHA和时间戳。
4. Update docs from git diff
4. 基于Git差异更新文档
Command:
codedocs:update --diff [base..head]Workflow:
- Get changed files - Run (default: last documented SHA from manifest to HEAD).
git diff --name-only base..head - Map files to modules - Using the manifest's source path mappings, determine which documented modules contain changed files.
- Re-generate affected modules - For each affected module, re-run the module doc generation workflow.
- Detect new modules - If changed files are in directories not yet documented, flag them as new module candidates and prompt the user.
- Update manifest - Bump SHAs for all updated modules.
See for the diff detection logic and new module handling.
references/update-workflow.md命令:
codedocs:update --diff [base..head]工作流:
- 获取变更文件 - 运行(默认:从清单中上次文档化的SHA到HEAD)。
git diff --name-only base..head - 将文件映射到模块 - 使用清单中的源路径映射,确定哪些已文档化的模块包含变更文件。
- 重新生成受影响的模块 - 对每个受影响的模块,重新运行模块文档生成工作流。
- 检测新模块 - 如果变更文件位于尚未文档化的目录中,将其标记为新模块候选并提示用户。
- 更新清单 - 更新所有已更新模块的SHA。
差异检测逻辑和新模块处理请参阅。
references/update-workflow.md5. Generate docs for a specific subdirectory
5. 为特定子目录生成文档
Command:
codedocs:generate path/to/subdir [--output path/to/subdir/docs/]Same workflow as full generation but scoped to a subdirectory. The output defaults to a
folder inside the specified path. Useful for monorepos where each package needs
its own documentation.
docs/命令:
codedocs:generate path/to/subdir [--output path/to/subdir/docs/]工作流与完整生成相同,但范围限定为子目录。输出默认位于指定路径内的文件夹。这在单体仓库中非常有用,每个包都需要自己的文档。
docs/6. Check documentation coverage
6. 检查文档覆盖率
Command:
codedocs:statusWorkflow:
- Read manifest - Load . If missing, suggest running
.codedocs.json.codedocs:generate - Compute coverage - Count total source files in the repo vs files covered by documented modules.
- Detect staleness - For each module, compare the manifest SHA against the latest git commit SHA on that module's source path.
- Find gaps - List directories in the repo not covered by any module doc.
- Report - Print a structured status report: coverage percentage, stale modules, gap directories, and recommendations.
See for coverage targets, the status report format, and
strategies for improving coverage on large repos.
references/coverage-strategy.md命令:
codedocs:status工作流:
- 读取清单 - 加载。如果缺失,建议运行
.codedocs.json。codedocs:generate - 计算覆盖率 - 统计仓库中的总源文件数与已文档化模块覆盖的文件数。
- 检测过时内容 - 对每个模块,将清单中的SHA与该模块源路径的最新Git提交SHA进行比较。
- 查找缺口 - 列出仓库中未被任何模块文档覆盖的目录。
- 报告 - 打印结构化状态报告:覆盖率百分比、过时模块、缺口目录以及建议。
覆盖率目标、状态报告格式和大型仓库的改进策略请参阅。
references/coverage-strategy.mdAnti-patterns / common mistakes
反模式/常见错误
| Mistake | Why it's wrong | What to do instead |
|---|---|---|
| Re-reading source code when docs exist | Wastes context window and time; docs are the structured cache | Always check for |
| Documenting every file individually | Creates noise; most files are internal implementation details | Document at the module level; only call out key files within a module |
| Skipping the discovery/plan phase | Jumping straight to writing produces unstructured, incomplete docs | Always run discovery first; present the plan to the user for approval |
| Hardcoding language assumptions | Breaks on polyglot repos or unfamiliar stacks | Detect from manifest files; handle multiple languages in one repo |
| Ignoring the manifest on updates | Leads to full re-generation when only one module changed | Always read |
| Mixing module docs and pattern docs | Cross-cutting concerns documented in one module become invisible | Use the patterns/ directory for anything that spans 2+ modules |
| Writing docs without git SHA tracking | Makes incremental updates impossible; no way to know what's stale | Always populate the manifest with per-module git SHAs |
| Stopping at top-level directories | A huge repo generates only 8-12 files; most of the codebase is invisible | Run the full recursive census (Step 3), verify coverage, and scan deeper |
| One flat doc for a 50-file module | The doc is too long to be useful; every question returns the same giant file | Split modules with 15+ files into sub-modules ( |
| Not checking coverage before presenting plan | Low-coverage plans look complete but leave most of the repo undocumented | Always run Step 6 (coverage verification) before showing the plan |
| Skipping INDEX.md | AI agents can't map a specific file to its module doc | Always generate INDEX.md as part of the output |
| Skipping GETTING_STARTED.md | Developers and agents can't run the project without hunting through package.json and README | Always generate GETTING_STARTED.md; source commands from scripts, Makefile, and CI config |
| Copying README verbatim into GETTING_STARTED.md | READMEs are often incomplete or outdated; the guide adds no value | Extract commands from README but expand with context, fill gaps, and verify against actual scripts |
| 错误 | 错误原因 | 正确做法 |
|---|---|---|
| 已有文档时仍读取源代码 | 浪费上下文窗口和时间;文档是结构化的缓存 | 始终先检查 |
| 为每个文件单独生成文档 | 产生冗余信息;大多数文件是内部实现细节 | 以模块为单位生成文档;仅在模块中提及关键文件 |
| 跳过发现/计划阶段 | 直接撰写会产生无结构、不完整的文档 | 始终先运行发现阶段;向用户展示计划并获得批准 |
| 硬编码语言假设 | 在多语言仓库或不熟悉的技术栈上会失效 | 从清单文件中检测;支持同一仓库中的多种语言 |
| 更新时忽略清单 | 导致仅一个模块变更时却要重新生成所有文档 | 始终读取 |
| 混合模块文档和模式文档 | 跨领域关注点在单个模块中记录会变得不可见 | 使用patterns/目录记录任何跨越2个以上模块的内容 |
| 生成文档时不跟踪Git SHA | 无法进行增量更新;无法判断哪些内容已过时 | 始终在清单中填充每个模块的Git SHA |
| 仅停留在顶层目录 | 庞大的仓库仅生成8-12个文件;大部分代码库不可见 | 运行完整的递归统计(步骤3),验证覆盖率,并深入扫描 |
| 为包含50个文件的模块生成单个扁平化文档 | 文档过长无法使用;每个问题都会返回同一个大文件 | 将包含15个以上文件的模块拆分为子模块( |
| 呈现计划前不检查覆盖率 | 低覆盖率的计划看起来完整,但实际上大部分仓库未被文档化 | 呈现计划前始终运行步骤6(覆盖率验证) |
| 跳过INDEX.md | AI Agent无法将特定文件映射到其模块文档 | 始终在输出中生成INDEX.md |
| 跳过GETTING_STARTED.md | 开发人员和Agent无法运行项目,必须在package.json和README中查找信息 | 始终生成GETTING_STARTED.md;从脚本、Makefile和CI配置中获取命令 |
| 将README直接复制到GETTING_STARTED.md | README通常不完整或过时;指南没有添加任何价值 | 从README中提取命令,但补充上下文、填补缺口,并与实际脚本进行验证 |
Gotchas
注意事项
-
Manifest SHA drift causes phantom staleness - If the repo has uncommitted changes whenruns, the recorded git SHA doesn't match the working tree. Subsequent
codedocs:generateruns see all files as stale and attempt full re-generation. Run codedocs against a clean working tree or committed state where possible.codedocs:update -
Coverage counts source files, not lines - A large 2,000-line file and a small 50-line config file each count as one source file for coverage. A 70% coverage score can hide an undocumented core module if it happens to be split into many small files. Review the gap directory list inrather than trusting the percentage alone.
codedocs:status -
Sub-module splitting creates orphaned parent docs - When a module with 15+ files is split into sub-modules, the parentshould become an index pointing to sub-modules. If you create
modules/<name>.mdandmodules/api/routes.mdbut leave the originalmodules/api/middleware.mdintact unchanged, agents get conflicting information from two sources about the same code.modules/api.md -
Polyglot repos confuse module boundary detection - A repo with both a Python backend and a TypeScript frontend may have overlapping directory names (,
utils/,types/) at different levels. The discovery phase can conflate these into one module. Explicitly verify module boundaries during the plan phase for monorepos or polyglot projects.config/ -
GETTING_STARTED.md sourced only from README - READMEs are often incomplete or outdated. Commands listed inscripts,
package.jsontargets, and CI config files frequently include critical developer workflows not mentioned in the README. Always cross-check all three sources when generating GETTING_STARTED.md.Makefile
-
清单SHA漂移导致虚假过时 - 如果在运行时仓库有未提交的变更,记录的Git SHA与工作树不匹配。后续运行
codedocs:generate时会将所有文件标记为过时并尝试重新生成所有文档。尽可能在干净的工作树或已提交的状态下运行Codedocs。codedocs:update -
覆盖率统计源文件数量,而非行数 - 一个2000行的大文件和一个50行的配置文件在覆盖率统计中都算作一个源文件。70%的覆盖率得分可能会掩盖未文档化的核心模块,如果该模块恰好被拆分为许多小文件。请查看中的缺口目录列表,而非仅依赖百分比。
codedocs:status -
子模块拆分导致父文档孤立 - 当包含15个以上文件的模块拆分为子模块时,父模块应变成指向子模块的索引。如果创建了
modules/<name>.md和modules/api/routes.md但保留原始modules/api/middleware.md不变,Agent会从两个来源获取关于同一代码的冲突信息。modules/api.md -
多语言仓库混淆模块边界检测 - 同时包含Python后端和TypeScript前端的仓库可能在不同层级有重叠的目录名称(、
utils/、types/)。发现阶段可能会将这些合并为一个模块。对于单体仓库或多语言项目,在计划阶段需明确验证模块边界。config/ -
仅从README获取GETTING_STARTED.md内容 - README通常不完整或过时。脚本、
package.json目标和CI配置文件中列出的命令通常包含README中未提及的关键开发工作流。生成GETTING_STARTED.md时始终交叉检查这三个来源。Makefile
References
参考文件
For detailed workflows and schemas, read the relevant file from :
references/- - Complete discovery heuristics, recursive census, multi-level module boundary detection, sub-module splitting, coverage verification, tech stack identification, and all output templates (OVERVIEW.md, module doc, pattern doc, INDEX.md). Load when running codedocs:generate.
references/generate-workflow.md - - Question routing logic, doc-first resolution strategy, source code fallback rules, and citation format. Load when running codedocs:ask.
references/ask-workflow.md - - Diff detection logic, manifest-driven scoping, new module detection, and OVERVIEW.md sync rules. Load when running codedocs:update.
references/update-workflow.md - - Complete
references/output-structure.mdmanifest schema (v1.1 with coverage stats and sub-modules), directory layout spec including sub-module directories and INDEX.md, and file format guidelines. Load when creating or validating output..codedocs.json - - Coverage targets by repo size, the codedocs:status report format, prioritization framework for large repos, and coverage improvement strategies. Load when running codedocs:status or when coverage is below target.
references/coverage-strategy.md
Only load a references file if the current task requires deep detail on that topic.
如需详细工作流和 schema,请从中读取相关文件:
references/- - 完整的发现启发式算法、递归统计、多级模块边界检测、子模块拆分、覆盖率验证、技术栈识别以及所有输出模板(OVERVIEW.md、模块文档、模式文档、INDEX.md)。运行codedocs:generate时加载。
references/generate-workflow.md - - 问题路由逻辑、文档优先的解决策略、源代码回退规则以及引用格式。运行codedocs:ask时加载。
references/ask-workflow.md - - 差异检测逻辑、基于清单的范围限定、新模块检测以及OVERVIEW.md同步规则。运行codedocs:update时加载。
references/update-workflow.md - - 完整的
references/output-structure.md清单 schema(v1.1,包含覆盖率统计和子模块)、目录布局规范(包括子模块目录和INDEX.md)以及文件格式指南。创建或验证输出时加载。.codedocs.json - - 按仓库大小划分的覆盖率目标、codedocs:status报告格式、大型仓库的优先级框架以及覆盖率改进策略。运行codedocs:status或覆盖率低于目标时加载。
references/coverage-strategy.md
仅当当前任务需要该主题的详细信息时才加载参考文件。
Companion check
配套Skill检查
On first activation of this skill in a conversation: check which companion skills are installed by running. Compare the results against thels ~/.claude/skills/ ~/.agent/skills/ ~/.agents/skills/ .claude/skills/ .agent/skills/ .agents/skills/ 2>/dev/nullfield in this file's frontmatter. For any that are missing, mention them once and offer to install:recommended_skillsnpx skills add AbsolutelySkilled/AbsolutelySkilled --skill <name>Skip entirely ifis empty or all companions are already installed.recommended_skills
在对话中首次激活此Skill时:通过运行检查已安装的配套Skill。将结果与此文件前置内容中的ls ~/.claude/skills/ ~/.agent/skills/ ~/.agents/skills/ .claude/skills/ .agent/skills/ .agents/skills/ 2>/dev/null字段进行比较。对于任何缺失的Skill,提及一次并提供安装命令:recommended_skillsnpx skills add AbsolutelySkilled/AbsolutelySkilled --skill <name>如果为空或所有配套Skill已安装,则完全跳过此步骤。recommended_skills