This skill is used to execute only the "coding execution" phase of the DWF workflow. It is only responsible for applying the confirmed solution and implementation checklist to the target code directory. It is not responsible for generating requirements documents, design drafts, requirements analysis, technical solutions, or implementation checklists.
-
Handle only coding execution. By default, only read or update the target code directory, the target spec directory under
05-实现清单/实现清单.md, necessary project code files, and in workflow mode,.dwf/state.json. Do not proactively create or rewrite01-需求/、02-设计稿/、03-需求分析/、04-技术方案/or05-实现清单/unless the user explicitly requests returning to the corresponding phase first. -
The target code directory and target spec directory are determined by the run mode.
- Workflow mode: read
.dwf/state.json, inspecsfind in the array a spec withstatus: "active"andcurrent_stepascode. The target spec directory is.dwf/specs/{spec.name}/, and the target code directory isthe workspace root directory(the convention of dwf-orchestrator: code is not placed inside the spec directory, but uniformly placed in the root directory). Ifshared_refis non-empty, you may read.dwf/specs/{shared_ref}/01-需求/、/02-设计稿/as read-only context. - Standalone mode: use
questionto ask the user for the target spec directory (including the implementation checklist and technical solution) and the target code directory. For the spec directory, by default propose.dwf/specs/{今日日期}-{seq}-feat-{描述}, whereseqscans.dwf/specs/for the maximum number among existing spec directory names + 1 (or 001 if none). For the code directory, by default propose the current workspace directory, to be confirmed or modified by the user.
- Workflow mode: read
-
Before coding, the basis must be read. Before executing any code modification, you must first read
05-实现清单/实现清单.md、04-技术方案/技术方案.mdunder the target spec directory (if it exists),references/coding_standards.mdunder this skill directory, and the confirmed programming standards under the project-level.dwf/coding-specs/(if they exist), and inspect the existing structure of the target code directory. If the implementation checklist is missing or the technical solution is insufficient for execution, first explain the gap and request the user to supplement it or return todwf-development。
-
Detect the run mode. Each time it is triggered, check
.dwf/state.jsonand find the spec withstatus: "active"andcurrent_stepascode.- If found, execute coding in workflow mode. After completion, remove that spec from the
specsqueue, append it tocompleted_specs, and incrementiteration_count(finalization is handled by dwf-orchestrator; this skill may also update state.json and_meta.json)。 - If no active spec meeting the conditions is found, execute in standalone mode, do not create
.dwf/state.json, and do not advance the complete workflow state.
- If found, execute coding in workflow mode. After completion, remove that spec from the
-
The programming paradigm agreement must be completed before coding. Before entering "execute coding", you must first reach agreement with the user on the programming paradigm and apply the result to the project-level
.dwf/coding-specs/(shared with all specs/iterations, not placed inside the spec directory):- Check whether there is already under
.dwf/coding-specs/a*.mdcovering the current tech stack (such as前端编程规范.md、后端编程规范.md、移动端编程规范.md)。 - already exists → use
questionConfirm with the user whether to reuse it; the user may want to modify it. When modifying, negotiate revisions according to the "does not exist" process and update the file. If reusing, skip generation. - Does not exist → from
04-技术方案/技术方案.mddetect the ends involved this time (frontend/backend/mobile, etc.), usequestionto confirm with the user which specifications to generate; negotiate each one (third-party library selection, component/module splitting, whether to use TypeScript, state management, styling system, directory structure, naming conventions, API encapsulation, testing approach, etc.), write to.dwf/coding-specs/{端}编程规范.md, and usequestionto confirm each one. .dwf/coding-specs/*.mdSupplement the general baseline ofreferences/coding_standards.mdunder this skill directory; in case of conflict, the project-level specification prevails; read both.- Before obtaining user confirmation, do not enter "execute coding" and do not modify any project code.
- Check whether there is already under
-
Do not bypass confirmation boundaries. If the implementation checklist is still unconfirmed, the spec's
current_stepis notcode, the programming paradigm agreement is not completed, or requirements/design/checklist are found to conflict with each other, you must pause and explain the reason; do not code without authorization. -
Execute item by item and mark item by item. Strictly execute tasks in the order of the implementation checklist. Each time one item is completed, verify the result against that task's "coding specification check" and "verification criteria", then mark the corresponding task from
[ ]as[x](written to05-实现清单/实现清单.mdunder the target spec directory). Do not mark all unverified tasks as completed at once. -
Change scope is controlled. Only modify files necessary to complete the current task. In workflow mode, only implement the affected scope confirmed this time; do not casually refactor unrelated modules, replace the architecture, or expand requirements.
-
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.
Process after triggering
1. Explore the context
- Check whether
.dwf/state.jsonexists, read thespecsarray and each item'scurrent_step/selected_plan/shared_ref/updated_at。 - After finding the spec with
status: "active"andcurrent_step: "code", the target spec directory is.dwf/specs/{spec.name}/, and the target code directory defaults to the workspace root directory. Ifshared_refis non-empty, you may read its01-需求/、02-设计稿/as read-only context. - Read
05-实现清单/实现清单.mdunder the target spec directory, and identify incomplete tasks, task order, verification criteria, and blockers. - Read
04-技术方案/技术方案.mdunder the target spec directory; ifselected_planhas a value, prioritize the selected design. - Read
references/coding_standards.mdunder this skill directory; if the file is missing, follow the existing project specifications and the coding constraints provided by the user. - Check whether there are already confirmed programming specifications under the project-level
.dwf/coding-specs/(such as前端编程规范.md、后端编程规范.md、移动端编程规范.md); if so, use them as the project-level conventions for this coding session. - Check whether the target code directory already has project code, and analyze the framework, directory structure, naming, styling, testing, and build approach.
2. Determine the run mode
Standalone mode
If any condition is met, it is standalone mode:
.dwf/state.jsondoes not exist..dwf/state.jsonexists, butspecsdoes not containstatus: "active"andcurrent_step: "code"spec.- The user explicitly requested "execute coding only, do not advance workflow state".
In standalone mode:
- Use
questionto ask the user for the target spec directory (containing the implementation checklist and technical plan) and the target code directory, and provide default proposals (the spec directory defaults to.dwf/specs/{今日日期}-{seq}-feat-{描述},seqscanning.dwf/specs/the maximum sequence number among existing spec directory names +1, or 001 if none; the code directory defaults to the workspace current directory), for the user to confirm or modify. - Only perform coding and task marking within the target code directory and the implementation checklist under the target spec directory.
- Do not create
.dwf/state.json。 - After completion, summarize the changes, verification results, and remaining tasks.
Workflow mode
Enter workflow mode when the following conditions are met:
.dwf/state.jsonexists,specscontainsstatus: "active"andcurrent_step: "code"spec, andconfirmed_stagescontains all affected document phases.
In workflow mode:
- Execute according to the code phase of dwf-orchestrator. The target code directory is the workspace root directory.
- After completing each task, update
05-实现清单/实现清单.mdunder the target spec directory task checkboxes. - After all tasks are completed, update
.dwf/state.json: remove this spec fromspecs, append it tocompleted_specs(includingcompleted_at), incrementiteration_count, updateupdated_at; synchronize this spec's_meta.jsontostatus: "done"、completed_at. Then have dwf-orchestrator usequestionto ask whether to continue with the next spec.
3. Programming paradigm conventions
Before entering coding, first confirm this programming paradigm with the user, and persist the result to the project-level .dwf/coding-specs/. This directory is shared with all specs/iterations; programming conventions are not repeatedly negotiated per iteration.
- Check
.dwf/coding-specs/for existing*.md(e.g.前端编程规范.md、后端编程规范.md、移动端编程规范.md)。 - Read
04-技术方案/技术方案.md, detect the ends involved this time (frontend/backend/mobile, etc.) and the tech stack. - There are existing conventions covering the current tech stack:
- Use
questionto confirm with the user whether to reuse the existing conventions (the user may want to modify them). - Reuse → skip generation and go directly to "Execute coding".
- Need to modify → negotiate revisions according to the following "no conventions" process, and update the corresponding files.
- Use
- Does not exist or needs to be created:
- Use
questionto confirm with the user which conventions to generate (according to the ends involved, typically前端编程规范.md、后端编程规范.md, etc.). - Negotiate key paradigms one by one: third-party library selection, component/module splitting approach, whether to use TypeScript, state management approach, styling system, directory structure, naming conventions, interface encapsulation, testing approach, etc.
- Write the negotiation results to
.dwf/coding-specs/{端}编程规范.md, and usequestionto ask the user to confirm each one.
- Use
.dwf/coding-specs/*.mdsupplementreferences/coding_standards.mdgeneral baseline; in case of conflict, the project-level conventions take precedence.- Only after all conventions are confirmed, enter "Execute coding". Before the user confirms, do not modify any project code.
4. Execute coding
- Select the first incomplete and unblocked task from the implementation checklist.
- Read the files involved in the task (located in the target code directory); if a file does not exist, first confirm whether it should be created according to the technical plan.
- Implement the minimal necessary changes following the project's existing patterns.
- Self-check against the coding standards and verification criteria in the task.
- Run the relevant verification commands, such as lint, typecheck, test, build; if they cannot be run, explain why and record alternative checks.
- Mark the verified completed task as
[x](written to the target spec directory under05-实现清单/实现清单.md)。 - Continue to the next task until the checklist is complete or a blocker is encountered.
5. Handle templates and new projects
If the target code directory is empty and the technical plan explicitly chooses to base it on this skill's assets/ React template:
- For PC, preferentially use this skill directory's
assets/react-pc/。 - For mobile, preferentially use this skill directory's
assets/react-mobile/。 - Common configuration, hooks, utils, request wrappers, etc. can reference or merge this skill directory's
assets/shared/。 - Only copy content that matches the target platform and the chosen plan; do not copy unrelated platform templates, and do not treat
dist/as source code to continue development.
If there is a conflict between the template, the technical plan, and the requirements, pause and explain the conflict to the user.
6. Blocker handling
You must pause when the following situations occur:
- Missing in the target spec directory
05-实现清单/实现清单.md。 - The implementation checklist has no clear tasks, verification criteria, or dependency order.
- The technical plan is missing and the architecture or technology choices cannot be determined.
- The spec's
current_stepshows it is still inrequirements、design、breakdown、plansortodos。 - The programming paradigm conventions are not complete (
.dwf/coding-specs/the standards covering the current tech stack are missing or have not been confirmed by the user). - During coding, it is discovered that the requirements, plan, or implementation checklist are no longer valid.
When pausing, explain: what is missing, why you cannot continue, and which skill or phase the user should enter to fill the gap.
Pre-completion check
Before finishing, confirm:
- The implementation checklist, technical plan, coding standards (
references/coding_standards.mdand.dwf/coding-specs/*.md) and existing code structure have been read. - The programming paradigm conventions are complete:
.dwf/coding-specs/the standards covering the current tech stack already exist and have been confirmed by the user, or have been negotiated, generated, and confirmed in this session. - Tasks were executed in order, and only verified completed tasks were marked (checked off and written to the implementation checklist in the target spec directory).
- The available verification commands have been run, or the reason they cannot be run has been explained.
- In standalone mode, no
.dwf/state.json。 - In workflow mode, only after all tasks are complete, update state.json (move the spec into completed_specs, increment iteration_count) and that spec's
_meta.json(status=done)。 - The summary lists completed tasks, main modified files, verification results, unfinished items, or blockers.