@e0ipso/ai-task-manager 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,319 @@
1
+ ---
2
+ argument-hint: [plan-ID] [task-ID]
3
+ description: Execute a single task with dependency validation and status management
4
+ ---
5
+ # Single Task Execution
6
+
7
+ You are responsible for executing a single task within a plan while maintaining strict dependency validation and proper status management. Your role is to ensure the task is ready for execution, deploy the appropriate agent, and track execution progress.
8
+
9
+ ## Critical Rules
10
+
11
+ 1. **Never skip dependency validation** - Task execution requires all dependencies to be completed
12
+ 2. **Validate task status** - Never execute tasks that are already completed or in-progress
13
+ 3. **Maintain status integrity** - Update task status throughout the execution lifecycle
14
+ 4. **Use appropriate agents** - Match task skills to available sub-agents
15
+ 5. **Document execution** - Record all outcomes and issues encountered
16
+
17
+ ## Input Requirements
18
+ - Plan ID: $1 (required)
19
+ - Task ID: $2 (required)
20
+ - Task management directory structure: `@.ai/task-manager/`
21
+ - Dependency checking script: `@templates/ai-task-manager/config/scripts/check-task-dependencies.sh`
22
+
23
+ ### Input Validation
24
+
25
+ First, validate that both arguments are provided:
26
+
27
+ ```bash
28
+ if [ -z "$1" ] || [ -z "$2" ]; then
29
+ echo "Error: Both plan ID and task ID are required"
30
+ echo "Usage: /tasks:execute-task [plan-ID] [task-ID]"
31
+ echo "Example: /tasks:execute-task 16 03"
32
+ exit 1
33
+ fi
34
+ ```
35
+
36
+ ## Execution Process
37
+
38
+ ### 1. Plan and Task Location
39
+
40
+ Locate the plan directory using the established find pattern:
41
+
42
+ ```bash
43
+ PLAN_ID="$1"
44
+ TASK_ID="$2"
45
+
46
+ # Find plan directory
47
+ PLAN_DIR=$(find .ai/task-manager/{plans,archive} -type d -name "${PLAN_ID}--*" 2>/dev/null | head -1)
48
+
49
+ if [ -z "$PLAN_DIR" ]; then
50
+ echo "Error: Plan with ID ${PLAN_ID} not found"
51
+ echo "Available plans:"
52
+ find .ai/task-manager/plans -name "*--*" -type d | head -5
53
+ exit 1
54
+ fi
55
+
56
+ echo "Found plan: $PLAN_DIR"
57
+ ```
58
+
59
+ ### 2. Task File Validation
60
+
61
+ Locate and validate the specific task file:
62
+
63
+ ```bash
64
+ # Handle both padded (01, 02) and unpadded (1, 2) task IDs
65
+ TASK_FILE=""
66
+ if [ -f "${PLAN_DIR}/tasks/${TASK_ID}--"*.md ]; then
67
+ TASK_FILE=$(ls "${PLAN_DIR}/tasks/${TASK_ID}--"*.md 2>/dev/null | head -1)
68
+ elif [ -f "${PLAN_DIR}/tasks/0${TASK_ID}--"*.md ]; then
69
+ TASK_FILE=$(ls "${PLAN_DIR}/tasks/0${TASK_ID}--"*.md 2>/dev/null | head -1)
70
+ fi
71
+
72
+ if [ -z "$TASK_FILE" ] || [ ! -f "$TASK_FILE" ]; then
73
+ echo "Error: Task with ID ${TASK_ID} not found in plan ${PLAN_ID}"
74
+ echo "Available tasks in plan:"
75
+ find "$PLAN_DIR/tasks" -name "*.md" -type f | head -5
76
+ exit 1
77
+ fi
78
+
79
+ echo "Found task: $(basename "$TASK_FILE")"
80
+ ```
81
+
82
+ ### 3. Task Status Validation
83
+
84
+ Check current task status to ensure it can be executed:
85
+
86
+ ```bash
87
+ # Extract current status from task frontmatter
88
+ CURRENT_STATUS=$(awk '
89
+ /^---$/ { if (++delim == 2) exit }
90
+ /^status:/ {
91
+ gsub(/^status:[ \t]*/, "")
92
+ gsub(/^["'\'']/, "")
93
+ gsub(/["'\'']$/, "")
94
+ print
95
+ exit
96
+ }
97
+ ' "$TASK_FILE")
98
+
99
+ echo "Current task status: ${CURRENT_STATUS:-unknown}"
100
+
101
+ # Validate status allows execution
102
+ case "$CURRENT_STATUS" in
103
+ "completed")
104
+ echo "Error: Task ${TASK_ID} is already completed"
105
+ echo "Use execute-blueprint to re-execute the entire plan if needed"
106
+ exit 1
107
+ ;;
108
+ "in-progress")
109
+ echo "Error: Task ${TASK_ID} is already in progress"
110
+ echo "Wait for current execution to complete or check for stale processes"
111
+ exit 1
112
+ ;;
113
+ "pending"|"failed"|"")
114
+ echo "Task status allows execution - proceeding..."
115
+ ;;
116
+ *)
117
+ echo "Warning: Unknown task status '${CURRENT_STATUS}' - proceeding with caution..."
118
+ ;;
119
+ esac
120
+ ```
121
+
122
+ ### 4. Dependency Validation
123
+
124
+ Use the dependency checking script to validate all dependencies:
125
+
126
+ ```bash
127
+ # Call the dependency checking script
128
+ if ! @templates/ai-task-manager/config/scripts/check-task-dependencies.sh "$PLAN_ID" "$TASK_ID"; then
129
+ echo ""
130
+ echo "Task execution blocked by unresolved dependencies."
131
+ echo "Please complete the required dependencies first."
132
+ exit 1
133
+ fi
134
+
135
+ echo ""
136
+ echo "✓ All dependencies resolved - proceeding with execution"
137
+ ```
138
+
139
+ ### 5. Agent Selection
140
+
141
+ Read task skills and select appropriate task-specific agent:
142
+
143
+ ```bash
144
+ # Extract skills from task frontmatter
145
+ TASK_SKILLS=$(awk '
146
+ /^---$/ { if (++delim == 2) exit }
147
+ /^skills:/ {
148
+ in_skills = 1
149
+ # Check if skills are on the same line
150
+ if (match($0, /\[.*\]/)) {
151
+ gsub(/^skills:[ \t]*\[/, "")
152
+ gsub(/\].*$/, "")
153
+ gsub(/[ \t]/, "")
154
+ print
155
+ in_skills = 0
156
+ }
157
+ next
158
+ }
159
+ in_skills && /^[^ ]/ { in_skills = 0 }
160
+ in_skills && /^[ \t]*-/ {
161
+ gsub(/^[ \t]*-[ \t]*/, "")
162
+ gsub(/^"/, ""); gsub(/"$/, "")
163
+ print
164
+ }
165
+ ' "$TASK_FILE" | tr ',' '\n' | sed 's/^[ \t]*//;s/[ \t]*$//' | grep -v '^$')
166
+
167
+ echo "Task skills required: $TASK_SKILLS"
168
+
169
+ # Check for available sub-agents across assistant directories
170
+ AGENT_FOUND=false
171
+ for assistant_dir in .claude .gemini .opencode; do
172
+ if [ -d "$assistant_dir/agents" ] && [ -n "$(ls $assistant_dir/agents 2>/dev/null)" ]; then
173
+ echo "Available sub-agents detected in $assistant_dir - will match to task requirements"
174
+ AGENT_FOUND=true
175
+ break
176
+ fi
177
+ done
178
+
179
+ if [ "$AGENT_FOUND" = false ]; then
180
+ echo "Using general-purpose agent for task execution"
181
+ fi
182
+ ```
183
+
184
+ ### 6. Status Update to In-Progress
185
+
186
+ Update task status before execution:
187
+
188
+ ```bash
189
+ echo "Updating task status to in-progress..."
190
+
191
+ # Create temporary file with updated status
192
+ TEMP_FILE=$(mktemp)
193
+ awk '
194
+ /^---$/ {
195
+ if (++delim == 1) {
196
+ print
197
+ next
198
+ } else if (delim == 2) {
199
+ print "status: \"in-progress\""
200
+ print
201
+ next
202
+ }
203
+ }
204
+ /^status:/ && delim == 1 {
205
+ print "status: \"in-progress\""
206
+ next
207
+ }
208
+ { print }
209
+ ' "$TASK_FILE" > "$TEMP_FILE"
210
+
211
+ # Replace original file
212
+ mv "$TEMP_FILE" "$TASK_FILE"
213
+
214
+ echo "✓ Task status updated to in-progress"
215
+ ```
216
+
217
+ ### 7. Task Execution
218
+
219
+ Deploy the task using the Task tool with full context:
220
+
221
+ **Task Deployment**: Use your internal Task tool to execute the task with the following context:
222
+ - Task file path: `$TASK_FILE`
223
+ - Plan directory: `$PLAN_DIR`
224
+ - Required skills: `$TASK_SKILLS`
225
+ - Agent selection: Based on skills analysis or general-purpose agent
226
+
227
+ Read the complete task file and execute according to its requirements. The task includes:
228
+ - Objective and acceptance criteria
229
+ - Technical requirements and implementation notes
230
+ - Input dependencies and expected output artifacts
231
+
232
+ ### 8. Post-Execution Status Management
233
+
234
+ After task completion, update the status based on execution outcome:
235
+
236
+ ```bash
237
+ TEMP_FILE=$(mktemp)
238
+ awk '
239
+ /^---$/ {
240
+ if (++delim == 1) {
241
+ print
242
+ next
243
+ } else if (delim == 2) {
244
+ print "status: \"completed\""
245
+ print
246
+ next
247
+ }
248
+ }
249
+ /^status:/ && delim == 1 {
250
+ print "status: \"completed\""
251
+ next
252
+ }
253
+ { print }
254
+ ' "$TASK_FILE" > "$TEMP_FILE"
255
+
256
+ mv "$TEMP_FILE" "$TASK_FILE"
257
+
258
+ echo "✓ Task ${TASK_ID} completed successfully"
259
+ echo ""
260
+ echo "You can now execute dependent tasks or continue with the full blueprint execution."
261
+ ```
262
+
263
+ ## Error Handling
264
+
265
+ If task execution fails:
266
+
267
+ ```bash
268
+ # On execution failure, update status to failed
269
+ echo "Task execution failed - updating status..."
270
+
271
+ TEMP_FILE=$(mktemp)
272
+ awk '
273
+ /^---$/ {
274
+ if (++delim == 1) {
275
+ print
276
+ next
277
+ } else if (delim == 2) {
278
+ print "status: \"failed\""
279
+ print
280
+ next
281
+ }
282
+ }
283
+ /^status:/ && delim == 1 {
284
+ print "status: \"failed\""
285
+ next
286
+ }
287
+ { print }
288
+ ' "$TASK_FILE" > "$TEMP_FILE"
289
+
290
+ mv "$TEMP_FILE" "$TASK_FILE"
291
+
292
+ echo "Task ${TASK_ID} marked as failed"
293
+ echo "Check the task requirements and try again"
294
+ exit 1
295
+ ```
296
+
297
+ ## Usage Examples
298
+
299
+ ```bash
300
+ # Execute a specific task
301
+ /tasks:execute-task 16 1
302
+
303
+ # Execute task with zero-padded ID
304
+ /tasks:execute-task 16 03
305
+
306
+ # Execute task from archived plan
307
+ /tasks:execute-task 12 05
308
+ ```
309
+
310
+ ## Integration Notes
311
+
312
+ This command integrates with the existing task management system by:
313
+ - Using established plan and task location patterns
314
+ - Leveraging the dependency checking script for validation
315
+ - Following status management conventions
316
+ - Maintaining compatibility with execute-blueprint workflows
317
+ - Preserving task isolation and dependency order
318
+
319
+ The command complements execute-blueprint by providing granular task control while maintaining the same validation and execution standards.
@@ -5,14 +5,14 @@ description: Generate tasks to implement the plan with the provided ID.
5
5
  # Comprehensive Task List Creation
6
6
  You are a comprehensive task planning assistant. Your role is to create detailed, actionable plans based on user input while ensuring you have all necessary context before proceeding.
7
7
 
8
- Include @.ai/task-manager/TASK_MANAGER_INFO.md for the directory structure of tasks.
8
+ Include @.ai/task-manager/TASK_MANAGER.md for the directory structure of tasks.
9
9
 
10
10
  ## Instructions
11
11
 
12
12
  You will think hard to analyze the provided plan document and decompose it into atomic, actionable tasks with clear dependencies and groupings.
13
13
 
14
14
  ### Input
15
- - A plan document. See @.ai/task-manager/TASK_MANAGER_INFO.md fo find the plan with ID $1
15
+ - A plan document. See @.ai/task-manager/TASK_MANAGER.md fo find the plan with ID $1
16
16
  - The plan contains high-level objectives and implementation steps
17
17
 
18
18
  ### Input Error Handling
@@ -40,7 +40,6 @@ Each task must be:
40
40
  - **Single-purpose**: One clear deliverable or outcome
41
41
  - **Atomic**: Cannot be meaningfully split further
42
42
  - **Skill-specific**: Executable by a single skill agent (examples below)
43
- - **Time-bounded**: Completable in a reasonable timeframe by a skilled developer
44
43
  - **Verifiable**: Has clear completion criteria
45
44
 
46
45
  #### Skill Selection and Technical Requirements
@@ -119,6 +118,7 @@ Tests that verify custom business logic, critical paths, and edge cases specific
119
118
  5. Ensure no task requires multiple skill sets
120
119
  6. Verify each task has clear inputs and outputs
121
120
  7. **Minimize test tasks**: Combine related testing scenarios, avoid testing framework functionality
121
+ 8. Be very detailed with the "Implementation Notes". This should contain enough detail for a non-thinking LLM model to successfully complete the task. Put these instructions in a collapsible field `<details>`.
122
122
 
123
123
  #### Step 2: Dependency Analysis
124
124
  For each task, identify:
@@ -131,8 +131,9 @@ Dependency Rule: Task B depends on Task A if:
131
131
  - B modifies code created by A
132
132
  - B tests functionality implemented in A
133
133
 
134
- #### Step 3: Task Grouping
135
- Organize tasks into logical groups based on feature areas (e.g., "user-authentication", "payment-processing", "dashboard", "reporting", "notifications")
134
+ #### Step 3: POST_TASK_GENERATION_ALL hook
135
+
136
+ Read and run the @.ai/task-manager/config/hooks/POST_TASK_GENERATION_ALL.md
136
137
 
137
138
  #### Step 4: Output Generation
138
139
 
@@ -147,6 +148,9 @@ dependencies: [] # List of task IDs, e.g., [2, 3]
147
148
  status: "pending" # pending | in-progress | completed | needs-clarification
148
149
  created: "2024-01-15"
149
150
  skills: ["react-components", "authentication"] # Technical skills required for this task
151
+ # Optional: Include complexity scores for high-complexity tasks or decomposition tracking
152
+ # complexity_score: 4.2 # Composite complexity score (only if >4 or decomposed)
153
+ # complexity_notes: "Decomposed from original task due to high technical depth"
150
154
  ---
151
155
  ```
152
156
 
@@ -190,6 +194,16 @@ The schema for this frontmatter is:
190
194
  },
191
195
  "minItems": 1,
192
196
  "uniqueItems": true
197
+ },
198
+ "complexity_score": {
199
+ "type": "number",
200
+ "minimum": 1,
201
+ "maximum": 10,
202
+ "description": "Optional: Composite complexity score (include only if >4 or for decomposed tasks)"
203
+ },
204
+ "complexity_notes": {
205
+ "type": "string",
206
+ "description": "Optional: Rationale for complexity score or decomposition decisions"
193
207
  }
194
208
  },
195
209
  "additionalProperties": false
@@ -197,32 +211,8 @@ The schema for this frontmatter is:
197
211
  ```
198
212
 
199
213
  ##### Task Body Structure
200
- ```markdown
201
- ## Objective
202
- [Clear statement of what this task accomplishes]
203
-
204
- ## Skills Required
205
- [Reference to the skills listed in frontmatter - these should align with the technical work needed]
206
-
207
- ## Acceptance Criteria
208
- - [ ] Criterion 1
209
- - [ ] Criterion 2
210
- - [ ] Criterion 3
211
214
 
212
- Use your internal TODO tool to track these and keep on track.
213
-
214
- ## Technical Requirements
215
- [Specific technical details, APIs, libraries, etc. - use this to infer appropriate skills]
216
-
217
- ## Input Dependencies
218
- [What artifacts/code from other tasks are needed]
219
-
220
- ## Output Artifacts
221
- [What this task produces for other tasks to consume]
222
-
223
- ## Implementation Notes
224
- [Any helpful context or suggestions, including skill-specific guidance]
225
- ```
215
+ Use the task template in @.ai/task-manager/config/templates/TASK_TEMPLATE.md
226
216
 
227
217
  ### Task ID Generation
228
218
 
@@ -312,6 +302,8 @@ If the command fails or returns unexpected results:
312
302
 
313
303
  ### Validation Checklist
314
304
  Before finalizing, ensure:
305
+
306
+ **Core Task Requirements:**
315
307
  - [ ] Each task has 1-2 appropriate technical skills assigned
316
308
  - [ ] Skills are automatically inferred from task objectives and technical requirements
317
309
  - [ ] All dependencies form an acyclic graph
@@ -319,10 +311,36 @@ Before finalizing, ensure:
319
311
  - [ ] Groups are consistent and meaningful
320
312
  - [ ] Every **explicitly stated** task from the plan is covered
321
313
  - [ ] No redundant or overlapping tasks
322
- - [ ] **Minimization applied**: Each task is absolutely necessary
323
- - [ ] **Test tasks are meaningful**: Focus on business logic, not framework functionality
324
- - [ ] **No gold-plating**: Only plan requirements are addressed
325
- - [ ] Total task count represents minimum viable implementation
314
+
315
+ **Complexity Analysis & Controls:**
316
+ - [ ] **Complexity Analysis Complete**: All tasks assessed using 5-dimension scoring
317
+ - [ ] **Decomposition Applied**: Tasks with composite score ≥6 have been decomposed or justified
318
+ - [ ] **Final Task Complexity**: All final tasks have composite score ≤5 (target ≤4)
319
+ - [ ] **Iteration Limits Respected**: No task exceeded 3 decomposition rounds
320
+ - [ ] **Minimum Viability**: No tasks decomposed below complexity threshold of 3
321
+ - [ ] **Quality Gates Passed**: All decomposed tasks meet enhanced quality criteria
322
+ - [ ] **Dependency Integrity**: No circular dependencies or orphaned tasks exist
323
+ - [ ] **Error Handling Complete**: All edge cases resolved or escalated appropriately
324
+
325
+ **Complexity Documentation Requirements:**
326
+ - [ ] **Complexity Scores Documented**: Individual dimension scores recorded for complex tasks
327
+ - [ ] **Decomposition History**: Iteration tracking included in `complexity_notes` for decomposed tasks
328
+ - [ ] **Validation Status**: All tasks marked with appropriate validation outcomes
329
+ - [ ] **Escalation Documentation**: High-complexity tasks have clear escalation notes
330
+ - [ ] **Consistency Validated**: Complexity scores align with task descriptions and skills
331
+
332
+ **Scope & Quality Control:**
333
+ - [ ] **Minimization Applied**: Each task is absolutely necessary (20-30% reduction target)
334
+ - [ ] **Test Tasks are Meaningful**: Focus on business logic, not framework functionality
335
+ - [ ] **No Gold-plating**: Only plan requirements are addressed
336
+ - [ ] **Total Task Count**: Represents minimum viable implementation
337
+ - [ ] **Scope Preservation**: Decomposed tasks collectively match original requirements
338
+
339
+ **System Reliability:**
340
+ - [ ] **Error Conditions Resolved**: No unresolved error states remain
341
+ - [ ] **Manual Intervention Flagged**: Complex edge cases properly escalated
342
+ - [ ] **Quality Checkpoints**: All validation gates completed successfully
343
+ - [ ] **Dependency Graph Validated**: Full dependency analysis confirms acyclic, logical relationships
326
344
 
327
345
  ### Error Handling
328
346
  If the plan lacks sufficient detail:
@@ -368,7 +386,7 @@ The execution blueprint organizes tasks into sequential phases where:
368
386
  ## Execution Blueprint
369
387
 
370
388
  **Validation Gates:**
371
- - Reference: `@.ai/task-manager/VALIDATION_GATES.md`
389
+ - Reference: `@.ai/task-manager/config/hooks/POST_PHASE.md`
372
390
 
373
391
  ### Phase 1: [Descriptive Phase Name]
374
392
  **Parallel Tasks:**
@@ -397,7 +415,7 @@ The execution blueprint organizes tasks into sequential phases where:
397
415
 
398
416
  #### Phase Transition Rules
399
417
  1. All tasks in the current phase must have status: "completed"
400
- 2. All validation gates defined in `@.ai/task-manager/VALIDATION_GATES.md` for the current phase must pass
418
+ 2. All validation gates defined in `@.ai/task-manager/config/hooks/POST_PHASE.md` for the current phase must pass
401
419
  3. No task in a future phase can begin until these conditions are met
402
420
 
403
421
  #### Blueprint Verification
@@ -420,7 +438,7 @@ Before finalizing, ensure:
420
438
  - Phases execute in strict numerical order
421
439
  - Phase N+1 cannot begin until Phase N is fully complete and validated
422
440
  - This ensures dependency integrity and systematic progress
423
- -
441
+ -
424
442
 
425
443
  #### Validation Gates
426
444
  - Each phase has associated validation criteria defined externally