groove-work-doc
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<!-- groove:managed — do not edit; changes will be overwritten by groove update -->
<!-- groove:managed — do not edit; changes will be overwritten by groove update -->
groove-work-doc
groove-work-doc
Use $ARGUMENTS as the doc topic if provided.
如果提供了 $ARGUMENTS 则将其作为文档主题。
Outcome
产出
A structured documentation file explaining how a component, concept, or pattern works — for future agents and humans picking up the codebase.
一份结构化的说明文档,解释某个组件、概念或模式的工作原理,供后续接触代码库的 Agent 和开发人员参考。
Acceptance Criteria
验收标准
Doc file contains:
- Overview: What this component/concept is and what problem it solves
- Key Files: The most important files, with a one-line role for each
- How It Works: Step-by-step explanation of the main flow or logic
- Gotchas: Non-obvious constraints, edge cases, known sharp edges
文档需要包含以下内容:
- 概述:该组件/概念是什么,解决了什么问题
- 核心文件:最重要的相关文件,每个文件配一行说明描述其作用
- 工作原理:分步解释核心流程或逻辑
- 注意事项:不直观的约束、边界情况、已知易踩坑点
Constraints
约束条件
- Sanitize topic for use as filename — strip path separators, special characters, and traversal patterns ()
../ - Read and
memory:fromspecs:; resolve docs directory as.groove/index.mdif<specs>/../docs/key is present, otherwisespecs:<memory>/docs/ - Ensure the resolved docs directory exists (create if missing)
- Research the codebase thoroughly before writing (use Explore agent) — docs should reference actual file paths, not generic descriptions
- Interview user if scope is ambiguous: "What's the audience — a new contributor, a future agent, or both?"
- Write doc in isolated context (use general-purpose agent)
- Verify all four required sections exist before completing
- Keep each section concise — this is a reference doc, not a tutorial
- 对主题做文件名适配处理:移除路径分隔符、特殊字符和目录遍历格式()
../ - 读取 中的
.groove/index.md和memory:配置;如果存在specs:键,将文档目录解析为specs:,否则使用<specs>/../docs/<memory>/docs/ - 确保解析得到的文档目录存在(不存在则创建)
- 编写前充分调研代码库(使用 Explore agent):文档需要引用真实文件路径,而非通用描述
- 如果范围不明确,询问用户:「目标受众是谁?是新贡献者、未来的 Agent,还是两者都是?」
- 在独立上下文中编写文档(使用通用-purpose agent)
- 完成前确认四个必填章节都已存在
- 保持每个章节简洁:这是参考文档,不是教程
Quality Signals
质量校验项
- Key Files lists actual paths found in the codebase
- How It Works traces a real execution path (e.g. "user runs X → Y reads config → Z writes file")
- Gotchas surface things that are not obvious from reading the code
- Doc does not duplicate what a spec already says — link to the spec if one exists
- 核心文件部分列出代码库中存在的真实路径
- 工作原理部分追踪真实的执行路径(例如 "用户运行 X → Y 读取配置 → Z 写入文件")
- 注意事项部分点出仅通过阅读代码难以发现的问题
- 文档不重复规范中已有的内容,如果存在相关规范请添加跳转链接