@e0ipso/ai-task-manager 1.18.5 → 1.18.6

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.18.5",
3
+ "version": "1.18.6",
4
4
  "description": "Task management for AI coding assistants",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -2,7 +2,8 @@
2
2
  id: [PLAN-ID]
3
3
  summary: "[Brief one-line description of what this plan accomplishes]"
4
4
  created: [YYYY-MM-DD]
5
- approval_method: [auto|manual] # Optional: Workflow approval mode (auto=automated, manual=requires review)
5
+ approval_method_plan: [auto|manual] # Workflow approval for plan review (default: manual)
6
+ approval_method_tasks: [auto|manual] # Workflow approval for task generation review (default: manual)
6
7
  ---
7
8
 
8
9
  # Plan: [Descriptive Plan Title]
@@ -88,14 +88,18 @@ Structure your response as follows:
88
88
  - If context is insufficient: List specific clarifying questions
89
89
  - If context is sufficient: Provide the comprehensive plan using the structure above. Use the information in @TASK_MANAGER.md for the directory structure and additional information about plans.
90
90
 
91
- **Output Behavior:**
91
+ **Output Behavior: CRITICAL - Structured Output for Command Coordination**
92
92
 
93
- Be extremely concise but helpful:
94
- - Tell the user that you are done
95
- - Instruct them to review the plan document with the file path
96
- - Example output: "Plan created. Please review: `.ai/task-manager/plans/40--plan-name/plan-40--plan-name.md`"
93
+ Always end your output with a standardized summary in this exact format:
97
94
 
98
- **Note:** When this command is invoked by the full-workflow command, the full-workflow will modify the plan's `approval_method` field after creation to enable automated execution.
95
+ ```
96
+ ---
97
+ Plan Summary:
98
+ - Plan ID: [numeric-id]
99
+ - Plan File: [full-path-to-plan-file]
100
+ ```
101
+
102
+ This structured output enables automated workflow coordination and must be included even when running standalone.
99
103
 
100
104
  ###### Plan Template
101
105
 
@@ -114,11 +118,12 @@ Example:
114
118
  id: 1
115
119
  summary: "Implement a comprehensive CI/CD pipeline using GitHub Actions for automated linting, testing, semantic versioning, and NPM publishing"
116
120
  created: 2025-09-01
117
- approval_method: "manual"
121
+ approval_method_plan: "manual"
122
+ approval_method_tasks: "manual"
118
123
  ---
119
124
  ```
120
125
 
121
- **Important**: Always set `approval_method` to "manual" when creating a plan. The full-workflow command will modify this field to "auto" after creation if running in automated mode.
126
+ **Important**: Always set both `approval_method_plan` and `approval_method_tasks` to "manual" when creating a plan. The full-workflow command will modify these fields to "auto" after creation if running in automated mode.
122
127
 
123
128
  The schema for this frontmatter is:
124
129
  ```json
@@ -139,10 +144,15 @@ The schema for this frontmatter is:
139
144
  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
140
145
  "description": "Creation date in YYYY-MM-DD format"
141
146
  },
142
- "approval_method": {
147
+ "approval_method_plan": {
148
+ "type": "string",
149
+ "enum": ["auto", "manual"],
150
+ "description": "Workflow approval mode for plan review: auto for automated workflows, manual for standalone execution"
151
+ },
152
+ "approval_method_tasks": {
143
153
  "type": "string",
144
154
  "enum": ["auto", "manual"],
145
- "description": "Workflow approval mode: auto for automated workflows, manual for standalone execution"
155
+ "description": "Workflow approval mode for task generation review: auto when tasks auto-generated in workflow, manual for standalone execution"
146
156
  }
147
157
  },
148
158
  "additionalProperties": false
@@ -71,7 +71,12 @@ If either `$TASK_COUNT` is 0 or `$BLUEPRINT_EXISTS` is "no":
71
71
  ```
72
72
  /tasks:generate-tasks $1
73
73
  ```
74
- - **CRITICAL**: After task generation completes successfully, you MUST immediately proceed with blueprint execution without waiting for user input. The workflow should continue seamlessly.
74
+ - **NEW STEP**: Immediately after task generation succeeds, set the approval_method_tasks field to auto:
75
+ ```bash
76
+ node .ai/task-manager/config/scripts/set-approval-method.cjs "$PLAN_FILE" auto tasks
77
+ ```
78
+ - This signals that tasks were auto-generated in workflow context and execution should continue without pause.
79
+ - **CRITICAL**: After setting the field, you MUST immediately proceed with blueprint execution without waiting for user input. The workflow should continue seamlessly.
75
80
  - If generation fails: Halt execution with clear error message:
76
81
  ```
77
82
  ❌ Error: Automatic task generation failed.
@@ -146,33 +151,57 @@ Read and execute .ai/task-manager/config/hooks/POST_ERROR_DETECTION.md
146
151
 
147
152
  **Extract approval method from plan metadata:**
148
153
 
149
- First, extract the approval_method from the plan document:
154
+ First, extract both approval method fields from the plan document:
150
155
 
151
156
  ```bash
152
157
  # Find plan file by ID
153
158
  PLAN_FILE=$(find .ai/task-manager/{plans,archive} -name "plan-$1--*.md" -type f -exec grep -l "^id: \?$1$" {} \;)
154
159
 
155
- # Extract approval_method from YAML frontmatter
156
- APPROVAL_METHOD=$(sed -n '/^---$/,/^---$/p' "$PLAN_FILE" | grep '^approval_method:' | sed 's/approval_method: *//;s/"//g;s/'"'"'//g' | tr -d ' ')
160
+ # Extract both approval method fields from YAML frontmatter
161
+ APPROVAL_METHOD_PLAN=$(sed -n '/^---$/,/^---$/p' "$PLAN_FILE" | grep '^approval_method_plan:' | sed 's/approval_method_plan: *//;s/"//g' | tr -d " '")
162
+ APPROVAL_METHOD_TASKS=$(sed -n '/^---$/,/^---$/p' "$PLAN_FILE" | grep '^approval_method_tasks:' | sed 's/approval_method_tasks: *//;s/"//g' | tr -d " '")
157
163
 
158
- # Default to "manual" if field doesn't exist (backward compatibility)
159
- APPROVAL_METHOD=${APPROVAL_METHOD:-manual}
164
+ # Defaults to "manual" if fields don't exist
165
+ APPROVAL_METHOD_PLAN=${APPROVAL_METHOD_PLAN:-manual}
166
+ APPROVAL_METHOD_TASKS=${APPROVAL_METHOD_TASKS:-manual}
160
167
  ```
161
168
 
162
- Then adjust output based on the extracted approval method:
169
+ Then adjust output based on the extracted approval methods:
163
170
 
164
- - **If `APPROVAL_METHOD="auto"` (automated workflow mode)**:
165
- - Provide minimal progress updates at phase boundaries
166
- - Do NOT instruct user to review implementation details
171
+ - **If `APPROVAL_METHOD_PLAN="auto"` (automated workflow mode)**:
172
+ - During task auto-generation phase: Provide minimal progress updates
173
+ - Do NOT instruct user to review the plan or tasks being generated
167
174
  - Do NOT add any prompts that would pause execution
175
+
176
+ - **If `APPROVAL_METHOD_TASKS="auto"` (tasks auto-generated in workflow)**:
177
+ - During task execution phase: Provide minimal progress updates at phase boundaries
178
+ - Do NOT instruct user to review implementation details
168
179
  - Example output: "Phase 1/3 completed. Proceeding to Phase 2."
169
180
 
170
- - **If `APPROVAL_METHOD="manual"` or empty (standalone mode)**:
181
+ - **If `APPROVAL_METHOD_PLAN="manual"` or `APPROVAL_METHOD_TASKS="manual"` (standalone mode)**:
171
182
  - Provide detailed execution summary with phase results
172
183
  - List completed tasks and any noteworthy events
173
184
  - Instruct user to review the execution summary in the plan document
174
185
  - Example output: "Execution completed. Review summary: `.ai/task-manager/archive/[plan]/plan-[id].md`"
175
186
 
187
+ **Note**: This command respects both approval method fields:
188
+ - `approval_method_plan`: Used during auto-generation to determine if we're in automated workflow
189
+ - `approval_method_tasks`: Used during execution to determine output verbosity
190
+
191
+ **CRITICAL - Structured Output for Command Coordination:**
192
+
193
+ Always end your output with a standardized summary in this exact format:
194
+
195
+ ```
196
+ ---
197
+ Execution Summary:
198
+ - Plan ID: [numeric-id]
199
+ - Status: Archived
200
+ - Location: .ai/task-manager/archive/[plan-id]--[plan-name]/
201
+ ```
202
+
203
+ This structured output enables automated workflow coordination and must be included even when running standalone.
204
+
176
205
  ## Optimization Guidelines
177
206
 
178
207
  - **Maximize parallelism**: Always run all available tasks in a phase simultaneously
@@ -306,23 +306,37 @@ First, extract the approval_method from the plan document:
306
306
  # Find plan file by ID
307
307
  PLAN_FILE=$(find .ai/task-manager/{plans,archive} -name "plan-$1--*.md" -type f -exec grep -l "^id: \?$1$" {} \;)
308
308
 
309
- # Extract approval_method from YAML frontmatter
310
- APPROVAL_METHOD=$(sed -n '/^---$/,/^---$/p' "$PLAN_FILE" | grep '^approval_method:' | sed 's/approval_method: *//;s/"//g;s/'"'"'//g' | tr -d ' ')
309
+ # Extract approval_method_tasks from YAML frontmatter
310
+ APPROVAL_METHOD_TASKS=$(sed -n '/^---$/,/^---$/p' "$PLAN_FILE" | grep '^approval_method_tasks:' | sed 's/approval_method_tasks: *//;s/"//g' | tr -d " '")
311
311
 
312
312
  # Default to "manual" if field doesn't exist (backward compatibility)
313
- APPROVAL_METHOD=${APPROVAL_METHOD:-manual}
313
+ APPROVAL_METHOD_TASKS=${APPROVAL_METHOD_TASKS:-manual}
314
314
  ```
315
315
 
316
316
  Then adjust output based on the extracted approval method:
317
317
 
318
- - **If `APPROVAL_METHOD="auto"` (automated workflow mode)**:
318
+ - **If `APPROVAL_METHOD_TASKS="auto"` (automated workflow mode)**:
319
319
  - Simply confirm task generation with task count
320
320
  - Do NOT instruct user to review the tasks
321
321
  - Do NOT add any prompts that would pause execution
322
322
  - Example output: "Tasks generated for plan [id]: [count] tasks created"
323
323
 
324
- - **If `APPROVAL_METHOD="manual"` or empty (standalone mode)**:
324
+ - **If `APPROVAL_METHOD_TASKS="manual"` or empty (standalone mode)**:
325
325
  - Be concise but helpful
326
326
  - Tell the user that you are done
327
327
  - Instruct them to review the tasks with file paths
328
328
  - Example output: "Task generation complete. Review tasks in: `.ai/task-manager/plans/[plan-id]--[name]/tasks/`"
329
+
330
+ **CRITICAL - Structured Output for Command Coordination:**
331
+
332
+ Always end your output with a standardized summary in this exact format:
333
+
334
+ ```
335
+ ---
336
+ Task Generation Summary:
337
+ - Plan ID: [numeric-id]
338
+ - Tasks: [count]
339
+ - Status: Ready for execution
340
+ ```
341
+
342
+ This structured output enables automated workflow coordination and must be included even when running standalone.
@@ -1,90 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require('fs');
4
- const path = require('path');
5
-
6
- /**
7
- * Update or add approval_method field in a plan file's YAML frontmatter
8
- * @param {string} filePath - Path to the plan file
9
- * @param {string} approvalMethod - Approval method value ('auto' or 'manual')
10
- * @returns {boolean} True if successful, false otherwise
11
- */
12
- function setApprovalMethod(filePath, approvalMethod) {
13
- // Validate inputs
14
- if (!filePath) {
15
- throw new Error('File path is required');
16
- }
17
-
18
- if (!approvalMethod || !['auto', 'manual'].includes(approvalMethod)) {
19
- throw new Error('Approval method must be "auto" or "manual"');
20
- }
21
-
22
- // Check file exists
23
- if (!fs.existsSync(filePath)) {
24
- throw new Error(`File not found: ${filePath}`);
25
- }
26
-
27
- // Read file content
28
- const content = fs.readFileSync(filePath, 'utf8');
29
-
30
- // Parse frontmatter - handle both empty and non-empty frontmatter
31
- const frontmatterRegex = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n([\s\S]*))?$/;
32
- const match = content.match(frontmatterRegex);
33
-
34
- if (!match) {
35
- throw new Error('No frontmatter found in file');
36
- }
37
-
38
- const frontmatterContent = match[1] || '';
39
- const bodyContent = match[2] || '';
40
- const frontmatterLines = frontmatterContent ? frontmatterContent.split('\n') : [];
41
-
42
- // Update or add approval_method field
43
- let approvalMethodFound = false;
44
- const updatedFrontmatter = frontmatterLines.map(line => {
45
- const trimmed = line.trim();
46
- if (trimmed.startsWith('approval_method:')) {
47
- approvalMethodFound = true;
48
- return `approval_method: ${approvalMethod}`;
49
- }
50
- return line;
51
- });
52
-
53
- // Add approval_method if not found
54
- if (!approvalMethodFound) {
55
- updatedFrontmatter.push(`approval_method: ${approvalMethod}`);
56
- }
57
-
58
- // Reconstruct file
59
- const updated = '---\n' + updatedFrontmatter.join('\n') + '\n---\n' + bodyContent;
60
-
61
- // Write back to file
62
- fs.writeFileSync(filePath, updated, 'utf8');
63
-
64
- return true;
65
- }
66
-
67
- // Main execution with error handling
68
- try {
69
- const args = process.argv.slice(2);
70
-
71
- if (args.length < 2) {
72
- console.error('Usage: set-approval-method.cjs <file-path> <approval-method>');
73
- console.error(' file-path: Path to the plan file');
74
- console.error(' approval-method: "auto" or "manual"');
75
- process.exit(1);
76
- }
77
-
78
- const [filePath, approvalMethod] = args;
79
-
80
- // Resolve relative paths
81
- const resolvedPath = path.isAbsolute(filePath) ? filePath : path.resolve(process.cwd(), filePath);
82
-
83
- setApprovalMethod(resolvedPath, approvalMethod);
84
-
85
- console.log(`✓ Successfully set approval_method to "${approvalMethod}" in ${path.basename(resolvedPath)}`);
86
- process.exit(0);
87
- } catch (error) {
88
- console.error(`✗ Error: ${error.message}`);
89
- process.exit(1);
90
- }
@@ -1,190 +0,0 @@
1
- ---
2
- argument-hint: [user-prompt]
3
- description: Execute the full workflow from plan creation to blueprint execution
4
- ---
5
- # Full Workflow Execution
6
-
7
- ## Assistant Configuration
8
-
9
- Before proceeding with this command, you MUST load and respect the assistant's configuration:
10
-
11
- **Run the following scripts:**
12
- ```bash
13
- ASSISTANT=$(node .ai/task-manager/config/scripts/detect-assistant.cjs)
14
- node .ai/task-manager/config/scripts/read-assistant-config.cjs "$ASSISTANT"
15
- ```
16
-
17
- The output above contains your global and project-level configuration rules. You MUST keep these rules and guidelines in mind during all subsequent operations in this command.
18
-
19
- ---
20
-
21
- You are a workflow orchestration assistant. Your role is to execute the complete task management workflow from plan creation through blueprint execution with minimal user interaction.
22
-
23
- ## Instructions
24
-
25
- The user input is:
26
-
27
- <user-input>
28
- $ARGUMENTS
29
- </user-input>
30
-
31
- If no user input is provided, stop immediately and show an error message to the user.
32
-
33
- ### Workflow Execution Process
34
-
35
- Use your internal Todo task tool to track the workflow execution:
36
-
37
- - [ ] Execute /tasks:create-plan
38
- - [ ] Extract plan ID
39
- - [ ] Execute /tasks:generate-tasks
40
- - [ ] Execute /tasks:execute-blueprint
41
- - [ ] Generate execution summary
42
-
43
- #### Step 1: Determine Next Plan ID
44
-
45
- Before creating the plan, determine what the next plan ID will be and store it persistently:
46
-
47
- ```bash
48
- PLAN_ID=$(node .ai/task-manager/config/scripts/get-next-plan-id.cjs)
49
- echo "$PLAN_ID" > /tmp/full-workflow-plan-id-$$.txt
50
- echo "Next plan ID: $PLAN_ID"
51
- ```
52
-
53
- This stores the plan ID in a temporary file that persists across all workflow steps.
54
-
55
- #### Step 2: Execute Plan Creation
56
-
57
- Use the SlashCommand tool to execute plan creation with the user's prompt:
58
-
59
- ```
60
- /tasks:create-plan $ARGUMENTS
61
- ```
62
-
63
- **Important**: The plan creation command may ask clarification questions. Wait for user responses before continuing. This is expected behavior and maintains quality control.
64
-
65
- After plan creation completes, retrieve the plan ID and provide a progress update:
66
-
67
- ```bash
68
- PLAN_ID=$(cat /tmp/full-workflow-plan-id-$$.txt)
69
- echo "Step 1/4: Plan created (ID: $PLAN_ID)"
70
- ```
71
-
72
- **CRITICAL**: Do not wait for user approval or review of the plan. In full-workflow mode, plan validation is automated (Step 3 performs file existence checking only). Proceed immediately to Step 3 without waiting for user input.
73
-
74
- #### Step 3: Validate Plan Creation and Set Approval Method
75
-
76
- Verify the plan was created successfully and set it to automated workflow mode:
77
-
78
- ```bash
79
- # Retrieve the plan ID from temp file
80
- PLAN_ID=$(cat /tmp/full-workflow-plan-id-$$.txt)
81
-
82
- # Find the created plan file
83
- PLAN_FILE=$(find .ai/task-manager/plans -name "plan-[0-9][0-9]*--*.md" -type f -exec grep -l "^id: \?${PLAN_ID}$" {} \;)
84
-
85
- # Verify plan exists
86
- if [ -z "$PLAN_FILE" ]; then
87
- echo "❌ Error: Plan creation failed. Expected plan with ID ${PLAN_ID} not found."
88
- exit 1
89
- fi
90
-
91
- # Set approval_method to auto for automated workflow execution
92
- # This ensures generate-tasks and execute-blueprint run without interruption
93
- node .ai/task-manager/config/scripts/set-approval-method.cjs "$PLAN_FILE" auto
94
- ```
95
-
96
- **Note**: Setting `approval_method: auto` in the plan metadata signals to subordinate commands (generate-tasks, execute-blueprint) that they are running in automated workflow mode and should suppress interactive prompts for plan review. This metadata persists in the plan document and is reliably read by subsequent commands, eliminating dependency on environment variables.
97
-
98
- #### Step 4: Execute Task Generation
99
-
100
- Retrieve the plan ID and use the SlashCommand tool to generate tasks:
101
-
102
- ```bash
103
- PLAN_ID=$(cat /tmp/full-workflow-plan-id-$$.txt)
104
- echo "Generating tasks for plan $PLAN_ID"
105
- ```
106
-
107
- Now use the SlashCommand tool with the plan ID from above:
108
-
109
- ```
110
- /tasks:generate-tasks [plan-id-from-above]
111
- ```
112
-
113
- After task generation completes, provide minimal progress update referencing the plan ID.
114
-
115
- #### Step 5: Execute Blueprint
116
-
117
- Retrieve the plan ID and use the SlashCommand tool to execute the blueprint:
118
-
119
- ```bash
120
- PLAN_ID=$(cat /tmp/full-workflow-plan-id-$$.txt)
121
- echo "Executing blueprint for plan $PLAN_ID"
122
- ```
123
-
124
- Now use the SlashCommand tool with the plan ID from above:
125
-
126
- ```
127
- /tasks:execute-blueprint [plan-id-from-above]
128
- ```
129
-
130
- After blueprint execution completes, provide minimal progress update:
131
- "Step 3/4: Blueprint execution completed"
132
-
133
- Note: The execute-blueprint command automatically archives the plan upon successful completion.
134
-
135
- #### Step 6: Generate Execution Summary
136
-
137
- After all steps complete successfully, retrieve the plan details and generate a summary:
138
-
139
- ```bash
140
- PLAN_ID=$(cat /tmp/full-workflow-plan-id-$$.txt)
141
- PLAN_DIR=$(find .ai/task-manager/archive -type d -name "${PLAN_ID}--*" 2>/dev/null | head -n 1)
142
- PLAN_NAME=$(basename "$PLAN_DIR")
143
-
144
- echo "✅ Full workflow completed successfully!"
145
- echo ""
146
- echo "Plan: $PLAN_NAME"
147
- echo "Location: .ai/task-manager/archive/$PLAN_NAME/"
148
- echo ""
149
- echo "Status: Archived and ready for review"
150
- echo ""
151
- echo "📋 Next Steps:"
152
- echo "- Review the implementation in the archived plan"
153
- echo "- Check the execution summary in the plan document"
154
- echo "- Verify all validation gates passed"
155
- echo ""
156
- echo "Plan document: .ai/task-manager/archive/$PLAN_NAME/plan-$PLAN_NAME.md"
157
-
158
- # Clean up temp file
159
- rm -f /tmp/full-workflow-plan-id-$$.txt
160
- ```
161
-
162
- ### Error Handling
163
-
164
- If any step fails:
165
- 1. Halt execution immediately
166
- 2. Report clear error message indicating which step failed
167
- 3. Preserve all created artifacts (plan, tasks) for manual review
168
- 4. Read the plan ID from temp file if needed: `cat /tmp/full-workflow-plan-id-$$.txt`
169
- 5. Provide guidance for manual continuation:
170
- - If plan creation failed: Review error and retry
171
- - If task generation failed: Run `/tasks:generate-tasks [plan-id]` manually after reviewing plan
172
- - If blueprint execution failed: Review tasks and run `/tasks:execute-blueprint [plan-id]` manually
173
- 6. Clean up temp file: `rm -f /tmp/full-workflow-plan-id-$$.txt`
174
-
175
- ### Output Requirements
176
-
177
- **During Execution:**
178
- - Minimal progress updates at each major step
179
- - Clear indication of current step (1/4, 2/4, etc.)
180
-
181
- **After Completion:**
182
- - Comprehensive summary with plan location
183
- - Status confirmation (Archived)
184
- - Next steps for user review
185
- - Direct link to plan document
186
-
187
- **On Error:**
188
- - Clear error message
189
- - Indication of which step failed
190
- - Manual recovery instructions