Remove a task
Removes a task from a minor version after validating no work is in progress and confirming dependencies.
/plugin marketplace add cowwoc/claude-code-dog/plugin install dog@claude-code-dog[major.minor/task-name]Remove a task from a minor version. Validates that no work is in progress before removal and confirms with the user.
</objective> <process> <step name="verify">Verify planning structure exists:
[ ! -d .claude/dog ] && echo "ERROR: No planning structure found." && exit 1
</step>
<step name="select_task">
Determine task to remove:
If $ARGUMENTS provided:
major.minor/task-name formatIf $ARGUMENTS empty:
List all tasks:
# Find all tasks with their status
find .claude/dog/major -name "STATE.md" -path "*/task/*/STATE.md" 2>/dev/null | while read f; do
TASK_PATH=$(dirname "$f")
TASK_NAME=$(basename "$TASK_PATH")
MAJOR=$(echo "$f" | sed 's|.*/major/\([0-9]*\)/.*|\1|')
MINOR=$(echo "$f" | sed 's|.*/minor/\([0-9]*\)/.*|\1|')
STATUS=$(grep "Status:" "$f" | sed 's/.*: //')
echo "$MAJOR.$MINOR/$TASK_NAME ($STATUS)"
done
Use AskUserQuestion:
If "Cancel" -> exit command.
</step> <step name="validate">Validate task can be removed:
TASK_PATH=".claude/dog/major/$MAJOR/minor/$MINOR/task/$TASK_NAME"
# Check task exists
[ ! -d "$TASK_PATH" ] && echo "ERROR: Task does not exist" && exit 1
# Check status
STATUS=$(grep "Status:" "$TASK_PATH/STATE.md" | sed 's/.*: //')
Block removal if in-progress:
If status is in-progress:
ERROR: Cannot remove task that is in-progress.
Current status: in-progress
Progress: {progress}%
Options:
1. Complete the task first with /dog:execute-task
2. Manually reset status to 'pending' in STATE.md if you want to discard work
Exit command.
Warn if completed:
If status is completed:
Use AskUserQuestion:
If "No, keep it" -> exit command.
</step> <step name="check_dependencies">Check if other tasks depend on this one:
# Find tasks that list this task as a dependency
grep -r "Dependencies:.*$TASK_NAME" .claude/dog/major/*/minor/*/task/*/STATE.md 2>/dev/null
If dependents found:
Use AskUserQuestion:
Final confirmation:
Use AskUserQuestion:
If "No, cancel" -> exit command.
</step> <step name="remove">Remove task directory:
rm -rf "$TASK_PATH"
</step>
<step name="update_parent">
Update parent minor STATE.md:
Recalculate progress without the removed task.
</step> <step name="commit">Commit removal:
git add -A ".claude/dog/major/$MAJOR/minor/$MINOR/"
git commit -m "$(cat <<'EOF'
docs: remove task {task-name} from {major}.{minor}
Task removed by user request.
EOF
)"
</step>
<step name="done">
Present completion:
Task removed:
- Task: {task-name}
- Version: {major}.{minor}
---
Use `/dog:status` to see current state.
---
</step>
</process>
<success_criteria>
</success_criteria>