When to Use
When authoring, validating, publishing, or executing STRATT prompt units. The CLI is the primary interface — every lifecycle operation is astratt command.
Command Table
| Command | Description | Exit Codes | Key Flags |
|---|---|---|---|
stratt new <type> <domain> <slug> | Scaffold a unit with valid schema skeleton | 0 success, 1 collision | — |
stratt validate <path> | Schema + imports + constraints | 0 pass, 1 schema fail, 3 broken import | --strict |
stratt fingerprint <path> | Compute/verify Blake3 fingerprint | 0 computed, 2 tampered | --verify |
stratt publish <path> | Validate → fingerprint → R2 → Git | 0 published, 1 validation, 4 R2 error | --dry-run |
stratt run <uri> | Execute chain via Anthropic API | 0 complete, 1 validation, 2 tampered | --gate-mode, --input |
stratt deprecate <path> | Set deprecated + tombstone | 0 deprecated | --reason, --successor (required) |
stratt verify <path> | Re-verify fingerprint against R2 | 0 verified, 2 tampered | — |
--verbose (debug output), --json (structured JSON output).
Lifecycle Pipeline
Exit Code Contract
| Code | Meaning | Recovery |
|---|---|---|
| 0 | Success | — |
| 1 | Validation failure | Fix schema errors, missing fields, invalid lifecycle transition |
| 2 | Fingerprint tampered | Re-publish via authorised author to recompute fingerprint |
| 3 | Broken import | Publish missing unit or fix the import URI |
| 4 | R2 error | Retry — operation is atomic, no partial state |
Publish Saga (FM-09)
The publish command follows R2-first-then-Git ordering:- Validate → fail fast (exit 1)
- Compute fingerprint → write to file
- Upload to R2 → if fails, revert fingerprint, exit 4
- Git commit → if fails, warn (R2 already correct)
--dry-run shows the plan without writing anything.
Gate Enforcement
stratt run pauses at gate steps by default (--gate-mode manual). Gates are architectural invariants per P-04 — they cannot be removed without a major version bump. --gate-mode auto exists for local testing only.