document-features
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesedocument-features
document-features
Write feature documentation for the repository — one populated per requested feature — by dispatching subagents in parallel so an "all" run does not serialize. The agent docs directory () is discovered in Phase 1; it's typically but may have written it somewhere else.
<docs-dir>/features/<slug>.md<docs-dir>agents-docs/setup-agentic-repositoryThis skill is the documentation counterpart to . discovers what is missing; is the focused worker that actually fills the template, in parallel, for the features the user names.
find-featuresfind-featuresdocument-featuresIf the user asks "find and document everything", you can start with to build the candidate list, then hand that list to this skill. If the user already knows which features they want (e.g. "document auth and billing"), come straight here.
find-features为仓库撰写功能文档——每个指定功能对应一个已填充内容的文件——通过并行调度子代理,避免“全量生成”时的串行执行问题。代理文档目录()会在阶段1中自动识别;默认路径通常为,但也可能将其配置在其他位置。
<docs-dir>/features/<slug>.md<docs-dir>agents-docs/setup-agentic-repository此技能是的文档撰写配套功能。负责发现缺失的文档,而则是专注的执行器,会并行为用户指定的功能填充模板内容。
find-featuresfind-featuresdocument-features如果用户要求“查找并记录所有内容”,你可以先调用生成候选列表,再将该列表传入此技能。如果用户已经明确知道需要记录的功能(例如“记录认证和计费功能”),则可直接使用此技能。
find-featuresPhase 1 — Verify prerequisites and locate the docs directory
阶段1——验证先决条件并定位文档目录
Confirm the repo has been initialized with the Mimas template, and discover where its agent docs actually live. writes the agent doc tree to by default (a sibling of any human-maintained ), but can override that (e.g. ). Don't assume the path; discover it.
setup-agentic-repositoryagents-docs/docs/--docs-dir <dir>docs/agents- Read at the repo root. Every Mimas-generated
AGENTS.mdlists its docs paths in the first block (AGENTS.md,<docs-dir>/AGENT_WORKFLOW.md, etc.) — the directory in those paths is the docs dir for this repo.<docs-dir>/AGENTS_FEATURES.md - If doesn't exist or doesn't reference the contract files, fall back to searching for
AGENTS.mddirectly (AGENTS_FEATURES.md). The directory containing it is the docs dir.find . -maxdepth 3 -name AGENTS_FEATURES.md - Confirm the files this skill needs are there:
- — feature documentation contract
<docs-dir>/AGENTS_FEATURES.md - — canonical template
<docs-dir>/features/feature-template.md - — feature index
<docs-dir>/FEATURES.md
If any are missing, tell the user this skill is designed to run after and stop. Do not scaffold them yourself.
setup-agentic-repositoryFor the rest of this skill, treat the discovered directory as and use it wherever paths appear. Critical: the subagent prompt in Phase 3 is a template — substitute the actual discovered value into it before dispatching each subagent. The subagents do not run this Phase 1 themselves and will not discover the dir on their own.
<docs-dir>Read and the root (plus any subdomain files) so you know the contract — what counts as an area-level doc vs. a per-service doc, and which subdomains exist. These files are authoritative; if anything in this skill drifts from them, the files win.
<docs-dir>/AGENTS_FEATURES.mdAGENTS.mdCONTEXT.md确认仓库已使用Mimas模板初始化,并找到其代理文档的实际存储位置。默认会将代理文档树写入****(与人工维护的目录同级),但可通过参数覆盖默认路径(例如)。请勿假设路径,需自动识别。
setup-agentic-repositoryagents-docs/docs/--docs-dir <dir>docs/agents- 读取仓库根目录下的文件。所有Mimas生成的
AGENTS.md都会在首个代码块中列出文档路径(AGENTS.md、<docs-dir>/AGENT_WORKFLOW.md等)——这些路径中的目录即为当前仓库的文档目录。<docs-dir>/AGENTS_FEATURES.md - 如果不存在或未引用约定文件,则直接搜索
AGENTS.md文件(执行命令AGENTS_FEATURES.md),包含该文件的目录即为文档目录。find . -maxdepth 3 -name AGENTS_FEATURES.md - 确认此技能所需的文件已存在:
- ——功能文档约定规则
<docs-dir>/AGENTS_FEATURES.md - ——标准模板
<docs-dir>/features/feature-template.md - ——功能索引
<docs-dir>/FEATURES.md
如果上述任一文件缺失,请告知用户此技能需在执行后使用,并终止操作。请勿自行搭建这些文件。
setup-agentic-repository在后续操作中,将识别到的目录视为,所有路径均以此为基准。重点注意:阶段3中的子代理提示是模板内容——在调度每个子代理前,需将其中的替换为实际识别到的路径。子代理不会自行执行阶段1的操作,也无法自动识别文档目录。
<docs-dir><docs-dir>读取和根目录下的(以及所有子域的文件),明确约定规则——区分区域级文档与服务级文档的标准,以及当前存在哪些子域。这些文件具有权威性,如果此技能的说明与这些文件内容冲突,以文件内容为准。
<docs-dir>/AGENTS_FEATURES.mdAGENTS.mdCONTEXT.mdPhase 2 — Decide what to document
阶段2——确定需要记录的功能
The user's request usually contains the answer. Parse what they said:
- Named features ("document auth and billing", "write up the search feature") → take that list of slugs
- A number ("document 3 features", "write up the top 5") → take a numeric count of the most significant undocumented features
- "all" / "every" / "everything" → every undocumented feature with meaningful implementation
- Ambiguous or empty → use with the same options find-features uses (Top 5 / All / Number / Specific names) plus an "Other" free-text fallback
AskUserQuestion
If the user is continuing from a recent session, prefer the candidate list that already exists in the conversation over re-asking.
find-featuresThen quickly inventory :
<docs-dir>/features/- Top-level files (one per documented area, ignoring
.md)feature-template.md - Subdirectories (areas with per-service docs)
- Entries in
<docs-dir>/FEATURES.md
Filter the requested list against the inventory:
- Drop slugs that already have . Tell the user which ones you skipped and why
<docs-dir>/features/<slug>.md - For named features that you cannot locate in the codebase, surface them and ask whether to skip or scaffold a TODO doc. Do not invent feature areas
If the user asked for a number or "all" and you need to identify candidates yourself, scan the subdomains declared in looking for named concepts with dedicated logic — dedicated service layer, non-trivial handler, dedicated tables/migrations, multiple endpoints, real business rules. A single empty route stub is not enough. Rank by significance and trim to the requested count.
AGENTS.md用户的请求通常会明确说明需记录的内容。解析用户的请求:
- 指定功能(例如“记录认证和计费功能”、“撰写搜索功能文档”)→ 直接使用该功能slug列表
- 指定数量(例如“记录3个功能”、“撰写前5个重要功能”)→ 选取对应数量的最关键未记录功能
- “全部”/“所有” → 记录所有具备有效实现的未记录功能
- 模糊或无明确要求 → 使用工具,提供与
AskUserQuestion相同的选项(前5个/全部/指定数量/特定名称),并添加“其他”自由文本选项find-features
如果用户是从最近的会话继续操作,优先使用对话中已有的候选列表,而非重新询问用户。
find-features随后快速盘点目录:
<docs-dir>/features/- 顶级文件(每个文件对应一个已记录的功能区域,忽略
.md)feature-template.md - 子目录(包含服务级文档的功能区域)
- 中的条目
<docs-dir>/FEATURES.md
将用户请求的列表与盘点结果进行过滤:
- 移除已存在文件的slug,并告知用户跳过的内容及原因
<docs-dir>/features/<slug>.md - 对于在代码库中无法定位的指定功能,告知用户并询问是否跳过或搭建一个待办文档。请勿凭空创建功能区域
如果用户要求记录指定数量或“全部”功能,且需要自行识别候选功能,请扫描中声明的子域,寻找具备专属逻辑的命名概念——例如专属服务层、非 trivial 处理器、专属表/迁移文件、多个端点、实际业务规则。仅包含空路由桩的功能不足以成为候选。按重要性排序并截取到指定数量。
AGENTS.mdPhase 3 — Dispatch one subagent per feature, in parallel
阶段3——并行调度每个功能对应的子代理
This is the whole point of the skill. Documentation per feature is independent work — one subagent can read the code for while another reads the code for . Serializing them throws away the parallelism the harness gives you.
authbillingCap concurrency at 10 subagents. If the final list has more than 10 features, dispatch the first batch of 10 in one message, wait for it to complete, then dispatch the next batch. Do not exceed 10 concurrent agents — it overwhelms tooling and the user's review can't keep up.
For each feature in the current batch, spawn one call in the same message (this is what makes them run in parallel). Use the subagent unless something more specific fits.
Agentgeneral-purposeEach subagent gets a self-contained prompt — it has not seen this conversation, so include everything it needs. Before dispatching, substitute with the value you discovered in Phase 1 (typically ). The subagents do not discover the dir on their own.
<docs-dir>agents-docsYou are documenting a single feature area for this repository. The output is one populated markdown file at `<docs-dir>/features/<slug>.md` that follows the project's feature documentation contract.
Feature slug: <slug>
One-line concept (from discovery, may be rough): <concept>
Authoritative reading order (read these first, in order):
1. `<docs-dir>/AGENTS_FEATURES.md` — the contract that governs how feature docs are written
2. `<docs-dir>/features/feature-template.md` — the canonical template. Mirror its section order and headings; do not invent your own structure
3. `AGENTS.md` and any subdomain `CONTEXT.md` files — for vocabulary and where the code lives
Your task:
- Locate this feature in the codebase. Confirm it has meaningful implementation (service layer, handler, endpoints, tables, real business rules). If it is only a stub, stop and report that back — do not write a doc for a stub
- Create `<docs-dir>/features/<slug>.md` from the template
- Fill in what you can verify from the code: overview, responsibilities, key concepts, endpoint(s), service/handler/repository paths, key types, tests location, related features
- Set `Area:` to the slug, `Status:` to `Active` for production code or `In Progress` for half-built features, and `Last updated:` to today's date in `YYYY-MM-DD`
- For sections you cannot confidently fill (performance, security review, undocumented edge cases), keep the template's prompt and add a clear `TODO:` marker. Honest gaps beat invented content
- If the feature has multiple distinct services or endpoints worth separating, also create `<docs-dir>/features/<slug>/<service>.md` files from the same template and link them from the area doc — but only when complexity actually warrants it. Do not duplicate large sections between area and per-service docs
- Do not edit `<docs-dir>/FEATURES.md` — the dispatcher will update the index once all features are written, to avoid concurrent edits to the same file
- Do not commit anything
Report back when done with:
- Path(s) of the file(s) you created
- One-line description of the feature (this will be used for the FEATURES.md entry)
- Which template sections you left as TODO
- Anything you noticed that needs human judgmentSubstitute , , and per feature. Keep the rest verbatim — the subagent depends on having the contract in its own context.
<slug><concept><docs-dir>If features turn out to be unrelated to one another (different subdomains, different layers), there's no need to coordinate beyond avoiding the shared file. The dispatcher updates the index after the batch returns.
<docs-dir>/FEATURES.md这是此技能的核心价值。每个功能的文档撰写是独立工作——一个子代理可以读取功能的代码,同时另一个子代理读取功能的代码。串行执行会浪费框架提供的并行能力。
authbilling并发上限为10个子代理。如果最终列表包含超过10个功能,先调度首批10个功能的子代理(在同一条消息中发送),等待执行完成后,再调度下一批。请勿超过10个并发代理——这会导致工具过载,且用户无法及时完成审核。
对于当前批次中的每个功能,在同一条消息中生成一个调用(这是实现并行执行的关键)。除非有更合适的专用子代理,否则使用子代理。
Agentgeneral-purpose每个子代理都会收到一个独立的提示——它无法查看当前对话内容,因此需包含其所需的全部信息。调度前,请将提示中的替换为阶段1中识别到的路径(通常为)。子代理无法自行识别文档目录。
<docs-dir>agents-docsYou are documenting a single feature area for this repository. The output is one populated markdown file at `<docs-dir>/features/<slug>.md` that follows the project's feature documentation contract.
Feature slug: <slug>
One-line concept (from discovery, may be rough): <concept>
Authoritative reading order (read these first, in order):
1. `<docs-dir>/AGENTS_FEATURES.md` — the contract that governs how feature docs are written
2. `<docs-dir>/features/feature-template.md` — the canonical template. Mirror its section order and headings; do not invent your own structure
3. `AGENTS.md` and any subdomain `CONTEXT.md` files — for vocabulary and where the code lives
Your task:
- Locate this feature in the codebase. Confirm it has meaningful implementation (service layer, handler, endpoints, tables, real business rules). If it is only a stub, stop and report that back — do not write a doc for a stub
- Create `<docs-dir>/features/<slug>.md` from the template
- Fill in what you can verify from the code: overview, responsibilities, key concepts, endpoint(s), service/handler/repository paths, key types, tests location, related features
- Set `Area:` to the slug, `Status:` to `Active` for production code or `In Progress` for half-built features, and `Last updated:` to today's date in `YYYY-MM-DD`
- For sections you cannot confidently fill (performance, security review, undocumented edge cases), keep the template's prompt and add a clear `TODO:` marker. Honest gaps beat invented content
- If the feature has multiple distinct services or endpoints worth separating, also create `<docs-dir>/features/<slug>/<service>.md` files from the same template and link them from the area doc — but only when complexity actually warrants it. Do not duplicate large sections between area and per-service docs
- Do not edit `<docs-dir>/FEATURES.md` — the dispatcher will update the index once all features are written, to avoid concurrent edits to the same file
- Do not commit anything
Report back when done with:
- Path(s) of the file(s) you created
- One-line description of the feature (this will be used for the FEATURES.md entry)
- Which template sections you left as TODO
- Anything you noticed that needs human judgment根据每个功能替换、和的值。其余内容保持原样——子代理依赖这些约定内容完成工作。
<slug><concept><docs-dir>如果功能之间互不相关(属于不同子域、不同层级),除了避免同时编辑共享的文件外,无需进行其他协调。调度器会在批次执行完成后更新索引。
<docs-dir>/FEATURES.mdPhase 4 — Update the index and report back
阶段4——更新索引并反馈结果
Once a batch completes, collect each subagent's reported one-liner and add entries to in alphabetical order, in the form:
<docs-dir>/FEATURES.md- [<slug>](./features/<slug>.md) — one-line descriptionIf still contains the placeholder , remove that line as you add the first real entry.
<docs-dir>/FEATURES.md_No feature areas documented yet. Add entries as you build out the system._Then, if more features remain (because the original list was >10), dispatch the next batch of up to 10 and repeat.
When everything is written, tell the user:
- Which feature docs were created (full paths), grouped by batch if there were multiple
- Which requested features were skipped, and why ("already documented at ", "could not locate in codebase", "implementation too thin to earn an entry yet")
<docs-dir>/features/<slug>.md - Which sections in the new docs are TODOs that still need human judgment
- That was updated and how many entries were added
<docs-dir>/FEATURES.md - Any discrepancies you noticed between and the filesystem
<docs-dir>/FEATURES.md
Do not commit the changes. The user reviews before committing.
批次执行完成后,收集每个子代理返回的单行描述,并按字母顺序添加到中,格式如下:
<docs-dir>/FEATURES.md- [<slug>](./features/<slug>.md) — one-line description如果中仍包含占位符,在添加第一条真实条目时删除该占位符。
<docs-dir>/FEATURES.md_No feature areas documented yet. Add entries as you build out the system._如果还有剩余功能(原列表超过10个),则调度下一批最多10个功能的子代理,重复上述流程。
所有文档撰写完成后,告知用户:
- 创建的功能文档路径(完整路径),如果分多批次则按批次分组展示
- 跳过的请求功能及原因(例如“已在中记录”、“在代码库中无法定位”、“实现过于简单,暂无需单独文档”)
<docs-dir>/features/<slug>.md - 新文档中仍为TODO、需要人工补充的章节
- 已更新,以及新增的条目数量
<docs-dir>/FEATURES.md - 发现的与文件系统之间的不一致情况
<docs-dir>/FEATURES.md
请勿提交更改。需等待用户审核后再提交。
Why this is structured around subagents
为何基于子代理构建此技能
Documenting one feature is read-heavy and largely independent of documenting another — different files, different services, different endpoints. The slow part is the reading, and parallelizing the reading is the entire reason this skill exists separately from . Spawning ten subagents in one message and letting them work concurrently turns a 10-minute sequential run into something closer to a 1–2 minute parallel one, with each subagent producing a focused, faithful doc because its whole context is one feature.
find-featuresThe 10-agent cap is pragmatic, not theoretical: more than that and you risk rate limits, output you can't usefully review at once, and the dispatcher running out of room to track which agent owns which slug. Two batches of ten is fine; ten batches of one is the failure mode this skill is designed to avoid.
单个功能的文档撰写需要大量代码阅读工作,且与其他功能的文档撰写工作基本独立——涉及不同文件、不同服务、不同端点。最耗时的部分是代码阅读,而并行化代码阅读正是此技能独立于存在的核心原因。在一条消息中生成10个子代理并让它们并行工作,可将原本10分钟的串行执行时间缩短至1-2分钟左右,且每个子代理仅专注于一个功能,能生成更精准、符合要求的文档。
find-features10个代理的并发上限是务实的选择,而非理论限制:超过此数量可能会触发速率限制,导致用户无法有效审核输出内容,且调度器可能无法跟踪每个代理对应的slug。分两批各10个代理是可行的;而分10批各1个代理则是此技能要避免的失败模式。
What makes a good output
优质输出的标准
Faithful to the code. Endpoint paths, file locations, method names, table names must match what is actually in the repo. If a subagent can't find something, the right move is a marker, not a guess.
TODO:Concept-first for area docs. The area-level doc explains what the feature is for — responsibilities, boundaries, vocabulary. Deep implementation detail belongs in per-service docs once they exist.
Honest about gaps. A clear is more useful than a fabricated rate limit policy. Future sessions can fill these in from real information.
TODO: describe rate limitingProportionate. A small CRUD endpoint with one handler does not need every section of the template. Trim or skip sections that genuinely do not apply. The template is a checklist of what might be relevant, not a contract that every section must be populated.
Honors the contract. The structure, headings, and rules in and win every time. If this skill's instructions ever drift from those files, the files are authoritative — they live with the project and are what other agents read.
<docs-dir>/AGENTS_FEATURES.md<docs-dir>/features/feature-template.md忠实于代码。端点路径、文件位置、方法名称、表名必须与仓库中的实际内容一致。如果子代理无法找到相关内容,正确的做法是添加标记,而非猜测内容。
TODO:区域文档以概念为先。区域级文档需解释功能的用途——职责、边界、术语。深层实现细节应放在服务级文档中(当服务级文档存在时)。
坦诚说明空白。清晰的比虚构的限流策略更有用。后续会话可根据真实信息补充这些内容。
TODO: 描述限流规则比例适当。仅包含一个处理器的小型CRUD端点无需填充模板的所有章节。可删减或跳过完全不适用的章节。模板是可能相关内容的检查清单,而非要求必须填充所有章节的强制约定。
遵守约定规则。和中的结构、标题和规则具有最高权威性。如果此技能的说明与这些文件内容冲突,以文件内容为准——这些文件随项目一起维护,是其他代理会读取的依据。
<docs-dir>/AGENTS_FEATURES.md<docs-dir>/features/feature-template.md