/wf2-spec
Create a specification document for an existing workflow.
Prerequisites
-
A completed kickoff exists at docs/wf/<work-id>/01_KICKOFF.md
-
state.json shows kickoff phase is completed
Workflow
Step 1: Load Context
-
Read docs/wf/<work-id>/state.json to verify the workflow exists and kickoff is done
-
Read docs/wf/<work-id>/01_KICKOFF.md to understand the goal and constraints
-
If the kickoff phase is not completed, tell the user to run /wf1-kickoff first
Step 2: Research
Based on the kickoff goal, explore the codebase to understand:
-
Which files and components are affected
-
Existing patterns and conventions
-
Potential edge cases and risks
Use the Explore agent for broad codebase exploration, or Glob/Grep for targeted searches.
Step 3: Draft the Specification
-
Copy this skill's bundled templates/02_SPEC.md to docs/wf/<work-id>/02_SPEC.md
-
Fill in the spec based on kickoff goals and codebase research:
-
Overview: Summarize what the change does
-
Scope: What's in and out
-
User / Use Cases: Who benefits and how
-
Functional Requirements: Concrete FR-N items
-
Non-Functional Requirements: Performance, security, etc.
-
Acceptance Criteria: Given/When/Then format
-
Affected Components: Based on codebase research
-
Change Details: Before/After where applicable
-
Test Strategy: How to verify
Remove sections that don't apply (e.g., API changes if there's no API).
Step 4: Review with User
Present the draft spec to the user. Ask if anything is missing, incorrect, or needs adjustment. Iterate until the user approves.
Step 5: Finalize
-
Update state.json :
-
Set phases.spec.status to "completed"
-
Set phases.spec.completed_at to current timestamp
-
Set phase to "plan"
-
Tell the user: the spec is complete, proceed with /wf3-plan <work-id>
Important Notes
-
The spec should be concrete enough to implement from. Avoid vague requirements.
-
Include "Open Questions" for anything that needs human decisions during implementation.
-
The spec document is written in Japanese (following the template language).
-
Cross-reference the kickoff document for traceability.
-
All timestamps in state.json must use UTC: YYYY-MM-DDTHH:MM:SSZ .