From 137c1053b4f59c017412646d923bf00f9b396a5b Mon Sep 17 00:00:00 2001 From: stack72 Date: Thu, 9 Apr 2026 13:25:10 +0100 Subject: [PATCH] fix: improve issue-lifecycle skill resumption and close-out guidance (#42) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix wrong resume command (swamp model get → swamp data get), add start safety warning, add in-flight guard in triage.md, and add close-out workflow section. Co-Authored-By: Claude Opus 4.6 (1M context) --- .claude/skills/issue-lifecycle/SKILL.md | 40 +++++++++++++++++-- .../issue-lifecycle/references/triage.md | 19 +++++++++ 2 files changed, 55 insertions(+), 4 deletions(-) diff --git a/.claude/skills/issue-lifecycle/SKILL.md b/.claude/skills/issue-lifecycle/SKILL.md index 2a742504..2a2a3c92 100644 --- a/.claude/skills/issue-lifecycle/SKILL.md +++ b/.claude/skills/issue-lifecycle/SKILL.md @@ -108,14 +108,46 @@ swamp model output search issue- --json ## Resuming a Session -If the human comes back to an in-progress issue, check the current state: +If the human comes back to an in-progress issue, check the current phase: ``` -swamp model get issue- --json +swamp data get issue- state-main --json ``` -Then read the reference file for whatever phase the state shows and pick up from -there. +Read the `phase` field from the response. **Do NOT call `start` to resume** — +`start` unconditionally resets the phase to `triaging`, destroying progress. + +Use this table to determine what to do next: + +| Phase | Action | +| ---------------- | ------------------------------------------------------------------------- | +| `triaging` | Read [references/triage.md](references/triage.md) | +| `classified` | Read [references/planning.md](references/planning.md) | +| `plan_generated` | Read [references/adversarial-review.md](references/adversarial-review.md) | +| `approved` | Read [references/implementation.md](references/implementation.md) | +| `implementing` | Check PR status or call `complete` | +| `pr_open` | Check PR status or call `complete` | +| `done` | Nothing to do — lifecycle is complete | + +The canonical phase list lives in the `TRANSITIONS` constant in +`extensions/models/_lib/schemas.ts`. + +## Closing Out a Shipped Issue + +When a PR has already merged and the lifecycle just needs to be marked done: + +1. Check the current phase: + ``` + swamp data get issue- state-main --json + ``` +2. If the phase is `implementing` and you have a PR URL, link it first: + ``` + swamp model method run issue- link_pr --input url= + ``` +3. Call `complete` (accepts both `implementing` and `pr_open` as source phases): + ``` + swamp model method run issue- complete + ``` ## Key Rules diff --git a/.claude/skills/issue-lifecycle/references/triage.md b/.claude/skills/issue-lifecycle/references/triage.md index 2b5deaf2..98f05109 100644 --- a/.claude/skills/issue-lifecycle/references/triage.md +++ b/.claude/skills/issue-lifecycle/references/triage.md @@ -3,6 +3,21 @@ Steps 1–5 of the issue lifecycle. Read this when starting a new triage or resuming an issue in the `triaging` phase. +## Before You Start + +Check whether the model instance already exists and is past triage: + +``` +swamp data get issue- state-main --json +``` + +- If this **returns data** and the `phase` is anything other than `created` or + `triaging`, the issue is already in flight. **Do NOT call `start`** — go to + the "Resuming a Session" section in SKILL.md and use the phase-to-action table + to pick up where the issue left off. +- If the command **fails** (no data found), the model instance hasn't been + created yet — proceed with step 1 below. + ## 1. Create the Model Instance The swamp-club issue must already exist — create it in the swamp-club UI first, @@ -25,6 +40,10 @@ commands in this skill also need `--repo-dir`. swamp model method run issue- start ``` +> **Warning:** `start` unconditionally resets the phase to `triaging`. Only call +> it once when beginning a new lifecycle. Never use it to resume an in-progress +> issue — it will destroy all progress (classification, plan, approvals). + This fetches the issue from swamp-club via `GET /api/v1/lab/issues/` and writes the title, body, type, status, and comments to the `context` resource. If the issue doesn't exist in swamp-club, `start` fails loudly — create the issue