This skill is used to execute the requirements analysis, technical solution, or implementation checklist stage of DWF, but each invocation handles only one stage. It does not start the full development workflow and does not generate multiple stage documents consecutively.
-
Handle only the current stage each time. In workflow mode, use the active spec's
current_stepas the sole entry point:breakdownwrite only03-需求分析/需求分析文档.md,planswrite only04-技术方案/技术方案.md,todoswrite only05-实现清单/实现清单.md. In standalone mode, use the target stage confirmed by the user as the entry point. Do not generate multiple stage documents consecutively in a single invocation. -
The target spec directory is determined by the run mode and is not invented by this skill.
- Workflow mode: read
.dwf/state.json, in thespecsarray find the spec wherestatus: "active"andcurrent_stepis one ofbreakdown/plans/todos, and use.dwf/specs/{spec.name}as the target spec directory. If that spec'sshared_refis non-empty (sibling spec), preferentially read.dwf/specs/{shared_ref}/01-需求/、/02-设计稿/as read-only reference context. - Standalone mode:
.dwf/state.jsondoes not exist or no active spec satisfying the conditions exists. First determine the target stage based on user input; if unclear, usequestionto ask for the target stage. Then usequestionto ask the user for the target directory, proposing by default.dwf/specs/{今日日期}-{seq}-feat-{描述}, whereseqscans the maximum sequence number among existing spec directory names in.dwf/specs/plus 1 (or 001 if none), to be confirmed or modified by the user.
- Workflow mode: read
-
Do not create a full workflow directory. Create or update only the directory and documents corresponding to the current stage. Do not proactively create
01-需求/、02-设计稿/or other non-current-stage directories. Do not modify existing requirements documents or design drafts. The project code directory is decided by dwf-coding/the user, and this skill does not create it. -
Do not overwrite existing documents before confirmation. If the target file already exists in the target spec directory, first read it and inform the user of the existing document, asking whether to keep, modify, or replace it. Do not overwrite before user confirmation.
-
Use Chinese throughout. Unless the user explicitly requests another language, all interactions with the user, skill descriptions, generated documents, test records, audit conclusions, and artifact descriptions must be in Chinese. Code, file paths, commands, API names, technical terms, third-party library names, and original content provided by the user may remain in English.
-
In standalone mode, do not create or advance
.dwf/state.json。 Standalone mode writes only the current stage document in the target spec directory and that spec's_meta.json(if this skill creates that spec). Do not advance the full workflow. Only in workflow mode, after user confirmation, update that spec'scurrent_step。
Post-trigger flow
1. Explore context
- Check whether
.dwf/state.jsonexists, and determine the run mode (see step 2). - Read the requirements and design basis: in the target spec directory,
01-需求/需求文档.md、02-设计稿/设计稿.md; in workflow mode, if the spec'sshared_refis non-empty, read.dwf/specs/{shared_ref}/01-需求/、/02-设计稿/first as read-only reference context. - Check whether the target file for the current phase already exists.
2. Determine the run mode and target spec directory
Read .dwf/state.json:
-
Standalone mode:
.dwf/state.jsondoes not exist or there is no active spec whosecurrent_stepisbreakdown/plans/todos.- First determine the target phase from user input: requirements breakdown/requirements analysis corresponds to
breakdown, technical solution corresponds toplans, implementation checklist corresponds totodos; if it cannot be determined, usequestionto let the user select a target phase. - Use
questionto ask the user for the target spec directory, by default proposing.dwf/specs/{今日日期}-{seq}-feat-{描述}(seqscan.dwf/specs/the maximum number in existing spec directory names + 1, or 001 if none), for the user to confirm or modify. - If the target spec directory does not exist, create only it and the subdirectory corresponding to the target phase:
breakdowncreate03-需求分析/,planscreate04-技术方案/,todoscreate05-实现清单/。 - Under that spec directory, write an initial
_meta.json(nameas the directory name,status: "active"、current_stepas the target phase,is_shared_context: false、shared_ref: null, etc.). - Do not create
.dwf/state.json, and do not advance the full workflow. - After the current phase is completed, request user confirmation, and stop after confirmation.
- First determine the target phase from user input: requirements breakdown/requirements analysis corresponds to
-
Workflow mode: in the
specsarray, findstatus: "active"andcurrent_stepis one ofbreakdown/plans/todosspec. The target spec directory is.dwf/specs/{spec.name}/。- Execute only the phase corresponding to that spec's current
current_step. After the phase is completed, update that spec'scurrent_step、confirmed_stages、selected_plan(plans phase), synchronize_meta.jsonwith the top-levelupdated_at, then stop. - Follow dwf-orchestrator's confirmation mechanism.
- Execute only the phase corresponding to that spec's current
3. Generate the requirements analysis document
Entry condition: standalone mode with the target phase being breakdown, or workflow mode with the spec's current_step being breakdown。
- Read the requirements document (if it exists); if
shared_refis non-empty, read its01-需求/、02-设计稿/as read-only context. - Generate the document according to the template in
references/breakdown_template.md, covering:- Target platform: PC / mobile / both.
- Page and feature breakdown: List each page's platform, dependencies, and feature modules separately by page; classify cross-page shared modules separately.
- Assets/dependencies checklist: Which assets the user needs to provide (such as API keys, accounts, third-party service credentials, image assets, etc.).
- Scope boundaries: Clearly specify what is not included in this implementation.
- Save to
{目标 spec 目录}/03-需求分析/需求分析文档.md。 - Use
questiontool to show the document to the user and request confirmation. - Wait for user confirmation.
- If the user chooses "needs modification" or enters modification feedback: directly modify the document, then use
questiontool again to request confirmation. - Only after the user chooses "confirm":
- Standalone mode: stop.
- Workflow mode: update this spec's
current_stepto"plans", appendbreakdowntoconfirmed_stages, sync_meta.jsonandupdated_at, then stop and return control to dwf-orchestrator.After completing the breakdown advancement, if this spec is an initialization spec (is_shared_context: true) and its requirements cover multiple pages/complex modules, remind dwf-orchestrator to proactively ask the user whether to split into iterations—this skill does not split directly; the orchestrator handles splitting.
- If the user chooses "needs modification" or enters modification feedback: directly modify the document, then use
4. Generate technical solution
Entry conditions: standalone mode with the target stage being plans, or workflow mode with the spec's current_step being plans。
- Read the requirements document and requirements analysis document; if
shared_refis non-empty, read it as read-only context. - Analyze the codebase (if it exists) to understand the current architecture, conventions, and patterns.
- Generate a technical solution according to the template in
references/plans_template.md,must provide at least 2 parallel options. Each option includes:- Framework/tech stack selection and rationale
- Required third-party libraries
- Backend API requirements (which APIs the backend needs to provide, API field definitions)
- Data model changes
- Affected files and modules
- Risk assessment and mitigation strategies
- Pros and cons comparison
- In
{目标 spec 目录}/04-技术方案/技术方案.md, include all options and the option comparison table. - Use the
questiontool to present the options to the user and request a selection. - Wait for the user's selection.
- If the user selects "needs modification" or enters modification feedback: directly modify the document, then use the
questiontool again to request confirmation. - Only after the user selects an option:
- Standalone mode: stop.
- Workflow mode: set this spec's
selected_planrecord the selected option,current_stepupdate to"todos", appendplanstoconfirmed_stages, sync_meta.jsonandupdated_at, then stop and return control to dwf-orchestrator.
- If the user selects "needs modification" or enters modification feedback: directly modify the document, then use the
5. Generate implementation checklist
Entry conditions: standalone mode with the target stage being todos, or workflow mode with the spec's current_step being todos。
- Read the requirements document, requirements analysis document, and technical solution (primarily the option specified by
selected_plan); ifshared_refis non-empty, read it as read-only context. - Break the selected option down into specific, ordered tasks, following the template in
references/todos_template.md. Task requirements:- Break down as much as possible; do not implement a feature or page all at once(for example, a page should be split into independent tasks such as skeleton, component A, component B, state integration, API integration, and styles).
- Specific enough to be executed unambiguously.
- Order by dependencies (earlier tasks unblock later tasks).
- Assign priorities (must/should/could/won't, MoSCoW).
- Every task must include "coding standard checks" and "verification criteria" to ensure the coding phase can verify them item by item.
- Save to
{目标 spec 目录}/05-实现清单/实现清单.md。 - Use the
questiontool to show the implementation checklist to the user and request confirmation. - Wait for user confirmation.
- If the user selects "needs modification" or enters modification feedback: directly modify the document, then use the
questiontool again to request confirmation. - Only after the user selects "confirm":
- Standalone mode: stop.
- Workflow mode: update the spec's
current_stepto"code", append thetodostoconfirmed_stages, synchronize_meta.jsonandupdated_at, then stop and return control to dwf-orchestrator.
- If the user selects "needs modification" or enters modification feedback: directly modify the document, then use the
Handling existing documents
If the target file already exists:
- Read the existing document.
- Summarize the main content of the current document.
- Ask the user how to handle it:
- Keep the existing document and only view or summarize it.
- Modify based on the existing document.
- Replace with a new document.
- Only write to the file after the user explicitly chooses to modify or replace.
When modifying an existing document, preserve the original structure unless the user requests a rewrite. Do not create 文档-v2.md or similar new version files unless the user explicitly requests it.
Pre-completion checks
Before finishing, confirm:
- Only one document corresponding to the current phase under the target spec directory was created or updated.
- In standalone mode, no
.dwf/state.json。 - In standalone mode, no subsequent phases were advanced.
- In workflow mode, multiple phase documents were not generated consecutively in a single invocation.
- The document content is in Chinese.
- The document follows the corresponding template in
references/. - The save path and the matters requiring user confirmation for the next step have been stated.