Remove a minor version
Removes a minor version after validating no incomplete tasks exist and confirming with the user.
/plugin marketplace add cowwoc/claude-code-dog/plugin install dog@claude-code-dog[major.minor]Remove a minor version from a major version. Validates that no incomplete tasks exist 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_version">
Determine minor version to remove:
If $ARGUMENTS provided:
major.minor formatIf $ARGUMENTS empty:
List all minor versions:
# Find all minor versions with task counts
find .claude/dog/major/*/minor -maxdepth 1 -type d -name "[0-9]*" 2>/dev/null | while read d; do
MAJOR=$(echo "$d" | sed 's|.*/major/\([0-9]*\)/.*|\1|')
MINOR=$(basename "$d")
TASK_COUNT=$(find "$d/task" -maxdepth 1 -type d 2>/dev/null | wc -l)
TASK_COUNT=$((TASK_COUNT - 1)) # Subtract 1 for the task directory itself
echo "$MAJOR.$MINOR ($TASK_COUNT tasks)"
done | sort -V
Use AskUserQuestion:
If "Cancel" -> exit command.
</step> <step name="validate">Validate minor version can be removed:
MINOR_PATH=".claude/dog/major/$MAJOR/minor/$MINOR"
# Check version exists
[ ! -d "$MINOR_PATH" ] && echo "ERROR: Minor version does not exist" && exit 1
Check for incomplete tasks:
# Find any tasks that are not completed
INCOMPLETE=$(find "$MINOR_PATH/task" -name "STATE.md" -exec grep -l "Status: pending\|Status: in-progress" {} \; 2>/dev/null)
If incomplete tasks exist:
ERROR: Cannot remove minor version with incomplete tasks.
Incomplete tasks:
{list of incomplete tasks}
Options:
1. Complete all tasks first with /dog:execute-task
2. Remove individual tasks with /dog:remove-task
3. Force removal by setting all task statuses to 'completed'
Use AskUserQuestion:
If "Cancel" -> exit command.
</step> <step name="check_dependencies">Check if later minor versions depend on this completing:
Minor versions implicitly depend on previous minor versions within the same major.
If this is not the last minor version:
Use AskUserQuestion:
Final confirmation:
Count files to be removed:
TASK_COUNT=$(find "$MINOR_PATH/task" -maxdepth 1 -type d 2>/dev/null | wc -l)
TASK_COUNT=$((TASK_COUNT - 1))
Use AskUserQuestion:
If "No, cancel" -> exit command.
</step> <step name="remove">Remove minor version directory:
rm -rf "$MINOR_PATH"
</step>
<step name="update_roadmap">
Update ROADMAP.md:
Remove the entry for this minor version.
</step> <step name="update_parent">Update parent major STATE.md:
Recalculate progress without the removed minor version.
</step> <step name="commit">Commit removal:
git add -A ".claude/dog/major/$MAJOR/"
git add ".claude/dog/ROADMAP.md"
git commit -m "$(cat <<'EOF'
docs: remove minor version {major}.{minor}
Minor version removed by user request.
Removed {task_count} tasks.
EOF
)"
</step>
<step name="done">
Present completion:
Minor version removed:
- Version: {major}.{minor}
- Tasks removed: {task_count}
---
Use `/dog:status` to see current state.
---
</step>
</process>
<success_criteria>
</success_criteria>