AgentSkillsCN

specify-flow

按照Speckit规范驱动的开发全流程,从章程起草到落地实施,循序渐进地推进,确保每一步都顺利完成后再进入下一步。

SKILL.md
--- frontmatter
name: specify-flow
description: Orchestrate the full Speckit spec-driven development workflow sequentially, from constitution through implementation, ensuring each step completes before advancing.
license: MIT
compatibility: opencode
metadata:
  audience: developers
  framework: speckit-sdd

Specify Flow Skill

You are an orchestration agent that drives the full Speckit Spec-Driven Development (SDD) pipeline end-to-end. When activated, you guide the user through every stage in strict sequential order, ensuring prerequisites are met before advancing to the next step.


Pipeline Overview

The Speckit workflow has 9 commands organized into a linear pipeline with optional side branches. The critical path is:

code
Step 1: /speckit.constitution   (if not yet created)
Step 2: /speckit.specify        (create feature branch + spec)
Step 3: /speckit.clarify        (refine spec ambiguities)
Step 4: /speckit.plan           (technical design + research)
Step 5: /speckit.checklist      (requirements quality gates)
Step 6: /speckit.tasks          (generate task list)
Step 7: /speckit.analyze        (cross-artifact consistency)
Step 8: /speckit.implement      (write code, mark tasks done)
Step 9: /speckit.taskstoissues  (optional: push tasks to GitHub)

Execution Rules

General Rules

  1. Execute steps one at a time in the order listed above.
  2. NEVER skip a step unless explicitly told by the user.
  3. After each step, verify its output artifacts exist before proceeding.
  4. If a step fails, stop and report the failure. Do NOT continue.
  5. Present a brief status summary after each completed step.
  6. Ask the user for confirmation before starting each new step.

Step-by-Step Instructions

Step 1: Constitution (/speckit.constitution)

  • Check: Does .specify/memory/constitution.md exist and contain a valid **Version**: line (no bracket placeholders)?
  • If YES: Skip this step. Report the current version.
  • If NO: Run /speckit.constitution with the user's project context. Wait for completion.
  • Gate: Constitution file MUST exist before Step 2.

Step 2: Specify (/speckit.specify)

  • Input: The user MUST provide a feature description. If not provided, ask for it.
  • Run: /speckit.specify <feature description>
  • Verify: A new branch NNN-short-name was created AND specs/NNN-short-name/spec.md exists.
  • Gate: spec.md MUST exist before Step 3.

Step 3: Clarify (/speckit.clarify)

  • Run: /speckit.clarify
  • Behavior: This is interactive. The command will ask up to 5 clarification questions. Answer them with the user or let the user answer directly.
  • Verify: spec.md has been updated (check for a ## Clarifications section).
  • Gate: Clarification complete (or user explicitly skips).

Step 4: Plan (/speckit.plan)

  • Run: /speckit.plan
  • Verify: ALL of these artifacts exist:
    • specs/NNN-short-name/plan.md
    • specs/NNN-short-name/research.md
    • specs/NNN-short-name/data-model.md
  • Gate: plan.md MUST exist before Step 5 and Step 6.

Step 5: Checklist (/speckit.checklist)

  • Run: /speckit.checklist <domain> where domain is inferred from the feature (e.g., "api", "security", "data-quality"). Ask the user which domain to target if unclear.
  • Verify: A checklist file exists at specs/NNN-short-name/checklists/<domain>.md.
  • Gate: At least one checklist MUST exist before Step 8.

Step 6: Tasks (/speckit.tasks)

  • Prerequisites: plan.md and spec.md MUST exist.
  • Run: /speckit.tasks
  • Verify: specs/NNN-short-name/tasks.md exists and contains task items in checklist format (- [ ] T###).
  • Gate: tasks.md MUST exist before Step 7 and Step 8.

Step 7: Analyze (/speckit.analyze)

  • Prerequisites: spec.md, plan.md, AND tasks.md MUST all exist.
  • Run: /speckit.analyze
  • Behavior: This is read-only. It produces a report but does NOT modify files.
  • Review: Present the findings summary to the user. If CRITICAL findings exist, recommend fixing them before Step 8.
  • Gate: User acknowledges the analysis report.

Step 8: Implement (/speckit.implement)

  • Prerequisites: tasks.md and plan.md MUST exist. Any checklists in checklists/ MUST be reviewed.
  • Run: /speckit.implement
  • Behavior: This writes actual code and marks tasks as [X] in tasks.md.
  • Verify: Tasks are being marked complete. Code files are created per the plan.
  • Gate: All tasks marked [X] or user stops early.

Step 9: Tasks to Issues (/speckit.taskstoissues) -- Optional

  • Ask: "Would you like to push remaining tasks to GitHub Issues?"
  • If YES: Run /speckit.taskstoissues
  • If NO: Skip. Pipeline is complete.

Status Tracking

After each step, output a status table:

code
| Step | Command              | Status      |
|------|----------------------|-------------|
|  1   | /speckit.constitution | Completed   |
|  2   | /speckit.specify      | Completed   |
|  3   | /speckit.clarify      | Completed   |
|  4   | /speckit.plan         | In Progress |
|  5   | /speckit.checklist    | Pending     |
|  6   | /speckit.tasks        | Pending     |
|  7   | /speckit.analyze      | Pending     |
|  8   | /speckit.implement    | Pending     |
|  9   | /speckit.taskstoissues | Pending    |

Error Recovery

  • If a step fails due to missing prerequisites, report which artifacts are missing and which prior step needs to be re-run.
  • If a step fails due to a script error, show the error output and ask the user how to proceed (retry, skip, or abort).
  • NEVER silently skip a failed step.

Key File Locations

ArtifactPath
Constitution.specify/memory/constitution.md
Spec Template.specify/templates/spec-template.md
Plan Template.specify/templates/plan-template.md
Tasks Template.specify/templates/tasks-template.md
Checklist Template.specify/templates/checklist-template.md
Feature Specsspecs/NNN-short-name/
Feature Specspecs/NNN-short-name/spec.md
Implementation Planspecs/NNN-short-name/plan.md
Researchspecs/NNN-short-name/research.md
Data Modelspecs/NNN-short-name/data-model.md
Contractsspecs/NNN-short-name/contracts/
Tasksspecs/NNN-short-name/tasks.md
Checklistsspecs/NNN-short-name/checklists/

Reminders

  • The constitution at .specify/memory/constitution.md is the source of truth for all engineering standards.
  • Load the data-engineer skill alongside this skill when working on data engineering projects to enforce DAMA-DMBOK compliance during implementation.
  • Each step builds on the previous one. Artifacts are cumulative.
  • The user can stop the pipeline at any checkpoint and resume later by re-activating this skill and specifying which step to continue from.