task-o-matic 0.0.1
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/LICENSE +21 -0
- package/README.md +552 -0
- package/dist/cli/bin.d.ts +3 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +8 -0
- package/dist/cli/display/common.d.ts +5 -0
- package/dist/cli/display/common.d.ts.map +1 -0
- package/dist/cli/display/common.js +44 -0
- package/dist/cli/display/plan.d.ts +11 -0
- package/dist/cli/display/plan.d.ts.map +1 -0
- package/dist/cli/display/plan.js +42 -0
- package/dist/cli/display/progress.d.ts +11 -0
- package/dist/cli/display/progress.d.ts.map +1 -0
- package/dist/cli/display/progress.js +47 -0
- package/dist/cli/display/task.d.ts +18 -0
- package/dist/cli/display/task.d.ts.map +1 -0
- package/dist/cli/display/task.js +250 -0
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +61 -0
- package/dist/commands/init.d.ts +4 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +197 -0
- package/dist/commands/prd.d.ts +4 -0
- package/dist/commands/prd.d.ts.map +1 -0
- package/dist/commands/prd.js +131 -0
- package/dist/commands/prompt.d.ts +3 -0
- package/dist/commands/prompt.d.ts.map +1 -0
- package/dist/commands/prompt.js +192 -0
- package/dist/commands/tasks.d.ts +3 -0
- package/dist/commands/tasks.d.ts.map +1 -0
- package/dist/commands/tasks.js +599 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +67 -0
- package/dist/lib/ai-service/ai-operations.d.ts +31 -0
- package/dist/lib/ai-service/ai-operations.d.ts.map +1 -0
- package/dist/lib/ai-service/ai-operations.js +648 -0
- package/dist/lib/ai-service/json-parser.d.ts +9 -0
- package/dist/lib/ai-service/json-parser.d.ts.map +1 -0
- package/dist/lib/ai-service/json-parser.js +37 -0
- package/dist/lib/ai-service/mcp-client.d.ts +9 -0
- package/dist/lib/ai-service/mcp-client.d.ts.map +1 -0
- package/dist/lib/ai-service/mcp-client.js +48 -0
- package/dist/lib/ai-service/model-provider.d.ts +8 -0
- package/dist/lib/ai-service/model-provider.d.ts.map +1 -0
- package/dist/lib/ai-service/model-provider.js +71 -0
- package/dist/lib/ai-service/research-tools.d.ts +4 -0
- package/dist/lib/ai-service/research-tools.d.ts.map +1 -0
- package/dist/lib/ai-service/research-tools.js +8 -0
- package/dist/lib/ai-service/retry-handler.d.ts +8 -0
- package/dist/lib/ai-service/retry-handler.d.ts.map +1 -0
- package/dist/lib/ai-service/retry-handler.js +62 -0
- package/dist/lib/better-t-stack-cli.d.ts +35 -0
- package/dist/lib/better-t-stack-cli.d.ts.map +1 -0
- package/dist/lib/better-t-stack-cli.js +118 -0
- package/dist/lib/config.d.ts +24 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +160 -0
- package/dist/lib/context-builder.d.ts +53 -0
- package/dist/lib/context-builder.d.ts.map +1 -0
- package/dist/lib/context-builder.js +294 -0
- package/dist/lib/executors/executor-factory.d.ts +5 -0
- package/dist/lib/executors/executor-factory.d.ts.map +1 -0
- package/dist/lib/executors/executor-factory.js +21 -0
- package/dist/lib/executors/opencode-executor.d.ts +6 -0
- package/dist/lib/executors/opencode-executor.d.ts.map +1 -0
- package/dist/lib/executors/opencode-executor.js +46 -0
- package/dist/lib/index.d.ts +89 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +134 -0
- package/dist/lib/prompt-builder.d.ts +50 -0
- package/dist/lib/prompt-builder.d.ts.map +1 -0
- package/dist/lib/prompt-builder.js +171 -0
- package/dist/lib/prompt-registry.d.ts +22 -0
- package/dist/lib/prompt-registry.d.ts.map +1 -0
- package/dist/lib/prompt-registry.js +201 -0
- package/dist/lib/storage.d.ts +60 -0
- package/dist/lib/storage.d.ts.map +1 -0
- package/dist/lib/storage.js +768 -0
- package/dist/lib/task-execution.d.ts +3 -0
- package/dist/lib/task-execution.d.ts.map +1 -0
- package/dist/lib/task-execution.js +130 -0
- package/dist/lib/validation.d.ts +4 -0
- package/dist/lib/validation.d.ts.map +1 -0
- package/dist/lib/validation.js +52 -0
- package/dist/mcp/prompts.d.ts +3 -0
- package/dist/mcp/prompts.d.ts.map +1 -0
- package/dist/mcp/prompts.js +7 -0
- package/dist/mcp/resources.d.ts +3 -0
- package/dist/mcp/resources.d.ts.map +1 -0
- package/dist/mcp/resources.js +7 -0
- package/dist/mcp/server.d.ts +3 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +25 -0
- package/dist/mcp/tools.d.ts +3 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +99 -0
- package/dist/prompts/documentation-detection.d.ts +2 -0
- package/dist/prompts/documentation-detection.d.ts.map +1 -0
- package/dist/prompts/documentation-detection.js +24 -0
- package/dist/prompts/index.d.ts +7 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +22 -0
- package/dist/prompts/prd-parsing.d.ts +3 -0
- package/dist/prompts/prd-parsing.d.ts.map +1 -0
- package/dist/prompts/prd-parsing.js +172 -0
- package/dist/prompts/prd-rework.d.ts +3 -0
- package/dist/prompts/prd-rework.d.ts.map +1 -0
- package/dist/prompts/prd-rework.js +81 -0
- package/dist/prompts/task-breakdown.d.ts +3 -0
- package/dist/prompts/task-breakdown.d.ts.map +1 -0
- package/dist/prompts/task-breakdown.js +151 -0
- package/dist/prompts/task-enhancement.d.ts +3 -0
- package/dist/prompts/task-enhancement.d.ts.map +1 -0
- package/dist/prompts/task-enhancement.js +140 -0
- package/dist/prompts/task-planning.d.ts +3 -0
- package/dist/prompts/task-planning.d.ts.map +1 -0
- package/dist/prompts/task-planning.js +66 -0
- package/dist/services/prd.d.ts +32 -0
- package/dist/services/prd.d.ts.map +1 -0
- package/dist/services/prd.js +191 -0
- package/dist/services/tasks.d.ts +67 -0
- package/dist/services/tasks.d.ts.map +1 -0
- package/dist/services/tasks.js +596 -0
- package/dist/test/commands.test.d.ts +2 -0
- package/dist/test/commands.test.d.ts.map +1 -0
- package/dist/test/commands.test.js +74 -0
- package/dist/test/storage.test.d.ts +2 -0
- package/dist/test/storage.test.d.ts.map +1 -0
- package/dist/test/storage.test.js +207 -0
- package/dist/types/callbacks.d.ts +27 -0
- package/dist/types/callbacks.d.ts.map +1 -0
- package/dist/types/callbacks.js +2 -0
- package/dist/types/index.d.ts +252 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/mcp.d.ts +3 -0
- package/dist/types/mcp.d.ts.map +1 -0
- package/dist/types/mcp.js +3 -0
- package/dist/types/options.d.ts +94 -0
- package/dist/types/options.d.ts.map +1 -0
- package/dist/types/options.js +2 -0
- package/dist/types/results.d.ts +90 -0
- package/dist/types/results.d.ts.map +1 -0
- package/dist/types/results.js +2 -0
- package/dist/utils/ai-config-builder.d.ts +14 -0
- package/dist/utils/ai-config-builder.d.ts.map +1 -0
- package/dist/utils/ai-config-builder.js +22 -0
- package/dist/utils/ai-service-factory.d.ts +10 -0
- package/dist/utils/ai-service-factory.d.ts.map +1 -0
- package/dist/utils/ai-service-factory.js +52 -0
- package/dist/utils/stack-formatter.d.ts +11 -0
- package/dist/utils/stack-formatter.d.ts.map +1 -0
- package/dist/utils/stack-formatter.js +30 -0
- package/dist/utils/streaming-options.d.ts +10 -0
- package/dist/utils/streaming-options.d.ts.map +1 -0
- package/dist/utils/streaming-options.js +53 -0
- package/package.json +82 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-execution.d.ts","sourceRoot":"","sources":["../../src/lib/task-execution.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAgB,MAAM,UAAU,CAAC;AA2H5D,wBAAsB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4D5E"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.executeTask = executeTask;
|
|
7
|
+
const tasks_1 = require("../services/tasks");
|
|
8
|
+
const executor_factory_1 = require("./executors/executor-factory");
|
|
9
|
+
const validation_1 = require("./validation");
|
|
10
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
11
|
+
async function executeSingleTask(taskId, tool, dry) {
|
|
12
|
+
// Load task
|
|
13
|
+
const task = await tasks_1.taskService.getTask(taskId);
|
|
14
|
+
if (!task) {
|
|
15
|
+
throw new Error(`Task with ID ${taskId} not found`);
|
|
16
|
+
}
|
|
17
|
+
console.log(chalk_1.default.blue(`🎯 ${dry ? "DRY RUN" : "Executing"} task: ${task.title} (${taskId})`));
|
|
18
|
+
// Build execution message
|
|
19
|
+
let executionMessage;
|
|
20
|
+
const planData = await tasks_1.taskService.getTaskPlan(taskId);
|
|
21
|
+
if (planData) {
|
|
22
|
+
executionMessage = `Execute this task plan:\n\n${planData.plan}`;
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
executionMessage = `Execute this task: ${task.title}\n\nDescription: ${task.description || "No description"}`;
|
|
26
|
+
}
|
|
27
|
+
if (!dry) {
|
|
28
|
+
// console.log(chalk.yellow(`📝 Message that would be sent:`));
|
|
29
|
+
// console.log(chalk.cyan(executionMessage));
|
|
30
|
+
// } else {
|
|
31
|
+
// Update task status to in-progress
|
|
32
|
+
await tasks_1.taskService.setTaskStatus(taskId, "in-progress");
|
|
33
|
+
console.log(chalk_1.default.yellow("⏳ Task status updated to in-progress"));
|
|
34
|
+
}
|
|
35
|
+
try {
|
|
36
|
+
// Create executor and run
|
|
37
|
+
const executor = executor_factory_1.ExecutorFactory.create(tool);
|
|
38
|
+
console.log(chalk_1.default.cyan(`🔧 Using executor: ${executor.name}`));
|
|
39
|
+
await executor.execute(executionMessage, dry);
|
|
40
|
+
if (!dry) {
|
|
41
|
+
// Update task status to completed
|
|
42
|
+
await tasks_1.taskService.setTaskStatus(taskId, "completed");
|
|
43
|
+
console.log(chalk_1.default.green("✅ Task execution completed successfully"));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
if (!dry) {
|
|
48
|
+
// Update task status back to todo on failure
|
|
49
|
+
await tasks_1.taskService.setTaskStatus(taskId, "todo");
|
|
50
|
+
console.log(chalk_1.default.red("❌ Task execution failed, status reset to todo"));
|
|
51
|
+
}
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async function executeTaskWithSubtasks(taskId, tool, dry) {
|
|
56
|
+
const task = await tasks_1.taskService.getTask(taskId);
|
|
57
|
+
if (!task) {
|
|
58
|
+
throw new Error(`Task with ID ${taskId} not found`);
|
|
59
|
+
}
|
|
60
|
+
// Get subtasks
|
|
61
|
+
const subtasks = await tasks_1.taskService.getSubtasks(taskId);
|
|
62
|
+
if (subtasks.length === 0) {
|
|
63
|
+
// No subtasks, execute this task directly
|
|
64
|
+
await executeSingleTask(taskId, tool, dry);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
// Has subtasks - execute them one by one
|
|
68
|
+
console.log(chalk_1.default.blue(`📋 Task has ${subtasks.length} subtasks, executing recursively...`));
|
|
69
|
+
for (let i = 0; i < subtasks.length; i++) {
|
|
70
|
+
const subtask = subtasks[i];
|
|
71
|
+
console.log(chalk_1.default.cyan(`\n[${i + 1}/${subtasks.length}] Executing subtask: ${subtask.title} (${subtask.id})`));
|
|
72
|
+
try {
|
|
73
|
+
await executeTaskWithSubtasks(subtask.id, tool, dry);
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
console.error(chalk_1.default.red(`❌ Failed to execute subtask ${subtask.id}: ${error instanceof Error ? error.message : "Unknown error"}`));
|
|
77
|
+
throw error;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
// After all subtasks are done, mark the main task as completed
|
|
81
|
+
if (!dry) {
|
|
82
|
+
await tasks_1.taskService.setTaskStatus(taskId, "completed");
|
|
83
|
+
console.log(chalk_1.default.green(`✅ Main task ${task.title} completed after all subtasks`));
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
console.log(chalk_1.default.cyan(`🔍 DRY RUN - Main task ${task.title} would be completed after all subtasks`));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
async function executeTask(options) {
|
|
90
|
+
const { taskId, tool = "opencode", message, dry = false, validate = [], } = options;
|
|
91
|
+
// If custom message is provided, execute just this task (ignore subtasks)
|
|
92
|
+
if (message) {
|
|
93
|
+
const task = await tasks_1.taskService.getTask(taskId);
|
|
94
|
+
if (!task) {
|
|
95
|
+
throw new Error(`Task with ID ${taskId} not found`);
|
|
96
|
+
}
|
|
97
|
+
console.log(chalk_1.default.blue(`🎯 ${dry ? "DRY RUN - Would execute" : "Executing"} task with custom message: ${task.title} (${taskId})`));
|
|
98
|
+
if (dry) {
|
|
99
|
+
console.log(chalk_1.default.yellow(`📝 Custom message that would be sent:`));
|
|
100
|
+
console.log(chalk_1.default.cyan(message));
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
await tasks_1.taskService.setTaskStatus(taskId, "in-progress");
|
|
104
|
+
console.log(chalk_1.default.yellow("⏳ Task status updated to in-progress"));
|
|
105
|
+
}
|
|
106
|
+
try {
|
|
107
|
+
const executor = executor_factory_1.ExecutorFactory.create(tool);
|
|
108
|
+
console.log(chalk_1.default.cyan(`🔧 Using executor: ${executor.name}`));
|
|
109
|
+
await executor.execute(message, dry);
|
|
110
|
+
if (!dry) {
|
|
111
|
+
await tasks_1.taskService.setTaskStatus(taskId, "completed");
|
|
112
|
+
console.log(chalk_1.default.green("✅ Task execution completed successfully"));
|
|
113
|
+
}
|
|
114
|
+
// Run validations after task completion
|
|
115
|
+
await (0, validation_1.runValidations)(validate, dry);
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
if (!dry) {
|
|
119
|
+
await tasks_1.taskService.setTaskStatus(taskId, "todo");
|
|
120
|
+
console.log(chalk_1.default.red("❌ Task execution failed, status reset to todo"));
|
|
121
|
+
}
|
|
122
|
+
throw error;
|
|
123
|
+
}
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
// No custom message - execute recursively with subtasks
|
|
127
|
+
await executeTaskWithSubtasks(taskId, tool, dry);
|
|
128
|
+
// Run validations after all subtasks complete
|
|
129
|
+
await (0, validation_1.runValidations)(validate, dry);
|
|
130
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AIConfig } from '../types';
|
|
2
|
+
export declare function isValidAIProvider(provider: string): provider is NonNullable<AIConfig['provider']>;
|
|
3
|
+
export declare function runValidations(validations: string[], dry: boolean): Promise<void>;
|
|
4
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/lib/validation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAIpC,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,IAAI,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAEjG;AAED,wBAAsB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CA6CvF"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.isValidAIProvider = isValidAIProvider;
|
|
7
|
+
exports.runValidations = runValidations;
|
|
8
|
+
const child_process_1 = require("child_process");
|
|
9
|
+
const util_1 = require("util");
|
|
10
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
11
|
+
const execAsync = (0, util_1.promisify)(child_process_1.exec);
|
|
12
|
+
function isValidAIProvider(provider) {
|
|
13
|
+
return ['openrouter', 'openai', 'anthropic', 'custom'].includes(provider);
|
|
14
|
+
}
|
|
15
|
+
async function runValidations(validations, dry) {
|
|
16
|
+
if (validations.length === 0) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (dry) {
|
|
20
|
+
console.log(chalk_1.default.yellow('🔍 DRY RUN - Validations that would run:'));
|
|
21
|
+
validations.forEach(cmd => console.log(chalk_1.default.cyan(` ${cmd}`)));
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
console.log(chalk_1.default.blue(`🧪 Running ${validations.length} validation${validations.length > 1 ? 's' : ''}...`));
|
|
25
|
+
for (let i = 0; i < validations.length; i++) {
|
|
26
|
+
const validation = validations[i];
|
|
27
|
+
console.log(chalk_1.default.blue(`🧪 Running validation [${i + 1}/${validations.length}]: ${validation}`));
|
|
28
|
+
try {
|
|
29
|
+
const { stdout, stderr } = await execAsync(validation);
|
|
30
|
+
console.log(chalk_1.default.green(`✅ Validation passed: ${validation}`));
|
|
31
|
+
// Show stdout if there's any output
|
|
32
|
+
if (stdout && stdout.trim()) {
|
|
33
|
+
console.log(chalk_1.default.gray(` Output: ${stdout.trim()}`));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
console.error(chalk_1.default.red(`❌ Validation failed: ${validation}`));
|
|
38
|
+
// Show error details
|
|
39
|
+
if (error.stdout && error.stdout.trim()) {
|
|
40
|
+
console.error(chalk_1.default.yellow(` stdout: ${error.stdout.trim()}`));
|
|
41
|
+
}
|
|
42
|
+
if (error.stderr && error.stderr.trim()) {
|
|
43
|
+
console.error(chalk_1.default.red(` stderr: ${error.stderr.trim()}`));
|
|
44
|
+
}
|
|
45
|
+
if (error.message) {
|
|
46
|
+
console.error(chalk_1.default.red(` Error: ${error.message}`));
|
|
47
|
+
}
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
console.log(chalk_1.default.green(`🎉 All ${validations.length} validation${validations.length > 1 ? 's' : ''} passed!`));
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/mcp/prompts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEjE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,QAEnD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// MCP prompt definitions will be implemented here.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.registerMcpPrompts = registerMcpPrompts;
|
|
5
|
+
function registerMcpPrompts(server) {
|
|
6
|
+
// Example: server.registerPrompt(...);
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../src/mcp/resources.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEjE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,QAErD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// MCP resource definitions will be implemented here.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.registerMcpResources = registerMcpResources;
|
|
5
|
+
function registerMcpResources(server) {
|
|
6
|
+
// Example: server.registerResource(...);
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const mcp_1 = require("@modelcontextprotocol/sdk/server/mcp");
|
|
5
|
+
const stdio_1 = require("@modelcontextprotocol/sdk/server/stdio");
|
|
6
|
+
const tools_1 = require("./tools");
|
|
7
|
+
const resources_1 = require("./resources");
|
|
8
|
+
const prompts_1 = require("./prompts");
|
|
9
|
+
const mcpServer = new mcp_1.McpServer({
|
|
10
|
+
name: "task-o-matic-mcp-server",
|
|
11
|
+
version: "0.1.0",
|
|
12
|
+
});
|
|
13
|
+
// Register all tools, resources, and prompts
|
|
14
|
+
(0, tools_1.registerMcpTools)(mcpServer);
|
|
15
|
+
(0, resources_1.registerMcpResources)(mcpServer);
|
|
16
|
+
(0, prompts_1.registerMcpPrompts)(mcpServer);
|
|
17
|
+
async function main() {
|
|
18
|
+
const transport = new stdio_1.StdioServerTransport();
|
|
19
|
+
await mcpServer.connect(transport);
|
|
20
|
+
console.error("task-o-matic MCP server is running...");
|
|
21
|
+
}
|
|
22
|
+
main().catch((error) => {
|
|
23
|
+
console.error("Server error:", error);
|
|
24
|
+
process.exit(1);
|
|
25
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/mcp/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAKjE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,QAyGjD"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerMcpTools = registerMcpTools;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const tasks_1 = require("../services/tasks");
|
|
6
|
+
const config_1 = require("../lib/config");
|
|
7
|
+
function registerMcpTools(server) {
|
|
8
|
+
server.registerTool("get_project_info", {
|
|
9
|
+
title: "Get Project Info",
|
|
10
|
+
description: "Gets information about the current task-o-matic project, including AI configuration.",
|
|
11
|
+
inputSchema: {},
|
|
12
|
+
}, async () => {
|
|
13
|
+
try {
|
|
14
|
+
const config = config_1.configManager.getConfig();
|
|
15
|
+
const projectPath = config_1.configManager.getWorkingDirectory();
|
|
16
|
+
const info = {
|
|
17
|
+
projectPath,
|
|
18
|
+
aiConfig: config.ai,
|
|
19
|
+
};
|
|
20
|
+
return {
|
|
21
|
+
content: [
|
|
22
|
+
{
|
|
23
|
+
type: "text",
|
|
24
|
+
text: JSON.stringify(info, null, 2),
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
const error = err;
|
|
31
|
+
return {
|
|
32
|
+
content: [{ type: "text", text: `Error: ${error.message}` }],
|
|
33
|
+
isError: true,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
server.registerTool("list_tasks", {
|
|
38
|
+
title: "List Tasks",
|
|
39
|
+
description: "List all tasks for the current project. Can filter by status.",
|
|
40
|
+
inputSchema: {
|
|
41
|
+
filterByStatus: zod_1.z.enum(["todo", "in-progress", "completed"]).optional(),
|
|
42
|
+
},
|
|
43
|
+
}, async (input) => {
|
|
44
|
+
try {
|
|
45
|
+
const tasks = await tasks_1.taskService.listTasks({
|
|
46
|
+
status: input.filterByStatus
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
content: [
|
|
50
|
+
{
|
|
51
|
+
type: "text",
|
|
52
|
+
text: JSON.stringify(tasks, null, 2),
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
const error = err;
|
|
59
|
+
return {
|
|
60
|
+
content: [{ type: "text", text: `Error: ${error.message}` }],
|
|
61
|
+
isError: true,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
server.registerTool("create_task", {
|
|
66
|
+
title: "Create Task",
|
|
67
|
+
description: "Creates a new task.",
|
|
68
|
+
inputSchema: {
|
|
69
|
+
taskTitle: zod_1.z.string(),
|
|
70
|
+
taskContent: zod_1.z.string().optional(),
|
|
71
|
+
effort: zod_1.z.enum(["small", "medium", "large"]).optional(),
|
|
72
|
+
aiEnhance: zod_1.z.boolean().optional(),
|
|
73
|
+
},
|
|
74
|
+
}, async (input) => {
|
|
75
|
+
try {
|
|
76
|
+
const result = await tasks_1.taskService.createTask({
|
|
77
|
+
title: input.taskTitle,
|
|
78
|
+
content: input.taskContent,
|
|
79
|
+
effort: input.effort,
|
|
80
|
+
aiEnhance: input.aiEnhance,
|
|
81
|
+
});
|
|
82
|
+
return {
|
|
83
|
+
content: [
|
|
84
|
+
{
|
|
85
|
+
type: "text",
|
|
86
|
+
text: `Task created successfully with ID: ${result.task.id}`,
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
catch (err) {
|
|
92
|
+
const error = err;
|
|
93
|
+
return {
|
|
94
|
+
content: [{ type: "text", text: `Error: ${error.message}` }],
|
|
95
|
+
isError: true,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const DOCUMENTATION_DETECTION_PROMPT = "You are an expert developer. Your job is to analyze a task and fetch relevant documentation using Context7 and create a dedicated documentation for the task.\n\nDo not create a plan, i want a documentation for the actual task using the knowledge you gained from the research.\n\n## Task:\n**Title**: {TASK_TITLE}\n**Description**: {TASK_DESCRIPTION}\n\n## Current Stack:\n{STACK_INFO}\n\n## Already Researched:\n{EXISTING_RESEARCH}\n\n## Instructions:\n1. Identify technologies/libraries mentioned in the task that need documentation\n2. Skip anything already covered in existing research\n3. Use Context7 to resolve library names and fetch documentation\n4. Create a focused documentation only on what's actually needed for this specific task\n\nGet the documentation libraries needed for this task.";
|
|
2
|
+
//# sourceMappingURL=documentation-detection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentation-detection.d.ts","sourceRoot":"","sources":["../../src/prompts/documentation-detection.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,qyBAoBW,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DOCUMENTATION_DETECTION_PROMPT = void 0;
|
|
4
|
+
exports.DOCUMENTATION_DETECTION_PROMPT = `You are an expert developer. Your job is to analyze a task and fetch relevant documentation using Context7 and create a dedicated documentation for the task.
|
|
5
|
+
|
|
6
|
+
Do not create a plan, i want a documentation for the actual task using the knowledge you gained from the research.
|
|
7
|
+
|
|
8
|
+
## Task:
|
|
9
|
+
**Title**: {TASK_TITLE}
|
|
10
|
+
**Description**: {TASK_DESCRIPTION}
|
|
11
|
+
|
|
12
|
+
## Current Stack:
|
|
13
|
+
{STACK_INFO}
|
|
14
|
+
|
|
15
|
+
## Already Researched:
|
|
16
|
+
{EXISTING_RESEARCH}
|
|
17
|
+
|
|
18
|
+
## Instructions:
|
|
19
|
+
1. Identify technologies/libraries mentioned in the task that need documentation
|
|
20
|
+
2. Skip anything already covered in existing research
|
|
21
|
+
3. Use Context7 to resolve library names and fetch documentation
|
|
22
|
+
4. Create a focused documentation only on what's actually needed for this specific task
|
|
23
|
+
|
|
24
|
+
Get the documentation libraries needed for this task.`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./prd-parsing"), exports);
|
|
18
|
+
__exportStar(require("./task-breakdown"), exports);
|
|
19
|
+
__exportStar(require("./task-enhancement"), exports);
|
|
20
|
+
__exportStar(require("./prd-rework"), exports);
|
|
21
|
+
__exportStar(require("./documentation-detection"), exports);
|
|
22
|
+
__exportStar(require("./task-planning"), exports);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const PRD_PARSING_PROMPT = "\nYou are an AI assistant specialized in analyzing Product Requirements Documents (PRDs) and generating a structured, logically ordered, dependency-aware and sequenced list of development phases in JSON format.\n\n## \uD83C\uDFD7\uFE0F IMPORTANT: PROJECT INFRASTRUCTURE IS READY\nThis project is **already bootstrapped and configured**. The foundation is complete and ready for development. **DO NOT** create tasks for setting up the basic infrastructure.\n\nAnalyze the provided PRD content and generate an appropriate number of top-level development phases. Each phase should represent 1-3 weeks of focused development work and focus on the most direct and effective way to implement the requirements without unnecessary complexity or overengineering.\n\nIf the complexity or the level of detail of the PRD is high, generate more phases relative to the complexity of the PRD. Let the PRD content determine the appropriate number of phases - there is no fixed target.\n\n## CRITICAL: Task ID and Dependency Format\nYou MUST generate unique task IDs and reference them properly in dependencies:\n\n1. **Task ID Generation**: \n - Each task must have an \"id\" field with simple numeric format: \"1\", \"2\", \"3\", etc.\n - IDs must be sequential starting from \"1\"\n - Each task ID must be unique\n - NO prefixes like \"task-\" - use simple numbers only\n\n2. **Dependency References**:\n - Dependencies MUST reference the exact task IDs (not titles)\n - Use format: [\"1\", \"2\", \"3\"]\n - NEVER use task titles in dependencies\n - Only reference tasks that appear EARLIER in the list\n - Ensure all dependency references are valid\n\n## \uD83D\uDCCB Phase Sizing (1-3 WEEKS per phase):\n- **Small**: 1 week (5-7 days) - Focused module with clear boundaries\n- **Medium**: 2 weeks (8-12 days) - Complex feature with multiple components \n- **Large**: 3 weeks (13-15 days) - Major system with integrations and polish\n\n## \uD83C\uDFAF PHASE EXAMPLES (1-3 WEEKS EACH):\n\u2705 \"User Authentication & Profile Management\" - Complete user system with registration, login, profiles, and security\n\u2705 \"Interactive Map & Location Services\" - Full mapping functionality with search, geolocation, and place markers\n\u2705 \"Rating & Review System\" - Complete rating workflow with reviews, scores, and moderation\n\u2705 \"Content Management System\" - Full CRUD system for managing content with validation and permissions\n\n## \u274C FORBIDDEN MICRO-TASKS (THESE ARE IMPLEMENTATION DETAILS, NOT PHASES):\n- \"Implement API endpoint\" (this is a planning step)\n- \"Build UI component\" (this is a planning step) \n- \"Create database schema\" (this is a planning step)\n- \"Setup authentication\" (this is part of a larger phase)\n\n## \u2705 Guidelines:\n1. Create an appropriate number of phases based on PRD complexity\n2. Each phase should be atomic and focused on a major feature area\n3. Order phases logically - consider dependencies and implementation sequence\n4. Early phases should focus on foundation and core functionality first, then advanced features\n5. Include clear technical considerations for each phase\n6. Set appropriate dependency IDs (a phase can only depend on phases with lower IDs)\n7. Assign effort based on the scope and complexity of work involved\n8. Include detailed implementation guidance in the description\n9. If the PRD contains specific requirements for libraries, frameworks, or tech stacks, STRICTLY ADHERE to these requirements\n10. Focus on filling in any gaps left by the PRD while preserving all explicit requirements\n11. Always aim to provide the most direct path to implementation, avoiding over-engineering\n\n## \u2705 Dependency Validation Rules:\n- Task \"1\" must have no dependencies (it's the first task)\n- Task N can only depend on tasks 1 through (N-1)\n- No circular dependencies allowed\n- No forward references\n- Every task must have a unique sequential ID\n\nFormat your response as JSON:\n{\n \"tasks\": [\n {\n \"id\": \"1\",\n \"title\": \"User Authentication & Security System\",\n \"description\": \"Implement complete user authentication system including registration, login/logout, password reset, session management, security measures, and user profile functionality with proper validation and error handling\",\n \"effort\": \"medium\",\n \"dependencies\": [],\n \"technicalConsiderations\": \"Leverage existing Better-Auth integration and Convex backend for secure user management\"\n },\n {\n \"id\": \"2\", \n \"title\": \"Core Business Data Management\",\n \"description\": \"Set up database schemas, models, and business logic for the main application entities including data validation, relationships, and core CRUD operations\",\n \"effort\": \"medium\", \n \"dependencies\": [\"1\"],\n \"technicalConsiderations\": \"Design efficient Convex schemas with proper indexing and relationships\"\n }\n ]\n}\n\n## Technology Stack\n{STACK_INFO}\n\nPRD to parse:\n{PRD_CONTENT}\n";
|
|
2
|
+
export declare const PRD_PARSING_SYSTEM_PROMPT = "\nYou are an AI assistant specialized in analyzing Product Requirements Documents (PRDs) and generating a structured, logically ordered, dependency-aware and sequenced list of development phases in JSON format.\n\n## CRITICAL INSTRUCTION: Create Appropriate-Sized Phases\nYou MUST generate development phases that represent 1-3 weeks of focused work each. The number of phases should be determined by the PRD complexity, not by arbitrary targets.\n\n## CRITICAL INSTRUCTION: Task ID Generation and Dependencies\nYou MUST generate unique task IDs and use them for dependencies:\n\n1. **Generate Task IDs**: \n - Each task needs an \"id\" field: \"1\", \"2\", \"3\", etc.\n - IDs must be sequential and unique\n - Start with \"1\"\n - NO prefixes like \"task-\" - use simple numbers only\n\n2. **Dependency References**:\n - Use the exact task IDs in dependencies arrays\n - NEVER use task titles\n - Only reference earlier tasks (lower numbers)\n - Validate that all dependency references exist\n\n3. **Required Fields for Each Task**:\n - id: \"N\" format (required)\n - title: string (required)\n - description: string (required)\n - effort: \"small\"|\"medium\"|\"large\" (required - based on 1-3 week duration)\n - dependencies: array of task IDs (required)\n - technicalConsiderations: string (optional)\n\n## Phase Analysis Guidelines:\n1. **Scope Appropriately**: Each phase should represent 1-3 weeks of substantial development work\n2. **Business-Focused**: Phase titles should reflect business value and user-facing features\n3. **Logical Sequencing**: Order phases based on dependencies and implementation priorities\n4. **Complexity-Based**: More complex PRDs should result in more phases, simpler PRDs in fewer phases\n5. **Direct Implementation**: Focus on the most direct path to implementing requirements\n\n## FORBIDDEN MICRO-TASKS (DO NOT CREATE):\n- Individual API endpoints, UI components, database schemas\n- Technical implementation details that belong in planning\n- Tasks that take less than 1 week to complete\n\n## REQUIRED PHASE EXAMPLES (1-3 WEEKS EACH):\n- \"User Authentication & Profile Management\" \u2192 Complete user system\n- \"Interactive Map & Location Services\" \u2192 Full mapping functionality\n- \"Rating & Review System\" \u2192 Complete rating workflow\n- \"Content Management System\" \u2192 Full CRUD for content\n\n## Dependency Validation Rules:\n- Task \"1\" MUST have empty dependencies array: []\n- Task N can only reference tasks 1 through (N-1)\n- No circular dependencies\n- No forward references\n- All dependency references must be valid task IDs\n- Every task must have a unique sequential ID\n- Verify all referenced IDs exist in the tasks array\n\n## Quality Standards:\n- Each phase should be atomic and focused on a major feature area\n- Include detailed implementation guidance in descriptions\n- Consider the existing technology stack and infrastructure\n- Ensure phases build upon each other logically\n- Focus on business value and user-facing outcomes\n\n## Output Validation:\nBefore returning your response, verify:\n1. Every task represents 1-3 weeks of substantial work\n2. Tasks are major phases, not implementation details\n3. Every task has a unique sequential ID (\"1\", \"2\", \"3\", etc.)\n4. All dependency arrays contain valid task IDs (not titles)\n5. No task depends on itself or a later task\n6. Task \"1\" has no dependencies\n7. All referenced task IDs exist in the tasks array\n8. JSON structure is valid and parseable\n9. All required fields are present for each task\n10. The number of tasks is appropriate for the PRD complexity\n\nReturn only valid JSON that can be parsed. Ensure all required fields are present and properly formatted.\n";
|
|
3
|
+
//# sourceMappingURL=prd-parsing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prd-parsing.d.ts","sourceRoot":"","sources":["../../src/prompts/prd-parsing.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,i8JA0F9B,CAAC;AAEF,eAAO,MAAM,yBAAyB,+qHA6ErC,CAAC"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PRD_PARSING_SYSTEM_PROMPT = exports.PRD_PARSING_PROMPT = void 0;
|
|
4
|
+
exports.PRD_PARSING_PROMPT = `
|
|
5
|
+
You are an AI assistant specialized in analyzing Product Requirements Documents (PRDs) and generating a structured, logically ordered, dependency-aware and sequenced list of development phases in JSON format.
|
|
6
|
+
|
|
7
|
+
## 🏗️ IMPORTANT: PROJECT INFRASTRUCTURE IS READY
|
|
8
|
+
This project is **already bootstrapped and configured**. The foundation is complete and ready for development. **DO NOT** create tasks for setting up the basic infrastructure.
|
|
9
|
+
|
|
10
|
+
Analyze the provided PRD content and generate an appropriate number of top-level development phases. Each phase should represent 1-3 weeks of focused development work and focus on the most direct and effective way to implement the requirements without unnecessary complexity or overengineering.
|
|
11
|
+
|
|
12
|
+
If the complexity or the level of detail of the PRD is high, generate more phases relative to the complexity of the PRD. Let the PRD content determine the appropriate number of phases - there is no fixed target.
|
|
13
|
+
|
|
14
|
+
## CRITICAL: Task ID and Dependency Format
|
|
15
|
+
You MUST generate unique task IDs and reference them properly in dependencies:
|
|
16
|
+
|
|
17
|
+
1. **Task ID Generation**:
|
|
18
|
+
- Each task must have an "id" field with simple numeric format: "1", "2", "3", etc.
|
|
19
|
+
- IDs must be sequential starting from "1"
|
|
20
|
+
- Each task ID must be unique
|
|
21
|
+
- NO prefixes like "task-" - use simple numbers only
|
|
22
|
+
|
|
23
|
+
2. **Dependency References**:
|
|
24
|
+
- Dependencies MUST reference the exact task IDs (not titles)
|
|
25
|
+
- Use format: ["1", "2", "3"]
|
|
26
|
+
- NEVER use task titles in dependencies
|
|
27
|
+
- Only reference tasks that appear EARLIER in the list
|
|
28
|
+
- Ensure all dependency references are valid
|
|
29
|
+
|
|
30
|
+
## 📋 Phase Sizing (1-3 WEEKS per phase):
|
|
31
|
+
- **Small**: 1 week (5-7 days) - Focused module with clear boundaries
|
|
32
|
+
- **Medium**: 2 weeks (8-12 days) - Complex feature with multiple components
|
|
33
|
+
- **Large**: 3 weeks (13-15 days) - Major system with integrations and polish
|
|
34
|
+
|
|
35
|
+
## 🎯 PHASE EXAMPLES (1-3 WEEKS EACH):
|
|
36
|
+
✅ "User Authentication & Profile Management" - Complete user system with registration, login, profiles, and security
|
|
37
|
+
✅ "Interactive Map & Location Services" - Full mapping functionality with search, geolocation, and place markers
|
|
38
|
+
✅ "Rating & Review System" - Complete rating workflow with reviews, scores, and moderation
|
|
39
|
+
✅ "Content Management System" - Full CRUD system for managing content with validation and permissions
|
|
40
|
+
|
|
41
|
+
## ❌ FORBIDDEN MICRO-TASKS (THESE ARE IMPLEMENTATION DETAILS, NOT PHASES):
|
|
42
|
+
- "Implement API endpoint" (this is a planning step)
|
|
43
|
+
- "Build UI component" (this is a planning step)
|
|
44
|
+
- "Create database schema" (this is a planning step)
|
|
45
|
+
- "Setup authentication" (this is part of a larger phase)
|
|
46
|
+
|
|
47
|
+
## ✅ Guidelines:
|
|
48
|
+
1. Create an appropriate number of phases based on PRD complexity
|
|
49
|
+
2. Each phase should be atomic and focused on a major feature area
|
|
50
|
+
3. Order phases logically - consider dependencies and implementation sequence
|
|
51
|
+
4. Early phases should focus on foundation and core functionality first, then advanced features
|
|
52
|
+
5. Include clear technical considerations for each phase
|
|
53
|
+
6. Set appropriate dependency IDs (a phase can only depend on phases with lower IDs)
|
|
54
|
+
7. Assign effort based on the scope and complexity of work involved
|
|
55
|
+
8. Include detailed implementation guidance in the description
|
|
56
|
+
9. If the PRD contains specific requirements for libraries, frameworks, or tech stacks, STRICTLY ADHERE to these requirements
|
|
57
|
+
10. Focus on filling in any gaps left by the PRD while preserving all explicit requirements
|
|
58
|
+
11. Always aim to provide the most direct path to implementation, avoiding over-engineering
|
|
59
|
+
|
|
60
|
+
## ✅ Dependency Validation Rules:
|
|
61
|
+
- Task "1" must have no dependencies (it's the first task)
|
|
62
|
+
- Task N can only depend on tasks 1 through (N-1)
|
|
63
|
+
- No circular dependencies allowed
|
|
64
|
+
- No forward references
|
|
65
|
+
- Every task must have a unique sequential ID
|
|
66
|
+
|
|
67
|
+
Format your response as JSON:
|
|
68
|
+
{
|
|
69
|
+
"tasks": [
|
|
70
|
+
{
|
|
71
|
+
"id": "1",
|
|
72
|
+
"title": "User Authentication & Security System",
|
|
73
|
+
"description": "Implement complete user authentication system including registration, login/logout, password reset, session management, security measures, and user profile functionality with proper validation and error handling",
|
|
74
|
+
"effort": "medium",
|
|
75
|
+
"dependencies": [],
|
|
76
|
+
"technicalConsiderations": "Leverage existing Better-Auth integration and Convex backend for secure user management"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"id": "2",
|
|
80
|
+
"title": "Core Business Data Management",
|
|
81
|
+
"description": "Set up database schemas, models, and business logic for the main application entities including data validation, relationships, and core CRUD operations",
|
|
82
|
+
"effort": "medium",
|
|
83
|
+
"dependencies": ["1"],
|
|
84
|
+
"technicalConsiderations": "Design efficient Convex schemas with proper indexing and relationships"
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
## Technology Stack
|
|
90
|
+
{STACK_INFO}
|
|
91
|
+
|
|
92
|
+
PRD to parse:
|
|
93
|
+
{PRD_CONTENT}
|
|
94
|
+
`;
|
|
95
|
+
exports.PRD_PARSING_SYSTEM_PROMPT = `
|
|
96
|
+
You are an AI assistant specialized in analyzing Product Requirements Documents (PRDs) and generating a structured, logically ordered, dependency-aware and sequenced list of development phases in JSON format.
|
|
97
|
+
|
|
98
|
+
## CRITICAL INSTRUCTION: Create Appropriate-Sized Phases
|
|
99
|
+
You MUST generate development phases that represent 1-3 weeks of focused work each. The number of phases should be determined by the PRD complexity, not by arbitrary targets.
|
|
100
|
+
|
|
101
|
+
## CRITICAL INSTRUCTION: Task ID Generation and Dependencies
|
|
102
|
+
You MUST generate unique task IDs and use them for dependencies:
|
|
103
|
+
|
|
104
|
+
1. **Generate Task IDs**:
|
|
105
|
+
- Each task needs an "id" field: "1", "2", "3", etc.
|
|
106
|
+
- IDs must be sequential and unique
|
|
107
|
+
- Start with "1"
|
|
108
|
+
- NO prefixes like "task-" - use simple numbers only
|
|
109
|
+
|
|
110
|
+
2. **Dependency References**:
|
|
111
|
+
- Use the exact task IDs in dependencies arrays
|
|
112
|
+
- NEVER use task titles
|
|
113
|
+
- Only reference earlier tasks (lower numbers)
|
|
114
|
+
- Validate that all dependency references exist
|
|
115
|
+
|
|
116
|
+
3. **Required Fields for Each Task**:
|
|
117
|
+
- id: "N" format (required)
|
|
118
|
+
- title: string (required)
|
|
119
|
+
- description: string (required)
|
|
120
|
+
- effort: "small"|"medium"|"large" (required - based on 1-3 week duration)
|
|
121
|
+
- dependencies: array of task IDs (required)
|
|
122
|
+
- technicalConsiderations: string (optional)
|
|
123
|
+
|
|
124
|
+
## Phase Analysis Guidelines:
|
|
125
|
+
1. **Scope Appropriately**: Each phase should represent 1-3 weeks of substantial development work
|
|
126
|
+
2. **Business-Focused**: Phase titles should reflect business value and user-facing features
|
|
127
|
+
3. **Logical Sequencing**: Order phases based on dependencies and implementation priorities
|
|
128
|
+
4. **Complexity-Based**: More complex PRDs should result in more phases, simpler PRDs in fewer phases
|
|
129
|
+
5. **Direct Implementation**: Focus on the most direct path to implementing requirements
|
|
130
|
+
|
|
131
|
+
## FORBIDDEN MICRO-TASKS (DO NOT CREATE):
|
|
132
|
+
- Individual API endpoints, UI components, database schemas
|
|
133
|
+
- Technical implementation details that belong in planning
|
|
134
|
+
- Tasks that take less than 1 week to complete
|
|
135
|
+
|
|
136
|
+
## REQUIRED PHASE EXAMPLES (1-3 WEEKS EACH):
|
|
137
|
+
- "User Authentication & Profile Management" → Complete user system
|
|
138
|
+
- "Interactive Map & Location Services" → Full mapping functionality
|
|
139
|
+
- "Rating & Review System" → Complete rating workflow
|
|
140
|
+
- "Content Management System" → Full CRUD for content
|
|
141
|
+
|
|
142
|
+
## Dependency Validation Rules:
|
|
143
|
+
- Task "1" MUST have empty dependencies array: []
|
|
144
|
+
- Task N can only reference tasks 1 through (N-1)
|
|
145
|
+
- No circular dependencies
|
|
146
|
+
- No forward references
|
|
147
|
+
- All dependency references must be valid task IDs
|
|
148
|
+
- Every task must have a unique sequential ID
|
|
149
|
+
- Verify all referenced IDs exist in the tasks array
|
|
150
|
+
|
|
151
|
+
## Quality Standards:
|
|
152
|
+
- Each phase should be atomic and focused on a major feature area
|
|
153
|
+
- Include detailed implementation guidance in descriptions
|
|
154
|
+
- Consider the existing technology stack and infrastructure
|
|
155
|
+
- Ensure phases build upon each other logically
|
|
156
|
+
- Focus on business value and user-facing outcomes
|
|
157
|
+
|
|
158
|
+
## Output Validation:
|
|
159
|
+
Before returning your response, verify:
|
|
160
|
+
1. Every task represents 1-3 weeks of substantial work
|
|
161
|
+
2. Tasks are major phases, not implementation details
|
|
162
|
+
3. Every task has a unique sequential ID ("1", "2", "3", etc.)
|
|
163
|
+
4. All dependency arrays contain valid task IDs (not titles)
|
|
164
|
+
5. No task depends on itself or a later task
|
|
165
|
+
6. Task "1" has no dependencies
|
|
166
|
+
7. All referenced task IDs exist in the tasks array
|
|
167
|
+
8. JSON structure is valid and parseable
|
|
168
|
+
9. All required fields are present for each task
|
|
169
|
+
10. The number of tasks is appropriate for the PRD complexity
|
|
170
|
+
|
|
171
|
+
Return only valid JSON that can be parsed. Ensure all required fields are present and properly formatted.
|
|
172
|
+
`;
|