@e0ipso/ai-task-manager 1.27.1 → 1.27.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e0ipso/ai-task-manager",
3
- "version": "1.27.1",
3
+ "version": "1.27.2",
4
4
  "description": "Task management for AI coding assistants",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -57,7 +57,7 @@ fi
57
57
 
58
58
  ## Instructions
59
59
 
60
- Include $root/ $root/.ai/task-manager/config/TASK_MANAGER.md for the directory structure of tasks.
60
+ Include $root/.ai/task-manager/config/TASK_MANAGER.md for the directory structure of tasks.
61
61
 
62
62
  The user input is:
63
63
 
@@ -71,11 +71,11 @@ If no user input is provided stop immediately and show an error message to the u
71
71
 
72
72
  Use your internal Todo task tool to track the following plan generation:
73
73
 
74
- - [ ] Read and execute $root/ $root/.ai/task-manager/config/hooks/PRE_PLAN.md
74
+ - [ ] Read and execute $root/.ai/task-manager/config/hooks/PRE_PLAN.md
75
75
  - [ ] User input and context analysis
76
76
  - [ ] Clarification questions
77
77
  - [ ] Plan generation
78
- - [ ] Read and execute $root/ $root/.ai/task-manager/config/hooks/POST_PLAN.md
78
+ - [ ] Read and execute $root/.ai/task-manager/config/hooks/POST_PLAN.md
79
79
 
80
80
  #### Step 1: Context Analysis
81
81
  Before creating any plan, analyze the user's request for:
@@ -98,7 +98,7 @@ Try to answer your own questions first by inspecting the codebase, docs, and ass
98
98
  IMPORTANT: Once you have the user's answers go back to Step 2. Do this in a loop until you have no more questions. Ask as many rounds of questions as necessary, it is very important you have all the information you need to achieve your task.
99
99
 
100
100
  #### Step 3: Plan Generation
101
- Only after confirming sufficient context, create a plan according the the $root/ $root/.ai/task-manager/config/templates/PLAN_TEMPLATE.md
101
+ Only after confirming sufficient context, create a plan according to the $root/.ai/task-manager/config/templates/PLAN_TEMPLATE.md
102
102
 
103
103
  ##### CRITICAL: Output Format
104
104
 
@@ -120,7 +120,7 @@ This structured output enables automated workflow coordination and must be inclu
120
120
 
121
121
  ###### Plan Template
122
122
 
123
- Use the template in $root/ $root/.ai/task-manager/config/templates/PLAN_TEMPLATE.md
123
+ Use the template in $root/.ai/task-manager/config/templates/PLAN_TEMPLATE.md
124
124
 
125
125
  ###### Patterns to Avoid
126
126
  Do not include the following in your plan output.
@@ -17,7 +17,7 @@ You are the coordinator responsible for executing all tasks defined in the execu
17
17
  5. **Fail safely** - Better to halt and request help than corrupt the execution state
18
18
 
19
19
  ## Input Requirements
20
- - A plan document with an execution blueprint section. See /TASK_MANAGER.md fo find the plan with ID $1
20
+ - A plan document with an execution blueprint section. See /TASK_MANAGER.md to find the plan with ID $1
21
21
  - Task files with frontmatter metadata (id, group, dependencies, status)
22
22
  - Validation gates document: `/config/hooks/POST_PHASE.md`
23
23
 
@@ -211,7 +211,7 @@ If validation fails, halt execution. The plan remains in `plans/` for debugging.
211
211
 
212
212
  ### 1. Execution Summary Generation
213
213
 
214
- Append an execution summary section to the plan document with the format described in $root/.ai/task-manager/config/templates/[EXECUTION_SUMMARY_TEMPLATE.md
214
+ Append an execution summary section to the plan document with the format described in $root/.ai/task-manager/config/templates/EXECUTION_SUMMARY_TEMPLATE.md
215
215
 
216
216
  ### 2. Plan Archival
217
217
 
@@ -83,26 +83,74 @@ Use your internal Todo task tool to track the workflow execution:
83
83
 
84
84
  Execute the following plan creation process:
85
85
 
86
- Ultrathink, think harder, and use tools.
86
+ Use tools for the planning. You are encouraged to write your own specialized tools to research, analyze, and debug
87
+ any work order from the user. You are not restricted to the stack of the current project to create your own
88
+ specialized tools.
87
89
 
88
- 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.
90
+ ## Find the AI Task Manager root
91
+
92
+ ```bash
93
+ if [ ! -f /tmp/find-ai-task-manager-root.js ]; then
94
+ cat << 'EOF' > /tmp/find-ai-task-manager-root.js
95
+ const fs = require('fs');
96
+ const path = require('path');
97
+
98
+ const findRoot = (currentDir) => {
99
+ const taskManagerPath = path.join(currentDir, '.ai/task-manager');
100
+ const metadataPath = path.join(taskManagerPath, '.init-metadata.json');
101
+
102
+ try {
103
+ if (fs.existsSync(metadataPath) && JSON.parse(fs.readFileSync(metadataPath, 'utf8')).version) {
104
+ console.log(path.resolve(taskManagerPath));
105
+ process.exit(0);
106
+ }
107
+ } catch (e) {
108
+ // Continue searching
109
+ }
110
+
111
+ const parentDir = path.dirname(currentDir);
112
+ if (parentDir.length < currentDir.length) {
113
+ findRoot(parentDir);
114
+ } else {
115
+ process.exit(1);
116
+ }
117
+ };
118
+
119
+ findRoot(process.cwd());
120
+ EOF
121
+ fi
122
+
123
+ root=$(node /tmp/find-ai-task-manager-root.js)
124
+
125
+ if [ -z "$root" ]; then
126
+ echo "Error: Could not find task manager root directory (.ai/task-manager)"
127
+ exit 1
128
+ fi
129
+ ```
130
+
131
+ ## Instructions
89
132
 
90
133
  Include $root/.ai/task-manager/config/TASK_MANAGER.md for the directory structure of tasks.
91
134
 
92
- ### Process
135
+ The user input is:
136
+
137
+ <user-input>
138
+ $ARGUMENTS
139
+ </user-input>
140
+
141
+ If no user input is provided stop immediately and show an error message to the user.
93
142
 
94
- Use your internal Todo task tool to track the plan generation:
143
+ ### Process Checklist
144
+
145
+ Use your internal Todo task tool to track the following plan generation:
95
146
 
96
147
  - [ ] Read and execute $root/.ai/task-manager/config/hooks/PRE_PLAN.md
97
148
  - [ ] User input and context analysis
98
149
  - [ ] Clarification questions
99
- - [ ] Plan generation: Executive Summary
100
- - [ ] Plan generation: Detailed Steps
101
- - [ ] Plan generation: Risk Considerations
102
- - [ ] Plan generation: Success Metrics
150
+ - [ ] Plan generation
103
151
  - [ ] Read and execute $root/.ai/task-manager/config/hooks/POST_PLAN.md
104
152
 
105
- #### Context Analysis
153
+ #### Step 1: Context Analysis
106
154
  Before creating any plan, analyze the user's request for:
107
155
  - **Objective**: What is the end goal?
108
156
  - **Scope**: What are the boundaries and constraints?
@@ -111,34 +159,23 @@ Before creating any plan, analyze the user's request for:
111
159
  - **Dependencies**: What prerequisites or blockers exist?
112
160
  - **Technical Requirements**: What technologies or skills are needed?
113
161
 
114
- #### Clarification Phase
162
+ #### Step 2: Clarification Phase
115
163
  If any critical context is missing:
116
164
  1. Identify specific gaps in the information provided
117
- 2. Ask targeted follow-up questions grouped by category
118
- 3. Wait for user responses before proceeding to planning
119
- 4. Frame questions clearly with examples when helpful
120
- 5. Be extra cautious. Users miss important context very often. Don't hesitate to ask for clarifications.
121
-
122
- Example clarifying questions:
123
- - "Q: What is your primary goal with [specific aspect]?"
124
- - "Q: Do you have any existing [resources/code/infrastructure] I should consider?"
125
- - "Q: What is your timeline for completing this?"
126
- - "Q: Are there specific constraints I should account for?"
127
- - "Q: Do you want me to write tests for this?"
128
- - "Q: Are there other systems, projects, or modules that perform a similar task?"
165
+ 2. Ask targeted follow-up questions
166
+ 3. Frame questions clearly with examples when helpful
167
+ 4. Be extra cautious. Users miss important context very often. Don't hesitate to ask for additional clarifications.
129
168
 
130
169
  Try to answer your own questions first by inspecting the codebase, docs, and assistant documents like CLAUDE.md, GEMINI.md, AGENTS.md ...
131
170
 
132
- #### Plan Generation
133
- Only after confirming sufficient context, create a plan that includes:
134
- 1. **Executive Summary**: Brief overview of the approach
135
- 2. **Detailed Steps**: Numbered, actionable tasks with clear outcomes
136
- 3. **Risk Considerations**: Potential challenges and mitigation strategies
137
- 4. **Success Metrics**: How to measure completion and quality
171
+ IMPORTANT: Once you have the user's answers go back to Step 2. Do this in a loop until you have no more questions. Ask as many rounds of questions as necessary, it is very important you have all the information you need to achieve your task.
138
172
 
139
- Remember that a plan needs to be reviewed by a human. Be concise and to the point. Also, include mermaid diagrams to illustrate the plan.
173
+ #### Step 3: Plan Generation
174
+ Only after confirming sufficient context, create a plan according to the $root/.ai/task-manager/config/templates/PLAN_TEMPLATE.md
140
175
 
141
- #### Output Format
176
+ ##### CRITICAL: Output Format
177
+
178
+ Remember that a plan needs to be reviewed by a human. Be concise and to the point. Also, include mermaid diagrams to illustrate the plan.
142
179
 
143
180
  **Output Behavior: CRITICAL - Structured Output for Command Coordination**
144
181
 
@@ -154,16 +191,17 @@ Plan Summary:
154
191
 
155
192
  This structured output enables automated workflow coordination and must be included even when running standalone.
156
193
 
157
- #### Plan Template
194
+ ###### Plan Template
158
195
 
159
196
  Use the template in $root/.ai/task-manager/config/templates/PLAN_TEMPLATE.md
160
197
 
161
- #### Patterns to Avoid
198
+ ###### Patterns to Avoid
162
199
  Do not include the following in your plan output.
163
200
  - Avoid time estimations
164
201
  - Avoid task lists and mentions of phases (those are things we'll introduce later)
202
+ - Avoid code examples
165
203
 
166
- #### Frontmatter Structure
204
+ ###### Frontmatter Structure
167
205
 
168
206
  Example:
169
207
  ```yaml
@@ -174,12 +212,36 @@ created: 2025-09-01
174
212
  ---
175
213
  ```
176
214
 
177
- #### Plan ID Generation
215
+ The schema for this frontmatter is:
216
+ ```json
217
+ {
218
+ "type": "object",
219
+ "required": ["id", "summary", "created"],
220
+ "properties": {
221
+ "id": {
222
+ "type": ["number"],
223
+ "description": "Unique identifier for the task. An integer."
224
+ },
225
+ "summary": {
226
+ "type": "string",
227
+ "description": "A summary of the plan"
228
+ },
229
+ "created": {
230
+ "type": "string",
231
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
232
+ "description": "Creation date in YYYY-MM-DD format"
233
+ }
234
+ },
235
+ "additionalProperties": false
236
+ }
237
+ ```
178
238
 
179
- Execute to auto-generate the next plan ID:
239
+ ### Plan ID Generation
240
+
241
+ Execute this script to determine the plan ID:
180
242
 
181
243
  ```bash
182
- node $root/config/scripts/get-next-plan-id.cjs
244
+ next_id=$(node $root/config/scripts/get-next-plan-id.cjs)
183
245
  ```
184
246
 
185
247
  **Key formatting:**
@@ -200,25 +262,71 @@ node $root/config/scripts/get-next-plan-id.cjs
200
262
 
201
263
  Using the Plan ID extracted from Step 1, execute task generation:
202
264
 
265
+ ## Find the AI Task Manager root
266
+
267
+ ```bash
268
+ if [ ! -f /tmp/find-ai-task-manager-root.js ]; then
269
+ cat << 'EOF' > /tmp/find-ai-task-manager-root.js
270
+ const fs = require('fs');
271
+ const path = require('path');
272
+
273
+ const findRoot = (currentDir) => {
274
+ const taskManagerPath = path.join(currentDir, '.ai/task-manager');
275
+ const metadataPath = path.join(taskManagerPath, '.init-metadata.json');
276
+
277
+ try {
278
+ if (fs.existsSync(metadataPath) && JSON.parse(fs.readFileSync(metadataPath, 'utf8')).version) {
279
+ console.log(path.resolve(taskManagerPath));
280
+ process.exit(0);
281
+ }
282
+ } catch (e) {
283
+ // Continue searching
284
+ }
285
+
286
+ const parentDir = path.dirname(currentDir);
287
+ if (parentDir.length < currentDir.length) {
288
+ findRoot(parentDir);
289
+ } else {
290
+ process.exit(1);
291
+ }
292
+ };
293
+
294
+ findRoot(process.cwd());
295
+ EOF
296
+ fi
297
+
298
+ root=$(node /tmp/find-ai-task-manager-root.js)
299
+
300
+ if [ -z "$root" ]; then
301
+ echo "Error: Could not find task manager root directory (.ai/task-manager)"
302
+ exit 1
303
+ fi
304
+ ```
305
+
203
306
  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.
204
307
 
205
- Include /TASK_MANAGER.md for the directory structure of tasks.
308
+ Include `$root/.ai/task-manager/config/TASK_MANAGER.md` for the directory structure of tasks.
206
309
 
207
- ### Instructions
310
+ ## Instructions
208
311
 
209
312
  You will think hard to analyze the provided plan document and decompose it into atomic, actionable tasks with clear dependencies and groupings.
210
313
 
211
314
  Use your internal Todo task tool to track the following process:
212
315
 
213
- - [ ] Read and process plan [PLAN_ID from Step 1]
316
+ - [ ] Read and process plan [planId]
214
317
  - [ ] Use the Task Generation Process to create tasks according to the Task Creation Guidelines
215
318
  - [ ] Read and run the $root/.ai/task-manager/config/hooks/POST_TASK_GENERATION_ALL.md
216
319
 
217
- #### Input
218
- - A plan document. See $root/.ai/task-manager/config/TASK_MANAGER.md to find the plan with ID from Step 1
219
- - The plan contains high-level objectives and implementation steps
320
+ ### Input
321
+
322
+ - A plan document. Extract it with the following command.
323
+
324
+ ```bash
325
+ # Extract validation results directly from script
326
+ plan_file=$(node $root/config/scripts/validate-plan-blueprint.cjs [planId] planFile)
327
+ ```
220
328
 
221
- #### Input Error Handling
329
+ ### Input Error Handling
222
330
  If the plan does not exist. Stop immediately and show an error to the user.
223
331
 
224
332
  ### Task Creation Guidelines
@@ -242,24 +350,54 @@ If the plan does not exist. Stop immediately and show an error to the user.
242
350
  Each task must be:
243
351
  - **Single-purpose**: One clear deliverable or outcome
244
352
  - **Atomic**: Cannot be meaningfully split further
245
- - **Skill-specific**: Executable by a single skill agent
353
+ - **Skill-specific**: Executable by a single skill agent (examples below)
246
354
  - **Verifiable**: Has clear completion criteria
247
355
 
248
356
  #### Skill Selection and Technical Requirements
249
357
 
250
358
  **Core Principle**: Each task should require 1-2 specific technical skills that can be handled by specialized agents. Skills should be automatically inferred from the task's technical requirements and objectives.
251
359
 
360
+ **Skill Selection Criteria**:
361
+ 1. **Technical Specificity**: Choose skills that directly match the technical work required
362
+ 2. **Agent Specialization**: Select skills that allow a single skilled agent to complete the task
363
+ 3. **Minimal Overlap**: Avoid combining unrelated skill domains in a single task
364
+ 4. **Creative Inference**: Derive skills from task objectives and implementation context
365
+
366
+ **Inspirational Skill Examples** (use kebab-case format):
367
+ - Frontend: `react-components`, `css`, `js`, `vue-components`, `html`
368
+ - Backend: `api-endpoints`, `database`, `authentication`, `server-config`
369
+ - Testing: `jest`, `playwright`, `unit-testing`, `e2e-testing`
370
+ - DevOps: `docker`, `github-actions`, `deployment`, `ci-cd`
371
+ - Languages: `typescript`, `python`, `php`, `bash`, `sql`
372
+ - Frameworks: `nextjs`, `express`, `drupal-backend`, `wordpress-plugins`
373
+
374
+ **Automatic Skill Inference Examples**:
375
+ - "Create user login form" → `["react-components", "authentication"]`
376
+ - "Build REST API for orders" → `["api-endpoints", "database"]`
377
+ - "Add Docker deployment" → `["docker", "deployment"]`
378
+ - "Write Jest tests for utils" → `["jest"]`
379
+
252
380
  **Assignment Guidelines**:
253
381
  - **1 skill**: Focused, single-domain tasks
254
382
  - **2 skills**: Tasks requiring complementary domains
255
383
  - **Split if 3+**: Indicates task should be broken down
256
384
 
385
+ ```
386
+ # Examples
387
+ skills: ["css"] # Pure styling
388
+ skills: ["api-endpoints", "database"] # API with persistence
389
+ skills: ["react-components", "jest"] # Implementation + testing
390
+ ```
391
+
257
392
  #### Meaningful Test Strategy Guidelines
258
393
 
259
394
  **IMPORTANT** Make sure to copy this _Meaningful Test Strategy Guidelines_ section into all the tasks focused on testing, and **also** keep them in mind when generating tasks.
260
395
 
261
396
  Your critical mantra for test generation is: "write a few tests, mostly integration".
262
397
 
398
+ **Definition of "Meaningful Tests":**
399
+ Tests that verify custom business logic, critical paths, and edge cases specific to the application. Focus on testing YOUR code, not the framework or library functionality.
400
+
263
401
  **When TO Write Tests:**
264
402
  - Custom business logic and algorithms
265
403
  - Critical user workflows and data transformations
@@ -275,6 +413,12 @@ Your critical mantra for test generation is: "write a few tests, mostly integrat
275
413
  - Configuration files or static data
276
414
  - Obvious functionality that would break immediately if incorrect
277
415
 
416
+ **Test Task Creation Rules:**
417
+ - Combine related test scenarios into single tasks (e.g., "Test user authentication flow" not separate tasks for login, logout, validation)
418
+ - Focus on integration and critical path testing over unit test coverage
419
+ - Avoid creating separate tasks for testing each CRUD operation individually
420
+ - Question whether simple functions need dedicated test tasks
421
+
278
422
  ### Task Generation Process
279
423
 
280
424
  #### Step 1: Task Decomposition
@@ -293,18 +437,146 @@ For each task, identify:
293
437
  - **Soft dependencies**: Tasks that SHOULD complete for optimal execution
294
438
  - **No circular dependencies**: Validate the dependency graph is acyclic
295
439
 
440
+ Dependency Rule: Task B depends on Task A if:
441
+ - B requires output or artifacts from A
442
+ - B modifies code created by A
443
+ - B tests functionality implemented in A
444
+
296
445
  #### Step 3: Task Generation
297
446
 
447
+ ##### Frontmatter Structure
448
+
449
+ Example:
450
+ ```yaml
451
+ ---
452
+ id: 1
453
+ group: "user-authentication"
454
+ dependencies: [] # List of task IDs, e.g., [2, 3]
455
+ status: "pending" # pending | in-progress | completed | needs-clarification
456
+ created: "2024-01-15"
457
+ skills: ["react-components", "authentication"] # Technical skills required for this task
458
+ # Optional: Include complexity scores for high-complexity tasks or decomposition tracking
459
+ # complexity_score: 4.2 # Composite complexity score (only if >4 or decomposed)
460
+ # complexity_notes: "Decomposed from original task due to high technical depth"
461
+ ---
462
+ ```
463
+
464
+ The schema for this frontmatter is:
465
+ ```json
466
+ {
467
+ "type": "object",
468
+ "required": ["id", "group", "dependencies", "status", "created", "skills"],
469
+ "properties": {
470
+ "id": {
471
+ "type": ["number"],
472
+ "description": "Unique identifier for the task. An integer."
473
+ },
474
+ "group": {
475
+ "type": "string",
476
+ "description": "Group or category the task belongs to"
477
+ },
478
+ "dependencies": {
479
+ "type": "array",
480
+ "description": "List of task IDs this task depends on",
481
+ "items": {
482
+ "type": ["number"]
483
+ }
484
+ },
485
+ "status": {
486
+ "type": "string",
487
+ "enum": ["pending", "in-progress", "completed", "needs-clarification"],
488
+ "description": "Current status of the task"
489
+ },
490
+ "created": {
491
+ "type": "string",
492
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
493
+ "description": "Creation date in YYYY-MM-DD format"
494
+ },
495
+ "skills": {
496
+ "type": "array",
497
+ "description": "Technical skills required for this task (1-2 skills recommended)",
498
+ "items": {
499
+ "type": "string",
500
+ "pattern": "^[a-z][a-z0-9-]*$"
501
+ },
502
+ "minItems": 1,
503
+ "uniqueItems": true
504
+ },
505
+ "complexity_score": {
506
+ "type": "number",
507
+ "minimum": 1,
508
+ "maximum": 10,
509
+ "description": "Optional: Composite complexity score (include only if >4 or for decomposed tasks)"
510
+ },
511
+ "complexity_notes": {
512
+ "type": "string",
513
+ "description": "Optional: Rationale for complexity score or decomposition decisions"
514
+ }
515
+ },
516
+ "additionalProperties": false
517
+ }
518
+ ```
519
+
520
+ ##### Task Body Structure
521
+
298
522
  Use the task template in $root/.ai/task-manager/config/templates/TASK_TEMPLATE.md
299
523
 
300
- **Task ID Generation:**
524
+ ##### Task ID Generation
301
525
 
302
526
  When creating tasks, you need to determine the next available task ID for the specified plan. Use this bash command to automatically generate the correct ID:
303
527
 
304
528
  ```bash
305
- node $root/config/scripts/get-next-task-id.cjs [PLAN_ID from Step 1]
529
+ node $root/config/scripts/get-next-task-id.cjs [planId]
306
530
  ```
307
531
 
532
+ ### Validation Checklist
533
+ Before finalizing, ensure:
534
+
535
+ **Core Task Requirements:**
536
+ - [ ] Each task has 1-2 appropriate technical skills assigned
537
+ - [ ] Skills are automatically inferred from task objectives and technical requirements
538
+ - [ ] All dependencies form an acyclic graph
539
+ - [ ] Task IDs are unique and sequential
540
+ - [ ] Groups are consistent and meaningful
541
+ - [ ] Every **explicitly stated** task from the plan is covered
542
+ - [ ] No redundant or overlapping tasks
543
+
544
+ **Complexity Analysis & Controls:**
545
+ - [ ] **Complexity Analysis Complete**: All tasks assessed using 5-dimension scoring
546
+ - [ ] **Decomposition Applied**: Tasks with composite score ≥6 have been decomposed or justified
547
+ - [ ] **Final Task Complexity**: All final tasks have composite score ≤5 (target ≤4)
548
+ - [ ] **Iteration Limits Respected**: No task exceeded 3 decomposition rounds
549
+ - [ ] **Minimum Viability**: No tasks decomposed below complexity threshold of 3
550
+ - [ ] **Quality Gates Passed**: All decomposed tasks meet enhanced quality criteria
551
+ - [ ] **Dependency Integrity**: No circular dependencies or orphaned tasks exist
552
+ - [ ] **Error Handling Complete**: All edge cases resolved or escalated appropriately
553
+
554
+ **Complexity Documentation Requirements:**
555
+ - [ ] **Complexity Scores Documented**: Individual dimension scores recorded for complex tasks
556
+ - [ ] **Decomposition History**: Iteration tracking included in `complexity_notes` for decomposed tasks
557
+ - [ ] **Validation Status**: All tasks marked with appropriate validation outcomes
558
+ - [ ] **Escalation Documentation**: High-complexity tasks have clear escalation notes
559
+ - [ ] **Consistency Validated**: Complexity scores align with task descriptions and skills
560
+
561
+ **Scope & Quality Control:**
562
+ - [ ] **Minimization Applied**: Each task is absolutely necessary (20-30% reduction target)
563
+ - [ ] **Test Tasks are Meaningful**: Focus on business logic, not framework functionality
564
+ - [ ] **No Gold-plating**: Only plan requirements are addressed
565
+ - [ ] **Total Task Count**: Represents minimum viable implementation
566
+ - [ ] **Scope Preservation**: Decomposed tasks collectively match original requirements
567
+
568
+ **System Reliability:**
569
+ - [ ] **Error Conditions Resolved**: No unresolved error states remain
570
+ - [ ] **Manual Intervention Flagged**: Complex edge cases properly escalated
571
+ - [ ] **Quality Checkpoints**: All validation gates completed successfully
572
+ - [ ] **Dependency Graph Validated**: Full dependency analysis confirms acyclic, logical relationships
573
+
574
+ ### Error Handling
575
+ If the plan lacks sufficient detail:
576
+ - Note areas needing clarification
577
+ - Create placeholder tasks marked with `status: "needs-clarification"`
578
+ - Document assumptions made
579
+
308
580
  #### Step 4: POST_TASK_GENERATION_ALL hook
309
581
 
310
582
  Read and run the $root/.ai/task-manager/config/hooks/POST_TASK_GENERATION_ALL.md
@@ -342,7 +614,7 @@ Using the Plan ID from previous steps, execute the blueprint:
342
614
 
343
615
  You are the coordinator responsible for executing all tasks defined in the execution blueprint of a plan document, so choose an appropriate sub-agent for this role. Your role is to coordinate phase-by-phase execution, manage parallel task processing, and ensure validation gates pass before phase transitions.
344
616
 
345
- ### Critical Rules
617
+ ## Critical Rules
346
618
 
347
619
  1. **Never skip validation gates** - Phase progression requires successful validation
348
620
  2. **Maintain task isolation** - Parallel tasks must not interfere with each other
@@ -350,24 +622,65 @@ You are the coordinator responsible for executing all tasks defined in the execu
350
622
  4. **Document everything** - All decisions, issues, and outcomes must be recorded in the "Execution Summary", under "Noteworthy Events"
351
623
  5. **Fail safely** - Better to halt and request help than corrupt the execution state
352
624
 
353
- ### Input Requirements
354
- - A plan document with an execution blueprint section. See /TASK_MANAGER.md to find the plan with ID from Step 1
625
+ ## Input Requirements
626
+ - A plan document with an execution blueprint section. See /TASK_MANAGER.md to find the plan with ID [planId]
355
627
  - Task files with frontmatter metadata (id, group, dependencies, status)
356
628
  - Validation gates document: `/config/hooks/POST_PHASE.md`
357
629
 
358
- #### Input Error Handling
630
+ ### Input Error Handling
359
631
 
360
632
  If the plan does not exist, stop immediately and show an error to the user.
361
633
 
362
634
  **Note**: If tasks or the execution blueprint section are missing, they will be automatically generated before execution begins (see Task and Blueprint Validation below).
363
635
 
364
- #### Task and Blueprint Validation
636
+ ### Task and Blueprint Validation
365
637
 
366
638
  Before proceeding with execution, validate that tasks exist and the execution blueprint has been generated. If either is missing, automatically invoke task generation.
367
639
 
368
640
  **Validation Steps:**
369
641
 
370
- Use the task manager root discovered in Step 1 to extract validation results:
642
+ First, discover the task manager root directory:
643
+
644
+ ```bash
645
+ if [ ! -f /tmp/find-ai-task-manager-root.js ]; then
646
+ cat << 'EOF' > /tmp/find-ai-task-manager-root.js
647
+ const fs = require('fs');
648
+ const path = require('path');
649
+
650
+ const findRoot = (currentDir) => {
651
+ const taskManagerPath = path.join(currentDir, '.ai/task-manager');
652
+ const metadataPath = path.join(taskManagerPath, '.init-metadata.json');
653
+
654
+ try {
655
+ if (fs.existsSync(metadataPath) && JSON.parse(fs.readFileSync(metadataPath, 'utf8')).version) {
656
+ console.log(path.resolve(taskManagerPath));
657
+ process.exit(0);
658
+ }
659
+ } catch (e) {
660
+ // Continue searching
661
+ }
662
+
663
+ const parentDir = path.dirname(currentDir);
664
+ if (parentDir.length < currentDir.length) {
665
+ findRoot(parentDir);
666
+ } else {
667
+ process.exit(1);
668
+ }
669
+ };
670
+
671
+ findRoot(process.cwd());
672
+ EOF
673
+ fi
674
+
675
+ root=$(node /tmp/find-ai-task-manager-root.js)
676
+
677
+ if [ -z "$root" ]; then
678
+ echo "Error: Could not find task manager root directory (.ai/task-manager)"
679
+ exit 1
680
+ fi
681
+ ```
682
+
683
+ Then extract validation results:
371
684
 
372
685
  ```bash
373
686
  # Extract validation results directly from script
@@ -377,18 +690,54 @@ task_count=$(node $root/config/scripts/validate-plan-blueprint.cjs [planId] task
377
690
  blueprint_exists=$(node $root/config/scripts/validate-plan-blueprint.cjs [planId] blueprintExists)
378
691
  ```
379
692
 
693
+ 4. **Automatic task generation**:
694
+
380
695
  If either `$task_count` is 0 or `$blueprint_exists` is "no":
381
696
  - Display notification to user: "⚠️ Tasks or execution blueprint not found. Generating tasks automatically..."
697
+ - Execute the embedded task generation process below
698
+
699
+ ## Embedded Task Generation
700
+
701
+ Follow ALL instructions from `.*/**/generate-tasks.md` exactly for plan ID [planId]. It is important that you find and read the `generate-tasks.md` command first.
702
+
703
+ This includes:
704
+ - Reading and processing the plan document
705
+ - Applying task minimization principles (20-30% reduction target)
706
+ - Creating atomic tasks with 1-2 skills each
707
+ - Generating proper task files with frontmatter and body structure
708
+ - Running all validation checklists
709
+ - Executing the POST_TASK_GENERATION_ALL hook
382
710
 
383
- ### Execution Process
711
+ ## Resume Blueprint Execution
384
712
 
385
- Use your internal Todo task tool to track the execution of all phases, and the final update of the plan with the summary.
713
+ After task generation completes, continue with execution below.
386
714
 
387
- #### Phase Pre-Execution
715
+ Otherwise, if tasks exist, proceed directly to execution.
716
+
717
+ ## Execution Process
718
+
719
+ Use your internal Todo task tool to track the execution of all phases, and the final update of the plan with the summary. Example:
720
+
721
+ - [ ] Create feature branch via `node $root/config/scripts/create-feature-branch.cjs [planId]`
722
+ - [ ] Validate or auto-generate tasks and execution blueprint if missing.
723
+ - [ ] Execute $root/.ai/task-manager/config/hooks/PRE_PHASE.md hook before Phase 1.
724
+ - [ ] Phase 1: Execute 1 task(s) in parallel.
725
+ - [ ] Execute $root/.ai/task-manager/config/hooks/POST_PHASE.md hook after Phase 1.
726
+ - [ ] Execute $root/.ai/task-manager/config/hooks/PRE_PHASE.md hook before Phase 2.
727
+ - [ ] Phase 2: Execute 3 task(s) in parallel.
728
+ - [ ] Execute $root/.ai/task-manager/config/hooks/POST_PHASE.md hook after Phase 2.
729
+ - [ ] Execute $root/.ai/task-manager/config/hooks/PRE_PHASE.md hook before Phase 3.
730
+ - [ ] Phase 3: Execute 1 task(s) in parallel.
731
+ - [ ] Execute $root/.ai/task-manager/config/hooks/POST_PHASE.md hook after Phase 3.
732
+ - [ ] Execute $root/.ai/task-manager/config/hooks/POST_EXECUTION.md hook after all phases complete.
733
+ - [ ] Update the Plan 7 with execution summary using $root/.ai/task-manager/config/hooks/EXECUTION_SUMMARY_TEMPLATE.md.
734
+ - [ ] Archive Plan 7.
735
+
736
+ ### Phase Pre-Execution
388
737
 
389
738
  Read and execute $root/.ai/task-manager/config/hooks/PRE_PHASE.md
390
739
 
391
- #### Phase Execution Workflow
740
+ ### Phase Execution Workflow
392
741
 
393
742
  1. **Phase Initialization**
394
743
  - Identify current phase from the execution blueprint
@@ -408,16 +757,22 @@ Read and execute $root/.ai/task-manager/config/hooks/PRE_TASK_ASSIGNMENT.md
408
757
  - Collect and review all task outputs
409
758
  - Document any issues or exceptions encountered
410
759
 
411
- #### Phase Post-Execution
760
+ ### Phase Post-Execution
412
761
 
413
762
  Read and execute $root/.ai/task-manager/config/hooks/POST_PHASE.md
414
763
 
415
- #### Phase Transition
416
764
 
417
- - Update phase status to "completed" in the Blueprint section of the plan document.
765
+ ### Phase Transition
766
+
767
+ - Update phase status to "completed" in the Blueprint section of the plan [planId] document.
418
768
  - Initialize next phase
419
769
  - Repeat process until all phases are complete
420
770
 
771
+ ### Error Handling
772
+
773
+ #### Validation Gate Failures
774
+ Read and execute $root/.ai/task-manager/config/hooks/POST_ERROR_DETECTION.md
775
+
421
776
  ### Output Requirements
422
777
 
423
778
  **Output Behavior:**
@@ -439,7 +794,14 @@ Execution Summary:
439
794
 
440
795
  This structured output enables automated workflow coordination and must be included even when running standalone.
441
796
 
442
- ### Post-Execution Processing
797
+ ## Optimization Guidelines
798
+
799
+ - **Maximize parallelism**: Always run all available tasks in a phase simultaneously
800
+ - **Resource awareness**: Balance agent allocation with system capabilities
801
+ - **Early failure detection**: Monitor tasks actively to catch issues quickly
802
+ - **Continuous improvement**: Note patterns for future blueprint optimization
803
+
804
+ ## Post-Execution Processing
443
805
 
444
806
  Upon successful completion of all phases and validation gates, perform the following additional steps:
445
807
 
@@ -447,17 +809,17 @@ Upon successful completion of all phases and validation gates, perform the follo
447
809
  - [ ] Execution Summary Generation
448
810
  - [ ] Plan Archival
449
811
 
450
- #### Post-Execution Validation
812
+ ### 0. Post-Execution Validation
451
813
 
452
814
  Read and execute $root/.ai/task-manager/config/hooks/POST_EXECUTION.md
453
815
 
454
816
  If validation fails, halt execution. The plan remains in `plans/` for debugging.
455
817
 
456
- #### Execution Summary Generation
818
+ ### 1. Execution Summary Generation
457
819
 
458
820
  Append an execution summary section to the plan document with the format described in $root/.ai/task-manager/config/templates/EXECUTION_SUMMARY_TEMPLATE.md
459
821
 
460
- #### Plan Archival
822
+ ### 2. Plan Archival
461
823
 
462
824
  After successfully appending the execution summary:
463
825
 
@@ -466,6 +828,13 @@ After successfully appending the execution summary:
466
828
  mv $root/.ai/task-manager/plans/[plan-folder] $root/.ai/task-manager/archive/
467
829
  ```
468
830
 
831
+ ### Important Notes
832
+
833
+ - **Only archive on complete success**: Archive operations should only occur when ALL phases are completed and ALL validation gates have passed
834
+ - **Failed executions remain active**: Plans that fail execution or validation should remain in the `plans/` directory for debugging and potential re-execution
835
+ - **Error handling**: If archival fails, log the error but do not fail the overall execution - the implementation work is complete
836
+ - **Preserve structure**: The entire plan folder (including all tasks and subdirectories) should be moved as-is to maintain referential integrity
837
+
469
838
  **Progress**: ⬛⬛⬛ 100% - Step 3/3: Blueprint Execution Complete
470
839
 
471
840
  ---