@pixelbyte-software/pixcode 1.34.0 → 1.35.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.
Files changed (247) hide show
  1. package/LICENSE +718 -718
  2. package/README.de.md +248 -248
  3. package/README.ja.md +240 -240
  4. package/README.ko.md +240 -240
  5. package/README.md +303 -303
  6. package/README.ru.md +248 -248
  7. package/README.tr.md +250 -250
  8. package/README.zh-CN.md +240 -240
  9. package/dist/api-docs.html +548 -395
  10. package/dist/assets/index-B8w57E1r.css +32 -0
  11. package/dist/assets/index-CBdsvGSR.js +854 -0
  12. package/dist/clear-cache.html +85 -85
  13. package/dist/convert-icons.md +52 -52
  14. package/dist/favicon.svg +8 -8
  15. package/dist/generate-icons.js +48 -48
  16. package/dist/icons/codex-white.svg +3 -3
  17. package/dist/icons/codex.svg +3 -3
  18. package/dist/icons/cursor-white.svg +11 -11
  19. package/dist/icons/icon-128x128.svg +9 -9
  20. package/dist/icons/icon-144x144.svg +9 -9
  21. package/dist/icons/icon-152x152.svg +9 -9
  22. package/dist/icons/icon-192x192.svg +9 -9
  23. package/dist/icons/icon-384x384.svg +9 -9
  24. package/dist/icons/icon-512x512.svg +9 -9
  25. package/dist/icons/icon-72x72.svg +9 -9
  26. package/dist/icons/icon-96x96.svg +9 -9
  27. package/dist/icons/icon-template.svg +9 -9
  28. package/dist/icons/qwen-logo.svg +14 -14
  29. package/dist/index.html +59 -59
  30. package/dist/logo.svg +12 -12
  31. package/dist/manifest.json +60 -60
  32. package/dist/openapi.yaml +1693 -1311
  33. package/dist/sw.js +124 -124
  34. package/dist-server/server/claude-sdk.js +38 -7
  35. package/dist-server/server/claude-sdk.js.map +1 -1
  36. package/dist-server/server/cli.js +107 -112
  37. package/dist-server/server/cli.js.map +1 -1
  38. package/dist-server/server/daemon/manager.js +33 -33
  39. package/dist-server/server/daemon-manager.js +159 -112
  40. package/dist-server/server/daemon-manager.js.map +1 -1
  41. package/dist-server/server/database/json-store.js +8 -5
  42. package/dist-server/server/database/json-store.js.map +1 -1
  43. package/dist-server/server/index.js +31 -10
  44. package/dist-server/server/index.js.map +1 -1
  45. package/dist-server/server/modules/orchestration/a2a/adapter-registry.js +45 -19
  46. package/dist-server/server/modules/orchestration/a2a/adapter-registry.js.map +1 -1
  47. package/dist-server/server/modules/orchestration/a2a/adapters/abstract-a2a.adapter.js.map +1 -1
  48. package/dist-server/server/modules/orchestration/a2a/adapters/claude-code.adapter.js +1 -0
  49. package/dist-server/server/modules/orchestration/a2a/adapters/claude-code.adapter.js.map +1 -1
  50. package/dist-server/server/modules/orchestration/a2a/adapters/codex.adapter.js +202 -0
  51. package/dist-server/server/modules/orchestration/a2a/adapters/codex.adapter.js.map +1 -0
  52. package/dist-server/server/modules/orchestration/a2a/adapters/cursor.adapter.js +205 -0
  53. package/dist-server/server/modules/orchestration/a2a/adapters/cursor.adapter.js.map +1 -0
  54. package/dist-server/server/modules/orchestration/a2a/adapters/gemini.adapter.js +205 -0
  55. package/dist-server/server/modules/orchestration/a2a/adapters/gemini.adapter.js.map +1 -0
  56. package/dist-server/server/modules/orchestration/a2a/adapters/opencode.adapter.js +205 -0
  57. package/dist-server/server/modules/orchestration/a2a/adapters/opencode.adapter.js.map +1 -0
  58. package/dist-server/server/modules/orchestration/a2a/adapters/qwen.adapter.js +205 -0
  59. package/dist-server/server/modules/orchestration/a2a/adapters/qwen.adapter.js.map +1 -0
  60. package/dist-server/server/modules/orchestration/a2a/routes.js +298 -34
  61. package/dist-server/server/modules/orchestration/a2a/routes.js.map +1 -1
  62. package/dist-server/server/modules/orchestration/a2a/task-store.js +144 -0
  63. package/dist-server/server/modules/orchestration/a2a/task-store.js.map +1 -0
  64. package/dist-server/server/modules/orchestration/a2a/validator.js +16 -0
  65. package/dist-server/server/modules/orchestration/a2a/validator.js.map +1 -1
  66. package/dist-server/server/modules/orchestration/index.js +14 -0
  67. package/dist-server/server/modules/orchestration/index.js.map +1 -1
  68. package/dist-server/server/modules/orchestration/preview/port-watcher.js +90 -0
  69. package/dist-server/server/modules/orchestration/preview/port-watcher.js.map +1 -0
  70. package/dist-server/server/modules/orchestration/preview/preview-proxy.js +58 -0
  71. package/dist-server/server/modules/orchestration/preview/preview-proxy.js.map +1 -0
  72. package/dist-server/server/modules/orchestration/preview/types.js +2 -0
  73. package/dist-server/server/modules/orchestration/preview/types.js.map +1 -0
  74. package/dist-server/server/modules/orchestration/tasks/orchestration-task-store.js +37 -0
  75. package/dist-server/server/modules/orchestration/tasks/orchestration-task-store.js.map +1 -0
  76. package/dist-server/server/modules/orchestration/tasks/orchestration-task.routes.js +68 -0
  77. package/dist-server/server/modules/orchestration/tasks/orchestration-task.routes.js.map +1 -0
  78. package/dist-server/server/modules/orchestration/tasks/orchestration-task.service.js +128 -0
  79. package/dist-server/server/modules/orchestration/tasks/orchestration-task.service.js.map +1 -0
  80. package/dist-server/server/modules/orchestration/tasks/orchestration-task.types.js +2 -0
  81. package/dist-server/server/modules/orchestration/tasks/orchestration-task.types.js.map +1 -0
  82. package/dist-server/server/modules/orchestration/workflows/built-in-workflows.js +126 -0
  83. package/dist-server/server/modules/orchestration/workflows/built-in-workflows.js.map +1 -0
  84. package/dist-server/server/modules/orchestration/workflows/workflow-runner.js +1047 -0
  85. package/dist-server/server/modules/orchestration/workflows/workflow-runner.js.map +1 -0
  86. package/dist-server/server/modules/orchestration/workflows/workflow-store.js +76 -0
  87. package/dist-server/server/modules/orchestration/workflows/workflow-store.js.map +1 -0
  88. package/dist-server/server/modules/orchestration/workflows/workflow.routes.js +151 -0
  89. package/dist-server/server/modules/orchestration/workflows/workflow.routes.js.map +1 -0
  90. package/dist-server/server/modules/orchestration/workflows/workflow.types.js +2 -0
  91. package/dist-server/server/modules/orchestration/workflows/workflow.types.js.map +1 -0
  92. package/dist-server/server/modules/orchestration/workflows/workspace-target.js +98 -0
  93. package/dist-server/server/modules/orchestration/workflows/workspace-target.js.map +1 -0
  94. package/dist-server/server/modules/orchestration/workspace/docker-workspace.js +122 -0
  95. package/dist-server/server/modules/orchestration/workspace/docker-workspace.js.map +1 -0
  96. package/dist-server/server/modules/orchestration/workspace/path-safety.js +48 -0
  97. package/dist-server/server/modules/orchestration/workspace/path-safety.js.map +1 -0
  98. package/dist-server/server/modules/orchestration/workspace/types.js +11 -0
  99. package/dist-server/server/modules/orchestration/workspace/types.js.map +1 -0
  100. package/dist-server/server/modules/orchestration/workspace/workspace-manager.js +80 -0
  101. package/dist-server/server/modules/orchestration/workspace/workspace-manager.js.map +1 -0
  102. package/dist-server/server/modules/orchestration/workspace/worktree-workspace.js +96 -0
  103. package/dist-server/server/modules/orchestration/workspace/worktree-workspace.js.map +1 -0
  104. package/dist-server/server/modules/providers/index.js +3 -0
  105. package/dist-server/server/modules/providers/index.js.map +1 -0
  106. package/dist-server/server/openai-codex.js +35 -4
  107. package/dist-server/server/openai-codex.js.map +1 -1
  108. package/dist-server/server/routes/commands.js +25 -25
  109. package/dist-server/server/routes/git.js +17 -17
  110. package/dist-server/server/routes/taskmaster.js +525 -508
  111. package/dist-server/server/routes/taskmaster.js.map +1 -1
  112. package/package.json +180 -178
  113. package/scripts/fix-node-pty.js +67 -67
  114. package/scripts/smoke/a2a-roundtrip.mjs +86 -17
  115. package/scripts/smoke/orchestration-api.mjs +172 -0
  116. package/scripts/smoke/orchestration-live-run.mjs +176 -0
  117. package/server/claude-sdk.js +898 -857
  118. package/server/cli.js +935 -940
  119. package/server/constants/config.js +4 -4
  120. package/server/cursor-cli.js +342 -342
  121. package/server/daemon/manager.js +564 -564
  122. package/server/daemon-manager.js +959 -920
  123. package/server/database/db.js +794 -794
  124. package/server/database/json-store.js +197 -194
  125. package/server/gemini-cli.js +535 -535
  126. package/server/gemini-response-handler.js +79 -79
  127. package/server/index.js +3135 -3104
  128. package/server/load-env.js +34 -34
  129. package/server/middleware/auth.js +173 -173
  130. package/server/modules/orchestration/a2a/adapter-registry.ts +72 -22
  131. package/server/modules/orchestration/a2a/adapters/abstract-a2a.adapter.ts +9 -3
  132. package/server/modules/orchestration/a2a/adapters/claude-code.adapter.ts +1 -0
  133. package/server/modules/orchestration/a2a/adapters/codex.adapter.ts +244 -0
  134. package/server/modules/orchestration/a2a/adapters/cursor.adapter.ts +249 -0
  135. package/server/modules/orchestration/a2a/adapters/gemini.adapter.ts +248 -0
  136. package/server/modules/orchestration/a2a/adapters/opencode.adapter.ts +248 -0
  137. package/server/modules/orchestration/a2a/adapters/qwen.adapter.ts +248 -0
  138. package/server/modules/orchestration/a2a/routes.ts +349 -36
  139. package/server/modules/orchestration/a2a/task-store.ts +178 -0
  140. package/server/modules/orchestration/a2a/types.ts +14 -0
  141. package/server/modules/orchestration/a2a/validator.ts +25 -2
  142. package/server/modules/orchestration/index.ts +40 -0
  143. package/server/modules/orchestration/preview/port-watcher.ts +112 -0
  144. package/server/modules/orchestration/preview/preview-proxy.ts +60 -0
  145. package/server/modules/orchestration/preview/types.ts +19 -0
  146. package/server/modules/orchestration/tasks/orchestration-task-store.ts +45 -0
  147. package/server/modules/orchestration/tasks/orchestration-task.routes.ts +73 -0
  148. package/server/modules/orchestration/tasks/orchestration-task.service.ts +145 -0
  149. package/server/modules/orchestration/tasks/orchestration-task.types.ts +29 -0
  150. package/server/modules/orchestration/workflows/built-in-workflows.ts +127 -0
  151. package/server/modules/orchestration/workflows/workflow-runner.ts +1206 -0
  152. package/server/modules/orchestration/workflows/workflow-store.ts +97 -0
  153. package/server/modules/orchestration/workflows/workflow.routes.ts +169 -0
  154. package/server/modules/orchestration/workflows/workflow.types.ts +70 -0
  155. package/server/modules/orchestration/workflows/workspace-target.ts +120 -0
  156. package/server/modules/orchestration/workspace/docker-workspace.ts +135 -0
  157. package/server/modules/orchestration/workspace/path-safety.ts +55 -0
  158. package/server/modules/orchestration/workspace/types.ts +52 -0
  159. package/server/modules/orchestration/workspace/workspace-manager.ts +97 -0
  160. package/server/modules/orchestration/workspace/worktree-workspace.ts +125 -0
  161. package/server/modules/providers/index.ts +2 -0
  162. package/server/modules/providers/list/claude/claude-auth.provider.ts +145 -145
  163. package/server/modules/providers/list/claude/claude-mcp.provider.ts +135 -135
  164. package/server/modules/providers/list/claude/claude-sessions.provider.ts +306 -306
  165. package/server/modules/providers/list/claude/claude.provider.ts +15 -15
  166. package/server/modules/providers/list/codex/codex-auth.provider.ts +115 -115
  167. package/server/modules/providers/list/codex/codex-mcp.provider.ts +135 -135
  168. package/server/modules/providers/list/codex/codex-sessions.provider.ts +319 -319
  169. package/server/modules/providers/list/codex/codex.provider.ts +15 -15
  170. package/server/modules/providers/list/cursor/cursor-auth.provider.ts +143 -143
  171. package/server/modules/providers/list/cursor/cursor-mcp.provider.ts +108 -108
  172. package/server/modules/providers/list/cursor/cursor-sessions.provider.ts +421 -421
  173. package/server/modules/providers/list/cursor/cursor.provider.ts +15 -15
  174. package/server/modules/providers/list/gemini/gemini-auth.provider.ts +163 -163
  175. package/server/modules/providers/list/gemini/gemini-mcp.provider.ts +110 -110
  176. package/server/modules/providers/list/gemini/gemini-sessions.provider.ts +227 -227
  177. package/server/modules/providers/list/gemini/gemini.provider.ts +15 -15
  178. package/server/modules/providers/list/opencode/opencode-auth.provider.ts +130 -130
  179. package/server/modules/providers/list/opencode/opencode-mcp.provider.ts +126 -126
  180. package/server/modules/providers/list/opencode/opencode-sessions.provider.ts +232 -232
  181. package/server/modules/providers/list/opencode/opencode.provider.ts +29 -29
  182. package/server/modules/providers/list/qwen/qwen-auth.provider.ts +145 -145
  183. package/server/modules/providers/list/qwen/qwen-mcp.provider.ts +114 -114
  184. package/server/modules/providers/list/qwen/qwen-sessions.provider.ts +265 -265
  185. package/server/modules/providers/list/qwen/qwen.provider.ts +21 -21
  186. package/server/modules/providers/provider.registry.ts +40 -40
  187. package/server/modules/providers/provider.routes.ts +819 -819
  188. package/server/modules/providers/services/mcp.service.ts +86 -86
  189. package/server/modules/providers/services/provider-auth.service.ts +26 -26
  190. package/server/modules/providers/services/sessions.service.ts +45 -45
  191. package/server/modules/providers/shared/base/abstract.provider.ts +20 -20
  192. package/server/modules/providers/shared/mcp/mcp.provider.ts +151 -151
  193. package/server/modules/providers/shared/provider-configs.ts +142 -142
  194. package/server/modules/providers/tests/mcp.test.ts +293 -293
  195. package/server/openai-codex.js +462 -426
  196. package/server/opencode-cli.js +459 -459
  197. package/server/opencode-response-handler.js +107 -107
  198. package/server/projects.js +3105 -3105
  199. package/server/qwen-code-cli.js +395 -395
  200. package/server/qwen-response-handler.js +73 -73
  201. package/server/routes/agent.js +1365 -1365
  202. package/server/routes/auth.js +138 -138
  203. package/server/routes/codex.js +19 -19
  204. package/server/routes/commands.js +554 -554
  205. package/server/routes/cursor.js +52 -52
  206. package/server/routes/gemini.js +24 -24
  207. package/server/routes/git.js +1488 -1488
  208. package/server/routes/mcp-utils.js +31 -31
  209. package/server/routes/messages.js +61 -61
  210. package/server/routes/network.js +120 -120
  211. package/server/routes/plugins.js +318 -318
  212. package/server/routes/projects.js +915 -915
  213. package/server/routes/qwen.js +27 -27
  214. package/server/routes/settings.js +286 -286
  215. package/server/routes/taskmaster.js +1496 -1471
  216. package/server/routes/telegram.js +125 -125
  217. package/server/routes/user.js +123 -123
  218. package/server/services/external-access.js +171 -171
  219. package/server/services/install-jobs.js +571 -571
  220. package/server/services/notification-orchestrator.js +242 -242
  221. package/server/services/provider-credentials.js +189 -189
  222. package/server/services/provider-models.js +381 -381
  223. package/server/services/telegram/bot.js +279 -279
  224. package/server/services/telegram/telegram-http-client.js +130 -130
  225. package/server/services/telegram/translations.js +170 -170
  226. package/server/services/vapid-keys.js +36 -36
  227. package/server/sessionManager.js +225 -225
  228. package/server/shared/interfaces.ts +54 -54
  229. package/server/shared/types.ts +172 -172
  230. package/server/shared/utils.ts +193 -193
  231. package/server/tsconfig.json +36 -36
  232. package/server/utils/colors.js +21 -21
  233. package/server/utils/commandParser.js +303 -303
  234. package/server/utils/frontmatter.js +18 -18
  235. package/server/utils/gitConfig.js +34 -34
  236. package/server/utils/mcp-detector.js +147 -147
  237. package/server/utils/plugin-loader.js +457 -457
  238. package/server/utils/plugin-process-manager.js +184 -184
  239. package/server/utils/port-access.js +209 -209
  240. package/server/utils/runtime-paths.js +37 -37
  241. package/server/utils/taskmaster-websocket.js +128 -128
  242. package/server/utils/url-detection.js +71 -71
  243. package/server/vite-daemon.js +78 -78
  244. package/shared/modelConstants.js +162 -162
  245. package/shared/networkHosts.js +22 -22
  246. package/dist/assets/index-B1ghfb4w.css +0 -32
  247. package/dist/assets/index-BvClqlMf.js +0 -852
@@ -15,6 +15,7 @@ import { spawn } from 'child_process';
15
15
  import { extractProjectDirectory } from '../projects.js';
16
16
  import { detectTaskMasterMCPServer } from '../utils/mcp-detector.js';
17
17
  import { broadcastTaskMasterProjectUpdate, broadcastTaskMasterTasksUpdate } from '../utils/taskmaster-websocket.js';
18
+ import { orchestrationTaskService } from '../modules/orchestration/tasks/orchestration-task.service.js';
18
19
  const router = express.Router();
19
20
  /**
20
21
  * Check if TaskMaster CLI is installed globally
@@ -82,6 +83,48 @@ async function checkTaskMasterInstallation() {
82
83
  });
83
84
  });
84
85
  }
86
+ async function readTaskMasterTasks(projectName) {
87
+ const projectPath = await extractProjectDirectory(projectName);
88
+ const tasksFilePath = path.join(projectPath, '.taskmaster', 'tasks', 'tasks.json');
89
+ await fsPromises.access(tasksFilePath);
90
+ const tasksContent = await fsPromises.readFile(tasksFilePath, 'utf8');
91
+ const tasksData = JSON.parse(tasksContent);
92
+ let tasks = [];
93
+ let currentTag = 'master';
94
+ if (Array.isArray(tasksData)) {
95
+ tasks = tasksData;
96
+ }
97
+ else if (tasksData.tasks) {
98
+ tasks = tasksData.tasks;
99
+ }
100
+ else if (tasksData[currentTag] && tasksData[currentTag].tasks) {
101
+ tasks = tasksData[currentTag].tasks;
102
+ }
103
+ else if (tasksData.master && tasksData.master.tasks) {
104
+ tasks = tasksData.master.tasks;
105
+ }
106
+ else {
107
+ const firstTag = Object.keys(tasksData).find((key) => tasksData[key].tasks && Array.isArray(tasksData[key].tasks));
108
+ if (firstTag) {
109
+ tasks = tasksData[firstTag].tasks;
110
+ currentTag = firstTag;
111
+ }
112
+ }
113
+ const transformedTasks = tasks.map((task) => ({
114
+ id: task.id,
115
+ title: task.title || 'Untitled Task',
116
+ description: task.description || '',
117
+ status: task.status || 'pending',
118
+ priority: task.priority || 'medium',
119
+ dependencies: task.dependencies || [],
120
+ createdAt: task.createdAt || task.created || new Date().toISOString(),
121
+ updatedAt: task.updatedAt || task.updated || new Date().toISOString(),
122
+ details: task.details || '',
123
+ testStrategy: task.testStrategy || task.test_strategy || '',
124
+ subtasks: task.subtasks || []
125
+ }));
126
+ return { projectPath, transformedTasks, currentTag };
127
+ }
85
128
  // API Routes
86
129
  /**
87
130
  * GET /api/taskmaster/installation-status
@@ -123,102 +166,38 @@ router.get('/installation-status', async (req, res) => {
123
166
  router.get('/tasks/:projectName', async (req, res) => {
124
167
  try {
125
168
  const { projectName } = req.params;
126
- // Get project path
127
- let projectPath;
128
- try {
129
- projectPath = await extractProjectDirectory(projectName);
130
- }
131
- catch (error) {
132
- return res.status(404).json({
133
- error: 'Project not found',
134
- message: `Project "${projectName}" does not exist`
135
- });
136
- }
137
- const taskMasterPath = path.join(projectPath, '.taskmaster');
138
- const tasksFilePath = path.join(taskMasterPath, 'tasks', 'tasks.json');
139
- // Check if tasks file exists
140
- try {
141
- await fsPromises.access(tasksFilePath);
142
- }
143
- catch (error) {
169
+ const { projectPath, transformedTasks, currentTag } = await readTaskMasterTasks(projectName);
170
+ res.json({
171
+ projectName,
172
+ projectPath,
173
+ tasks: transformedTasks,
174
+ currentTag,
175
+ totalTasks: transformedTasks.length,
176
+ tasksByStatus: {
177
+ pending: transformedTasks.filter(t => t.status === 'pending').length,
178
+ 'in-progress': transformedTasks.filter(t => t.status === 'in-progress').length,
179
+ done: transformedTasks.filter(t => t.status === 'done').length,
180
+ review: transformedTasks.filter(t => t.status === 'review').length,
181
+ deferred: transformedTasks.filter(t => t.status === 'deferred').length,
182
+ cancelled: transformedTasks.filter(t => t.status === 'cancelled').length
183
+ },
184
+ timestamp: new Date().toISOString()
185
+ });
186
+ }
187
+ catch (error) {
188
+ if (error?.code === 'ENOENT') {
144
189
  return res.json({
145
- projectName,
190
+ projectName: req.params.projectName,
146
191
  tasks: [],
147
192
  message: 'No tasks.json file found'
148
193
  });
149
194
  }
150
- // Read and parse tasks file
151
- try {
152
- const tasksContent = await fsPromises.readFile(tasksFilePath, 'utf8');
153
- const tasksData = JSON.parse(tasksContent);
154
- let tasks = [];
155
- let currentTag = 'master';
156
- // Handle both tagged and legacy formats
157
- if (Array.isArray(tasksData)) {
158
- // Legacy format
159
- tasks = tasksData;
160
- }
161
- else if (tasksData.tasks) {
162
- // Simple format with tasks array
163
- tasks = tasksData.tasks;
164
- }
165
- else {
166
- // Tagged format - get tasks from current tag or master
167
- if (tasksData[currentTag] && tasksData[currentTag].tasks) {
168
- tasks = tasksData[currentTag].tasks;
169
- }
170
- else if (tasksData.master && tasksData.master.tasks) {
171
- tasks = tasksData.master.tasks;
172
- }
173
- else {
174
- // Get tasks from first available tag
175
- const firstTag = Object.keys(tasksData).find(key => tasksData[key].tasks && Array.isArray(tasksData[key].tasks));
176
- if (firstTag) {
177
- tasks = tasksData[firstTag].tasks;
178
- currentTag = firstTag;
179
- }
180
- }
181
- }
182
- // Transform tasks to ensure all have required fields
183
- const transformedTasks = tasks.map(task => ({
184
- id: task.id,
185
- title: task.title || 'Untitled Task',
186
- description: task.description || '',
187
- status: task.status || 'pending',
188
- priority: task.priority || 'medium',
189
- dependencies: task.dependencies || [],
190
- createdAt: task.createdAt || task.created || new Date().toISOString(),
191
- updatedAt: task.updatedAt || task.updated || new Date().toISOString(),
192
- details: task.details || '',
193
- testStrategy: task.testStrategy || task.test_strategy || '',
194
- subtasks: task.subtasks || []
195
- }));
196
- res.json({
197
- projectName,
198
- projectPath,
199
- tasks: transformedTasks,
200
- currentTag,
201
- totalTasks: transformedTasks.length,
202
- tasksByStatus: {
203
- pending: transformedTasks.filter(t => t.status === 'pending').length,
204
- 'in-progress': transformedTasks.filter(t => t.status === 'in-progress').length,
205
- done: transformedTasks.filter(t => t.status === 'done').length,
206
- review: transformedTasks.filter(t => t.status === 'review').length,
207
- deferred: transformedTasks.filter(t => t.status === 'deferred').length,
208
- cancelled: transformedTasks.filter(t => t.status === 'cancelled').length
209
- },
210
- timestamp: new Date().toISOString()
211
- });
212
- }
213
- catch (parseError) {
214
- console.error('Failed to parse tasks.json:', parseError);
215
- return res.status(500).json({
216
- error: 'Failed to parse tasks file',
217
- message: parseError.message
195
+ if (String(error?.message || '').includes('does not exist')) {
196
+ return res.status(404).json({
197
+ error: 'Project not found',
198
+ message: `Project "${req.params.projectName}" does not exist`
218
199
  });
219
200
  }
220
- }
221
- catch (error) {
222
201
  console.error('TaskMaster tasks loading error:', error);
223
202
  res.status(500).json({
224
203
  error: 'Failed to load TaskMaster tasks',
@@ -226,6 +205,44 @@ router.get('/tasks/:projectName', async (req, res) => {
226
205
  });
227
206
  }
228
207
  });
208
+ /**
209
+ * POST /api/taskmaster/sync-orchestration/:projectName
210
+ * One-way sync: TaskMaster -> Orchestration tasks
211
+ */
212
+ router.post('/sync-orchestration/:projectName', async (req, res) => {
213
+ try {
214
+ const { projectName } = req.params;
215
+ const { transformedTasks } = await readTaskMasterTasks(projectName);
216
+ const projectId = typeof req.body?.projectId === 'string' && req.body.projectId.trim()
217
+ ? req.body.projectId.trim()
218
+ : projectName;
219
+ const syncedTasks = transformedTasks.map((task) => orchestrationTaskService.upsertFromTaskMaster({
220
+ projectId,
221
+ taskmasterId: String(task.id),
222
+ title: task.title,
223
+ description: task.description,
224
+ }));
225
+ res.json({
226
+ success: true,
227
+ projectName,
228
+ projectId,
229
+ synced: syncedTasks.length,
230
+ tasks: syncedTasks,
231
+ timestamp: new Date().toISOString(),
232
+ });
233
+ }
234
+ catch (error) {
235
+ if (error?.code === 'ENOENT') {
236
+ return res.json({ success: true, projectName: req.params.projectName, synced: 0, tasks: [] });
237
+ }
238
+ console.error('TaskMaster orchestration sync error:', error);
239
+ res.status(500).json({
240
+ success: false,
241
+ error: 'Failed to sync TaskMaster tasks to orchestration',
242
+ message: error.message,
243
+ });
244
+ }
245
+ });
229
246
  /**
230
247
  * GET /api/taskmaster/prd/:projectName
231
248
  * List all PRD files in the project's .taskmaster/docs directory
@@ -819,74 +836,74 @@ router.get('/prd-templates', async (req, res) => {
819
836
  name: 'Web Application',
820
837
  description: 'Template for web application projects with frontend and backend components',
821
838
  category: 'web',
822
- content: `# Product Requirements Document - Web Application
823
-
824
- ## Overview
825
- **Product Name:** [Your App Name]
826
- **Version:** 1.0
827
- **Date:** ${new Date().toISOString().split('T')[0]}
828
- **Author:** [Your Name]
829
-
830
- ## Executive Summary
831
- Brief description of what this web application will do and why it's needed.
832
-
833
- ## Product Goals
834
- - Goal 1: [Specific measurable goal]
835
- - Goal 2: [Specific measurable goal]
836
- - Goal 3: [Specific measurable goal]
837
-
838
- ## User Stories
839
- ### Core Features
840
- 1. **User Registration & Authentication**
841
- - As a user, I want to create an account so I can access personalized features
842
- - As a user, I want to log in securely so my data is protected
843
- - As a user, I want to reset my password if I forget it
844
-
845
- 2. **Main Application Features**
846
- - As a user, I want to [core feature 1] so I can [benefit]
847
- - As a user, I want to [core feature 2] so I can [benefit]
848
- - As a user, I want to [core feature 3] so I can [benefit]
849
-
850
- 3. **User Interface**
851
- - As a user, I want a responsive design so I can use the app on any device
852
- - As a user, I want intuitive navigation so I can easily find features
853
-
854
- ## Technical Requirements
855
- ### Frontend
856
- - Framework: React/Vue/Angular or vanilla JavaScript
857
- - Styling: CSS framework (Tailwind, Bootstrap, etc.)
858
- - State Management: Redux/Vuex/Context API
859
- - Build Tools: Webpack/Vite
860
- - Testing: Jest/Vitest for unit tests
861
-
862
- ### Backend
863
- - Runtime: Node.js/Python/Java
864
- - Database: PostgreSQL/MySQL/MongoDB
865
- - API: RESTful API or GraphQL
866
- - Authentication: JWT tokens
867
- - Testing: Integration and unit tests
868
-
869
- ### Infrastructure
870
- - Hosting: Cloud provider (AWS, Azure, GCP)
871
- - CI/CD: GitHub Actions/GitLab CI
872
- - Monitoring: Application monitoring tools
873
- - Security: HTTPS, input validation, rate limiting
874
-
875
- ## Success Metrics
876
- - User engagement metrics
877
- - Performance benchmarks (load time < 2s)
878
- - Error rates < 1%
879
- - User satisfaction scores
880
-
881
- ## Timeline
882
- - Phase 1: Core functionality (4-6 weeks)
883
- - Phase 2: Advanced features (2-4 weeks)
884
- - Phase 3: Polish and launch (2 weeks)
885
-
886
- ## Constraints & Assumptions
887
- - Budget constraints
888
- - Technical limitations
889
- - Team size and expertise
839
+ content: `# Product Requirements Document - Web Application
840
+
841
+ ## Overview
842
+ **Product Name:** [Your App Name]
843
+ **Version:** 1.0
844
+ **Date:** ${new Date().toISOString().split('T')[0]}
845
+ **Author:** [Your Name]
846
+
847
+ ## Executive Summary
848
+ Brief description of what this web application will do and why it's needed.
849
+
850
+ ## Product Goals
851
+ - Goal 1: [Specific measurable goal]
852
+ - Goal 2: [Specific measurable goal]
853
+ - Goal 3: [Specific measurable goal]
854
+
855
+ ## User Stories
856
+ ### Core Features
857
+ 1. **User Registration & Authentication**
858
+ - As a user, I want to create an account so I can access personalized features
859
+ - As a user, I want to log in securely so my data is protected
860
+ - As a user, I want to reset my password if I forget it
861
+
862
+ 2. **Main Application Features**
863
+ - As a user, I want to [core feature 1] so I can [benefit]
864
+ - As a user, I want to [core feature 2] so I can [benefit]
865
+ - As a user, I want to [core feature 3] so I can [benefit]
866
+
867
+ 3. **User Interface**
868
+ - As a user, I want a responsive design so I can use the app on any device
869
+ - As a user, I want intuitive navigation so I can easily find features
870
+
871
+ ## Technical Requirements
872
+ ### Frontend
873
+ - Framework: React/Vue/Angular or vanilla JavaScript
874
+ - Styling: CSS framework (Tailwind, Bootstrap, etc.)
875
+ - State Management: Redux/Vuex/Context API
876
+ - Build Tools: Webpack/Vite
877
+ - Testing: Jest/Vitest for unit tests
878
+
879
+ ### Backend
880
+ - Runtime: Node.js/Python/Java
881
+ - Database: PostgreSQL/MySQL/MongoDB
882
+ - API: RESTful API or GraphQL
883
+ - Authentication: JWT tokens
884
+ - Testing: Integration and unit tests
885
+
886
+ ### Infrastructure
887
+ - Hosting: Cloud provider (AWS, Azure, GCP)
888
+ - CI/CD: GitHub Actions/GitLab CI
889
+ - Monitoring: Application monitoring tools
890
+ - Security: HTTPS, input validation, rate limiting
891
+
892
+ ## Success Metrics
893
+ - User engagement metrics
894
+ - Performance benchmarks (load time < 2s)
895
+ - Error rates < 1%
896
+ - User satisfaction scores
897
+
898
+ ## Timeline
899
+ - Phase 1: Core functionality (4-6 weeks)
900
+ - Phase 2: Advanced features (2-4 weeks)
901
+ - Phase 3: Polish and launch (2 weeks)
902
+
903
+ ## Constraints & Assumptions
904
+ - Budget constraints
905
+ - Technical limitations
906
+ - Team size and expertise
890
907
  - Timeline constraints`
891
908
  },
892
909
  {
@@ -894,102 +911,102 @@ Brief description of what this web application will do and why it's needed.
894
911
  name: 'REST API',
895
912
  description: 'Template for REST API development projects',
896
913
  category: 'backend',
897
- content: `# Product Requirements Document - REST API
898
-
899
- ## Overview
900
- **API Name:** [Your API Name]
901
- **Version:** v1.0
902
- **Date:** ${new Date().toISOString().split('T')[0]}
903
- **Author:** [Your Name]
904
-
905
- ## Executive Summary
906
- Description of the API's purpose, target users, and primary use cases.
907
-
908
- ## API Goals
909
- - Goal 1: Provide secure data access
910
- - Goal 2: Ensure scalable architecture
911
- - Goal 3: Maintain high availability (99.9% uptime)
912
-
913
- ## Functional Requirements
914
- ### Core Endpoints
915
- 1. **Authentication Endpoints**
916
- - POST /api/auth/login - User authentication
917
- - POST /api/auth/logout - User logout
918
- - POST /api/auth/refresh - Token refresh
919
- - POST /api/auth/register - User registration
920
-
921
- 2. **Data Management Endpoints**
922
- - GET /api/resources - List resources with pagination
923
- - GET /api/resources/{id} - Get specific resource
924
- - POST /api/resources - Create new resource
925
- - PUT /api/resources/{id} - Update existing resource
926
- - DELETE /api/resources/{id} - Delete resource
927
-
928
- 3. **Administrative Endpoints**
929
- - GET /api/admin/users - Manage users (admin only)
930
- - GET /api/admin/analytics - System analytics
931
- - POST /api/admin/backup - Trigger system backup
932
-
933
- ## Technical Requirements
934
- ### API Design
935
- - RESTful architecture following OpenAPI 3.0 specification
936
- - JSON request/response format
937
- - Consistent error response format
938
- - API versioning strategy
939
-
940
- ### Authentication & Security
941
- - JWT token-based authentication
942
- - Role-based access control (RBAC)
943
- - Rate limiting (100 requests/minute per user)
944
- - Input validation and sanitization
945
- - HTTPS enforcement
946
-
947
- ### Database
948
- - Database type: [PostgreSQL/MongoDB/MySQL]
949
- - Connection pooling
950
- - Database migrations
951
- - Backup and recovery procedures
952
-
953
- ### Performance Requirements
954
- - Response time: < 200ms for 95% of requests
955
- - Throughput: 1000+ requests/second
956
- - Concurrent users: 10,000+
957
- - Database query optimization
958
-
959
- ### Documentation
960
- - Auto-generated API documentation (Swagger/OpenAPI)
961
- - Code examples for common use cases
962
- - SDK development for major languages
963
- - Postman collection for testing
964
-
965
- ## Error Handling
966
- - Standardized error codes and messages
967
- - Proper HTTP status codes
968
- - Detailed error logging
969
- - Graceful degradation strategies
970
-
971
- ## Testing Strategy
972
- - Unit tests (80%+ coverage)
973
- - Integration tests for all endpoints
974
- - Load testing and performance testing
975
- - Security testing (OWASP compliance)
976
-
977
- ## Monitoring & Logging
978
- - Application performance monitoring
979
- - Error tracking and alerting
980
- - Access logs and audit trails
981
- - Health check endpoints
982
-
983
- ## Deployment
984
- - Containerized deployment (Docker)
985
- - CI/CD pipeline setup
986
- - Environment management (dev, staging, prod)
987
- - Blue-green deployment strategy
988
-
989
- ## Success Metrics
990
- - API uptime > 99.9%
991
- - Average response time < 200ms
992
- - Zero critical security vulnerabilities
914
+ content: `# Product Requirements Document - REST API
915
+
916
+ ## Overview
917
+ **API Name:** [Your API Name]
918
+ **Version:** v1.0
919
+ **Date:** ${new Date().toISOString().split('T')[0]}
920
+ **Author:** [Your Name]
921
+
922
+ ## Executive Summary
923
+ Description of the API's purpose, target users, and primary use cases.
924
+
925
+ ## API Goals
926
+ - Goal 1: Provide secure data access
927
+ - Goal 2: Ensure scalable architecture
928
+ - Goal 3: Maintain high availability (99.9% uptime)
929
+
930
+ ## Functional Requirements
931
+ ### Core Endpoints
932
+ 1. **Authentication Endpoints**
933
+ - POST /api/auth/login - User authentication
934
+ - POST /api/auth/logout - User logout
935
+ - POST /api/auth/refresh - Token refresh
936
+ - POST /api/auth/register - User registration
937
+
938
+ 2. **Data Management Endpoints**
939
+ - GET /api/resources - List resources with pagination
940
+ - GET /api/resources/{id} - Get specific resource
941
+ - POST /api/resources - Create new resource
942
+ - PUT /api/resources/{id} - Update existing resource
943
+ - DELETE /api/resources/{id} - Delete resource
944
+
945
+ 3. **Administrative Endpoints**
946
+ - GET /api/admin/users - Manage users (admin only)
947
+ - GET /api/admin/analytics - System analytics
948
+ - POST /api/admin/backup - Trigger system backup
949
+
950
+ ## Technical Requirements
951
+ ### API Design
952
+ - RESTful architecture following OpenAPI 3.0 specification
953
+ - JSON request/response format
954
+ - Consistent error response format
955
+ - API versioning strategy
956
+
957
+ ### Authentication & Security
958
+ - JWT token-based authentication
959
+ - Role-based access control (RBAC)
960
+ - Rate limiting (100 requests/minute per user)
961
+ - Input validation and sanitization
962
+ - HTTPS enforcement
963
+
964
+ ### Database
965
+ - Database type: [PostgreSQL/MongoDB/MySQL]
966
+ - Connection pooling
967
+ - Database migrations
968
+ - Backup and recovery procedures
969
+
970
+ ### Performance Requirements
971
+ - Response time: < 200ms for 95% of requests
972
+ - Throughput: 1000+ requests/second
973
+ - Concurrent users: 10,000+
974
+ - Database query optimization
975
+
976
+ ### Documentation
977
+ - Auto-generated API documentation (Swagger/OpenAPI)
978
+ - Code examples for common use cases
979
+ - SDK development for major languages
980
+ - Postman collection for testing
981
+
982
+ ## Error Handling
983
+ - Standardized error codes and messages
984
+ - Proper HTTP status codes
985
+ - Detailed error logging
986
+ - Graceful degradation strategies
987
+
988
+ ## Testing Strategy
989
+ - Unit tests (80%+ coverage)
990
+ - Integration tests for all endpoints
991
+ - Load testing and performance testing
992
+ - Security testing (OWASP compliance)
993
+
994
+ ## Monitoring & Logging
995
+ - Application performance monitoring
996
+ - Error tracking and alerting
997
+ - Access logs and audit trails
998
+ - Health check endpoints
999
+
1000
+ ## Deployment
1001
+ - Containerized deployment (Docker)
1002
+ - CI/CD pipeline setup
1003
+ - Environment management (dev, staging, prod)
1004
+ - Blue-green deployment strategy
1005
+
1006
+ ## Success Metrics
1007
+ - API uptime > 99.9%
1008
+ - Average response time < 200ms
1009
+ - Zero critical security vulnerabilities
993
1010
  - Developer adoption metrics`
994
1011
  },
995
1012
  {
@@ -997,115 +1014,115 @@ Description of the API's purpose, target users, and primary use cases.
997
1014
  name: 'Mobile Application',
998
1015
  description: 'Template for mobile app development projects (iOS/Android)',
999
1016
  category: 'mobile',
1000
- content: `# Product Requirements Document - Mobile Application
1001
-
1002
- ## Overview
1003
- **App Name:** [Your App Name]
1004
- **Platform:** iOS / Android / Cross-platform
1005
- **Version:** 1.0
1006
- **Date:** ${new Date().toISOString().split('T')[0]}
1007
- **Author:** [Your Name]
1008
-
1009
- ## Executive Summary
1010
- Brief description of the mobile app's purpose, target audience, and key value proposition.
1011
-
1012
- ## Product Goals
1013
- - Goal 1: [Specific user engagement goal]
1014
- - Goal 2: [Specific functionality goal]
1015
- - Goal 3: [Specific performance goal]
1016
-
1017
- ## User Stories
1018
- ### Core Features
1019
- 1. **Onboarding & Authentication**
1020
- - As a new user, I want a simple onboarding process
1021
- - As a user, I want to sign up with email or social media
1022
- - As a user, I want biometric authentication for security
1023
-
1024
- 2. **Main App Features**
1025
- - As a user, I want [core feature 1] accessible from home screen
1026
- - As a user, I want [core feature 2] to work offline
1027
- - As a user, I want to sync data across devices
1028
-
1029
- 3. **User Experience**
1030
- - As a user, I want intuitive navigation patterns
1031
- - As a user, I want fast loading times
1032
- - As a user, I want accessibility features
1033
-
1034
- ## Technical Requirements
1035
- ### Mobile Development
1036
- - **Cross-platform:** React Native / Flutter / Xamarin
1037
- - **Native:** Swift (iOS) / Kotlin (Android)
1038
- - **State Management:** Redux / MobX / Provider
1039
- - **Navigation:** React Navigation / Flutter Navigation
1040
-
1041
- ### Backend Integration
1042
- - REST API or GraphQL integration
1043
- - Real-time features (WebSockets/Push notifications)
1044
- - Offline data synchronization
1045
- - Background processing
1046
-
1047
- ### Device Features
1048
- - Camera and photo library access
1049
- - GPS location services
1050
- - Push notifications
1051
- - Biometric authentication
1052
- - Device storage
1053
-
1054
- ### Performance Requirements
1055
- - App launch time < 3 seconds
1056
- - Screen transition animations < 300ms
1057
- - Memory usage optimization
1058
- - Battery usage optimization
1059
-
1060
- ## Platform-Specific Considerations
1061
- ### iOS Requirements
1062
- - iOS 13.0+ minimum version
1063
- - App Store guidelines compliance
1064
- - iOS design guidelines (Human Interface Guidelines)
1065
- - TestFlight beta testing
1066
-
1067
- ### Android Requirements
1068
- - Android 8.0+ (API level 26) minimum
1069
- - Google Play Store guidelines
1070
- - Material Design guidelines
1071
- - Google Play Console testing
1072
-
1073
- ## User Interface Design
1074
- - Responsive design for different screen sizes
1075
- - Dark mode support
1076
- - Accessibility compliance (WCAG 2.1)
1077
- - Consistent design system
1078
-
1079
- ## Security & Privacy
1080
- - Secure data storage (Keychain/Keystore)
1081
- - API communication encryption
1082
- - Privacy policy compliance (GDPR/CCPA)
1083
- - App security best practices
1084
-
1085
- ## Testing Strategy
1086
- - Unit testing (80%+ coverage)
1087
- - UI/E2E testing (Detox/Appium)
1088
- - Device testing on multiple screen sizes
1089
- - Performance testing
1090
- - Security testing
1091
-
1092
- ## App Store Deployment
1093
- - App store optimization (ASO)
1094
- - App icons and screenshots
1095
- - Store listing content
1096
- - Release management strategy
1097
-
1098
- ## Analytics & Monitoring
1099
- - User analytics (Firebase/Analytics)
1100
- - Crash reporting (Crashlytics/Sentry)
1101
- - Performance monitoring
1102
- - User feedback collection
1103
-
1104
- ## Success Metrics
1105
- - App store ratings > 4.0
1106
- - User retention rates
1107
- - Daily/Monthly active users
1108
- - App performance metrics
1017
+ content: `# Product Requirements Document - Mobile Application
1018
+
1019
+ ## Overview
1020
+ **App Name:** [Your App Name]
1021
+ **Platform:** iOS / Android / Cross-platform
1022
+ **Version:** 1.0
1023
+ **Date:** ${new Date().toISOString().split('T')[0]}
1024
+ **Author:** [Your Name]
1025
+
1026
+ ## Executive Summary
1027
+ Brief description of the mobile app's purpose, target audience, and key value proposition.
1028
+
1029
+ ## Product Goals
1030
+ - Goal 1: [Specific user engagement goal]
1031
+ - Goal 2: [Specific functionality goal]
1032
+ - Goal 3: [Specific performance goal]
1033
+
1034
+ ## User Stories
1035
+ ### Core Features
1036
+ 1. **Onboarding & Authentication**
1037
+ - As a new user, I want a simple onboarding process
1038
+ - As a user, I want to sign up with email or social media
1039
+ - As a user, I want biometric authentication for security
1040
+
1041
+ 2. **Main App Features**
1042
+ - As a user, I want [core feature 1] accessible from home screen
1043
+ - As a user, I want [core feature 2] to work offline
1044
+ - As a user, I want to sync data across devices
1045
+
1046
+ 3. **User Experience**
1047
+ - As a user, I want intuitive navigation patterns
1048
+ - As a user, I want fast loading times
1049
+ - As a user, I want accessibility features
1050
+
1051
+ ## Technical Requirements
1052
+ ### Mobile Development
1053
+ - **Cross-platform:** React Native / Flutter / Xamarin
1054
+ - **Native:** Swift (iOS) / Kotlin (Android)
1055
+ - **State Management:** Redux / MobX / Provider
1056
+ - **Navigation:** React Navigation / Flutter Navigation
1057
+
1058
+ ### Backend Integration
1059
+ - REST API or GraphQL integration
1060
+ - Real-time features (WebSockets/Push notifications)
1061
+ - Offline data synchronization
1062
+ - Background processing
1063
+
1064
+ ### Device Features
1065
+ - Camera and photo library access
1066
+ - GPS location services
1067
+ - Push notifications
1068
+ - Biometric authentication
1069
+ - Device storage
1070
+
1071
+ ### Performance Requirements
1072
+ - App launch time < 3 seconds
1073
+ - Screen transition animations < 300ms
1074
+ - Memory usage optimization
1075
+ - Battery usage optimization
1076
+
1077
+ ## Platform-Specific Considerations
1078
+ ### iOS Requirements
1079
+ - iOS 13.0+ minimum version
1080
+ - App Store guidelines compliance
1081
+ - iOS design guidelines (Human Interface Guidelines)
1082
+ - TestFlight beta testing
1083
+
1084
+ ### Android Requirements
1085
+ - Android 8.0+ (API level 26) minimum
1086
+ - Google Play Store guidelines
1087
+ - Material Design guidelines
1088
+ - Google Play Console testing
1089
+
1090
+ ## User Interface Design
1091
+ - Responsive design for different screen sizes
1092
+ - Dark mode support
1093
+ - Accessibility compliance (WCAG 2.1)
1094
+ - Consistent design system
1095
+
1096
+ ## Security & Privacy
1097
+ - Secure data storage (Keychain/Keystore)
1098
+ - API communication encryption
1099
+ - Privacy policy compliance (GDPR/CCPA)
1100
+ - App security best practices
1101
+
1102
+ ## Testing Strategy
1103
+ - Unit testing (80%+ coverage)
1104
+ - UI/E2E testing (Detox/Appium)
1105
+ - Device testing on multiple screen sizes
1106
+ - Performance testing
1107
+ - Security testing
1108
+
1109
+ ## App Store Deployment
1110
+ - App store optimization (ASO)
1111
+ - App icons and screenshots
1112
+ - Store listing content
1113
+ - Release management strategy
1114
+
1115
+ ## Analytics & Monitoring
1116
+ - User analytics (Firebase/Analytics)
1117
+ - Crash reporting (Crashlytics/Sentry)
1118
+ - Performance monitoring
1119
+ - User feedback collection
1120
+
1121
+ ## Success Metrics
1122
+ - App store ratings > 4.0
1123
+ - User retention rates
1124
+ - Daily/Monthly active users
1125
+ - App performance metrics
1109
1126
  - Conversion rates`
1110
1127
  },
1111
1128
  {
@@ -1113,127 +1130,127 @@ Brief description of the mobile app's purpose, target audience, and key value pr
1113
1130
  name: 'Data Analysis Project',
1114
1131
  description: 'Template for data analysis and visualization projects',
1115
1132
  category: 'data',
1116
- content: `# Product Requirements Document - Data Analysis Project
1117
-
1118
- ## Overview
1119
- **Project Name:** [Your Analysis Project]
1120
- **Analysis Type:** [Descriptive/Predictive/Prescriptive]
1121
- **Date:** ${new Date().toISOString().split('T')[0]}
1122
- **Author:** [Your Name]
1123
-
1124
- ## Executive Summary
1125
- Description of the business problem, data sources, and expected insights.
1126
-
1127
- ## Project Goals
1128
- - Goal 1: [Specific business question to answer]
1129
- - Goal 2: [Specific prediction to make]
1130
- - Goal 3: [Specific recommendation to provide]
1131
-
1132
- ## Business Requirements
1133
- ### Key Questions
1134
- 1. What patterns exist in the current data?
1135
- 2. What factors influence [target variable]?
1136
- 3. What predictions can be made for [future outcome]?
1137
- 4. What recommendations can improve [business metric]?
1138
-
1139
- ### Success Criteria
1140
- - Actionable insights for stakeholders
1141
- - Statistical significance in findings
1142
- - Reproducible analysis pipeline
1143
- - Clear visualization and reporting
1144
-
1145
- ## Data Requirements
1146
- ### Data Sources
1147
- 1. **Primary Data**
1148
- - Source: [Database/API/Files]
1149
- - Format: [CSV/JSON/SQL]
1150
- - Size: [Volume estimate]
1151
- - Update frequency: [Real-time/Daily/Monthly]
1152
-
1153
- 2. **External Data**
1154
- - Third-party APIs
1155
- - Public datasets
1156
- - Market research data
1157
-
1158
- ### Data Quality Requirements
1159
- - Data completeness (< 5% missing values)
1160
- - Data accuracy validation
1161
- - Data consistency checks
1162
- - Historical data availability
1163
-
1164
- ## Technical Requirements
1165
- ### Data Pipeline
1166
- - Data extraction and ingestion
1167
- - Data cleaning and preprocessing
1168
- - Data transformation and feature engineering
1169
- - Data validation and quality checks
1170
-
1171
- ### Analysis Tools
1172
- - **Programming:** Python/R/SQL
1173
- - **Libraries:** pandas, numpy, scikit-learn, matplotlib
1174
- - **Visualization:** Tableau, PowerBI, or custom dashboards
1175
- - **Version Control:** Git for code and DVC for data
1176
-
1177
- ### Computing Resources
1178
- - Local development environment
1179
- - Cloud computing (AWS/GCP/Azure) if needed
1180
- - Database access and permissions
1181
- - Storage requirements
1182
-
1183
- ## Analysis Methodology
1184
- ### Data Exploration
1185
- 1. Descriptive statistics and data profiling
1186
- 2. Data visualization and pattern identification
1187
- 3. Correlation analysis
1188
- 4. Outlier detection and handling
1189
-
1190
- ### Statistical Analysis
1191
- 1. Hypothesis formulation
1192
- 2. Statistical testing
1193
- 3. Confidence intervals
1194
- 4. Effect size calculations
1195
-
1196
- ### Machine Learning (if applicable)
1197
- 1. Feature selection and engineering
1198
- 2. Model selection and training
1199
- 3. Cross-validation and evaluation
1200
- 4. Model interpretation and explainability
1201
-
1202
- ## Deliverables
1203
- ### Reports
1204
- - Executive summary for stakeholders
1205
- - Technical analysis report
1206
- - Data quality report
1207
- - Methodology documentation
1208
-
1209
- ### Visualizations
1210
- - Interactive dashboards
1211
- - Static charts and graphs
1212
- - Data story presentations
1213
- - Key findings infographics
1214
-
1215
- ### Code & Documentation
1216
- - Reproducible analysis scripts
1217
- - Data pipeline code
1218
- - Documentation and comments
1219
- - Testing and validation code
1220
-
1221
- ## Timeline
1222
- - Phase 1: Data collection and exploration (2 weeks)
1223
- - Phase 2: Analysis and modeling (3 weeks)
1224
- - Phase 3: Reporting and visualization (1 week)
1225
- - Phase 4: Stakeholder presentation (1 week)
1226
-
1227
- ## Risks & Assumptions
1228
- - Data availability and quality risks
1229
- - Technical complexity assumptions
1230
- - Resource and timeline constraints
1231
- - Stakeholder engagement assumptions
1232
-
1233
- ## Success Metrics
1234
- - Stakeholder satisfaction with insights
1235
- - Accuracy of predictions (if applicable)
1236
- - Business impact of recommendations
1133
+ content: `# Product Requirements Document - Data Analysis Project
1134
+
1135
+ ## Overview
1136
+ **Project Name:** [Your Analysis Project]
1137
+ **Analysis Type:** [Descriptive/Predictive/Prescriptive]
1138
+ **Date:** ${new Date().toISOString().split('T')[0]}
1139
+ **Author:** [Your Name]
1140
+
1141
+ ## Executive Summary
1142
+ Description of the business problem, data sources, and expected insights.
1143
+
1144
+ ## Project Goals
1145
+ - Goal 1: [Specific business question to answer]
1146
+ - Goal 2: [Specific prediction to make]
1147
+ - Goal 3: [Specific recommendation to provide]
1148
+
1149
+ ## Business Requirements
1150
+ ### Key Questions
1151
+ 1. What patterns exist in the current data?
1152
+ 2. What factors influence [target variable]?
1153
+ 3. What predictions can be made for [future outcome]?
1154
+ 4. What recommendations can improve [business metric]?
1155
+
1156
+ ### Success Criteria
1157
+ - Actionable insights for stakeholders
1158
+ - Statistical significance in findings
1159
+ - Reproducible analysis pipeline
1160
+ - Clear visualization and reporting
1161
+
1162
+ ## Data Requirements
1163
+ ### Data Sources
1164
+ 1. **Primary Data**
1165
+ - Source: [Database/API/Files]
1166
+ - Format: [CSV/JSON/SQL]
1167
+ - Size: [Volume estimate]
1168
+ - Update frequency: [Real-time/Daily/Monthly]
1169
+
1170
+ 2. **External Data**
1171
+ - Third-party APIs
1172
+ - Public datasets
1173
+ - Market research data
1174
+
1175
+ ### Data Quality Requirements
1176
+ - Data completeness (< 5% missing values)
1177
+ - Data accuracy validation
1178
+ - Data consistency checks
1179
+ - Historical data availability
1180
+
1181
+ ## Technical Requirements
1182
+ ### Data Pipeline
1183
+ - Data extraction and ingestion
1184
+ - Data cleaning and preprocessing
1185
+ - Data transformation and feature engineering
1186
+ - Data validation and quality checks
1187
+
1188
+ ### Analysis Tools
1189
+ - **Programming:** Python/R/SQL
1190
+ - **Libraries:** pandas, numpy, scikit-learn, matplotlib
1191
+ - **Visualization:** Tableau, PowerBI, or custom dashboards
1192
+ - **Version Control:** Git for code and DVC for data
1193
+
1194
+ ### Computing Resources
1195
+ - Local development environment
1196
+ - Cloud computing (AWS/GCP/Azure) if needed
1197
+ - Database access and permissions
1198
+ - Storage requirements
1199
+
1200
+ ## Analysis Methodology
1201
+ ### Data Exploration
1202
+ 1. Descriptive statistics and data profiling
1203
+ 2. Data visualization and pattern identification
1204
+ 3. Correlation analysis
1205
+ 4. Outlier detection and handling
1206
+
1207
+ ### Statistical Analysis
1208
+ 1. Hypothesis formulation
1209
+ 2. Statistical testing
1210
+ 3. Confidence intervals
1211
+ 4. Effect size calculations
1212
+
1213
+ ### Machine Learning (if applicable)
1214
+ 1. Feature selection and engineering
1215
+ 2. Model selection and training
1216
+ 3. Cross-validation and evaluation
1217
+ 4. Model interpretation and explainability
1218
+
1219
+ ## Deliverables
1220
+ ### Reports
1221
+ - Executive summary for stakeholders
1222
+ - Technical analysis report
1223
+ - Data quality report
1224
+ - Methodology documentation
1225
+
1226
+ ### Visualizations
1227
+ - Interactive dashboards
1228
+ - Static charts and graphs
1229
+ - Data story presentations
1230
+ - Key findings infographics
1231
+
1232
+ ### Code & Documentation
1233
+ - Reproducible analysis scripts
1234
+ - Data pipeline code
1235
+ - Documentation and comments
1236
+ - Testing and validation code
1237
+
1238
+ ## Timeline
1239
+ - Phase 1: Data collection and exploration (2 weeks)
1240
+ - Phase 2: Analysis and modeling (3 weeks)
1241
+ - Phase 3: Reporting and visualization (1 week)
1242
+ - Phase 4: Stakeholder presentation (1 week)
1243
+
1244
+ ## Risks & Assumptions
1245
+ - Data availability and quality risks
1246
+ - Technical complexity assumptions
1247
+ - Resource and timeline constraints
1248
+ - Stakeholder engagement assumptions
1249
+
1250
+ ## Success Metrics
1251
+ - Stakeholder satisfaction with insights
1252
+ - Accuracy of predictions (if applicable)
1253
+ - Business impact of recommendations
1237
1254
  - Reproducibility of results`
1238
1255
  }
1239
1256
  ];
@@ -1339,31 +1356,31 @@ async function getAvailableTemplates() {
1339
1356
  name: 'Web Application',
1340
1357
  description: 'Template for web application projects',
1341
1358
  category: 'web',
1342
- content: `# Product Requirements Document - Web Application
1343
-
1344
- ## Overview
1345
- **Product Name:** [Your App Name]
1346
- **Version:** 1.0
1347
- **Date:** ${new Date().toISOString().split('T')[0]}
1348
- **Author:** [Your Name]
1349
-
1350
- ## Executive Summary
1351
- Brief description of what this web application will do and why it's needed.
1352
-
1353
- ## User Stories
1354
- 1. As a user, I want [feature] so I can [benefit]
1355
- 2. As a user, I want [feature] so I can [benefit]
1356
- 3. As a user, I want [feature] so I can [benefit]
1357
-
1358
- ## Technical Requirements
1359
- - Frontend framework
1360
- - Backend services
1361
- - Database requirements
1362
- - Security considerations
1363
-
1364
- ## Success Metrics
1365
- - User engagement metrics
1366
- - Performance benchmarks
1359
+ content: `# Product Requirements Document - Web Application
1360
+
1361
+ ## Overview
1362
+ **Product Name:** [Your App Name]
1363
+ **Version:** 1.0
1364
+ **Date:** ${new Date().toISOString().split('T')[0]}
1365
+ **Author:** [Your Name]
1366
+
1367
+ ## Executive Summary
1368
+ Brief description of what this web application will do and why it's needed.
1369
+
1370
+ ## User Stories
1371
+ 1. As a user, I want [feature] so I can [benefit]
1372
+ 2. As a user, I want [feature] so I can [benefit]
1373
+ 3. As a user, I want [feature] so I can [benefit]
1374
+
1375
+ ## Technical Requirements
1376
+ - Frontend framework
1377
+ - Backend services
1378
+ - Database requirements
1379
+ - Security considerations
1380
+
1381
+ ## Success Metrics
1382
+ - User engagement metrics
1383
+ - Performance benchmarks
1367
1384
  - Business objectives`
1368
1385
  },
1369
1386
  // Add other templates here if needed