@e0ipso/ai-task-manager 1.36.0 → 1.37.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
package/dist/utils.js
CHANGED
|
@@ -1,153 +1,87 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Helper Functions for
|
|
3
|
+
* Helper Functions for the CLI
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* path manipulation, and other common tasks used by the CLI
|
|
5
|
+
* Validation helpers for the `--harnesses` option.
|
|
7
6
|
*/
|
|
8
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
-
if (k2 === undefined) k2 = k;
|
|
10
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
-
}
|
|
14
|
-
Object.defineProperty(o, k2, desc);
|
|
15
|
-
}) : (function(o, m, k, k2) {
|
|
16
|
-
if (k2 === undefined) k2 = k;
|
|
17
|
-
o[k2] = m[k];
|
|
18
|
-
}));
|
|
19
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
-
}) : function(o, v) {
|
|
22
|
-
o["default"] = v;
|
|
23
|
-
});
|
|
24
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
-
var ownKeys = function(o) {
|
|
26
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
-
var ar = [];
|
|
28
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
-
return ar;
|
|
30
|
-
};
|
|
31
|
-
return ownKeys(o);
|
|
32
|
-
};
|
|
33
|
-
return function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
})();
|
|
41
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.
|
|
43
|
-
exports.
|
|
44
|
-
exports.getTemplateFormat = getTemplateFormat;
|
|
8
|
+
exports.parseHarnesses = parseHarnesses;
|
|
9
|
+
exports.validateHarnesses = validateHarnesses;
|
|
45
10
|
exports.parseFrontmatter = parseFrontmatter;
|
|
46
11
|
exports.escapeTomlString = escapeTomlString;
|
|
47
12
|
exports.escapeTomlTripleQuotedString = escapeTomlTripleQuotedString;
|
|
48
|
-
exports.
|
|
49
|
-
exports.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
13
|
+
exports.convertAgentMdToToml = convertAgentMdToToml;
|
|
14
|
+
exports.getAgentFormat = getAgentFormat;
|
|
15
|
+
const VALID_HARNESSES = [
|
|
16
|
+
'claude',
|
|
17
|
+
'codex',
|
|
18
|
+
'cursor',
|
|
19
|
+
'gemini',
|
|
20
|
+
'github',
|
|
21
|
+
'opencode',
|
|
22
|
+
];
|
|
54
23
|
/**
|
|
55
|
-
* Parse comma-separated
|
|
56
|
-
* @param value - Comma-separated string of
|
|
57
|
-
* @returns Array of
|
|
58
|
-
* @throws Error if invalid
|
|
24
|
+
* Parse comma-separated harness values into an array
|
|
25
|
+
* @param value - Comma-separated string of harness names
|
|
26
|
+
* @returns Array of harness names
|
|
27
|
+
* @throws Error if invalid harness names are provided
|
|
59
28
|
*/
|
|
60
|
-
function
|
|
61
|
-
const validAssistants = [
|
|
62
|
-
'claude',
|
|
63
|
-
'codex',
|
|
64
|
-
'cursor',
|
|
65
|
-
'gemini',
|
|
66
|
-
'github',
|
|
67
|
-
'opencode',
|
|
68
|
-
];
|
|
29
|
+
function parseHarnesses(value) {
|
|
69
30
|
if (!value.trim()) {
|
|
70
|
-
throw new Error('
|
|
31
|
+
throw new Error('Harnesses parameter cannot be empty');
|
|
71
32
|
}
|
|
72
|
-
const
|
|
33
|
+
const harnesses = value
|
|
73
34
|
.split(',')
|
|
74
35
|
.map(a => a.trim().toLowerCase())
|
|
75
36
|
.filter(a => a.length > 0);
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
throw new Error(`Invalid assistant(s): ${invalidAssistants.join(', ')}. Valid options are: ${validAssistants.join(', ')}`);
|
|
37
|
+
const invalidHarnesses = harnesses.filter((harness) => !VALID_HARNESSES.includes(harness));
|
|
38
|
+
if (invalidHarnesses.length > 0) {
|
|
39
|
+
throw new Error(`Invalid harness(es): ${invalidHarnesses.join(', ')}. Valid options are: ${VALID_HARNESSES.join(', ')}`);
|
|
80
40
|
}
|
|
81
|
-
|
|
82
|
-
return Array.from(new Set(assistants));
|
|
41
|
+
return Array.from(new Set(harnesses));
|
|
83
42
|
}
|
|
84
43
|
/**
|
|
85
|
-
* Validate that all
|
|
86
|
-
* @param
|
|
87
|
-
* @throws Error if any
|
|
44
|
+
* Validate that all harnesses are supported
|
|
45
|
+
* @param harnesses - Array of harnesses to validate
|
|
46
|
+
* @throws Error if any harness is invalid or array is empty
|
|
88
47
|
*/
|
|
89
|
-
function
|
|
90
|
-
|
|
91
|
-
'
|
|
92
|
-
'codex',
|
|
93
|
-
'cursor',
|
|
94
|
-
'gemini',
|
|
95
|
-
'github',
|
|
96
|
-
'opencode',
|
|
97
|
-
];
|
|
98
|
-
if (assistants.length === 0) {
|
|
99
|
-
throw new Error('At least one assistant must be specified');
|
|
48
|
+
function validateHarnesses(harnesses) {
|
|
49
|
+
if (harnesses.length === 0) {
|
|
50
|
+
throw new Error('At least one harness must be specified');
|
|
100
51
|
}
|
|
101
|
-
for (const
|
|
102
|
-
if (!
|
|
103
|
-
throw new Error(`Invalid
|
|
52
|
+
for (const harness of harnesses) {
|
|
53
|
+
if (!VALID_HARNESSES.includes(harness)) {
|
|
54
|
+
throw new Error(`Invalid harness: ${harness}. Supported harnesses: ${VALID_HARNESSES.join(', ')}`);
|
|
104
55
|
}
|
|
105
56
|
}
|
|
106
57
|
}
|
|
107
58
|
/**
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
* @returns The template format to use ('md' for Claude/Open Code, 'toml' for Gemini)
|
|
111
|
-
*/
|
|
112
|
-
function getTemplateFormat(assistant) {
|
|
113
|
-
switch (assistant) {
|
|
114
|
-
case 'claude':
|
|
115
|
-
return 'md';
|
|
116
|
-
case 'codex':
|
|
117
|
-
return 'md';
|
|
118
|
-
case 'cursor':
|
|
119
|
-
return 'md';
|
|
120
|
-
case 'gemini':
|
|
121
|
-
return 'toml';
|
|
122
|
-
case 'github':
|
|
123
|
-
return 'md'; // GitHub prompt files use Markdown
|
|
124
|
-
case 'opencode':
|
|
125
|
-
return 'md';
|
|
126
|
-
default:
|
|
127
|
-
// This should never happen due to type safety, but adding for completeness
|
|
128
|
-
throw new Error(`Unknown assistant type: ${assistant}`);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Parse YAML frontmatter from markdown content
|
|
133
|
-
* @param content - The markdown content with frontmatter
|
|
134
|
-
* @returns Object containing frontmatter and body content
|
|
59
|
+
* Extract YAML frontmatter and body from a markdown string.
|
|
60
|
+
* Returns an empty frontmatter object when no fences are found.
|
|
135
61
|
*/
|
|
136
62
|
function parseFrontmatter(content) {
|
|
137
63
|
const frontmatterRegex = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n([\s\S]*))?$/;
|
|
138
64
|
const match = content.match(frontmatterRegex);
|
|
139
65
|
if (!match) {
|
|
140
|
-
return {
|
|
141
|
-
frontmatter: {},
|
|
142
|
-
body: content,
|
|
143
|
-
};
|
|
66
|
+
return { frontmatter: {}, body: content };
|
|
144
67
|
}
|
|
145
|
-
const frontmatterContent = match[1] || '';
|
|
146
|
-
const bodyContent = match[2] || ''; // match[2] is now undefined when no body exists
|
|
147
|
-
// Simple YAML parser for our specific use case
|
|
148
68
|
const frontmatter = {};
|
|
149
|
-
const lines =
|
|
69
|
+
const lines = (match[1] || '').split('\n');
|
|
70
|
+
let currentKey = '';
|
|
71
|
+
let multilineValue = [];
|
|
72
|
+
const flushMultiline = () => {
|
|
73
|
+
if (currentKey && multilineValue.length > 0) {
|
|
74
|
+
frontmatter[currentKey] = multilineValue.join('\n');
|
|
75
|
+
}
|
|
76
|
+
currentKey = '';
|
|
77
|
+
multilineValue = [];
|
|
78
|
+
};
|
|
150
79
|
for (const line of lines) {
|
|
80
|
+
if (currentKey && (line.startsWith(' ') || line.startsWith('\t'))) {
|
|
81
|
+
multilineValue.push(line.replace(/^ {2}/, '').replace(/^\t/, ''));
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
flushMultiline();
|
|
151
85
|
const trimmed = line.trim();
|
|
152
86
|
if (!trimmed || trimmed.startsWith('#'))
|
|
153
87
|
continue;
|
|
@@ -156,18 +90,19 @@ function parseFrontmatter(content) {
|
|
|
156
90
|
continue;
|
|
157
91
|
const key = trimmed.substring(0, colonIndex).trim();
|
|
158
92
|
const value = trimmed.substring(colonIndex + 1).trim();
|
|
159
|
-
|
|
160
|
-
|
|
93
|
+
if (value === '|' || value === '>') {
|
|
94
|
+
currentKey = key;
|
|
95
|
+
multilineValue = [];
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
frontmatter[key] = value.replace(/^["']|["']$/g, '');
|
|
99
|
+
}
|
|
161
100
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
body: bodyContent,
|
|
165
|
-
};
|
|
101
|
+
flushMultiline();
|
|
102
|
+
return { frontmatter, body: (match[2] || '').trimStart() };
|
|
166
103
|
}
|
|
167
104
|
/**
|
|
168
|
-
* Escape a string for TOML
|
|
169
|
-
* @param str - The string to escape
|
|
170
|
-
* @returns The escaped string suitable for TOML
|
|
105
|
+
* Escape a string for use inside a TOML basic (double-quoted) string.
|
|
171
106
|
*/
|
|
172
107
|
function escapeTomlString(str) {
|
|
173
108
|
return str
|
|
@@ -178,107 +113,46 @@ function escapeTomlString(str) {
|
|
|
178
113
|
.replace(/\t/g, '\\t');
|
|
179
114
|
}
|
|
180
115
|
/**
|
|
181
|
-
* Escape a string for TOML triple-quoted
|
|
182
|
-
* Triple-quoted strings in TOML do NOT interpret escape sequences,
|
|
183
|
-
* so we preserve newlines and only escape triple-quote boundaries.
|
|
184
|
-
* However, some TOML parsers (notably Gemini's) treat backslashes as escape
|
|
185
|
-
* characters even in triple-quoted strings, so we must escape them.
|
|
186
|
-
* @param str - The string to escape
|
|
187
|
-
* @returns The escaped string suitable for TOML triple-quoted strings
|
|
116
|
+
* Escape a string for use inside a TOML multi-line basic (triple-quoted) string.
|
|
188
117
|
*/
|
|
189
118
|
function escapeTomlTripleQuotedString(str) {
|
|
190
|
-
return (
|
|
191
|
-
// Escape backslashes first to prevent them being treated as escape characters
|
|
192
|
-
// by non-compliant TOML parsers (notably Gemini's parser)
|
|
193
|
-
.replace(/\\/g, '\\\\')
|
|
194
|
-
// Escape triple-quote sequences that would break the string delimiters
|
|
195
|
-
.replace(/"""/g, '"\\"'));
|
|
119
|
+
return str.replace(/\\\\/g, '\\\\\\\\').replace(/"""/g, '"\\""');
|
|
196
120
|
}
|
|
197
121
|
/**
|
|
198
|
-
* Convert
|
|
199
|
-
*
|
|
200
|
-
* @returns The converted TOML content
|
|
122
|
+
* Convert a canonical agent markdown template (with YAML frontmatter
|
|
123
|
+
* containing `name` and `description`) into Codex's TOML agent format.
|
|
201
124
|
*/
|
|
202
|
-
function
|
|
125
|
+
function convertAgentMdToToml(mdContent) {
|
|
203
126
|
const { frontmatter, body } = parseFrontmatter(mdContent);
|
|
204
|
-
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
tomlContent += '[metadata]\n';
|
|
216
|
-
// Add frontmatter fields to metadata section
|
|
217
|
-
for (const [key, value] of Object.entries(frontmatter)) {
|
|
218
|
-
if (key === 'argument-hint') {
|
|
219
|
-
// Special handling for argument-hint - convert to {{}} format
|
|
220
|
-
const convertedHint = String(value)
|
|
221
|
-
.replace(/\[planId\]/g, '{{plan_id}}')
|
|
222
|
-
.replace(/\[taskId\]/g, '{{task_id}}')
|
|
223
|
-
.replace(/\[userPrompt\]/g, '{{args}}')
|
|
224
|
-
.replace(/\[testCommand\]/g, '{{test_command}}');
|
|
225
|
-
tomlContent += `argument-hint = "${escapeTomlString(convertedHint)}"\n`;
|
|
226
|
-
}
|
|
227
|
-
else {
|
|
228
|
-
tomlContent += `${key} = "${escapeTomlString(String(value))}"\n`;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
return tomlContent;
|
|
127
|
+
const name = escapeTomlString(frontmatter.name || '');
|
|
128
|
+
const description = escapeTomlString((frontmatter.description || '').trim());
|
|
129
|
+
const instructions = escapeTomlTripleQuotedString(body.trim());
|
|
130
|
+
return [
|
|
131
|
+
`name = "${name}"`,
|
|
132
|
+
`description = "${description}"`,
|
|
133
|
+
`developer_instructions = """`,
|
|
134
|
+
instructions,
|
|
135
|
+
`"""`,
|
|
136
|
+
'',
|
|
137
|
+
].join('\n');
|
|
232
138
|
}
|
|
233
139
|
/**
|
|
234
|
-
*
|
|
235
|
-
* @param mdContent - The markdown template content
|
|
236
|
-
* @returns The converted prompt file content
|
|
140
|
+
* Return the agent file format, extension, and target directory for a harness.
|
|
237
141
|
*/
|
|
238
|
-
function
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
* @param templatePath - Path to the markdown template
|
|
253
|
-
* @param targetFormat - Target format ('md' or 'toml')
|
|
254
|
-
* @param assistant - Optional assistant type for format-specific processing
|
|
255
|
-
* @returns The template content in the requested format
|
|
256
|
-
*/
|
|
257
|
-
async function readAndProcessTemplate(templatePath, targetFormat, assistant) {
|
|
258
|
-
const mdContent = await fs.readFile(templatePath, 'utf-8');
|
|
259
|
-
if (targetFormat === 'md') {
|
|
260
|
-
// Check if GitHub assistant needs special processing
|
|
261
|
-
if (assistant === 'github') {
|
|
262
|
-
return convertMdToGitHubPrompt(mdContent);
|
|
263
|
-
}
|
|
264
|
-
return mdContent; // Claude and OpenCode use raw Markdown
|
|
265
|
-
}
|
|
266
|
-
else if (targetFormat === 'toml') {
|
|
267
|
-
return convertMdToToml(mdContent); // Gemini conversion
|
|
268
|
-
}
|
|
269
|
-
else {
|
|
270
|
-
throw new Error(`Unsupported template format: ${targetFormat}`);
|
|
142
|
+
function getAgentFormat(harness) {
|
|
143
|
+
switch (harness) {
|
|
144
|
+
case 'codex':
|
|
145
|
+
return { format: 'toml', extension: '.toml', directory: '.codex/agents' };
|
|
146
|
+
case 'github':
|
|
147
|
+
return { format: 'md', extension: '.agent.md', directory: '.github/agents' };
|
|
148
|
+
case 'claude':
|
|
149
|
+
return { format: 'md', extension: '.md', directory: '.claude/agents' };
|
|
150
|
+
case 'gemini':
|
|
151
|
+
return { format: 'md', extension: '.md', directory: '.gemini/agents' };
|
|
152
|
+
case 'cursor':
|
|
153
|
+
return { format: 'md', extension: '.md', directory: '.cursor/agents' };
|
|
154
|
+
case 'opencode':
|
|
155
|
+
return { format: 'md', extension: '.md', directory: '.opencode/agents' };
|
|
271
156
|
}
|
|
272
157
|
}
|
|
273
|
-
/**
|
|
274
|
-
* Write processed template content to destination
|
|
275
|
-
* @param content - The template content to write
|
|
276
|
-
* @param destPath - Destination file path
|
|
277
|
-
*/
|
|
278
|
-
async function writeProcessedTemplate(content, destPath) {
|
|
279
|
-
// Ensure destination directory exists
|
|
280
|
-
await fs.ensureDir(path.dirname(destPath));
|
|
281
|
-
// Write the content
|
|
282
|
-
await fs.writeFile(destPath, content, 'utf-8');
|
|
283
|
-
}
|
|
284
158
|
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAmBH,wCAqBC;AAOD,8CAYC;AAYD,4CAkDC;AAKD,4CAOC;AAKD,oEAEC;AAMD,oDAcC;AAWD,wCAeC;AAtLD,MAAM,eAAe,GAAuB;IAC1C,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,UAAU;CACX,CAAC;AAEF;;;;;GAKG;AACH,SAAgB,cAAc,CAAC,KAAa;IAC1C,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,SAAS,GAAG,KAAK;SACpB,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;SAChC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAE7B,MAAM,gBAAgB,GAAG,SAAS,CAAC,MAAM,CACvC,CAAC,OAAO,EAAqB,EAAE,CAAC,CAAC,eAAe,CAAC,Q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;QACL,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAQD;;GAEG;AACH,SAAgB,cAAc,CAAC,OAAgB;IAC7C,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,OAAO;YACV,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;QAC5E,KAAK,QAAQ;YACX,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;QAC/E,KAAK,QAAQ;YACX,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;QACzE,KAAK,QAAQ;YACX,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;QACzE,KAAK,QAAQ;YACX,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;QACzE,KAAK,UAAU;YACb,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;IAC7E,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e0ipso/ai-task-manager",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.37.0",
|
|
4
4
|
"description": "Task management for AI coding assistants",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"ai-task-manager": "dist/cli.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"build": "tsc",
|
|
10
|
+
"build": "tsc && npm run build:skills",
|
|
11
|
+
"build:skills": "tsc --noEmit -p tsconfig.skill-scripts.json && node scripts/build-skills.cjs",
|
|
11
12
|
"dev": "tsc --watch",
|
|
12
13
|
"start": "node dist/cli.js",
|
|
13
14
|
"test": "jest",
|
|
@@ -77,6 +78,7 @@
|
|
|
77
78
|
"@types/node": "^24.3.0",
|
|
78
79
|
"@typescript-eslint/eslint-plugin": "^8.41.0",
|
|
79
80
|
"@typescript-eslint/parser": "^8.41.0",
|
|
81
|
+
"esbuild": "^0.28.0",
|
|
80
82
|
"eslint": "^9.34.0",
|
|
81
83
|
"eslint-config-prettier": "^10.1.8",
|
|
82
84
|
"eslint-plugin-prettier": "^5.5.4",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Task Manager General Information
|
|
2
2
|
|
|
3
|
-
This document contains important information that is common to all the
|
|
4
|
-
|
|
3
|
+
This document contains important information that is common to all the
|
|
4
|
+
task-manager skills your AI assistant uses to plan, decompose, and execute work.
|
|
5
5
|
|
|
6
6
|
## Types of Documents
|
|
7
7
|
|
|
@@ -66,7 +66,7 @@ Plans follow a lifecycle that maintains workspace organization:
|
|
|
66
66
|
|
|
67
67
|
1. **Active Plans**: When created, plans are placed in the `plans/` directory where they remain while being worked on.
|
|
68
68
|
|
|
69
|
-
2. **Completed Plans**: Upon successful execution of a blueprint (via
|
|
69
|
+
2. **Completed Plans**: Upon successful execution of a blueprint (via the `task-execute-blueprint` skill), the entire plan directory is automatically moved from `plans/` to `archive/`.
|
|
70
70
|
|
|
71
71
|
3. **Archive Directory**: The `archive/` directory serves as permanent storage for completed work. This separation keeps the active workspace clean while preserving completed plans for reference.
|
|
72
72
|
|
|
@@ -4,38 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
### Feature Branch Creation
|
|
6
6
|
|
|
7
|
-
Create a feature branch for this plan execution
|
|
7
|
+
Create a feature branch for this plan execution:
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
# Exit codes:
|
|
14
|
-
# 0 = Success (branch created, already exists, or not on main/master)
|
|
15
|
-
# 1 = Error (not git repo, uncommitted changes, or plan not found)
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
**Behavior**:
|
|
19
|
-
- From `main`/`master` with clean tree: Creates `feature/{planId}--{plan-name}` branch
|
|
20
|
-
- From `main`/`master` with uncommitted changes: Exits with error (exit 1)
|
|
21
|
-
- From feature branch: Proceeds without creating a new branch
|
|
22
|
-
- Branch already exists: Proceeds normally
|
|
9
|
+
- From `main`/`master` with a clean working tree: create a branch named `feature/{planId}--{plan-name}` and switch to it.
|
|
10
|
+
- From `main`/`master` with uncommitted changes: halt with an error — do not proceed.
|
|
11
|
+
- Already on a feature branch: proceed without creating a new branch.
|
|
12
|
+
- Branch already exists: switch to it and proceed normally.
|
|
23
13
|
|
|
24
14
|
## Phase Execution Workflow
|
|
25
15
|
|
|
26
16
|
1. **Phase Initialization**
|
|
27
17
|
- Identify current phase from the execution blueprint
|
|
28
18
|
- List all tasks scheduled for parallel execution in this phase
|
|
29
|
-
- **Validate Task Dependencies**: For each task in the current phase,
|
|
30
|
-
```bash
|
|
31
|
-
# For each task in current phase
|
|
32
|
-
for TASK_ID in $PHASE_TASKS; do
|
|
33
|
-
if ! node .ai/task-manager/config/scripts/check-task-dependencies.cjs "$1" "$TASK_ID"; then
|
|
34
|
-
echo "ERROR: Task $TASK_ID has unresolved dependencies - cannot proceed with phase execution"
|
|
35
|
-
echo "Please resolve dependencies before continuing with blueprint execution"
|
|
36
|
-
exit 1
|
|
37
|
-
fi
|
|
38
|
-
done
|
|
39
|
-
```
|
|
19
|
+
- **Validate Task Dependencies**: For each task in the current phase, verify that all declared dependencies (from the task's YAML frontmatter `dependencies` array) have status `completed`. If any dependency is unresolved, halt the phase and report the blocking dependencies before continuing.
|
|
40
20
|
- Confirm no tasks are marked "needs-clarification"
|
|
41
21
|
- If any phases are marked as completed, verify they are actually completed and continue from the next phase.
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
- Select the most appropriate sub-agent (if any are available). If no sub-agent is appropriate, use the general-purpose one.
|
|
10
10
|
- Consider task-specific requirements from the task document
|
|
11
11
|
|
|
12
|
-
[IMPORTANT] Analyze the set of tasks skills in order to engage any relevant
|
|
12
|
+
[IMPORTANT] Analyze the set of tasks skills in order to engage any relevant harness skills as necessary (either global
|
|
13
13
|
or project skills).
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
## Available Sub-Agents
|
|
17
|
-
Analyze the sub-agents available in your current
|
|
17
|
+
Analyze the sub-agents available in your current harness's agents directory. If none are available or the available
|
|
18
18
|
ones do not match the task's requirements, then use a generic agent.
|
|
19
19
|
|
|
20
20
|
## Matching Criteria
|
|
@@ -26,25 +26,7 @@ Select agents based on:
|
|
|
26
26
|
|
|
27
27
|
## Skills Extraction and Agent Detection
|
|
28
28
|
|
|
29
|
-
Read
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
TASK_SKILLS=$(node "$root/config/scripts/extract-task-skills.cjs" "$TASK_FILE")
|
|
34
|
-
|
|
35
|
-
echo "Task skills required: $TASK_SKILLS"
|
|
36
|
-
|
|
37
|
-
# Check for available sub-agents across assistant directories
|
|
38
|
-
AGENT_FOUND=false
|
|
39
|
-
for assistant_dir in .claude .gemini .opencode; do
|
|
40
|
-
if [ -d "$assistant_dir/agents" ] && [ -n "$(ls $assistant_dir/agents 2>/dev/null)" ]; then
|
|
41
|
-
echo "Available sub-agents detected in $assistant_dir - will match to task requirements"
|
|
42
|
-
AGENT_FOUND=true
|
|
43
|
-
break
|
|
44
|
-
fi
|
|
45
|
-
done
|
|
46
|
-
|
|
47
|
-
if [ "$AGENT_FOUND" = false ]; then
|
|
48
|
-
echo "Using general-purpose agent for task execution"
|
|
49
|
-
fi
|
|
50
|
-
```
|
|
29
|
+
1. Read the `skills` array from the task's YAML frontmatter directly.
|
|
30
|
+
2. Check for available sub-agents in your harness's agents directory.
|
|
31
|
+
3. If matching sub-agents are found, select the most appropriate one based on the task's required skills.
|
|
32
|
+
4. If no sub-agents are available or none match, use a general-purpose agent for task execution.
|
|
@@ -89,7 +89,7 @@ Avoid vague statements like "verify it works" or "ensure quality". Each step mus
|
|
|
89
89
|
|
|
90
90
|
## Documentation
|
|
91
91
|
|
|
92
|
-
[Required documentation updates to existing documentation, either human-focused documentation
|
|
92
|
+
[Required documentation updates to existing documentation, either human-focused documentation like README.md or AI-facing documentation like AGENTS.md and related configuration files.]
|
|
93
93
|
|
|
94
94
|
## Resource Requirements
|
|
95
95
|
|
|
@@ -18,7 +18,7 @@ Create strategic blueprints that define WHAT to build and WHY, not HOW. Your pla
|
|
|
18
18
|
## Critical Workflow
|
|
19
19
|
|
|
20
20
|
**1. Context Gathering**
|
|
21
|
-
- Read
|
|
21
|
+
- Read project instructions (AGENTS.md, README.md, or equivalent)
|
|
22
22
|
- Search codebase for similar patterns
|
|
23
23
|
- Ask specific, categorized clarification questions when gaps exist
|
|
24
24
|
- STOP and wait for answers before planning
|
|
@@ -73,7 +73,7 @@ Eliminate these anti-patterns:
|
|
|
73
73
|
1. Execute PRE_PLAN.md hook if exists
|
|
74
74
|
2. Analyze user input and search codebase
|
|
75
75
|
3. Ask clarification questions if needed (STOP until answered)
|
|
76
|
-
4. Generate Plan ID:
|
|
76
|
+
4. Generate Plan ID: scan `.ai/task-manager/plans/` and `.ai/task-manager/archive/` for existing plan directories, extract the highest numeric `id` from their YAML frontmatter, and add 1. If no plans exist, use ID 1.
|
|
77
77
|
5. Create plan at `.ai/task-manager/plans/[ID]--[name]/plan-[ID]--[name].md`
|
|
78
78
|
6. Execute POST_PLAN.md hook if exists
|
|
79
79
|
7. Output:
|