---
name: finalize-ticket
description: Clean up after completing a ticket - derived tickets, doc updates, cross-links
---

# Finalize Ticket

Use this skill after completing a ticket's main work to ensure proper cleanup and follow-through.

## When to Use

Run `/finalize-ticket` after you've:
- Completed the main deliverables for a ticket
- Want to ensure nothing is missed before moving on

## Checklist

### 1. Update the Completed Ticket

- [ ] Mark all tasks as `[x]` complete
- [ ] Add a `## Resolution` section with:
  - Completion date
  - Key decisions made
  - Artifacts created (files, docs)
- [ ] Move to `.project/done/`

```markdown
## Resolution

**Completed:** YYYY-MM-DD

### Decisions Made
- Decision 1: rationale
- Decision 2: rationale

### Artifacts Created
- `path/to/file.md` - Description
- `path/to/other.rs` - Description
```

### 2. Identify Derived Tickets

Ask: "What new work did this ticket reveal?"

Common patterns:
| Completed ticket type | Often creates |
|-----------------------|---------------|
| Design/spec | Implementation ticket(s) |
| Research | Design ticket based on findings |
| Implementation | Testing, documentation tickets |
| Any | Refactoring ideas, future enhancements |

Create new tickets in `.project/backlog/` with proper numbering.

### 3. Update Related Documentation

Ask: "What docs should link to the new work?"

- Add cross-links between related docs (Related Documents sections)
- Update docs that reference the area you changed
- Ensure new docs are discoverable from existing ones

### 4. Update System Files

If the ticket changed a system's state:
- Update `.project/systems/<system>.md`
- Update the State emoji if appropriate (🔴→🟡→🟢)
- Add new key files to the list
- Update "What's Missing" and "What Works" sections

### 5. Update Dependent Tickets

Check if other tickets in backlog:
- Were blocked by this ticket (now unblocked)
- Reference outdated information
- Have tasks that are now complete

## Example Workflow

```
1. Finish ticket 001 (define interaction model)
   └─ Main deliverable: docs/agent/interaction.md

2. Update ticket 001
   └─ Mark tasks [x], add Resolution section, move to done/

3. Identify derived tickets
   └─ 006: Implement session management (from the design)
   └─ 007: CLI command structure (from the design)

4. Update related docs
   └─ reasoning-model.md → link to interaction.md
   └─ sub-problems/index.md → note about invariants

5. Update systems
   └─ agent-core.md → add interaction.md to key files
   └─ Create session-management.md system file

6. Update dependent tickets
   └─ 002 → mark "user interaction" task as done
```

## Tips

- Don't skip this step - loose ends accumulate
- Cross-links make docs discoverable; isolated docs get forgotten
- New tickets should be small and focused
- If you're unsure whether to create a ticket, create it - it can always be closed as "won't do"
