Loading...
Loading...
Compare original and translation side by side
docs/docs/ ██████╗ ██████╗ ██████╗ ███████╗██████╗ ██████╗ ██████╗███████╗
██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔══██╗██╔═══██╗██╔════╝██╔════╝
██║ ██║ ██║██║ ██║█████╗ ██║ ██║██║ ██║██║ ███████╗
██║ ██║ ██║██║ ██║██╔══╝ ██║ ██║██║ ██║██║ ╚════██║
╚██████╗╚██████╔╝██████╔╝███████╗██████╔╝╚██████╔╝╚██████╗███████║
╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═════╝ ╚═════╝ ╚═════╝╚══════╝codedocs:generate · src/ → docs/ ██████╗ ██████╗ ██████╗ ███████╗██████╗ ██████╗ ██████╗███████╗
██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔══██╗██╔═══██╗██╔════╝██╔════╝
██║ ██║ ██║██║ ██║█████╗ ██║ ██║██║ ██║██║ ███████╗
██║ ██║ ██║██║ ██║██╔══╝ ██║ ██║██║ ██║██║ ╚════██║
╚██████╗╚██████╔╝██████╔╝███████╗██████╔╝╚██████╔╝╚██████╗███████║
╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═════╝ ╚═════╝ ╚═════╝╚══════╝codedocs:generate · src/ → docs/internal-docstechnical-writingopen-source-managementinternal-docstechnical-writingopen-source-management.codedocs.jsondocs/references/coverage-strategy.md.codedocs.jsondocs/references/coverage-strategy.md.codedocs.jsonreferences/output-structure.mdgenerateaskupdatestatusmodules/<parent>/<child>.mdreferences/coverage-strategy.md.codedocs.json--diffgit diff.codedocs.jsonreferences/output-structure.mdgenerateaskupdatestatusmodules/<parent>/<child>.mdreferences/coverage-strategy.md.codedocs.json--diffgit diffcodedocs:generate [path] [--output docs/].codedocs.jsonreferences/output-structure.mdreferences/generate-workflow.mdcodedocs:generate [path] [--output docs/].codedocs.jsonreferences/output-structure.mdreferences/generate-workflow.mdcodedocs:ask "<question>".codedocs.jsoncodedocs:generatecodedocs:updatereferences/ask-workflow.mdcodedocs:ask "<question>".codedocs.jsoncodedocs:generatecodedocs:updatereferences/ask-workflow.mdcodedocs:update --scope path/to/module.codedocs.jsoncodedocs:update --scope path/to/module.codedocs.jsoncodedocs:update --diff [base..head]git diff --name-only base..headreferences/update-workflow.mdcodedocs:update --diff [base..head]git diff --name-only base..headreferences/update-workflow.mdcodedocs:generate path/to/subdir [--output path/to/subdir/docs/]docs/codedocs:generate path/to/subdir [--output path/to/subdir/docs/]docs/codedocs:status.codedocs.jsoncodedocs:generatereferences/coverage-strategy.mdcodedocs:status.codedocs.jsoncodedocs:generatereferences/coverage-strategy.md| 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中提取命令,但补充上下文、填补缺口,并与实际脚本进行验证 |
codedocs:generatecodedocs:updatecodedocs:statusmodules/<name>.mdmodules/api/routes.mdmodules/api/middleware.mdmodules/api.mdutils/types/config/package.jsonMakefilecodedocs:generatecodedocs:updatecodedocs:statusmodules/<name>.mdmodules/api/routes.mdmodules/api/middleware.mdmodules/api.mdutils/types/config/package.jsonMakefilereferences/references/generate-workflow.mdreferences/ask-workflow.mdreferences/update-workflow.mdreferences/output-structure.md.codedocs.jsonreferences/coverage-strategy.mdreferences/references/generate-workflow.mdreferences/ask-workflow.mdreferences/update-workflow.mdreferences/output-structure.md.codedocs.jsonreferences/coverage-strategy.mdOn 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