A spec-driven development workflow that wraps the OpenSpec CLI with TDD discipline and subagent-based implementation, for Claude Code and OpenCode.
The core idea: a Given/When/Then scenario and a test case are the same object.
Requirements are terse (one SHALL sentence, 1-3 scenarios) and every scenario
maps to exactly one named test, enforced by a semantic lint script that runs
alongside openspec validate --strict.
This is alpha software. It dispatches an unbounded number of subagents in a loop and will happily burn through a large number of tokens doing so. It has not been proven not to set your house on fire. Use it on a system you're prepared to lose, review what it's about to do before you approve it, and please, for everyone's sake, do not let it anywhere near your neighbor's spouse. You have been warned.
Into an existing repository (installs into the current directory by default):
curl -fsSL https://raw.githubusercontent.com/mafeka/superspecs/main/install.sh | bashOr with npx:
npx github:mafeka/superspecsBoth accept a target directory, --force (overwrite files already installed), and
--host <claude|opencode|all> (default all) to restrict which host's command
set gets installed:
curl -fsSL https://raw.githubusercontent.com/mafeka/superspecs/main/install.sh | bash -s -- /path/to/repo --force
npx github:mafeka/superspecs /path/to/repo --force
npx github:mafeka/superspecs /path/to/repo --host opencodeRequirements in the target repo: git, node (>= 18), and either the
openspec CLI on PATH or a package.json the installer can add it to as a
devDependency. The target should be (or become) a git repository —
/superspec-apply's task and final reviews both work from git diff.
The installer is idempotent: re-running it skips files that already exist
unless --force is passed. By default it installs the command set for both
hosts; pass --host claude or --host opencode to install just one. It will:
- Add
openspec/schemas/superspec/— the forked OpenSpec schema enforcing the terse requirement format - Add
scripts/superspec-lint.mjs— the semantic lint (scenario coverage, task-size cap, one-sentence requirements) - Add
.claude/commands/superspec-*.md— the five slash commands below (Claude Code; skipped with--host opencode) - Add
.claude/superspec/— subagent dispatch prompt templates used by/superspec-apply(Claude Code; skipped with--host opencode) - Add
.opencode/command/superspec-*.md— the five commands below (OpenCode; skipped with--host claude) - Add
.opencode/agent/superspec.mdand.opencode/superspec/— the OpenCode agent and its dispatch prompt templates (OpenCode; skipped with--host claude) - Run
openspec initif the target has noopenspec/root yet - Set
openspec/config.yaml's default schema tosuperspec
| Command | Behavior |
|---|---|
/superspec-explore |
Discovery dialogue. Writes no artifacts. |
/superspec-propose |
Writes proposal.md and terse delta specs, gated on openspec validate --strict. |
/superspec-tasks |
Derives tasks.md with explicit scenario grouping and a per-task implementer tier, gated on the semantic lint. |
/superspec-apply |
Dispatches one fresh implementer subagent per task (per-task TDD cycle), a fresh reviewer per task, then an adversarial whole-change review that gates archive. |
/superspec-archive |
Archives the change — refuses to run until the final review reports Approved. |
Typical flow: /superspec-propose → /superspec-tasks → /superspec-apply → /superspec-archive.
Every task line in tasks.md carries a [tier: haiku|sonnet|opus] tag next
to its [scenarios: ...] and [test: ...] tags. /superspec-tasks assigns
it — it is the step that reads the codebase, so it is the one that can judge
how hard a task actually is. sonnet is the default; haiku is for
mechanical, fully specified work with no design latitude, opus for
concurrency, cross-package contracts, and non-obvious edge semantics.
On Claude Code, /superspec-apply dispatches each implementer on its tier's
model, and escalates one step up the ladder when an implementer reports
BLOCKED for lack of reasoning or when a task fails two review rounds at the
same tier. Escalations rewrite the tag so a resumed run can't fall back to a
tier that already failed, and land in the change's progress.md.
On OpenCode the tag is advisory. A subagent's model there comes from its
agent definition rather than from the dispatch call, and SuperSpec dispatches
every role as general, so there is nothing to vary per task — implementers
run on the session's model regardless. The tag is still written and
preserved, so a tasks.md stays portable between hosts. Dispatching on it
would mean shipping one agent definition per tier.
Reviewers are never tiered on either host. A cheap implementer is only safe because the gate checking it isn't cheap, so the task reviewer, the final reviewer, and the whole-change fix subagent always run on the full model — and the task reviewer is never told which tier wrote the code.
node bin/install.js /path/to/target [--force]runs the installer directly from a checkout, without going through install.sh or npx.