---
name: plan-inventory
description: Use when the user asks what plans exist and their states — "which plans are ready to run", "which are abandoned", "what's running right now", "list our plans", "which plan should I test on" — or when another skill needs a plan slug the user didn't supply. Classifies docs/plans/* + runstate journals into running / ready / stalled / done / abandoned with a suggested action each.
---

# Plan-Inventory — Classify Every Plan's State

Audience: AI coding agents first.

Rule: **classification comes from artifacts (journal, git, task runner), never from plan-doc prose. Program the scan (exec), don't read plan files into context.**

## Steps

1. **Collect**: `docs/plans/*.jsonl` + companion `.md` in target repo(s); engine journals `runstate/<slug>.jsonl`; `TaskList` for live background runs.
2. **Classify each slug** (first match wins):
   - **running** — background task alive for slug, or journal mtime < 24h with run not terminal
   - **stalled/HALT** — journal exists, last record is HALT or non-terminal + mtime > 24h
   - **done** — journal terminal-complete, or all waves committed (verify vs `git log`)
   - **abandoned** — `meta.base_branch` deleted/merged-and-diverged, or plan superseded by a newer slug touching same modules, or journal untouched > 14d mid-run
   - **ready** — JSONL valid, base-branch gate passes (`workflows/lib/handoff-base-gate.sh`), no journal
3. **Report table**: slug | state | evidence (one clause) | suggested action (`runplan <slug>` (add `--retry-blocked` for blocked tasks) / `plan-preflight` first / archive / delete journal orphan).
4. Route follow-up: resume a stalled run → `babysit-runplan`; launch a ready one → `plan-preflight` then `run-plan`.

## Boundaries

- DO NOT delete/archive anything — inventory is read-only; suggest, user decides.
- Ambiguous done-vs-abandoned → mark SUSPECT with the conflicting evidence, never guess a terminal state.
