SuperAPI AI Directory

dwf-design

Design & creation

View repository

Updated 10-16 08:54

About this skill

dwf-design

This skill is used to execute the "design draft" stage of the DWF workflow separately. It is only responsible for collecting, generating, or recording design draft information, producing the target spec directory's 02-设计稿/设计稿.md; when run independently it does not start the full development workflow; in workflow mode it follows .dwf/state.json to continue the current stage.

  1. Only handle the design draft stage. By default, this skill only creates or updates the target spec directory's 02-设计稿/设计稿.md, as well as the necessary 02-设计稿/images/ image directory. It does not create documents or code for other stages.

  2. The target spec directory is determined by the run mode and is not invented by this skill.

    • Workflow mode: read .dwf/state.json, in the specs array find the spec where status: "active" and current_step: "design" , and use .dwf/specs/{spec.name} as the target spec directory. If that spec's shared_ref is non-empty (sibling spec), preferentially read .dwf/specs/{shared_ref}/01-需求/需求文档.md as the requirements basis, rather than the requirements document within this spec.
    • Standalone mode:.dwf/state.json does not exist or there is no active spec satisfying the conditions. Use question to ask the user for the target directory, by default proposing .dwf/specs/{今日日期}-{seq}-feat-{描述}, where seq scans .dwf/specs/ the maximum sequence number among existing spec directory names +1 (or 001 if none), to be confirmed or modified by the user.
  3. In standalone mode, do not create or advance .dwf/state.json。 Standalone mode only writes the design draft under the target spec directory and that spec's _meta.json(if this skill creates that spec). Do not advance the project to breakdown, plans, todos, or code. Only in workflow mode, after user confirmation, update that spec's current_step。

  4. Do not create a full workflow directory. Except for the target spec directory's 02-设计稿/ , do not proactively create 01-需求/、03-需求分析/、04-技术方案/、05-实现清单/. Do not modify existing requirements documents.

  1. Do not overwrite an existing design draft document before confirmation. If the target spec directory's 02-设计稿/设计稿.md already exists, first read it and inform the user of the existing document, and ask whether to keep, modify, or replace it. Do not overwrite before the user confirms.

  2. Use Chinese throughout. Unless the user explicitly requests another language, all interactions with the user, design clarification questions, generated documents, titles, labels, table contents, explanatory text, test records, audit conclusions, and artifact descriptions must be in Chinese. Code, file paths, commands, API names, technical terms, third-party library names, design tool names, and original content provided by the user may remain in English.

Process after triggering

1. Explore the context

  • Check whether .dwf/state.json exists, and determine the run mode (see step 2).
  • If the target spec directory's 02-设计稿/设计稿.md exists, first read it and follow "Handling existing documents".
  • Read the requirements basis: the target spec directory's 01-需求/需求文档.md if it exists; in workflow mode, if that spec's shared_ref is non-empty, preferentially read .dwf/specs/{shared_ref}/01-需求/需求文档.md。
  • If the user provides a local file path, read the file contents; if it is an image, record the image path and, when possible, copy or reference it into the target spec directory 02-设计稿/images/。
  • If the user provides a Figma, web page, Feishu, or other external link, use the corresponding skill to read or record the link according to the link type; if it cannot be read, still write the link into the design source.
  • If the user gives only a brief idea, first clarify the minimum information that will affect the design direction.

2. Determine the run mode and target spec directory

Read .dwf/state.json:

  • Workflow mode: In the specs array, find the spec where status: "active" and current_step: "design" . The target spec directory is .dwf/specs/{spec.name}/. If spec.design_skipped is true (the user chose to skip the design mockup during the requirements phase), directly under the target spec directory, 02-设计稿/设计稿.md write "The design mockup phase has been skipped; there is no design mockup.", add design_skipped: true and design to the affected_stages exclusions, then confirm and proceed.

    • After the design mockup is completed and confirmed by the user, update this spec's current_step to "breakdown", append design to confirmed_stages, and synchronize _meta.json with the top-level updated_at。
    • Follow the dwf-orchestrator confirmation mechanism; do not skip user confirmation.
  • Standalone mode:.dwf/state.json does not exist, or no active spec satisfying the conditions exists.

    • Use question to ask the user for the target spec directory, and by default propose .dwf/specs/{今日日期}-{seq}-feat-{描述}(seq scan the largest sequence number among the existing spec directory names under .dwf/specs/ plus 1, or 001 if none), and let the user confirm or modify it.
    • If the target spec directory does not exist, create it and the 02-设计稿/、02-设计稿/images/。
    • under it; write an initial _meta.json(name in that spec directory with the directory name,status: "active"、current_step: "design"、is_shared_context: false、shared_ref: null , etc.).
    • Do not create .dwf/state.json; do not advance the full workflow.
    • After the design mockup phase is completed, request user confirmation; stop after confirmation.

3. Determine the design mockup source

Choose one method based on the input:

  • Provide a link: Record the design mockup URL, filename, or page name; if a screenshot can be obtained, save it to 02-设计稿/images/。
  • Provide an image: Organize the image information into the design mockup document; if the image needs to be copied, save it to 02-设计稿/images/。
  • AI-generated: Generate the design description based on the requirements document and the user's description; if the environment allows, generate an HTML/CSS mockup screenshot or image artifact and save it to 02-设计稿/images/。
  • Skip: Write 02-设计稿/设计稿.md as "The design mockup phase has been skipped; there is no design mockup.", and explain that subsequent phases need to proceed based on the requirements document.

4. Clarify missing information

When information is insufficient, ask only one question at a time, prioritizing clarification of:

  1. Target platform: PC, mobile, or both.
  2. Design mockup source: link, image, AI-generated, or skipped.
  3. Number of key pages and page names.
  4. Desired style, brand colors, fonts, or reference products.
  5. Key interactions and responsive requirements.

If a reasonable assumption can be made, explicitly write it into "Items to be confirmed" first; do not block the output for minor details.

5. Generate the design mockup document

Read from this skill directory references/design_template.md and save it as a template to the target spec directory:

{目标 spec 目录}/02-设计稿/设计稿.md

Generation rules:

  • Use the structure in the template: project name, design source, link, design image, design description, responsive adaptation, and items to be confirmed.
  • The project name should preferably come from the requirements document (the target spec or the shared context spec's 01-需求/需求文档.md); if missing, extract it from the user's description, and if it is still unclear, write "To be confirmed".
  • The design description should cover the overall style, primary color, fonts, spacing specifications, key page descriptions, and key interactions.
  • If there are no real images, do not fabricate screenshot paths; you may write "No image yet" and note it in the items to be confirmed.
  • If an image is generated or saved, reference it in the document using the relative path images/<文件名> , and place the image under the target spec directory 02-设计稿/images/。

6. Request user confirmation

After generating the document, show the user the save location and a brief summary, and request confirmation:

  • If the user confirms, it means the design draft stage is complete.
  • If the user provides modification feedback, update 02-设计稿/设计稿.mdand request confirmation again.
  • If the user asks to skip, update the design draft document in the "skip" format.

After confirmation is complete:

  • Standalone mode: stop, and do not automatically proceed to requirements analysis, technical solution, implementation checklist, or coding.
  • Workflow mode: update this spec's current_step to "breakdown", append design to confirmed_stages, synchronize _meta.json and updated_at, and let dwf-orchestrator advance it.

Handling existing documents

If the target file already exists:

  1. Read {目标 spec 目录}/02-设计稿/设计稿.md。
  2. and summarize the current document's project name, design source, and main design content.
  3. Ask the user how to handle it:
    • Keep the existing design draft and only view or summarize it.
    • Modify based on the existing design draft.
    • Replace it with a new design draft.
  4. 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 new version files such as 设计稿-v2.md unless the user explicitly requests it.

Pre-completion check

Before finishing, confirm:

  • Only 02-设计稿/设计稿.md and necessary images under the target spec directory were created or updated.
  • In standalone mode, .dwf/state.json。
  • In standalone mode, no other stage directories besides the target spec directory 02-设计稿/ were created.
  • In standalone mode, no subsequent stages were advanced.
  • In workflow mode, only after user confirmation update this spec's current_step to breakdown。
  • The document content is in Chinese.
  • The document follows this skill directory's references/design_template.md。
  • The save path and the matters requiring user confirmation for the next step have been explained.