index
Audit repository documentation against the real codebase and reorganize docs into three buckets: implemented, planned, and mismatch. Use this whenever the user asks to review docs for correctness, compare docs with code or git diff, reconcile stale design docs, rewrite project documentation structure, or maintain `project-index.yaml` as the source of truth for doc-to-code mapping.
- License 许可
- Apache-2.0
- 最近更新
- 2026-06-08
- Stars
- ★ 2
- Forks
- 1
01 前言 Front Matter
- name
- index
- description
- Audit repository documentation against the real codebase and reorganize docs into three buckets: implemented, planned, and mismatch. Use this whenever the user asks to review docs for correctness, compare docs with code or git diff, reconcile stale design docs, rewrite project documentation structure, or maintain `project-index.yaml` as the source of truth for doc-to-code mapping.
02 资源文件 3
- 参考文档agents/openai.yaml234 B
- 参考文档references/doc-model.md1.3 KB
- 脚本scripts/doc_inventory.py2.1 KB
03 SKILL.md 正文
Doc Code Consistency
Overview
Use this skill to keep repository documentation aligned with the implementation.
Treat documentation maintenance as a code review task with three outputs:
implemented: documents that already match the current code.planned: forward-looking design documents that intentionally describe a target state.mismatch: places where docs and code disagree and must be reconciled before the docs can guide development.
Always ground decisions in the current repository state, not in memory.
Core Rules
- Read the code before trusting the docs.
- Read
project-index.yamlbefore reorganizing documentation. - Prefer classifying uncertain topics as
mismatchrather than overstating implementation status. - Preserve user changes already in the worktree or index; never revert unrelated edits.
- If old docs are being replaced, create the new canonical docs first, then delete or retire the superseded files.
- Keep the three-bucket structure simple and explicit; avoid mixing current behavior and future design in the same file.
Required Inputs
At minimum, inspect these locations if they exist:
docs/project-index.yaml- relevant code paths referenced by the docs
git diffandgit diff --cachedwhen the user asks to include pending changes
If the repo uses a different documentation root or index file, adapt to that structure and record the choice in the rewritten docs.
Workflow
1. Build the inventory
Do the following first:
- list the docs under
docs/ - read
project-index.yaml - scan old and new docs for code references
- inspect the referenced code, not just filenames
- include staged and unstaged changes when the user asks for a full consistency pass
Use scripts/doc_inventory.py to generate a baseline inventory and stale-reference report, then confirm the findings by reading the actual files.
2. Classify each document or topic
For every meaningful topic, decide which bucket it belongs to:
implemented: behavior is already visible in the code and safe to treat as current truthplanned: intentionally future-state, not yet implemented, but still a valid target designmismatch: docs and code diverge, or the doc mixes current truth with speculative behavior
Use these heuristics:
- if the code path exists and behavior is observable today, prefer
implemented - if the doc explicitly defines a migration target or vNext shape, prefer
planned - if the doc over-claims capability, references removed structure, or mixes old and new worlds, prefer
mismatch
3. Rewrite into canonical docs
Create or update:
docs/index.mddocs/implemented/index.mddocs/planned/index.mddocs/mismatch/index.md
Then add focused docs under each bucket.
Keep each file narrow and stable:
- implemented docs should describe current behavior only
- planned docs should describe target behavior only
- mismatch docs should explain the exact drift and what needs to be reconciled
4. Update the index source of truth
Update the documentation: section in project-index.yaml so it maps:
- bucket definitions
- document paths
- status
- related code
- notes
If the requirements section also points to docs, refresh those links too.
5. Remove or retire superseded docs
Only after the new canonical docs exist:
- delete obsolete top-level design docs if the user asked for a full migration
- remove stale references to deleted docs
- make sure the new bucket docs are the only authoritative doc set
6. Validate the result
Before finishing, run these checks:
- validate
project-index.yamlparses cleanly - search for references to deleted doc paths
- check that each bucket index only points to existing files
- verify the main implementation claims against the code one more time
Output Expectations
When you finish the task, report:
- what moved into
implemented - what moved into
planned - what moved into
mismatch - which old docs were removed
- whether
project-index.yamlwas updated successfully - any residual ambiguity that still needs a product or engineering decision
Suggested Commands
Prefer fast local inspection commands such as:
rg --files docs
rg -n "documentation:|requirements:" project-index.yaml
rg -n "docs/|internal/|cmd/|\.github/workbuddy/" docs project-index.yaml
python .codex/skills/doc-code-consistency/scripts/doc_inventory.py --root .
Reference Material
Read references/doc-model.md before a large rewrite to keep the bucket semantics and migration rules consistent.
04 同仓库更多 Skills
workbuddy-guide
Explain and operate workbuddy: what it is, which command to reach for, and where to find deeper references. **Trigger whenever the user mentions 'workbuddy' in any context** — including operational requests (register/onboard a repo, add/bind a worker, 注册仓库, 加仓库, 接入新仓库, onboard repo, set up worker), explanatory questions (how to use workbuddy, workbuddy guide, teach me workbuddy, 怎么用workbuddy, 使用指南), deployment/running/operating/debugging workbuddy, and questions about how issues/tasks are scheduled or how dependencies between issues work (depends_on, blocked, dependency gate, 依赖, 调度, 排队, '为什么没派发'), and questions about parallel-development workflows (rollouts:N fan-out, synthesize/synthesis reduce step, cherry-pick, '并行开发', '多个方案', 'rollout'). Invoke this skill before running workbuddy CLI commands so the documented onboarding flow (coordinator register + worker repos add) and the dependency/scheduling model aren't re-derived from scratch.
web-debug
Validate the workbuddy webui (SPA + auth + JSON API) end-to-end on the same machine workbuddy runs on, using browser-use's headless harness. Use when the user says 'verify the frontend', 'test the SPA', 'check dashboard loads', '前端验证', '验下 webui', or after merging changes that touch internal/webui, web/, or the auth/cookie path.
setup-repo
Configure a GitHub repository for workbuddy orchestration — creates labels, the two canonical agent configs (dev + review), workflow definitions, issue templates, and config.yaml. Use when the user says 'set up repo', 'configure repo for workbuddy', 'initialize workbuddy', '配置仓库', '初始化workbuddy', or wants to onboard a new repo.
pipeline-monitor
Monitor the workbuddy agent pipeline, detect stuck issues, zombie processes, and missed redispatches. Works for both the 3-unit bundle (supervisor + coordinator + worker) and single-process `serve`. Use when the user says 'monitor the pipeline', 'check workbuddy status', '监工', '看看跑完了没', or asks to watch issue progress.
merge-flow
Merge a batch of approved workbuddy PRs into main: order them, resolve conflicts against design intent, validate post-merge health, and report. Use when the user asks to 'merge the batch', 'merge approved PRs', 'integrate finished issues', '批量合并', '处理冲突'; or when the merge-agent is invoked.
deploy
Workbuddy deployment topology guide — explains the 3-unit bundle (supervisor + coordinator + worker), the rolling-restart property, and the cutover from the legacy single-process `serve` install. Use when the user says 'how should I deploy workbuddy', 'install workbuddy as a service', 'switch to bundle', 'rolling restart', '部署 workbuddy', '升级到 bundle'.