@e0ipso/ai-task-manager 1.36.1 → 1.38.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.
Files changed (72) hide show
  1. package/README.md +26 -21
  2. package/dist/cli.js +1 -32
  3. package/dist/cli.js.map +1 -1
  4. package/dist/conflict-detector.d.ts.map +1 -1
  5. package/dist/conflict-detector.js +0 -4
  6. package/dist/conflict-detector.js.map +1 -1
  7. package/dist/index.d.ts +3 -16
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +50 -245
  10. package/dist/index.js.map +1 -1
  11. package/dist/metadata.d.ts +9 -0
  12. package/dist/metadata.d.ts.map +1 -1
  13. package/dist/metadata.js +14 -0
  14. package/dist/metadata.js.map +1 -1
  15. package/dist/types.d.ts +18 -18
  16. package/dist/types.d.ts.map +1 -1
  17. package/dist/utils.d.ts +27 -58
  18. package/dist/utils.d.ts.map +1 -1
  19. package/dist/utils.js +93 -219
  20. package/dist/utils.js.map +1 -1
  21. package/package.json +4 -2
  22. package/templates/ai-task-manager/config/TASK_MANAGER.md +3 -3
  23. package/templates/ai-task-manager/config/hooks/PRE_PHASE.md +6 -26
  24. package/templates/ai-task-manager/config/hooks/PRE_TASK_ASSIGNMENT.md +6 -24
  25. package/templates/ai-task-manager/config/templates/PLAN_TEMPLATE.md +1 -1
  26. package/templates/{assistant → harness}/agents/plan-creator.md +2 -2
  27. package/templates/harness/skills/task-create-plan/SKILL.md +120 -0
  28. package/templates/harness/skills/task-create-plan/scripts/find-task-manager-root.cjs +116 -0
  29. package/templates/harness/skills/task-create-plan/scripts/get-next-plan-id.cjs +214 -0
  30. package/templates/harness/skills/task-execute-blueprint/SKILL.md +139 -0
  31. package/templates/harness/skills/task-execute-blueprint/scripts/create-feature-branch.cjs +376 -0
  32. package/templates/harness/skills/task-execute-blueprint/scripts/find-task-manager-root.cjs +116 -0
  33. package/templates/harness/skills/task-execute-blueprint/scripts/validate-plan-blueprint.cjs +375 -0
  34. package/templates/harness/skills/task-execute-task/SKILL.md +195 -0
  35. package/templates/harness/skills/task-execute-task/scripts/check-task-dependencies.cjs +437 -0
  36. package/templates/harness/skills/task-execute-task/scripts/find-task-manager-root.cjs +116 -0
  37. package/templates/harness/skills/task-execute-task/scripts/validate-plan-blueprint.cjs +375 -0
  38. package/templates/harness/skills/task-full-workflow/SKILL.md +378 -0
  39. package/templates/harness/skills/task-full-workflow/scripts/create-feature-branch.cjs +376 -0
  40. package/templates/harness/skills/task-full-workflow/scripts/find-task-manager-root.cjs +116 -0
  41. package/templates/harness/skills/task-full-workflow/scripts/get-next-plan-id.cjs +214 -0
  42. package/templates/harness/skills/task-full-workflow/scripts/get-next-task-id.cjs +312 -0
  43. package/templates/harness/skills/task-full-workflow/scripts/validate-plan-blueprint.cjs +375 -0
  44. package/templates/harness/skills/task-generate-tasks/SKILL.md +244 -0
  45. package/templates/harness/skills/task-generate-tasks/scripts/find-task-manager-root.cjs +116 -0
  46. package/templates/harness/skills/task-generate-tasks/scripts/get-next-task-id.cjs +312 -0
  47. package/templates/harness/skills/task-generate-tasks/scripts/validate-plan-blueprint.cjs +375 -0
  48. package/templates/harness/skills/task-refine-plan/SKILL.md +205 -0
  49. package/templates/harness/skills/task-refine-plan/scripts/find-task-manager-root.cjs +116 -0
  50. package/templates/harness/skills/task-refine-plan/scripts/validate-plan-blueprint.cjs +375 -0
  51. package/dist/exec.d.ts +0 -13
  52. package/dist/exec.d.ts.map +0 -1
  53. package/dist/exec.js +0 -261
  54. package/dist/exec.js.map +0 -1
  55. package/templates/ai-task-manager/config/scripts/check-task-dependencies.cjs +0 -240
  56. package/templates/ai-task-manager/config/scripts/compose-prompt.cjs +0 -234
  57. package/templates/ai-task-manager/config/scripts/create-feature-branch.cjs +0 -204
  58. package/templates/ai-task-manager/config/scripts/extract-task-skills.cjs +0 -84
  59. package/templates/ai-task-manager/config/scripts/find-root.cjs +0 -10
  60. package/templates/ai-task-manager/config/scripts/get-next-plan-id.cjs +0 -49
  61. package/templates/ai-task-manager/config/scripts/get-next-task-id.cjs +0 -81
  62. package/templates/ai-task-manager/config/scripts/shared-utils.cjs +0 -418
  63. package/templates/ai-task-manager/config/scripts/validate-plan-blueprint.cjs +0 -138
  64. package/templates/assistant/commands/tasks/create-plan-auto.md +0 -174
  65. package/templates/assistant/commands/tasks/create-plan.md +0 -175
  66. package/templates/assistant/commands/tasks/execute-blueprint.md +0 -233
  67. package/templates/assistant/commands/tasks/execute-task.md +0 -351
  68. package/templates/assistant/commands/tasks/fix-broken-tests.md +0 -44
  69. package/templates/assistant/commands/tasks/full-workflow.md +0 -849
  70. package/templates/assistant/commands/tasks/generate-tasks.md +0 -348
  71. package/templates/assistant/commands/tasks/refine-plan-auto.md +0 -172
  72. package/templates/assistant/commands/tasks/refine-plan.md +0 -163
@@ -1,849 +0,0 @@
1
- ---
2
- argument-hint: "[userPrompt]"
3
- description: Execute the full workflow from plan creation to blueprint execution.
4
- ---
5
-
6
- # Full Workflow Execution
7
-
8
- You are a workflow composition assistant. Your role is to execute the complete task management workflow from plan creation through blueprint execution **without pausing between steps**. This is a fully automated workflow that executes all three steps sequentially.
9
-
10
- ---
11
-
12
- ## Find the AI Task Manager root
13
-
14
- ```bash
15
- if [ ! -f /tmp/find-ai-task-manager-root.js ]; then
16
- cat << 'EOF' > /tmp/find-ai-task-manager-root.js
17
- const fs = require('fs');
18
- const path = require('path');
19
-
20
- const findRoot = (currentDir) => {
21
- const taskManagerPath = path.join(currentDir, '.ai/task-manager');
22
- const metadataPath = path.join(taskManagerPath, '.init-metadata.json');
23
-
24
- try {
25
- if (fs.existsSync(metadataPath) && JSON.parse(fs.readFileSync(metadataPath, 'utf8')).version) {
26
- console.log(path.resolve(taskManagerPath));
27
- process.exit(0);
28
- }
29
- } catch (e) {
30
- // Continue searching
31
- }
32
-
33
- const parentDir = path.dirname(currentDir);
34
- if (parentDir.length < currentDir.length) {
35
- findRoot(parentDir);
36
- } else {
37
- process.exit(1);
38
- }
39
- };
40
-
41
- findRoot(process.cwd());
42
- EOF
43
- fi
44
-
45
- root=$(node /tmp/find-ai-task-manager-root.js)
46
-
47
- if [ -z "$root" ]; then
48
- echo "Error: Could not find task manager root directory (.ai/task-manager)"
49
- exit 1
50
- fi
51
- ```
52
-
53
- ## Workflow Execution Instructions
54
-
55
- **CRITICAL**: Execute all three steps sequentially without waiting for user input between steps. Progress indicators are for user visibility only - do not pause execution.
56
-
57
- The user input is:
58
-
59
- <user-input>
60
- $ARGUMENTS
61
- </user-input>
62
-
63
- If no user input is provided, stop immediately and show an error message to the user.
64
-
65
- ### Context Passing Between Steps
66
-
67
- **How information flows through the workflow:**
68
- 1. User provides prompt → use as input in Step 1
69
- 2. Step 1 outputs "Plan ID: X" in structured format → extract X, use in Step 2
70
- 3. Step 2 outputs "Tasks: Y" in structured format → use for progress tracking in Step 3
71
-
72
- Use your internal Todo task tool to track the workflow execution:
73
-
74
- - [ ] Step 1: Create Plan
75
- - [ ] Step 2: Generate Tasks
76
- - [ ] Step 3: Execute Blueprint
77
-
78
- ---
79
-
80
- ## Step 1: Plan Creation
81
-
82
- **Progress**: ⬛⬜⬜ 0% - Step 1/3: Starting Plan Creation
83
-
84
- Execute the following plan creation process:
85
-
86
- For this step, think hard to create detailed, actionable plans based on the user input while
87
- ensuring you have all necessary context before proceeding. Use the plan-creator sub-agent for this if it is available.
88
-
89
- Use tools for the planning. You are encouraged to write your own specialized tools to research, analyze, and debug
90
- any work order from the user. You are not restricted to the stack of the current project to create your own
91
- specialized tools.
92
-
93
- ## Find the AI Task Manager root
94
-
95
- ```bash
96
- if [ ! -f /tmp/find-ai-task-manager-root.js ]; then
97
- cat << 'EOF' > /tmp/find-ai-task-manager-root.js
98
- const fs = require('fs');
99
- const path = require('path');
100
-
101
- const findRoot = (currentDir) => {
102
- const taskManagerPath = path.join(currentDir, '.ai/task-manager');
103
- const metadataPath = path.join(taskManagerPath, '.init-metadata.json');
104
-
105
- try {
106
- if (fs.existsSync(metadataPath) && JSON.parse(fs.readFileSync(metadataPath, 'utf8')).version) {
107
- console.log(path.resolve(taskManagerPath));
108
- process.exit(0);
109
- }
110
- } catch (e) {
111
- // Continue searching
112
- }
113
-
114
- const parentDir = path.dirname(currentDir);
115
- if (parentDir.length < currentDir.length) {
116
- findRoot(parentDir);
117
- } else {
118
- process.exit(1);
119
- }
120
- };
121
-
122
- findRoot(process.cwd());
123
- EOF
124
- fi
125
-
126
- root=$(node /tmp/find-ai-task-manager-root.js)
127
-
128
- if [ -z "$root" ]; then
129
- echo "Error: Could not find task manager root directory (.ai/task-manager)"
130
- exit 1
131
- fi
132
- ```
133
-
134
- ## Instructions
135
-
136
- Include $root/.ai/task-manager/config/TASK_MANAGER.md for the directory structure of tasks.
137
-
138
- The user input is:
139
-
140
- <user-input>
141
- $ARGUMENTS
142
- </user-input>
143
-
144
- If no user input is provided stop immediately and show an error message to the user.
145
-
146
- ### Process Checklist
147
-
148
- Use your internal Todo task tool to track the following plan generation:
149
-
150
- - [ ] Read and execute $root/.ai/task-manager/config/hooks/PRE_PLAN.md
151
- - [ ] User input and context analysis
152
- - [ ] Clarification questions
153
- - [ ] Plan generation
154
- - [ ] Read and execute $root/.ai/task-manager/config/hooks/POST_PLAN.md
155
-
156
- #### Step 1: Context Analysis
157
- Before creating any plan, analyze the user's request for:
158
- - **Objective**: What is the end goal?
159
- - **Scope**: What are the boundaries and constraints?
160
- - **Resources**: What tools, libraries, or infrastructure are available?
161
- - **Success Criteria**: How will success be measured?
162
- - **Dependencies**: What prerequisites or blockers exist?
163
- - **Technical Requirements**: What technologies or skills are needed?
164
-
165
- #### Step 2: Clarification Phase
166
- If any critical context is missing:
167
- 1. Identify specific gaps in the information provided
168
- 2. Ask targeted follow-up questions
169
- 3. Frame questions clearly with examples when helpful
170
- 4. Be extra cautious. Users miss important context very often. Don't hesitate to ask for additional clarifications.
171
- 5. Make sure to get explicit confirmation of weather the user wants to maintain backwards compatibility or not.
172
-
173
- Try to answer your own questions first by inspecting the codebase, docs, and assistant documents like CLAUDE.md, GEMINI.md, AGENTS.md ...
174
-
175
- 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.
176
-
177
- #### Step 3: Plan Generation
178
- Step 3 starts only after all items in Step 2 have been executed.
179
-
180
- Only after confirming sufficient context, create a plan according to the $root/.ai/task-manager/config/templates/PLAN_TEMPLATE.md
181
-
182
- ##### CRITICAL: Output Format
183
-
184
- 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.
185
-
186
- **Output Behavior: CRITICAL - Structured Output for Command Coordination**
187
-
188
- Always end your output with a standardized summary in this exact format, for command coordination:
189
-
190
- ```
191
- ---
192
-
193
- Plan Summary:
194
- - Plan ID: [numeric-id]
195
- - Plan File: [full-path-to-plan-file]
196
- ```
197
-
198
- This structured output enables automated workflow coordination and must be included even when running standalone.
199
-
200
- ###### Patterns to Avoid
201
- Do not include the following in your plan output.
202
- - Avoid time estimations
203
- - Avoid task lists and mentions of phases (those are things we'll introduce later)
204
- - Avoid code examples
205
-
206
- ###### Frontmatter Structure
207
-
208
- Example:
209
- ```yaml
210
- ---
211
- id: 1
212
- summary: "Implement a comprehensive CI/CD pipeline using GitHub Actions for automated linting, testing, semantic versioning, and NPM publishing"
213
- created: 2025-09-01
214
- ---
215
- ```
216
-
217
- The schema for this frontmatter is:
218
- ```json
219
- {
220
- "type": "object",
221
- "required": ["id", "summary", "created"],
222
- "properties": {
223
- "id": {
224
- "type": ["number"],
225
- "description": "Unique identifier for the task. An integer."
226
- },
227
- "summary": {
228
- "type": "string",
229
- "description": "A summary of the plan"
230
- },
231
- "created": {
232
- "type": "string",
233
- "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
234
- "description": "Creation date in YYYY-MM-DD format"
235
- }
236
- },
237
- "additionalProperties": false
238
- }
239
- ```
240
-
241
- ### Plan ID Generation
242
-
243
- Execute this script to determine the plan ID:
244
-
245
- ```bash
246
- next_id=$(node $root/config/scripts/get-next-plan-id.cjs)
247
- ```
248
-
249
- **Key formatting:**
250
- - **Front-matter**: Use numeric values (`id: 7`)
251
- - **Directory names**: Use zero-padded strings (`07--plan-name`)
252
-
253
- **After completing Step 1:**
254
- - Extract the Plan ID from the structured output
255
- - Extract the Plan File path from the structured output
256
-
257
- **Progress**: ⬛⬜⬜ 33% - Step 1/3: Plan Creation Complete
258
-
259
- ---
260
-
261
- ## Step 2: Task Generation
262
-
263
- **Progress**: ⬛⬜⬜ 33% - Step 2/3: Starting Task Generation
264
-
265
- Using the Plan ID extracted from Step 1, execute task generation:
266
-
267
- ## Find the AI Task Manager root
268
-
269
- ```bash
270
- if [ ! -f /tmp/find-ai-task-manager-root.js ]; then
271
- cat << 'EOF' > /tmp/find-ai-task-manager-root.js
272
- const fs = require('fs');
273
- const path = require('path');
274
-
275
- const findRoot = (currentDir) => {
276
- const taskManagerPath = path.join(currentDir, '.ai/task-manager');
277
- const metadataPath = path.join(taskManagerPath, '.init-metadata.json');
278
-
279
- try {
280
- if (fs.existsSync(metadataPath) && JSON.parse(fs.readFileSync(metadataPath, 'utf8')).version) {
281
- console.log(path.resolve(taskManagerPath));
282
- process.exit(0);
283
- }
284
- } catch (e) {
285
- // Continue searching
286
- }
287
-
288
- const parentDir = path.dirname(currentDir);
289
- if (parentDir.length < currentDir.length) {
290
- findRoot(parentDir);
291
- } else {
292
- process.exit(1);
293
- }
294
- };
295
-
296
- findRoot(process.cwd());
297
- EOF
298
- fi
299
-
300
- root=$(node /tmp/find-ai-task-manager-root.js)
301
-
302
- if [ -z "$root" ]; then
303
- echo "Error: Could not find task manager root directory (.ai/task-manager)"
304
- exit 1
305
- fi
306
- ```
307
-
308
- 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.
309
-
310
- Include `$root/.ai/task-manager/config/TASK_MANAGER.md` for the directory structure of tasks.
311
-
312
- ## Instructions
313
-
314
- You will think hard to analyze the provided plan document and decompose it into atomic, actionable tasks with clear dependencies and groupings.
315
-
316
- Use your internal Todo task tool to track the following process:
317
-
318
- - [ ] Read and process plan [planId]
319
- - [ ] Use the Task Generation Process to create tasks according to the Task Creation Guidelines
320
- - [ ] Read and run the $root/.ai/task-manager/config/hooks/POST_TASK_GENERATION_ALL.md
321
-
322
- ### Input
323
-
324
- - A plan document. Extract it with the following command.
325
-
326
- ```bash
327
- # Extract validation results directly from script
328
- plan_file=$(node $root/config/scripts/validate-plan-blueprint.cjs [planId] planFile)
329
- ```
330
-
331
- ### Input Error Handling
332
- If the plan does not exist. Stop immediately and show an error to the user.
333
-
334
- ### Task Creation Guidelines
335
-
336
- #### Task Minimization Principles
337
- **Core Constraint:** Create only the minimum number of tasks necessary to satisfy the plan requirements. Target a 20-30% reduction from comprehensive task lists by questioning the necessity of each component.
338
-
339
- **Minimization Rules:**
340
- - **Direct Implementation Only**: Create tasks for explicitly stated requirements, not "nice-to-have" features
341
- - **DRY Task Principle**: Each task should have a unique, non-overlapping purpose
342
- - **Question Everything**: For each task, ask "Is this absolutely necessary to meet the plan objectives?"
343
- - **Avoid Gold-plating**: Resist the urge to add comprehensive features not explicitly required
344
-
345
- **Antipatterns to Avoid:**
346
- - Creating separate tasks for "error handling" when it can be included in the main implementation
347
- - Breaking simple operations into multiple tasks (e.g., separate "validate input" and "process input" tasks)
348
- - Adding tasks for "future extensibility" or "best practices" not mentioned in the plan
349
- - Creating comprehensive test suites for trivial functionality
350
-
351
- #### Task Granularity
352
- Each task must be:
353
- - **Single-purpose**: One clear deliverable or outcome
354
- - **Atomic**: Cannot be meaningfully split further
355
- - **Skill-specific**: Executable by a single skill agent (examples below)
356
- - **Verifiable**: Has clear completion criteria
357
-
358
- #### Skill Selection and Technical Requirements
359
-
360
- **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.
361
-
362
- **Skill Selection Criteria**:
363
- 1. **Technical Specificity**: Choose skills that directly match the technical work required
364
- 2. **Agent Specialization**: Select skills that allow a single skilled agent to complete the task
365
- 3. **Minimal Overlap**: Avoid combining unrelated skill domains in a single task
366
- 4. **Creative Inference**: Derive skills from task objectives and implementation context
367
-
368
- **Inspirational Skill Examples** (use kebab-case format):
369
- - Frontend: `react-components`, `css`, `js`, `vue-components`, `html`
370
- - Backend: `api-endpoints`, `database`, `authentication`, `server-config`
371
- - Testing: `jest`, `playwright`, `unit-testing`, `e2e-testing`
372
- - DevOps: `docker`, `github-actions`, `deployment`, `ci-cd`
373
- - Languages: `typescript`, `python`, `php`, `bash`, `sql`
374
- - Frameworks: `nextjs`, `express`, `drupal-backend`, `wordpress-plugins`
375
-
376
- **Automatic Skill Inference Examples**:
377
- - "Create user login form" → `["react-components", "authentication"]`
378
- - "Build REST API for orders" → `["api-endpoints", "database"]`
379
- - "Add Docker deployment" → `["docker", "deployment"]`
380
- - "Write Jest tests for utils" → `["jest"]`
381
-
382
- **Assignment Guidelines**:
383
- - **1 skill**: Focused, single-domain tasks
384
- - **2 skills**: Tasks requiring complementary domains
385
- - **Split if 3+**: Indicates task should be broken down
386
-
387
- ```
388
- # Examples
389
- skills: ["css"] # Pure styling
390
- skills: ["api-endpoints", "database"] # API with persistence
391
- skills: ["react-components", "jest"] # Implementation + testing
392
- ```
393
-
394
- #### Meaningful Test Strategy Guidelines
395
-
396
- **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.
397
-
398
- Your critical mantra for test generation is: "write a few tests, mostly integration".
399
-
400
- **Definition of "Meaningful Tests":**
401
- 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.
402
-
403
- **When TO Write Tests:**
404
- - Custom business logic and algorithms
405
- - Critical user workflows and data transformations
406
- - Edge cases and error conditions for core functionality
407
- - Integration points between different system components
408
- - Complex validation logic or calculations
409
-
410
- **When NOT to Write Tests:**
411
- - Third-party library functionality (already tested upstream)
412
- - Framework features (React hooks, Express middleware, etc.)
413
- - Simple CRUD operations without custom logic
414
- - Getter/setter methods or basic property access
415
- - Configuration files or static data
416
- - Obvious functionality that would break immediately if incorrect
417
-
418
- **Test Task Creation Rules:**
419
- - Combine related test scenarios into single tasks (e.g., "Test user authentication flow" not separate tasks for login, logout, validation)
420
- - Focus on integration and critical path testing over unit test coverage
421
- - Avoid creating separate tasks for testing each CRUD operation individually
422
- - Question whether simple functions need dedicated test tasks
423
-
424
- ### Task Generation Process
425
-
426
- #### Step 1: Task Decomposition
427
- 1. Read through the entire plan
428
- 2. Identify all concrete deliverables **explicitly stated** in the plan
429
- 3. Apply minimization principles: question necessity of each potential task
430
- 4. Break each deliverable into atomic tasks (only if genuinely needed)
431
- 5. Ensure no task requires multiple skill sets
432
- 6. Verify each task has clear inputs and outputs
433
- 7. **Minimize test tasks**: Combine related testing scenarios, avoid testing framework functionality
434
- 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>`.
435
-
436
- #### Step 2: Dependency Analysis
437
- For each task, identify:
438
- - **Hard dependencies**: Tasks that MUST complete before this can start
439
- - **Soft dependencies**: Tasks that SHOULD complete for optimal execution
440
- - **No circular dependencies**: Validate the dependency graph is acyclic
441
-
442
- Dependency Rule: Task B depends on Task A if:
443
- - B requires output or artifacts from A
444
- - B modifies code created by A
445
- - B tests functionality implemented in A
446
-
447
- #### Step 3: Task Generation
448
-
449
- ##### Frontmatter Structure
450
-
451
- Example:
452
- ```yaml
453
- ---
454
- id: 1
455
- group: "user-authentication"
456
- dependencies: [] # List of task IDs, e.g., [2, 3]
457
- status: "pending" # pending | in-progress | completed | needs-clarification
458
- created: "2024-01-15"
459
- skills: ["react-components", "authentication"] # Technical skills required for this task
460
- # Optional: Include complexity scores for high-complexity tasks or decomposition tracking
461
- # complexity_score: 4.2 # Composite complexity score (only if >4 or decomposed)
462
- # complexity_notes: "Decomposed from original task due to high technical depth"
463
- ---
464
- ```
465
-
466
- The schema for this frontmatter is:
467
- ```json
468
- {
469
- "type": "object",
470
- "required": ["id", "group", "dependencies", "status", "created", "skills"],
471
- "properties": {
472
- "id": {
473
- "type": ["number"],
474
- "description": "Unique identifier for the task. An integer."
475
- },
476
- "group": {
477
- "type": "string",
478
- "description": "Group or category the task belongs to"
479
- },
480
- "dependencies": {
481
- "type": "array",
482
- "description": "List of task IDs this task depends on",
483
- "items": {
484
- "type": ["number"]
485
- }
486
- },
487
- "status": {
488
- "type": "string",
489
- "enum": ["pending", "in-progress", "completed", "needs-clarification"],
490
- "description": "Current status of the task"
491
- },
492
- "created": {
493
- "type": "string",
494
- "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
495
- "description": "Creation date in YYYY-MM-DD format"
496
- },
497
- "skills": {
498
- "type": "array",
499
- "description": "Technical skills required for this task (1-2 skills recommended)",
500
- "items": {
501
- "type": "string",
502
- "pattern": "^[a-z][a-z0-9-]*$"
503
- },
504
- "minItems": 1,
505
- "uniqueItems": true
506
- },
507
- "complexity_score": {
508
- "type": "number",
509
- "minimum": 1,
510
- "maximum": 10,
511
- "description": "Optional: Composite complexity score (include only if >4 or for decomposed tasks)"
512
- },
513
- "complexity_notes": {
514
- "type": "string",
515
- "description": "Optional: Rationale for complexity score or decomposition decisions"
516
- }
517
- },
518
- "additionalProperties": false
519
- }
520
- ```
521
-
522
- ##### Task Body Structure
523
-
524
- Use the task template in $root/.ai/task-manager/config/templates/TASK_TEMPLATE.md
525
-
526
- ##### Task ID Generation
527
-
528
- 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:
529
-
530
- ```bash
531
- node $root/config/scripts/get-next-task-id.cjs [planId]
532
- ```
533
-
534
- ### Validation Checklist
535
- Before finalizing, ensure:
536
-
537
- **Core Task Requirements:**
538
- - [ ] Each task has 1-2 appropriate technical skills assigned
539
- - [ ] Skills are automatically inferred from task objectives and technical requirements
540
- - [ ] All dependencies form an acyclic graph
541
- - [ ] Task IDs are unique and sequential
542
- - [ ] Groups are consistent and meaningful
543
- - [ ] Every **explicitly stated** task from the plan is covered
544
- - [ ] No redundant or overlapping tasks
545
-
546
- **Complexity Analysis & Controls:**
547
- - [ ] **Complexity Analysis Complete**: All tasks assessed using 5-dimension scoring
548
- - [ ] **Decomposition Applied**: Tasks with composite score ≥6 have been decomposed or justified
549
- - [ ] **Final Task Complexity**: All final tasks have composite score ≤5 (target ≤4)
550
- - [ ] **Iteration Limits Respected**: No task exceeded 3 decomposition rounds
551
- - [ ] **Minimum Viability**: No tasks decomposed below complexity threshold of 3
552
- - [ ] **Quality Gates Passed**: All decomposed tasks meet enhanced quality criteria
553
- - [ ] **Dependency Integrity**: No circular dependencies or orphaned tasks exist
554
- - [ ] **Error Handling Complete**: All edge cases resolved or escalated appropriately
555
-
556
- **Complexity Documentation Requirements:**
557
- - [ ] **Complexity Scores Documented**: Individual dimension scores recorded for complex tasks
558
- - [ ] **Decomposition History**: Iteration tracking included in `complexity_notes` for decomposed tasks
559
- - [ ] **Validation Status**: All tasks marked with appropriate validation outcomes
560
- - [ ] **Escalation Documentation**: High-complexity tasks have clear escalation notes
561
- - [ ] **Consistency Validated**: Complexity scores align with task descriptions and skills
562
-
563
- **Scope & Quality Control:**
564
- - [ ] **Minimization Applied**: Each task is absolutely necessary (20-30% reduction target)
565
- - [ ] **Test Tasks are Meaningful**: Focus on business logic, not framework functionality
566
- - [ ] **No Gold-plating**: Only plan requirements are addressed
567
- - [ ] **Total Task Count**: Represents minimum viable implementation
568
- - [ ] **Scope Preservation**: Decomposed tasks collectively match original requirements
569
-
570
- **System Reliability:**
571
- - [ ] **Error Conditions Resolved**: No unresolved error states remain
572
- - [ ] **Manual Intervention Flagged**: Complex edge cases properly escalated
573
- - [ ] **Quality Checkpoints**: All validation gates completed successfully
574
- - [ ] **Dependency Graph Validated**: Full dependency analysis confirms acyclic, logical relationships
575
-
576
- ### Error Handling
577
- If the plan lacks sufficient detail:
578
- - Note areas needing clarification
579
- - Create placeholder tasks marked with `status: "needs-clarification"`
580
- - Document assumptions made
581
-
582
- #### Step 4: POST_TASK_GENERATION_ALL hook
583
-
584
- Read and run the $root/.ai/task-manager/config/hooks/POST_TASK_GENERATION_ALL.md
585
-
586
- ### Output Requirements
587
-
588
- **Output Behavior:**
589
-
590
- Provide a concise completion message with task count and location:
591
- - Example: "Task generation complete. Created [count] tasks in `$root/.ai/task-manager/plans/[plan-id]--[name]/tasks/`"
592
-
593
- **CRITICAL - Structured Output for Command Coordination:**
594
-
595
- Always end your output with a standardized summary in this exact format:
596
-
597
- ```
598
- ---
599
- Task Generation Summary:
600
- - Plan ID: [numeric-id]
601
- - Tasks: [count]
602
- - Status: Ready for execution
603
- ```
604
-
605
- This structured output enables automated workflow coordination and must be included even when running standalone.
606
-
607
- **Progress**: ⬛⬛⬜ 66% - Step 2/3: Task Generation Complete
608
-
609
- ---
610
-
611
- ## Step 3: Blueprint Execution
612
-
613
- **Progress**: ⬛⬛⬜ 66% - Step 3/3: Starting Blueprint Execution
614
-
615
- Using the Plan ID from previous steps, execute the blueprint:
616
-
617
- 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.
618
-
619
- ## Critical Rules
620
-
621
- 1. **Never skip validation gates** - Phase progression requires successful validation
622
- 2. **Maintain task isolation** - Parallel tasks must not interfere with each other
623
- 3. **Preserve dependency order** - Never execute a task before its dependencies
624
- 4. **Document everything** - All decisions, issues, and outcomes must be recorded in the "Execution Summary", under "Noteworthy Events"
625
- 5. **Fail safely** - Better to halt and request help than corrupt the execution state
626
-
627
- ## Input Requirements
628
- - A plan document with an execution blueprint section. See /TASK_MANAGER.md to find the plan with ID [planId]
629
- - Task files with frontmatter metadata (id, group, dependencies, status)
630
- - Validation gates document: `/config/hooks/POST_PHASE.md`
631
-
632
- ### Input Error Handling
633
-
634
- If the plan does not exist, stop immediately and show an error to the user.
635
-
636
- **Note**: If tasks or the execution blueprint section are missing, they will be automatically generated before execution begins (see Task and Blueprint Validation below).
637
-
638
- ### Task and Blueprint Validation
639
-
640
- Before proceeding with execution, validate that tasks exist and the execution blueprint has been generated. If either is missing, automatically invoke task generation.
641
-
642
- **Validation Steps:**
643
-
644
- First, discover the task manager root directory:
645
-
646
- ```bash
647
- if [ ! -f /tmp/find-ai-task-manager-root.js ]; then
648
- cat << 'EOF' > /tmp/find-ai-task-manager-root.js
649
- const fs = require('fs');
650
- const path = require('path');
651
-
652
- const findRoot = (currentDir) => {
653
- const taskManagerPath = path.join(currentDir, '.ai/task-manager');
654
- const metadataPath = path.join(taskManagerPath, '.init-metadata.json');
655
-
656
- try {
657
- if (fs.existsSync(metadataPath) && JSON.parse(fs.readFileSync(metadataPath, 'utf8')).version) {
658
- console.log(path.resolve(taskManagerPath));
659
- process.exit(0);
660
- }
661
- } catch (e) {
662
- // Continue searching
663
- }
664
-
665
- const parentDir = path.dirname(currentDir);
666
- if (parentDir.length < currentDir.length) {
667
- findRoot(parentDir);
668
- } else {
669
- process.exit(1);
670
- }
671
- };
672
-
673
- findRoot(process.cwd());
674
- EOF
675
- fi
676
-
677
- root=$(node /tmp/find-ai-task-manager-root.js)
678
-
679
- if [ -z "$root" ]; then
680
- echo "Error: Could not find task manager root directory (.ai/task-manager)"
681
- exit 1
682
- fi
683
- ```
684
-
685
- Then extract validation results:
686
-
687
- ```bash
688
- # Extract validation results directly from script
689
- plan_file=$(node $root/config/scripts/validate-plan-blueprint.cjs [planId] planFile)
690
- plan_dir=$(node $root/config/scripts/validate-plan-blueprint.cjs [planId] planDir)
691
- task_count=$(node $root/config/scripts/validate-plan-blueprint.cjs [planId] taskCount)
692
- blueprint_exists=$(node $root/config/scripts/validate-plan-blueprint.cjs [planId] blueprintExists)
693
- ```
694
-
695
- 4. **Automatic task generation**:
696
-
697
- If either `$task_count` is 0 or `$blueprint_exists` is "no":
698
- - Display notification to user: "⚠️ Tasks or execution blueprint not found. Generating tasks automatically..."
699
- - Execute the embedded task generation process below
700
-
701
- ## Embedded Task Generation
702
-
703
- 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.
704
-
705
- This includes:
706
- - Reading and processing the plan document
707
- - Applying task minimization principles (20-30% reduction target)
708
- - Creating atomic tasks with 1-2 skills each
709
- - Generating proper task files with frontmatter and body structure
710
- - Running all validation checklists
711
- - Executing the POST_TASK_GENERATION_ALL hook
712
-
713
- ## Resume Blueprint Execution
714
-
715
- After task generation completes, continue with execution below.
716
-
717
- Otherwise, if tasks exist, proceed directly to execution.
718
-
719
- ## Execution Process
720
-
721
- Use your internal Todo task tool to track the execution of all phases, and the final update of the plan with the summary. Example:
722
-
723
- - [ ] Create feature branch via `node $root/config/scripts/create-feature-branch.cjs [planId]`
724
- - [ ] Validate or auto-generate tasks and execution blueprint if missing.
725
- - [ ] Execute $root/.ai/task-manager/config/hooks/PRE_PHASE.md hook before Phase 1.
726
- - [ ] Phase 1: Execute 1 task(s) in parallel.
727
- - [ ] Execute $root/.ai/task-manager/config/hooks/POST_PHASE.md hook after Phase 1.
728
- - [ ] Execute $root/.ai/task-manager/config/hooks/PRE_PHASE.md hook before Phase 2.
729
- - [ ] Phase 2: Execute 3 task(s) in parallel.
730
- - [ ] Execute $root/.ai/task-manager/config/hooks/POST_PHASE.md hook after Phase 2.
731
- - [ ] Execute $root/.ai/task-manager/config/hooks/PRE_PHASE.md hook before Phase 3.
732
- - [ ] Phase 3: Execute 1 task(s) in parallel.
733
- - [ ] Execute $root/.ai/task-manager/config/hooks/POST_PHASE.md hook after Phase 3.
734
- - [ ] Execute $root/.ai/task-manager/config/hooks/POST_EXECUTION.md hook after all phases complete.
735
- - [ ] Update the Plan 7 with execution summary using $root/.ai/task-manager/config/hooks/EXECUTION_SUMMARY_TEMPLATE.md.
736
- - [ ] Archive Plan 7.
737
-
738
- ### Phase Pre-Execution
739
-
740
- Read and execute $root/.ai/task-manager/config/hooks/PRE_PHASE.md
741
-
742
- ### Phase Execution Workflow
743
-
744
- 1. **Phase Initialization**
745
- - Identify current phase from the execution blueprint
746
- - List all tasks scheduled for parallel execution in this phase
747
-
748
- 2. **Agent Selection and Task Assignment**
749
- Read and execute $root/.ai/task-manager/config/hooks/PRE_TASK_ASSIGNMENT.md
750
-
751
- 3. **Parallel Execution**
752
- - Deploy all selected agents simultaneously using your internal Task tool
753
- - **Each agent MUST perform these steps in order:**
754
- 1. Read and execute `$root/.ai/task-manager/config/hooks/PRE_TASK_EXECUTION.md` before starting any implementation work
755
- 2. Execute the task according to its requirements
756
- - Monitor execution progress for each task
757
- - Capture outputs and artifacts from each agent
758
- - Update task status in real-time
759
-
760
- 4. **Phase Completion Verification**
761
- - Ensure all tasks in the phase have status: "completed"
762
- - Collect and review all task outputs
763
- - Document any issues or exceptions encountered
764
-
765
- ### Phase Post-Execution
766
-
767
- Read and execute $root/.ai/task-manager/config/hooks/POST_PHASE.md
768
-
769
-
770
- ### Phase Transition
771
-
772
- - Update phase status to "completed" in the Blueprint section of the plan [planId] document.
773
- - Initialize next phase
774
- - Repeat process until all phases are complete
775
-
776
- ### Error Handling
777
-
778
- #### Validation Gate Failures
779
- Read and execute $root/.ai/task-manager/config/hooks/POST_ERROR_DETECTION.md
780
-
781
- ### Output Requirements
782
-
783
- **Output Behavior:**
784
-
785
- Provide a concise execution summary:
786
- - Example: "Execution completed. Review summary: `$root/.ai/task-manager/archive/[plan]/plan-[id].md`"
787
-
788
- **CRITICAL - Structured Output for Command Coordination:**
789
-
790
- Always end your output with a standardized summary in this exact format:
791
-
792
- ```
793
- ---
794
- Execution Summary:
795
- - Plan ID: [numeric-id]
796
- - Status: Archived
797
- - Location: $root/.ai/task-manager/archive/[plan-id]--[plan-name]/
798
- ```
799
-
800
- This structured output enables automated workflow coordination and must be included even when running standalone.
801
-
802
- ## Optimization Guidelines
803
-
804
- - **Maximize parallelism**: Always run all available tasks in a phase simultaneously
805
- - **Resource awareness**: Balance agent allocation with system capabilities
806
- - **Early failure detection**: Monitor tasks actively to catch issues quickly
807
- - **Continuous improvement**: Note patterns for future blueprint optimization
808
-
809
- ## Post-Execution Processing
810
-
811
- Upon successful completion of all phases and validation gates, perform the following additional steps:
812
-
813
- - [ ] Post-Execution Validation
814
- - [ ] Execution Summary Generation
815
- - [ ] Plan Archival
816
-
817
- ### 0. Post-Execution Validation
818
-
819
- Read and execute $root/.ai/task-manager/config/hooks/POST_EXECUTION.md
820
-
821
- If validation fails, halt execution. The plan remains in `plans/` for debugging.
822
-
823
- ### 1. Execution Summary Generation
824
-
825
- Append an execution summary section to the plan document with the format described in $root/.ai/task-manager/config/templates/EXECUTION_SUMMARY_TEMPLATE.md
826
-
827
- ### 2. Plan Archival
828
-
829
- After successfully appending the execution summary:
830
-
831
- **Move completed plan to archive**:
832
- ```bash
833
- mv $root/.ai/task-manager/plans/[plan-folder] $root/.ai/task-manager/archive/
834
- ```
835
-
836
- ### Important Notes
837
-
838
- - **Only archive on complete success**: Archive operations should only occur when ALL phases are completed and ALL validation gates have passed
839
- - **Failed executions remain active**: Plans that fail execution or validation should remain in the `plans/` directory for debugging and potential re-execution
840
- - **Error handling**: If archival fails, log the error but do not fail the overall execution - the implementation work is complete
841
- - **Preserve structure**: The entire plan folder (including all tasks and subdirectories) should be moved as-is to maintain referential integrity
842
-
843
- **Progress**: ⬛⬛⬛ 100% - Step 3/3: Blueprint Execution Complete
844
-
845
- ---
846
-
847
- ## Final Summary
848
-
849
- Generate an extremely concise final summary using the structured output from Step 3.