mcp-task-server 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,441 @@
1
+ /**
2
+ * Template files for init_project tool
3
+ *
4
+ * All templates use <project> as a placeholder for the project name.
5
+ */
6
+ /**
7
+ * Get all template files with placeholders replaced
8
+ */
9
+ export function getTemplateFiles(projectName) {
10
+ return [
11
+ // agent-kit files
12
+ {
13
+ path: "agent-kit/AGENT_RULES.md",
14
+ content: AGENT_RULES_TEMPLATE,
15
+ },
16
+ {
17
+ path: "agent-kit/TASKS.md",
18
+ content: TASKS_TEMPLATE,
19
+ },
20
+ {
21
+ path: "agent-kit/HANDOFF.md",
22
+ content: HANDOFF_TEMPLATE,
23
+ },
24
+ {
25
+ path: "agent-kit/SHARED_CONTEXT.md",
26
+ content: SHARED_CONTEXT_TEMPLATE,
27
+ },
28
+ // memory_bank/context files
29
+ {
30
+ path: "memory_bank/context/brief.md",
31
+ content: BRIEF_TEMPLATE.replace(/<project>/g, projectName),
32
+ },
33
+ {
34
+ path: "memory_bank/context/active.md",
35
+ content: ACTIVE_TEMPLATE.replace(/<project>/g, projectName),
36
+ },
37
+ // memory_bank/execution files
38
+ {
39
+ path: "memory_bank/execution/progress.md",
40
+ content: PROGRESS_TEMPLATE.replace(/<project>/g, projectName),
41
+ },
42
+ {
43
+ path: "memory_bank/execution/decisions.md",
44
+ content: DECISIONS_TEMPLATE.replace(/<project>/g, projectName),
45
+ },
46
+ // .cursor/rules file
47
+ {
48
+ path: ".cursor/rules/agent-workflow.mdc",
49
+ content: CURSOR_RULES_TEMPLATE,
50
+ },
51
+ ];
52
+ }
53
+ // =============================================================================
54
+ // agent-kit templates
55
+ // =============================================================================
56
+ const AGENT_RULES_TEMPLATE = `# Agent Rules
57
+
58
+ Read this file before making any changes.
59
+
60
+ ## Required Files
61
+
62
+ - README.md
63
+ - memory_bank/context/brief.md
64
+ - memory_bank/context/active.md
65
+ - memory_bank/execution/progress.md
66
+ - memory_bank/execution/decisions.md
67
+
68
+ ## Guardrails
69
+
70
+ - Assumptions → Request → Safeguards
71
+ - One change → one run
72
+ - Keep the model locked (no Auto)
73
+ - Prefer small, reversible steps
74
+
75
+ ## Roles
76
+
77
+ ### Planner
78
+
79
+ - Explore the repo and memory_bank/context/*.md
80
+ - Add tasks via \`add_task\` tool or update memory_bank/execution/progress.md
81
+ - Break down large tasks with \`expand_task\` or manually
82
+ - Do not implement code unless explicitly requested
83
+
84
+ **MCP Tool Permissions:**
85
+ - ✅ add_task, expand_task, parse_prd, set_dependencies, analyze_complexity
86
+ - ❌ claim_task, complete_task
87
+
88
+ ### Worker
89
+
90
+ - Pick one task from memory_bank/execution/progress.md
91
+ - Implement only that task
92
+ - Update memory_bank/execution/progress.md with status and notes
93
+ - Avoid new architecture decisions; log them in decisions.md
94
+
95
+ **MCP Tool Permissions:**
96
+ - ✅ claim_task, update_task, complete_task, add_subtask, research_task
97
+ - ✅ release_task, handoff_task
98
+ - ❌ add_task, approve_task
99
+
100
+ ### Judge
101
+
102
+ - Review diffs and memory_bank/execution/progress.md
103
+ - Verify acceptance criteria and tests
104
+ - Decide: accept, request fixes, or re-plan
105
+
106
+ **MCP Tool Permissions:**
107
+ - ✅ review_task, approve_task, reject_task
108
+ - ❌ claim_task, update_task
109
+
110
+ ## Update Cadence
111
+
112
+ - After each task, update memory_bank/execution/progress.md
113
+ - If a decision is made, update memory_bank/execution/decisions.md
114
+
115
+ ## Coordination Rules
116
+
117
+ - One active task per worker
118
+ - Do not modify tasks owned by another worker
119
+ - If blocked, mark the task as blocked and explain why
120
+
121
+ ## Kickoff Prompts
122
+
123
+ **Planner:**
124
+ "Read AGENT_RULES.md, README.md, and memory_bank/context/*.md. Scan the repo and update memory_bank/execution/progress.md with 5 to 10 concrete tasks. Each task must include scope, target files, and acceptance criteria."
125
+
126
+ **Worker:**
127
+ "Read AGENT_RULES.md, README.md, and memory_bank/context/active.md. Pick one task from memory_bank/execution/progress.md, implement it fully, then update progress.md with a concise summary."
128
+
129
+ **Judge:**
130
+ "Read AGENT_RULES.md and memory_bank/execution/progress.md. Review the latest changes and verify acceptance criteria. If issues exist, write fixes in progress.md or add follow-up tasks."
131
+ `;
132
+ const TASKS_TEMPLATE = `# Tasks Reference
133
+
134
+ Do not track tasks here.
135
+ Use memory_bank/execution/progress.md for high-level task tracking.
136
+ Detailed tasks are stored in memory_bank/tasks/task_XXX.txt files.
137
+
138
+ ## Required Reading
139
+
140
+ - README.md
141
+ - memory_bank/context/brief.md
142
+ - memory_bank/context/active.md
143
+ - memory_bank/execution/progress.md
144
+ `;
145
+ const HANDOFF_TEMPLATE = `# Handoff Reference
146
+
147
+ Do not write handoffs here.
148
+ Use memory_bank/execution/progress.md for status updates and
149
+ memory_bank/execution/decisions.md for architectural decisions.
150
+
151
+ ## Handoff Protocol
152
+
153
+ 1. Worker completes task and calls \`handoff_task\` to Judge
154
+ 2. Task status changes to "review"
155
+ 3. Judge reviews and calls \`approve_task\` or \`reject_task\`
156
+ 4. Rejected tasks return to Worker with feedback
157
+ 5. Approved tasks are marked "completed"
158
+ `;
159
+ const SHARED_CONTEXT_TEMPLATE = `# Shared Context
160
+
161
+ MCP servers are isolated processes with no access to Cursor's memory system.
162
+ The shared context file bridges this gap.
163
+
164
+ ## File Location
165
+
166
+ \`\`\`
167
+ ~/.cursor/shared-context.json
168
+ \`\`\`
169
+
170
+ ## File Format
171
+
172
+ \`\`\`json
173
+ {
174
+ "cursor_memories": [
175
+ {
176
+ "id": "unique-id",
177
+ "title": "Memory title",
178
+ "content": "Memory content..."
179
+ }
180
+ ]
181
+ }
182
+ \`\`\`
183
+
184
+ ## Recognised Memory Titles
185
+
186
+ | Title Contains | Used For |
187
+ |----------------|----------|
188
+ | identity or values | User context in prompts |
189
+ | writing preferences | Formatting and style guidance |
190
+ | workflow or memory bank | Task management preferences |
191
+
192
+ ## Keeping It Updated
193
+
194
+ When Cursor creates or updates a memory, you'll be reminded to sync.
195
+ Run \`sync-memories\` or edit \`~/.cursor/shared-context.json\` manually.
196
+
197
+ See the full documentation in the MCP Task Server repository.
198
+ `;
199
+ // =============================================================================
200
+ // memory_bank templates
201
+ // =============================================================================
202
+ const BRIEF_TEMPLATE = `---
203
+ title: Project Brief
204
+ slug: /applications/<project>/context/brief
205
+ sidebar_label: brief
206
+ sidebar_position: 1
207
+ unlisted: false
208
+ tags:
209
+ - application
210
+ - <project>
211
+ - context
212
+ - planning
213
+ - brief
214
+ ---
215
+
216
+ # Project Brief
217
+
218
+ ## Purpose
219
+
220
+ State the core purpose in 2 to 3 sentences.
221
+
222
+ ## Core Problem
223
+
224
+ Describe the specific problem you are solving.
225
+
226
+ ## Real Goal
227
+
228
+ - Primary outcome:
229
+ - Secondary outcomes:
230
+
231
+ ## Audience
232
+
233
+ - Primary users:
234
+ - Secondary users:
235
+
236
+ ## Constraints
237
+
238
+ - Must run where:
239
+ - Cost limits:
240
+ - Data/privacy requirements:
241
+ `;
242
+ const ACTIVE_TEMPLATE = `---
243
+ title: Active Context
244
+ slug: /applications/<project>/context/active
245
+ sidebar_label: active
246
+ sidebar_position: 2
247
+ unlisted: false
248
+ tags:
249
+ - application
250
+ - <project>
251
+ - context
252
+ - planning
253
+ - active
254
+ ---
255
+
256
+ # Active Context
257
+
258
+ > What is actively being worked on.
259
+
260
+ ## Current Stage and Phase
261
+
262
+ - Stage:
263
+ - Phase:
264
+
265
+ ## Current Focus
266
+
267
+ - [ ] Task 1
268
+ - [ ] Task 2
269
+
270
+ ## Near-term
271
+
272
+ - [ ] Next step 1
273
+ - [ ] Next step 2
274
+
275
+ ## Known Issues and Risks
276
+
277
+ - Risk:
278
+ - Impact:
279
+ - Mitigation:
280
+
281
+ ## Guardrails
282
+
283
+ - Assumptions → Request → Safeguards
284
+ - One change → one run
285
+ - Keep the model locked (no Auto)
286
+ `;
287
+ const PROGRESS_TEMPLATE = `---
288
+ title: Progress
289
+ slug: /applications/<project>/execution/progress
290
+ sidebar_label: progress
291
+ sidebar_position: 1
292
+ unlisted: false
293
+ tags:
294
+ - application
295
+ - <project>
296
+ - execution
297
+ - progress
298
+ ---
299
+
300
+ # Implementation Progress
301
+
302
+ ## Status
303
+
304
+ Last updated: ${new Date().toISOString().split("T")[0]}
305
+
306
+ ## Task Completion Summary
307
+
308
+ ### Completed Tasks (0/0)
309
+
310
+ (No completed tasks yet)
311
+
312
+ ### In Progress Tasks (0/0)
313
+
314
+ (No tasks in progress)
315
+
316
+ ### Pending Tasks (0/0)
317
+
318
+ (No pending tasks)
319
+
320
+ ## Recent Updates
321
+
322
+ - ${new Date().toISOString().split("T")[0]}: Project initialised
323
+
324
+ ---
325
+
326
+ *Task details are in \`memory_bank/tasks/task_XXX.txt\` files.*
327
+ *This summary is auto-generated from \`memory_bank/tasks/tasks.json\`.*
328
+ `;
329
+ const DECISIONS_TEMPLATE = `---
330
+ title: Decision Log
331
+ slug: /applications/<project>/execution/decisions
332
+ sidebar_label: decisions
333
+ sidebar_position: 3
334
+ unlisted: false
335
+ tags:
336
+ - application
337
+ - <project>
338
+ - execution
339
+ - decisions
340
+ ---
341
+
342
+ # Decision Log
343
+
344
+ ## Structure
345
+
346
+ - Date
347
+ - Decision
348
+ - Reasoning
349
+ - Alternatives
350
+ - Impact
351
+
352
+ ## Decision History
353
+
354
+ ### ${new Date().toISOString().slice(0, 7)}
355
+
356
+ - Decision:
357
+ - Reasoning:
358
+ - Alternatives:
359
+ - Impact:
360
+ `;
361
+ // =============================================================================
362
+ // .cursor/rules template
363
+ // =============================================================================
364
+ const CURSOR_RULES_TEMPLATE = `# Agent Workflow Rules
365
+
366
+ ## Task Management Protocol
367
+
368
+ When working on this project, follow these task management rules:
369
+
370
+ ### Before Starting Work
371
+
372
+ 1. Check \`memory_bank/execution/progress.md\` for current task status
373
+ 2. Use \`list_tasks\` to see available tasks
374
+ 3. Use \`next_task\` to get the recommended task based on dependencies
375
+ 4. Claim the task before starting work
376
+
377
+ ### During Work
378
+
379
+ 1. Update task status as you progress
380
+ 2. Add subtasks if you discover additional work
381
+ 3. Document decisions in \`memory_bank/execution/decisions.md\`
382
+ 4. Keep \`memory_bank/context/active.md\` updated with current focus
383
+
384
+ ### After Completing Work
385
+
386
+ 1. Mark the task complete
387
+ 2. Update progress.md with completion notes
388
+ 3. Hand off to Judge for review if required
389
+ 4. Move to the next task
390
+
391
+ ## Role-Based Behaviour
392
+
393
+ ### As a Planner
394
+
395
+ - Focus on breaking down requirements into actionable tasks
396
+ - Set clear dependencies between tasks
397
+ - Estimate complexity before assigning
398
+ - Do not execute tasks yourself
399
+
400
+ ### As a Worker
401
+
402
+ - Claim tasks before starting
403
+ - Update progress frequently
404
+ - Request help if blocked
405
+ - Hand off completed work for review
406
+
407
+ ### As a Judge
408
+
409
+ - Review completed work thoroughly
410
+ - Provide specific, actionable feedback
411
+ - Approve work that meets requirements
412
+ - Request re-planning if approach is wrong
413
+
414
+ ## File Conventions
415
+
416
+ - **progress.md**: High-level task summary, auto-synced with tasks.json
417
+ - **tasks/task_XXX.txt**: Detailed task files
418
+ - **decisions.md**: Architectural and design decisions
419
+ - **active.md**: Current working context
420
+ - **brief.md**: Project overview and goals
421
+
422
+ ## Communication
423
+
424
+ When handing off between roles:
425
+ 1. Clearly state what was done
426
+ 2. Note any issues or concerns
427
+ 3. Specify what review is needed
428
+ 4. Include relevant file references
429
+ `;
430
+ /**
431
+ * Get the initial empty tasks.json content
432
+ */
433
+ export function getInitialTasksJson() {
434
+ return JSON.stringify({
435
+ version: "2.0.0",
436
+ tasks: [],
437
+ agents: [],
438
+ updated_at: new Date().toISOString(),
439
+ }, null, 2);
440
+ }
441
+ //# sourceMappingURL=templates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.js","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,WAAmB;IAClD,OAAO;QACL,kBAAkB;QAClB;YACE,IAAI,EAAE,0BAA0B;Y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