roadmap-skill 0.2.0 → 0.2.4

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/dist/index.js CHANGED
@@ -276,6 +276,9 @@ var ProjectStorage = class {
276
276
  if (filters.searchText && !task.title.toLowerCase().includes(filters.searchText.toLowerCase()) && !task.description.toLowerCase().includes(filters.searchText.toLowerCase())) {
277
277
  continue;
278
278
  }
279
+ if (filters.includeCompleted === false && task.status === "done") {
280
+ continue;
281
+ }
279
282
  results.push({ task, project: data.project });
280
283
  }
281
284
  } catch {
@@ -284,6 +287,58 @@ var ProjectStorage = class {
284
287
  }
285
288
  return results;
286
289
  }
290
+ async exportAllData() {
291
+ await this.ensureDirectory();
292
+ const fs3 = await import("fs/promises");
293
+ const files = await fs3.readdir(this.storageDir);
294
+ const jsonFiles = files.filter((f) => f.endsWith(".json"));
295
+ const projects = [];
296
+ for (const file of jsonFiles) {
297
+ try {
298
+ const filePath = path3.join(this.storageDir, file);
299
+ const data = await readJsonFile(filePath);
300
+ projects.push(data);
301
+ } catch {
302
+ continue;
303
+ }
304
+ }
305
+ return {
306
+ version: 1,
307
+ exportedAt: (/* @__PURE__ */ new Date()).toISOString(),
308
+ projects
309
+ };
310
+ }
311
+ async importAllData(data) {
312
+ await this.ensureDirectory();
313
+ let imported = 0;
314
+ let errors = 0;
315
+ const errorDetails = [];
316
+ if (!data.projects || !Array.isArray(data.projects)) {
317
+ throw new Error("Invalid backup data: projects array is required");
318
+ }
319
+ for (const projectData of data.projects) {
320
+ try {
321
+ if (!projectData.project || !projectData.project.id) {
322
+ errors++;
323
+ errorDetails.push("Skipping invalid project: missing project or id");
324
+ continue;
325
+ }
326
+ const filePath = this.getFilePath(projectData.project.id);
327
+ await writeJsonFile(filePath, projectData);
328
+ imported++;
329
+ } catch (error) {
330
+ errors++;
331
+ const errorMessage = error instanceof Error ? error.message : String(error);
332
+ errorDetails.push(`Failed to import project ${projectData.project?.id || "unknown"}: ${errorMessage}`);
333
+ }
334
+ }
335
+ return {
336
+ success: errors === 0,
337
+ imported,
338
+ errors,
339
+ errorDetails
340
+ };
341
+ }
287
342
  };
288
343
  var storage = new ProjectStorage();
289
344
 
@@ -508,7 +563,8 @@ var listTasksTool = {
508
563
  tags: z2.array(z2.string()).optional(),
509
564
  assignee: z2.string().optional(),
510
565
  dueBefore: z2.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),
511
- dueAfter: z2.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional()
566
+ dueAfter: z2.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),
567
+ includeCompleted: z2.boolean().optional()
512
568
  }),
513
569
  async execute(input) {
514
570
  try {
@@ -519,7 +575,8 @@ var listTasksTool = {
519
575
  tags: input.tags,
520
576
  assignee: input.assignee,
521
577
  dueBefore: input.dueBefore,
522
- dueAfter: input.dueAfter
578
+ dueAfter: input.dueAfter,
579
+ includeCompleted: input.includeCompleted
523
580
  });
524
581
  return {
525
582
  success: true,
@@ -1020,170 +1077,227 @@ init_esm_shims();
1020
1077
  import express from "express";
1021
1078
  import * as path4 from "path";
1022
1079
  function createServer(port = 7860) {
1023
- const app = express();
1024
- app.use(express.json());
1025
- app.get("/api/projects", async (_req, res) => {
1026
- try {
1027
- const projects = await storage.listProjects();
1028
- res.json(projects);
1029
- } catch (error) {
1030
- res.status(500).json({ error: error.message });
1031
- }
1032
- });
1033
- app.get("/api/projects/:id", async (req, res) => {
1034
- try {
1035
- const project = await storage.readProject(req.params.id);
1036
- if (!project) {
1037
- res.status(404).json({ error: "Project not found" });
1038
- return;
1080
+ return new Promise((resolve, reject) => {
1081
+ const app = express();
1082
+ app.use(express.json());
1083
+ app.get("/api/projects", async (_req, res) => {
1084
+ try {
1085
+ const projects = await storage.listProjects();
1086
+ res.json(projects);
1087
+ } catch (error) {
1088
+ res.status(500).json({ error: error.message });
1039
1089
  }
1040
- res.json(project);
1041
- } catch (error) {
1042
- res.status(500).json({ error: error.message });
1043
- }
1044
- });
1045
- app.get("/api/tasks", async (req, res) => {
1046
- try {
1047
- const filters = req.query;
1048
- const tasks = await storage.searchTasks(filters);
1049
- res.json(tasks);
1050
- } catch (error) {
1051
- res.status(500).json({ error: error.message });
1052
- }
1053
- });
1054
- app.post("/api/projects", async (req, res) => {
1055
- try {
1056
- const project = await storage.createProject(req.body);
1057
- res.json({ success: true, data: project });
1058
- } catch (error) {
1059
- res.status(500).json({ error: error.message });
1060
- }
1061
- });
1062
- app.put("/api/projects", async (req, res) => {
1063
- try {
1064
- const { projectId, ...updateData } = req.body;
1065
- const project = await storage.updateProject(projectId, updateData);
1066
- res.json({ success: true, data: project });
1067
- } catch (error) {
1068
- res.status(500).json({ error: error.message });
1069
- }
1070
- });
1071
- app.delete("/api/projects", async (req, res) => {
1072
- try {
1073
- const { projectId } = req.query;
1074
- await storage.deleteProject(projectId);
1075
- res.json({ success: true });
1076
- } catch (error) {
1077
- res.status(500).json({ error: error.message });
1078
- }
1079
- });
1080
- app.post("/api/tasks", async (req, res) => {
1081
- try {
1082
- const { projectId, ...taskData } = req.body;
1083
- const projectData = await storage.readProject(projectId);
1084
- if (!projectData) {
1085
- res.status(404).json({ error: "Project not found" });
1086
- return;
1090
+ });
1091
+ app.get("/api/projects/:id", async (req, res) => {
1092
+ try {
1093
+ const project = await storage.readProject(req.params.id);
1094
+ if (!project) {
1095
+ res.status(404).json({ error: "Project not found" });
1096
+ return;
1097
+ }
1098
+ res.json(project);
1099
+ } catch (error) {
1100
+ res.status(500).json({ error: error.message });
1087
1101
  }
1088
- const now = (/* @__PURE__ */ new Date()).toISOString();
1089
- const task = {
1090
- id: `task_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`,
1091
- projectId,
1092
- ...taskData,
1093
- status: taskData.status || "todo",
1094
- priority: taskData.priority || "medium",
1095
- tags: taskData.tags || [],
1096
- dueDate: taskData.dueDate || null,
1097
- assignee: taskData.assignee || null,
1098
- createdAt: now,
1099
- updatedAt: now,
1100
- completedAt: null
1101
- };
1102
- projectData.tasks.push(task);
1103
- projectData.project.updatedAt = now;
1104
- const filePath = storage.getFilePath(projectId);
1105
- const { writeJsonFile: writeJsonFile2 } = await Promise.resolve().then(() => (init_file_helpers(), file_helpers_exports));
1106
- await writeJsonFile2(filePath, projectData);
1107
- res.json({ success: true, data: task });
1108
- } catch (error) {
1109
- res.status(500).json({ error: error.message });
1110
- }
1111
- });
1112
- app.put("/api/tasks", async (req, res) => {
1113
- try {
1114
- const { projectId, taskId, ...updateData } = req.body;
1115
- const projectData = await storage.readProject(projectId);
1116
- if (!projectData) {
1117
- res.status(404).json({ error: "Project not found" });
1118
- return;
1102
+ });
1103
+ app.get("/api/tasks", async (req, res) => {
1104
+ try {
1105
+ const filters = { ...req.query };
1106
+ if (filters.includeCompleted !== void 0) {
1107
+ filters.includeCompleted = filters.includeCompleted === "true";
1108
+ }
1109
+ const tasks = await storage.searchTasks(filters);
1110
+ res.json(tasks);
1111
+ } catch (error) {
1112
+ res.status(500).json({ error: error.message });
1119
1113
  }
1120
- const taskIndex = projectData.tasks.findIndex((t) => t.id === taskId);
1121
- if (taskIndex === -1) {
1122
- res.status(404).json({ error: "Task not found" });
1123
- return;
1114
+ });
1115
+ app.post("/api/projects", async (req, res) => {
1116
+ try {
1117
+ const project = await storage.createProject(req.body);
1118
+ res.json({ success: true, data: project });
1119
+ } catch (error) {
1120
+ res.status(500).json({ error: error.message });
1124
1121
  }
1125
- const now = (/* @__PURE__ */ new Date()).toISOString();
1126
- const existingTask = projectData.tasks[taskIndex];
1127
- const updatedTask = {
1128
- ...existingTask,
1129
- ...updateData,
1130
- id: existingTask.id,
1131
- projectId: existingTask.projectId,
1132
- createdAt: existingTask.createdAt,
1133
- updatedAt: now,
1134
- completedAt: updateData.status === "done" && existingTask.status !== "done" ? now : updateData.status && updateData.status !== "done" ? null : existingTask.completedAt
1135
- };
1136
- projectData.tasks[taskIndex] = updatedTask;
1137
- projectData.project.updatedAt = now;
1138
- const filePath = storage.getFilePath(projectId);
1139
- const { writeJsonFile: writeJsonFile2 } = await Promise.resolve().then(() => (init_file_helpers(), file_helpers_exports));
1140
- await writeJsonFile2(filePath, projectData);
1141
- res.json({ success: true, data: updatedTask });
1142
- } catch (error) {
1143
- res.status(500).json({ error: error.message });
1144
- }
1145
- });
1146
- app.delete("/api/tasks", async (req, res) => {
1147
- try {
1148
- const { projectId, taskId } = req.query;
1149
- const projectData = await storage.readProject(projectId);
1150
- if (!projectData) {
1151
- res.status(404).json({ error: "Project not found" });
1122
+ });
1123
+ app.put("/api/projects", async (req, res) => {
1124
+ try {
1125
+ const { projectId, ...updateData } = req.body;
1126
+ const project = await storage.updateProject(projectId, updateData);
1127
+ res.json({ success: true, data: project });
1128
+ } catch (error) {
1129
+ res.status(500).json({ error: error.message });
1130
+ }
1131
+ });
1132
+ app.delete("/api/projects", async (req, res) => {
1133
+ try {
1134
+ const { projectId } = req.query;
1135
+ await storage.deleteProject(projectId);
1136
+ res.json({ success: true });
1137
+ } catch (error) {
1138
+ res.status(500).json({ error: error.message });
1139
+ }
1140
+ });
1141
+ app.post("/api/tasks", async (req, res) => {
1142
+ try {
1143
+ const { projectId, ...taskData } = req.body;
1144
+ const projectData = await storage.readProject(projectId);
1145
+ if (!projectData) {
1146
+ res.status(404).json({ error: "Project not found" });
1147
+ return;
1148
+ }
1149
+ const now = (/* @__PURE__ */ new Date()).toISOString();
1150
+ const task = {
1151
+ id: `task_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`,
1152
+ projectId,
1153
+ ...taskData,
1154
+ status: taskData.status || "todo",
1155
+ priority: taskData.priority || "medium",
1156
+ tags: taskData.tags || [],
1157
+ dueDate: taskData.dueDate || null,
1158
+ assignee: taskData.assignee || null,
1159
+ createdAt: now,
1160
+ updatedAt: now,
1161
+ completedAt: null
1162
+ };
1163
+ projectData.tasks.push(task);
1164
+ projectData.project.updatedAt = now;
1165
+ const filePath = storage.getFilePath(projectId);
1166
+ const { writeJsonFile: writeJsonFile2 } = await Promise.resolve().then(() => (init_file_helpers(), file_helpers_exports));
1167
+ await writeJsonFile2(filePath, projectData);
1168
+ res.json({ success: true, data: task });
1169
+ } catch (error) {
1170
+ res.status(500).json({ error: error.message });
1171
+ }
1172
+ });
1173
+ app.put("/api/tasks", async (req, res) => {
1174
+ try {
1175
+ const { projectId, taskId, ...updateData } = req.body;
1176
+ const projectData = await storage.readProject(projectId);
1177
+ if (!projectData) {
1178
+ res.status(404).json({ error: "Project not found" });
1179
+ return;
1180
+ }
1181
+ const taskIndex = projectData.tasks.findIndex((t) => t.id === taskId);
1182
+ if (taskIndex === -1) {
1183
+ res.status(404).json({ error: "Task not found" });
1184
+ return;
1185
+ }
1186
+ const now = (/* @__PURE__ */ new Date()).toISOString();
1187
+ const existingTask = projectData.tasks[taskIndex];
1188
+ const updatedTask = {
1189
+ ...existingTask,
1190
+ ...updateData,
1191
+ id: existingTask.id,
1192
+ projectId: existingTask.projectId,
1193
+ createdAt: existingTask.createdAt,
1194
+ updatedAt: now,
1195
+ completedAt: updateData.status === "done" && existingTask.status !== "done" ? now : updateData.status && updateData.status !== "done" ? null : existingTask.completedAt
1196
+ };
1197
+ projectData.tasks[taskIndex] = updatedTask;
1198
+ projectData.project.updatedAt = now;
1199
+ const filePath = storage.getFilePath(projectId);
1200
+ const { writeJsonFile: writeJsonFile2 } = await Promise.resolve().then(() => (init_file_helpers(), file_helpers_exports));
1201
+ await writeJsonFile2(filePath, projectData);
1202
+ res.json({ success: true, data: updatedTask });
1203
+ } catch (error) {
1204
+ res.status(500).json({ error: error.message });
1205
+ }
1206
+ });
1207
+ app.delete("/api/tasks", async (req, res) => {
1208
+ try {
1209
+ const { projectId, taskId } = req.query;
1210
+ const projectData = await storage.readProject(projectId);
1211
+ if (!projectData) {
1212
+ res.status(404).json({ error: "Project not found" });
1213
+ return;
1214
+ }
1215
+ const taskIndex = projectData.tasks.findIndex((t) => t.id === taskId);
1216
+ if (taskIndex === -1) {
1217
+ res.status(404).json({ error: "Task not found" });
1218
+ return;
1219
+ }
1220
+ projectData.tasks.splice(taskIndex, 1);
1221
+ projectData.project.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
1222
+ const filePath = storage.getFilePath(projectId);
1223
+ const { writeJsonFile: writeJsonFile2 } = await Promise.resolve().then(() => (init_file_helpers(), file_helpers_exports));
1224
+ await writeJsonFile2(filePath, projectData);
1225
+ res.json({ success: true });
1226
+ } catch (error) {
1227
+ res.status(500).json({ error: error.message });
1228
+ }
1229
+ });
1230
+ app.get("/api/backup", async (_req, res) => {
1231
+ try {
1232
+ const backup = await storage.exportAllData();
1233
+ const filename = `roadmap-skill-backup-${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.json`;
1234
+ res.setHeader("Content-Type", "application/json");
1235
+ res.setHeader("Content-Disposition", `attachment; filename="${filename}"`);
1236
+ res.json(backup);
1237
+ } catch (error) {
1238
+ res.status(500).json({ error: error.message });
1239
+ }
1240
+ });
1241
+ app.post("/api/backup", async (req, res) => {
1242
+ try {
1243
+ const result = await storage.importAllData(req.body);
1244
+ res.json(result);
1245
+ } catch (error) {
1246
+ res.status(400).json({
1247
+ success: false,
1248
+ error: error.message
1249
+ });
1250
+ }
1251
+ });
1252
+ const distPath = path4.join(process.cwd(), "dist", "web", "app");
1253
+ app.use(express.static(distPath));
1254
+ app.get("*", (req, res) => {
1255
+ if (req.path.startsWith("/api")) {
1256
+ res.status(404).json({ error: "API not found" });
1152
1257
  return;
1153
1258
  }
1154
- const taskIndex = projectData.tasks.findIndex((t) => t.id === taskId);
1155
- if (taskIndex === -1) {
1156
- res.status(404).json({ error: "Task not found" });
1259
+ res.sendFile(path4.join(distPath, "index.html"));
1260
+ });
1261
+ const server = app.listen(port, "127.0.0.1");
1262
+ server.once("listening", () => {
1263
+ console.log(`Web interface server running at http://localhost:${port}`);
1264
+ resolve(server);
1265
+ });
1266
+ server.once("error", (error) => {
1267
+ if (error.code === "EADDRINUSE") {
1268
+ reject(new Error(`Port ${port} is already in use`));
1157
1269
  return;
1158
1270
  }
1159
- projectData.tasks.splice(taskIndex, 1);
1160
- projectData.project.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
1161
- const filePath = storage.getFilePath(projectId);
1162
- const { writeJsonFile: writeJsonFile2 } = await Promise.resolve().then(() => (init_file_helpers(), file_helpers_exports));
1163
- await writeJsonFile2(filePath, projectData);
1164
- res.json({ success: true });
1165
- } catch (error) {
1166
- res.status(500).json({ error: error.message });
1167
- }
1168
- });
1169
- const distPath = path4.join(process.cwd(), "dist", "web", "app");
1170
- app.use(express.static(distPath));
1171
- app.get("*", (req, res) => {
1172
- if (req.path.startsWith("/api")) {
1173
- res.status(404).json({ error: "API not found" });
1174
- return;
1175
- }
1176
- res.sendFile(path4.join(distPath, "index.html"));
1177
- });
1178
- const server = app.listen(port, "0.0.0.0", () => {
1179
- console.log(`Web interface server running at http://0.0.0.0:${port}`);
1271
+ reject(error);
1272
+ });
1180
1273
  });
1181
- return server;
1182
1274
  }
1183
1275
 
1184
1276
  // src/tools/web-tools.ts
1185
1277
  import open from "open";
1186
1278
  var activeServer = null;
1279
+ var activePort = null;
1280
+ function getServerPort(server) {
1281
+ const address = server.address();
1282
+ if (address && typeof address === "object" && "port" in address) {
1283
+ return typeof address.port === "number" ? address.port : null;
1284
+ }
1285
+ return null;
1286
+ }
1287
+ async function closeServer(server) {
1288
+ await new Promise((resolve, reject) => {
1289
+ server.close((error) => {
1290
+ if (error) {
1291
+ reject(error);
1292
+ return;
1293
+ }
1294
+ resolve();
1295
+ });
1296
+ const forceCloseServer = server;
1297
+ forceCloseServer.closeIdleConnections?.();
1298
+ forceCloseServer.closeAllConnections?.();
1299
+ });
1300
+ }
1187
1301
  async function openBrowser(url) {
1188
1302
  try {
1189
1303
  await open(url);
@@ -1204,20 +1318,34 @@ var openWebInterfaceTool = {
1204
1318
  }
1205
1319
  },
1206
1320
  async execute(args) {
1321
+ const requestedPort = args.port || 7860;
1207
1322
  if (activeServer) {
1323
+ const runningPort = getServerPort(activeServer) ?? activePort;
1324
+ if (runningPort !== requestedPort) {
1325
+ throw new Error(`Web interface is already running on port ${runningPort ?? "unknown"}. Please close it before opening a different port.`);
1326
+ }
1327
+ const url2 = `http://localhost:${runningPort ?? requestedPort}`;
1328
+ await openBrowser(url2);
1208
1329
  return {
1209
1330
  message: "Web interface is already running",
1210
- url: `http://localhost:${activeServer.address().port}`
1331
+ url: url2
1211
1332
  };
1212
1333
  }
1213
- const port = args.port || 7860;
1214
- activeServer = createServer(port);
1215
- const url = `http://localhost:${port}`;
1216
- void openBrowser(url);
1217
- return {
1218
- message: "Web interface started successfully and opened in browser",
1219
- url
1220
- };
1334
+ const url = `http://localhost:${requestedPort}`;
1335
+ try {
1336
+ activeServer = await createServer(requestedPort);
1337
+ activePort = requestedPort;
1338
+ await openBrowser(url);
1339
+ return {
1340
+ message: "Web interface started successfully and opened in browser",
1341
+ url
1342
+ };
1343
+ } catch (error) {
1344
+ activeServer = null;
1345
+ activePort = null;
1346
+ const errorMessage = error instanceof Error ? error.message : String(error);
1347
+ throw new Error(`Failed to start web interface: ${errorMessage}`);
1348
+ }
1221
1349
  }
1222
1350
  };
1223
1351
  var closeWebInterfaceTool = {
@@ -1231,12 +1359,15 @@ var closeWebInterfaceTool = {
1231
1359
  if (!activeServer) {
1232
1360
  return { message: "Web interface is not running" };
1233
1361
  }
1234
- return new Promise((resolve) => {
1235
- activeServer.close(() => {
1236
- activeServer = null;
1237
- resolve({ message: "Web interface stopped" });
1238
- });
1239
- });
1362
+ try {
1363
+ await closeServer(activeServer);
1364
+ activeServer = null;
1365
+ activePort = null;
1366
+ return { message: "Web interface stopped" };
1367
+ } catch (error) {
1368
+ const errorMessage = error instanceof Error ? error.message : String(error);
1369
+ throw new Error(`Failed to stop web interface: ${errorMessage}`);
1370
+ }
1240
1371
  }
1241
1372
  };
1242
1373
 
@@ -1650,115 +1781,115 @@ init_esm_shims();
1650
1781
  var projectPrompts = [
1651
1782
  {
1652
1783
  name: "recommendNextTasks",
1653
- description: "\u667A\u80FD\u63A8\u8350\u63A5\u4E0B\u6765\u8981\u5B8C\u6210\u7684\u4F18\u5148\u4EFB\u52A1\uFF0C\u57FA\u4E8E\u4F18\u5148\u7EA7\u3001\u622A\u6B62\u65E5\u671F\u548C\u9879\u76EE\u72B6\u6001",
1784
+ description: "Intelligently recommend the next priority tasks based on urgency, due dates, and project status",
1654
1785
  arguments: [
1655
1786
  {
1656
1787
  name: "projectId",
1657
- description: "\u7279\u5B9A\u9879\u76EE\u7684ID\uFF08\u53EF\u9009\uFF0C\u4E0D\u63D0\u4F9B\u5219\u5206\u6790\u6240\u6709\u9879\u76EE\uFF09",
1788
+ description: "Specific project ID (optional; if not provided, analyze all projects)",
1658
1789
  required: false
1659
1790
  },
1660
1791
  {
1661
1792
  name: "limit",
1662
- description: "\u63A8\u8350\u4EFB\u52A1\u6570\u91CF\uFF08\u9ED8\u8BA43\u4E2A\uFF09",
1793
+ description: "Number of tasks to recommend (default: 3)",
1663
1794
  required: false
1664
1795
  }
1665
1796
  ]
1666
1797
  },
1667
1798
  {
1668
1799
  name: "autoPrioritize",
1669
- description: "\u81EA\u52A8\u5206\u6790\u4EFB\u52A1\u5E76\u667A\u80FD\u8C03\u6574\u4F18\u5148\u7EA7\uFF0C\u8003\u8651\u622A\u6B62\u65E5\u671F\u3001\u4EFB\u52A1\u4F9D\u8D56\u548C\u9879\u76EE\u91CD\u8981\u6027",
1800
+ description: "Automatically analyze tasks and intelligently adjust priorities, considering due dates, dependencies, and project importance",
1670
1801
  arguments: [
1671
1802
  {
1672
1803
  name: "projectId",
1673
- description: "\u7279\u5B9A\u9879\u76EE\u7684ID\uFF08\u53EF\u9009\uFF0C\u4E0D\u63D0\u4F9B\u5219\u5206\u6790\u6240\u6709\u9879\u76EE\uFF09",
1804
+ description: "Specific project ID (optional; if not provided, analyze all projects)",
1674
1805
  required: false
1675
1806
  }
1676
1807
  ]
1677
1808
  },
1678
1809
  {
1679
1810
  name: "enhanceTaskDetails",
1680
- description: "\u667A\u80FD\u8865\u5145\u4EFB\u52A1\u7EC6\u8282\uFF0C\u5305\u62EC\u63CF\u8FF0\u3001\u9A8C\u6536\u6807\u51C6\u3001\u5B50\u4EFB\u52A1\u548C\u6240\u9700\u8D44\u6E90",
1811
+ description: "Intelligently enhance task details, including description, acceptance criteria, subtasks, and required resources",
1681
1812
  arguments: [
1682
1813
  {
1683
1814
  name: "taskId",
1684
- description: "\u8981\u5B8C\u5584\u7684\u4EFB\u52A1ID",
1815
+ description: "Task ID to be enhanced",
1685
1816
  required: true
1686
1817
  }
1687
1818
  ]
1688
1819
  },
1689
1820
  {
1690
1821
  name: "quickCapture",
1691
- description: "\u5FEB\u901F\u6355\u6349\u60F3\u6CD5/\u4EFB\u52A1\uFF0C\u81EA\u52A8\u5206\u7C7B\u5E76\u5EFA\u8BAE\u4F18\u5148\u7EA7",
1822
+ description: "Quickly capture ideas/tasks, auto-categorize and suggest priorities",
1692
1823
  arguments: [
1693
1824
  {
1694
1825
  name: "idea",
1695
- description: "\u8981\u6355\u6349\u7684\u60F3\u6CD5\u6216\u4EFB\u52A1\u63CF\u8FF0",
1826
+ description: "Idea or task description to be captured",
1696
1827
  required: true
1697
1828
  },
1698
1829
  {
1699
1830
  name: "projectId",
1700
- description: "\u76EE\u6807\u9879\u76EEID\uFF08\u53EF\u9009\uFF09",
1831
+ description: "Target project ID (optional)",
1701
1832
  required: false
1702
1833
  }
1703
1834
  ]
1704
1835
  }
1705
1836
  ];
1706
1837
  function getRecommendNextTasksPrompt(projectId, limit) {
1707
- const context = projectId ? `\u5206\u6790\u9879\u76EE ${projectId} \u7684\u4EFB\u52A1` : "\u5206\u6790\u6240\u6709\u6D3B\u8DC3\u9879\u76EE\u7684\u4EFB\u52A1";
1838
+ const context = projectId ? `Analyze tasks for project ${projectId}` : "Analyze tasks for all active projects";
1708
1839
  const taskLimit = limit ? parseInt(limit, 10) : 3;
1709
1840
  return {
1710
- description: "\u667A\u80FD\u4EFB\u52A1\u63A8\u8350\u52A9\u624B",
1841
+ description: "Intelligent Task Recommendation Assistant",
1711
1842
  messages: [
1712
1843
  {
1713
1844
  role: "user",
1714
1845
  content: {
1715
1846
  type: "text",
1716
- text: `${context}\uFF0C\u8BF7\u5E2E\u6211\u63A8\u8350\u63A5\u4E0B\u6765\u5E94\u8BE5\u4F18\u5148\u5B8C\u6210\u7684${taskLimit}\u4E2A\u4EFB\u52A1\u3002
1847
+ text: `${context}, please recommend the ${taskLimit} tasks I should prioritize next.
1717
1848
 
1718
- ## \u63A8\u8350\u903B\u8F91\uFF08\u6309\u4F18\u5148\u7EA7\u6392\u5E8F\uFF09\uFF1A
1849
+ ## Recommendation Logic (sorted by priority):
1719
1850
 
1720
- ### 1. \u7D27\u6025\u4E14\u91CD\u8981\uFF08Critical\u4F18\u5148\u7EA7 + \u622A\u6B62\u65E5\u671F\u8FD1\uFF09
1721
- - \u4ECA\u5929\u6216\u660E\u5929\u5230\u671F\u7684Critical\u4EFB\u52A1
1722
- - \u5DF2\u903E\u671F\u7684\u9AD8\u4F18\u5148\u7EA7\u4EFB\u52A1
1851
+ ### 1. Urgent and Important (Critical priority + Near due date)
1852
+ - Critical tasks due today or tomorrow
1853
+ - Overdue high-priority tasks
1723
1854
 
1724
- ### 2. \u9AD8\u4EF7\u503C\u4EFB\u52A1\uFF08High\u4F18\u5148\u7EA7 + \u6709\u660E\u786E\u622A\u6B62\u65E5\u671F\uFF09
1725
- - \u672C\u5468\u5185\u5230\u671F\u7684High\u4F18\u5148\u7EA7\u4EFB\u52A1
1726
- - \u963B\u585E\u5176\u4ED6\u4EFB\u52A1\u7684\u5173\u952E\u8DEF\u5F84\u4EFB\u52A1
1855
+ ### 2. High-Value Tasks (High priority + Clear due date)
1856
+ - High priority tasks due this week
1857
+ - Critical path tasks blocking other work
1727
1858
 
1728
- ### 3. \u5FEB\u901F\u83B7\u80DC\uFF08Medium\u4F18\u5148\u7EA7 + \u9884\u8BA1\u8017\u65F6\u77ED\uFF09
1729
- - \u53EF\u4EE5\u57281-2\u5C0F\u65F6\u5185\u5B8C\u6210\u7684Medium\u4EFB\u52A1
1730
- - \u80FD\u660E\u663E\u63D0\u5347\u9879\u76EE\u8FDB\u5EA6\u7684\u4EFB\u52A1
1859
+ ### 3. Quick Wins (Medium priority + Short estimated time)
1860
+ - Medium tasks completable in 1-2 hours
1861
+ - Tasks that can significantly boost project progress
1731
1862
 
1732
- ### 4. \u8BA1\u5212\u5185\u5DE5\u4F5C
1733
- - \u5DF2\u6807\u8BB0\u4E3A"in-progress"\u4F46\u672A\u5B8C\u6210\u7684\u4EFB\u52A1
1734
- - \u5373\u5C06\u5230\u671F\u7684Normal\u4F18\u5148\u7EA7\u4EFB\u52A1
1863
+ ### 4. Planned Work
1864
+ - Tasks marked "in-progress" but not yet completed
1865
+ - Normal priority tasks due soon
1735
1866
 
1736
- ## \u8BF7\u6267\u884C\u4EE5\u4E0B\u6B65\u9AA4\uFF1A
1867
+ ## Please perform the following steps:
1737
1868
 
1738
- 1. **\u5217\u51FA\u6240\u6709\u5F85\u529E\u4EFB\u52A1**\uFF08status = todo \u6216 in-progress\uFF09
1739
- 2. **\u7B5B\u9009\u51FA\u9AD8\u4F18\u5148\u7EA7\u4EFB\u52A1**\uFF1Acritical \u548C high
1740
- 3. **\u68C0\u67E5\u622A\u6B62\u65E5\u671F**\uFF1A\u627E\u51FA\u5373\u5C06\u5230\u671F\u6216\u5DF2\u903E\u671F\u7684\u4EFB\u52A1
1741
- 4. **\u5206\u6790\u963B\u585E\u5173\u7CFB**\uFF1A\u8BC6\u522B\u54EA\u4E9B\u4EFB\u52A1\u963B\u585E\u4E86\u5176\u4ED6\u4EFB\u52A1
1742
- 5. **\u751F\u6210\u63A8\u8350\u5217\u8868**\uFF1A\u7ED9\u51FA${taskLimit}\u4E2A\u6700\u5E94\u8BE5\u4F18\u5148\u5904\u7406\u7684\u4EFB\u52A1\uFF0C\u5305\u542B\u7406\u7531
1869
+ 1. **List all pending tasks** (status = todo or in-progress)
1870
+ 2. **Filter high-priority tasks**: critical and high
1871
+ 3. **Check due dates**: Identify tasks due soon or overdue
1872
+ 4. **Analyze blocking relationships**: Identify tasks blocking others
1873
+ 5. **Generate recommendation list**: Provide ${taskLimit} tasks to prioritize with reasons
1743
1874
 
1744
- ## \u8F93\u51FA\u683C\u5F0F\uFF1A
1875
+ ## Output Format:
1745
1876
 
1746
- ### \u7ACB\u5373\u5904\u7406\uFF08Critical\uFF09
1747
- 1. **\u4EFB\u52A1\u540D** (\u9879\u76EE\u540D)
1748
- - \u539F\u56E0\uFF1A[\u4E3A\u4EC0\u4E48\u8FD9\u4E2A\u4EFB\u52A1\u6700\u7D27\u6025]
1749
- - \u5EFA\u8BAE\u884C\u52A8\uFF1A[\u5177\u4F53\u505A\u4EC0\u4E48]
1877
+ ### Immediate Action (Critical)
1878
+ 1. **Task Name** (Project Name)
1879
+ - Reason: [Why this task is most urgent]
1880
+ - Suggested Action: [What specifically to do]
1750
1881
 
1751
- ### \u4ECA\u65E5\u91CD\u70B9\uFF08High\uFF09
1752
- 2. **\u4EFB\u52A1\u540D** (\u9879\u76EE\u540D)
1753
- - \u539F\u56E0\uFF1A[\u4E3A\u4EC0\u4E48\u8FD9\u4E2A\u4EFB\u52A1\u91CD\u8981]
1754
- - \u5EFA\u8BAE\u884C\u52A8\uFF1A[\u5177\u4F53\u505A\u4EC0\u4E48]
1882
+ ### Today's Focus (High)
1883
+ 2. **Task Name** (Project Name)
1884
+ - Reason: [Why this task is important]
1885
+ - Suggested Action: [What specifically to do]
1755
1886
 
1756
- ### \u540E\u7EED\u8DDF\u8FDB
1757
- 3. **\u4EFB\u52A1\u540D** (\u9879\u76EE\u540D)
1758
- - \u539F\u56E0\uFF1A[\u4E3A\u4EC0\u4E48\u5E94\u8BE5\u63A5\u4E0B\u6765\u505A]
1759
- - \u5EFA\u8BAE\u884C\u52A8\uFF1A[\u5177\u4F53\u505A\u4EC0\u4E48]
1887
+ ### Follow-up
1888
+ 3. **Task Name** (Project Name)
1889
+ - Reason: [Why this should be done next]
1890
+ - Suggested Action: [What specifically to do]
1760
1891
 
1761
- \u8BF7\u4F7F\u7528 list_tasks \u5DE5\u5177\u83B7\u53D6\u4EFB\u52A1\u6570\u636E\uFF0C\u7136\u540E\u7ED9\u51FA\u667A\u80FD\u63A8\u8350\u3002
1892
+ Please use the list_tasks tool to fetch task data, then provide intelligent recommendations.
1762
1893
 
1763
1894
  ## Important Reminder
1764
1895
  When you start working on recommended tasks, please:
@@ -1773,71 +1904,71 @@ Keep task status synchronized with actual progress!`
1773
1904
  };
1774
1905
  }
1775
1906
  function getAutoPrioritizePrompt(projectId) {
1776
- const context = projectId ? `\u5206\u6790\u9879\u76EE ${projectId} \u7684\u4EFB\u52A1\u4F18\u5148\u7EA7` : "\u5206\u6790\u6240\u6709\u9879\u76EE\u7684\u4EFB\u52A1\u4F18\u5148\u7EA7";
1907
+ const context = projectId ? `Analyze task priorities for project ${projectId}` : "Analyze task priorities for all projects";
1777
1908
  return {
1778
- description: "\u667A\u80FD\u4F18\u5148\u7EA7\u4F18\u5316\u52A9\u624B",
1909
+ description: "Intelligent Priority Optimization Assistant",
1779
1910
  messages: [
1780
1911
  {
1781
1912
  role: "user",
1782
1913
  content: {
1783
1914
  type: "text",
1784
- text: `${context}\uFF0C\u8BF7\u81EA\u52A8\u5206\u6790\u5E76\u5EFA\u8BAE\u4F18\u5148\u7EA7\u8C03\u6574\u3002
1785
-
1786
- ## \u4F18\u5148\u7EA7\u8C03\u6574\u89C4\u5219\uFF1A
1787
-
1788
- ### \u5347\u7EA7\u4E3A Critical \u7684\u6761\u4EF6\uFF1A
1789
- - [ ] \u622A\u6B62\u65E5\u671F\u572848\u5C0F\u65F6\u5185\u4E14\u672A\u5B8C\u6210
1790
- - [ ] \u963B\u585E\u4E86\u5176\u4ED6high/critical\u4EFB\u52A1
1791
- - [ ] \u662F\u9879\u76EE\u5173\u952E\u8DEF\u5F84\u4E0A\u7684\u4EFB\u52A1\u4E14\u8FDB\u5EA6\u843D\u540E
1792
- - [ ] \u6709\u5916\u90E8\u4F9D\u8D56\uFF08\u5982\u5BA2\u6237\u3001\u5408\u4F5C\u65B9\uFF09\u4E14\u65F6\u95F4\u7D27\u8FEB
1793
-
1794
- ### \u5347\u7EA7\u4E3A High \u7684\u6761\u4EF6\uFF1A
1795
- - [ ] \u622A\u6B62\u65E5\u671F\u57281\u5468\u5185
1796
- - [ ] \u662F\u91CD\u8981\u91CC\u7A0B\u7891\u7684\u524D\u7F6E\u4EFB\u52A1
1797
- - [ ] \u957F\u671F\u5361\u5728"in-progress"\u72B6\u6001\uFF08\u8D85\u8FC73\u5929\uFF09
1798
- - [ ] \u5F71\u54CD\u591A\u4E2A\u56E2\u961F\u6210\u5458\u7684\u5DE5\u4F5C
1799
-
1800
- ### \u964D\u7EA7\u4E3A Medium/Low \u7684\u6761\u4EF6\uFF1A
1801
- - [ ] \u622A\u6B62\u65E5\u671F\u8FD8\u5F88\u8FDC\uFF08>2\u5468\uFF09\u4E14\u6CA1\u6709\u4F9D\u8D56
1802
- - [ ] \u662F"nice to have"\u529F\u80FD\u800C\u975E\u6838\u5FC3\u529F\u80FD
1803
- - [ ] \u5F53\u524D\u9636\u6BB5\u4E0D\u9700\u8981\uFF0C\u53EF\u4EE5\u5EF6\u540E
1804
-
1805
- ### \u5176\u4ED6\u8003\u8651\u56E0\u7D20\uFF1A
1806
- - **\u9879\u76EE\u6574\u4F53\u8FDB\u5EA6**\uFF1A\u8FDB\u5EA6\u843D\u540E\u7684\u9879\u76EE\u4EFB\u52A1\u5E94\u63D0\u5347\u4F18\u5148\u7EA7
1807
- - **\u8D44\u6E90\u53EF\u7528\u6027**\uFF1A\u5982\u679C\u8D44\u6E90\u7D27\u5F20\uFF0C\u805A\u7126\u6700\u9AD8\u4F18\u5148\u7EA7
1808
- - **\u98CE\u9669\u56E0\u7D20**\uFF1A\u98CE\u9669\u9AD8\u7684\u4EFB\u52A1\u5E94\u63D0\u524D\u5904\u7406
1809
-
1810
- ## \u8BF7\u6267\u884C\u4EE5\u4E0B\u6B65\u9AA4\uFF1A
1811
-
1812
- 1. **\u83B7\u53D6\u6240\u6709\u4EFB\u52A1**\uFF1A\u4F7F\u7528 list_tasks \u83B7\u53D6\u4EFB\u52A1\u5217\u8868
1813
- 2. **\u5206\u6790\u6BCF\u4E2A\u4EFB\u52A1**\uFF1A
1814
- - \u68C0\u67E5\u622A\u6B62\u65E5\u671F\u4E0E\u5F53\u524D\u65E5\u671F\u7684\u5DEE\u8DDD
1815
- - \u8BC6\u522B\u4EFB\u52A1\u4F9D\u8D56\u5173\u7CFB
1816
- - \u8BC4\u4F30\u9879\u76EE\u6574\u4F53\u5065\u5EB7\u5EA6
1817
- 3. **\u751F\u6210\u8C03\u6574\u5EFA\u8BAE**\uFF1A\u5217\u51FA\u9700\u8981\u8C03\u6574\u4F18\u5148\u7EA7\u7684\u4EFB\u52A1\u53CA\u7406\u7531
1818
- 4. **\u6279\u91CF\u66F4\u65B0**\uFF1A\u4F7F\u7528 batch_update_tasks \u6267\u884C\u4F18\u5148\u7EA7\u8C03\u6574
1819
-
1820
- ## \u8F93\u51FA\u683C\u5F0F\uFF1A
1821
-
1822
- ### \u5EFA\u8BAE\u5347\u7EA7\u4E3A Critical
1823
- | \u4EFB\u52A1 | \u5F53\u524D\u4F18\u5148\u7EA7 | \u5EFA\u8BAE\u4F18\u5148\u7EA7 | \u7406\u7531 |
1824
- |------|-----------|-----------|------|
1825
- | XXX | high \u2192 critical | \u660E\u5929\u5230\u671F |
1826
-
1827
- ### \u5EFA\u8BAE\u5347\u7EA7\u4E3A High
1828
- | \u4EFB\u52A1 | \u5F53\u524D\u4F18\u5148\u7EA7 | \u5EFA\u8BAE\u4F18\u5148\u7EA7 | \u7406\u7531 |
1829
- |------|-----------|-----------|------|
1830
- | XXX | medium \u2192 high | \u963B\u585E\u540E\u7EED\u4EFB\u52A1 |
1831
-
1832
- ### \u5EFA\u8BAE\u964D\u7EA7
1833
- | \u4EFB\u52A1 | \u5F53\u524D\u4F18\u5148\u7EA7 | \u5EFA\u8BAE\u4F18\u5148\u7EA7 | \u7406\u7531 |
1834
- |------|-----------|-----------|------|
1835
- | XXX | high \u2192 medium | \u53EF\u5EF6\u540E\u5904\u7406 |
1836
-
1837
- ### \u4FDD\u6301\u4E0D\u53D8\uFF08\u4F18\u5148\u7EA7\u5408\u7406\uFF09
1838
- - \u5217\u51FA\u4F18\u5148\u7EA7\u8BBE\u7F6E\u5408\u7406\u7684\u4EFB\u52A1
1839
-
1840
- \u8BF7\u7ED9\u51FA\u5206\u6790\u7ED3\u679C\uFF0C\u5E76\u5728\u7528\u6237\u786E\u8BA4\u540E\u6267\u884C\u6279\u91CF\u66F4\u65B0\u3002`
1915
+ text: `${context}, please automatically analyze and suggest priority adjustments.
1916
+
1917
+ ## Priority Adjustment Rules:
1918
+
1919
+ ### Conditions to Upgrade to Critical:
1920
+ - [ ] Due within 48 hours and not completed
1921
+ - [ ] Blocking other high/critical tasks
1922
+ - [ ] On project critical path and behind schedule
1923
+ - [ ] Has external dependencies (e.g., clients, partners) and time is tight
1924
+
1925
+ ### Conditions to Upgrade to High:
1926
+ - [ ] Due within 1 week
1927
+ - [ ] Prerequisite for important milestone
1928
+ - [ ] Stuck in "in-progress" state for too long (over 3 days)
1929
+ - [ ] Affects work of multiple team members
1930
+
1931
+ ### Conditions to Downgrade to Medium/Low:
1932
+ - [ ] Due date is far away (>2 weeks) and no dependencies
1933
+ - [ ] "Nice to have" feature rather than core functionality
1934
+ - [ ] Not needed in current phase, can be postponed
1935
+
1936
+ ### Other Considerations:
1937
+ - **Overall project progress**: Tasks for behind-schedule projects should be prioritized higher
1938
+ - **Resource availability**: If resources are tight, focus on highest priority
1939
+ - **Risk factors**: High-risk tasks should be addressed earlier
1940
+
1941
+ ## Please perform the following steps:
1942
+
1943
+ 1. **Get all tasks**: Use list_tasks to fetch task list
1944
+ 2. **Analyze each task**:
1945
+ - Check gap between due date and current date
1946
+ - Identify task dependency relationships
1947
+ - Evaluate overall project health
1948
+ 3. **Generate adjustment suggestions**: List tasks needing priority changes with reasons
1949
+ 4. **Batch update**: Use batch_update_tasks to execute priority adjustments
1950
+
1951
+ ## Output Format:
1952
+
1953
+ ### Suggested Upgrade to Critical
1954
+ | Task | Current Priority | Suggested Priority | Reason |
1955
+ |------|-----------------|-------------------|--------|
1956
+ | XXX | high \u2192 critical | Due tomorrow |
1957
+
1958
+ ### Suggested Upgrade to High
1959
+ | Task | Current Priority | Suggested Priority | Reason |
1960
+ |------|-----------------|-------------------|--------|
1961
+ | XXX | medium \u2192 high | Blocking follow-up tasks |
1962
+
1963
+ ### Suggested Downgrade
1964
+ | Task | Current Priority | Suggested Priority | Reason |
1965
+ |------|-----------------|-------------------|--------|
1966
+ | XXX | high \u2192 medium | Can be postponed |
1967
+
1968
+ ### Keep Unchanged (Priorities are reasonable)
1969
+ - List tasks with reasonable priority settings
1970
+
1971
+ Please provide analysis results, then execute batch update after user confirmation.`
1841
1972
  }
1842
1973
  }
1843
1974
  ]
@@ -1845,139 +1976,139 @@ function getAutoPrioritizePrompt(projectId) {
1845
1976
  }
1846
1977
  function getEnhanceTaskDetailsPrompt(taskId) {
1847
1978
  return {
1848
- description: "\u4EFB\u52A1\u7EC6\u8282\u5B8C\u5584\u52A9\u624B",
1979
+ description: "Task Detail Enhancement Assistant",
1849
1980
  messages: [
1850
1981
  {
1851
1982
  role: "user",
1852
1983
  content: {
1853
1984
  type: "text",
1854
- text: `\u8BF7\u5E2E\u6211\u5B8C\u5584\u4EFB\u52A1 ${taskId} \u7684\u7EC6\u8282\u3002
1855
-
1856
- ## \u5B8C\u5584\u5185\u5BB9\uFF1A
1857
-
1858
- ### 1. \u8BE6\u7EC6\u63CF\u8FF0
1859
- - \u4EFB\u52A1\u7684\u5177\u4F53\u5185\u5BB9\u548C\u80CC\u666F
1860
- - \u4E3A\u4EC0\u4E48\u8981\u505A\u8FD9\u4E2A\u4EFB\u52A1
1861
- - \u9884\u671F\u7684\u4E1A\u52A1\u4EF7\u503C\u6216\u6280\u672F\u4EF7\u503C
1862
-
1863
- ### 2. \u9A8C\u6536\u6807\u51C6\uFF08Definition of Done\uFF09
1864
- \u5217\u51FA\u660E\u786E\u7684\u5B8C\u6210\u6807\u51C6\uFF0C\u4F8B\u5982\uFF1A
1865
- - [ ] \u529F\u80FD\u5B9E\u73B0\u5E76\u672C\u5730\u6D4B\u8BD5\u901A\u8FC7
1866
- - [ ] \u4EE3\u7801\u901A\u8FC7Code Review
1867
- - [ ] \u76F8\u5173\u6587\u6863\u5DF2\u66F4\u65B0
1868
- - [ ] \u5355\u5143\u6D4B\u8BD5\u8986\u76D6\u7387>80%
1869
-
1870
- ### 3. \u6280\u672F/\u5B9E\u73B0\u7EC6\u8282
1871
- - \u6D89\u53CA\u7684\u6280\u672F\u6808\u6216\u6A21\u5757
1872
- - \u53EF\u80FD\u9700\u8981\u4FEE\u6539\u7684\u6587\u4EF6
1873
- - \u6F5C\u5728\u7684\u6311\u6218\u6216\u6CE8\u610F\u4E8B\u9879
1874
-
1875
- ### 4. \u76F8\u5173\u8D44\u6E90
1876
- - \u76F8\u5173\u6587\u6863\u94FE\u63A5
1877
- - \u53C2\u8003\u5B9E\u73B0\u6216\u793A\u4F8B\u4EE3\u7801
1878
- - \u9700\u8981\u54A8\u8BE2\u7684\u4EBA\u5458
1879
-
1880
- ### 5. \u5B50\u4EFB\u52A1\u5EFA\u8BAE\uFF08\u5982\u679C\u9700\u8981\uFF09
1881
- \u5982\u679C\u4EFB\u52A1\u8F83\u590D\u6742\uFF0C\u5EFA\u8BAE\u62C6\u5206\u4E3A\u5B50\u4EFB\u52A1\uFF1A
1882
- - \u5B50\u4EFB\u52A11\uFF1A...
1883
- - \u5B50\u4EFB\u52A12\uFF1A...
1884
- - \u5B50\u4EFB\u52A13\uFF1A...
1885
-
1886
- ## \u8BF7\u6267\u884C\u4EE5\u4E0B\u6B65\u9AA4\uFF1A
1887
-
1888
- 1. **\u83B7\u53D6\u4EFB\u52A1\u4FE1\u606F**\uFF1A\u4F7F\u7528 get_task \u67E5\u770B\u5F53\u524D\u4EFB\u52A1\u8BE6\u60C5
1889
- 2. **\u83B7\u53D6\u9879\u76EE\u4E0A\u4E0B\u6587**\uFF1A\u4F7F\u7528 get_project \u4E86\u89E3\u9879\u76EE\u80CC\u666F
1890
- 3. **\u5206\u6790\u4EFB\u52A1\u7C7B\u578B**\uFF1A
1891
- - \u5982\u679C\u662F\u5F00\u53D1\u4EFB\u52A1\uFF1A\u8865\u5145\u6280\u672F\u7EC6\u8282\u3001\u4EE3\u7801\u4F4D\u7F6E
1892
- - \u5982\u679C\u662F\u8BBE\u8BA1\u4EFB\u52A1\uFF1A\u8865\u5145\u8BBE\u8BA1\u89C4\u8303\u3001\u8BC4\u5BA1\u6807\u51C6
1893
- - \u5982\u679C\u662F\u6587\u6863\u4EFB\u52A1\uFF1A\u8865\u5145\u6587\u6863\u7ED3\u6784\u3001\u53C2\u8003\u8D44\u6599
1894
- - \u5982\u679C\u662F\u6D4B\u8BD5\u4EFB\u52A1\uFF1A\u8865\u5145\u6D4B\u8BD5\u573A\u666F\u3001\u8986\u76D6\u8303\u56F4
1895
- 4. **\u751F\u6210\u5B8C\u5584\u5185\u5BB9**\uFF1A\u4F7F\u7528 update_task \u66F4\u65B0\u4EFB\u52A1\u63CF\u8FF0
1896
-
1897
- ## \u66F4\u65B0\u540E\u4EFB\u52A1\u5E94\u5305\u542B\uFF1A
1985
+ text: `Please help me enhance the details for task ${taskId}.
1986
+
1987
+ ## Enhancement Content:
1988
+
1989
+ ### 1. Detailed Description
1990
+ - Specific content and background of the task
1991
+ - Why this task needs to be done
1992
+ - Expected business or technical value
1993
+
1994
+ ### 2. Acceptance Criteria (Definition of Done)
1995
+ List clear completion standards, for example:
1996
+ - [ ] Feature implemented and locally tested
1997
+ - [ ] Code passes Code Review
1998
+ - [ ] Related documentation updated
1999
+ - [ ] Unit test coverage > 80%
2000
+
2001
+ ### 3. Technical/Implementation Details
2002
+ - Tech stack or modules involved
2003
+ - Files that may need modification
2004
+ - Potential challenges or considerations
2005
+
2006
+ ### 4. Related Resources
2007
+ - Related documentation links
2008
+ - Reference implementations or example code
2009
+ - People to consult
2010
+
2011
+ ### 5. Subtask Suggestions (if needed)
2012
+ If the task is complex, suggest breaking it down:
2013
+ - Subtask 1: ...
2014
+ - Subtask 2: ...
2015
+ - Subtask 3: ...
2016
+
2017
+ ## Please perform the following steps:
2018
+
2019
+ 1. **Get task info**: Use get_task to view current task details
2020
+ 2. **Get project context**: Use get_project to understand project background
2021
+ 3. **Analyze task type**:
2022
+ - If development task: Add technical details, code locations
2023
+ - If design task: Add design specs, review criteria
2024
+ - If documentation task: Add doc structure, references
2025
+ - If testing task: Add test scenarios, coverage scope
2026
+ 4. **Generate enhancement content**: Use update_task to update task description
2027
+
2028
+ ## Updated task should include:
1898
2029
 
1899
2030
  \`\`\`
1900
- ## \u80CC\u666F
1901
- [\u4EFB\u52A1\u80CC\u666F\u548C\u76EE\u7684]
1902
-
1903
- ## \u9A8C\u6536\u6807\u51C6
1904
- - [ ] [\u6807\u51C61]
1905
- - [ ] [\u6807\u51C62]
1906
- - [ ] [\u6807\u51C63]
1907
-
1908
- ## \u6280\u672F\u7EC6\u8282
1909
- - \u6D89\u53CA\u6A21\u5757\uFF1A[\u6A21\u5757\u540D]
1910
- - \u5173\u952E\u6587\u4EF6\uFF1A[\u6587\u4EF6\u8DEF\u5F84]
1911
- - \u6CE8\u610F\u4E8B\u9879\uFF1A[\u91CD\u8981\u63D0\u9192]
1912
-
1913
- ## \u76F8\u5173\u8D44\u6E90
1914
- - \u6587\u6863\uFF1A[\u94FE\u63A5]
1915
- - \u53C2\u8003\uFF1A[\u94FE\u63A5]
2031
+ ## Background
2032
+ [Task background and purpose]
2033
+
2034
+ ## Acceptance Criteria
2035
+ - [ ] [Standard 1]
2036
+ - [ ] [Standard 2]
2037
+ - [ ] [Standard 3]
2038
+
2039
+ ## Technical Details
2040
+ - Modules: [module name]
2041
+ - Key files: [file path]
2042
+ - Notes: [important reminders]
2043
+
2044
+ ## Related Resources
2045
+ - Documentation: [link]
2046
+ - References: [link]
1916
2047
  \`\`\`
1917
2048
 
1918
- \u8BF7\u83B7\u53D6\u4EFB\u52A1\u4FE1\u606F\u540E\uFF0C\u7ED9\u51FA\u8BE6\u7EC6\u7684\u5B8C\u5584\u5EFA\u8BAE\u3002`
2049
+ Please fetch task info first, then provide detailed enhancement suggestions.`
1919
2050
  }
1920
2051
  }
1921
2052
  ]
1922
2053
  };
1923
2054
  }
1924
2055
  function getQuickCapturePrompt(idea, projectId) {
1925
- const projectContext = projectId ? `\u6DFB\u52A0\u5230\u9879\u76EE ${projectId}` : "\u81EA\u52A8\u9009\u62E9\u6700\u5408\u9002\u7684\u9879\u76EE";
2056
+ const projectContext = projectId ? `Add to project ${projectId}` : "Auto-select the most suitable project";
1926
2057
  return {
1927
- description: "\u5FEB\u901F\u6355\u6349\u52A9\u624B",
2058
+ description: "Quick Capture Assistant",
1928
2059
  messages: [
1929
2060
  {
1930
2061
  role: "user",
1931
2062
  content: {
1932
2063
  type: "text",
1933
- text: `\u6211\u8981\u5FEB\u901F\u6355\u6349\u4E00\u4E2A\u60F3\u6CD5/\u4EFB\u52A1\uFF1A"${idea}"
2064
+ text: `I want to quickly capture an idea/task: "${idea}"
1934
2065
 
1935
2066
  ${projectContext}
1936
2067
 
1937
- ## \u8BF7\u5E2E\u6211\u5B8C\u6210\u4EE5\u4E0B\u6B65\u9AA4\uFF1A
2068
+ ## Please help me complete the following steps:
1938
2069
 
1939
- ### 1. \u4EFB\u52A1\u4FE1\u606F\u63D0\u53D6
1940
- \u4ECE\u63CF\u8FF0\u4E2D\u63D0\u53D6\uFF1A
1941
- - **\u4EFB\u52A1\u6807\u9898**\uFF1A\u7B80\u6D01\u660E\u786E\u7684\u6807\u9898\uFF08\u52A8\u8BCD\u5F00\u5934\uFF09
1942
- - **\u4EFB\u52A1\u63CF\u8FF0**\uFF1A\u8865\u5145\u4E0A\u4E0B\u6587\u548C\u7EC6\u8282
1943
- - **\u4EFB\u52A1\u7C7B\u578B**\uFF1Abug / feature / refactor / docs / chore
1944
- - **\u9884\u4F30\u4F18\u5148\u7EA7**\uFF1Acritical / high / medium / low\uFF08\u57FA\u4E8E\u63CF\u8FF0\u5224\u65AD\u7D27\u6025\u7A0B\u5EA6\uFF09
2070
+ ### 1. Task Information Extraction
2071
+ Extract from description:
2072
+ - **Task Title**: Concise and clear title (start with verb)
2073
+ - **Task Description**: Add context and details
2074
+ - **Task Type**: bug / feature / refactor / docs / chore
2075
+ - **Estimated Priority**: critical / high / medium / low (based on urgency in description)
1945
2076
 
1946
- ### 2. \u9879\u76EE\u63A8\u8350\uFF08\u5982\u679C\u672A\u6307\u5B9A\u9879\u76EE\uFF09
1947
- \u5982\u679C\u7528\u6237\u6CA1\u6709\u6307\u5B9A\u9879\u76EE\uFF0C\u8BF7\uFF1A
1948
- - \u5217\u51FA\u6240\u6709\u6D3B\u8DC3\u9879\u76EE
1949
- - \u5206\u6790\u4EFB\u52A1\u5185\u5BB9\u4E0E\u54EA\u4E2A\u9879\u76EE\u6700\u76F8\u5173
1950
- - \u63A8\u8350\u6700\u5408\u9002\u7684\u9879\u76EE
2077
+ ### 2. Project Recommendation (if no project specified)
2078
+ If user didn't specify a project, please:
2079
+ - List all active projects
2080
+ - Analyze which project the task content is most relevant to
2081
+ - Recommend the most suitable project
1951
2082
 
1952
- ### 3. \u6807\u7B7E\u5EFA\u8BAE
1953
- \u5EFA\u8BAE\u76F8\u5173\u7684\u6807\u7B7E\uFF1A
1954
- - \u7C7B\u578B\u6807\u7B7E\uFF1Abug, feature, refactor, docs
1955
- - \u4F18\u5148\u7EA7\u6807\u7B7E\uFF1Aurgent, important
1956
- - \u9886\u57DF\u6807\u7B7E\uFF1Afrontend, backend, design, testing\uFF08\u5982\u9002\u7528\uFF09
2083
+ ### 3. Tag Suggestions
2084
+ Suggest relevant tags:
2085
+ - Type tags: bug, feature, refactor, docs
2086
+ - Priority tags: urgent, important
2087
+ - Domain tags: frontend, backend, design, testing (if applicable)
1957
2088
 
1958
- ### 4. \u751F\u6210\u4EFB\u52A1
1959
- \u4F7F\u7528 create_task \u521B\u5EFA\u4EFB\u52A1
2089
+ ### 4. Generate Task
2090
+ Use create_task to create the task
1960
2091
 
1961
2092
  ### 5. Status Recommendation
1962
2093
  After creating the task, if you start working on it immediately, consider setting the status to in-progress. Use update_task to keep progress updated during work, and mark as done when completed.
1963
2094
 
1964
- ## \u793A\u4F8B\uFF1A
2095
+ ## Example:
1965
2096
 
1966
- **\u8F93\u5165**\uFF1A"\u7528\u6237\u53CD\u9988\u767B\u5F55\u9875\u9762\u5728\u624B\u673A\u4E0A\u663E\u793A\u4E0D\u5BF9"
2097
+ **Input**: "User reported login page doesn't display correctly on mobile"
1967
2098
 
1968
- **\u8F93\u51FA**\uFF1A
1969
- - \u6807\u9898\uFF1A\u4FEE\u590D\u767B\u5F55\u9875\u9762\u79FB\u52A8\u7AEF\u9002\u914D\u95EE\u9898
1970
- - \u63CF\u8FF0\uFF1A\u7528\u6237\u53CD\u9988\u767B\u5F55\u9875\u9762\u5728\u79FB\u52A8\u8BBE\u5907\u4E0A\u663E\u793A\u5F02\u5E38\uFF0C\u9700\u8981\u68C0\u67E5\u54CD\u5E94\u5F0F\u5E03\u5C40\u3002
1971
- - \u7C7B\u578B\uFF1ABug
1972
- - \u4F18\u5148\u7EA7\uFF1AHigh\uFF08\u5F71\u54CD\u7528\u6237\u4F53\u9A8C\uFF09
1973
- - \u5EFA\u8BAE\u6807\u7B7E\uFF1Abug, frontend, mobile
1974
- - \u63A8\u8350\u9879\u76EE\uFF1A[\u5982\u679C\u6709web\u9879\u76EE\u5219\u63A8\u8350]
2099
+ **Output**:
2100
+ - Title: Fix login page mobile responsiveness issue
2101
+ - Description: User reported the login page displays abnormally on mobile devices, need to check responsive layout.
2102
+ - Type: Bug
2103
+ - Priority: High (affects user experience)
2104
+ - Suggested Tags: bug, frontend, mobile
2105
+ - Recommended Project: [Recommend if there's a web project]
1975
2106
 
1976
- ## \u5F53\u524D\u60F3\u6CD5\u5206\u6790\uFF1A
2107
+ ## Current Idea Analysis:
1977
2108
 
1978
- \u60F3\u6CD5\uFF1A"${idea}"
2109
+ Idea: "${idea}"
1979
2110
 
1980
- \u8BF7\u5206\u6790\u5E76\u751F\u6210\u4EFB\u52A1\u5EFA\u8BAE\u3002\u7528\u6237\u786E\u8BA4\u540E\uFF0C\u6267\u884C create_task \u521B\u5EFA\u4EFB\u52A1\u3002`
2111
+ Please analyze and generate task suggestions. After user confirmation, execute create_task to create the task.`
1981
2112
  }
1982
2113
  }
1983
2114
  ]
@@ -2027,7 +2158,7 @@ function createServer2() {
2027
2158
  const server = new Server(
2028
2159
  {
2029
2160
  name: "roadmap-skill",
2030
- version: "0.2.0"
2161
+ version: "0.2.1"
2031
2162
  },
2032
2163
  {
2033
2164
  capabilities: {