Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 36 additions & 4 deletions .claude/skills/issue-lifecycle/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,46 @@ swamp model output search issue-<N> --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-<N> --json
swamp data get issue-<N> 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-<N> state-main --json
```
2. If the phase is `implementing` and you have a PR URL, link it first:
```
swamp model method run issue-<N> link_pr --input url=<PR URL>
```
3. Call `complete` (accepts both `implementing` and `pr_open` as source phases):
```
swamp model method run issue-<N> complete
```

## Key Rules

Expand Down
19 changes: 19 additions & 0 deletions .claude/skills/issue-lifecycle/references/triage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-<N> 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,
Expand All @@ -25,6 +40,10 @@ commands in this skill also need `--repo-dir`.
swamp model method run issue-<N> 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/<N>` 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
Expand Down
Loading