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.testing
Phase-agent that fixes a failing verify verdict so the pipeline self-heals instead of stalling to needs-human (CTL-653). Reads `${ORCH_DIR}/workers/<ticket>/verify.json`, fixes the `findings[]` (every severity:"high" plus the regression_risk drivers) directly via Edit/Write, commits the remediation, and emits `phase.remediate.complete.<ticket>`. The scheduler's router then re-dispatches `verify` to re-check (the verify⇄remediate cycle, cap 3). Dispatched as a `claude --bg` job by `phase-agent-dispatch`, which invokes it via slash command — hence `user-invocable: true`.
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
tools
Phase agent for the research step of the 9-phase orchestrator pipeline (CTL-450). Wraps /catalyst-dev:research-codebase and produces thoughts/shared/research/<date>-<ticket>.md, then emits phase.research.complete.<ticket>. Reads triage.json from the worker dir as its prior-phase artifact. Spawned via plugins/dev/scripts/phase-agent-dispatch, which invokes it via slash command — hence `user-invocable: true`.
development
Phase-agent wrapper that opens the pull request after implementation completes (CTL-449 Initiative 1 Phase 3). Delegates to `/catalyst-dev:create-pr` (which already auto-runs `describe-pr` and transitions Linear to `inReview`), then writes the PR number + URL into the phase signal file so the downstream `phase-monitor-merge` agent can read it without re-querying GitHub. Dispatched as a `claude --bg` job by `phase-agent-dispatch`, which invokes it via slash command — hence `user-invocable: true`.