@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.
- package/README.md +26 -21
- package/dist/cli.js +1 -32
- package/dist/cli.js.map +1 -1
- package/dist/conflict-detector.d.ts.map +1 -1
- package/dist/conflict-detector.js +0 -4
- package/dist/conflict-detector.js.map +1 -1
- package/dist/index.d.ts +3 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +50 -245
- package/dist/index.js.map +1 -1
- package/dist/metadata.d.ts +9 -0
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js +14 -0
- package/dist/metadata.js.map +1 -1
- package/dist/types.d.ts +18 -18
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts +27 -58
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +93 -219
- package/dist/utils.js.map +1 -1
- package/package.json +4 -2
- package/templates/ai-task-manager/config/TASK_MANAGER.md +3 -3
- package/templates/ai-task-manager/config/hooks/PRE_PHASE.md +6 -26
- package/templates/ai-task-manager/config/hooks/PRE_TASK_ASSIGNMENT.md +6 -24
- package/templates/ai-task-manager/config/templates/PLAN_TEMPLATE.md +1 -1
- package/templates/{assistant → harness}/agents/plan-creator.md +2 -2
- package/templates/harness/skills/task-create-plan/SKILL.md +120 -0
- package/templates/harness/skills/task-create-plan/scripts/find-task-manager-root.cjs +116 -0
- package/templates/harness/skills/task-create-plan/scripts/get-next-plan-id.cjs +214 -0
- package/templates/harness/skills/task-execute-blueprint/SKILL.md +139 -0
- package/templates/harness/skills/task-execute-blueprint/scripts/create-feature-branch.cjs +376 -0
- package/templates/harness/skills/task-execute-blueprint/scripts/find-task-manager-root.cjs +116 -0
- package/templates/harness/skills/task-execute-blueprint/scripts/validate-plan-blueprint.cjs +375 -0
- package/templates/harness/skills/task-execute-task/SKILL.md +195 -0
- package/templates/harness/skills/task-execute-task/scripts/check-task-dependencies.cjs +437 -0
- package/templates/harness/skills/task-execute-task/scripts/find-task-manager-root.cjs +116 -0
- package/templates/harness/skills/task-execute-task/scripts/validate-plan-blueprint.cjs +375 -0
- package/templates/harness/skills/task-full-workflow/SKILL.md +378 -0
- package/templates/harness/skills/task-full-workflow/scripts/create-feature-branch.cjs +376 -0
- package/templates/harness/skills/task-full-workflow/scripts/find-task-manager-root.cjs +116 -0
- package/templates/harness/skills/task-full-workflow/scripts/get-next-plan-id.cjs +214 -0
- package/templates/harness/skills/task-full-workflow/scripts/get-next-task-id.cjs +312 -0
- package/templates/harness/skills/task-full-workflow/scripts/validate-plan-blueprint.cjs +375 -0
- package/templates/harness/skills/task-generate-tasks/SKILL.md +244 -0
- package/templates/harness/skills/task-generate-tasks/scripts/find-task-manager-root.cjs +116 -0
- package/templates/harness/skills/task-generate-tasks/scripts/get-next-task-id.cjs +312 -0
- package/templates/harness/skills/task-generate-tasks/scripts/validate-plan-blueprint.cjs +375 -0
- package/templates/harness/skills/task-refine-plan/SKILL.md +205 -0
- package/templates/harness/skills/task-refine-plan/scripts/find-task-manager-root.cjs +116 -0
- package/templates/harness/skills/task-refine-plan/scripts/validate-plan-blueprint.cjs +375 -0
- package/dist/exec.d.ts +0 -13
- package/dist/exec.d.ts.map +0 -1
- package/dist/exec.js +0 -261
- package/dist/exec.js.map +0 -1
- package/templates/ai-task-manager/config/scripts/check-task-dependencies.cjs +0 -240
- package/templates/ai-task-manager/config/scripts/compose-prompt.cjs +0 -234
- package/templates/ai-task-manager/config/scripts/create-feature-branch.cjs +0 -204
- package/templates/ai-task-manager/config/scripts/extract-task-skills.cjs +0 -84
- package/templates/ai-task-manager/config/scripts/find-root.cjs +0 -10
- package/templates/ai-task-manager/config/scripts/get-next-plan-id.cjs +0 -49
- package/templates/ai-task-manager/config/scripts/get-next-task-id.cjs +0 -81
- package/templates/ai-task-manager/config/scripts/shared-utils.cjs +0 -418
- package/templates/ai-task-manager/config/scripts/validate-plan-blueprint.cjs +0 -138
- package/templates/assistant/commands/tasks/create-plan-auto.md +0 -174
- package/templates/assistant/commands/tasks/create-plan.md +0 -175
- package/templates/assistant/commands/tasks/execute-blueprint.md +0 -233
- package/templates/assistant/commands/tasks/execute-task.md +0 -351
- package/templates/assistant/commands/tasks/fix-broken-tests.md +0 -44
- package/templates/assistant/commands/tasks/full-workflow.md +0 -849
- package/templates/assistant/commands/tasks/generate-tasks.md +0 -348
- package/templates/assistant/commands/tasks/refine-plan-auto.md +0 -172
- package/templates/assistant/commands/tasks/refine-plan.md +0 -163
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const sharedUtils = require('./shared-utils.cjs');
|
|
6
|
-
const {
|
|
7
|
-
findTaskManagerRoot,
|
|
8
|
-
findPlanById,
|
|
9
|
-
countTasks,
|
|
10
|
-
checkBlueprintExists,
|
|
11
|
-
getAllPlans,
|
|
12
|
-
validatePlanFile,
|
|
13
|
-
checkStandardRootShortcut,
|
|
14
|
-
resolvePlan
|
|
15
|
-
} = sharedUtils;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Error logging utility
|
|
19
|
-
* @private
|
|
20
|
-
* @param {string} message - Error message
|
|
21
|
-
* @param {...any} args - Additional arguments to log
|
|
22
|
-
*/
|
|
23
|
-
function _errorLog(message, ...args) {
|
|
24
|
-
console.error(`[ERROR] ${message}`, ...args);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* List available plans for error messaging
|
|
29
|
-
* @private
|
|
30
|
-
* @param {string} [taskManagerRoot] - Optional task manager root path
|
|
31
|
-
* @returns {string[]} Array of plan directory names
|
|
32
|
-
*/
|
|
33
|
-
function _listAvailablePlans(taskManagerRoot) {
|
|
34
|
-
const plans = getAllPlans(taskManagerRoot);
|
|
35
|
-
return plans
|
|
36
|
-
.map(p => p.name)
|
|
37
|
-
.sort((a, b) => {
|
|
38
|
-
const aIdMatch = a.match(/^(\d+)--/);
|
|
39
|
-
const bIdMatch = b.match(/^(\d+)--/);
|
|
40
|
-
if (!aIdMatch || !bIdMatch) return 0;
|
|
41
|
-
return parseInt(aIdMatch[1], 10) - parseInt(bIdMatch[1], 10);
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Validate plan blueprint and output JSON or specific field
|
|
47
|
-
* @private
|
|
48
|
-
* @param {string|number} inputId - Plan ID or absolute path to validate
|
|
49
|
-
* @param {string} [fieldName] - Optional field name to extract (planFile, planDir, taskCount, blueprintExists, taskManagerRoot, planId)
|
|
50
|
-
* @param {string} [startPath] - Optional start path for finding task manager root
|
|
51
|
-
*/
|
|
52
|
-
function _validatePlanBlueprint(inputId, fieldName, startPath = process.cwd()) {
|
|
53
|
-
if (!inputId) {
|
|
54
|
-
_errorLog('Plan ID or absolute path is required');
|
|
55
|
-
_errorLog('');
|
|
56
|
-
_errorLog('Usage: node validate-plan-blueprint.cjs <plan-id-or-path> [field-name]');
|
|
57
|
-
_errorLog('');
|
|
58
|
-
_errorLog('Examples:');
|
|
59
|
-
_errorLog(' node validate-plan-blueprint.cjs 47 # Output full JSON');
|
|
60
|
-
_errorLog(' node validate-plan-blueprint.cjs /path/to/plan.md # Output full JSON for specific file');
|
|
61
|
-
_errorLog(' node validate-plan-blueprint.cjs 47 planFile # Output just the plan file path');
|
|
62
|
-
_errorLog(' node validate-plan-blueprint.cjs 47 blueprintExists # Output yes/no');
|
|
63
|
-
process.exit(1);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// Check if input is numeric (allowing padded zeros) - if not a number or path, it's invalid
|
|
67
|
-
const numericInput = parseInt(inputId, 10);
|
|
68
|
-
const isNumeric = !isNaN(numericInput);
|
|
69
|
-
const isAbsolutePath = inputId.startsWith('/');
|
|
70
|
-
|
|
71
|
-
if (!isNumeric && !isAbsolutePath) {
|
|
72
|
-
_errorLog(`Invalid plan ID: "${inputId}" is not a valid number`);
|
|
73
|
-
process.exit(1);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const resolved = resolvePlan(inputId, startPath);
|
|
77
|
-
|
|
78
|
-
if (!resolved) {
|
|
79
|
-
_errorLog(`Plan ID ${inputId} not found or invalid`);
|
|
80
|
-
_errorLog('');
|
|
81
|
-
|
|
82
|
-
const tmRoot = findTaskManagerRoot(startPath);
|
|
83
|
-
const availablePlans = _listAvailablePlans(tmRoot);
|
|
84
|
-
if (availablePlans.length > 0) {
|
|
85
|
-
_errorLog('Available plans:');
|
|
86
|
-
availablePlans.forEach(plan => {
|
|
87
|
-
_errorLog(` ${plan}`);
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
process.exit(1);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const {
|
|
95
|
-
planFile,
|
|
96
|
-
planDir,
|
|
97
|
-
taskManagerRoot,
|
|
98
|
-
planId
|
|
99
|
-
} = resolved;
|
|
100
|
-
|
|
101
|
-
const taskCount = countTasks(planDir);
|
|
102
|
-
const blueprintExists = checkBlueprintExists(planFile);
|
|
103
|
-
|
|
104
|
-
const result = {
|
|
105
|
-
planFile,
|
|
106
|
-
planDir,
|
|
107
|
-
taskManagerRoot,
|
|
108
|
-
planId,
|
|
109
|
-
taskCount,
|
|
110
|
-
blueprintExists: blueprintExists ? 'yes' : 'no'
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
// If field name is provided, output just that field
|
|
114
|
-
if (fieldName) {
|
|
115
|
-
const validFields = ['planFile', 'planDir', 'taskCount', 'blueprintExists', 'taskManagerRoot', 'planId'];
|
|
116
|
-
if (!validFields.includes(fieldName)) {
|
|
117
|
-
_errorLog(`Invalid field name: ${fieldName}`);
|
|
118
|
-
_errorLog(`Valid fields: ${validFields.join(', ')}`);
|
|
119
|
-
process.exit(1);
|
|
120
|
-
}
|
|
121
|
-
// Use process.stdout.write to avoid util.inspect colorization
|
|
122
|
-
process.stdout.write(String(result[fieldName]) + '\n');
|
|
123
|
-
} else {
|
|
124
|
-
// Output full JSON
|
|
125
|
-
console.log(JSON.stringify(result, null, 2));
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// Main execution
|
|
130
|
-
if (require.main === module) {
|
|
131
|
-
const planId = process.argv[2];
|
|
132
|
-
const fieldName = process.argv[3];
|
|
133
|
-
_validatePlanBlueprint(planId, fieldName);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
module.exports = {
|
|
137
|
-
_validatePlanBlueprint
|
|
138
|
-
};
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
<!-- Based on create-plan.md — keep in sync with changes to the original. -->
|
|
2
|
-
---
|
|
3
|
-
argument-hint: "[userPrompt]"
|
|
4
|
-
description: Create a comprehensive plan without user interaction, resolving ambiguities autonomously.
|
|
5
|
-
---
|
|
6
|
-
# Comprehensive Plan Creation (Autonomous Mode)
|
|
7
|
-
|
|
8
|
-
You are a strategic planning specialist who creates actionable plan documents that balance comprehensive context with
|
|
9
|
-
disciplined scope control. Your role is to think hard to create detailed, actionable plans based on user input while
|
|
10
|
-
ensuring you have all necessary context before proceeding. Use the plan-creator sub-agent for this if it is available.
|
|
11
|
-
|
|
12
|
-
**AUTONOMOUS MODE**: This command runs without user interaction. You must resolve all ambiguities by inspecting the
|
|
13
|
-
codebase, documentation, and project context. Do NOT ask the user any questions or wait for user input at any point.
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
Use tools for the planning. You are encouraged to write your own specialized tools to research, analyze, and debug
|
|
18
|
-
any work order from the user. You are not restricted to the stack of the current project to create your own
|
|
19
|
-
specialized tools.
|
|
20
|
-
|
|
21
|
-
## Find the AI Task Manager root
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
if [ ! -f /tmp/find-ai-task-manager-root.js ]; then
|
|
25
|
-
cat << 'EOF' > /tmp/find-ai-task-manager-root.js
|
|
26
|
-
const fs = require('fs');
|
|
27
|
-
const path = require('path');
|
|
28
|
-
|
|
29
|
-
const findRoot = (currentDir) => {
|
|
30
|
-
const taskManagerPath = path.join(currentDir, '.ai/task-manager');
|
|
31
|
-
const metadataPath = path.join(taskManagerPath, '.init-metadata.json');
|
|
32
|
-
|
|
33
|
-
try {
|
|
34
|
-
if (fs.existsSync(metadataPath) && JSON.parse(fs.readFileSync(metadataPath, 'utf8')).version) {
|
|
35
|
-
console.log(path.resolve(taskManagerPath));
|
|
36
|
-
process.exit(0);
|
|
37
|
-
}
|
|
38
|
-
} catch (e) {
|
|
39
|
-
// Continue searching
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const parentDir = path.dirname(currentDir);
|
|
43
|
-
if (parentDir.length < currentDir.length) {
|
|
44
|
-
findRoot(parentDir);
|
|
45
|
-
} else {
|
|
46
|
-
process.exit(1);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
findRoot(process.cwd());
|
|
51
|
-
EOF
|
|
52
|
-
fi
|
|
53
|
-
|
|
54
|
-
root=$(node /tmp/find-ai-task-manager-root.js)
|
|
55
|
-
|
|
56
|
-
if [ -z "$root" ]; then
|
|
57
|
-
echo "Error: Could not find task manager root directory (.ai/task-manager)"
|
|
58
|
-
exit 1
|
|
59
|
-
fi
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## Instructions
|
|
63
|
-
|
|
64
|
-
Include $root/.ai/task-manager/config/TASK_MANAGER.md for the directory structure of tasks.
|
|
65
|
-
|
|
66
|
-
The user input is:
|
|
67
|
-
|
|
68
|
-
<user-input>
|
|
69
|
-
$ARGUMENTS
|
|
70
|
-
</user-input>
|
|
71
|
-
|
|
72
|
-
If no user input is provided stop immediately and show an error message to the user.
|
|
73
|
-
|
|
74
|
-
### Process Checklist
|
|
75
|
-
|
|
76
|
-
Use your internal Todo task tool to track the following plan generation:
|
|
77
|
-
|
|
78
|
-
- [ ] Read and execute $root/.ai/task-manager/config/hooks/PRE_PLAN.md
|
|
79
|
-
- [ ] User input and context analysis
|
|
80
|
-
- [ ] Autonomous clarification (resolve gaps via codebase inspection)
|
|
81
|
-
- [ ] Plan generation
|
|
82
|
-
- [ ] Read and execute $root/.ai/task-manager/config/hooks/POST_PLAN.md
|
|
83
|
-
|
|
84
|
-
#### Step 1: Context Analysis
|
|
85
|
-
Before creating any plan, analyze the user's request for:
|
|
86
|
-
- **Objective**: What is the end goal?
|
|
87
|
-
- **Scope**: What are the boundaries and constraints?
|
|
88
|
-
- **Resources**: What tools, libraries, or infrastructure are available?
|
|
89
|
-
- **Success Criteria**: How will success be measured?
|
|
90
|
-
- **Dependencies**: What prerequisites or blockers exist?
|
|
91
|
-
- **Technical Requirements**: What technologies or skills are needed?
|
|
92
|
-
|
|
93
|
-
#### Step 2: Autonomous Clarification Phase
|
|
94
|
-
If any critical context is missing:
|
|
95
|
-
1. Identify specific gaps in the information provided
|
|
96
|
-
2. Attempt to resolve each gap by inspecting the codebase, documentation, README files, assistant documents (CLAUDE.md, GEMINI.md, AGENTS.md), configuration files, and any other available project context
|
|
97
|
-
3. For gaps that cannot be resolved through codebase inspection, document your best-effort assumptions in the Plan Clarifications table with clear rationale
|
|
98
|
-
4. Record all assumptions prominently so they can be reviewed later
|
|
99
|
-
|
|
100
|
-
CRITICAL: Do NOT ask the user any questions. Do NOT wait for user input. You must resolve all ambiguity autonomously through codebase analysis and reasonable assumptions. If you cannot determine something, state your assumption and proceed.
|
|
101
|
-
|
|
102
|
-
#### Step 3: Plan Generation
|
|
103
|
-
Only after confirming sufficient context, create a plan according to the $root/.ai/task-manager/config/templates/PLAN_TEMPLATE.md
|
|
104
|
-
|
|
105
|
-
##### CRITICAL: Output Format
|
|
106
|
-
|
|
107
|
-
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.
|
|
108
|
-
|
|
109
|
-
**Output Behavior: CRITICAL - Structured Output for Command Coordination**
|
|
110
|
-
|
|
111
|
-
Always end your output with a standardized summary in this exact format, for command coordination:
|
|
112
|
-
|
|
113
|
-
```
|
|
114
|
-
---
|
|
115
|
-
|
|
116
|
-
Plan Summary:
|
|
117
|
-
- Plan ID: [numeric-id]
|
|
118
|
-
- Plan File: [full-path-to-plan-file]
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
This structured output enables automated workflow coordination and must be included even when running standalone.
|
|
122
|
-
|
|
123
|
-
###### Patterns to Avoid
|
|
124
|
-
Do not include the following in your plan output.
|
|
125
|
-
- Avoid time estimations
|
|
126
|
-
- Avoid task lists and mentions of phases (those are things we'll introduce later)
|
|
127
|
-
- Avoid code examples
|
|
128
|
-
|
|
129
|
-
###### Frontmatter Structure
|
|
130
|
-
|
|
131
|
-
Example:
|
|
132
|
-
```yaml
|
|
133
|
-
---
|
|
134
|
-
id: 1
|
|
135
|
-
summary: "Implement a comprehensive CI/CD pipeline using GitHub Actions for automated linting, testing, semantic versioning, and NPM publishing"
|
|
136
|
-
created: 2025-09-01
|
|
137
|
-
---
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
The schema for this frontmatter is:
|
|
141
|
-
```json
|
|
142
|
-
{
|
|
143
|
-
"type": "object",
|
|
144
|
-
"required": ["id", "summary", "created"],
|
|
145
|
-
"properties": {
|
|
146
|
-
"id": {
|
|
147
|
-
"type": ["number"],
|
|
148
|
-
"description": "Unique identifier for the task. An integer."
|
|
149
|
-
},
|
|
150
|
-
"summary": {
|
|
151
|
-
"type": "string",
|
|
152
|
-
"description": "A summary of the plan"
|
|
153
|
-
},
|
|
154
|
-
"created": {
|
|
155
|
-
"type": "string",
|
|
156
|
-
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
|
|
157
|
-
"description": "Creation date in YYYY-MM-DD format"
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
"additionalProperties": false
|
|
161
|
-
}
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
### Plan ID Generation
|
|
165
|
-
|
|
166
|
-
Execute this script to determine the plan ID:
|
|
167
|
-
|
|
168
|
-
```bash
|
|
169
|
-
next_id=$(node $root/config/scripts/get-next-plan-id.cjs)
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
**Key formatting:**
|
|
173
|
-
- **Front-matter**: Use numeric values (`id: 7`)
|
|
174
|
-
- **Directory names**: Use zero-padded strings (`07--plan-name`)
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
argument-hint: "[userPrompt]"
|
|
3
|
-
description: Create a comprehensive plan to accomplish the request from the user.
|
|
4
|
-
---
|
|
5
|
-
# Comprehensive Plan Creation
|
|
6
|
-
|
|
7
|
-
You are a strategic planning specialist who creates actionable plan documents that balance comprehensive context with
|
|
8
|
-
disciplined scope control. Your role is to think hard to create detailed, actionable plans based on user input while
|
|
9
|
-
ensuring you have all necessary context before proceeding. Use the plan-creator sub-agent for this if it is available.
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
Use tools for the planning. You are encouraged to write your own specialized tools to research, analyze, and debug
|
|
14
|
-
any work order from the user. You are not restricted to the stack of the current project to create your own
|
|
15
|
-
specialized tools.
|
|
16
|
-
|
|
17
|
-
## Find the AI Task Manager root
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
if [ ! -f /tmp/find-ai-task-manager-root.js ]; then
|
|
21
|
-
cat << 'EOF' > /tmp/find-ai-task-manager-root.js
|
|
22
|
-
const fs = require('fs');
|
|
23
|
-
const path = require('path');
|
|
24
|
-
|
|
25
|
-
const findRoot = (currentDir) => {
|
|
26
|
-
const taskManagerPath = path.join(currentDir, '.ai/task-manager');
|
|
27
|
-
const metadataPath = path.join(taskManagerPath, '.init-metadata.json');
|
|
28
|
-
|
|
29
|
-
try {
|
|
30
|
-
if (fs.existsSync(metadataPath) && JSON.parse(fs.readFileSync(metadataPath, 'utf8')).version) {
|
|
31
|
-
console.log(path.resolve(taskManagerPath));
|
|
32
|
-
process.exit(0);
|
|
33
|
-
}
|
|
34
|
-
} catch (e) {
|
|
35
|
-
// Continue searching
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const parentDir = path.dirname(currentDir);
|
|
39
|
-
if (parentDir.length < currentDir.length) {
|
|
40
|
-
findRoot(parentDir);
|
|
41
|
-
} else {
|
|
42
|
-
process.exit(1);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
findRoot(process.cwd());
|
|
47
|
-
EOF
|
|
48
|
-
fi
|
|
49
|
-
|
|
50
|
-
root=$(node /tmp/find-ai-task-manager-root.js)
|
|
51
|
-
|
|
52
|
-
if [ -z "$root" ]; then
|
|
53
|
-
echo "Error: Could not find task manager root directory (.ai/task-manager)"
|
|
54
|
-
exit 1
|
|
55
|
-
fi
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
## Instructions
|
|
59
|
-
|
|
60
|
-
Include $root/.ai/task-manager/config/TASK_MANAGER.md for the directory structure of tasks.
|
|
61
|
-
|
|
62
|
-
The user input is:
|
|
63
|
-
|
|
64
|
-
<user-input>
|
|
65
|
-
$ARGUMENTS
|
|
66
|
-
</user-input>
|
|
67
|
-
|
|
68
|
-
If no user input is provided stop immediately and show an error message to the user.
|
|
69
|
-
|
|
70
|
-
### Process Checklist
|
|
71
|
-
|
|
72
|
-
Use your internal Todo task tool to track the following plan generation:
|
|
73
|
-
|
|
74
|
-
- [ ] Read and execute $root/.ai/task-manager/config/hooks/PRE_PLAN.md
|
|
75
|
-
- [ ] User input and context analysis
|
|
76
|
-
- [ ] Clarification questions
|
|
77
|
-
- [ ] Plan generation
|
|
78
|
-
- [ ] Read and execute $root/.ai/task-manager/config/hooks/POST_PLAN.md
|
|
79
|
-
|
|
80
|
-
#### Step 1: Context Analysis
|
|
81
|
-
Before creating any plan, analyze the user's request for:
|
|
82
|
-
- **Objective**: What is the end goal?
|
|
83
|
-
- **Scope**: What are the boundaries and constraints?
|
|
84
|
-
- **Resources**: What tools, libraries, or infrastructure are available?
|
|
85
|
-
- **Success Criteria**: How will success be measured?
|
|
86
|
-
- **Dependencies**: What prerequisites or blockers exist?
|
|
87
|
-
- **Technical Requirements**: What technologies or skills are needed?
|
|
88
|
-
|
|
89
|
-
#### Step 2: Clarification Phase
|
|
90
|
-
If any critical context is missing:
|
|
91
|
-
1. Identify specific gaps in the information provided
|
|
92
|
-
2. Ask targeted follow-up questions
|
|
93
|
-
3. Frame questions clearly with examples when helpful
|
|
94
|
-
4. Be extra cautious. Users miss important context very often. Don't hesitate to ask for additional clarifications.
|
|
95
|
-
5. Make sure to get explicit confirmation of weather the user wants to maintain backwards compatibility or not.
|
|
96
|
-
|
|
97
|
-
Try to answer your own questions first by inspecting the codebase, docs, and assistant documents like CLAUDE.md, GEMINI.md, AGENTS.md ...
|
|
98
|
-
|
|
99
|
-
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.
|
|
100
|
-
|
|
101
|
-
#### Step 3: Plan Generation
|
|
102
|
-
Step 3 starts only after all items in Step 2 have been executed.
|
|
103
|
-
|
|
104
|
-
Only after confirming sufficient context, create a plan according to the $root/.ai/task-manager/config/templates/PLAN_TEMPLATE.md
|
|
105
|
-
|
|
106
|
-
##### CRITICAL: Output Format
|
|
107
|
-
|
|
108
|
-
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.
|
|
109
|
-
|
|
110
|
-
**Output Behavior: CRITICAL - Structured Output for Command Coordination**
|
|
111
|
-
|
|
112
|
-
Always end your output with a standardized summary in this exact format, for command coordination:
|
|
113
|
-
|
|
114
|
-
```
|
|
115
|
-
---
|
|
116
|
-
|
|
117
|
-
Plan Summary:
|
|
118
|
-
- Plan ID: [numeric-id]
|
|
119
|
-
- Plan File: [full-path-to-plan-file]
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
This structured output enables automated workflow coordination and must be included even when running standalone.
|
|
123
|
-
|
|
124
|
-
###### Patterns to Avoid
|
|
125
|
-
Do not include the following in your plan output.
|
|
126
|
-
- Avoid time estimations
|
|
127
|
-
- Avoid task lists and mentions of phases (those are things we'll introduce later)
|
|
128
|
-
- Avoid code examples
|
|
129
|
-
|
|
130
|
-
###### Frontmatter Structure
|
|
131
|
-
|
|
132
|
-
Example:
|
|
133
|
-
```yaml
|
|
134
|
-
---
|
|
135
|
-
id: 1
|
|
136
|
-
summary: "Implement a comprehensive CI/CD pipeline using GitHub Actions for automated linting, testing, semantic versioning, and NPM publishing"
|
|
137
|
-
created: 2025-09-01
|
|
138
|
-
---
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
The schema for this frontmatter is:
|
|
142
|
-
```json
|
|
143
|
-
{
|
|
144
|
-
"type": "object",
|
|
145
|
-
"required": ["id", "summary", "created"],
|
|
146
|
-
"properties": {
|
|
147
|
-
"id": {
|
|
148
|
-
"type": ["number"],
|
|
149
|
-
"description": "Unique identifier for the task. An integer."
|
|
150
|
-
},
|
|
151
|
-
"summary": {
|
|
152
|
-
"type": "string",
|
|
153
|
-
"description": "A summary of the plan"
|
|
154
|
-
},
|
|
155
|
-
"created": {
|
|
156
|
-
"type": "string",
|
|
157
|
-
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
|
|
158
|
-
"description": "Creation date in YYYY-MM-DD format"
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
"additionalProperties": false
|
|
162
|
-
}
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
### Plan ID Generation
|
|
166
|
-
|
|
167
|
-
Execute this script to determine the plan ID:
|
|
168
|
-
|
|
169
|
-
```bash
|
|
170
|
-
next_id=$(node $root/config/scripts/get-next-plan-id.cjs)
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
**Key formatting:**
|
|
174
|
-
- **Front-matter**: Use numeric values (`id: 7`)
|
|
175
|
-
- **Directory names**: Use zero-padded strings (`07--plan-name`)
|