From spec-superflow
Entry point for the spec-superflow state-machine workflow. Inspects change context, determines state, routes to correct skill, and blocks invalid transitions.
How this skill is triggered — by the user, by Claude, or both
Slash command
/spec-superflow:workflow-startThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Primary entry point for `spec-superflow`. Jobs: inspect change context, check for updates, confirm DP-0, determine state, route to correct skill, block invalid transitions.
Primary entry point for spec-superflow. Jobs: inspect change context, check for updates, confirm DP-0, determine state, route to correct skill, block invalid transitions.
Only invoke when spec-superflow context is present: .spec-superflow.yaml exists, artifacts like proposal.md/specs//design.md/tasks.md/execution-contract.md are present, or user explicitly invokes spec-superflow by name. When in doubt, check for .spec-superflow.yaml first.
Do NOT invoke for: general coding tasks outside spec-superflow changes, casual questions, unrelated work.
exploring → specifying → bridging → approved-for-build → executing → closing, with debugging side-path from executing, and abandoned as terminal. Read docs/state-machine.md if transition is ambiguous.
node "${CLAUDE_PLUGIN_ROOT}/scripts/check-update.mjs". Exit 0 → continue. Exit 1 → non-blocking upgrade reminder. Exit 2 → skip.proposal.md, specs/, design.md, tasks.md, execution-contract.md. Answer: Is the change fuzzy? Artifacts missing/unstable? Contract exist? User approved contract? Execution in progress or blocked? In verification/wrap-up?ssf handoff list <change-dir> --json and ssf checkpoint list <change-dir> --json. A result-ready handoff requires explicit review and ssf handoff resolve before resuming the affected work. An active handoff is non-blocking side work. Show a non-stale checkpoint as recovery context; show a stale checkpoint only as historical evidence.approved-for-build, executing, debugging, or closing, run ssf execution show <change-dir> --json. Treat only current: true plus waves[].eligible: true as permission to start a wave; report plan revision, mode, next eligible wave, and every wave's receipt/blockers. A missing, invalid, or stale plan blocks implementation and routes to build-executor; do not infer progress from chat history.Run DP-0 when: change folder doesn't exist, planning artifacts missing/empty, or dp_0_confirmed ≠ true. Skip if dp_0_confirmed is true.
Ask: change name + one-sentence intent, known constraints, related optimizations (include or stay focused?), communication preference (ask per decision or draft for review).
After confirmation:
node "${CLAUDE_PLUGIN_ROOT}/scripts/spec-superflow.mjs" state set <change-dir> dp_0_decisions "<summary>"
node "${CLAUDE_PLUGIN_ROOT}/scripts/spec-superflow.mjs" state set <change-dir> dp_0_result confirmed
node "${CLAUDE_PLUGIN_ROOT}/scripts/spec-superflow.mjs" state set <change-dir> dp_0_confirmed true
node "${CLAUDE_PLUGIN_ROOT}/scripts/spec-superflow.mjs" state set <change-dir> dp_0_timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)
Config-aware routing: check artifacts.order and artifacts.skip from project config.
If workflow is auto/null/unset: run node "${CLAUDE_PLUGIN_ROOT}/scripts/infer-workflow.mjs" <change-dir>. Inference: hotfix (≤2 tasks, ≤2 files, no schema/API/new modules), tweak (≤4 tasks, config/doc only), full (anything larger). Persist with node "${CLAUDE_PLUGIN_ROOT}/scripts/spec-superflow.mjs" state set <dir> workflow <mode>.
Validate mode against artifact content. If hotfix/tweak criteria not met → upgrade to full and output reason. Don't overwrite explicit mode unless user asks.
Change is fuzzy, scope unclear, comparing options, no stable change name.
Guard: node "${CLAUDE_PLUGIN_ROOT}/scripts/guard/guard.mjs" check <dir> exploring specifying --json → fail = BLOCK. User knows what they want, artifacts missing/incomplete.
Guard: ... check <dir> specifying bridging --json → fail = BLOCK. Artifacts exist, implementation requested, contract missing/stale. Include DP-3: 契约批准.
Contract exists and approved, contract matches artifacts. Include DP-4: 执行模式选择. Before the first implementation edit, build-executor must run ssf execution plan <change-dir> ..., then ssf execution show <change-dir> --json; report the saved revision, selected mode, ordered waves, and actual concurrent-dispatch capability. Do not transition to executing until show reports current: true; then run ... check <dir> approved-for-build executing --json → fail = BLOCK.
Execution hit blockage: test failure, unexpected behavior, build error, task cannot proceed. After debugging, route back to build-executor.
The current planned wave is implemented and ready for spec-compliance + code-quality verification. A reviewer must write an ssf execution review <change-dir> --wave <id> --base <sha> --head <sha> --report <path> --verdict <pass|fail> receipt before any dependent wave or closing transition.
Guard: ... check <dir> executing closing --json → fail = BLOCK. Implementation complete, verification complete/nearly complete. Include DP-7: 归档确认.
Delta specs exist that need merging, change closing with ADDED/MODIFIED/REMOVED/RENAMED specs.
User explicitly requests, bug-investigator escalates after 3+ failures AND user chooses, scope change makes change no longer worthwhile AND user confirms. Block from closing or abandoned.
When the user's brief explicitly contains UI, screen, interaction, layout, UX, or product-experience uncertainty, ask once whether a prototype would reduce uncertainty. Do not create a prototype handoff or enter a prototype worktree until the user confirms. After confirmation:
node "${CLAUDE_PLUGIN_ROOT}/scripts/spec-superflow.mjs" handoff create <change-dir> \
--type prototype --objective "<confirmed objective>" \
--expected-output "<expected evidence>" --acceptance "<completion criterion>"
node "${CLAUDE_PLUGIN_ROOT}/scripts/spec-superflow.mjs" isolate <change-dir> prototype-<handoff-id>
Never suggest or enter this route automatically for backend, CLI, configuration,
or internal-refactor work. Never pass --force to ssf isolate for prototype
work.
exploring bridging --workflow hotfix, then bridging -> approved-for-build, after DP-3 → build-executor (default SDD plan), after → release-archivist (lightweight). Hotfix may skip proposal.md, design.md, tasks.md, and specs/, but it still requires a fresh minimal execution-contract.md, DP-3 approval, and a current execution plan before buildexploring approved-for-build --workflow tweak, after → release-archivist (lightweight)Post-transition: 💡 node "${CLAUDE_PLUGIN_ROOT}/scripts/spec-superflow.mjs" inject <change-dir> to update phase-guard artifacts.
Use content inspection, not timestamps.
Stale contract: proposal scope expanded beyond contract scope fence, or contract references capabilities no longer in proposal → route back to contract-builder.
Stale planning artifacts: capability in proposal has no spec file, or spec exists for capability not in proposal → drift detected.
Stale tasks: requirement in specs has no corresponding task → stale tasks.
ssf execution plan; no state transition based on an unverified DP-4 stringpassabandoned (terminal)abandoned from closing or abandonedAlways state: (1) current detected state, (2) why (cite file/content/condition), (3) which skill should run next. If blocking, explain missing artifact/approval.
Decision point references when routing:
.spec-superflow.yaml is malformednpx claudepluginhub magebyte-zero/spec-superflow --plugin spec-superflowManages workflow states in sdd/workflows/ via YAML, tracking spec/plan/impl/review phases for session-independent resumption across conversations.
Advances OpenSpec changes by listing recent ones, checking status via CLI, and generating the next ready artifact per schema instructions and templates.
Transforms ideas into structured specifications (requirements, design, tasks) before implementation. Use when building features, fixing bugs, refactoring, or designing systems.