Spec Harness turns substantial work into a recoverable, verifiable task package. Use for spec commands, Spec Harness updates, and work spanning acceptance criteria, implementation, or delivery. Skip small reversible fixes, read-only investigation, and experiments.
---
name: spec
description: >-
Spec Harness turns substantial work into a recoverable, verifiable task package. Use for spec
commands, Spec Harness updates, and work spanning acceptance criteria, implementation, or delivery.
Skip small reversible fixes, read-only investigation, and experiments.
---
# Spec Workflow
Update a stable install: `spec-harness update` (`--check` to inspect; fallback: `~/.local/bin/spec-harness`). It installs releases, not `main`.
A v3 package stores `spec.md`, `tasks.md`, and `runs.jsonl` under `.spec/specs/YYYY-MM-DD_slug/`. Run the CLI via `python3 <skill-dir>/scripts/spec.py` (or `python3 scripts/spec.py` in-repo); add `--json` for machine output.
## Two Phases
`/spec` routes an unbound goal to `plan` (or the [two-call quick path](references/exec.md) for a small reversible goal on a clean checkout), an unfrozen bound package to `update`, and a frozen bound package to execution. Plan backward from failure, then `plan-go`.
No session brief: run `python3 <skill-dir>/scripts/spec.py next`. On fresh failure evidence, replan within the frozen goal and acceptance. Stop uses verified checkpoints and unseen blockers (or `reset_recommended` churn handoff to a fresh session); see [recovery](references/exec.md#delivery-recovery).
## Autonomy Contract
The user is the last resort, not the first; climb the ladder: resolve from repository evidence and frozen policy, then decide reversible in-scope work yourself. Park irreversible or unauthorized work, at most four cards, once per package. Re-asking what evidence already answers is a violation. Do not assign the user a repair; stop at `delivered`, `parked-only`, or `stalled`.
## Hard Rules
1. Tasks require `id`, path-glob `boundary`, and backticked non-trivial `verify` (no `true`, `:`, `exit 0`, or standalone `echo`/`printf` unless `origin: support`); optional `expect` runs a planning probe. Only recorded checkpoints advance the DAG.
2. Before `plan-go`, edit only `.spec/`. `plan-go` fails fast on pre-existing foreign staged paths; unstaged dirt inside boundaries may deliver, outside blocks.
3. Spec owns commit, archive, merge, and push; active or pending-handoff archived packages reject direct Git commit/push and hook bypasses (`--no-verify`, `-n`, `hooksPath`).
4. Standard `plan-go` binds a non-protected branch (worktree from protected branches). Quick fixes verify in place and never commit or push. Never stash user changes.
5. Boundary edits require a matching task or `plan-amend`; audit Bash diffs before verify.
6. Irreversible forks require `by: user <reference>`. New dependencies and compatibility breaks need charter authority.
7. `check` preflights the gate (including `spec.py review --pass` when `- review: required`), re-verifies distinct frozen commands on the candidate tree, archives, and applies V4 (`--check-only` never verifies/delivers).
## Entry & Sub-Intents
| Invocation | Intent |
| --- | --- |
| `/spec <goal>` | Plan when unbound; otherwise continue bound package |
| `/spec plan <goal>` | Create or refine package: lint, forks, `plan-go` |
| `/spec run [goal]` | Resume bound package or run small goal on quick path |
| `/spec repair <slug>` | Create regular v3 repair package (`kind: repair`, `repair-of`) |
| `/spec check` | Verify candidate tree, repair in scope, archive and deliver (`--check-only` diagnoses) |
| `/spec push` | Complete authorized V4 `merge`/`push` handoff on this branch |
| `/spec doctor` | Check or repair runtime, session hooks, legacy Git hooks, and hygiene |
| `/spec status` | Read-only `spec.py status`: next action, archive, and counts |
| `/spec purge` | `spec.py purge`: unstage `.spec` records, keep local files |
Planning: [plan](references/plan.md). Execution: [exec](references/exec.md). Format: [format](references/format.md). Philosophy: [philosophy](references/philosophy.md). Git: [git](references/git.md).