On this page

/architect:cleanup — wrap up after an AAS run

After /architect:<variant>:loop finishes (or you stop one), invoke this skill to wrap up. Two actions, both dry-run-first / human-approved before any destructive change:

  1. Archive outputs/design_runs/ so the live tree stays small and the next run starts on a clean slate.
  2. Scrub auto-memory writes via /memory:hygiene so this run's graph-specific findings don't pollute the next session's proposer context.

Why

Each AAS cycle leaves two kinds of debris:

This skill is the load-bearing step that prevents an iter's pollution from contaminating the next.

Usage

/architect:cleanup

No arguments. The skill always runs interactively (dry-run → user approves → live).

Steps

Step 1 — Archive outputs/design_runs/ (dry-run)

python3 .claude/commands/architect/data/archive_outputs.py --dry-run --prune

Prints the full three-phase plan: - Phase 1 — which finished v{N}/ dirs would be renamed under their _archive/ sibling (a v{N}/ is skipped only if its .staging/ is non-empty, i.e. an iter is in flight). - Phase 2 — which outputs/ subdirs would be rsynced to the sibling archive root (default <repo>/../_outputs_archive/). - Phase 3 (--prune) — which in-repo _archive/ dirs (and the outputs/archive/ mirror) would be verified against their external copy and then rm'd so the working tree actually shrinks.

No files are touched.

Show the plan to the user, then ask:

Apply this archive plan? Or skip archiving this round?

Wait for reply. If the user wants to filter (e.g. "only archive method X"), pass --methods <name> to the live invocation in Step 2.

Step 2 — Archive outputs/design_runs/ (live)

If the user confirmed:

python3 .claude/commands/architect/data/archive_outputs.py --prune [--methods <names>] [--reason <tag>]

(Drop --dry-run.) Executes the same plan for real. Phase 3 only rm's an in-repo _archive/ dir after a checksum dry-run rsync confirms its external copy is byte-complete — an unverified dir is kept and reported on stderr. Print the helper's stdout — the final stat lines name how many version dirs were moved and how many archived dirs were pruned.

If the user skipped archive: print Skipped archive. and proceed. The cycle's output stays in outputs/design_runs/ until next time.

Step 3 — Scrub auto-memory writes

Invoke /memory:hygiene. That skill runs its own propose-and-confirm flow:

Run this step even if the user skipped Step 2. Archive and memory hygiene are independent — memory pollution will recur regardless of where the run output lives.

Step 4 — Print final status

After Step 3 returns, print a one-line summary:

Cleanup done: archived <N> version dirs, pruned <P> in-repo _archive dirs, <M> memory entries reviewed (<K> deleted, <J> relocated).

Pull the archive + prune counts from Step 2's output ([phase1] … moved and [phase3] … pruned lines) and the memory counts from /memory:hygiene's execution log. If a step was skipped, say so explicitly.

Notes

See also