@e0ipso/ai-task-manager 1.7.1 → 1.8.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/README.md +28 -94
- 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 +1 -26
- 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 +1 -103
package/README.md
CHANGED
|
@@ -1,121 +1,55 @@
|
|
|
1
1
|
# 🤖 AI Task Manager
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@e0ipso/ai-task-manager)
|
|
4
|
-
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
|
|
6
|
-
AI-powered task management that creates structured workflows within your existing AI subscriptions
|
|
6
|
+
**AI-powered task management that creates structured workflows within your existing AI subscriptions.**
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Transform chaotic AI prompts into organized, executable development workflows through custom slash commands for Claude Code, Gemini CLI, and Open Code.
|
|
9
9
|
|
|
10
|
-
##
|
|
11
|
-
|
|
12
|
-
This tool creates custom slash commands (like `/tasks:create-plan`, `/tasks:generate-tasks`) that integrate directly into:
|
|
13
|
-
- **Claude Code**: Works with your Claude Pro/Max subscription via [claude.ai/code](https://claude.ai/code)
|
|
14
|
-
- **Gemini CLI**: Uses your existing Gemini subscription
|
|
15
|
-
- **Open Code**: Leverages your preferred open-source setup
|
|
16
|
-
|
|
17
|
-
## ✨ Features
|
|
18
|
-
|
|
19
|
-
- 🤝 **Multi-Assistant Support**: Configure support for Claude, Gemini, and Open Code
|
|
20
|
-
- 📋 **Template System**: Built-in templates for different project types (basic, development, research)
|
|
10
|
+
## 💰 No Additional Costs
|
|
21
11
|
|
|
12
|
+
Unlike Plandex, Claude Task Master, and Conductor Tasks that require API keys with pay-per-token pricing, **AI Task Manager works within your existing AI subscriptions** - no API keys or additional costs required.
|
|
22
13
|
|
|
23
14
|
## 🚀 Quick Start
|
|
24
15
|
|
|
25
|
-
### 🏗️ Initialize a New Workspace
|
|
26
|
-
|
|
27
|
-
The `--assistants` flag is **required** when initializing a workspace. You must specify which coding assistant(s) you want to configure support for.
|
|
28
|
-
|
|
29
|
-
AI Task Manager supports multiple coding assistants. You **must** specify which assistant(s) to use during initialization using the `--assistants` flag.
|
|
30
|
-
|
|
31
|
-
🤖 Supported Assistants are
|
|
32
|
-
|
|
33
|
-
- 🎭 **Claude**: Anthropic's Claude AI assistant
|
|
34
|
-
- 💎 **Gemini**: Google's Gemini AI assistant
|
|
35
|
-
- 📝 **Open Code**: Open source code assistant
|
|
36
|
-
|
|
37
|
-
The `--destination-directory` flag allows you to specify an alternative directory for the workspace. By default, the workspace is initialized in the current working directory.
|
|
38
|
-
|
|
39
16
|
```bash
|
|
40
|
-
#
|
|
17
|
+
# Initialize for your preferred AI assistant
|
|
41
18
|
npx @e0ipso/ai-task-manager init --assistants claude
|
|
42
|
-
|
|
43
|
-
# Gemini only
|
|
44
|
-
npx @e0ipso/ai-task-manager init --assistants gemini
|
|
45
|
-
|
|
46
|
-
# Open Code only
|
|
19
|
+
npx @e0ipso/ai-task-manager init --assistants gemini
|
|
47
20
|
npx @e0ipso/ai-task-manager init --assistants opencode
|
|
48
21
|
|
|
49
|
-
#
|
|
50
|
-
npx @e0ipso/ai-task-manager init --assistants claude,gemini
|
|
51
|
-
npx @e0ipso/ai-task-manager init --assistants claude,opencode
|
|
22
|
+
# Or configure multiple assistants
|
|
52
23
|
npx @e0ipso/ai-task-manager init --assistants claude,gemini,opencode
|
|
53
24
|
```
|
|
54
25
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
### 📂 Directory Structure
|
|
58
|
-
|
|
59
|
-
When you initialize with assistant selection, the following directory structure is created:
|
|
60
|
-
|
|
61
|
-
```
|
|
62
|
-
project-root/
|
|
63
|
-
├── .ai/
|
|
64
|
-
│ └── task-manager/ # Shared configuration files
|
|
65
|
-
│ ├── plans
|
|
66
|
-
│ ├── TASK_MANAGER.md # General information to operate the task manager
|
|
67
|
-
│ └── POST_PHASE.md # Validation gates for phase completion
|
|
68
|
-
├── .claude/ # Claude files (if selected)
|
|
69
|
-
│ └── commands/ # Custom slash commands for Claude
|
|
70
|
-
│ └── tasks/
|
|
71
|
-
│ ├── create-plan.md
|
|
72
|
-
│ ├── execute-blueprint.md
|
|
73
|
-
│ └── generate-tasks.md
|
|
74
|
-
├── .gemini/ # Gemini files (if selected)
|
|
75
|
-
│ └── commands/ # Custom slash commands for Gemini
|
|
76
|
-
│ └── tasks/
|
|
77
|
-
│ ├── create-plan.toml
|
|
78
|
-
│ ├── execute-blueprint.toml
|
|
79
|
-
│ └── generate-tasks.toml
|
|
80
|
-
├── .opencode/ # Open Code files (if selected)
|
|
81
|
-
│ └── commands/ # Custom slash commands for Open Code
|
|
82
|
-
│ └── tasks/
|
|
83
|
-
│ ├── create-plan.md
|
|
84
|
-
│ ├── execute-blueprint.md
|
|
85
|
-
│ └── generate-tasks.md
|
|
86
|
-
└── project files...
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
## 💡 Suggested Workflow
|
|
90
|
-
|
|
91
|
-
### 📋 One-time Setup
|
|
92
|
-
|
|
93
|
-
Review and tweak the `.ai/task-manager/TASK_MANAGER.md` and `.ai/task-manager/config/hooks/POST_PHASE.md`. These files are yours to edit and should reflect your project's tech stack and goals.
|
|
26
|
+
## 📖 Documentation
|
|
94
27
|
|
|
95
|
-
|
|
28
|
+
**For complete setup instructions, features, and workflow guides, visit:**
|
|
96
29
|
|
|
97
|
-
|
|
98
|
-
2. 💬 Provide additional context if the assistant needs it.
|
|
99
|
-
3. ⚠️ Manually review the plan and make the necessary edits. You might be tempted to skip this step, **do not skip this step**. Find the plan document in `.ai/task-manager/plans/01--authentication-workflow/plan-01--authentication-workflow.md`
|
|
100
|
-
4. 📋 Create the tasks for the plan: `/tasks:generate-tasks 1`
|
|
101
|
-
5. 👀 Review the list of tasks. This step is important to avoid scope creep and ensure the right things are to be built. Again, **do not skip this step**. Find the tasks in the folder `.ai/task-manager/plans/01--authentication-workflow/tasks/`
|
|
102
|
-
6. 🚀 Execute the tasks: `/tasks:execute-blueprint 1`
|
|
103
|
-
7. ✅ Review the implementation and the generated tests.
|
|
30
|
+
### 🌐 **[Documentation Site →](https://mateuaguilo.com/ai-task-manager/)**
|
|
104
31
|
|
|
105
|
-
|
|
32
|
+
The documentation includes:
|
|
33
|
+
- Detailed installation and setup instructions
|
|
34
|
+
- Complete workflow guides with examples
|
|
35
|
+
- Feature overview and capabilities
|
|
36
|
+
- Troubleshooting and best practices
|
|
37
|
+
- Architecture and customization details
|
|
106
38
|
|
|
107
|
-
|
|
108
|
-
<summary>🚫 Permission Errors</summary>
|
|
39
|
+
## 💡 Quick Workflow Preview
|
|
109
40
|
|
|
110
|
-
|
|
41
|
+
1. **📝 Create a plan**: `/tasks:create-plan Create user authentication system`
|
|
42
|
+
2. **📋 Generate tasks**: `/tasks:generate-tasks 1`
|
|
43
|
+
3. **🚀 Execute blueprint**: `/tasks:execute-blueprint 1`
|
|
111
44
|
|
|
112
|
-
|
|
113
|
-
- Ensure you have write permissions to the target directory
|
|
114
|
-
- On Unix systems, check directory ownership: `ls -la`
|
|
115
|
-
- Try running with appropriate permissions or in a user-owned directory
|
|
45
|
+
## 🤖 Supported Assistants
|
|
116
46
|
|
|
117
|
-
|
|
47
|
+
| Assistant | Interface | Cost Model |
|
|
48
|
+
|-----------|-----------|------------|
|
|
49
|
+
| 🎭 **Claude** | [claude.ai/code](https://claude.ai/code) | Your existing subscription |
|
|
50
|
+
| 💎 **Gemini** | Gemini CLI | Your existing subscription |
|
|
51
|
+
| 📝 **Open Code** | Open source | Free |
|
|
118
52
|
|
|
119
53
|
## 📄 License
|
|
120
54
|
|
|
121
|
-
|
|
55
|
+
MIT License - Open source and free to use.
|
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:
|
|
@@ -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
|
|
|
@@ -348,106 +348,4 @@ If the plan lacks sufficient detail:
|
|
|
348
348
|
- Create placeholder tasks marked with `status: "needs-clarification"`
|
|
349
349
|
- Document assumptions made
|
|
350
350
|
|
|
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
|
|
351
|
+
Read and execute @.ai/task-manager/config/hooks/POST_PLAN.md
|