跪拜 Guibai
← All articles
Frontend

Chaining OpenSpec, Superpowers, and gstack Turns Claude Code Into an Automated Delivery Pipeline

By 关中王来了 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Most AI-coding workflows still treat requirements, testing, review, and release as separate manual steps. Wiring three Claude Code skills into a single session with state isolation and automatic hand-offs turns a chatbot into a gated delivery pipeline—cutting the rework that comes from unverified specs and untested code.

Summary

A seven-stage pipeline chains OpenSpec, Superpowers, and gstack to move AI coding from ad-hoc prompting to structured delivery. OpenSpec generates a proposal, spec, design, and task list before any code is written. Superpowers then enforces a strict TDD cycle—tests must exist and fail before implementation begins—and blocks commits that don't pass coverage, lint, and build gates. gstack reads the OpenSpec artifacts to run CEEO, engineering, DX, and security reviews, then drives Playwright E2E tests, auto-bumps versions, generates changelogs, and creates a pull request. The final archive phase diffs the spec against the implementation, records deltas, and merges lessons back into the project's living specification. The four hand-off points—specs feeding plan reviews, TDD tests feeding code review, ship triggering archive, and deltas updating the master spec—form a closed loop where each stage's output becomes the next stage's input without manual orchestration.

Takeaways
OpenSpec produces four structured artifacts—proposal, spec, design, and tasks—before any implementation code is written, creating a single source of truth that downstream tools consume.
Superpowers enforces a hard TDD rule inside Claude Code: the agent refuses to write implementation unless a failing test exists first, and a HARDGATE checkpoint blocks commits that fail coverage, lint, type-check, or build.
gstack reads the openspec/ directory as input for its plan phase, running CEEO, engineering, DX, and security reviews against the spec rather than reviewing from scratch.
The four hand-off points are: OpenSpec artifacts feed gstack plan reviews; TDD tests feed gstack code review; a successful ship triggers OpenSpec archive; and archived deltas merge back into the master spec.
Directory isolation—openspec/, .claude/, and gstack/—keeps the three tools' state from colliding, so they coexist in one Claude Code session without overwriting each other.
gstack's ship phase auto-bumps the version, generates a conventional changelog, creates a feature branch, commits, pushes, and opens a structured pull request with traceability back to the spec and test results.
The archive phase diffs the original spec against the actual implementation, records deviations like timezone handling changes or caching decisions, and writes lessons learned back into the project's knowledge base.
Conclusions

Treating the spec as a living document that absorbs implementation deltas—rather than a frozen upfront artifact—turns each feature into accumulated institutional knowledge instead of a one-off delivery.

The workflow's value is less about any single tool and more about the hand-offs: each stage's output is structured so the next stage can consume it without a human translating between formats.

Hard-gating commits on coverage and lint inside the coding agent itself, rather than in CI, shortens the feedback loop from minutes to seconds and makes the gate feel like part of coding rather than a separate process.

Explicit TDD exemption clauses for config files, generated code, and prototypes prevent the iron law from becoming ceremonial overhead on work that doesn't benefit from it.

Concepts & terms
OpenSpec
A Claude Code skill that generates structured requirement artifacts—proposal, spec, design, and task list—before coding begins, serving as the single source of truth for downstream pipeline stages.
Superpowers
A Claude Code skill that enforces two iron laws: TDD (no implementation without a failing test first) and HARDGATE (commits blocked unless tests, coverage, lint, type-check, and build all pass).
gstack
A Claude Code skill that runs a seven-stage Sprint pipeline—plan, design, implement, review, QA, ship, archive—automatically reading OpenSpec artifacts, running reviews, executing Playwright E2E tests, and generating releases.
HARDGATE
A pre-commit quality gate enforced by Superpowers that blocks commits if any of five checks fail: test pass rate, code coverage thresholds, linting, TypeScript type-checking, or build.
CEEO Review
A review category in gstack that evaluates code on Correctness, Efficiency, Organization, and Optimization, applied during both the plan phase (against specs) and the review phase (against implementation).
Delta Archiving
The final OpenSpec phase that diffs the original specification against the actual implementation, records deviations and trade-offs, and merges those lessons back into the master spec as a living knowledge asset.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗