@e0ipso/ai-task-manager 1.8.0 → 1.8.2
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.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/ai-task-manager/config/hooks/POST_ERROR_DETECTION.md +48 -0
- package/templates/ai-task-manager/config/hooks/POST_PLAN.md +136 -0
- package/templates/ai-task-manager/config/hooks/PRE_PHASE.md +28 -0
- package/templates/ai-task-manager/config/hooks/PRE_TASK_ASSIGNMENT.md +69 -0
- package/templates/assistant/commands/tasks/create-plan.md +17 -28
- package/templates/assistant/commands/tasks/execute-blueprint.md +3 -43
- package/templates/assistant/commands/tasks/execute-task.md +2 -69
- package/templates/assistant/commands/tasks/generate-tasks.md +11 -111
package/dist/index.js
CHANGED
|
@@ -253,7 +253,7 @@ async function displayWorkflowHelp() {
|
|
|
253
253
|
console.log(`│ 2) Provide additional context if the assistant needs it${' '.repeat(3)}│`);
|
|
254
254
|
console.log(`│${' '.repeat(width)}│`);
|
|
255
255
|
console.log(`│ 3) MANUALLY REVIEW THE PLAN (don't skip this!)${' '.repeat(12)}│`);
|
|
256
|
-
console.log(`│ Find it in: .ai/task-manager/plans/01--*/plan
|
|
256
|
+
console.log(`│ Find it in: .ai/task-manager/plans/01--*/plan-[0-9]*--*.md${' '.repeat(4)}│`);
|
|
257
257
|
console.log(`│${' '.repeat(width)}│`);
|
|
258
258
|
console.log(`│ 4) Create the tasks for the plan:${' '.repeat(25)}│`);
|
|
259
259
|
console.log(`│ /tasks:generate-tasks 1${' '.repeat(31)}│`);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDH,oBA0EC;AA6ED,sCAGC;AAKD,kCAyBC;AA3OD,6C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}
|
package/package.json
CHANGED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# POST_ERROR_DETECTION Hook
|
|
2
|
+
|
|
3
|
+
This hook provides error handling procedures for task execution failures and validation gate failures.
|
|
4
|
+
|
|
5
|
+
## Task Execution Error Handling
|
|
6
|
+
|
|
7
|
+
If task execution fails:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# On execution failure, update status to failed
|
|
11
|
+
echo "Task execution failed - updating status..."
|
|
12
|
+
|
|
13
|
+
TEMP_FILE=$(mktemp)
|
|
14
|
+
awk '
|
|
15
|
+
/^---$/ {
|
|
16
|
+
if (++delim == 1) {
|
|
17
|
+
print
|
|
18
|
+
next
|
|
19
|
+
} else if (delim == 2) {
|
|
20
|
+
print "status: \"failed\""
|
|
21
|
+
print
|
|
22
|
+
next
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/^status:/ && delim == 1 {
|
|
26
|
+
print "status: \"failed\""
|
|
27
|
+
next
|
|
28
|
+
}
|
|
29
|
+
{ print }
|
|
30
|
+
' "$TASK_FILE" > "$TEMP_FILE"
|
|
31
|
+
|
|
32
|
+
mv "$TEMP_FILE" "$TASK_FILE"
|
|
33
|
+
|
|
34
|
+
echo "Task ${TASK_ID} marked as failed"
|
|
35
|
+
echo "Check the task requirements and try again"
|
|
36
|
+
exit 1
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Validation Gate Failure Handling
|
|
40
|
+
|
|
41
|
+
#### Validation Gate Failures
|
|
42
|
+
If validation gates fail:
|
|
43
|
+
1. Document which specific validations failed
|
|
44
|
+
2. Identify which tasks may have caused the failure
|
|
45
|
+
3. Generate remediation plan
|
|
46
|
+
4. Re-execute affected tasks after fixes
|
|
47
|
+
5. Re-run validation gates
|
|
48
|
+
6. If errors persist, escalate to the user
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# POST_PLAN Hook
|
|
2
|
+
|
|
3
|
+
This hook provides validation and update procedures to execute after plan creation, ensuring comprehensive context analysis and proper plan document structuring with dependency visualization.
|
|
4
|
+
|
|
5
|
+
## Plan Validation and Clarification
|
|
6
|
+
|
|
7
|
+
#### Step 1: Context Analysis
|
|
8
|
+
Before creating any plan, analyze the user's request for:
|
|
9
|
+
- **Objective**: What is the end goal?
|
|
10
|
+
- **Scope**: What are the boundaries and constraints?
|
|
11
|
+
- **Resources**: What tools, budget, or team are available?
|
|
12
|
+
- **Success Criteria**: How will success be measured?
|
|
13
|
+
- **Dependencies**: What prerequisites or blockers exist?
|
|
14
|
+
- **Technical Requirements**: What technologies or skills are needed?
|
|
15
|
+
|
|
16
|
+
#### Step 2: Clarification Phase
|
|
17
|
+
If any critical context is missing:
|
|
18
|
+
1. Identify specific gaps in the information provided
|
|
19
|
+
2. Ask targeted follow-up questions grouped by category
|
|
20
|
+
3. Wait for user responses before proceeding to planning
|
|
21
|
+
4. Frame questions clearly with examples when helpful
|
|
22
|
+
5. Be extra cautious. Users miss important context very often. Don't hesitate to ask for clarifications.
|
|
23
|
+
|
|
24
|
+
Example clarifying questions:
|
|
25
|
+
- "Q: What is your primary goal with [specific aspect]?"
|
|
26
|
+
- "Q: Do you have any existing [resources/code/infrastructure] I should consider?"
|
|
27
|
+
- "Q: What is your timeline for completing this?"
|
|
28
|
+
- "Q: Are there specific constraints I should account for?"
|
|
29
|
+
- "Q: Do you want me to write tests for this?"
|
|
30
|
+
- "Q: Are there other systems, projects, or modules that perform a similar task?"
|
|
31
|
+
|
|
32
|
+
Try to answer your own questions first by inspecting the codebase, docs, and assistant documents like CLAUDE.md, GEMINI.md, AGENTS.md ...
|
|
33
|
+
|
|
34
|
+
## Update the plan document
|
|
35
|
+
|
|
36
|
+
After creating all tasks with their dependencies, update the original plan document with two critical sections: a task dependency visualization and a phase-based execution blueprint.
|
|
37
|
+
|
|
38
|
+
### Section 1: Dependency Visualization
|
|
39
|
+
|
|
40
|
+
If any tasks have dependencies, create a Mermaid diagram showing the dependency graph:
|
|
41
|
+
|
|
42
|
+
```mermaid
|
|
43
|
+
graph TD
|
|
44
|
+
001[Task 001: Database Schema] --> 002[Task 002: API Endpoints]
|
|
45
|
+
001 --> 003[Task 003: Data Models]
|
|
46
|
+
002 --> 004[Task 004: Frontend Integration]
|
|
47
|
+
003 --> 004
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Note: Ensure the graph is acyclic (no circular dependencies).
|
|
51
|
+
|
|
52
|
+
### Section 2: Phase-Based Execution Blueprint
|
|
53
|
+
|
|
54
|
+
#### Core Concept
|
|
55
|
+
The execution blueprint organizes tasks into sequential phases where:
|
|
56
|
+
- **Within a phase**: All tasks execute in parallel
|
|
57
|
+
- **Between phases**: Execution is strictly sequential
|
|
58
|
+
- **Phase progression**: Requires all tasks in current phase to complete AND validation gates to pass
|
|
59
|
+
|
|
60
|
+
#### Phase Definition Rules
|
|
61
|
+
1. **Phase 1**: Contains all tasks with zero dependencies
|
|
62
|
+
2. **Phase N**: Contains tasks whose dependencies are ALL satisfied by tasks in phases 1 through N-1
|
|
63
|
+
3. **Parallelism Priority**: Maximize the number of tasks that can run simultaneously in each phase
|
|
64
|
+
4. **Completeness**: Every task must be assigned to exactly one phase
|
|
65
|
+
|
|
66
|
+
#### Blueprint Structure
|
|
67
|
+
|
|
68
|
+
```markdown
|
|
69
|
+
## Execution Blueprint
|
|
70
|
+
|
|
71
|
+
**Validation Gates:**
|
|
72
|
+
- Reference: `@.ai/task-manager/config/hooks/POST_PHASE.md`
|
|
73
|
+
|
|
74
|
+
### Phase 1: [Descriptive Phase Name]
|
|
75
|
+
**Parallel Tasks:**
|
|
76
|
+
- Task 001: [Description]
|
|
77
|
+
- Task 005: [Description]
|
|
78
|
+
- Task 009: [Description]
|
|
79
|
+
|
|
80
|
+
### Phase 2: [Descriptive Phase Name]
|
|
81
|
+
**Parallel Tasks:**
|
|
82
|
+
- Task 002: [Description] (depends on: 001)
|
|
83
|
+
- Task 003: [Description] (depends on: 001)
|
|
84
|
+
- Task 006: [Description] (depends on: 005)
|
|
85
|
+
|
|
86
|
+
[Continue for all phases...]
|
|
87
|
+
|
|
88
|
+
### Post-phase Actions
|
|
89
|
+
|
|
90
|
+
### Execution Summary
|
|
91
|
+
- Total Phases: X
|
|
92
|
+
- Total Tasks: Y
|
|
93
|
+
- Maximum Parallelism: Z tasks (in Phase N)
|
|
94
|
+
- Critical Path Length: X phases
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Validation Requirements
|
|
98
|
+
|
|
99
|
+
#### Phase Transition Rules
|
|
100
|
+
1. All tasks in the current phase must have status: "completed"
|
|
101
|
+
2. All validation gates defined in `@.ai/task-manager/config/hooks/POST_PHASE.md` for the current phase must pass
|
|
102
|
+
3. No task in a future phase can begin until these conditions are met
|
|
103
|
+
|
|
104
|
+
#### Blueprint Verification
|
|
105
|
+
Before finalizing, ensure:
|
|
106
|
+
- [ ] Every task appears in exactly one phase
|
|
107
|
+
- [ ] No task appears in a phase before all its dependencies
|
|
108
|
+
- [ ] Phase 1 contains only tasks with no dependencies
|
|
109
|
+
- [ ] Each phase maximizes parallel execution opportunities
|
|
110
|
+
- [ ] All phases reference their validation gates
|
|
111
|
+
- [ ] The execution summary accurately reflects the blueprint
|
|
112
|
+
|
|
113
|
+
### Important Notes
|
|
114
|
+
|
|
115
|
+
#### Parallel Execution
|
|
116
|
+
- Tasks within a phase have no interdependencies and can run simultaneously
|
|
117
|
+
- This enables efficient resource utilization and faster completion
|
|
118
|
+
- AI agents can be assigned to multiple tasks within the same phase
|
|
119
|
+
|
|
120
|
+
#### Sequential Phases
|
|
121
|
+
- Phases execute in strict numerical order
|
|
122
|
+
- Phase N+1 cannot begin until Phase N is fully complete and validated
|
|
123
|
+
- This ensures dependency integrity and systematic progress
|
|
124
|
+
-
|
|
125
|
+
|
|
126
|
+
#### Validation Gates
|
|
127
|
+
- Each phase has associated validation criteria defined externally
|
|
128
|
+
- Gates ensure quality and correctness before progression
|
|
129
|
+
- Failed validations require task remediation before phase completion
|
|
130
|
+
|
|
131
|
+
### Error Handling
|
|
132
|
+
|
|
133
|
+
If dependency analysis reveals issues:
|
|
134
|
+
- **Circular dependencies**: Document the cycle and mark affected tasks for review
|
|
135
|
+
- **Orphaned tasks**: Tasks that cannot be scheduled due to missing dependencies
|
|
136
|
+
- **Ambiguous dependencies**: Note assumptions made and flag for clarification
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# PRE_PHASE Hook
|
|
2
|
+
|
|
3
|
+
This hook contains the phase preparation logic that should be executed before starting any phase execution.
|
|
4
|
+
|
|
5
|
+
## Phase Pre-Execution
|
|
6
|
+
|
|
7
|
+
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.
|
|
8
|
+
|
|
9
|
+
If there are unstaged changes in the `main` branch, do not create a feature branch.
|
|
10
|
+
|
|
11
|
+
## Phase Execution Workflow
|
|
12
|
+
|
|
13
|
+
1. **Phase Initialization**
|
|
14
|
+
- Identify current phase from the execution blueprint
|
|
15
|
+
- List all tasks scheduled for parallel execution in this phase
|
|
16
|
+
- **Validate Task Dependencies**: For each task in the current phase, use the dependency checking script:
|
|
17
|
+
```bash
|
|
18
|
+
# For each task in current phase
|
|
19
|
+
for TASK_ID in $PHASE_TASKS; do
|
|
20
|
+
if ! node .ai/task-manager/config/scripts/check-task-dependencies.js "$1" "$TASK_ID"; then
|
|
21
|
+
echo "ERROR: Task $TASK_ID has unresolved dependencies - cannot proceed with phase execution"
|
|
22
|
+
echo "Please resolve dependencies before continuing with blueprint execution"
|
|
23
|
+
exit 1
|
|
24
|
+
fi
|
|
25
|
+
done
|
|
26
|
+
```
|
|
27
|
+
- Confirm no tasks are marked "needs-clarification"
|
|
28
|
+
- If any phases are marked as completed, verify they are actually completed and continue from the next phase.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Pre-Task Assignment Hook
|
|
2
|
+
|
|
3
|
+
This hook executes before task assignment to determine the most appropriate agent for each task based on skill requirements and available sub-agents.
|
|
4
|
+
|
|
5
|
+
## Agent Selection and Task Assignment
|
|
6
|
+
|
|
7
|
+
- For each task in the current phase:
|
|
8
|
+
- Read task frontmatter to extract the `skills` property (array of technical skills)
|
|
9
|
+
- Analyze task requirements and technical domain from description
|
|
10
|
+
- Match task skills against available sub-agent capabilities
|
|
11
|
+
- Select the most appropriate sub-agent (if any are available). If no sub-agent is appropriate, use the general-purpose one.
|
|
12
|
+
- Consider task-specific requirements from the task document
|
|
13
|
+
|
|
14
|
+
## Available Sub-Agents
|
|
15
|
+
Analyze the sub-agents available in your current assistant's agents directory. If none are available
|
|
16
|
+
or the available ones do not match the task's requirements, then use a generic
|
|
17
|
+
agent.
|
|
18
|
+
|
|
19
|
+
## Matching Criteria
|
|
20
|
+
Select agents based on:
|
|
21
|
+
1. **Primary skill match**: Task technical requirements from the `skills` array in task frontmatter
|
|
22
|
+
2. **Domain expertise**: Specific frameworks or libraries mentioned in task descriptions
|
|
23
|
+
3. **Task complexity**: Senior vs. junior agent capabilities
|
|
24
|
+
4. **Resource efficiency**: Avoid over-provisioning for simple tasks
|
|
25
|
+
|
|
26
|
+
## Skills Extraction and Agent Detection
|
|
27
|
+
|
|
28
|
+
Read task skills and select appropriate task-specific agent:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Extract skills from task frontmatter
|
|
32
|
+
TASK_SKILLS=$(awk '
|
|
33
|
+
/^---$/ { if (++delim == 2) exit }
|
|
34
|
+
/^skills:/ {
|
|
35
|
+
in_skills = 1
|
|
36
|
+
# Check if skills are on the same line
|
|
37
|
+
if (match($0, /\[.*\]/)) {
|
|
38
|
+
gsub(/^skills:[ \t]*\[/, "")
|
|
39
|
+
gsub(/\].*$/, "")
|
|
40
|
+
gsub(/[ \t]/, "")
|
|
41
|
+
print
|
|
42
|
+
in_skills = 0
|
|
43
|
+
}
|
|
44
|
+
next
|
|
45
|
+
}
|
|
46
|
+
in_skills && /^[^ ]/ { in_skills = 0 }
|
|
47
|
+
in_skills && /^[ \t]*-/ {
|
|
48
|
+
gsub(/^[ \t]*-[ \t]*/, "")
|
|
49
|
+
gsub(/^"/, ""); gsub(/"$/, "")
|
|
50
|
+
print
|
|
51
|
+
}
|
|
52
|
+
' "$TASK_FILE" | tr ',' '\n' | sed 's/^[ \t]*//;s/[ \t]*$//' | grep -v '^$')
|
|
53
|
+
|
|
54
|
+
echo "Task skills required: $TASK_SKILLS"
|
|
55
|
+
|
|
56
|
+
# Check for available sub-agents across assistant directories
|
|
57
|
+
AGENT_FOUND=false
|
|
58
|
+
for assistant_dir in .claude .gemini .opencode; do
|
|
59
|
+
if [ -d "$assistant_dir/agents" ] && [ -n "$(ls $assistant_dir/agents 2>/dev/null)" ]; then
|
|
60
|
+
echo "Available sub-agents detected in $assistant_dir - will match to task requirements"
|
|
61
|
+
AGENT_FOUND=true
|
|
62
|
+
break
|
|
63
|
+
fi
|
|
64
|
+
done
|
|
65
|
+
|
|
66
|
+
if [ "$AGENT_FOUND" = false ]; then
|
|
67
|
+
echo "Using general-purpose agent for task execution"
|
|
68
|
+
fi
|
|
69
|
+
```
|
|
@@ -29,32 +29,7 @@ Use your internal Todo task tool to track the plan generation. Example:
|
|
|
29
29
|
- [ ] Plan generation: Risk Considerations
|
|
30
30
|
- [ ] Plan generation: Success Metrics
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
Before creating any plan, analyze the user's request for:
|
|
34
|
-
- **Objective**: What is the end goal?
|
|
35
|
-
- **Scope**: What are the boundaries and constraints?
|
|
36
|
-
- **Resources**: What tools, budget, or team are available?
|
|
37
|
-
- **Success Criteria**: How will success be measured?
|
|
38
|
-
- **Dependencies**: What prerequisites or blockers exist?
|
|
39
|
-
- **Technical Requirements**: What technologies or skills are needed?
|
|
40
|
-
|
|
41
|
-
#### Step 2: Clarification Phase
|
|
42
|
-
If any critical context is missing:
|
|
43
|
-
1. Identify specific gaps in the information provided
|
|
44
|
-
2. Ask targeted follow-up questions grouped by category
|
|
45
|
-
3. Wait for user responses before proceeding to planning
|
|
46
|
-
4. Frame questions clearly with examples when helpful
|
|
47
|
-
5. Be extra cautious. Users miss important context very often. Don't hesitate to ask for clarifications.
|
|
48
|
-
|
|
49
|
-
Example clarifying questions:
|
|
50
|
-
- "Q: What is your primary goal with [specific aspect]?"
|
|
51
|
-
- "Q: Do you have any existing [resources/code/infrastructure] I should consider?"
|
|
52
|
-
- "Q: What is your timeline for completing this?"
|
|
53
|
-
- "Q: Are there specific constraints I should account for?"
|
|
54
|
-
- "Q: Do you want me to write tests for this?"
|
|
55
|
-
- "Q: Are there other systems, projects, or modules that perform a similar task?"
|
|
56
|
-
|
|
57
|
-
Try to answer your own questions first by inspecting the codebase, docs, and assistant documents like CLAUDE.md, GEMINI.md, AGENTS.md ...
|
|
32
|
+
Read and execute @.ai/task-manager/config/hooks/POST_PLAN.md
|
|
58
33
|
|
|
59
34
|
#### Step 3: Plan Generation
|
|
60
35
|
Only after confirming sufficient context, create a plan that includes:
|
|
@@ -157,11 +132,25 @@ The schema for this frontmatter is:
|
|
|
157
132
|
|
|
158
133
|
**Auto-generate the next plan ID:**
|
|
159
134
|
```bash
|
|
160
|
-
echo $(($(find .ai/task-manager/{plans,archive} -name "plan
|
|
135
|
+
echo $(($(find .ai/task-manager/{plans,archive} -name "plan-[0-9]*--*.md" 2>/dev/null -exec sh -c 'grep -m1 "^[[:space:]]*id:[[:space:]]*[0-9][0-9]*[[:space:]]*$" "$1" 2>/dev/null || echo "id: 0"' _ {} \; | sed -E "s/^[[:space:]]*id:[[:space:]]*([0-9]+)[[:space:]]*$/\1/" | awk 'BEGIN{max=0} {if($1+0>max) max=$1+0} END{print max}') + 1))
|
|
161
136
|
```
|
|
162
137
|
|
|
163
138
|
**Key formatting:**
|
|
164
139
|
- **Front-matter**: Use numeric values (`id: 7`)
|
|
165
140
|
- **Directory names**: Use zero-padded strings (`07--plan-name`)
|
|
166
141
|
|
|
167
|
-
This command
|
|
142
|
+
This enhanced command provides robust plan ID generation with comprehensive error handling:
|
|
143
|
+
|
|
144
|
+
**Features:**
|
|
145
|
+
- **Flexible Whitespace Handling**: Supports various patterns: `id: 5`, `id:5`, `id: 15`, `id: 25` (tabs)
|
|
146
|
+
- **Validation Layer**: Only processes files with valid numeric ID fields in YAML frontmatter
|
|
147
|
+
- **Error Resilience**: Gracefully handles empty directories, corrupted files, and parsing failures
|
|
148
|
+
- **Fallback Logic**: Returns ID 1 when no valid plans found, ensuring command never fails
|
|
149
|
+
- **Robust Parsing**: Uses POSIX character classes for reliable whitespace matching across systems
|
|
150
|
+
|
|
151
|
+
**Handles Edge Cases:**
|
|
152
|
+
- Empty plans/archive directories → Returns 1
|
|
153
|
+
- Corrupted or malformed YAML frontmatter → Skips invalid files
|
|
154
|
+
- Non-numeric ID values → Filters out automatically
|
|
155
|
+
- Missing frontmatter → Ignored safely
|
|
156
|
+
- File system errors → Suppressed with 2>/dev/null
|
|
@@ -37,36 +37,16 @@ Use your internal Todo task tool to track the execution of all phases, and the f
|
|
|
37
37
|
|
|
38
38
|
### Phase Pre-Execution
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
If there are unstaged changes in the `main` branch, do not create a feature branch.
|
|
40
|
+
Read and execute @.ai/task-manager/config/hooks/PRE_PHASE.md
|
|
43
41
|
|
|
44
42
|
### Phase Execution Workflow
|
|
45
43
|
|
|
46
44
|
1. **Phase Initialization**
|
|
47
45
|
- Identify current phase from the execution blueprint
|
|
48
46
|
- List all tasks scheduled for parallel execution in this phase
|
|
49
|
-
- **Validate Task Dependencies**: For each task in the current phase, use the dependency checking script:
|
|
50
|
-
```bash
|
|
51
|
-
# For each task in current phase
|
|
52
|
-
for TASK_ID in $PHASE_TASKS; do
|
|
53
|
-
if ! node .ai/task-manager/config/scripts/check-task-dependencies.js "$1" "$TASK_ID"; then
|
|
54
|
-
echo "ERROR: Task $TASK_ID has unresolved dependencies - cannot proceed with phase execution"
|
|
55
|
-
echo "Please resolve dependencies before continuing with blueprint execution"
|
|
56
|
-
exit 1
|
|
57
|
-
fi
|
|
58
|
-
done
|
|
59
|
-
```
|
|
60
|
-
- Confirm no tasks are marked "needs-clarification"
|
|
61
|
-
- If any phases are marked as completed, verify they are actually completed and continue from the next phase.
|
|
62
47
|
|
|
63
48
|
2. **Agent Selection and Task Assignment**
|
|
64
|
-
|
|
65
|
-
- Read task frontmatter to extract the `skills` property (array of technical skills)
|
|
66
|
-
- Analyze task requirements and technical domain from description
|
|
67
|
-
- Match task skills against available sub-agent capabilities
|
|
68
|
-
- Select the most appropriate sub-agent (if any are available). If no sub-agent is appropriate, use the general-purpose one.
|
|
69
|
-
- Consider task-specific requirements from the task document
|
|
49
|
+
Read and execute @.ai/task-manager/config/hooks/PRE_TASK_ASSIGNMENT.md
|
|
70
50
|
|
|
71
51
|
3. **Parallel Execution**
|
|
72
52
|
- Deploy all selected agents simultaneously using your internal Task tool
|
|
@@ -90,20 +70,6 @@ If there are unstaged changes in the `main` branch, do not create a feature bran
|
|
|
90
70
|
- Initialize next phase
|
|
91
71
|
- Repeat process until all phases are complete
|
|
92
72
|
|
|
93
|
-
### Agent Selection Guidelines
|
|
94
|
-
|
|
95
|
-
#### Available Sub-Agents
|
|
96
|
-
Analyze the sub-agents available in your current assistant's agents directory. If none are available
|
|
97
|
-
or the available ones do not match the task's requirements, then use a generic
|
|
98
|
-
agent.
|
|
99
|
-
|
|
100
|
-
#### Matching Criteria
|
|
101
|
-
Select agents based on:
|
|
102
|
-
1. **Primary skill match**: Task technical requirements from the `skills` array in task frontmatter
|
|
103
|
-
2. **Domain expertise**: Specific frameworks or libraries mentioned in task descriptions
|
|
104
|
-
3. **Task complexity**: Senior vs. junior agent capabilities
|
|
105
|
-
4. **Resource efficiency**: Avoid over-provisioning for simple tasks
|
|
106
|
-
|
|
107
73
|
### Execution Monitoring
|
|
108
74
|
|
|
109
75
|
#### Progress Tracking
|
|
@@ -124,13 +90,7 @@ Valid status transitions:
|
|
|
124
90
|
### Error Handling
|
|
125
91
|
|
|
126
92
|
#### Validation Gate Failures
|
|
127
|
-
|
|
128
|
-
1. Document which specific validations failed
|
|
129
|
-
2. Identify which tasks may have caused the failure
|
|
130
|
-
3. Generate remediation plan
|
|
131
|
-
4. Re-execute affected tasks after fixes
|
|
132
|
-
5. Re-run validation gates
|
|
133
|
-
6. If errors persist, escalate to the user
|
|
93
|
+
Read and execute @.ai/task-manager/config/hooks/POST_ERROR_DETECTION.md
|
|
134
94
|
|
|
135
95
|
### Output Requirements
|
|
136
96
|
|
|
@@ -150,44 +150,7 @@ echo "✓ All dependencies resolved - proceeding with execution"
|
|
|
150
150
|
Read task skills and select appropriate task-specific agent:
|
|
151
151
|
|
|
152
152
|
```bash
|
|
153
|
-
|
|
154
|
-
TASK_SKILLS=$(awk '
|
|
155
|
-
/^---$/ { if (++delim == 2) exit }
|
|
156
|
-
/^skills:/ {
|
|
157
|
-
in_skills = 1
|
|
158
|
-
# Check if skills are on the same line
|
|
159
|
-
if (match($0, /\[.*\]/)) {
|
|
160
|
-
gsub(/^skills:[ \t]*\[/, "")
|
|
161
|
-
gsub(/\].*$/, "")
|
|
162
|
-
gsub(/[ \t]/, "")
|
|
163
|
-
print
|
|
164
|
-
in_skills = 0
|
|
165
|
-
}
|
|
166
|
-
next
|
|
167
|
-
}
|
|
168
|
-
in_skills && /^[^ ]/ { in_skills = 0 }
|
|
169
|
-
in_skills && /^[ \t]*-/ {
|
|
170
|
-
gsub(/^[ \t]*-[ \t]*/, "")
|
|
171
|
-
gsub(/^"/, ""); gsub(/"$/, "")
|
|
172
|
-
print
|
|
173
|
-
}
|
|
174
|
-
' "$TASK_FILE" | tr ',' '\n' | sed 's/^[ \t]*//;s/[ \t]*$//' | grep -v '^$')
|
|
175
|
-
|
|
176
|
-
echo "Task skills required: $TASK_SKILLS"
|
|
177
|
-
|
|
178
|
-
# Check for available sub-agents across assistant directories
|
|
179
|
-
AGENT_FOUND=false
|
|
180
|
-
for assistant_dir in .claude .gemini .opencode; do
|
|
181
|
-
if [ -d "$assistant_dir/agents" ] && [ -n "$(ls $assistant_dir/agents 2>/dev/null)" ]; then
|
|
182
|
-
echo "Available sub-agents detected in $assistant_dir - will match to task requirements"
|
|
183
|
-
AGENT_FOUND=true
|
|
184
|
-
break
|
|
185
|
-
fi
|
|
186
|
-
done
|
|
187
|
-
|
|
188
|
-
if [ "$AGENT_FOUND" = false ]; then
|
|
189
|
-
echo "Using general-purpose agent for task execution"
|
|
190
|
-
fi
|
|
153
|
+
Read and execute @.ai/task-manager/config/hooks/PRE_TASK_ASSIGNMENT.md
|
|
191
154
|
```
|
|
192
155
|
|
|
193
156
|
### 6. Status Update to In-Progress
|
|
@@ -271,37 +234,7 @@ echo "You can now execute dependent tasks or continue with the full blueprint ex
|
|
|
271
234
|
|
|
272
235
|
## Error Handling
|
|
273
236
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
```bash
|
|
277
|
-
# On execution failure, update status to failed
|
|
278
|
-
echo "Task execution failed - updating status..."
|
|
279
|
-
|
|
280
|
-
TEMP_FILE=$(mktemp)
|
|
281
|
-
awk '
|
|
282
|
-
/^---$/ {
|
|
283
|
-
if (++delim == 1) {
|
|
284
|
-
print
|
|
285
|
-
next
|
|
286
|
-
} else if (delim == 2) {
|
|
287
|
-
print "status: \"failed\""
|
|
288
|
-
print
|
|
289
|
-
next
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
/^status:/ && delim == 1 {
|
|
293
|
-
print "status: \"failed\""
|
|
294
|
-
next
|
|
295
|
-
}
|
|
296
|
-
{ print }
|
|
297
|
-
' "$TASK_FILE" > "$TEMP_FILE"
|
|
298
|
-
|
|
299
|
-
mv "$TEMP_FILE" "$TASK_FILE"
|
|
300
|
-
|
|
301
|
-
echo "Task ${TASK_ID} marked as failed"
|
|
302
|
-
echo "Check the task requirements and try again"
|
|
303
|
-
exit 1
|
|
304
|
-
```
|
|
237
|
+
Read and execute @.ai/task-manager/config/hooks/POST_ERROR_DETECTION.md
|
|
305
238
|
|
|
306
239
|
## Usage Examples
|
|
307
240
|
|
|
@@ -220,15 +220,15 @@ When creating tasks, you need to determine the next available task ID for the sp
|
|
|
220
220
|
|
|
221
221
|
#### Command
|
|
222
222
|
```bash
|
|
223
|
-
PLAN_ID=$1; echo $(($(find .ai/task-manager/plans/$(printf "%02d" $PLAN_ID)--*/tasks -name "*.md" -exec grep "^id:" {} \; 2>/dev/null | sed 's
|
|
223
|
+
PLAN_ID=$1; echo $(($(find .ai/task-manager/plans/$(printf "%02d" $PLAN_ID)--*/tasks -name "*.md" -exec grep "^id: *[0-9][0-9]* *$" {} \; 2>/dev/null | sed 's/.*id: *//' | sed 's/ *$//' | sort -n | tail -1 | sed 's/^$/0/') + 1))
|
|
224
224
|
```
|
|
225
225
|
|
|
226
226
|
#### How It Works
|
|
227
227
|
1. **Finds task files** using the pattern `*.md` in the specific plan's tasks directory
|
|
228
|
-
2. **
|
|
229
|
-
3. **Strips the `id:` prefix** using sed to get numeric values only
|
|
228
|
+
2. **Validates and extracts front-matter IDs** using grep to find `id:` lines with valid numeric values, filtering out malformed or string IDs
|
|
229
|
+
3. **Strips the `id:` prefix and whitespace** using sed to get clean numeric values only
|
|
230
230
|
4. **Sorts numerically** to find the highest existing task ID
|
|
231
|
-
5. **Handles empty results** by defaulting to 0 if no tasks exist
|
|
231
|
+
5. **Handles empty results** by defaulting to 0 if no valid tasks exist
|
|
232
232
|
6. **Adds 1** to get the next available task ID
|
|
233
233
|
|
|
234
234
|
This command reads the actual `id:` values from task front-matter, making it the definitive source of truth.
|
|
@@ -249,8 +249,8 @@ This command reads the actual `id:` values from task front-matter, making it the
|
|
|
249
249
|
**Example 1: Plan 6 with existing tasks**
|
|
250
250
|
```bash
|
|
251
251
|
# Command execution (plan ID = 6)
|
|
252
|
-
PLAN_ID=6; echo $(($(find .ai/task-manager/plans/$(printf "%02d" $PLAN_ID)--*/tasks -name "*.md" -exec grep "^id:" {} \; 2>/dev/null | sed 's
|
|
253
|
-
# Output: 5 (if highest task front-matter has id: 4)
|
|
252
|
+
PLAN_ID=6; echo $(($(find .ai/task-manager/plans/$(printf "%02d" $PLAN_ID)--*/tasks -name "*.md" -exec grep "^id: *[0-9][0-9]* *$" {} \; 2>/dev/null | sed 's/.*id: *//' | sed 's/ *$//' | sort -n | tail -1 | sed 's/^$/0/') + 1))
|
|
253
|
+
# Output: 5 (if highest valid numeric task front-matter has id: 4)
|
|
254
254
|
|
|
255
255
|
# Front-matter usage:
|
|
256
256
|
---
|
|
@@ -266,8 +266,8 @@ skills: ["api-endpoints", "database"]
|
|
|
266
266
|
**Example 2: Plan 1 with no existing tasks**
|
|
267
267
|
```bash
|
|
268
268
|
# Command execution (plan ID = 1)
|
|
269
|
-
PLAN_ID=1; echo $(($(find .ai/task-manager/plans/$(printf "%02d" $PLAN_ID)--*/tasks -name "*.md" -exec grep "^id:" {} \; 2>/dev/null | sed 's
|
|
270
|
-
# Output: 1 (empty tasks directory, no front-matter to read)
|
|
269
|
+
PLAN_ID=1; echo $(($(find .ai/task-manager/plans/$(printf "%02d" $PLAN_ID)--*/tasks -name "*.md" -exec grep "^id: *[0-9][0-9]* *$" {} \; 2>/dev/null | sed 's/.*id: *//' | sed 's/ *$//' | sort -n | tail -1 | sed 's/^$/0/') + 1))
|
|
270
|
+
# Output: 1 (empty tasks directory, no valid front-matter to read)
|
|
271
271
|
|
|
272
272
|
# Front-matter usage:
|
|
273
273
|
---
|
|
@@ -286,6 +286,8 @@ The command handles several edge cases automatically:
|
|
|
286
286
|
- **Non-sequential task IDs**: Returns the maximum existing ID + 1
|
|
287
287
|
- **Missing plan directory**: Returns `1` (graceful fallback)
|
|
288
288
|
- **Mixed numbering**: Correctly finds the highest numeric ID regardless of gaps
|
|
289
|
+
- **Malformed frontmatter**: Skips files with non-numeric, string, or missing ID fields
|
|
290
|
+
- **Whitespace variations**: Handles extra spaces around ID values (e.g., `id: 5 `)
|
|
289
291
|
|
|
290
292
|
#### Command Execution Context
|
|
291
293
|
- Run this command from the repository root directory
|
|
@@ -348,106 +350,4 @@ If the plan lacks sufficient detail:
|
|
|
348
350
|
- Create placeholder tasks marked with `status: "needs-clarification"`
|
|
349
351
|
- Document assumptions made
|
|
350
352
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
After creating all tasks with their dependencies, update the original plan document with two critical sections: a task dependency visualization and a phase-based execution blueprint.
|
|
354
|
-
|
|
355
|
-
### Section 1: Dependency Visualization
|
|
356
|
-
|
|
357
|
-
If any tasks have dependencies, create a Mermaid diagram showing the dependency graph:
|
|
358
|
-
|
|
359
|
-
```mermaid
|
|
360
|
-
graph TD
|
|
361
|
-
001[Task 001: Database Schema] --> 002[Task 002: API Endpoints]
|
|
362
|
-
001 --> 003[Task 003: Data Models]
|
|
363
|
-
002 --> 004[Task 004: Frontend Integration]
|
|
364
|
-
003 --> 004
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
Note: Ensure the graph is acyclic (no circular dependencies).
|
|
368
|
-
|
|
369
|
-
### Section 2: Phase-Based Execution Blueprint
|
|
370
|
-
|
|
371
|
-
#### Core Concept
|
|
372
|
-
The execution blueprint organizes tasks into sequential phases where:
|
|
373
|
-
- **Within a phase**: All tasks execute in parallel
|
|
374
|
-
- **Between phases**: Execution is strictly sequential
|
|
375
|
-
- **Phase progression**: Requires all tasks in current phase to complete AND validation gates to pass
|
|
376
|
-
|
|
377
|
-
#### Phase Definition Rules
|
|
378
|
-
1. **Phase 1**: Contains all tasks with zero dependencies
|
|
379
|
-
2. **Phase N**: Contains tasks whose dependencies are ALL satisfied by tasks in phases 1 through N-1
|
|
380
|
-
3. **Parallelism Priority**: Maximize the number of tasks that can run simultaneously in each phase
|
|
381
|
-
4. **Completeness**: Every task must be assigned to exactly one phase
|
|
382
|
-
|
|
383
|
-
#### Blueprint Structure
|
|
384
|
-
|
|
385
|
-
```markdown
|
|
386
|
-
## Execution Blueprint
|
|
387
|
-
|
|
388
|
-
**Validation Gates:**
|
|
389
|
-
- Reference: `@.ai/task-manager/config/hooks/POST_PHASE.md`
|
|
390
|
-
|
|
391
|
-
### Phase 1: [Descriptive Phase Name]
|
|
392
|
-
**Parallel Tasks:**
|
|
393
|
-
- Task 001: [Description]
|
|
394
|
-
- Task 005: [Description]
|
|
395
|
-
- Task 009: [Description]
|
|
396
|
-
|
|
397
|
-
### Phase 2: [Descriptive Phase Name]
|
|
398
|
-
**Parallel Tasks:**
|
|
399
|
-
- Task 002: [Description] (depends on: 001)
|
|
400
|
-
- Task 003: [Description] (depends on: 001)
|
|
401
|
-
- Task 006: [Description] (depends on: 005)
|
|
402
|
-
|
|
403
|
-
[Continue for all phases...]
|
|
404
|
-
|
|
405
|
-
### Post-phase Actions
|
|
406
|
-
|
|
407
|
-
### Execution Summary
|
|
408
|
-
- Total Phases: X
|
|
409
|
-
- Total Tasks: Y
|
|
410
|
-
- Maximum Parallelism: Z tasks (in Phase N)
|
|
411
|
-
- Critical Path Length: X phases
|
|
412
|
-
```
|
|
413
|
-
|
|
414
|
-
### Validation Requirements
|
|
415
|
-
|
|
416
|
-
#### Phase Transition Rules
|
|
417
|
-
1. All tasks in the current phase must have status: "completed"
|
|
418
|
-
2. All validation gates defined in `@.ai/task-manager/config/hooks/POST_PHASE.md` for the current phase must pass
|
|
419
|
-
3. No task in a future phase can begin until these conditions are met
|
|
420
|
-
|
|
421
|
-
#### Blueprint Verification
|
|
422
|
-
Before finalizing, ensure:
|
|
423
|
-
- [ ] Every task appears in exactly one phase
|
|
424
|
-
- [ ] No task appears in a phase before all its dependencies
|
|
425
|
-
- [ ] Phase 1 contains only tasks with no dependencies
|
|
426
|
-
- [ ] Each phase maximizes parallel execution opportunities
|
|
427
|
-
- [ ] All phases reference their validation gates
|
|
428
|
-
- [ ] The execution summary accurately reflects the blueprint
|
|
429
|
-
|
|
430
|
-
### Important Notes
|
|
431
|
-
|
|
432
|
-
#### Parallel Execution
|
|
433
|
-
- Tasks within a phase have no interdependencies and can run simultaneously
|
|
434
|
-
- This enables efficient resource utilization and faster completion
|
|
435
|
-
- AI agents can be assigned to multiple tasks within the same phase
|
|
436
|
-
|
|
437
|
-
#### Sequential Phases
|
|
438
|
-
- Phases execute in strict numerical order
|
|
439
|
-
- Phase N+1 cannot begin until Phase N is fully complete and validated
|
|
440
|
-
- This ensures dependency integrity and systematic progress
|
|
441
|
-
-
|
|
442
|
-
|
|
443
|
-
#### Validation Gates
|
|
444
|
-
- Each phase has associated validation criteria defined externally
|
|
445
|
-
- Gates ensure quality and correctness before progression
|
|
446
|
-
- Failed validations require task remediation before phase completion
|
|
447
|
-
|
|
448
|
-
### Error Handling
|
|
449
|
-
|
|
450
|
-
If dependency analysis reveals issues:
|
|
451
|
-
- **Circular dependencies**: Document the cycle and mark affected tasks for review
|
|
452
|
-
- **Orphaned tasks**: Tasks that cannot be scheduled due to missing dependencies
|
|
453
|
-
- **Ambiguous dependencies**: Note assumptions made and flag for clarification
|
|
353
|
+
Read and execute @.ai/task-manager/config/hooks/POST_PLAN.md
|