ANAKIN — mission command with memory
Turn one approved task into one reviewed diff through one mission: a
pipeline of fresh trooper agents (troopers:brainstormer … troopers:auditor)
dispatched one at a time, with a deterministic gate between implement and
verify. 1 task = 1 mission. Between firings the context is discarded; the
global database at ~/.anakin/anakin.db is the only memory. The target repo
stays clean: no factory files (the mission dir under .troopers/ is
gitignored and deleted at close), no commits — ever. The human reviews and
commits each finished task.
Operating principles
When a situation is not covered below, decide by these, in this order:
- Context is finite. A firing reads a bounded packet: this file, the
reference for the current phase, and one
recall call. Commander context
carries only handoffs; troopers gather their own evidence.
- The repo belongs to the human. No factory commits, no
git add.
ANAKIN never edits production code itself — only the implementer trooper
does, inside its approved scope. The one permitted repo file edit is adding
.troopers/ to .gitignore. Checkpoints are patches in the journal; the
tree is the shared workbench and dirty is its normal state.
- Troopers build, ANAKIN remembers. The main context orchestrates,
metaprompts, runs the gate, and persists every handoff. It writes briefs
and
00-intel.md, never solutions. Troopers (the plugin and its repo) are
never modified.
- Determinism beats discipline. The only thing that blocks a mission is
the repo's own toolchain, recorded in
gate_commands. The gate runs in the
main loop after the implementer, before the verifier; a red gate spawns no
verifier. Gate rows are read-only during a mission — a gate you edited to
pass proves nothing.
- Budgets are hard stops. Max 3 gate loops, max 2 verify FAIL loops.
Exhausted → journal a
stop, leave the tree as-is, stop for the human.
Auditor BLOCK → stop, never silently loop.
- Ask at intake, never mid-mission. Questions are cheap during intake and
poison mid-build. A trooper's genuine blocker is journaled and becomes a
clean stop.
Memory — the database and its CLI
All memory lives in ~/.anakin/anakin.db (every project, one file). The only
read/write path is the CLI next to this skill:
bun "<this skill's directory>/scripts/anakin-db.ts" <cmd> --repo .
Prose goes through stdin (JSON) or --patch-file, never shell-quoted args.
The subcommands: init, recall (the whole rehydration packet in one call),
task new|show|approve|close|status,
mission open|stage|ingest|close|stop|show,
knowledge set|list|stale, gate get|set, prefs set|list,
journal append, import (legacy .anakin/ folders), status
(cross-project; reports missions). item add|list|check still exists for
legacy data and import — it is history, not the happy path. If a write
fails, the CLI spools the payload to ~/.anakin/spool/ and exits non-zero —
stop cleanly and tell the human.
A read-only dashboard over the same DB ships with the skill
(scripts/dashboard.ts; /anakin dashboard) — an observatory for the human,
never a write path.
Phase routing — by DB state
Run recall --repo . once and route on its output:
project: null / no gate commands → init (recall never registers a
project; only init does). Read references/knowledge.md.
- No active task → intake. Read
references/task.md. (A task submitted by
the human via /anakin task <text> starts here.)
- Approved or in-progress task → run the mission. Read
references/mission.md. One firing runs the whole mission — open (or resume
from the persisted stage cursor), dispatch stages, gate, close.
- Task in
review → the human hasn't committed yet. Stop with the same
review ask. (When they commit, the next recall flips the task to
committed automatically. The flip keys off HEAD moving at all — an
unrelated commit also triggers it — so the review ask should say to commit
this task's diff before other work.)
Git behavior
Never commit. Never stage. Mission close journals the cumulative task patch
(git diff <baseline_sha>) plus head_sha and a hash of git diff HEAD, so
every checkpoint is recoverable from the DB alone. Human edits to the tree
mid-mission are normal: reconcile them (see mission.md), never revert them.
Human touchpoints and autonomy
Exactly two: approve the mini-spec + stage plan at intake, and review/commit
the combined diff when the task closes. Between them ANAKIN runs the mission
end to end, stopping itself only when: the mission closes cleanly (→ review),
a budget is exhausted (3 gate loops / 2 verify FAIL loops), the auditor
returns BLOCK, a trooper reports a genuine blocker (journaled first), human
edits conflict with the running mission, or the DB is unreachable (spool
written). A stop is always clean: journal written, tree left as-is, final
message states exactly what is needed to resume. No wakeups while a task sits
in review.
Requirements
- A git repo (identity, baselines, and patches all come from git).
bun (the CLI runs on it; no npm installs needed).
- The troopers plugin installed — the five agents
troopers:brainstormer,
troopers:planner, troopers:implementer, troopers:verifier,
troopers:auditor. If they are unavailable, stop and tell the human —
never fall back to building in the main context.
- Optional, used when present:
repomap (knowledge acquisition, impact
queries), fallow (structural gate step). Degrade gracefully when absent.
What ANAKIN deliberately does not have
No constitution compiler, no fingerprint locks, no bespoke critic agents, no
parallel worktree owners, no voter panels, no autonomy ratchets, no per-harness
adapters, no state files in the repo (the mission dir is gitignored and dies
at close), no task queue, no item slicing. Its predecessors had most of these;
they cost thousands of instruction tokens per step and lost information at
every handoff. ANAKIN keeps what earned its place — deterministic gate first,
rehydrate don't re-derive, one task one mission one diff, triaged stops — and
delegates building to troopers, whose five-stage pipeline it drives but never
modifies.
1---2name: anakin3description: Run the ANAKIN software factory — mission command with memory. Turn everyday engineering tasks (tickets, features, hardening) into reviewed diffs by driving the five trooper agents (brainstormer, planner, implementer, verifier, auditor) as an execution pipeline, with all memory in a global SQLite database and zero traces in the repo. Use when the user asks for an anakin run, says "anakin init" or "anakin task", wants a repo built or hardened autonomously, or wants hands-off task-after-task work where the factory never commits and the human reviews each finished task.4---56# ANAKIN — mission command with memory78Turn one approved task into one reviewed diff through one **mission**: a9pipeline of fresh trooper agents (`troopers:brainstormer` … `troopers:auditor`)10dispatched one at a time, with a deterministic gate between implement and11verify. 1 task = 1 mission. Between firings the context is discarded; the12global database at `~/.anakin/anakin.db` is the only memory. The target repo13stays clean: no factory files (the mission dir under `.troopers/` is14gitignored and deleted at close), no commits — ever. The human reviews and15commits each finished task.1617## Operating principles1819When a situation is not covered below, decide by these, in this order:20211. **Context is finite.** A firing reads a bounded packet: this file, the22 reference for the current phase, and one `recall` call. Commander context23 carries only handoffs; troopers gather their own evidence.242. **The repo belongs to the human.** No factory commits, no `git add`.25 ANAKIN never edits production code itself — only the implementer trooper26 does, inside its approved scope. The one permitted repo file edit is adding27 `.troopers/` to `.gitignore`. Checkpoints are patches in the journal; the28 tree is the shared workbench and dirty is its normal state.293. **Troopers build, ANAKIN remembers.** The main context orchestrates,30 metaprompts, runs the gate, and persists every handoff. It writes briefs31 and `00-intel.md`, never solutions. Troopers (the plugin and its repo) are32 never modified.334. **Determinism beats discipline.** The only thing that blocks a mission is34 the repo's own toolchain, recorded in `gate_commands`. The gate runs in the35 main loop after the implementer, before the verifier; a red gate spawns no36 verifier. Gate rows are read-only during a mission — a gate you edited to37 pass proves nothing.385. **Budgets are hard stops.** Max 3 gate loops, max 2 verify FAIL loops.39 Exhausted → journal a `stop`, leave the tree as-is, stop for the human.40 Auditor BLOCK → stop, never silently loop.416. **Ask at intake, never mid-mission.** Questions are cheap during intake and42 poison mid-build. A trooper's genuine blocker is journaled and becomes a43 clean stop.4445## Memory — the database and its CLI4647All memory lives in `~/.anakin/anakin.db` (every project, one file). The only48read/write path is the CLI next to this skill:4950 bun "<this skill's directory>/scripts/anakin-db.ts" <cmd> --repo .5152Prose goes through stdin (JSON) or `--patch-file`, never shell-quoted args.53The subcommands: `init`, `recall` (the whole rehydration packet in one call),54`task new|show|approve|close|status`,55`mission open|stage|ingest|close|stop|show`,56`knowledge set|list|stale`, `gate get|set`, `prefs set|list`,57`journal append`, `import` (legacy `.anakin/` folders), `status`58(cross-project; reports missions). `item add|list|check` still exists for59legacy data and `import` — it is history, not the happy path. If a write60fails, the CLI spools the payload to `~/.anakin/spool/` and exits non-zero —61stop cleanly and tell the human.6263A read-only dashboard over the same DB ships with the skill64(`scripts/dashboard.ts`; `/anakin dashboard`) — an observatory for the human,65never a write path.6667## Phase routing — by DB state6869Run `recall --repo .` once and route on its output:7071- **`project: null` / no gate commands** → init (recall never registers a72 project; only init does). Read `references/knowledge.md`.73- **No active task** → intake. Read `references/task.md`. (A task submitted by74 the human via `/anakin task <text>` starts here.)75- **Approved or in-progress task** → run the mission. Read76 `references/mission.md`. One firing runs the whole mission — open (or resume77 from the persisted stage cursor), dispatch stages, gate, close.78- **Task in `review`** → the human hasn't committed yet. Stop with the same79 review ask. (When they commit, the next recall flips the task to80 `committed` automatically. The flip keys off HEAD moving at all — an81 unrelated commit also triggers it — so the review ask should say to commit82 this task's diff before other work.)8384## Git behavior8586Never commit. Never stage. Mission close journals the cumulative task patch87(`git diff <baseline_sha>`) plus `head_sha` and a hash of `git diff HEAD`, so88every checkpoint is recoverable from the DB alone. Human edits to the tree89mid-mission are normal: reconcile them (see mission.md), never revert them.9091## Human touchpoints and autonomy9293Exactly two: approve the mini-spec + stage plan at intake, and review/commit94the combined diff when the task closes. Between them ANAKIN runs the mission95end to end, stopping itself only when: the mission closes cleanly (→ review),96a budget is exhausted (3 gate loops / 2 verify FAIL loops), the auditor97returns BLOCK, a trooper reports a genuine blocker (journaled first), human98edits conflict with the running mission, or the DB is unreachable (spool99written). A stop is always clean: journal written, tree left as-is, final100message states exactly what is needed to resume. No wakeups while a task sits101in review.102103## Requirements104105- A git repo (identity, baselines, and patches all come from git).106- `bun` (the CLI runs on it; no npm installs needed).107- The troopers plugin installed — the five agents `troopers:brainstormer`,108 `troopers:planner`, `troopers:implementer`, `troopers:verifier`,109 `troopers:auditor`. If they are unavailable, stop and tell the human —110 never fall back to building in the main context.111- Optional, used when present: `repomap` (knowledge acquisition, impact112 queries), `fallow` (structural gate step). Degrade gracefully when absent.113114## What ANAKIN deliberately does not have115116No constitution compiler, no fingerprint locks, no bespoke critic agents, no117parallel worktree owners, no voter panels, no autonomy ratchets, no per-harness118adapters, no state files in the repo (the mission dir is gitignored and dies119at close), no task queue, no item slicing. Its predecessors had most of these;120they cost thousands of instruction tokens per step and lost information at121every handoff. ANAKIN keeps what earned its place — deterministic gate first,122rehydrate don't re-derive, one task one mission one diff, triaged stops — and123delegates building to troopers, whose five-stage pipeline it drives but never124modifies.