loki-spec-status
The loki-spec-status command runs deterministic drift detection to compare a Loki living specification against its locked version, reporting whether requirements have been added, removed, or changed and whether code has drifted since the lock was created. Use this command to verify specification compliance before deciding whether to update the spec or complete incomplete code changes.
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/asklokesh/loki-mode/HEAD/.claude/commands/loki-spec-status.md -o ~/.claude/commands/loki-spec-status.mdloki-spec-status.md
Check whether the spec is still true: the spec is the contract; Loki keeps it
true. This runs deterministic drift detection (no LLM cost) comparing the
current spec against its lock.
Steps:
1. If there is no lock yet, the status command will say so. In that case, offer
to create one:
```
loki spec lock $ARGUMENTS
```
The lock (`.loki/spec/spec.lock`) is a deterministic map of spec
requirements (checklist items and headings) to content hashes, plus repo
HEAD at lock time.
2. Run the drift check:
```
loki spec status $ARGUMENTS
```
Exit 0 means in sync (SPEC-TRUE); exit 1 means drift detected
(SPEC-DRIFTED). It writes `.loki/spec/drift-report.json`.
3. Read `.loki/spec/drift-report.json` and summarize for the user:
- The verdict: SPEC-TRUE or SPEC-DRIFTED.
- Counts of ADDED, REMOVED, and CHANGED requirements, then list each one.
- Whether code changed since the locked HEAD (files, insertions, deletions).
4. If drifted, explain the choice clearly:
- If the code is the source of truth and the spec should follow, the human
updates the spec, then runs `loki spec sync $ARGUMENTS` to re-lock.
- If the spec is correct and the code lags, the change set is incomplete.
This MVP never auto-rewrites the spec. Re-locking via `loki spec sync` is an
explicit human action after review. Do not run `sync` automatically; ask
first.
Report only what the drift report shows. Do not infer requirements that are not
in the spec.Interrogate a spec with Loki's Devil's-Advocate grill before building, and summarize the hardest questions it surfaces.
Run Loki's deterministic PR verification on the current change and summarize the evidence verdict.
Launch Loki Mode autonomous SDLC agent. Handles PRD-to-deployment with minimal human intervention. Invoke for multi-phase development tasks, bug fixing campaigns, or full product builds.
Pause for review every N tasks - selective autonomy pattern
Applies prompt repetition to improve accuracy for non-reasoning LLMs