Specadia Contract Handoff
1. Confirm the tool exists
Run:
specadia-contract --version
The executable is specadia-contract. Do not invoke specadia contract unless
specadia-contract is genuinely absent — the latter is a retained alias. Do not
assume import specadia works: the tool may be installed in an isolated
environment or via uvx.
If the command is missing, stop and tell the user exactly one install hint:
Specadia is not installed. Install it with: uv tool install specadia
(or: python -m pip install specadia)
Do not attempt to install it yourself.
2. Resolve inputs
Identify an approved requirements Markdown file and, optionally, a design Markdown file. Prefer paths the user supplied. Do not invent, summarize, or rewrite them.
If the user has only a product idea and no approved artifacts, offer
specadia-contract from-intent only when the specadia[full] extras and an
interactive, model-backed session are both available; otherwise ask for the
approved SRS/design. Never fabricate requirement IDs — traceability depends on
IDs the documents already carry (FR-*, NFR-*, REQ-*, AC-*).
3. Choose the harness deliberately
Cline is not Codex or Claude Code, so the default here is --harness generic
→ AGENT_CONTRACT.md. Switch only on evidence:
| Situation | Flag | File produced |
|---|---|---|
| Cline, or another non-Codex/non-Claude harness | --harness generic |
AGENT_CONTRACT.md |
User is on Codex, or the repo already has AGENTS.md |
--harness codex |
AGENTS.md |
User is on Claude Code, or the repo already has CLAUDE.md |
--harness claude |
CLAUDE.md |
State the choice in one line before running anything. Never emit all three by default.
4. Check before writing
If a matching file already exists at the repository root, stop and ask the user
whether to merge the generated instructions, keep both, or pick another harness
or output directory. Do not pass --force and do not copy over an
existing file without explicit permission.
5. Generate
Prefer a dedicated output directory so nothing is silently moved into place:
specadia-contract generate "<requirements-path>" \
--design "<design-path>" \
--harness generic \
--output-dir .specadia/contracts
Omit --design when the user supplied none. Quote every path.
6. Verify and report
Optionally confirm the artifacts still match their recorded sources:
specadia-contract verify .specadia/contracts/contract-manifest.json
Exit codes: 0 fresh, 1 stale, 3 missing artifact, 4 malformed manifest.
If verify is unavailable in the installed version, say so and skip it.
Report the harness chosen and why, the exact files written, a short excerpt proving requirement IDs were preserved, and any validation or verify failure unchanged. Then stop: the contract is a reviewed handoff artifact, not permission to start implementing.
