A Spec-Driven Development (SDD) process enforcement CLI extending Speckit
Project description
SpecOps CLI
Read this in: English | Português (BR)
SpecOps turns GitHub Speckit's spec-driven workflow into an enforced, auditable process. It layers an agent-guided atomic development methodology on top of any Speckit repository — a physical state ledger, machine-collected evidence, and token-optimized review — without replacing or forking a single Speckit file.
Speckit gives your agents great artifacts (spec → plan → tasks → implement). SpecOps makes sure they actually follow them: state is on disk and Git-verifiable, evidence is collected by tooling instead of claimed by the agent, and review rejects as cheaply as possible.
Why SpecOps?
Spec-driven development with AI agents has three recurring failure modes. SpecOps addresses each one:
| Problem | Without SpecOps | With SpecOps |
|---|---|---|
| Agents hallucinate progress | "Done ✅" with no proof | Every task is closed with machine-collected evidence (test output, commit hashes, diffs) recorded in the ledger |
| State lives in the chat | Lost on context reset; not auditable | State is a physical status.yaml ledger, Git-verifiable and recovery-safe |
| Reviews are slow and expensive | Agent reads the whole repo | /specops-review rejects cheapest-first (reconcile → lint/test → out-of-plan files) before reading any code |
What it adds to Speckit
- 📒 Physical state ledger (Repo-as-State). A structured
status.yamltracks phase, tasks, evidence, and review cycles. Mutated only throughspecopscommands — never hand-edited, never held in agent memory. - 🔬 Automated evidence collection.
complete-task --autoruns your test command, harvests commits and diffs, and records them as typed evidence. A task cannot beDONEwithout proof. - 🔁 A phase state machine wired into the prompts.
specops initinjects directives into the specify, plan, tasks, and implement prompts so the ledger is created and phases advance automatically — the human never runs the bookkeeping by hand. - ✂️ Token-optimized surgical review. The installed
/specops-reviewcommand reviews only in-scope files and stops at the first cheap rejection. - 📐 Empirical verification & gates.
specops consistencyandspecops reconcileare exit-code gates you can drop into CI or agent prompts. - ➕ Additive and reversible. Everything is delivered through marker-delimited blocks. Uninstalling restores your Speckit files byte-for-byte.
Install
pip install speckit-specops
Installs the specops command. Requires Python ≥ 3.10 and Git ≥ 2.30. No
network I/O after install.
Quick Start
# In a Speckit-initialized repository:
specops init # inject directives, install /specops-review, create specops.json
That's it. From here you drive Speckit as usual (/speckit.specify,
/speckit.plan, /speckit.tasks, /speckit.implement) and the injected
directives take care of the ledger and phase transitions. Check state anytime:
specops status show
How it works
SpecOps rides the Speckit lifecycle. Once specops init has run, the injected
directives drive the ledger at each stage seam:
| Speckit stage | What SpecOps does |
|---|---|
| specify | Marks the repo as SpecOps-managed (informational; no ledger yet) |
| plan | Enforces empirical path verification and the consistency gate |
| tasks | Creates the ledger (status init-spec), advances the phase to TASKS, and requires [SC-xxx] coverage tags on every task |
| implement | Opens IMPLEMENT, runs the evidence-backed ledger loop, then opens REVIEW |
| review | /specops-review validates the diff and records APPROVED / REJECTED |
The phase machine is SPECIFY → PLAN → TASKS → IMPLEMENT → REVIEW → DONE.
If SpecOps is not installed, the Speckit prompts still work standalone — the
directives degrade to no-ops.
Command reference
specops init [--non-interactive]
Prepares a Speckit repository in one run: validates (or offers to create) a Git
repo, detects Speckit, resolves prompt targets from Speckit's integration
manifests (works with any recorded agent layout — Claude skills, GitHub
Copilot, etc.), creates/merge-preserves specops.json, installs
/specops-review, and injects the directive blocks into the specify, plan,
tasks, and implement prompts (additive, idempotent, byte-identical restore on
removal). --non-interactive declines all prompts (CI-safe).
Speckit upgrade note: a Speckit upgrade may rewrite prompt files and remove the injected blocks. Just re-run
specops initto re-inject.
specops status show
Read-only. Prints ledger state: feature, branch, phase, active task, task counts (pending / in progress / done / orphaned), and the review-cycle history.
specops status init-spec [<name>]
Creates <feature_dir>/status.yaml from the packaged scaffold, syncing task IDs
from tasks.md. Usually run for you by the tasks directive.
specops status start-task <task-id>
Marks the task IN_PROGRESS and records started_commit = HEAD. Enforces the
single-active-task rule.
specops status complete-task <task-id> [--auto | --evidence "CLASS:summary"]
Marks the task DONE with exactly one evidence source:
--auto: runstest_command; on success, harvestsstarted_commit..HEADcommits + diff asTEST_REPORT/CODE_DIFFevidence.--evidence "CLASS:summary": caller-supplied, withCLASSinCLI_LOG | TEST_REPORT | SCREENSHOT_PATH | CODE_DIFF.
specops status transition-phase <phase> [-r APPROVED|REJECTED]
Advances the phase one step forward. Two transitions require -r:
specops status transition-phase DONE -r APPROVED # approved → close the feature
specops status transition-phase IMPLEMENT -r REJECTED # rejected → send back for rework
Entering DONE requires the latest review cycle to be APPROVED.
specops reconcile
Read-only gate. Verifies every ledger commit hash is reachable from HEAD and
every DONE task has commits and evidence. Exit 1 on any divergence.
specops reconcile || exit 1 # preflight before review
specops review
Read-only gate. Runs the deterministic review gates cheapest-first with early stop: reconcile → lint → test → working tree/effective diff. The first failing gate stops the run and prints its evidence to stderr (exit 1); a full pass prints a per-gate report to stdout (exit 0) that lists the effective-diff files — the exact scope the review agent then reads. Ledger parse errors keep exit 2. Runs from any directory inside the repo, never writes to the ledger or any repository file, needs no specific ledger phase, and never prompts — safe as a CI step.
specops review # local: gate-check the current change
As a CI gate:
# .github/workflows/ci.yml (step)
- run: pip install speckit-specops
- run: specops review
As an automated gate inside a Speckit workflow (replaces a human approve/reject gate; the YAML is yours, no SpecOps coupling):
- id: review
type: shell
run: specops review
on_fail: abort
specops consistency
Read-only gate. Verifies every SC-\d+ in the spec has ≥ 1 task with a matching
[SC-xxx] tag, and every plan.md path declaration carries a valid action
suffix ((create)/(modify)/(remove)). Exit 1 on violation.
specops --version
Prints the version and exits. Works anywhere.
Configuration — specops.json
| Key | Purpose | Default |
|---|---|---|
test_command |
Command run by complete-task --auto |
pytest |
lint_command |
Lint gate run by specops review (empty = skipped) |
"" |
skills_dir |
Directory the review prompt loads skills from | .specify/skills |
Unknown keys are preserved on re-init.
The /specops-review command
Installed by specops init (the name follows the layout's separator, e.g.
/specops-review for Claude skills). Not a CLI command — a packaged prompt that
drives the review agent cheapest-rejection-first:
- Load skills from
skills_dir. specops review— the CLI runs all deterministic gates (reconcile, lint, test, working tree); any non-zero exit is an immediate REJECTED without reading a single line of code.- Surgical diff review of in-scope files only.
- Write
revisions/revision-X.mdand record theAPPROVED/REJECTEDoutcome.
Language policy
All SpecOps operational output (CLI messages, injected assets) is in English.
Your prose (spec.md, plan.md, task descriptions) may be in any language —
SpecOps parses only structural tokens (SC-\d+, T\d+, action suffixes), never
content.
Supported Speckit layouts
SpecOps resolves prompt targets at runtime from
.specify/integrations/<agent>.manifest.json. Any Speckit integration with a
recorded manifest is supported; unknown layouts fail closed. Tested with
Speckit ≥ 0.12 (Claude skills mode, separator -).
Uninstall
Remove the appended block from each prompt file, then delete specops.json and
the installed review command. No other files are written; the restore is
byte-identical.
Contributing
Contributions are welcome — see CONTRIBUTING.md for dev setup,
the quality gates, and project principles. SpecOps is at 0.x; the CLI surface
and ledger format may still change before 1.0 (see CHANGELOG.md).
License
MIT © Paulo Segundo
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file speckit_specops-0.2.1.tar.gz.
File metadata
- Download URL: speckit_specops-0.2.1.tar.gz
- Upload date:
- Size: 26.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aef0e0c351f845c09ed2068f526c57845c2b5aaaefb45fe9edecfc575801bac8
|
|
| MD5 |
1ec73d6098afe5cc58dfc45392a23eb5
|
|
| BLAKE2b-256 |
eca8601ee71b4855512afd5afb0c104943e75e8c3ea99e2081c0acc7a5f37729
|
Provenance
The following attestation bundles were made for speckit_specops-0.2.1.tar.gz:
Publisher:
release.yml on paulo2nd/specops
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
speckit_specops-0.2.1.tar.gz -
Subject digest:
aef0e0c351f845c09ed2068f526c57845c2b5aaaefb45fe9edecfc575801bac8 - Sigstore transparency entry: 2169349813
- Sigstore integration time:
-
Permalink:
paulo2nd/specops@fdd83c4f3c9d2fa58c5ed392cc8bf692fc70fb12 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/paulo2nd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fdd83c4f3c9d2fa58c5ed392cc8bf692fc70fb12 -
Trigger Event:
release
-
Statement type:
File details
Details for the file speckit_specops-0.2.1-py3-none-any.whl.
File metadata
- Download URL: speckit_specops-0.2.1-py3-none-any.whl
- Upload date:
- Size: 34.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ae95d0742bdf168823e8e41f2fd1a2eb60e43c0490c2c4417150549e8bca12c
|
|
| MD5 |
e2dfb33a64b045ca6d4ff648790fc0f0
|
|
| BLAKE2b-256 |
6aebe700c5a169c141b593ae49b09cc212e3984b9b830a1eed33e2bdd12b2ce6
|
Provenance
The following attestation bundles were made for speckit_specops-0.2.1-py3-none-any.whl:
Publisher:
release.yml on paulo2nd/specops
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
speckit_specops-0.2.1-py3-none-any.whl -
Subject digest:
1ae95d0742bdf168823e8e41f2fd1a2eb60e43c0490c2c4417150549e8bca12c - Sigstore transparency entry: 2169349858
- Sigstore integration time:
-
Permalink:
paulo2nd/specops@fdd83c4f3c9d2fa58c5ed392cc8bf692fc70fb12 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/paulo2nd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fdd83c4f3c9d2fa58c5ed392cc8bf692fc70fb12 -
Trigger Event:
release
-
Statement type: