跳到正文
DEV Community· Faris Han·· 4 天前AI 評分53

OpenCode 工作流程循環:以規格、實作、驗證、審查和交付完成開發

OpenCode Workflow Loop: spec implement verify review ship

AI 導讀

Faris Han 分享一套用於 OpenCode 專案的開發循環,依次完成規格、實作、驗證、審查和交付,並要求每一步通過檢查後才進入下一步。流程以 SPEC.md、PLAN.md 和 ACCEPTANCE.md 設定目標,使用 wf-verify 執行相應的建置、lint 和測試,並透過獨立審查檢查 diff、範圍及安全問題。

正文

OpenCode Workflow Loop: spec → implement → verify → review → ship

Vibe-coding gets you a demo. It rarely gets you a shippable repo. The gap is
not the model; it is the missing structure around the model: a spec to aim at,
a verify gate to catch regressions, a review pass to catch the things tests do
not, and a ship step that does not skip the boring parts.

This guide walks through the loop I use on every OpenCode project, plus the
templates that make it cheap to repeat.

The loop

  1. Spec — write what "done" looks like before touching code.
  2. Implement — let the agent write code against the spec.
  3. Verify — run a universal verify gate (build, lint, tests).
  4. Review — a second pass: diff review, scope check, security sanity.
  5. Ship — commit, tag, push, update docs.

Each step is small and gated. You do not move on until the gate passes.

1. Spec

A spec is three short files, not a novel:

  • SPEC.md — what the thing does, for whom, and the acceptance criteria.
  • PLAN.md — the ordered steps to get there.
  • ACCEPTANCE.md — the checklist that proves it shipped.

Keep each under a page. The point is to give the agent a target it can be
checked against, and to give you a definition of done that survives the session.

Template (drop into any repo):

# SPEC.md
## Problem
## Users
## Acceptance criteria
- [ ] ...

2. Implement

Hand the spec to OpenCode. The agent implements against SPEC.md and updates
PLAN.md as it goes. Two rules:

  • One task at a time. Do not batch "implement everything."
  • The agent must run the verify gate after each meaningful change, not at the end.

3. Verify

Verification is the step most people skip, and it is the one that matters.
Use a single command that works across ecosystems:

wf-verify

wf-verify detects the project type (Go, Bun/Node, Rust, Python, Make, and
more) and runs the right build, lint, and test commands. It returns a clear
pass/fail so the loop can gate on it. No more "it works on my machine" — the
gate is the same everywhere.

If wf-verify fails, you do not review or ship. You fix.

4. Review

A separate pass, ideally a different agent persona, over the diff:

  • Does the diff match SPEC.md? (scope creep check)
  • Are there tests for the new behavior?
  • Any secrets, hardcoded paths, or unsafe defaults?
  • Did the verify gate actually run, or did someone skip it?

Review is cheap and catches the things verify does not.

5. Ship

Only after verify + review pass:

  • Commit with a clear message (what + why).
  • Tag if it is a release.
  • Push.
  • Update README/install instructions if behavior changed.
  • Log the work in your daily inputs.

Templates

The loop ships with drop-in templates: SPEC.md, PLAN.md, ACCEPTANCE.md,
plus agent/command definitions (/spec, /plan, /verify, /ship) and
implementer/tester/reviewer personas. They are MIT-licensed and free.

Get it

Takeaway

The model is not the bottleneck. The missing gate is. Add a spec, a verify
command, and a review pass, and "vibe-coding" becomes "shipping."

來源:DEV Community · dev.to