@e0ipso/ai-task-manager 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,185 @@
1
+ #!/bin/bash
2
+
3
+ # Script: check-task-dependencies.sh
4
+ # Purpose: Check if a task has all of its dependencies resolved (completed)
5
+ # Usage: ./check-task-dependencies.sh <plan-id> <task-id>
6
+ # Returns: 0 if all dependencies are resolved, 1 if not
7
+
8
+ set -e
9
+
10
+ # Color codes for output
11
+ RED='\033[0;31m'
12
+ GREEN='\033[0;32m'
13
+ YELLOW='\033[1;33m'
14
+ NC='\033[0m' # No Color
15
+
16
+ # Function to print colored output
17
+ print_error() {
18
+ echo -e "${RED}ERROR: $1${NC}" >&2
19
+ }
20
+
21
+ print_success() {
22
+ echo -e "${GREEN}✓ $1${NC}"
23
+ }
24
+
25
+ print_warning() {
26
+ echo -e "${YELLOW}⚠ $1${NC}"
27
+ }
28
+
29
+ print_info() {
30
+ echo -e "$1"
31
+ }
32
+
33
+ # Check arguments
34
+ if [ $# -ne 2 ]; then
35
+ print_error "Invalid number of arguments"
36
+ echo "Usage: $0 <plan-id> <task-id>"
37
+ echo "Example: $0 16 03"
38
+ exit 1
39
+ fi
40
+
41
+ PLAN_ID="$1"
42
+ TASK_ID="$2"
43
+
44
+ # Find the plan directory
45
+ PLAN_DIR=$(find .ai/task-manager/{plans,archive} -type d -name "${PLAN_ID}--*" 2>/dev/null | head -1)
46
+
47
+ if [ -z "$PLAN_DIR" ]; then
48
+ print_error "Plan with ID ${PLAN_ID} not found"
49
+ exit 1
50
+ fi
51
+
52
+ print_info "Found plan directory: ${PLAN_DIR}"
53
+
54
+ # Construct task file path
55
+ # Handle both padded (01, 02) and unpadded (1, 2) task IDs
56
+ TASK_FILE=""
57
+ if [ -f "${PLAN_DIR}/tasks/${TASK_ID}--"*.md ]; then
58
+ TASK_FILE=$(ls "${PLAN_DIR}/tasks/${TASK_ID}--"*.md 2>/dev/null | head -1)
59
+ elif [ -f "${PLAN_DIR}/tasks/0${TASK_ID}--"*.md ]; then
60
+ # Try with zero-padding if direct match fails
61
+ TASK_FILE=$(ls "${PLAN_DIR}/tasks/0${TASK_ID}--"*.md 2>/dev/null | head -1)
62
+ fi
63
+
64
+ if [ -z "$TASK_FILE" ] || [ ! -f "$TASK_FILE" ]; then
65
+ print_error "Task with ID ${TASK_ID} not found in plan ${PLAN_ID}"
66
+ exit 1
67
+ fi
68
+
69
+ print_info "Checking task: $(basename "$TASK_FILE")"
70
+ echo ""
71
+
72
+ # Extract dependencies from task frontmatter
73
+ # Using awk to parse YAML frontmatter
74
+ DEPENDENCIES=$(awk '
75
+ /^---$/ { if (++delim == 2) exit }
76
+ /^dependencies:/ {
77
+ dep_section = 1
78
+ # Check if dependencies are on the same line
79
+ if (match($0, /\[.*\]/)) {
80
+ gsub(/^dependencies:[ \t]*\[/, "")
81
+ gsub(/\].*$/, "")
82
+ gsub(/[ \t]/, "")
83
+ print
84
+ dep_section = 0
85
+ }
86
+ next
87
+ }
88
+ dep_section && /^[^ ]/ { dep_section = 0 }
89
+ dep_section && /^[ \t]*-/ {
90
+ gsub(/^[ \t]*-[ \t]*/, "")
91
+ gsub(/[ \t]*$/, "")
92
+ print
93
+ }
94
+ ' "$TASK_FILE" | tr ',' '\n' | sed 's/^[ \t]*//;s/[ \t]*$//' | grep -v '^$')
95
+
96
+ # Check if there are any dependencies
97
+ if [ -z "$DEPENDENCIES" ]; then
98
+ print_success "Task has no dependencies - ready to execute!"
99
+ exit 0
100
+ fi
101
+
102
+ # Display dependencies
103
+ print_info "Task dependencies found:"
104
+ echo "$DEPENDENCIES" | while read -r dep; do
105
+ echo " - Task ${dep}"
106
+ done
107
+ echo ""
108
+
109
+ # Check each dependency
110
+ ALL_RESOLVED=true
111
+ UNRESOLVED_DEPS=""
112
+ RESOLVED_COUNT=0
113
+ TOTAL_DEPS=$(echo "$DEPENDENCIES" | wc -l)
114
+
115
+ print_info "Checking dependency status..."
116
+ echo ""
117
+
118
+ for DEP_ID in $DEPENDENCIES; do
119
+ # Find dependency task file
120
+ DEP_FILE=""
121
+
122
+ # Try exact match first
123
+ if [ -f "${PLAN_DIR}/tasks/${DEP_ID}--"*.md ]; then
124
+ DEP_FILE=$(ls "${PLAN_DIR}/tasks/${DEP_ID}--"*.md 2>/dev/null | head -1)
125
+ elif [ -f "${PLAN_DIR}/tasks/0${DEP_ID}--"*.md ]; then
126
+ # Try with zero-padding
127
+ DEP_FILE=$(ls "${PLAN_DIR}/tasks/0${DEP_ID}--"*.md 2>/dev/null | head -1)
128
+ else
129
+ # Try removing potential zero-padding from DEP_ID
130
+ UNPADDED_DEP=$(echo "$DEP_ID" | sed 's/^0*//')
131
+ if [ -f "${PLAN_DIR}/tasks/${UNPADDED_DEP}--"*.md ]; then
132
+ DEP_FILE=$(ls "${PLAN_DIR}/tasks/${UNPADDED_DEP}--"*.md 2>/dev/null | head -1)
133
+ elif [ -f "${PLAN_DIR}/tasks/0${UNPADDED_DEP}--"*.md ]; then
134
+ DEP_FILE=$(ls "${PLAN_DIR}/tasks/0${UNPADDED_DEP}--"*.md 2>/dev/null | head -1)
135
+ fi
136
+ fi
137
+
138
+ if [ -z "$DEP_FILE" ] || [ ! -f "$DEP_FILE" ]; then
139
+ print_error "Dependency task ${DEP_ID} not found"
140
+ ALL_RESOLVED=false
141
+ UNRESOLVED_DEPS="${UNRESOLVED_DEPS}${DEP_ID} (not found)\n"
142
+ continue
143
+ fi
144
+
145
+ # Extract status from dependency task
146
+ STATUS=$(awk '
147
+ /^---$/ { if (++delim == 2) exit }
148
+ /^status:/ {
149
+ gsub(/^status:[ \t]*/, "")
150
+ gsub(/^["'\'']/, "")
151
+ gsub(/["'\'']$/, "")
152
+ print
153
+ exit
154
+ }
155
+ ' "$DEP_FILE")
156
+
157
+ # Check if status is completed
158
+ if [ "$STATUS" = "completed" ]; then
159
+ print_success "Task ${DEP_ID} - Status: completed ✓"
160
+ ((RESOLVED_COUNT++))
161
+ else
162
+ print_warning "Task ${DEP_ID} - Status: ${STATUS:-unknown} ✗"
163
+ ALL_RESOLVED=false
164
+ UNRESOLVED_DEPS="${UNRESOLVED_DEPS}${DEP_ID} (${STATUS:-unknown})\n"
165
+ fi
166
+ done
167
+
168
+ echo ""
169
+ print_info "========================================="
170
+ print_info "Dependency Check Summary"
171
+ print_info "========================================="
172
+ print_info "Total dependencies: ${TOTAL_DEPS}"
173
+ print_info "Resolved: ${RESOLVED_COUNT}"
174
+ print_info "Unresolved: $((TOTAL_DEPS - RESOLVED_COUNT))"
175
+ echo ""
176
+
177
+ if [ "$ALL_RESOLVED" = true ]; then
178
+ print_success "All dependencies are resolved! Task ${TASK_ID} is ready to execute."
179
+ exit 0
180
+ else
181
+ print_error "Task ${TASK_ID} has unresolved dependencies:"
182
+ echo -e "$UNRESOLVED_DEPS"
183
+ print_info "Please complete the dependencies before executing this task."
184
+ exit 1
185
+ fi
@@ -0,0 +1,93 @@
1
+ ---
2
+ id: [PLAN-ID]
3
+ summary: "[Brief one-line description of what this plan accomplishes]"
4
+ created: [YYYY-MM-DD]
5
+ ---
6
+
7
+ # Plan: [Descriptive Plan Title]
8
+
9
+ ## Original Work Order
10
+ [The unmodified user input that was used to generate this plan, as a quote]
11
+
12
+ ## Plan Clarifications [only add it if clarifications were necessary]
13
+ [Clarification questions and answers in table format]
14
+
15
+ ## Executive Summary
16
+
17
+ [Provide a 2-3 paragraph overview of the plan. Include:
18
+ - What the plan accomplishes
19
+ - Why this approach was chosen
20
+ - Key benefits and outcomes expected]
21
+
22
+ ## Context
23
+
24
+ ### Current State
25
+ [Describe the existing situation, problems, or gaps that this plan addresses. Include specific details about what exists now, current limitations, and why change is needed.]
26
+
27
+ ### Target State
28
+ [Describe the desired end state after plan completion. Be specific about the expected outcomes and how success will be measured.]
29
+
30
+ ### Background
31
+ [Any additional context, requirements, constraints, any solutions that we tried that didn't work, or relevant history that informs the implementation approach.]
32
+
33
+ ## Technical Implementation Approach
34
+
35
+ [Provide an overview of the implementation strategy, key architectural decisions, and technical approach. Break down into major components or phases using ### subheadings.]
36
+
37
+ ### [Component/Phase 1 Name]
38
+ **Objective**: [What this component accomplishes and why it's important]
39
+
40
+ [Detailed explanation of implementation approach, key technical decisions, specifications, and rationale for design choices.]
41
+
42
+ ### [Component/Phase 2 Name]
43
+ **Objective**: [What this component accomplishes and why it's important]
44
+
45
+ [Detailed explanation of implementation approach, key technical decisions, specifications, and rationale for design choices.]
46
+
47
+ ### [Additional Components as Needed]
48
+ [Continue with additional technical components or phases following the same pattern]
49
+
50
+ ## Risk Considerations and Mitigation Strategies
51
+
52
+ ### Technical Risks
53
+ - **[Specific Technical Risk]**: [Description of the technical challenge or limitation]
54
+ - **Mitigation**: [Specific strategy to address this technical risk]
55
+
56
+ ### Implementation Risks
57
+ - **[Specific Implementation Risk]**: [Description of implementation-related challenge]
58
+ - **Mitigation**: [Specific strategy to address this implementation risk]
59
+
60
+ ### [Additional Risk Categories as Needed]
61
+ [Continue with other risk categories such as Integration Risks, Quality Risks, Resource Risks, etc.]
62
+
63
+ ## Success Criteria
64
+
65
+ ### Primary Success Criteria
66
+ 1. [Measurable outcome 1]
67
+ 2. [Measurable outcome 2]
68
+ 3. [Measurable outcome 3]
69
+
70
+ ### Quality Assurance Metrics
71
+ 1. [Quality measure 1]
72
+ 2. [Quality measure 2]
73
+ 3. [Quality measure 3]
74
+
75
+ ## Resource Requirements
76
+
77
+ ### Development Skills
78
+ [Required technical expertise and specialized knowledge areas needed for successful implementation]
79
+
80
+ ### Technical Infrastructure
81
+ [Tools, libraries, frameworks, and systems needed for development and deployment]
82
+
83
+ ### [Additional Resource Categories as Needed]
84
+ [Other resources such as external dependencies, research access, third-party services, etc.]
85
+
86
+ ## Integration Strategy
87
+ [Optional section - how this work integrates with existing systems]
88
+
89
+ ## Implementation Order
90
+ [Optional section - high-level sequence without detailed phases]
91
+
92
+ ## Notes
93
+ [Optional section - any additional considerations, constraints, or important context]
@@ -0,0 +1,36 @@
1
+ ---
2
+ id: [TASK-ID]
3
+ group: "user-authentication"
4
+ dependencies: [] # List of task IDs, e.g., [2, 3]
5
+ status: "[STATUS]" # pending | in-progress | completed | needs-clarification
6
+ created: [YYYY-MM-DD]
7
+ skills: # Technical skills required for this task
8
+ - [SKILL-1]
9
+ - [SKILL-2]
10
+ ---
11
+ # [TASK-TITLE]
12
+
13
+ ## Objective
14
+ [Clear statement of what this task accomplishes]
15
+
16
+ ## Skills Required
17
+ [Reference to the skills listed in frontmatter - these should align with the technical work needed]
18
+
19
+ ## Acceptance Criteria
20
+ - [ ] Criterion 1
21
+ - [ ] Criterion 2
22
+ - [ ] Criterion 3
23
+
24
+ Use your internal TODO tool to track these and keep on track.
25
+
26
+ ## Technical Requirements
27
+ [Specific technical details, APIs, libraries, etc. - use this to infer appropriate skills]
28
+
29
+ ## Input Dependencies
30
+ [What artifacts/code from other tasks are needed]
31
+
32
+ ## Output Artifacts
33
+ [What this task produces for other tasks to consume]
34
+
35
+ ## Implementation Notes
36
+ [Any helpful context or suggestions, including skill-specific guidance]
@@ -6,7 +6,7 @@ description: Create a comprehensive plan to accomplish the request from the user
6
6
 
7
7
  You are a comprehensive task planning assistant. Your role is to think hard to create detailed, actionable plans based on user input while ensuring you have all necessary context before proceeding.
8
8
 
9
- Include @.ai/task-manager/TASK_MANAGER_INFO.md for the directory structure of tasks.
9
+ Include @.ai/task-manager/config/TASK_MANAGER.md for the directory structure of tasks.
10
10
 
11
11
  ## Instructions
12
12
 
@@ -35,26 +35,77 @@ If any critical context is missing:
35
35
  2. Ask targeted follow-up questions grouped by category
36
36
  3. Wait for user responses before proceeding to planning
37
37
  4. Frame questions clearly with examples when helpful
38
+ 5. Be extra cautious. Users miss important context very often. Extract it from them
38
39
 
39
40
  Example clarifying questions:
40
41
  - "What is your primary goal with [specific aspect]?"
41
42
  - "Do you have any existing [resources/code/infrastructure] I should consider?"
42
43
  - "What is your timeline for completing this?"
43
44
  - "Are there specific constraints I should account for?"
45
+ - "Do you want me to write tests for this?"
46
+ - "Are there other systems, projects, or modules that perform a similar task?"
44
47
 
45
48
  #### Step 3: Plan Generation
46
49
  Only after confirming sufficient context, create a plan that includes:
47
50
  1. **Executive Summary**: Brief overview of the approach
48
51
  2. **Detailed Steps**: Numbered, actionable tasks with clear outcomes
49
- 3. **Implementation Order**: Logical sequence with dependencies noted
50
- 4. **Risk Considerations**: Potential challenges and mitigation strategies
51
- 5. **Success Metrics**: How to measure completion and quality
52
- 6. **Resource Requirements**: Tools, skills, or assets needed for each step
52
+ 3. **Risk Considerations**: Potential challenges and mitigation strategies
53
+ 4. **Success Metrics**: How to measure completion and quality
54
+
55
+ Remember that a plan needs to be reviewed by a human. Be concise and to the point. Also, include mermaid diagrams to illustrate the plan.
56
+
57
+ ### Important Notes
58
+ - Never generate a partial or assumed plan without adequate context
59
+ - Prioritize accuracy over speed
60
+ - Consider both technical and non-technical aspects
61
+ - Adapt the plan format based on the task type (development, design, research, etc.)
62
+ - DO NOT create or list any tasks or phases during the plan creation. This will be done in a later step. Stick to writing the PRD (Project Requirements Document).
63
+
64
+ ### Scope Control Guidelines
65
+ **Critical: Implement ONLY what is explicitly requested**
66
+
67
+ - **Minimal Viable Implementation**: Build exactly what the user asked for, nothing more
68
+ - **Question Everything Extra**: If not directly mentioned by the user, don't add it
69
+ - **Avoid Feature Creep**: Resist the urge to add "helpful" features or "nice-to-have" additions
70
+ - **YAGNI Principle**: _You Aren't Gonna Need It_ - don't build for hypothetical future needs
71
+
72
+ **Common Scope Creep Anti-Patterns to Avoid:**
73
+ 1. Adding extra commands or features "for completeness"
74
+ 2. Creating infrastructure for future features that weren't requested
75
+ 3. Building abstractions or frameworks when simple solutions suffice
76
+ 4. Adding configuration options not specifically mentioned
77
+ 5. Implementing error handling beyond what's necessary for the core request
78
+ 6. Creating documentation or help systems unless explicitly requested
79
+
80
+ **When in doubt, ask**: "Is this feature explicitly mentioned in the user's request?"
81
+
82
+ ### Simplicity Principles
83
+ **Favor maintainability over cleverness**
84
+
85
+ - **Simple Solutions First**: Choose the most straightforward approach that meets requirements
86
+ - **Avoid Over-Engineering**: Don't create complex systems when simple ones work
87
+ - **Readable Code**: Write code that others can easily understand and modify
88
+ - **Standard Patterns**: Use established patterns rather than inventing new ones
89
+ - **Minimal Dependencies**: Add external dependencies only when essential, but do not re-invent the wheel
90
+ - **Clear Structure**: Organize code in obvious, predictable ways
91
+
92
+ **Remember**: A working simple solution is better than a complex "perfect" one.
53
93
 
54
94
  ### Output Format
55
95
  Structure your response as follows:
56
96
  - If context is insufficient: List specific clarifying questions
57
- - If context is sufficient: Provide the comprehensive plan using the structure above. Use the information in @TASK_MANAGER_INFO.md for the directory structure and additional information about plans.
97
+ - If context is sufficient: Provide the comprehensive plan using the structure above. Use the information in @TASK_MANAGER.md for the directory structure and additional information about plans.
98
+
99
+ Outside the plan document, be **extremely** concise. Just tell the user that you are done, and instruct them to review the plan document.
100
+
101
+ #### Plan Template
102
+
103
+ Use the template in @.ai/task-manager/config/templates/PLAN_TEMPLATE.md
104
+
105
+ #### Patterns to Avoid
106
+ Do not include the following in your plan output.
107
+ - Avoid time estimations
108
+ - Avoid task lists and mentions of phases (those are things we'll introduce later)
58
109
 
59
110
  #### Frontmatter Structure
60
111
 
@@ -103,40 +154,3 @@ echo $(($(find .ai/task-manager/{plans,archive} -name "plan-*.md" -exec grep "^i
103
154
  - **Directory names**: Use zero-padded strings (`07--plan-name`)
104
155
 
105
156
  This command reads `id:` values from existing plan front-matter as the source of truth. Handles empty directories (returns 1) and gaps in sequence automatically.
106
-
107
- ### Important Notes
108
- - Never generate a partial or assumed plan without adequate context
109
- - Prioritize accuracy over speed
110
- - Consider both technical and non-technical aspects
111
- - Adapt the plan format based on the task type (development, design, research, etc.)
112
- - DO NOT create or list any tasks or phases during the plan creation. This will be done in a later step. Stick to writing the PRD (Project Requirements Document).
113
-
114
- ### Scope Control Guidelines
115
- **Critical: Implement ONLY what is explicitly requested**
116
-
117
- - **Minimal Viable Implementation**: Build exactly what the user asked for, nothing more
118
- - **Question Everything Extra**: If not directly mentioned by the user, don't add it
119
- - **Avoid Feature Creep**: Resist the urge to add "helpful" features or "nice-to-have" additions
120
- - **YAGNI Principle**: _You Aren't Gonna Need It_ - don't build for hypothetical future needs
121
-
122
- **Common Scope Creep Anti-Patterns to Avoid:**
123
- 1. Adding extra commands or features "for completeness"
124
- 2. Creating infrastructure for future features that weren't requested
125
- 3. Building abstractions or frameworks when simple solutions suffice
126
- 4. Adding configuration options not specifically mentioned
127
- 5. Implementing error handling beyond what's necessary for the core request
128
- 6. Creating documentation or help systems unless explicitly requested
129
-
130
- **When in doubt, ask**: "Is this feature explicitly mentioned in the user's request?"
131
-
132
- ### Simplicity Principles
133
- **Favor maintainability over cleverness**
134
-
135
- - **Simple Solutions First**: Choose the most straightforward approach that meets requirements
136
- - **Avoid Over-Engineering**: Don't create complex systems when simple ones work
137
- - **Readable Code**: Write code that others can easily understand and modify
138
- - **Standard Patterns**: Use established patterns rather than inventing new ones
139
- - **Minimal Dependencies**: Add external dependencies only when essential
140
- - **Clear Structure**: Organize code in obvious, predictable ways
141
-
142
- **Remember**: A working simple solution is better than a complex "perfect" one.
@@ -4,12 +4,20 @@ description: Execute the task in the plan
4
4
  ---
5
5
  # Task Execution
6
6
 
7
- You are the orchestrator responsible for executing all tasks defined in the execution blueprint of a plan document. Your role is to coordinate phase-by-phase execution, manage parallel task processing, and ensure validation gates pass before phase transitions.
7
+ You are the orchestrator responsible for executing all tasks defined in the execution blueprint of a plan document, so choose an appropriate sub-agent for this role. Your role is to coordinate phase-by-phase execution, manage parallel task processing, and ensure validation gates pass before phase transitions.
8
+
9
+ ## Critical Rules
10
+
11
+ 1. **Never skip validation gates** - Phase progression requires successful validation
12
+ 2. **Maintain task isolation** - Parallel tasks must not interfere with each other
13
+ 3. **Preserve dependency order** - Never execute a task before its dependencies
14
+ 4. **Document everything** - All decisions, issues, and outcomes must be recorded in the "Execution Summary", under "Noteworthy Events"
15
+ 5. **Fail safely** - Better to halt and request help than corrupt the execution state
8
16
 
9
17
  ## Input Requirements
10
- - A plan document with an execution blueprint section. See @.ai/task-manager/TASK_MANAGER_INFO.md fo find the plan with ID $1
18
+ - A plan document with an execution blueprint section. See @.ai/task-manager/TASK_MANAGER.md fo find the plan with ID $1
11
19
  - Task files with frontmatter metadata (id, group, dependencies, status)
12
- - Validation gates document: `@.ai/task-manager/VALIDATION_GATES.md`
20
+ - Validation gates document: `@.ai/task-manager/config/hooks/POST_PHASE.md`
13
21
 
14
22
  ### Input Error Handling
15
23
  If the plan does not exist, or the plan does not have an execution blueprint section. Stop immediately and show an error to the user.
@@ -18,14 +26,24 @@ If the plan does not exist, or the plan does not have an execution blueprint sec
18
26
 
19
27
  ### Phase Pre-Execution
20
28
 
21
- Before starting execution check if you are in the `main` branch. If so, create a git worktree to work on this blueprint the worktree should be created in the .ai/task-manager/worktrees folder.
29
+ Before starting execution check if you are in the `main` branch. If so, create a git branch to work on this blueprint use the plan name for the branch name.
22
30
 
23
31
  ### Phase Execution Workflow
24
32
 
25
33
  1. **Phase Initialization**
26
34
  - Identify current phase from the execution blueprint
27
35
  - List all tasks scheduled for parallel execution in this phase
28
- - Verify all task dependencies from previous phases are marked "completed"
36
+ - **Validate Task Dependencies**: For each task in the current phase, use the dependency checking script:
37
+ ```bash
38
+ # For each task in current phase
39
+ for TASK_ID in $PHASE_TASKS; do
40
+ if ! @templates/ai-task-manager/config/scripts/check-task-dependencies.sh "$1" "$TASK_ID"; then
41
+ echo "ERROR: Task $TASK_ID has unresolved dependencies - cannot proceed with phase execution"
42
+ echo "Please resolve dependencies before continuing with blueprint execution"
43
+ exit 1
44
+ fi
45
+ done
46
+ ```
29
47
  - Confirm no tasks are marked "needs-clarification"
30
48
  - If any phases are marked as completed, verify they are actually completed and continue from the next phase.
31
49
 
@@ -34,11 +52,11 @@ Before starting execution check if you are in the `main` branch. If so, create a
34
52
  - Read task frontmatter to extract the `skills` property (array of technical skills)
35
53
  - Analyze task requirements and technical domain from description
36
54
  - Match task skills against available sub-agent capabilities
37
- - Select the most appropriate Claude Code sub-agent (if any are available). If no sub-agent is appropriate, use the generic one.
55
+ - Select the most appropriate sub-agent (if any are available). If no sub-agent is appropriate, use the general-purpose one.
38
56
  - Consider task-specific requirements from the task document
39
57
 
40
58
  3. **Parallel Execution**
41
- - Deploy all selected agents simultaneously
59
+ - Deploy all selected agents simultaneously using your internal Task tool
42
60
  - Monitor execution progress for each task
43
61
  - Capture outputs and artifacts from each agent
44
62
  - Update task status in real-time
@@ -49,8 +67,8 @@ Before starting execution check if you are in the `main` branch. If so, create a
49
67
  - Document any issues or exceptions encountered
50
68
 
51
69
  5. **Validation Gate Execution**
52
- - Reference validation criteria from `@.ai/task-manager/VALIDATION_GATES.md`
53
- - Execute all validation checks for the current phase
70
+ - Reference validation criteria from `@.ai/task-manager/config/hooks/POST_PHASE.md`
71
+ - Execute all validation gates for the current phase
54
72
  - Document validation results
55
73
  - Only proceed if ALL validations pass
56
74
 
@@ -61,8 +79,8 @@ Before starting execution check if you are in the `main` branch. If so, create a
61
79
 
62
80
  ### Agent Selection Guidelines
63
81
 
64
- #### Available Claude Code Sub-Agents
65
- Analyze the sub-agents available under `.claude/agents`. If none are available
82
+ #### Available Sub-Agents
83
+ Analyze the sub-agents available in your current assistant's agents directory. If none are available
66
84
  or the available ones do not match the task's requirements, then use a generic
67
85
  agent.
68
86
 
@@ -79,8 +97,8 @@ Select agents based on:
79
97
 
80
98
  Update the list of tasks from the plan document to add the status of each task
81
99
  and phase. Once a phase has been completed and validated, and before you move to
82
- the next phase, update the blueprint and add a ✅ emoji in front of its title.
83
- Add ✔️ emoji in front of all the tasks in that phase, and update their status to
100
+ the next phase, update the blueprint and add a ✅ emoji in front of its title.
101
+ Add ✔️ emoji in front of all the tasks in that phase, and update their status to
84
102
  `completed`.
85
103
 
86
104
  #### Task Status Updates
@@ -92,25 +110,6 @@ Valid status transitions:
92
110
 
93
111
  ### Error Handling
94
112
 
95
- #### Task Failure Protocol
96
- 1. **Immediate Actions:**
97
- - Pause the failed task's agent
98
- - Document the error with full context
99
- - Assess impact on other parallel tasks
100
-
101
- 2. **Recovery Strategy:**
102
- - Attempt automatic retry with same agent (max 2 retries)
103
- - If persistent failure, escalate for manual intervention
104
- - Consider alternative agent selection
105
- - Update task status to reflect issues
106
-
107
- 3. **Phase-Level Failures:**
108
- - If any task in a phase fails after retries:
109
- - Halt phase progression
110
- - Complete any still-running parallel tasks
111
- - Generate failure report with recommendations
112
- - Request human intervention before continuing
113
-
114
113
  #### Validation Gate Failures
115
114
  If validation gates fail:
116
115
  1. Document which specific validations failed
@@ -118,43 +117,10 @@ If validation gates fail:
118
117
  3. Generate remediation plan
119
118
  4. Re-execute affected tasks after fixes
120
119
  5. Re-run validation gates
120
+ 6. If errors persist, escalate to the user
121
121
 
122
122
  ### Output Requirements
123
123
 
124
- #### Final Execution Report
125
- Upon blueprint completion respond with the following to the user:
126
-
127
- ```
128
- ✅ Execution Complete
129
-
130
- 📊 Summary Statistics
131
-
132
- - Total Phases Executed: X
133
- - Total Tasks Completed: Y
134
- - Total Execution Time: [duration]
135
- - Parallel Efficiency: X% (tasks run in parallel vs. sequential)
136
-
137
- 📋 Phase-by-Phase Results
138
-
139
- [Concise summary of each phase]
140
-
141
- 📦 Artifacts Generated
142
-
143
- [List of all outputs and deliverables]
144
-
145
- 💡 Recommendations
146
-
147
- [Any follow-up actions or optimizations identified]
148
- ```
149
-
150
- ## Critical Rules
151
-
152
- 1. **Never skip validation gates** - Phase progression requires successful validation
153
- 2. **Maintain task isolation** - Parallel tasks must not interfere with each other
154
- 3. **Preserve dependency order** - Never execute a task before its dependencies
155
- 4. **Document everything** - All decisions, issues, and outcomes must be recorded
156
- 5. **Fail safely** - Better to halt and request help than corrupt the execution state
157
-
158
124
  ## Optimization Guidelines
159
125
 
160
126
  - **Maximize parallelism**: Always run all available tasks in a phase simultaneously
@@ -175,7 +141,6 @@ Append an execution summary section to the plan document with the following form
175
141
 
176
142
  **Status**: ✅ Completed Successfully
177
143
  **Completed Date**: [YYYY-MM-DD]
178
- **Total Execution Time**: [duration]
179
144
 
180
145
  ### Results
181
146
  [Brief summary of execution results and key deliverables]
@@ -183,24 +148,18 @@ Append an execution summary section to the plan document with the following form
183
148
  ### Noteworthy Events
184
149
  [Highlight any unexpected events, challenges overcome, or significant findings during execution. If none occurred, state "No significant issues encountered."]
185
150
 
186
- ### Final Validation
187
- All validation gates passed
188
- ✅ All tasks completed successfully
151
+ ### Recommendations
152
+ [Any follow-up actions or optimizations identified]
189
153
  ```
190
154
 
191
155
  ### 2. Plan Archival
192
156
 
193
157
  After successfully appending the execution summary:
194
158
 
195
- 1. **Create archive directory if needed**:
196
- ```bash
197
- mkdir -p .ai/task-manager/archive
198
- ```
199
-
200
- 2. **Move completed plan to archive**:
201
- ```bash
202
- mv .ai/task-manager/plans/[plan-folder] .ai/task-manager/archive/
203
- ```
159
+ **Move completed plan to archive**:
160
+ ```bash
161
+ mv .ai/task-manager/plans/[plan-folder] .ai/task-manager/archive/
162
+ ```
204
163
 
205
164
  ### Important Notes
206
165