Remove Task Skill
You are helping the user remove a task from an existing tracker. Removing a task will delete the task and optionally its plan file.
Your Task
Remove a single task from the tracker and update statistics accordingly.
Hierarchy Reminder
The tracker follows this structure:
- •Phase (sequential stages) → contains multiple Tracks
- •Track (feature groupings) → spans across Phases, contains Tasks
- •Task (individual work items) → belongs to a Phase and Track
Process Flow
Step 1: Parse Arguments and Find Tracker
- •
Parse
$ARGUMENTSfor:- •Tracker name (first argument)
- •Optional flags:
- •
--task=NN- Task number to remove - •
--confirm- Skip confirmation prompt - •
--keep-plan- Keep the plan file (don't delete it)
- •
- •
If tracker name not provided:
- •List available trackers:
bash
ls -1 .trackers/
- •If no trackers exist:
- •Inform user: "No trackers found. Create one with /create-tracker"
- •Exit
- •If trackers exist:
- •Show list and ask user to select
- •List available trackers:
- •
Verify tracker exists:
- •Check if
.trackers/{TRACKER_NAME}/TRACKER.mdexists - •If not found, inform user and exit
- •Check if
- •
Read the tracker file:
- •Use Read tool on
.trackers/{TRACKER_NAME}/TRACKER.md - •Parse all tasks to build task index
- •Use Read tool on
Step 2: Identify Task to Remove
- •
Get task number (if not from --task):
codeCurrent tasks: Phase 1: Foundation Track: authentication 01: Setup authentication framework [Pending] - Priority: High 02: Configure OAuth providers [In Progress] - Priority: Medium Track: dashboard 03: Create dashboard layout [Complete] - Priority: Medium Phase 2: Implementation Track: authentication 04: Implement login API [Blocked] - Priority: High, Blocked by: 01 Which task would you like to remove? Enter task number: - •
Validate task exists:
- •Search for
##### Task {TASK_NUMBER}:in Tasks section - •If not found:
- •Inform user: "Task {TASK_NUMBER} not found"
- •List available tasks
- •Exit
- •Search for
- •
Parse task details:
- •Extract task information:
- •Task number
- •Task title
- •Phase number and name
- •Track name
- •Status
- •Priority
- •Plan file (if exists)
- •Store for confirmation message
- •Extract task information:
Step 3: Check for Dependencies
- •
Search for tasks that depend on this task:
- •Parse all tasks looking for
**Blocked By**:fields - •Check if any task lists this task number
- •Store list of dependent tasks
- •Parse all tasks looking for
- •
If dependent tasks found, prepare warning message:
code⚠️ Other tasks depend on this task: {FOR_EACH_DEPENDENT} - Task {TASK_NUMBER}: {TITLE} (Blocked by: ..., {THIS_TASK}, ...) {END_FOR} These tasks will have invalid dependencies after removal.
Step 4: Confirm Deletion
Unless --confirm flag is provided, display warning and ask for confirmation:
⚠️ Remove Task {TASK_NUMBER}?
**Task**: {TASK_NUMBER}: {TITLE}
**Phase**: Phase {N}: {PHASE_NAME}
**Track**: {TRACK_NAME}
**Status**: {STATUS}
**Priority**: {PRIORITY}
{IF_PLAN_FILE}**Plan File**: {PLAN_FILENAME}{END_IF}
{IF_DEPENDENT_TASKS}
⚠️ WARNING: {DEPENDENT_COUNT} task(s) depend on this task:
{FOR_EACH_DEPENDENT}
- Task {TASK_NUMBER}: {TITLE}
{END_FOR}
These tasks will have invalid dependencies after removal.
{END_IF}
{IF_PLAN_FILE}
{IF_NOT_KEEP_PLAN}
The plan file will also be deleted: {PLAN_FILENAME}
{ELSE}
The plan file will be kept: {PLAN_FILENAME}
{END_IF}
{END_IF}
This action cannot be undone.
Are you sure you want to remove this task? (yes/no)
- •If user responds "no" or cancels, exit without changes
- •If user responds "yes", proceed with deletion
Step 5: Remove Task from Tasks Section
- •
Find the task:
- •Locate phase section:
### Phase {N}: - •Locate track subsection:
#### Track: {TRACK_NAME} - •Find task:
##### Task {TASK_NUMBER}: {TITLE}
- •Locate phase section:
- •
Delete task entry:
- •Remove entire task section including:
- •Task header (
##### Task {TASK_NUMBER}: ...) - •All task metadata (Status, Plan File, Priority, etc.)
- •Description
- •Acceptance criteria
- •All content until next task or track separator (
---)
- •Task header (
- •Use Edit tool to remove
- •Remove entire task section including:
- •
Handle empty track subsection:
- •If this was the only task in the track subsection:
- •Replace with:
_No tasks yet. Use /add-task to add tasks to this track._
- •Replace with:
- •Otherwise, leave track subsection intact
- •If this was the only task in the track subsection:
Step 6: Update Track Progress
- •
Find the track in Tracks section:
- •Locate:
### Track: {TRACK_NAME}
- •Locate:
- •
Recalculate progress:
- •Count remaining tasks in this track across all phases
- •Count completed tasks in this track
- •Calculate new percentage
- •
Update track progress:
- •Update:
**Progress**: {COMPLETED}/{TOTAL} tasks complete ({PERCENTAGE}%) - •Use Edit tool
- •Update:
Step 7: Delete Plan File (if exists and not --keep-plan)
- •
If task has plan file and
--keep-plannot specified:- •Delete plan file:
bash
rm .trackers/{TRACKER_NAME}/plans/{PLAN_FILENAME} - •Confirm deletion
- •Delete plan file:
- •
If --keep-plan specified:
- •Keep the plan file
- •Inform user that plan file was preserved
Step 8: Update Overview and Metadata
- •
Update task count:
- •Find:
- **Total Tasks**: {OLD_COUNT} - •Replace with:
- **Total Tasks**: {NEW_COUNT}
- •Find:
- •
Update completion statistics:
- •Recalculate overall completion:
- •Count all remaining tasks
- •Count completed tasks
- •Calculate percentage
- •Update:
- **Completed**: {COMPLETED}/{TOTAL} tasks ({PERCENTAGE}%)
- •Recalculate overall completion:
- •
Update metadata:
- •Update
updated:field in frontmatter to current date - •Get current date:
bash
date +%Y-%m-%d
- •Update
Step 9: Confirm Removal
Task removed successfully!
**Removed**: Task {TASK_NUMBER}: {TITLE}
**From**: Phase {N}: {PHASE_NAME} / Track: {TRACK_NAME}
**Was**: {STATUS}, Priority: {PRIORITY}
{IF_PLAN_DELETED}**Plan file deleted**: {PLAN_FILENAME}{END_IF}
{IF_PLAN_KEPT}**Plan file kept**: {PLAN_FILENAME}{END_IF}
{IF_DEPENDENT_TASKS}
⚠️ WARNING: Update dependencies manually
The following tasks have invalid dependencies:
{FOR_EACH_DEPENDENT}
- Task {TASK_NUMBER}: {TITLE}
Fix with: /edit-task {TRACKER_NAME} --task={TASK_NUMBER}
{END_FOR}
{END_IF}
**Tracker updated**:
- Total tasks: {OLD_TASK_COUNT} → {NEW_TASK_COUNT}
- Completion: {OLD_PERCENTAGE}% → {NEW_PERCENTAGE}%
**Track updated**:
- {TRACK_NAME}: {OLD_TRACK_PROGRESS} → {NEW_TRACK_PROGRESS}
**Next steps**:
{IF_DEPENDENT_TASKS}
- Fix task dependencies with /edit-task
{END_IF}
- Review tracker: /review-tracker {TRACKER_NAME}
- Add another task: /add-task {TRACKER_NAME}
View tracker: .trackers/{TRACKER_NAME}/TRACKER.md
Important Notes
- •Single task operation: Only removes one task at a time
- •No renumbering: Task numbers are not renumbered after deletion
- •Plan files: By default, associated plan files are deleted (use --keep-plan to preserve)
- •Dependencies: Task dependencies are NOT automatically updated
- •Track progress: Track progress statistics are recalculated
- •Confirmation required: User must confirm unless --confirm flag is used
- •No undo: This operation cannot be reversed
- •Gap in numbering: Removing a task creates a gap in task numbering (this is intentional)
Examples
Example 1: Remove Single Task
/remove-task my-app --task=05 > Warning: Will delete Task 05: Implement login API > Confirm: yes > Task removed > Plan file deleted: 05-implement-login-api.md
Example 2: Interactive Selection
/remove-task my-app > Shows all tasks with numbers > Enter task: 03 > Warning: Will delete Task 03 > Confirm: yes
Example 3: Keep Plan File
/remove-task my-app --task=07 --keep-plan > Task removed but plan file kept
Example 4: Skip Confirmation
/remove-task my-app --task=02 --confirm > Task removed immediately without confirmation
Example 5: Task with Dependencies
/remove-task my-app --task=01 > Warning: Task 04 and Task 06 depend on this task > Confirm: yes > Task removed > Warning: Update dependencies manually for Task 04, 06
Error Handling
- •If tracker doesn't exist, inform user and exit
- •If task doesn't exist, show available tasks
- •If user cancels confirmation, exit without changes
- •Validate all inputs before modifying
- •Ensure tracker structure remains valid after removal
- •Handle cases where plan file doesn't exist or deletion fails
Post-Removal Validation
After removing the task:
- •Verify track progress is correct
- •Ensure task count matches actual tasks
- •Validate completion percentage is accurate
- •Check that track/phase structure is intact
- •Manual check required: Verify dependent tasks are updated
Dependency Management
Important: When a task is removed, you must manually update dependent tasks:
- •List all dependent tasks in the confirmation output
- •For each dependent task:
- •Use
/edit-task {TRACKER} --task={NUMBER}to update - •Remove the deleted task from "Blocked By" field
- •Or replace with a different dependency
- •Use
Example dependency fix:
Task 04 was blocked by: 01, 02, 03 Task 02 was removed New blocking: 01, 03 (manually updated)
Why Task Numbers Are Not Renumbered
Task numbers are preserved (creating gaps) because:
- •Tasks may be referenced in external documentation
- •Git commits may reference task numbers
- •Plan files use task numbers in filenames
- •Renumbering would break these references
If you need sequential numbers, create a new tracker and migrate tasks.
Integration with Other Skills
- •Use
/edit-taskto update dependent tasks - •Use
/review-trackerto see updated structure - •Use
/add-taskto add replacement tasks - •Use
/mark-statusto mark tasks as cancelled instead of deleting