45 lines
2.9 KiB
Markdown
45 lines
2.9 KiB
Markdown
|
|
---
|
||
|
|
description: Capture work discovered mid-session as a Backlog card on the current repo's Planka board — resolves the board deterministically from the repo path, creates a missing board transparently via board-ensure, and always lands the card at Backlog. Use unprompted WHEN a concrete follow-up task, bug, or piece of deferred work surfaces mid-session that will not be done in this session. Invoked by `/os-backlog:capture`.
|
||
|
|
---
|
||
|
|
|
||
|
|
Capture a piece of work as a card on the right Planka board, cheaply, without interrupting the current task.
|
||
|
|
|
||
|
|
## Column-ownership rules (non-negotiable)
|
||
|
|
|
||
|
|
- **The AI creates cards at Backlog only.** Never create a card in any other list.
|
||
|
|
- **Never pull cards into or out of Next** — Next is human-curated.
|
||
|
|
- **The AI moves cards Doing → Review at most.** Never move a card past Review; never move Review → Done. Done is a human sign-off.
|
||
|
|
- **Never self-assign or start work on a card labeled `hitl`** — those require the human in the loop.
|
||
|
|
- Priority/autonomy labeling is not capture's job — leave new cards unlabeled; the card-triage agent batches that later.
|
||
|
|
|
||
|
|
## Procedure
|
||
|
|
|
||
|
|
All commands use the plugin CLI at `${CLAUDE_PLUGIN_ROOT}/bin/os-backlog`.
|
||
|
|
|
||
|
|
1. **Resolve the board** for the current repo. Gather the inputs and run the pure resolver (no network):
|
||
|
|
```bash
|
||
|
|
# config: contents of .cc-os/config if present, else null
|
||
|
|
# boards: names from Planka — every project's boards, including archived--* ones
|
||
|
|
echo '{"repo_path": "<repo root>", "config": <config-or-null>, "boards": [...]}' \
|
||
|
|
| ${CLAUDE_PLUGIN_ROOT}/bin/os-backlog resolve
|
||
|
|
```
|
||
|
|
To build the `boards` inventory, list boards via `snapshot`/the Planka client; if Planka is unreachable, stop here and report the error — do not guess.
|
||
|
|
2. **Act on the decision:**
|
||
|
|
- `use <board>` → proceed to step 3.
|
||
|
|
- `activate <archived board>` → run `os-backlog activate <name>` (activation is automatic — an archived board matching this repo is simply renamed back), then proceed.
|
||
|
|
- `stop-and-discuss` → do NOT create anything. Tell the user the repo doesn't map to a board and ask where the card should go.
|
||
|
|
3. **Ensure the board exists** (idempotent — safe to run every time):
|
||
|
|
```bash
|
||
|
|
${CLAUDE_PLUGIN_ROOT}/bin/os-backlog board-ensure <board> --project <Dev|Clients>
|
||
|
|
```
|
||
|
|
Project is `Dev` for repos under `~/dev/`, `Clients` for repos under `~/clients/`.
|
||
|
|
4. **Create the card at Backlog:**
|
||
|
|
```bash
|
||
|
|
${CLAUDE_PLUGIN_ROOT}/bin/os-backlog card-add --board <board> --title "<short imperative title>" [--description "<context: repo, file paths, why>"]
|
||
|
|
```
|
||
|
|
5. Confirm to the user in one line: board, title. Then return to the interrupted task.
|
||
|
|
|
||
|
|
## Failure behavior
|
||
|
|
|
||
|
|
Fail soft. If the planka-api gem or the Planka instance is unavailable, the CLI prints one clear error and exits nonzero — report that error to the user verbatim and offer to note the task elsewhere. Never retry destructively, never leave partial state unmentioned.
|