Run prep and implement as Spec Kit workflows

Merged
PO
15d ago
+1190-319

What has been implemented

opsmill-sdd installs three Spec Kit workflows. opsmill-prep and opsmill-implement run each phase as one step, and their files state when a phase is repeated and how often. /speckit.opsmill.prep, /speckit.opsmill.implement and /speckit.opsmill.auto each start their workflow and report its result. This is task 5.2 of the migration plan, with the trial of task 5.1.

Before: how a developer runs prep and implement end to end

The developer opens a Claude Code session and runs /speckit.opsmill.auto. It runs the prep skill, then the implement skill, in that same session.

flowchart LR
	D((Developer)) --> S["Claude Code session,<br>opened by the developer"]
	S --> A["/speckit.opsmill.auto"]
	A --> P["prep skill"]
	P --> I["implement skill,<br>same session"]
	classDef cmd fill:#ffedd5,stroke:#ea580c,color:#7c2d12
	class A,P,I cmd

After: how opsmill-auto runs prep and implement

specify workflow run starts each step as its own claude -p process, and Spec Kit keeps the state of the run. /speckit.opsmill.auto starts this workflow from a Claude Code session.

flowchart LR
	R["specify workflow run opsmill-auto<br>-i spec=..."] --> S
	subgraph PREP["opsmill-prep: one step per phase, a commit after each"]
		S["specify, or correct<br>the spec after drift"] --> PL["plan"]
		PL --> C["critique"]
		C -->|"RETHINK:<br>3 passes at most"| PL
		C -->|"PROCEED"| T["tasks"]
		T --> AL["alignment check"]
		AL -->|"significant drift:<br>2 corrections at most"| S
	end
	subgraph IMPL["opsmill-implement: one step per phase"]
		PF["check the spec directory<br>and the working tree"] --> CH["one chunk of tasks.md"]
		CH -->|"tasks left, and the chunk<br>completed at least one:<br>20 chunks at most"| CH
		CH --> RV["review"]
		RV --> RP["report"]
	end
	AL -->|"no significant drift"| PF
	C -.->|"limit reached"| X["stop with an error"]
	AL -.->|"limit reached"| X
	PF -.->|"not ready"| X
	RP -.->|"status is not DONE"| X
	classDef workflow fill:#dcfce7,stroke:#16a34a,color:#14532d
	classDef bad fill:#fee2e2,stroke:#dc2626,color:#7f1d1d
	class S,PL,C,T,AL,PF,CH,RV,RP workflow
	class X bad
  • In opsmill-prep, specify, plan and tasks run the Spec Kit commands. The critique, the alignment check and the spec correction run three new commands of the opsmill extension.
  • In opsmill-implement, each chunk of tasks.md runs in its own agent process, which replaces the subagents of the implement command. The chunk, the review and the report run three new commands of the opsmill extension.
  • /speckit.opsmill.prep, /speckit.opsmill.implement and /speckit.opsmill.auto start their workflow, tell which phase starts and report the result. The final STATUS: lines of prep and implement keep the same format.
  • Changes in implement:
    • It no longer pauses for the user: it ends with STATUS: BLOCKED when the spec directory is not ready or the working tree has uncommitted changes.
    • It stops implementing when a chunk completes no task. The review and the report still run.
    • A run that does not end with STATUS: DONE ends the workflow with an error.
    • The review runs /code-review at the medium effort level when the pr-review-toolkit plugin is not installed.
  • Both bundles move to 0.1.0, because opsmill-sdd now pins the workflows. The opsmill extension moves to 1.5.0, because the six phase commands change its zip.

What workflow_result.py prints after a run

Example, /speckit.opsmill.auto in an interactive session on 2026-11-17 (paths shortened):

run 256093ce | workflow opsmill-auto | completed
phases started: specify x1, plan x1, critique x1, tasks x1, align x1, chunk x6, review x1, report x1
prep.critique -> CRITIQUE_VERDICT: PROCEED | CRITIQUE: extension
prep.alignment -> ALIGNMENT: ALIGNED
implement.report -> STATUS: DONE | SPEC_DIR: <repo>/specs/001-subtract-safe-divide | REVIEW: command | REASON: n/a
coverage: critique full (extension)
coverage: review full (command)

Example with a critique and a review of reduced coverage, from phases played by a script:

coverage: critique REDUCED (fallback): a built-in critique of reduced depth ran; install the critique extension: specify bundle install opsmill-sdd
coverage: review REDUCED (fallback): a built-in review of reduced depth ran; install the review plugin in Claude Code: /plugin install pr-review-toolkit@claude-plugins-official

In that run, /speckit.opsmill.auto started its summary with these two lines.

Trial on a throwaway repo

Runs on 2026-11-17 and 2026-11-18 at the head of #43, with Spec Kit 1.2.4 and the real agent, on a request for subtract and a safe divide:

  • DONE for /speckit.opsmill.auto in an interactive session (12 min, no permission prompt) and without a session, and for opsmill-implement alone (6 min).
  • A plan that the critique rejects is reworked, then accepted.
  • BLOCKED (uncommitted file) and INCOMPLETE (tests not allowed) both fail the run.
  • With a reduced critique and review, the summary starts with the coverage: … REDUCED lines.

Found in the trials and now in the README: trust the folder or pass the tools in SPECKIT_INTEGRATION_CLAUDE_EXTRA_ARGS, allow 'Bash(rtk:*)' with the rtk hook, and add .specify/workflows/runs/ to the .gitignore. Not tested: the default permission mode of Claude Code.

Tools allowed in the first trial

Allowed: Read, Edit, Write, Glob, Grep, Skill, Task, TodoWrite, Bash(.specify/scripts/bash/*), Bash(bash .specify/*), Bash(git status:*), Bash(git diff:*), Bash(git log:*), Bash(git add:*), Bash(git commit:*), Bash(git rev-parse:*), Bash(git branch:*), Bash(git checkout:*), Bash(git switch:*), Bash(python3:*), Bash(pytest:*), Bash(uv run:*), Bash(ls:*), Bash(mkdir:*), Bash(cat:*)

Denied: Bash(git push:*), WebFetch, WebSearch

Not decided yet: which tool list the repos use, and the security review of that list.

Folders structure

  • workflows/: the three workflows, new
  • commands/: six phase commands, new, and prep.md, implement.md and auto.md, which now start their workflow
  • scripts/python/workflow_result.py: prints the result of a run, with the coverage of the critique and of the review, new
  • bundles/opsmill-sdd/: pins the workflows

How to review

  1. da3f552 adds the three workflows, pins them in opsmill-sdd, and documents how to run them and which tools to allow. To review closely.
  2. 327d66a splits opsmill-prep into one step per phase and adds the three phase commands. To review closely: workflows/opsmill-prep/workflow.yml.
  3. 324244b makes /speckit.opsmill.prep start the workflow. To review closely: commands/prep.md.
  4. 3dfafec splits opsmill-implement into one step per phase and adds its three phase commands. To review closely: workflows/opsmill-implement/workflow.yml.
  5. 39a9b2f makes /speckit.opsmill.implement and /speckit.opsmill.auto start their workflows, and adds the script that reads the result of a run. To review closely: commands/implement.md, commands/auto.md.
  6. ed74d7c makes workflow_result.py print the coverage of the critique and of the review, and makes the three commands start their summary with a line of reduced coverage. To review closely: scripts/python/workflow_result.py.

šŸ¤– Generated with Claude Code