Prompt file imported from achung123/aia-core (
.github/prompts/logan.close.prompt.md). Copyright stays with the author.
Goal
Close a beads task, record the completion reason, and identify any tasks that become ready as a result — so the next piece of work is immediately visible.
Context
Closing a task in beads updates the dependency graph. Tasks that were blocked solely by the now-closed task become ready. Logan closes the task via bd close <id> --reason "..." and then checks bd ready --json to surface newly unblocked work. Including the beads ID in commit messages ((bd-xxx)) enables bd doctor to detect orphaned issues.
Instructions
- Resolve the ID. If the user provides a Jean ID (e.g.,
T-003), search beads for the matching issue. Otherwise use the beads ID directly. - Verify the task exists and is open. Run
bd show <id> --json. If already closed, report it and stop. - Capture the "before" ready list. Run
bd ready --jsonto know what was ready before closing. - Close the task. Run
bd close <id> --reason "<reason>" --json. Use the user's stated reason, or default to "Completed" if none provided. - Capture the "after" ready list. Run
bd ready --jsonagain. - Diff the lists. Identify newly ready tasks (present in "after" but not "before").
- Output the closure confirmation and any newly unblocked tasks.
Output Format
## Closed: bd-x7k2 — <Title>
**Reason:** <reason>
### Newly Ready
| Beads ID | Title | Priority |
|----------|-------|----------|
| bd-m3p9 | ... | P1 |
**Suggested next:** Claim `bd-m3p9` — <rationale>
If no new tasks became ready:
## Closed: bd-x7k2 — <Title>
**Reason:** Completed
No new tasks unblocked. Run `@logan ready` to see the current queue.
Example
Input:
@logan close bd-x7k2
Expected output:
## Closed: bd-x7k2 — Initialize project structure
**Reason:** Completed
### Newly Ready
| Beads ID | Title | Priority |
|----------|------------------------|----------|
| bd-m3p9 | Define database models | P1 |
**Suggested next:** Claim `bd-m3p9` — it's the next task in the dependency chain and unblocks 3 downstream tasks.
Anti-patterns
- Do NOT close a task that is still blocked. If it has open dependencies, something is wrong — investigate first.
- Do NOT skip the ready-diff. Surfacing newly unblocked tasks is the primary value of closing through Logan.
- Do NOT close without a reason. Always provide one, even if it's just "Completed".
- Do NOT forget to remind about commit messages. When closing after code work, the commit should include
(bd-xxx).