| name | complete-task |
|---|---|
| model | fast |
| description | Mark a task as done and generate completion artifacts (changelog, handoff, roadmap update) |
| usage | /complete-task <task> |
Mark a task as complete and generate structured completion artifacts.
/complete-task <task>
Arguments:
task— Task description, TODO item text, or ticket ID that was completed (e.g.,"add rate limiting to API",PROJ-142)
/complete-task "add rate limiting to the /api/auth endpoints"
/complete-task PROJ-142
/complete-task fix-memory-leak-in-worker
/complete-task "refactor database connection pooling"
/complete-task "migrate auth service to OAuth 2.1"
- Reads
TODO.md,CHANGELOG.md,docs/planning/roadmap.md, andtask_plan.mdto understand current project state - Locates the matching TODO item in
TODO.mdby searching for the task description or ticket ID - Marks the TODO item as complete by replacing
- [ ]with- [x]and appending the completion date - Classifies the work into a changelog category (Added, Changed, Fixed, Removed, Security, Deprecated)
- Generates a changelog entry and prepends it to
CHANGELOG.mdunder the current version heading - Collects files changed, decisions made, and relevant git commits for the completion summary
- Updates
docs/planning/roadmap.mdto reflect the completed status of the task - Evaluates whether the completion triggers a handoff condition (milestone reached, end of day, context switch)
- Creates
handoff.mdif a handoff trigger condition is met, capturing full context for the next contributor - Removes
task_plan.mdif present, since the task is now complete - Outputs a completion summary to the terminal so the user can verify the artifacts
Use TodoWrite to track progress through each phase.
Read the following files to understand current project state. Skip any that do not exist.
| File | Purpose |
|---|---|
TODO.md |
Find and mark the completed task |
CHANGELOG.md |
Prepend the new changelog entry |
docs/planning/roadmap.md |
Update task status to complete |
task_plan.md |
Retrieve intent, scope, and acceptance criteria |
.git (via git log) |
Collect relevant commits for the completion record |
If TODO.md does not exist, warn the user and skip the status update step.
Search TODO.md for the matching task using these patterns in order:
| Search Strategy | Pattern | Example Match |
|---|---|---|
| Exact text match | Task description substring | - [ ] Add rate limiting to API |
| Ticket ID match | PROJ-\d+ or similar ID |
- [ ] PROJ-142: Add rate limiting |
| Fuzzy keyword match | Overlapping keywords | - [ ] Implement rate limiter for auth |
Apply the status update using regex replacement:
Before: - [ ] Add rate limiting to API
After: - [x] Add rate limiting to API ✓ (2026-02-06)
Pattern: Replace - \[ \] with - \[x\] on the matched line and append ✓ (YYYY-MM-DD).
If multiple matches are found, present them and ask the user to confirm which item to mark complete.
Determine the changelog category by analyzing the work performed:
| Category | Signals | Examples |
|---|---|---|
| Added | New feature, new endpoint, new component, new file | "Added rate limiting middleware" |
| Changed | Refactor, update, improve, enhance, modify behavior | "Changed connection pooling to support multi-tenant" |
| Fixed | Bug fix, error correction, patch, resolve issue | "Fixed memory leak in background worker" |
| Removed | Delete, remove, drop, deprecate and remove | "Removed legacy v1 API endpoints" |
| Security | Auth fix, vulnerability patch, dependency CVE, hardening | "Security: Patched XSS vulnerability in user input" |
| Deprecated | Mark for future removal, sunset notice, migration warning | "Deprecated syncUserData in favor of async pipeline" |
If the category cannot be determined from the task description or task_plan.md, ask the user:
"What type of change was this? (Added / Changed / Fixed / Removed / Security / Deprecated)"
Generate the entry and prepend it to CHANGELOG.md under the current ## [Unreleased] heading. If no [Unreleased] section exists, create one.
## [Unreleased]
### Added
- Rate limiting middleware for `/api/auth` endpoints with configurable thresholds ([commit](link))Gather the following information for the completion summary:
- Files changed — Run
git diff --name-onlyagainst the branch or recent commits related to this task. - Decisions made — Extract from
task_plan.mdsections: "Risks and Open Questions", "Scope", and any ADRs created. - Relevant commits — Run
git log --oneline -20 --grep="<task keyword>"to find associated commits. - Acceptance criteria status — If
task_plan.mdhas criteria, check each one and note whether it was met.
If docs/planning/roadmap.md exists:
- Find the task entry in the roadmap (Current Sprint, In Progress, or Backlog section).
- Move it to the Completed section with the completion date.
- Update the status marker: replace
[ ]or[~]with[x]. - Add the completion date:
(completed YYYY-MM-DD).
If the roadmap file does not exist, skip this step and note it in the output.
Check whether the completion triggers a handoff. A handoff is warranted when any of the following conditions are met:
| Trigger | Condition | Detection |
|---|---|---|
| Milestone reached | All tasks in a milestone group are now complete | All items under a ## Milestone heading in roadmap are [x] |
| End of day | User indicates EOD or session is wrapping up | User says "EOD", "wrapping up", "done for today" |
| Context switch | User is moving to a different project or area | User says "switching to", "moving on", "handing off" |
| Complex completion | Task was large or epic complexity |
task_plan.md complexity field is large or epic |
If a handoff trigger is detected, proceed to Phase 7. Otherwise, skip to Phase 8.
Write handoff.md to the project root with the following template:
# Handoff Notes
**Date:** YYYY-MM-DD
**Completed Task:** [task description]
**Author:** [from git config user.name]
## What Was Done
[2-4 sentence summary of the work completed]
## Key Decisions
- [Decision 1 and rationale]
- [Decision 2 and rationale]
## Files Changed
- `path/to/file.ts` — [what changed and why]
- `path/to/another.ts` — [what changed and why]
## Relevant Commits
- `abc1234` — [commit message]
- `def5678` — [commit message]
## Open Items
- [Anything left unfinished or deferred]
- [Follow-up tasks that were identified]
## Context for Next Contributor
[Anything the next person needs to know to pick up where you left off]- If
task_plan.mdexists, delete it or prompt the user: "Task is complete. Removetask_plan.md?" - Output the completion summary to the terminal.
The command updates existing files and optionally creates new ones:
- Updated:
TODO.md(task marked complete) - Updated:
CHANGELOG.md(new entry prepended) - Updated:
docs/planning/roadmap.md(status changed to complete) - Created:
handoff.md(only if a handoff trigger was met) - Deleted:
task_plan.md(if it existed and user confirms)
The terminal output follows this structure:
Task Completed
==============
Task: [description]
Category: [Added | Changed | Fixed | Removed | Security | Deprecated]
Date: YYYY-MM-DD
Changes:
TODO.md marked complete (line 14)
CHANGELOG.md entry added under [Unreleased] → Added
roadmap.md moved to Completed section
handoff.md created (milestone reached)
task_plan.md removed
Commits: 3 related commits found
Files: 7 files changed across 4 directories
Next steps:
1. Review CHANGELOG.md entry for accuracy
2. Review handoff.md if created
3. Run /start-task for the next item or /update-roadmap to plan ahead
- Never mark a TODO complete without confirming the match. If multiple items match, ask the user to disambiguate.
- Never skip the changelog entry. Every completed task gets a changelog record, even trivial ones.
- Never fabricate commits or file changes. Only reference real git history and actual files in the project.
- Never delete
task_plan.mdwithout user confirmation. The user may want to keep it for reference. - Never auto-detect the changelog category when the work is ambiguous. Ask the user rather than guessing wrong.
- Never create a handoff without a trigger condition. Handoffs add overhead; only generate them when warranted.
- Never modify
CHANGELOG.mdstructure. Prepend entries under the existing format; do not reorganize existing entries.
- If
TODO.mddoes not exist, skip the status update and note: "No TODO.md found. Changelog entry created without TODO update." - If
CHANGELOG.mddoes not exist, create it with an[Unreleased]section and the new entry. - If no matching TODO item is found, list the 5 most recent incomplete items and ask the user to select one or provide a more specific description.
- If
docs/planning/roadmap.mddoes not exist, skip the roadmap update and note: "No roadmap found. Task completion recorded in TODO.md and CHANGELOG.md only." - If
git logreturns no matching commits, note: "No related commits found. Add commit references manually if needed." - If
task_plan.mddoes not exist, proceed without it and note: "No task plan found. Completion artifacts generated from task description only."
- Optional automation: Run
python3 scripts/sync_status.pyto sync TODO/roadmap/task_plan status markers automatically. - Optional automation: Run
python3 scripts/sync_todos_from_git.pyto update TODO status from git commit messages. - Optional automation: Run
python3 scripts/todo_to_changelog.pyto auto-generate changelog entries from completed TODOs.
- Command:
/start-task(for establishing task context before implementation) - Command:
/update-roadmap(for managing roadmap entries independently) - Command:
/review-code(for reviewing the implementation before marking complete) - Agent:
ai/agents/development/