Add task to minor version
Creates a new task for a minor version with guided planning and generates a comprehensive PLAN.md.
/plugin marketplace add cowwoc/claude-code-dog/plugin install dog@claude-code-dog[major.minor]Add a new task to a minor version. Uses a discussion workflow to gather context and automatically generates a comprehensive PLAN.md for the task.
Tasks are the atomic unit of work in DOG - each task should be completable within a single context window (target: 40% of limit).
</objective><execution_context>
@${CLAUDE_PLUGIN_ROOT}/.claude/dog/templates/task-state.md @${CLAUDE_PLUGIN_ROOT}/.claude/dog/templates/task-plan.md @${CLAUDE_PLUGIN_ROOT}/.claude/dog/templates/changelog.md @${CLAUDE_PLUGIN_ROOT}/.claude/dog/workflows/questioning.md
</execution_context>
<process> <step name="verify">Verify planning structure exists:
[ ! -d .claude/dog ] && echo "ERROR: No planning structure. Run /dog:new-project first." && exit 1
[ ! -f .claude/dog/ROADMAP.md ] && echo "ERROR: No ROADMAP.md. Run /dog:new-project first." && exit 1
</step>
<step name="select_version">
Determine target minor version:
If $ARGUMENTS provided:
major.minor format (e.g., "1.0", "2.1")If $ARGUMENTS empty:
List available minor versions:
# Find all minor versions
find .claude/dog/major/*/minor -maxdepth 1 -type d -name "[0-9]*" 2>/dev/null | \
sed 's|.claude/dog/major/\([0-9]*\)/minor/\([0-9]*\)|\1.\2|' | sort -V
Use AskUserQuestion:
If "Create new minor version" -> invoke /dog:add-minor-version and return.
Validate selected version exists:
MAJOR="{major}"
MINOR="{minor}"
VERSION_PATH=".claude/dog/major/$MAJOR/minor/$MINOR"
[ ! -d "$VERSION_PATH" ] && echo "ERROR: Version $MAJOR.$MINOR does not exist" && exit 1
</step>
<step name="get_task_name">
Get task name from user:
Ask inline (FREEFORM): "What should this task be called? (lowercase, hyphens only, max 50 chars)"
Validate task name:
TASK_NAME="{user input}"
# Validate format
if ! echo "$TASK_NAME" | grep -qE '^[a-z][a-z0-9-]{0,48}[a-z0-9]$'; then
echo "ERROR: Invalid task name. Use lowercase letters, numbers, and hyphens only."
echo "Example: parse-tokens, fix-memory-leak, add-user-auth"
exit 1
fi
# Check uniqueness within minor version
if [ -d ".claude/dog/major/$MAJOR/minor/$MINOR/task/$TASK_NAME" ]; then
echo "ERROR: Task '$TASK_NAME' already exists in version $MAJOR.$MINOR"
exit 1
fi
If validation fails, prompt user for different name.
</step> <step name="discuss">Gather task context through discussion:
1. What is this task? (FREEFORM):
Ask inline: "Describe what this task should accomplish."
2. Task type:
Use AskUserQuestion:
3. Scope:
Use AskUserQuestion:
If "6+ files": Use AskUserQuestion:
If "Split into multiple tasks" -> guide user to define multiple tasks, loop this command.
4. Dependencies:
Use AskUserQuestion:
If dependencies needed, list existing tasks in same minor version for selection.
5. Acceptance criteria:
Ask inline: "What are the acceptance criteria? How will we know this task is complete?"
</step> <step name="create_structure">Create task directory structure:
TASK_PATH=".claude/dog/major/$MAJOR/minor/$MINOR/task/$TASK_NAME"
mkdir -p "$TASK_PATH"
</step>
<step name="create_state">
Create STATE.md:
# State
- **Status:** pending
- **Progress:** 0%
- **Dependencies:** [{dep1}, {dep2}] or []
- **Last Updated:** {timestamp}
</step>
<step name="create_plan">
Create PLAN.md based on task type:
For Feature tasks:
# Plan: {task-name}
## Goal
{goal from discussion}
## Approach
{approach - synthesized from discussion}
## Files to Modify
- path/to/file1.ext - [reason]
- path/to/file2.ext - [reason]
## Dependencies
- {task-name} - {why needed}
## Acceptance Criteria
- [ ] {criterion 1}
- [ ] {criterion 2}
- [ ] {criterion 3}
## Execution Steps
1. {step 1}
2. {step 2}
3. {step 3}
For Bugfix tasks:
# Plan: {task-name}
## Problem
{problem description}
## Root Cause
{analysis of cause - may be "To be determined during execution"}
## Fix Approach
{how the fix will work}
## Files to Modify
- path/to/file.ext - [change description]
## Test Cases
- [ ] Test case 1
- [ ] Test case 2
## Execution Steps
1. {step 1}
2. {step 2}
For Refactor tasks:
# Plan: {task-name}
## Current State
{what exists now}
## Target State
{what it should become}
## Rationale
{why this refactor is needed}
## Files to Modify
- path/to/file.ext - [change description]
## Risk Assessment
- {potential risk 1}
- {potential risk 2}
## Execution Steps
1. {step 1}
2. {step 2}
</step>
<step name="create_changelog">
Create empty CHANGELOG.md:
# Changelog
## {task-name} - Pending
*Changelog will be populated when task is executed.*
</step>
<step name="update_parent">
Update parent minor STATE.md:
Recalculate progress and update task count.
</step> <step name="commit">Commit task creation:
git add ".claude/dog/major/$MAJOR/minor/$MINOR/task/$TASK_NAME/"
git add ".claude/dog/major/$MAJOR/minor/$MINOR/STATE.md"
git commit -m "$(cat <<'EOF'
docs: add task {task-name} to {major}.{minor}
{One-line description of task goal}
EOF
)"
</step>
<step name="done">
Present completion:
Task created:
- Path: .claude/dog/major/{major}/minor/{minor}/task/{task-name}/
- Type: {task-type}
- Dependencies: {deps or "None"}
---
## Next Up
**Execute this task:**
`/dog:execute-task {major}.{minor}/{task-name}`
**Or add another task:**
`/dog:add-task {major}.{minor}`
---
</step>
</process>
<validation_rules>
Task name rules:
parse-tokens, fix-memory-leak, add-user-authInvalid examples:
Parse_Tokens (uppercase, underscores)fix memory leak (spaces)add-user-authentication-system-with-oauth-integration (too long)</validation_rules>
<success_criteria>
</success_criteria>