Command line
npx aiad-sdd CLI — install and tool up
The slash commands live in the agent; the aiad-sdd CLI lives in the terminal and the CI. It installs SDD Mode, keeps it up to date, and provides the deterministic verdicts (traceability, multi-runtime parity, project state) that turn rituals into measurements.
1-minute install
npx aiad-sdd init
A single command installs in your project: the .aiad/ structure (PRD, ARCHITECTURE, AGENT-GUIDE, intents, specs, metrics), the 4 Tier 1 governance agents (AI-ACT, RGPD, RGAA, RGESN) and the CRA agent shipped as a complement for software products, the 33 slash commands and the 9 skills for Claude Code and the configured CLAUDE.md file. Then, in the agent: /sdd init to start the framing.
| Option | Effect |
|---|---|
--sans-gouvernance | Initialise without the Tier 1 governance agents. |
--minimal | AIAD-Lean profile: 4 commands (intent / spec / gate / drift-check). |
--upgrade <module> | Adds a module to the minimal profile: rituals, metrics, gouvernance or all. |
--runtime <list> | Target AI runtime: claude-code (default), cursor, codex, copilot, gemini, kiro (since 1.19.0, passed on to emit-rules), all. |
--with-git-hooks | Installs the pre-commit hook (Drift Lock) at the same time. |
--dry-run / --force | Preview without writing / reinitialise by overwriting the existing setup. |
npx aiad-sdd update — update
Updates the slash commands and the governance agents to the current version of the package, while preserving your files: your .aiad/ artifacts (PRD, Intents, SPECs, metrics) are never touched. Options: --sans-gouvernance to leave governance untouched, --dry-run for a preview, --check in CI (exit 1 if the project diverges from the package).
The governance agents come from the package and update overwrites them; a local adaptation will never again be lost silently. init and update write a .aiad/gouvernance/.aiad-shipped.json manifest (SHA-256 fingerprint of each agent as shipped); before overwriting a locally modified agent, update backs it up as AIAD-X.md.bak-YYYY-MM-DD (then -2, -3…). An agent you added yourself is left untouched.
npx aiad-sdd status — project state
Displays the project's SDD state directly in the terminal: artifacts present, current cycle, and a maturity score from 0 to 5 — from "not initialised" to "complete". Outputs --json (machine) and --markdown (pasteable into a PR, Slack or Notion).
npx aiad-sdd trace — machine-verifiable traceability
Generates the Intent ↔ SPEC ↔ Code ↔ Tests matrix from the @intent / @spec / @verified-by / @governance annotations placed in the code. It is the final arbiter of the Drift Lock: measurement replaces an act of faith.
npx aiad-sdd trace # full matrix (md + json + html)
npx aiad-sdd trace --fail-on-gap # CI: exit 1 on a blocking gap
npx aiad-sdd trace --json # raw JSON on stdout
| Option | Effect |
|---|---|
--fail-on-gap | Exit 1 if a blocking gap is detected (orphan SPEC, validated SPEC without code) — CI usage. |
--format <list> | Produced formats: md, json, html (all by default). |
--out <dir> | Output folder (default: .aiad/metrics/traceability/). |
--watch | Regenerates the matrix on every change (intent / spec / code). |
--suggest | Creates a SPEC skeleton for every orphan SPEC referenced by the code. |
npx aiad-sdd emit-rules — multi-runtime
Regenerates the rule files of all the AI runtimes from the single upstream source (.aiad/AGENT-GUIDE.md + .aiad/gouvernance/): AGENTS.md, the CLAUDE.md header, .cursor/rules/*.mdc, .codex/AGENT.md, GEMINI.md and, since 1.19.0, the .kiro/steering/aiad*.md steering files. One single change in the AGENT-GUIDE, and Claude Code, Cursor, Codex, Copilot, Gemini and Kiro stay aligned.
npx aiad-sdd emit-rules # all targets
npx aiad-sdd emit-rules --runtime kiro # one specific runtime
npx aiad-sdd emit-rules --check # CI: exit 1 on divergence
Each generated file carries the DO NOT EDIT header and a SHA-256 source-hash: a manual modification will be overwritten at the next generation, and detected by --check in CI. Every rule is modified in the AGENT-GUIDE or the governance, never in a target.
Exit codes: 0 / 1 / 2
The CLI follows a three-state convention, aligned with the framework's JNSP uncertainty policy ("Je Ne Sais Pas" — I don't know):
| Code | Semantics |
|---|---|
0 | Success / PASS verdict. |
1 | Failure, error or FAIL verdict. |
2 | JNSP verdict — human decision required. It is not an error: the command detected an undecidable situation (vague intent, untestable criterion, ambiguous governance, unreadable file) and refuses to decide in place of the human. |
This third code lets the CI distinguish "blocked waiting for a human" from a real bug — it is notably emitted by the cycle's deterministic scorers (research, discovery-check, mini-gate, and soon gate-precheck).
npx aiad-sdd gate-precheck — Gate pre-check (upcoming)
Next release — upcoming. Deterministic pre-check of the Execution Gate, run by /sdd gate before any SQS scoring. It reads the SPEC's "Agent execution perimeter" section outside the model; only a structured declaration can close the Gate — sensitive keywords in prose only produce a warning.
npx aiad-sdd gate-precheck <SPEC-id> # human-readable verdict
npx aiad-sdd gate-precheck <SPEC-id> --json # machine verdict
| Verdict | Exit | Case | Effect on the Gate |
|---|---|---|---|
PASS | 0 | Section absent (possible warnings), "Not applicable", or a complete and consistent table. | SQS scoring can begin. |
FAIL | 1 | Irreversible action declared without a stop threshold; credentials or writable shared resource without declared isolation or network egress. | Gate CLOSED, without scoring; the gaps form the remediation plan. |
JNSP | 2 | SPEC not found, or one of the six table rows missing (isolation, network egress, credentials, shared resources, irreversible actions, stop threshold). | Gate UNKNOWN: the question is put to the human. |
CI integrations — GitHub Actions
Two provided workflows lock down the SDD Mode invariants on pull requests:
| Workflow | Role |
|---|---|
.github/workflows/sdd-trace.yml | Invokes aiad-sdd trace --fail-on-gap on every PR — a blocking traceability gap fails the pipeline (algorithmic Drift Lock). |
.github/workflows/aiad-emit-rules-check.yml | Invokes aiad-sdd emit-rules --check — blocks any PR where the multi-runtime rule files diverge from the AGENT-GUIDE. |
Hooks
The npx aiad-sdd hooks command installs the Git pre-commit hook (and --uninstall removes it). The hooks provided in .aiad/hooks/ close the loop between the agent and the repository:
pre-commit.sh— blocks any diff containing an unresolvedTODO-JNSP:and applies the Drift Lock before commit. Thegit commit --no-verifybypass exists but is discouraged.session-start.js— executed when an agent session opens, to load the initial SDD context.discovery-gate.js— verifies the Discovery prerequisite (§3.5):/sdd specand/sdd execdo not start without a linked Research at aGO/CONDITIONAL GOverdict.
The CLI exposes other supporting tools — doctor (diagnosis + health score), footprint (measured token footprint per SPEC, since 1.19.0), guardrails (enforced / advisory guardrail matrix), commands (categorised command registry), dashboard (the HTML dashboard described in /aiad dashboard-html), gouvernance (Tier 1 agent updates), uninstall… The exhaustive reference is available via npx aiad-sdd help.