SKILL.md 4.2 KB


name: docs-lifecycle-manager

description: Guide the emoon-backend team through its Docs as Code requirement lifecycle. Use when starting a new requirement, assigning or checking a feature_id, deciding the next document to produce, auditing lifecycle gaps, warning about skipped requirement/design/ADR/API/test documents, or acting as a document-based project manager before coding, testing, acceptance, or archive work.

Docs Lifecycle Manager

Use this skill as the project-manager layer for requirements in this repository. It keeps a requirement moving through documented stages before the team jumps into code.

Required Context

Always read these files first:

  1. docs/文档中心.md
  2. docs/governance/文档分类.md
  3. docs/governance/元数据规范.md
  4. docs/governance/生命周期流程.md

If the user provides a feature_id, read:

docs/initiatives/<feature_id>/专题索引.md

Then read every existing document referenced by that initiative index.

Lifecycle Order

Use this order when inspecting or advancing a requirement:

  1. 需求录入:需求录入.md
  2. 需求文档:需求文档.md
  3. 概要设计:概要设计.md
  4. 详细设计:详细设计.md
  5. ADR: docs/adr/ADR-*.md when triggered
  6. 接口契约:接口说明.md、专题内中文接口文档,或 docs/api/openapi/*.yaml when triggered
  7. 开发进度:开发进度.mddev-progress/ 下的中文文件
  8. 测试计划:测试计划.md
  9. 测试结果:测试结果.md
  10. 归档:更新专题 专题索引.md

Small changes may skip some stages only when the initiative 专题索引.md records the skipped stage, reason, risk, replacement record, and whether follow-up is required.

Triage Procedure

When the user asks what to do next:

  1. Identify or create the feature_id.
  2. Locate the initiative directory.
  3. Inventory existing lifecycle documents and their status.
  4. Compare the inventory against the lifecycle order.
  5. Check trigger conditions for mandatory ADR, API, security, and test documents.
  6. Report the current stage, missing prerequisites, next document, and warning if the requested action skips required context.

Use this response shape:

当前阶段:...
已有文档:...
缺口:...
下一步:...
建议动作:...
警示:...

Gate Rules

Warn before continuing when any rule is violated:

  • No feature_id: do not create later-stage documents.
  • No 需求录入.md: do not jump to detailed design or code.
  • No 需求文档.md: do not start design.
  • PRD has no acceptance criteria: do not code.
  • Multi-module impact: require outline design or an explicit skip record.
  • Data model, security, exception handling, or deployment changes: require detailed design.
  • Module boundary, dependency direction, long-lived contract, middleware, or major tradeoff: require ADR.
  • External or frontend-facing interface change: require API document and OpenAPI when applicable.
  • No 测试计划.md: do not claim completion.
  • No 测试结果.md: do not mark the initiative implemented.

Document Creation

Prefer repository templates under docs/templates/. New lifecycle document filenames must be Chinese and human-readable; keep doc_id, type, and lifecycle status in Front Matter instead of encoding them in English filenames:

  • 专题索引模板.md
  • 需求录入模板.md
  • 需求文档模板.md
  • 概要设计模板.md
  • 详细设计模板.md
  • 接口说明模板.md
  • 开发进度模板.md
  • 测试计划模板.md
  • 测试结果模板.md
  • 会议纪要模板.md

When creating a document:

  1. Copy the relevant template structure.
  2. Fill Front Matter with doc_id, feature_id, type, title, status, owner, created_at, and updated_at.
  3. Link previous-stage documents in related_docs.
  4. Add affected code modules to related_modules.
  5. Update the initiative 专题索引.md document index.

Output Rules

Be strict about lifecycle gaps, but do not block useful exploration.

If prerequisites are missing, offer one of three paths:

  • 补齐前置文档
  • 记录跳过原因后继续
  • 将当前任务降级为探索或草案

Do not silently skip documentation stages.