Announce at start: "I am using the arkweb-spec-gen skill to generate spec.md and task.md."
Input
The following 5 documents must be read:
proposal.md— Requirements baseline (Phase 1+3)requirement.md— Requirements baseline review (Phase 4)design.md— Architecture design (Phase 4)review.md— Review report (Phase 5)analysis.md— Code analysis report (Phase 2)
Output
spec.md— Unified specification document (4-in-1), saved todocs/features/{feature-name}/spec.mdtask.md— Execution plan, saved todocs/features/{feature-name}/task.md
Template
[Mandatory] Before generating documents, you must first Read the template file, and strictly fill in the content according to the template's chapter structure, Chinese chapter titles, and table format. Do not change it to an English structure or English titles on your own. This is a hard requirement, not a suggestion.
- spec.md: Read
{DOCS_REPO}/assets/templates/spec.md, fill in according to the template structure - task.md: Read
{DOCS_REPO}/assets/templates/task.md, fill in according to the template structure
Process
Step 1: Read all input documents
Read the 5 input documents in parallel and extract key information:
- Extract from proposal.md: problem statement, core goals, out-of-scope, P0 AC, user stories
- Extract from requirement.md: functional design, interface definitions, DFX analysis, device matrix, acceptance criteria
- Extract from design.md: involved repositories and modules, key design decisions (ADR), design skeleton, applicable architecture rules
- Extract from review.md: confirmed design decisions, 🟡 remaining items (recorded in the Known Limitations chapter of spec.md)
- Extract from analysis.md: list of affected files, module paths, code feasibility conclusion
Step 2: Generate spec.md
Generate the 4-in-1 unified specification document according to the template structure, containing four chapters:
Chapter 1: Architecture Design(extracted from design.md)
- Design metadata (Design ID / title / parent_requirement / target_feature / owner / status)
- Requirements baseline summary (problem statement / core goals / target release version / out-of-scope / P0 acceptance criteria)
- Involved repositories and modules (repository / module path / current responsibility / impact of this Feature)
- Applicable architecture rules (Rule ID / reason for applicability / design conclusion / verification method)
- Design goals and non-goals
- Confirmation of non-involved items
- Solution overview + architecture diagram + data flow/control flow
- Key design decisions (ADR)
- Design skeleton (API skeleton / module skeleton / test skeleton + verification method)
- Risks and open issues
Chapter 2: Interface Specification(extracted from requirement.md)
- Interface definition (four-part parameter table: parameter name/type/required/description)
- Behavior scenarios (input→output→side effects)
- Constraints (performance/security/compatibility)
Chapter 3: Feature Specification(extracted from proposal.md + requirement.md)
- Overview table (feature name/ID/Epic/priority/version/SIG/status)
- User stories + acceptance criteria (WHEN/THEN)
- Business Rule Table (BR)
- Exception Rule Table (AR)
- Exemption Rule Table (EX)
- Recovery Contract Table (RC)
- Verification Mapping Table (VM)
- Acceptance Traceability Table (AC → Business Rule → Task → Test)
- API Change Analysis (Public/System/Internal)
- Build System Impact (BUILD.gn / bundle.json)
- Compatibility Statement
- Quality Gate Plan
Chapter 4: Task Specification(Extracted from design.md + analysis.md)
- Affected File List (Operation/Path/Description)
- Dependencies (Blocking/Blocked/External)
- Code Change Specification (Add/Modify/Delete)
- BUILD.gn Changes
- repo-mapping
- Verification Checklist (Compilation/Unit Test/Interface/Code Quality)
Known Limitations Section:
- Extract 🟡 unhandled items from review.md and record them here
Step 3: Generate task.md
Based on the AC and rule tables in spec.md, break down into independently executable Tasks:
- AC to Task Traceability Table (ensure each P0/P1 AC maps to at least one Task)
- Initial Implementation Boundary (Must Implement / Can Be Deferred / Not Recommended to Defer)
- Phase Plan
- Task List (Task ID / Goal / File Scope / AC Mapping / Prerequisites / Completion Criteria / Verification Command)
- Task Details (each Task is self-contained: Goal / AC Mapping / Prerequisites / Non-Goals / Completion Criteria / Stop Conditions / File List / Spec Context / Design Context / Required Rules)
Task Granularity Principles:
- Each Task forms a minimal capability closed loop
- Task granularity is controlled within the range that AI can complete independently
- No TBD/TODO/placeholders
- No implicit cross-Task dependencies
- No references such as "similar to Task-N"
Step 4: Self-Check
spec.md self-check:
- No TBD/TODO/placeholders
- All ACs use the WHEN/THEN format
- Clear scope boundaries
- Interface definition parameter table has complete four-part structure
- Involved repositories and modules are consistent with analysis.md
task.md self-check:
- Each P0/P1 AC maps to at least one Task
- Each Task has a clear file scope
- Each Task has completion criteria and stop conditions
- Task verification commands are executable
- Handover information is self-contained
Response Format
✅ spec-gen 完成
📄 spec.md:{file_path}
📄 task.md:{file_path}
📋 spec.md 结构:
- 第1章 架构设计:涉及 {N} 仓,ADR {N} 项
- 第2章 接口规格:{N} 个接口定义
- 第3章 特性规格:{N} 条 AC,规则表 {N} 条
- 第4章 任务规格:{N} 个受影响文件
📋 task.md 结构:
- Task 总数:{N}
- AC 覆盖:{N}/{N}(P0: {N}/{N})
- 阶段数:{N}