plugins/dev/skills/teardown/SKILL.md
Safely delete orchestrator runtime state — worktrees and ~/catalyst/runs/{orchId} — after archiving artifacts to ~/catalyst/archives/{orchId}. **ALWAYS use when** the user says 'teardown', 'delete orchestrator', 'cleanup orchestrator', or 'remove worktree' for a finished orchestrator. Refuses to delete unless the archive sweep succeeded; use --force to bypass.
npx skillsauth add coalesce-labs/catalyst teardownInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Safely delete orchestrator runtime artifacts (runs directory + worktrees) after archiving
them to ~/catalyst/archives/{orchId}/ and recording them in the SQLite index. The goal: once
an orchestrator is finished, its artifacts survive even when worktrees and runtime directories
are reaped.
orchestrate Phase 7 has run the archive sweep. The
sweep is automatic; teardown is explicit — the user invokes it when they no longer need
the live worktree and runs directory.claude /catalyst-dev:teardown <orchId> to clean up a finished orchestrator.An orchestrator is teardown-safe when ALL of these are true:
~/catalyst/runs/{orchId}/state.json exists and reports status in {done, complete, failed}.~/catalyst/archives/{orchId}/metadata.json exists and the
SQLite row for {orchId} is present in orchestrators.status: "in_progress" or an alive PID.Use --force to bypass the preconditions (you own the consequences).
Arguments
/catalyst-dev:teardown <orchId> [--force] [--dry-run]
<orchId> — required. Must match /^[A-Za-z0-9._-]+$/.--force — skip safety checks.--dry-run — print what would be deleted without deleting.Archive sweep (prerequisite)
Before deleting anything, run the sweep to make sure artifacts are persisted:
bun plugins/dev/scripts/orch-monitor/catalyst-archive.ts sweep "<orchId>"
If the sweep exits non-zero AND --force is not set, abort with a message that explains
what's missing. The sweep is idempotent, so re-running it is safe.
Enumerate deletion candidates
~/catalyst/runs/<orchId>/git worktree list --porcelain whose branch name
contains <orchId>.Print the candidates.
Safety gate
For each candidate, verify:
git -C <worktree> status --porcelain is clean (or --force).workers/*.json has status: "in_progress" or alive: true
(or --force).Stop background jobs (CTL-567)
A phase-agents run spawns one claude --bg job per phase; a completed bg job keeps
its process alive until the ~1h supervisor reaper. Before deleting the runtime
directory, claude stop every remaining job of the run:
plugins/dev/scripts/phase-agent-watch-bg reap \
--orch-dir ~/catalyst/runs/<orchId> --scope all
--scope all is correct here — the run is terminal, so the mid-run exemptions
(failed-pending-revive, turn-cap-exhausted) no longer apply. Prefer claude stop over
claude rm: phase agents for one ticket share a worktree, so claude rm could delete a
live sibling's worktree. With --dry-run, pass --dry-run through. A missing run
directory or phase-agent-watch-bg is non-fatal — skip and continue.
Delete
git worktree remove <path> for each worktree (add --force if step 4 flagged dirty
state AND user passed --force).rm -rf ~/catalyst/runs/<orchId>/ for the runs directory.Verify
Re-run the archive listing to confirm the orchestrator is still discoverable:
bun plugins/dev/scripts/orch-monitor/catalyst-archive.ts list --orch "<orchId>" --json
The SQLite row must still exist and archive_path must still point to a real directory.
On success, print a summary:
Teardown complete for <orchId>
archived to: ~/catalyst/archives/<orchId>/
bg jobs stopped: <N>
deleted:
runs: ~/catalyst/runs/<orchId>/
worktrees: <paths...>
On refusal (preconditions failed and no --force), print what's blocking and exit non-zero.
/catalyst-legacy:orchestrate Phase 7 — runs the sweep automatically when orchestration ends.bun plugins/dev/scripts/orch-monitor/catalyst-archive.ts — the archive CLI with
sweep|sync|prune|list|show subcommands.docs/architecture.md § "Artifact Persistence" for the end-to-end lifecycle.development
Migrate a single-harness repo to the dual-harness layout so both Claude Code and Codex load the same instructions and skills — AGENTS.md as the portable canonical doc, a thin CLAUDE.md `@AGENTS.md` bridge, and a `.agents/skills` dir with a `.claude/skills` symlink onto it. Use when asked to migrate to dual-harness, make this repo work in both Claude and Codex, or for agent metadata cleanup.
tools
Goal-driven senior-engineer pipeline-unstick sweep (CTL-1176 rung 3). Given the stuck/failed/needs-human set (or ONE ticket handed by the recovery router), its GOAL is to get the pipeline MOVING again — not to fix one ticket's review findings (that is phase-remediate). It runs AFTER the eyes (diagnostician evidence) and the hands (deterministic unstuck-sweep seams) have already tried, and it CONSUMES their output from a recovery-pass.json brief rather than re-diagnosing or redoing their narrow work. It acts like a senior engineer with full tool access — it resolves merge conflicts, rebases, force-pushes, merges green PRs, and re-dispatches stalled phases AUTONOMOUSLY — and escalates to the operator ONLY for a genuine value judgment / something that degrades other functionality / a real cost-benefit trade-off / a serious architecture change / an ADR conflict. On escalation it AUTHORS the operator inbox row + the push notification (executive-voiced). Dispatched as a `claude --bg` job by phase-agent-dispatch via slash command, AND invocable bare by the operator as a sweep — hence `user-invocable: true`. Ships behind CATALYST_RECOVERY_PASS (off by default — no live behavior change until shadow/enforce).
tools
Diagnose and fix Catalyst setup issues. Validates tools, database, config, OTel, direnv, and thoughts. Automatically fixes what it can — creates directories, initializes the database, sets WAL mode, runs migrations. Use for new installs, upgrades, or when something isn't working.
tools
--- name: phase-triage description: Phase agent that triages a Linear ticket — expands acronyms, classifies (feature/bug/docs/refactor/chore), identifies genuine blockers (a semantic second-pass over the backlog — NOT a prose scrape; CTL-838), estimates scope, writes triage.json, and posts a triage analysis comment to Linear. Triage completion is signaled by that comment plus the local triage.json — there is no `triaged` label. Emits phase.triage.complete.<TICKET> on success and phase.triage.fai