@e0ipso/ai-task-manager 1.0.1
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/LICENSE +68 -0
- package/README.md +128 -0
- package/dist/cli.d.ts +9 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +90 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +219 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +66 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +184 -0
- package/dist/logger.js.map +1 -0
- package/dist/types.d.ts +256 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +62 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +210 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +553 -0
- package/dist/utils.js.map +1 -0
- package/package.json +86 -0
- package/templates/ai-task-manager/TASK_MANAGER_INFO.md +54 -0
- package/templates/ai-task-manager/VALIDATION_GATES.md +5 -0
- package/templates/commands/tasks/create-plan.md +142 -0
- package/templates/commands/tasks/create-plan.toml +72 -0
- package/templates/commands/tasks/execute-blueprint.md +163 -0
- package/templates/commands/tasks/execute-blueprint.toml +156 -0
- package/templates/commands/tasks/generate-tasks.md +466 -0
- package/templates/commands/tasks/generate-tasks.toml +220 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Task Manager General Information
|
|
2
|
+
|
|
3
|
+
This document contains important information that is common to all the /task:*
|
|
4
|
+
commands for Claude Code.
|
|
5
|
+
|
|
6
|
+
## Types of Documents
|
|
7
|
+
|
|
8
|
+
Work orders (abbreviated as WO) are complex prompts for programming,
|
|
9
|
+
organizational, or management tasks created by a user. Work orders are
|
|
10
|
+
independent of each other and cannot share any context. By definition
|
|
11
|
+
different work orders can be worked on independently.
|
|
12
|
+
|
|
13
|
+
Each work order has plan associated to it. The plan is a comprehensive document
|
|
14
|
+
highlighting all the aspects of the work necessary to accomplish the goals from
|
|
15
|
+
the work order.
|
|
16
|
+
|
|
17
|
+
Each plan will be broken into tasks. Each task is a logical unit of work that
|
|
18
|
+
has a single purpose, and is solved using a single skill. All tasks exist as
|
|
19
|
+
part of a plan. Tasks can have dependencies on other tasks. This happens when a
|
|
20
|
+
task cannot be worked on (or completed) before some other task(s) are completed.
|
|
21
|
+
|
|
22
|
+
## Directory Structure
|
|
23
|
+
|
|
24
|
+
To find a plan document from its ID use the following command (replace {planId} with the ID, like 06):
|
|
25
|
+
```shell
|
|
26
|
+
find . -name "plan-[0-9][0-9]*--*.md" -type f -exec grep -l "^id: \?{planId}$" {} \;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Plans, and tasks are stored as MarkDown files with a YAML front-matter. They are
|
|
30
|
+
all filed under the `.ai/task-manager/` folder at the root of the repository.
|
|
31
|
+
|
|
32
|
+
Plans are organized as follows:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
.ai/
|
|
36
|
+
task-manager/
|
|
37
|
+
plans/
|
|
38
|
+
01--authentication-provider/
|
|
39
|
+
plan-01--authentication-provider.md
|
|
40
|
+
tasks/
|
|
41
|
+
01--create-project-structure.md
|
|
42
|
+
02--implement-authorization.md
|
|
43
|
+
03--this-example-task.md
|
|
44
|
+
04--create-tests.md
|
|
45
|
+
05--update-documentation.md
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Note how in the `.ai/task-manager/plans/` folder we have a sub-folder per plan.
|
|
49
|
+
Each sub-folder will contain the plan document and has a name following a naming
|
|
50
|
+
pattern `[ID]--[plan-short-name]`. Where the ID is auto-incremental. The plan
|
|
51
|
+
document has a name following the pattern `plan-[ID]--[plan-short-name].md`.
|
|
52
|
+
Finally, all tasks are under a `tasks` sub-folder. Each task has a name
|
|
53
|
+
according to the pattern `[incremental-ID]--[task-short-name].md`. IDs for tasks
|
|
54
|
+
are auto-incremental within a plan. Each plan starts their tasks' IDs from 01.
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
argument-hint: [user-prompt]
|
|
3
|
+
description: Create a comprehensive plan to accomplish the request from the user.
|
|
4
|
+
---
|
|
5
|
+
# Comprehensive Plan Creation
|
|
6
|
+
|
|
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
|
+
|
|
9
|
+
Include @.ai/task-manager/TASK_MANAGER_INFO.md for the directory structure of tasks.
|
|
10
|
+
|
|
11
|
+
## Instructions
|
|
12
|
+
|
|
13
|
+
The user input is:
|
|
14
|
+
|
|
15
|
+
<user-input>
|
|
16
|
+
$ARGUMENTS
|
|
17
|
+
</user-input>
|
|
18
|
+
|
|
19
|
+
If no user input is provided stop immediately and show an error message to the user:
|
|
20
|
+
|
|
21
|
+
### Process
|
|
22
|
+
|
|
23
|
+
#### Step 1: Context Analysis
|
|
24
|
+
Before creating any plan, analyze the user's request for:
|
|
25
|
+
- **Objective**: What is the end goal?
|
|
26
|
+
- **Scope**: What are the boundaries and constraints?
|
|
27
|
+
- **Resources**: What tools, budget, or team are available?
|
|
28
|
+
- **Success Criteria**: How will success be measured?
|
|
29
|
+
- **Dependencies**: What prerequisites or blockers exist?
|
|
30
|
+
- **Technical Requirements**: What technologies or skills are needed?
|
|
31
|
+
|
|
32
|
+
#### Step 2: Clarification Phase
|
|
33
|
+
If any critical context is missing:
|
|
34
|
+
1. Identify specific gaps in the information provided
|
|
35
|
+
2. Ask targeted follow-up questions grouped by category
|
|
36
|
+
3. Wait for user responses before proceeding to planning
|
|
37
|
+
4. Frame questions clearly with examples when helpful
|
|
38
|
+
|
|
39
|
+
Example clarifying questions:
|
|
40
|
+
- "What is your primary goal with [specific aspect]?"
|
|
41
|
+
- "Do you have any existing [resources/code/infrastructure] I should consider?"
|
|
42
|
+
- "What is your timeline for completing this?"
|
|
43
|
+
- "Are there specific constraints I should account for?"
|
|
44
|
+
|
|
45
|
+
#### Step 3: Plan Generation
|
|
46
|
+
Only after confirming sufficient context, create a plan that includes:
|
|
47
|
+
1. **Executive Summary**: Brief overview of the approach
|
|
48
|
+
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
|
|
53
|
+
|
|
54
|
+
### Output Format
|
|
55
|
+
Structure your response as follows:
|
|
56
|
+
- 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.
|
|
58
|
+
|
|
59
|
+
#### Frontmatter Structure
|
|
60
|
+
|
|
61
|
+
Example:
|
|
62
|
+
```yaml
|
|
63
|
+
---
|
|
64
|
+
id: 1
|
|
65
|
+
summary: "Implement a comprehensive CI/CD pipeline using GitHub Actions for automated linting, testing, semantic versioning, and NPM publishing"
|
|
66
|
+
created: 2025-09-01
|
|
67
|
+
---
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The schema for this frontmatter is:
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"type": "object",
|
|
74
|
+
"required": ["id", "summary", "created"],
|
|
75
|
+
"properties": {
|
|
76
|
+
"id": {
|
|
77
|
+
"type": ["number"],
|
|
78
|
+
"description": "Unique identifier for the task. An integer."
|
|
79
|
+
},
|
|
80
|
+
"summary": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"description": "A summary of the plan"
|
|
83
|
+
},
|
|
84
|
+
"created": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
|
|
87
|
+
"description": "Creation date in YYYY-MM-DD format"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"additionalProperties": false
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Plan ID Generation
|
|
95
|
+
|
|
96
|
+
**Auto-generate the next plan ID:**
|
|
97
|
+
```bash
|
|
98
|
+
echo $(($(find .ai/task-manager/plans -name "plan-*.md" -exec grep "^id:" {} \; | sed 's/id: *//' | sort -n | tail -1 | sed 's/^$/0/') + 1))
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Key formatting:**
|
|
102
|
+
- **Front-matter**: Use numeric values (`id: 7`)
|
|
103
|
+
- **Directory names**: Use zero-padded strings (`07--plan-name`)
|
|
104
|
+
|
|
105
|
+
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.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
description = "Create a comprehensive plan to accomplish the request from the user."
|
|
2
|
+
prompt = """
|
|
3
|
+
# Comprehensive Plan Creation
|
|
4
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
Include @.ai/task-manager/TASK_MANAGER_INFO.md for the directory structure of tasks.
|
|
8
|
+
|
|
9
|
+
## Instructions
|
|
10
|
+
|
|
11
|
+
The user input is:
|
|
12
|
+
|
|
13
|
+
<user-input>
|
|
14
|
+
{{args}}
|
|
15
|
+
</user-input>
|
|
16
|
+
|
|
17
|
+
If no user input is provided stop immediately and show an error message to the user:
|
|
18
|
+
|
|
19
|
+
### Process
|
|
20
|
+
|
|
21
|
+
#### Step 1: Context Analysis
|
|
22
|
+
Before creating any plan, analyze the user's request for:
|
|
23
|
+
- **Objective**: What is the end goal?
|
|
24
|
+
- **Scope**: What are the boundaries and constraints?
|
|
25
|
+
- **Resources**: What tools, budget, or team are available?
|
|
26
|
+
- **Success Criteria**: How will success be measured?
|
|
27
|
+
- **Dependencies**: What prerequisites or blockers exist?
|
|
28
|
+
- **Technical Requirements**: What technologies or skills are needed?
|
|
29
|
+
|
|
30
|
+
#### Step 2: Clarification Phase
|
|
31
|
+
If any critical context is missing:
|
|
32
|
+
1. Identify specific gaps in the information provided
|
|
33
|
+
2. Ask targeted follow-up questions grouped by category
|
|
34
|
+
3. Wait for user responses before proceeding to planning
|
|
35
|
+
4. Frame questions clearly with examples when helpful
|
|
36
|
+
|
|
37
|
+
Example clarifying questions:
|
|
38
|
+
- "What is your primary goal with [specific aspect]?"
|
|
39
|
+
- "Do you have any existing [resources/code/infrastructure] I should consider?"
|
|
40
|
+
- "What is your timeline for completing this?"
|
|
41
|
+
- "Are there specific constraints I should account for?"
|
|
42
|
+
|
|
43
|
+
#### Step 3: Plan Generation
|
|
44
|
+
Only after confirming sufficient context, create a plan that includes:
|
|
45
|
+
1. **Executive Summary**: Brief overview of the approach
|
|
46
|
+
2. **Detailed Steps**: Numbered, actionable tasks with clear outcomes
|
|
47
|
+
3. **Implementation Order**: Logical sequence with dependencies noted
|
|
48
|
+
4. **Risk Considerations**: Potential challenges and mitigation strategies
|
|
49
|
+
5. **Success Metrics**: How to measure completion and quality
|
|
50
|
+
6. **Resource Requirements**: Tools, skills, or assets needed for each step
|
|
51
|
+
|
|
52
|
+
### Output Format
|
|
53
|
+
Structure your response as follows:
|
|
54
|
+
- If context is insufficient: List specific clarifying questions
|
|
55
|
+
- 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.
|
|
56
|
+
|
|
57
|
+
#### Frontmatter Structure
|
|
58
|
+
```yaml
|
|
59
|
+
---
|
|
60
|
+
id: 01
|
|
61
|
+
summary: "Implement a comprehensive CI/CD pipeline using GitHub Actions for automated linting, testing, semantic versioning, and NPM publishing"
|
|
62
|
+
created: 2025-09-01
|
|
63
|
+
---
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Important Notes
|
|
67
|
+
- Never generate a partial or assumed plan without adequate context
|
|
68
|
+
- Prioritize accuracy over speed
|
|
69
|
+
- Consider both technical and non-technical aspects
|
|
70
|
+
- Adapt the plan format based on the task type (development, design, research, etc.)
|
|
71
|
+
- 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).
|
|
72
|
+
"""
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
---
|
|
2
|
+
argument-hint: [plan-ID]
|
|
3
|
+
description: Execute the task in the plan
|
|
4
|
+
---
|
|
5
|
+
# Task Execution
|
|
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.
|
|
8
|
+
|
|
9
|
+
## 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
|
|
11
|
+
- Task files with frontmatter metadata (id, group, dependencies, status)
|
|
12
|
+
- Validation gates document: `@.ai/task-manager/VALIDATION_GATES.md`
|
|
13
|
+
|
|
14
|
+
### Input Error Handling
|
|
15
|
+
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.
|
|
16
|
+
|
|
17
|
+
## Execution Process
|
|
18
|
+
|
|
19
|
+
### Phase Pre-Execution
|
|
20
|
+
|
|
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.
|
|
22
|
+
|
|
23
|
+
### Phase Execution Workflow
|
|
24
|
+
|
|
25
|
+
1. **Phase Initialization**
|
|
26
|
+
- Identify current phase from the execution blueprint
|
|
27
|
+
- List all tasks scheduled for parallel execution in this phase
|
|
28
|
+
- Verify all task dependencies from previous phases are marked "completed"
|
|
29
|
+
- Confirm no tasks are marked "needs-clarification"
|
|
30
|
+
- If any phases are marked as completed, verify they are actually completed and continue from the next phase.
|
|
31
|
+
|
|
32
|
+
2. **Agent Selection and Task Assignment**
|
|
33
|
+
- For each task in the current phase:
|
|
34
|
+
- Read task frontmatter to extract the `skills` property (array of technical skills)
|
|
35
|
+
- Analyze task requirements and technical domain from description
|
|
36
|
+
- 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.
|
|
38
|
+
- Consider task-specific requirements from the task document
|
|
39
|
+
|
|
40
|
+
3. **Parallel Execution**
|
|
41
|
+
- Deploy all selected agents simultaneously
|
|
42
|
+
- Monitor execution progress for each task
|
|
43
|
+
- Capture outputs and artifacts from each agent
|
|
44
|
+
- Update task status in real-time
|
|
45
|
+
|
|
46
|
+
4. **Phase Completion Verification**
|
|
47
|
+
- Ensure all tasks in the phase have status: "completed"
|
|
48
|
+
- Collect and review all task outputs
|
|
49
|
+
- Document any issues or exceptions encountered
|
|
50
|
+
|
|
51
|
+
5. **Validation Gate Execution**
|
|
52
|
+
- Reference validation criteria from `@.ai/task-manager/VALIDATION_GATES.md`
|
|
53
|
+
- Execute all validation checks for the current phase
|
|
54
|
+
- Document validation results
|
|
55
|
+
- Only proceed if ALL validations pass
|
|
56
|
+
|
|
57
|
+
6. **Phase Transition**
|
|
58
|
+
- Update phase status to "completed"
|
|
59
|
+
- Initialize next phase
|
|
60
|
+
- Repeat process until all phases are complete
|
|
61
|
+
|
|
62
|
+
### Agent Selection Guidelines
|
|
63
|
+
|
|
64
|
+
#### Available Claude Code Sub-Agents
|
|
65
|
+
Analyze the sub-agents available under `.claude/agents`. If none are available
|
|
66
|
+
or the available ones do not match the task's requirements, then use a generic
|
|
67
|
+
agent.
|
|
68
|
+
|
|
69
|
+
#### Matching Criteria
|
|
70
|
+
Select agents based on:
|
|
71
|
+
1. **Primary skill match**: Task technical requirements from the `skills` array in task frontmatter
|
|
72
|
+
2. **Domain expertise**: Specific frameworks or libraries mentioned in task descriptions
|
|
73
|
+
3. **Task complexity**: Senior vs. junior agent capabilities
|
|
74
|
+
4. **Resource efficiency**: Avoid over-provisioning for simple tasks
|
|
75
|
+
|
|
76
|
+
### Execution Monitoring
|
|
77
|
+
|
|
78
|
+
#### Progress Tracking
|
|
79
|
+
|
|
80
|
+
Update the list of tasks from the plan document to add the status of each task
|
|
81
|
+
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
|
|
84
|
+
`completed`.
|
|
85
|
+
|
|
86
|
+
#### Task Status Updates
|
|
87
|
+
Valid status transitions:
|
|
88
|
+
- `pending` → `in-progress` (when agent starts)
|
|
89
|
+
- `in-progress` → `completed` (successful execution)
|
|
90
|
+
- `in-progress` → `failed` (execution error)
|
|
91
|
+
- `failed` → `in-progress` (retry attempt)
|
|
92
|
+
|
|
93
|
+
### Error Handling
|
|
94
|
+
|
|
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
|
+
#### Validation Gate Failures
|
|
115
|
+
If validation gates fail:
|
|
116
|
+
1. Document which specific validations failed
|
|
117
|
+
2. Identify which tasks may have caused the failure
|
|
118
|
+
3. Generate remediation plan
|
|
119
|
+
4. Re-execute affected tasks after fixes
|
|
120
|
+
5. Re-run validation gates
|
|
121
|
+
|
|
122
|
+
### Output Requirements
|
|
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
|
+
## Optimization Guidelines
|
|
159
|
+
|
|
160
|
+
- **Maximize parallelism**: Always run all available tasks in a phase simultaneously
|
|
161
|
+
- **Resource awareness**: Balance agent allocation with system capabilities
|
|
162
|
+
- **Early failure detection**: Monitor tasks actively to catch issues quickly
|
|
163
|
+
- **Continuous improvement**: Note patterns for future blueprint optimization
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
description = "Execute the task in the plan"
|
|
2
|
+
prompt = """
|
|
3
|
+
# Task Execution
|
|
4
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
## Input Requirements
|
|
8
|
+
- A plan document with an execution blueprint section. See @.ai/task-manager/TASK_MANAGER_INFO.md fo find the plan with ID {{args}}
|
|
9
|
+
- Task files with frontmatter metadata (id, group, dependencies, status)
|
|
10
|
+
- Validation gates document: `@.ai/task-manager/VALIDATION_GATES.md`
|
|
11
|
+
|
|
12
|
+
### Input Error Handling
|
|
13
|
+
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.
|
|
14
|
+
|
|
15
|
+
## Execution Process
|
|
16
|
+
|
|
17
|
+
### Phase Execution Workflow
|
|
18
|
+
|
|
19
|
+
1. **Phase Initialization**
|
|
20
|
+
- Identify current phase from the execution blueprint
|
|
21
|
+
- List all tasks scheduled for parallel execution in this phase
|
|
22
|
+
- Verify all task dependencies from previous phases are marked "completed"
|
|
23
|
+
- Confirm no tasks are marked "needs-clarification"
|
|
24
|
+
- If any phases are marked as completed, verify they are actually completed and continue from the next phase.
|
|
25
|
+
|
|
26
|
+
2. **Agent Selection and Task Assignment**
|
|
27
|
+
- For each task in the current phase:
|
|
28
|
+
- Analyze task requirements and technical domain
|
|
29
|
+
- Select the most appropriate Claude Code sub-agent (if any are available). If no sub-agent is appropriate, use the generic one.
|
|
30
|
+
- Consider task-specific requirements from the task document
|
|
31
|
+
|
|
32
|
+
3. **Parallel Execution**
|
|
33
|
+
- Deploy all selected agents simultaneously
|
|
34
|
+
- Monitor execution progress for each task
|
|
35
|
+
- Capture outputs and artifacts from each agent
|
|
36
|
+
- Update task status in real-time
|
|
37
|
+
|
|
38
|
+
4. **Phase Completion Verification**
|
|
39
|
+
- Ensure all tasks in the phase have status: "completed"
|
|
40
|
+
- Collect and review all task outputs
|
|
41
|
+
- Document any issues or exceptions encountered
|
|
42
|
+
|
|
43
|
+
5. **Validation Gate Execution**
|
|
44
|
+
- Reference validation criteria from `@.ai/task-manager/VALIDATION_GATES.md`
|
|
45
|
+
- Execute all validation checks for the current phase
|
|
46
|
+
- Document validation results
|
|
47
|
+
- Only proceed if ALL validations pass
|
|
48
|
+
|
|
49
|
+
6. **Phase Transition**
|
|
50
|
+
- Update phase status to "completed"
|
|
51
|
+
- Initialize next phase
|
|
52
|
+
- Repeat process until all phases are complete
|
|
53
|
+
|
|
54
|
+
### Agent Selection Guidelines
|
|
55
|
+
|
|
56
|
+
#### Available Claude Code Sub-Agents
|
|
57
|
+
Analyze the sub-agents available under `.claude/agents`. If none are available
|
|
58
|
+
or the available ones do not match the task's requirements, then use a generic
|
|
59
|
+
agent.
|
|
60
|
+
|
|
61
|
+
#### Matching Criteria
|
|
62
|
+
Select agents based on:
|
|
63
|
+
1. **Primary skill match**: Task technical requirements
|
|
64
|
+
2. **Domain expertise**: Specific frameworks or libraries mentioned
|
|
65
|
+
3. **Task complexity**: Senior vs. junior agent capabilities
|
|
66
|
+
4. **Resource efficiency**: Avoid over-provisioning for simple tasks
|
|
67
|
+
|
|
68
|
+
### Execution Monitoring
|
|
69
|
+
|
|
70
|
+
#### Progress Tracking
|
|
71
|
+
|
|
72
|
+
Update the list of tasks from the plan document to add the status of each task
|
|
73
|
+
and phase. Once a phase has been completed and validated, and before you move to
|
|
74
|
+
the next phase, update the blueprint and add a ✅ emoji in front of its title.
|
|
75
|
+
Add ✔️ emoji in front of all the tasks in that phase, and update their status to
|
|
76
|
+
`completed`.
|
|
77
|
+
|
|
78
|
+
#### Task Status Updates
|
|
79
|
+
Valid status transitions:
|
|
80
|
+
- `pending` → `in-progress` (when agent starts)
|
|
81
|
+
- `in-progress` → `completed` (successful execution)
|
|
82
|
+
- `in-progress` → `failed` (execution error)
|
|
83
|
+
- `failed` → `in-progress` (retry attempt)
|
|
84
|
+
|
|
85
|
+
### Error Handling
|
|
86
|
+
|
|
87
|
+
#### Task Failure Protocol
|
|
88
|
+
1. **Immediate Actions:**
|
|
89
|
+
- Pause the failed task's agent
|
|
90
|
+
- Document the error with full context
|
|
91
|
+
- Assess impact on other parallel tasks
|
|
92
|
+
|
|
93
|
+
2. **Recovery Strategy:**
|
|
94
|
+
- Attempt automatic retry with same agent (max 2 retries)
|
|
95
|
+
- If persistent failure, escalate for manual intervention
|
|
96
|
+
- Consider alternative agent selection
|
|
97
|
+
- Update task status to reflect issues
|
|
98
|
+
|
|
99
|
+
3. **Phase-Level Failures:**
|
|
100
|
+
- If any task in a phase fails after retries:
|
|
101
|
+
- Halt phase progression
|
|
102
|
+
- Complete any still-running parallel tasks
|
|
103
|
+
- Generate failure report with recommendations
|
|
104
|
+
- Request human intervention before continuing
|
|
105
|
+
|
|
106
|
+
#### Validation Gate Failures
|
|
107
|
+
If validation gates fail:
|
|
108
|
+
1. Document which specific validations failed
|
|
109
|
+
2. Identify which tasks may have caused the failure
|
|
110
|
+
3. Generate remediation plan
|
|
111
|
+
4. Re-execute affected tasks after fixes
|
|
112
|
+
5. Re-run validation gates
|
|
113
|
+
|
|
114
|
+
### Output Requirements
|
|
115
|
+
|
|
116
|
+
#### Final Execution Report
|
|
117
|
+
Upon blueprint completion respond with the following to the user:
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
✅ Execution Complete
|
|
121
|
+
|
|
122
|
+
📊 Summary Statistics
|
|
123
|
+
|
|
124
|
+
- Total Phases Executed: X
|
|
125
|
+
- Total Tasks Completed: Y
|
|
126
|
+
- Total Execution Time: [duration]
|
|
127
|
+
- Parallel Efficiency: X% (tasks run in parallel vs. sequential)
|
|
128
|
+
|
|
129
|
+
📋 Phase-by-Phase Results
|
|
130
|
+
|
|
131
|
+
[Concise summary of each phase]
|
|
132
|
+
|
|
133
|
+
📦 Artifacts Generated
|
|
134
|
+
|
|
135
|
+
[List of all outputs and deliverables]
|
|
136
|
+
|
|
137
|
+
💡 Recommendations
|
|
138
|
+
|
|
139
|
+
[Any follow-up actions or optimizations identified]
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Critical Rules
|
|
143
|
+
|
|
144
|
+
1. **Never skip validation gates** - Phase progression requires successful validation
|
|
145
|
+
2. **Maintain task isolation** - Parallel tasks must not interfere with each other
|
|
146
|
+
3. **Preserve dependency order** - Never execute a task before its dependencies
|
|
147
|
+
4. **Document everything** - All decisions, issues, and outcomes must be recorded
|
|
148
|
+
5. **Fail safely** - Better to halt and request help than corrupt the execution state
|
|
149
|
+
|
|
150
|
+
## Optimization Guidelines
|
|
151
|
+
|
|
152
|
+
- **Maximize parallelism**: Always run all available tasks in a phase simultaneously
|
|
153
|
+
- **Resource awareness**: Balance agent allocation with system capabilities
|
|
154
|
+
- **Early failure detection**: Monitor tasks actively to catch issues quickly
|
|
155
|
+
- **Continuous improvement**: Note patterns for future blueprint optimization
|
|
156
|
+
"""
|