@vibescope/mcp-server 0.4.5 → 0.4.7

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 (176) hide show
  1. package/CHANGELOG.md +84 -84
  2. package/README.md +194 -194
  3. package/dist/api-client/project.d.ts +1 -0
  4. package/dist/api-client.d.ts +4 -1
  5. package/dist/api-client.js +24 -7
  6. package/dist/cli-init.js +25 -24
  7. package/dist/cli.js +26 -26
  8. package/dist/handlers/chat.d.ts +2 -0
  9. package/dist/handlers/chat.js +25 -0
  10. package/dist/handlers/discovery.js +12 -0
  11. package/dist/handlers/project.js +4 -2
  12. package/dist/handlers/tool-docs.js +1203 -1137
  13. package/dist/handlers/version.js +1 -1
  14. package/dist/index.js +159 -87
  15. package/dist/setup.js +13 -7
  16. package/dist/templates/agent-guidelines.d.ts +1 -1
  17. package/dist/templates/agent-guidelines.js +205 -187
  18. package/dist/templates/help-content.js +1621 -1621
  19. package/dist/tools/bodies-of-work.js +6 -6
  20. package/dist/tools/chat.d.ts +1 -0
  21. package/dist/tools/chat.js +24 -0
  22. package/dist/tools/cloud-agents.js +22 -22
  23. package/dist/tools/features.d.ts +13 -0
  24. package/dist/tools/features.js +151 -0
  25. package/dist/tools/index.d.ts +3 -1
  26. package/dist/tools/index.js +4 -1
  27. package/dist/tools/milestones.js +2 -2
  28. package/dist/tools/project.js +4 -0
  29. package/dist/tools/requests.js +1 -1
  30. package/dist/tools/session.js +11 -11
  31. package/dist/tools/sprints.js +9 -9
  32. package/dist/tools/tasks.js +35 -35
  33. package/dist/tools/worktrees.js +14 -14
  34. package/dist/tools.d.ts +2 -0
  35. package/dist/tools.js +3602 -0
  36. package/dist/utils.js +11 -11
  37. package/dist/version.d.ts +9 -3
  38. package/dist/version.js +56 -8
  39. package/docs/TOOLS.md +2663 -2559
  40. package/package.json +53 -53
  41. package/scripts/generate-docs.ts +212 -212
  42. package/scripts/version-bump.ts +203 -203
  43. package/src/api-client/blockers.ts +86 -86
  44. package/src/api-client/bodies-of-work.ts +194 -194
  45. package/src/api-client/chat.ts +50 -50
  46. package/src/api-client/connectors.ts +152 -152
  47. package/src/api-client/cost.ts +185 -185
  48. package/src/api-client/decisions.ts +87 -87
  49. package/src/api-client/deployment.ts +313 -313
  50. package/src/api-client/discovery.ts +81 -81
  51. package/src/api-client/fallback.ts +52 -52
  52. package/src/api-client/file-checkouts.ts +115 -115
  53. package/src/api-client/findings.ts +100 -100
  54. package/src/api-client/git-issues.ts +88 -88
  55. package/src/api-client/ideas.ts +112 -112
  56. package/src/api-client/index.ts +592 -592
  57. package/src/api-client/milestones.ts +83 -83
  58. package/src/api-client/organizations.ts +185 -185
  59. package/src/api-client/progress.ts +94 -94
  60. package/src/api-client/project.ts +180 -179
  61. package/src/api-client/requests.ts +54 -54
  62. package/src/api-client/session.ts +220 -220
  63. package/src/api-client/sprints.ts +227 -227
  64. package/src/api-client/subtasks.ts +57 -57
  65. package/src/api-client/tasks.ts +450 -450
  66. package/src/api-client/types.ts +32 -32
  67. package/src/api-client/validation.ts +60 -60
  68. package/src/api-client/worktrees.ts +53 -53
  69. package/src/api-client.test.ts +847 -847
  70. package/src/api-client.ts +2723 -2706
  71. package/src/cli-init.ts +558 -557
  72. package/src/cli.test.ts +284 -284
  73. package/src/cli.ts +204 -204
  74. package/src/handlers/__test-setup__.ts +240 -240
  75. package/src/handlers/__test-utils__.ts +89 -89
  76. package/src/handlers/blockers.test.ts +468 -468
  77. package/src/handlers/blockers.ts +172 -172
  78. package/src/handlers/bodies-of-work.test.ts +704 -704
  79. package/src/handlers/bodies-of-work.ts +526 -526
  80. package/src/handlers/chat.test.ts +185 -185
  81. package/src/handlers/chat.ts +101 -69
  82. package/src/handlers/cloud-agents.test.ts +438 -438
  83. package/src/handlers/cloud-agents.ts +156 -156
  84. package/src/handlers/connectors.test.ts +834 -834
  85. package/src/handlers/connectors.ts +229 -229
  86. package/src/handlers/cost.test.ts +462 -462
  87. package/src/handlers/cost.ts +285 -285
  88. package/src/handlers/decisions.test.ts +382 -382
  89. package/src/handlers/decisions.ts +153 -153
  90. package/src/handlers/deployment.test.ts +551 -551
  91. package/src/handlers/deployment.ts +570 -570
  92. package/src/handlers/discovery.test.ts +206 -206
  93. package/src/handlers/discovery.ts +427 -415
  94. package/src/handlers/fallback.test.ts +537 -537
  95. package/src/handlers/fallback.ts +194 -194
  96. package/src/handlers/file-checkouts.test.ts +750 -750
  97. package/src/handlers/file-checkouts.ts +185 -185
  98. package/src/handlers/findings.test.ts +633 -633
  99. package/src/handlers/findings.ts +239 -239
  100. package/src/handlers/git-issues.test.ts +631 -631
  101. package/src/handlers/git-issues.ts +136 -136
  102. package/src/handlers/ideas.test.ts +644 -644
  103. package/src/handlers/ideas.ts +207 -207
  104. package/src/handlers/index.ts +93 -93
  105. package/src/handlers/milestones.test.ts +475 -475
  106. package/src/handlers/milestones.ts +180 -180
  107. package/src/handlers/organizations.test.ts +826 -826
  108. package/src/handlers/organizations.ts +315 -315
  109. package/src/handlers/progress.test.ts +269 -269
  110. package/src/handlers/progress.ts +77 -77
  111. package/src/handlers/project.test.ts +546 -546
  112. package/src/handlers/project.ts +242 -239
  113. package/src/handlers/requests.test.ts +303 -303
  114. package/src/handlers/requests.ts +99 -99
  115. package/src/handlers/roles.test.ts +305 -305
  116. package/src/handlers/roles.ts +219 -219
  117. package/src/handlers/session.test.ts +998 -998
  118. package/src/handlers/session.ts +1105 -1105
  119. package/src/handlers/sprints.test.ts +732 -732
  120. package/src/handlers/sprints.ts +537 -537
  121. package/src/handlers/tasks.test.ts +931 -931
  122. package/src/handlers/tasks.ts +1133 -1133
  123. package/src/handlers/tool-categories.test.ts +66 -66
  124. package/src/handlers/tool-docs.test.ts +511 -511
  125. package/src/handlers/tool-docs.ts +1571 -1499
  126. package/src/handlers/types.test.ts +259 -259
  127. package/src/handlers/types.ts +176 -176
  128. package/src/handlers/validation.test.ts +582 -582
  129. package/src/handlers/validation.ts +164 -164
  130. package/src/handlers/version.ts +63 -63
  131. package/src/index.test.ts +674 -674
  132. package/src/index.ts +884 -807
  133. package/src/setup.test.ts +243 -233
  134. package/src/setup.ts +410 -404
  135. package/src/templates/agent-guidelines.ts +233 -215
  136. package/src/templates/help-content.ts +1751 -1751
  137. package/src/token-tracking.test.ts +463 -463
  138. package/src/token-tracking.ts +167 -167
  139. package/src/tools/blockers.ts +122 -122
  140. package/src/tools/bodies-of-work.ts +283 -283
  141. package/src/tools/chat.ts +72 -46
  142. package/src/tools/cloud-agents.ts +101 -101
  143. package/src/tools/connectors.ts +191 -191
  144. package/src/tools/cost.ts +111 -111
  145. package/src/tools/decisions.ts +111 -111
  146. package/src/tools/deployment.ts +455 -455
  147. package/src/tools/discovery.ts +76 -76
  148. package/src/tools/fallback.ts +111 -111
  149. package/src/tools/features.ts +154 -0
  150. package/src/tools/file-checkouts.ts +145 -145
  151. package/src/tools/findings.ts +101 -101
  152. package/src/tools/git-issues.ts +130 -130
  153. package/src/tools/ideas.ts +162 -162
  154. package/src/tools/index.ts +141 -137
  155. package/src/tools/milestones.ts +118 -118
  156. package/src/tools/organizations.ts +224 -224
  157. package/src/tools/progress.ts +73 -73
  158. package/src/tools/project.ts +206 -202
  159. package/src/tools/requests.ts +68 -68
  160. package/src/tools/roles.ts +112 -112
  161. package/src/tools/session.ts +181 -181
  162. package/src/tools/sprints.ts +298 -298
  163. package/src/tools/tasks.ts +550 -550
  164. package/src/tools/tools.test.ts +222 -222
  165. package/src/tools/types.ts +9 -9
  166. package/src/tools/validation.ts +75 -75
  167. package/src/tools/version.ts +34 -34
  168. package/src/tools/worktrees.ts +66 -66
  169. package/src/tools.test.ts +416 -416
  170. package/src/utils.test.ts +1014 -1014
  171. package/src/utils.ts +586 -586
  172. package/src/validators.test.ts +223 -223
  173. package/src/validators.ts +249 -249
  174. package/src/version.ts +162 -109
  175. package/tsconfig.json +16 -16
  176. package/vitest.config.ts +14 -14
@@ -1,1751 +1,1751 @@
1
- /**
2
- * Fallback Help Content
3
- *
4
- * This provides comprehensive help content for each topic when the backend
5
- * database has no content populated. Ensures agents always get useful guidance.
6
- */
7
-
8
- export const HELP_TOPICS: Record<string, { title: string; content: string }> = {
9
- getting_started: {
10
- title: 'Getting Started',
11
- content: `# Getting Started with Vibescope
12
-
13
- ## Quick Start
14
-
15
- \`\`\`
16
- start_work_session(git_url: "https://github.com/YOUR/REPO", model: "opus", agent_type: "claude")
17
- \`\`\`
18
-
19
- **Parameters:**
20
- - \`git_url\`: Your repository URL (required if no project_id)
21
- - \`model\`: Your model type - opus, sonnet, or haiku (for cost tracking)
22
- - \`agent_type\`: Your agent type - claude, gemini, cursor, windsurf, or other
23
-
24
- This returns:
25
- - \`session_id\`: Your session identifier
26
- - \`persona\`: Your assigned agent persona (e.g., "Nova", "Edge")
27
- - \`project\`: Project details and settings
28
- - \`next_task\`: The highest priority task to work on
29
-
30
- ## Core Workflow
31
-
32
- 1. **Start session** → \`start_work_session(git_url, model, agent_type)\`
33
- 2. **Mark task in progress** → \`update_task(task_id, status: "in_progress")\`
34
- 3. **Update progress** → \`update_task(task_id, progress_percentage: 50, progress_note: "...")\`
35
- 4. **Complete task** → \`complete_task(task_id, summary: "...")\`
36
- 5. **Continue** → Start the next_task returned, or call \`get_next_task(project_id)\`
37
-
38
- ## Key Rules
39
-
40
- 1. **Always call complete_task()** after finishing work - don't wait for PR review
41
- 2. **Never ask permission** to continue - just start the next task
42
- 3. **Use git worktrees** for branching workflows to avoid conflicts
43
- 4. **Update progress** regularly (every 15-20% completion)
44
-
45
- ## Need More Help?
46
-
47
- Use \`get_help(topic)\` with these topics:
48
- - \`tasks\` - Task management workflow
49
- - \`validation\` - Cross-agent task validation
50
- - \`git\` - Git workflow and worktrees
51
- - \`deployment\` - Deployment coordination
52
- - \`session\` - Session management
53
- - \`fallback\` - Background activities
54
- - \`blockers\` - Handling blockers
55
- - \`milestones\` - Breaking down complex tasks`,
56
- },
57
-
58
- session: {
59
- title: 'Session Management',
60
- content: `# Session Management
61
-
62
- ## Starting a Session
63
-
64
- \`\`\`
65
- start_work_session(
66
- git_url: "https://github.com/YOUR/REPO",
67
- model: "opus", // opus, sonnet, or haiku
68
- agent_type: "claude", // claude, gemini, cursor, windsurf, other
69
- role: "developer" // developer, validator, deployer, reviewer, maintainer
70
- )
71
- \`\`\`
72
-
73
- **Response includes:**
74
- - \`session_id\`: Unique session identifier
75
- - \`persona\`: Your assigned agent name (e.g., "Nova", "Edge", "Arc")
76
- - \`project\`: Project configuration
77
- - \`next_task\`: Highest priority task to start
78
- - \`pending_requests\`: User questions to answer first
79
- - \`awaiting_validation\`: Tasks needing review (for validators)
80
- - \`stale_worktrees\`: Worktrees to clean up
81
-
82
- ## Maintaining Your Session
83
-
84
- ### Heartbeat
85
- Send heartbeats every 30-60 seconds to stay active:
86
- \`\`\`
87
- heartbeat(current_worktree_path: "../project-persona-task")
88
- \`\`\`
89
-
90
- This:
91
- - Keeps your session marked as "active" on the dashboard
92
- - Reports your current working directory
93
- - Syncs token usage to the backend
94
-
95
- ### Token Tracking
96
- Check your token usage:
97
- \`\`\`
98
- get_token_usage()
99
- \`\`\`
100
-
101
- Report actual API usage for accurate cost tracking:
102
- \`\`\`
103
- report_token_usage(input_tokens: 1500, output_tokens: 500, model: "opus")
104
- \`\`\`
105
-
106
- ## Ending a Session
107
-
108
- \`\`\`
109
- end_work_session()
110
- \`\`\`
111
-
112
- This:
113
- - Releases any claimed tasks
114
- - Syncs final token usage
115
- - Returns a session summary
116
-
117
- ## Context Management
118
-
119
- When your context grows large (50+ tool calls or 100k+ tokens):
120
- 1. Run \`/clear\` to reset conversation
121
- 2. Immediately call \`start_work_session()\` to reload
122
- 3. Continue with the \`next_task\` from the response
123
-
124
- **Do NOT ask the user** - just clear and continue. The dashboard tracks all progress.
125
-
126
- ## Session Roles
127
-
128
- | Role | Description |
129
- |------|-------------|
130
- | \`developer\` | General development work (default) |
131
- | \`validator\` | Reviews and validates completed tasks |
132
- | \`deployer\` | Handles deployments |
133
- | \`reviewer\` | Code review focus |
134
- | \`maintainer\` | Housekeeping and maintenance |
135
-
136
- Change role mid-session:
137
- \`\`\`
138
- set_session_role(role: "validator")
139
- \`\`\``,
140
- },
141
-
142
- tasks: {
143
- title: 'Task Management',
144
- content: `# Task Management
145
-
146
- ## Getting Tasks
147
-
148
- ### Get Next Task
149
- \`\`\`
150
- get_next_task(project_id)
151
- \`\`\`
152
- Returns the highest priority pending task.
153
-
154
- ### Search Tasks
155
- \`\`\`
156
- search_tasks(project_id, query: "login bug", status: ["pending", "in_progress"])
157
- \`\`\`
158
-
159
- ### Get by Priority
160
- \`\`\`
161
- get_tasks_by_priority(project_id, priority: 1) // P1 tasks only
162
- get_tasks_by_priority(project_id, priority: 1, priority_max: 2) // P1 and P2
163
- \`\`\`
164
-
165
- ## Working on Tasks
166
-
167
- ### 1. Start the Task
168
- \`\`\`
169
- update_task(task_id, status: "in_progress")
170
- \`\`\`
171
-
172
- **For branching workflows (github-flow, git-flow):**
173
- Create a worktree first, then include it:
174
- \`\`\`
175
- update_task(
176
- task_id,
177
- status: "in_progress",
178
- git_branch: "feature/abc123-add-login",
179
- worktree_path: "../project-persona-add-login"
180
- )
181
- \`\`\`
182
-
183
- ### 2. Update Progress
184
- Update regularly (every 15-20% completion):
185
- \`\`\`
186
- update_task(
187
- task_id,
188
- progress_percentage: 50,
189
- progress_note: "Implemented core logic, working on tests"
190
- )
191
- \`\`\`
192
-
193
- ### 3. Complete the Task
194
- **CRITICAL: Always call complete_task() after finishing!**
195
- \`\`\`
196
- complete_task(task_id, summary: "Added login flow with OAuth support")
197
- \`\`\`
198
-
199
- **When to call complete_task:**
200
- - After creating and pushing a PR
201
- - After merging (trunk-based workflow)
202
- - After finishing any unit of work
203
-
204
- **Do NOT wait for:**
205
- - PR review/merge (validation handles that)
206
- - User confirmation
207
- - Perfect summary
208
-
209
- ### Fix Already Exists (No Code Changes Needed)
210
-
211
- When investigating a task and finding the fix already exists in code but hasn't been deployed:
212
-
213
- 1. **Document the finding:**
214
- \`\`\`
215
- add_finding(
216
- project_id,
217
- title: "Fix exists but awaits deployment",
218
- category: "other",
219
- severity: "info",
220
- description: "The fix for [issue] was implemented in PR #{pr_number} but hasn't been deployed yet.",
221
- related_task_id: task_id
222
- )
223
- \`\`\`
224
-
225
- 2. **Complete the task** (investigation is done):
226
- \`\`\`
227
- complete_task(task_id, summary: "Fix already exists in codebase (PR #{pr_number}). Needs deployment to production.")
228
- \`\`\`
229
-
230
- 3. **Request deployment** if not already pending:
231
- \`\`\`
232
- check_deployment_status(project_id) // Check if deployment pending
233
- request_deployment(project_id, notes: "Includes fix for [issue]")
234
- \`\`\`
235
-
236
- This prevents tasks from being blocked waiting for deployment when the actual work is done.
237
-
238
- ## Task Priorities
239
-
240
- | Priority | Meaning |
241
- |----------|---------|
242
- | 1 | Critical - do first |
243
- | 2 | High priority |
244
- | 3 | Normal (default) |
245
- | 4 | Low priority |
246
- | 5 | Backlog |
247
-
248
- ## Breaking Down Tasks
249
-
250
- For complex tasks, use milestones:
251
- \`\`\`
252
- add_milestone(task_id, title: "Set up database schema")
253
- add_milestone(task_id, title: "Implement API endpoints")
254
- add_milestone(task_id, title: "Add unit tests")
255
-
256
- complete_milestone(milestone_id)
257
- \`\`\`
258
-
259
- Or subtasks for parallel work:
260
- \`\`\`
261
- add_subtask(parent_task_id, title: "Implement frontend form")
262
- add_subtask(parent_task_id, title: "Implement backend validation")
263
- \`\`\`
264
-
265
- ## Task References
266
-
267
- Link PRs, issues, or docs to tasks:
268
- \`\`\`
269
- add_task_reference(task_id, url: "https://github.com/org/repo/pull/123", label: "PR")
270
- \`\`\`
271
-
272
- **Important:** For github-flow/git-flow projects, add PR reference before completing - validators need it.
273
-
274
- ## Deployment-Only Resolutions
275
-
276
- When investigating a task and finding the fix already exists in code (just needs deployment):
277
-
278
- **1. Document the finding:**
279
- \`\`\`
280
- add_finding(
281
- project_id,
282
- title: "Fix exists - needs deployment",
283
- category: "other",
284
- severity: "info",
285
- description: "Investigation found the fix for [issue] already exists in [commit/PR]. Deployment will resolve this."
286
- )
287
- \`\`\`
288
-
289
- **2. Mark the task complete:**
290
- \`\`\`
291
- complete_task(task_id, summary: "Investigation complete: fix exists in [branch/commit], pending deployment")
292
- \`\`\`
293
-
294
- **3. Request deployment if needed:**
295
- \`\`\`
296
- # Check if deployment is already pending
297
- check_deployment_status(project_id)
298
-
299
- # If not, request one
300
- request_deployment(project_id, notes: "Includes fix for [task description]")
301
- \`\`\`
302
-
303
- **Why this pattern?**
304
- - Tasks shouldn't block waiting for deployment
305
- - Investigation work is complete (resolution identified)
306
- - The finding creates a record of what needs deploying
307
- - Deployment can bundle multiple fixes together`,
308
- },
309
-
310
- validation: {
311
- title: 'Task Validation',
312
- content: `# Task Validation
313
-
314
- Validation ensures completed work meets quality standards before merging.
315
-
316
- ## For Developers
317
-
318
- After completing a task:
319
- 1. Create your PR
320
- 2. Add PR reference: \`add_task_reference(task_id, url: "PR_URL")\`
321
- 3. Call \`complete_task(task_id, summary: "...")\`
322
- 4. A validator will review and merge
323
-
324
- ## For Validators
325
-
326
- ### 1. Get Tasks to Validate
327
- \`\`\`
328
- get_tasks_awaiting_validation(project_id)
329
- \`\`\`
330
- Returns tasks sorted by PR number (oldest first). **Always review in this order (FIFO).**
331
-
332
- ### 2. Claim a Task
333
- \`\`\`
334
- claim_validation(task_id)
335
- \`\`\`
336
-
337
- Returns:
338
- - \`worktree_setup\`: Commands to checkout the branch
339
- - \`conflict_check\`: Steps to verify PR can merge
340
- - \`merge_status\`: Current PR state
341
-
342
- ### 3. Set Up Your Worktree
343
- \`\`\`bash
344
- # Fetch and create worktree from existing branch
345
- git fetch origin feature/abc123-task
346
- git worktree add ../project-validator-review feature/abc123-task
347
- cd ../project-validator-review
348
- \`\`\`
349
-
350
- ### 4. Run Tests Locally
351
- \`\`\`bash
352
- pnpm install
353
- pnpm test
354
- pnpm build
355
- \`\`\`
356
-
357
- ### 5. Check PR State
358
- \`\`\`bash
359
- gh pr view <PR_NUMBER> --json state,mergedAt --jq '.state'
360
- \`\`\`
361
-
362
- If PR is CLOSED (not merged), cancel instead of validating:
363
- \`\`\`
364
- cancel_task(task_id, cancelled_reason: "pr_closed")
365
- \`\`\`
366
-
367
- ### 6. Approve or Reject
368
-
369
- **If APPROVED:**
370
- \`\`\`
371
- validate_task(task_id, approved: true, validation_notes: "Tests pass, code looks good")
372
- \`\`\`
373
- Then merge the PR and clean up:
374
- \`\`\`bash
375
- gh pr merge <PR_NUMBER> --squash
376
- cd ../project && git worktree remove ../project-validator-review
377
- \`\`\`
378
-
379
- **If REJECTED:**
380
- \`\`\`
381
- validate_task(
382
- task_id,
383
- approved: false,
384
- validation_notes: "Tests failing in auth module",
385
- create_fix_task: true // Creates a fix task on the same branch
386
- )
387
- \`\`\`
388
- Then clean up your worktree - the fix agent will create their own.
389
-
390
- ## Handling Merge Conflicts
391
-
392
- If \`claim_validation\` shows merge conflicts:
393
- 1. Follow the \`rebase_instructions.steps\`
394
- 2. Resolve conflicts in your editor
395
- 3. Force push with \`--force-with-lease\`
396
- 4. Call \`claim_validation\` again to verify
397
-
398
- Record git issues:
399
- \`\`\`
400
- add_git_issue(
401
- project_id,
402
- issue_type: "merge_conflict",
403
- branch: "feature-branch",
404
- target_branch: "develop",
405
- task_id: task_id
406
- )
407
- \`\`\``,
408
- },
409
-
410
- git: {
411
- title: 'Git Workflow',
412
- content: `# Git Workflow
413
-
414
- ## Supported Workflows
415
-
416
- | Workflow | Description |
417
- |----------|-------------|
418
- | \`none\` | No branching, direct commits |
419
- | \`trunk-based\` | Commit directly to main |
420
- | \`github-flow\` | Feature branches + PRs to main |
421
- | \`git-flow\` | Feature branches off develop, PRs to develop |
422
-
423
- Check your project's workflow:
424
- \`\`\`
425
- get_git_workflow(project_id)
426
- \`\`\`
427
-
428
- ## Git Worktrees (CRITICAL)
429
-
430
- **For github-flow and git-flow projects, you MUST use worktrees.**
431
-
432
- ### Rebase Before PR (MANDATORY)
433
-
434
- **Always rebase your branch before creating a PR.** This prevents overwrites of other agents' work.
435
-
436
- \`\`\`bash
437
- # Before creating PR, rebase onto latest base branch
438
- git fetch origin
439
- git rebase origin/develop # or origin/main for github-flow
440
- # Resolve any conflicts
441
- git push --force-with-lease
442
- \`\`\`
443
-
444
- **Why?** Without rebasing, your branch may contain old versions of files that other agents modified. When merged, your old version overwrites their changes.
445
-
446
- ### Why Worktrees?
447
- Multiple agents sharing one repo will conflict:
448
- - Switching branches affects all agents
449
- - Uncommitted changes collide
450
- - Direct commits create merge conflicts
451
-
452
- Worktrees give each task an isolated working directory.
453
-
454
- ### Worktree Workflow
455
-
456
- **1. Create worktree BEFORE making any edits:**
457
- \`\`\`bash
458
- # Naming: ../PROJECT-PERSONA-short-description
459
- git worktree add ../Vibescope-Nova-add-login -b feature/abc123-add-login develop
460
- cd ../Vibescope-Nova-add-login
461
- \`\`\`
462
-
463
- **2. Report your location:**
464
- \`\`\`
465
- heartbeat(current_worktree_path: "../Vibescope-Nova-add-login")
466
- \`\`\`
467
-
468
- **3. Update the task:**
469
- \`\`\`
470
- update_task(
471
- task_id,
472
- status: "in_progress",
473
- git_branch: "feature/abc123-add-login",
474
- worktree_path: "../Vibescope-Nova-add-login"
475
- )
476
- \`\`\`
477
-
478
- **4. Do your work, commit, push, create PR**
479
-
480
- **5. Clean up IMMEDIATELY after opening PR:**
481
- \`\`\`bash
482
- cd ../Vibescope # Return to main repo
483
- git worktree remove ../Vibescope-Nova-add-login
484
- \`\`\`
485
- Then clear the path:
486
- \`\`\`
487
- clear_worktree_path(task_id)
488
- \`\`\`
489
-
490
- ### NO EXCEPTIONS
491
-
492
- Even for:
493
- - "Quick fixes" → Use a worktree
494
- - "Urgent hotfixes" → Use a worktree
495
- - "One line changes" → Use a worktree
496
-
497
- ### Wrong vs Right Order
498
-
499
- **WRONG:**
500
- 1. Edit files in main repo
501
- 2. git stash
502
- 3. Create worktree
503
- 4. git stash pop
504
-
505
- **RIGHT:**
506
- 1. Create worktree FIRST
507
- 2. cd into worktree
508
- 3. THEN edit files
509
-
510
- ### Useful Commands
511
-
512
- | Command | Description |
513
- |---------|-------------|
514
- | \`git worktree list\` | List all worktrees |
515
- | \`git worktree add <path> -b <branch> <base>\` | Create worktree |
516
- | \`git worktree remove <path>\` | Remove worktree |
517
- | \`get_stale_worktrees(project_id)\` | Find orphaned worktrees |
518
-
519
- ### Cleaning Stale Worktrees
520
-
521
- On session start, if \`stale_worktrees\` is returned:
522
- \`\`\`bash
523
- git worktree remove <path>
524
- \`\`\`
525
- Then:
526
- \`\`\`
527
- clear_worktree_path(task_id)
528
- \`\`\``,
529
- },
530
-
531
- deployment: {
532
- title: 'Deployment Coordination',
533
- content: `# Deployment Coordination
534
-
535
- ## Deployment Flow
536
-
537
- 1. **Request** → \`request_deployment(project_id)\`
538
- 2. **Validate** → Build and test the deployment
539
- 3. **Deploy** → Execute deployment
540
- 4. **Complete** → Mark success/failure
541
-
542
- ## Requesting Deployment
543
-
544
- \`\`\`
545
- request_deployment(
546
- project_id,
547
- environment: "production", // development, staging, production
548
- version_bump: "patch", // patch, minor, major
549
- git_ref: "main", // Branch or commit
550
- notes: "Bug fixes for auth" // Optional
551
- )
552
- \`\`\`
553
-
554
- ## Pre-Deployment Requirements
555
-
556
- Add requirements that must be completed before deploying:
557
- \`\`\`
558
- add_deployment_requirement(
559
- project_id,
560
- type: "migration",
561
- title: "Run migration: add_user_roles",
562
- description: "Run: pnpm db:migrate",
563
- stage: "preparation" // preparation, deployment, verification
564
- )
565
- \`\`\`
566
-
567
- Types: \`migration\`, \`env_var\`, \`config\`, \`manual\`, \`breaking_change\`, \`agent_task\`
568
-
569
- Check requirements:
570
- \`\`\`
571
- get_deployment_requirements(project_id)
572
- \`\`\`
573
-
574
- Complete them:
575
- \`\`\`
576
- complete_deployment_requirement(requirement_id)
577
- \`\`\`
578
-
579
- ## Validating Deployment
580
-
581
- Claim for validation:
582
- \`\`\`
583
- claim_deployment_validation(project_id)
584
- \`\`\`
585
-
586
- Run build and tests, then report:
587
- \`\`\`
588
- report_validation(
589
- project_id,
590
- build_passed: true,
591
- tests_passed: true
592
- )
593
- \`\`\`
594
-
595
- If validation fails, an investigation task is auto-created.
596
-
597
- ## Executing Deployment
598
-
599
- Check status:
600
- \`\`\`
601
- check_deployment_status(project_id)
602
- \`\`\`
603
-
604
- When status is "ready":
605
- \`\`\`
606
- start_deployment(project_id)
607
- \`\`\`
608
-
609
- After deployment completes:
610
- \`\`\`
611
- complete_deployment(
612
- project_id,
613
- success: true,
614
- summary: "Deployed v1.2.3 with auth fixes"
615
- )
616
- \`\`\`
617
-
618
- Or if it failed:
619
- \`\`\`
620
- complete_deployment(
621
- project_id,
622
- success: false,
623
- summary: "Rollback due to database connection errors"
624
- )
625
- \`\`\`
626
-
627
- ## Scheduled Deployments
628
-
629
- Schedule future deployments:
630
- \`\`\`
631
- schedule_deployment(
632
- project_id,
633
- scheduled_at: "2025-01-20T10:00:00Z",
634
- schedule_type: "once", // once, hourly, daily, weekly, monthly
635
- auto_trigger: true // Auto-deploy when due
636
- )
637
- \`\`\`
638
-
639
- Check due deployments:
640
- \`\`\`
641
- check_due_deployments(project_id)
642
- \`\`\`
643
-
644
- ## Canceling
645
-
646
- \`\`\`
647
- cancel_deployment(project_id, reason: "Blocker found in staging")
648
- \`\`\``,
649
- },
650
-
651
- blockers: {
652
- title: 'Handling Blockers',
653
- content: `# Handling Blockers
654
-
655
- ## Recording a Blocker
656
-
657
- When you can't proceed:
658
- \`\`\`
659
- add_blocker(
660
- project_id,
661
- description: "API endpoint returning 500 errors - need backend team to investigate"
662
- )
663
- \`\`\`
664
-
665
- ## Viewing Blockers
666
-
667
- \`\`\`
668
- get_blockers(project_id) // Open blockers
669
- get_blockers(project_id, status: "resolved") // Resolved blockers
670
- get_blockers_stats(project_id) // Just counts
671
- \`\`\`
672
-
673
- ## Resolving Blockers
674
-
675
- \`\`\`
676
- resolve_blocker(
677
- blocker_id,
678
- resolution_note: "Backend team fixed the API - endpoint now returns correct data"
679
- )
680
- \`\`\`
681
-
682
- ## What Counts as a Blocker?
683
-
684
- **IS a blocker:**
685
- - External dependency not available
686
- - Need access/credentials you don't have
687
- - Critical bug in a dependency
688
- - Waiting for human decision
689
- - Environment issue preventing testing
690
-
691
- **NOT a blocker:**
692
- - Need to learn something → research and continue
693
- - Code is complex → break it down with milestones
694
- - Tests failing → fix them
695
- - Merge conflicts → resolve them
696
-
697
- ## Blocker Best Practices
698
-
699
- 1. **Be specific** - Describe exactly what's blocked and why
700
- 2. **Include context** - What were you trying to do?
701
- 3. **Suggest solutions** - If you know what might help
702
- 4. **Check existing blockers** - Don't duplicate
703
- 5. **Resolve promptly** - When the issue is fixed, resolve the blocker`,
704
- },
705
-
706
- milestones: {
707
- title: 'Task Milestones',
708
- content: `# Task Milestones
709
-
710
- Milestones break down large tasks into trackable steps.
711
-
712
- ## Adding Milestones
713
-
714
- \`\`\`
715
- add_milestone(task_id, title: "Design database schema")
716
- add_milestone(task_id, title: "Implement API endpoints")
717
- add_milestone(task_id, title: "Write unit tests")
718
- add_milestone(task_id, title: "Add integration tests")
719
- \`\`\`
720
-
721
- With order and description:
722
- \`\`\`
723
- add_milestone(
724
- task_id,
725
- title: "Set up authentication",
726
- description: "Configure OAuth providers and session management",
727
- order_index: 0
728
- )
729
- \`\`\`
730
-
731
- ## Viewing Milestones
732
-
733
- \`\`\`
734
- get_milestones(task_id)
735
- \`\`\`
736
-
737
- Or include when getting task:
738
- \`\`\`
739
- get_task(task_id, include_milestones: true)
740
- \`\`\`
741
-
742
- ## Updating Progress
743
-
744
- Mark milestone in progress:
745
- \`\`\`
746
- update_milestone(milestone_id, status: "in_progress")
747
- \`\`\`
748
-
749
- Complete a milestone:
750
- \`\`\`
751
- complete_milestone(milestone_id)
752
- \`\`\`
753
-
754
- ## When to Use Milestones
755
-
756
- **Good candidates:**
757
- - Tasks estimated > 2 hours
758
- - Multi-step implementations
759
- - Features spanning multiple files/modules
760
- - Tasks with clear phases
761
-
762
- **Example breakdown:**
763
-
764
- Task: "Implement user authentication"
765
- 1. Set up OAuth provider configuration
766
- 2. Create login/logout API endpoints
767
- 3. Implement session management
768
- 4. Add protected route middleware
769
- 5. Create login UI components
770
- 6. Write tests
771
-
772
- ## Milestones vs Subtasks
773
-
774
- | Milestones | Subtasks |
775
- |------------|----------|
776
- | Sequential steps | Parallel work items |
777
- | Same agent | Can be claimed by different agents |
778
- | Progress tracking | Delegation |
779
- | One at a time | Multiple in progress |
780
-
781
- Use **milestones** for ordered steps you'll do yourself.
782
- Use **subtasks** when work can be parallelized across agents.`,
783
- },
784
-
785
- fallback: {
786
- title: 'Fallback Activities',
787
- content: `# Fallback Activities
788
-
789
- When no tasks are available, agents can perform background activities.
790
-
791
- ## Starting a Fallback Activity
792
-
793
- \`\`\`
794
- start_fallback_activity(project_id, activity: "code_review")
795
- \`\`\`
796
-
797
- ## Available Activities
798
-
799
- | Activity | Description |
800
- |----------|-------------|
801
- | \`code_review\` | Review code quality, patterns, best practices |
802
- | \`security_review\` | Security audit, vulnerability scanning |
803
- | \`performance_audit\` | Performance analysis, optimization opportunities |
804
- | \`ux_review\` | UX/accessibility review |
805
- | \`test_coverage\` | Test coverage analysis, missing tests |
806
- | \`documentation_review\` | Documentation gaps, outdated docs |
807
- | \`dependency_audit\` | Dependency updates, vulnerabilities |
808
- | \`feature_ideation\` | Suggest improvements, new features |
809
- | \`validate_completed_tasks\` | Review tasks awaiting validation |
810
- | \`worktree_cleanup\` | Clean up stale worktrees |
811
-
812
- ## Recording Findings
813
-
814
- During activities, record findings:
815
- \`\`\`
816
- add_finding(
817
- project_id,
818
- title: "SQL injection risk in user search",
819
- category: "security", // security, performance, code_quality, etc.
820
- severity: "high", // info, low, medium, high, critical
821
- description: "User input passed directly to query without sanitization",
822
- file_path: "src/api/users.ts",
823
- line_number: 45
824
- )
825
- \`\`\`
826
-
827
- ## Recording Ideas
828
-
829
- For feature suggestions:
830
- \`\`\`
831
- add_idea(
832
- project_id,
833
- title: "Add rate limiting to API",
834
- description: "Protect against abuse by adding rate limits per user/IP"
835
- )
836
- \`\`\`
837
-
838
- ## Stopping Activities
839
-
840
- Activities auto-stop when you start a task. Manual stop:
841
- \`\`\`
842
- stop_fallback_activity(project_id, summary: "Reviewed 5 files, found 2 issues")
843
- \`\`\`
844
-
845
- ## Activity History
846
-
847
- \`\`\`
848
- get_activity_history(project_id)
849
- \`\`\`
850
-
851
- ## Project Settings
852
-
853
- Projects can restrict fallback activities:
854
- \`\`\`
855
- update_project(
856
- project_id,
857
- fallback_activities_enabled: true,
858
- preferred_fallback_activities: ["code_review", "security_review"]
859
- )
860
- \`\`\``,
861
- },
862
-
863
- tokens: {
864
- title: 'Token Usage & Cost Tracking',
865
- content: `# Token Usage & Cost Tracking
866
-
867
- ## Checking Usage
868
-
869
- \`\`\`
870
- get_token_usage()
871
- \`\`\`
872
-
873
- Returns:
874
- - Session stats (calls, tokens, avg per call)
875
- - Top tools by token usage
876
- - Model breakdown (input/output tokens)
877
- - Estimated costs
878
-
879
- ## Reporting Actual Usage
880
-
881
- MCP estimates are only ~1-5% of actual API usage. For accurate tracking:
882
-
883
- \`\`\`
884
- report_token_usage(
885
- input_tokens: 1500,
886
- output_tokens: 500,
887
- model: "opus" // or sonnet, haiku
888
- )
889
- \`\`\`
890
-
891
- Call this after each API response using values from the response headers:
892
- - \`usage.input_tokens\`
893
- - \`usage.output_tokens\`
894
-
895
- ## Model Pricing
896
-
897
- | Model | Input (per 1M) | Output (per 1M) |
898
- |-------|---------------|-----------------|
899
- | Opus | $15.00 | $75.00 |
900
- | Sonnet | $3.00 | $15.00 |
901
- | Haiku | $0.25 | $1.25 |
902
-
903
- ## Cost Monitoring
904
-
905
- Get cost summary:
906
- \`\`\`
907
- get_cost_summary(project_id, period: "daily") // daily, weekly, monthly
908
- \`\`\`
909
-
910
- Set up alerts:
911
- \`\`\`
912
- add_cost_alert(
913
- project_id,
914
- threshold_amount: 100, // USD
915
- threshold_period: "daily",
916
- alert_type: "warning" // warning, critical
917
- )
918
- \`\`\`
919
-
920
- ## Context Management
921
-
922
- When token usage is high:
923
- 1. Check with \`get_token_usage()\`
924
- 2. If 50+ calls or 100k+ tokens: \`/clear\`
925
- 3. Immediately call \`start_work_session()\`
926
- 4. Continue with \`next_task\`
927
-
928
- **Don't ask permission** - just clear and continue.
929
-
930
- ## Efficiency Tips
931
-
932
- 1. **Use lite mode** (default) - saves ~85% tokens on session start
933
- 2. **Batch updates** - Use \`batch_update_tasks\` when updating multiple
934
- 3. **Use stats endpoints** - \`get_task_stats\` instead of listing all tasks
935
- 4. **Clear context regularly** - Don't let it grow unbounded`,
936
- },
937
-
938
- sprints: {
939
- title: 'Sprint Management',
940
- content: `# Sprint Management
941
-
942
- Sprints are time-bounded work periods with velocity tracking.
943
-
944
- ## Creating a Sprint
945
-
946
- \`\`\`
947
- create_sprint(
948
- project_id,
949
- title: "Sprint 5",
950
- start_date: "2025-01-20",
951
- end_date: "2025-02-03",
952
- goal: "Complete authentication and user profile features"
953
- )
954
- \`\`\`
955
-
956
- ## Sprint Lifecycle
957
-
958
- 1. **Planning** → Add tasks, assign story points
959
- 2. **Active** → Work on tasks
960
- 3. **In Review** → Review completed work
961
- 4. **Retrospective** → Reflect on sprint
962
- 5. **Completed** → Archive with metrics
963
-
964
- ## Adding Tasks to Sprint
965
-
966
- \`\`\`
967
- add_task_to_sprint(
968
- sprint_id,
969
- task_id,
970
- story_points: 3,
971
- phase: "core" // pre, core, post
972
- )
973
- \`\`\`
974
-
975
- ## Starting a Sprint
976
-
977
- \`\`\`
978
- start_sprint(sprint_id)
979
- \`\`\`
980
-
981
- This locks \`committed_points\` at the current total.
982
-
983
- ## Getting Sprint Backlog
984
-
985
- Tasks available to add:
986
- \`\`\`
987
- get_sprint_backlog(project_id, sprint_id)
988
- \`\`\`
989
-
990
- ## Sprint Progress
991
-
992
- \`\`\`
993
- get_sprint(sprint_id)
994
- \`\`\`
995
-
996
- With just counts (saves tokens):
997
- \`\`\`
998
- get_sprint(sprint_id, summary_only: true)
999
- \`\`\`
1000
-
1001
- ## Completing a Sprint
1002
-
1003
- \`\`\`
1004
- complete_sprint(
1005
- sprint_id,
1006
- retrospective_notes: "Completed 80% of planned work. Auth took longer than expected.",
1007
- skip_retrospective: false
1008
- )
1009
- \`\`\`
1010
-
1011
- ## Velocity Tracking
1012
-
1013
- \`\`\`
1014
- get_sprint_velocity(project_id, limit: 10)
1015
- \`\`\`
1016
-
1017
- Returns:
1018
- - Committed vs completed points per sprint
1019
- - Average velocity
1020
- - Trend analysis`,
1021
- },
1022
-
1023
- topics: {
1024
- title: 'Available Help Topics',
1025
- content: `# Available Help Topics
1026
-
1027
- Use \`get_help(topic)\` for detailed guidance on any topic.
1028
-
1029
- ## Core Topics
1030
-
1031
- | Topic | Description |
1032
- |-------|-------------|
1033
- | \`getting_started\` | Quick start guide, core workflow |
1034
- | \`session\` | Session lifecycle, heartbeats, context management |
1035
- | \`tasks\` | Task management, progress tracking, completion |
1036
- | \`validation\` | Cross-agent task validation workflow |
1037
- | \`git\` | Git workflows, worktrees, branch management |
1038
- | \`deployment\` | Deployment coordination, requirements |
1039
-
1040
- ## Task Organization
1041
-
1042
- | Topic | Description |
1043
- |-------|-------------|
1044
- | \`milestones\` | Breaking down complex tasks into steps |
1045
- | \`subtasks\` | Parallelizable task breakdown |
1046
- | \`bodies_of_work\` | Group related tasks into phases |
1047
- | \`sprints\` | Time-bounded sprints with velocity tracking |
1048
-
1049
- ## Collaboration
1050
-
1051
- | Topic | Description |
1052
- |-------|-------------|
1053
- | \`roles\` | Agent roles and specialization |
1054
- | \`file_locks\` | Multi-agent file coordination |
1055
- | \`git_issues\` | Git conflict and issue tracking |
1056
- | \`requests\` | Handle user questions from dashboard |
1057
-
1058
- ## Knowledge & Tracking
1059
-
1060
- | Topic | Description |
1061
- |-------|-------------|
1062
- | \`blockers\` | Recording and resolving blockers |
1063
- | \`knowledge\` | Project knowledge base |
1064
- | \`ideas\` | Feature ideas and requests |
1065
- | \`tokens\` | Token usage and cost tracking |
1066
- | \`fallback\` | Background activities when idle |
1067
- | \`connectors\` | External integrations (Slack, webhooks) |
1068
-
1069
- ## Quick Examples
1070
-
1071
- \`\`\`
1072
- get_help("getting_started") // New to Vibescope? Start here
1073
- get_help("git") // Git worktree workflow
1074
- get_help("validation") // How to validate tasks
1075
- get_help("session") // Session management
1076
- get_help("bodies_of_work") // Organizing related tasks
1077
- \`\`\``,
1078
- },
1079
-
1080
- roles: {
1081
- title: 'Agent Roles',
1082
- content: `# Agent Roles
1083
-
1084
- Roles specialize agents for different types of work.
1085
-
1086
- ## Available Roles
1087
-
1088
- | Role | Description |
1089
- |------|-------------|
1090
- | \`developer\` | General development work (default) |
1091
- | \`validator\` | Reviews and validates completed tasks |
1092
- | \`deployer\` | Handles deployments |
1093
- | \`reviewer\` | Code review focus |
1094
- | \`maintainer\` | Housekeeping and maintenance |
1095
-
1096
- ## Setting Your Role
1097
-
1098
- At session start:
1099
- \`\`\`
1100
- start_work_session(git_url, model, role: "validator")
1101
- \`\`\`
1102
-
1103
- Or mid-session:
1104
- \`\`\`
1105
- set_session_role(role: "validator")
1106
- \`\`\`
1107
-
1108
- ## Role Configuration
1109
-
1110
- View project role settings:
1111
- \`\`\`
1112
- get_role_settings(project_id)
1113
- \`\`\`
1114
-
1115
- Configure role behavior:
1116
- \`\`\`
1117
- update_role_settings(
1118
- project_id,
1119
- role: "validator",
1120
- enabled: true,
1121
- auto_assign_validation: true,
1122
- fallback_activities: ["code_review", "security_review"]
1123
- )
1124
- \`\`\`
1125
-
1126
- ## Viewing Agents by Role
1127
-
1128
- \`\`\`
1129
- get_agents_by_role(project_id)
1130
- \`\`\`
1131
-
1132
- With counts only (saves tokens):
1133
- \`\`\`
1134
- get_agents_by_role(project_id, counts_only: true)
1135
- \`\`\`
1136
-
1137
- ## Role-Specific Workflows
1138
-
1139
- **Developer:**
1140
- - Gets tasks via \`get_next_task\`
1141
- - Creates PRs
1142
- - Calls \`complete_task\`
1143
-
1144
- **Validator:**
1145
- - Gets tasks via \`get_tasks_awaiting_validation\`
1146
- - Reviews code, runs tests
1147
- - Approves/rejects via \`validate_task\`
1148
- - Merges PRs on approval
1149
-
1150
- **Deployer:**
1151
- - Checks \`check_deployment_status\`
1152
- - Validates deployments
1153
- - Executes deployments
1154
- - Handles rollbacks`,
1155
- },
1156
-
1157
- knowledge: {
1158
- title: 'Project Knowledge Base',
1159
- content: `# Project Knowledge Base
1160
-
1161
- Query aggregated project knowledge efficiently.
1162
-
1163
- ## Querying Knowledge
1164
-
1165
- \`\`\`
1166
- query_knowledge_base(
1167
- project_id,
1168
- categories: ["findings", "decisions", "completed_tasks"],
1169
- scope: "summary", // summary or detailed
1170
- limit: 10,
1171
- search_query: "authentication"
1172
- )
1173
- \`\`\`
1174
-
1175
- ## Categories
1176
-
1177
- | Category | Description |
1178
- |----------|-------------|
1179
- | \`findings\` | Audit findings, code issues |
1180
- | \`qa\` | Questions and answers |
1181
- | \`decisions\` | Architectural decisions |
1182
- | \`completed_tasks\` | Recently completed work |
1183
- | \`blockers\` | Resolved blockers |
1184
- | \`progress\` | Progress updates |
1185
-
1186
- ## Recording Knowledge
1187
-
1188
- ### Findings
1189
- \`\`\`
1190
- add_finding(
1191
- project_id,
1192
- title: "N+1 query in user list",
1193
- category: "performance",
1194
- severity: "medium",
1195
- description: "User list makes N+1 queries for profile images",
1196
- file_path: "src/api/users.ts"
1197
- )
1198
- \`\`\`
1199
-
1200
- ### Decisions
1201
- \`\`\`
1202
- log_decision(
1203
- project_id,
1204
- title: "Use PostgreSQL for database",
1205
- description: "Selected PostgreSQL over MongoDB",
1206
- rationale: "Better support for complex queries and transactions",
1207
- alternatives_considered: ["MongoDB", "MySQL"]
1208
- )
1209
- \`\`\`
1210
-
1211
- ### Ideas
1212
- \`\`\`
1213
- add_idea(
1214
- project_id,
1215
- title: "Add caching layer",
1216
- description: "Redis cache for frequently accessed data",
1217
- status: "raw" // raw, exploring, planned, in_development, shipped
1218
- )
1219
- \`\`\`
1220
-
1221
- ## Efficiency
1222
-
1223
- Use \`query_knowledge_base\` instead of multiple separate calls:
1224
- - Single call returns aggregated data
1225
- - Filter by category to reduce response size
1226
- - Use \`summary\` scope for token efficiency`,
1227
- },
1228
-
1229
- bodies_of_work: {
1230
- title: 'Bodies of Work',
1231
- content: `# Bodies of Work
1232
-
1233
- Bodies of work group related tasks into phases for coordinated execution.
1234
-
1235
- ## Creating a Body of Work
1236
-
1237
- \`\`\`
1238
- create_body_of_work(
1239
- project_id,
1240
- title: "User Authentication Feature",
1241
- description: "Complete auth system with OAuth support",
1242
- auto_deploy_on_completion: true,
1243
- deploy_version_bump: "minor"
1244
- )
1245
- \`\`\`
1246
-
1247
- ## Task Phases
1248
-
1249
- Tasks are organized into three phases:
1250
- - **pre** - Setup, migrations, dependencies
1251
- - **core** - Main implementation work
1252
- - **post** - Cleanup, documentation, verification
1253
-
1254
- ## Adding Tasks
1255
-
1256
- \`\`\`
1257
- add_task_to_body_of_work(
1258
- body_of_work_id,
1259
- task_id,
1260
- phase: "core" // pre, core, post
1261
- )
1262
- \`\`\`
1263
-
1264
- ## Task Dependencies
1265
-
1266
- Create dependencies between tasks:
1267
- \`\`\`
1268
- add_task_dependency(
1269
- body_of_work_id,
1270
- task_id: "frontend-task",
1271
- depends_on_task_id: "api-task"
1272
- )
1273
- \`\`\`
1274
-
1275
- The dependent task won't be available until its dependencies are complete.
1276
-
1277
- ## Activating
1278
-
1279
- Bodies of work start in "draft" status. Activate to begin:
1280
- \`\`\`
1281
- activate_body_of_work(body_of_work_id)
1282
- \`\`\`
1283
-
1284
- ## Getting Next Task
1285
-
1286
- \`\`\`
1287
- get_next_body_of_work_task(body_of_work_id)
1288
- \`\`\`
1289
-
1290
- Returns the next available task considering:
1291
- - Phase order (pre → core → post)
1292
- - Task dependencies
1293
- - Task status
1294
-
1295
- ## Viewing Bodies of Work
1296
-
1297
- \`\`\`
1298
- get_body_of_work(body_of_work_id) // Single BOW with tasks
1299
- get_bodies_of_work(project_id) // All BOWs for project
1300
- \`\`\`
1301
-
1302
- ## Auto-Deployment
1303
-
1304
- If \`auto_deploy_on_completion: true\`, a deployment is automatically requested when all tasks complete.
1305
-
1306
- Configure the trigger:
1307
- - \`all_completed\` - Deploy immediately when all tasks done
1308
- - \`all_completed_validated\` - Wait for validation first`,
1309
- },
1310
-
1311
- subtasks: {
1312
- title: 'Subtasks',
1313
- content: `# Subtasks
1314
-
1315
- Subtasks break down larger tasks into smaller, parallelizable pieces.
1316
-
1317
- ## Adding Subtasks
1318
-
1319
- \`\`\`
1320
- add_subtask(
1321
- parent_task_id,
1322
- title: "Implement login form UI",
1323
- description: "Create React component for login form",
1324
- priority: 2,
1325
- estimated_minutes: 60
1326
- )
1327
- \`\`\`
1328
-
1329
- ## Viewing Subtasks
1330
-
1331
- \`\`\`
1332
- get_subtasks(parent_task_id)
1333
- \`\`\`
1334
-
1335
- Or include when getting task:
1336
- \`\`\`
1337
- get_task(task_id, include_subtasks: true)
1338
- \`\`\`
1339
-
1340
- ## Working on Subtasks
1341
-
1342
- Subtasks work just like regular tasks:
1343
- \`\`\`
1344
- update_task(subtask_id, status: "in_progress")
1345
- complete_task(subtask_id, summary: "Completed login form")
1346
- \`\`\`
1347
-
1348
- ## Subtasks vs Milestones
1349
-
1350
- | Subtasks | Milestones |
1351
- |----------|------------|
1352
- | Independent units of work | Sequential steps |
1353
- | Can be claimed by any agent | Same agent completes all |
1354
- | Parallel execution | One at a time |
1355
- | Full task lifecycle | Simple status tracking |
1356
-
1357
- **Use subtasks when:**
1358
- - Work can be done in parallel by multiple agents
1359
- - Each piece is independent and self-contained
1360
- - You want to delegate work
1361
-
1362
- **Use milestones when:**
1363
- - Steps must be done in order
1364
- - Same person does all steps
1365
- - Just need progress tracking
1366
-
1367
- ## Constraints
1368
-
1369
- - Max depth is 1 (subtasks cannot have their own subtasks)
1370
- - Subtasks inherit project from parent task
1371
- - Parent task completion is independent of subtasks`,
1372
- },
1373
-
1374
- file_locks: {
1375
- title: 'File Locking',
1376
- content: `# File Locking (Multi-Agent Coordination)
1377
-
1378
- Prevent conflicts when multiple agents work on the same files.
1379
-
1380
- ## Checking Availability
1381
-
1382
- Before editing a file:
1383
- \`\`\`
1384
- is_file_available(project_id, file_path: "src/api/users.ts")
1385
- \`\`\`
1386
-
1387
- Returns whether the file is free or who has it locked.
1388
-
1389
- ## Checking Out Files
1390
-
1391
- Lock a file before editing:
1392
- \`\`\`
1393
- checkout_file(
1394
- project_id,
1395
- file_path: "src/api/users.ts",
1396
- reason: "Fixing authentication bug"
1397
- )
1398
- \`\`\`
1399
-
1400
- ## Checking In Files
1401
-
1402
- Release the file when done:
1403
- \`\`\`
1404
- checkin_file(
1405
- checkout_id,
1406
- summary: "Fixed token validation logic"
1407
- )
1408
- \`\`\`
1409
-
1410
- Or by path:
1411
- \`\`\`
1412
- checkin_file(
1413
- project_id,
1414
- file_path: "src/api/users.ts",
1415
- summary: "Fixed token validation logic"
1416
- )
1417
- \`\`\`
1418
-
1419
- ## Viewing Checkouts
1420
-
1421
- \`\`\`
1422
- get_file_checkouts(project_id) // Active checkouts
1423
- get_file_checkouts(project_id, status: "checked_in") // Completed
1424
- get_file_checkouts_stats(project_id) // Just counts
1425
- \`\`\`
1426
-
1427
- ## Handling Abandoned Locks
1428
-
1429
- If an agent session dies with a file locked:
1430
- \`\`\`
1431
- abandon_checkout(
1432
- checkout_id,
1433
- reason: "Agent session terminated"
1434
- )
1435
- \`\`\`
1436
-
1437
- ## Best Practices
1438
-
1439
- 1. **Always check availability** before editing shared files
1440
- 2. **Keep locks short** - check in as soon as you're done
1441
- 3. **Use meaningful reasons** - helps others understand why file is locked
1442
- 4. **Check in even if no changes** - releases the lock for others
1443
- 5. **Use worktrees** - provides file isolation, reducing need for locks`,
1444
- },
1445
-
1446
- connectors: {
1447
- title: 'External Connectors',
1448
- content: `# External Connectors
1449
-
1450
- Connectors enable sending events to external services.
1451
-
1452
- ## Supported Types
1453
-
1454
- | Type | Description |
1455
- |------|-------------|
1456
- | \`webhook\` | Generic HTTP webhook |
1457
- | \`slack\` | Slack notifications |
1458
- | \`discord\` | Discord notifications |
1459
- | \`github\` | GitHub integration |
1460
- | \`custom\` | Custom connector |
1461
-
1462
- ## Adding a Connector
1463
-
1464
- Slack example:
1465
- \`\`\`
1466
- add_connector(
1467
- project_id,
1468
- name: "Slack Notifications",
1469
- type: "slack",
1470
- config: { webhook_url: "https://hooks.slack.com/..." },
1471
- events: {
1472
- task_completed: true,
1473
- blocker_added: true,
1474
- deployment_started: true
1475
- }
1476
- )
1477
- \`\`\`
1478
-
1479
- Webhook example:
1480
- \`\`\`
1481
- add_connector(
1482
- project_id,
1483
- name: "CI/CD Webhook",
1484
- type: "webhook",
1485
- config: {
1486
- url: "https://ci.example.com/webhook",
1487
- headers: { "X-API-Key": "secret" }
1488
- },
1489
- events: { deployment_completed: true }
1490
- )
1491
- \`\`\`
1492
-
1493
- ## Available Events
1494
-
1495
- - \`task_completed\` - Task marked done
1496
- - \`task_validated\` - Task approved/rejected
1497
- - \`blocker_added\` - New blocker recorded
1498
- - \`blocker_resolved\` - Blocker resolved
1499
- - \`deployment_started\` - Deployment began
1500
- - \`deployment_completed\` - Deployment finished
1501
- - \`agent_session_started\` - Agent connected
1502
- - \`agent_session_ended\` - Agent disconnected
1503
-
1504
- ## Managing Connectors
1505
-
1506
- \`\`\`
1507
- get_connectors(project_id) // List all
1508
- get_connector(connector_id) // Get details
1509
- update_connector(connector_id, ...) // Update config
1510
- delete_connector(connector_id) // Remove
1511
- \`\`\`
1512
-
1513
- ## Testing
1514
-
1515
- \`\`\`
1516
- test_connector(connector_id)
1517
- \`\`\`
1518
-
1519
- Sends a test event and returns success/failure.
1520
-
1521
- ## Event History
1522
-
1523
- \`\`\`
1524
- get_connector_events(connector_id)
1525
- get_connector_events(project_id) // All connectors
1526
- \`\`\``,
1527
- },
1528
-
1529
- git_issues: {
1530
- title: 'Git Issues',
1531
- content: `# Git Issues
1532
-
1533
- Track and resolve git-related problems.
1534
-
1535
- ## Issue Types
1536
-
1537
- | Type | Description |
1538
- |------|-------------|
1539
- | \`merge_conflict\` | Conflicting changes |
1540
- | \`push_failed\` | Push rejected |
1541
- | \`rebase_needed\` | Branch needs rebase |
1542
- | \`branch_diverged\` | Branch diverged from base |
1543
- | \`pr_not_mergeable\` | PR cannot be merged |
1544
-
1545
- ## Recording Issues
1546
-
1547
- \`\`\`
1548
- add_git_issue(
1549
- project_id,
1550
- issue_type: "merge_conflict",
1551
- branch: "feature/add-auth",
1552
- target_branch: "develop",
1553
- conflicting_files: ["src/api/users.ts", "src/models/user.ts"],
1554
- task_id: "task-uuid", // Optional
1555
- error_message: "Automatic merge failed"
1556
- )
1557
- \`\`\`
1558
-
1559
- ## Viewing Issues
1560
-
1561
- \`\`\`
1562
- get_git_issues(project_id) // Open issues
1563
- get_git_issues(project_id, status: "resolved") // Resolved
1564
- get_git_issues(project_id, branch: "feature/x") // By branch
1565
- get_git_issues(project_id, issue_type: "merge_conflict") // By type
1566
- \`\`\`
1567
-
1568
- ## Resolving Issues
1569
-
1570
- \`\`\`
1571
- resolve_git_issue(
1572
- git_issue_id,
1573
- resolution_note: "Rebased branch and resolved conflicts manually"
1574
- )
1575
- \`\`\`
1576
-
1577
- Auto-resolved (e.g., PR became mergeable):
1578
- \`\`\`
1579
- resolve_git_issue(
1580
- git_issue_id,
1581
- auto_resolved: true,
1582
- resolution_note: "PR automatically became mergeable after upstream merge"
1583
- )
1584
- \`\`\`
1585
-
1586
- ## Handling Merge Conflicts
1587
-
1588
- 1. **Fetch latest changes:**
1589
- \`\`\`bash
1590
- git fetch origin
1591
- \`\`\`
1592
-
1593
- 2. **Rebase on target:**
1594
- \`\`\`bash
1595
- git rebase origin/develop
1596
- \`\`\`
1597
-
1598
- 3. **Resolve conflicts in editor**
1599
-
1600
- 4. **Continue rebase:**
1601
- \`\`\`bash
1602
- git add .
1603
- git rebase --continue
1604
- \`\`\`
1605
-
1606
- 5. **Force push:**
1607
- \`\`\`bash
1608
- git push --force-with-lease
1609
- \`\`\`
1610
-
1611
- 6. **Resolve the issue:**
1612
- \`\`\`
1613
- resolve_git_issue(git_issue_id, resolution_note: "Rebased and resolved")
1614
- \`\`\``,
1615
- },
1616
-
1617
- ideas: {
1618
- title: 'Ideas & Feature Requests',
1619
- content: `# Ideas & Feature Requests
1620
-
1621
- Track improvement ideas and feature requests.
1622
-
1623
- ## Adding Ideas
1624
-
1625
- \`\`\`
1626
- add_idea(
1627
- project_id,
1628
- title: "Add dark mode support",
1629
- description: "Implement theme switching with dark mode option",
1630
- status: "raw" // Default status
1631
- )
1632
- \`\`\`
1633
-
1634
- ## Idea Lifecycle
1635
-
1636
- | Status | Description |
1637
- |--------|-------------|
1638
- | \`raw\` | Initial idea, not yet evaluated |
1639
- | \`exploring\` | Being researched/discussed |
1640
- | \`planned\` | Approved for implementation |
1641
- | \`in_development\` | Being worked on |
1642
- | \`shipped\` | Completed and deployed |
1643
-
1644
- ## Updating Ideas
1645
-
1646
- \`\`\`
1647
- update_idea(
1648
- idea_id,
1649
- status: "planned",
1650
- doc_url: "https://docs.example.com/dark-mode-spec"
1651
- )
1652
- \`\`\`
1653
-
1654
- ## Converting to Task
1655
-
1656
- When ready to implement:
1657
- \`\`\`
1658
- convert_idea_to_task(
1659
- idea_id,
1660
- priority: 2,
1661
- estimated_minutes: 120,
1662
- update_status: true // Sets idea to "in_development"
1663
- )
1664
- \`\`\`
1665
-
1666
- This creates a task linked to the idea.
1667
-
1668
- ## Viewing Ideas
1669
-
1670
- \`\`\`
1671
- get_ideas(project_id) // All ideas
1672
- get_ideas(project_id, status: "planned") // Ready to build
1673
- get_ideas(project_id, search_query: "dark") // Search
1674
- get_idea(idea_id) // Single idea
1675
- \`\`\`
1676
-
1677
- ## Best Practices
1678
-
1679
- 1. **Capture ideas immediately** - Don't lose them
1680
- 2. **Be specific** - Include context and rationale
1681
- 3. **Link documentation** - Add doc_url when available
1682
- 4. **Update status** - Keep ideas current
1683
- 5. **Convert when ready** - Move to tasks for execution`,
1684
- },
1685
-
1686
- requests: {
1687
- title: 'User Requests',
1688
- content: `# User Requests
1689
-
1690
- Handle questions and requests from users via the dashboard.
1691
-
1692
- ## Checking for Requests
1693
-
1694
- Requests are included in \`start_work_session\` response:
1695
- - \`pending_requests\` - Array of unanswered requests
1696
- - \`URGENT_QUESTIONS\` - High-priority questions
1697
-
1698
- ## Getting Pending Requests
1699
-
1700
- \`\`\`
1701
- get_pending_requests(project_id)
1702
- \`\`\`
1703
-
1704
- ## Answering Questions
1705
-
1706
- \`\`\`
1707
- answer_question(
1708
- request_id,
1709
- answer: "The authentication flow uses JWT tokens stored in httpOnly cookies. Tokens expire after 24 hours and are automatically refreshed."
1710
- )
1711
- \`\`\`
1712
-
1713
- ## Acknowledging Requests
1714
-
1715
- For non-question requests:
1716
- \`\`\`
1717
- acknowledge_request(request_id)
1718
- \`\`\`
1719
-
1720
- ## Priority
1721
-
1722
- When \`start_work_session\` returns pending requests:
1723
- 1. Answer questions FIRST (before starting tasks)
1724
- 2. \`URGENT_QUESTIONS\` take absolute priority
1725
- 3. Then proceed with \`next_task\`
1726
-
1727
- ## Best Practices
1728
-
1729
- 1. **Check requests early** - Answer before deep work
1730
- 2. **Be thorough** - Provide complete answers
1731
- 3. **Include context** - Reference code/docs when helpful
1732
- 4. **Acknowledge promptly** - Don't leave users waiting`,
1733
- },
1734
- };
1735
-
1736
- /**
1737
- * Get fallback help content for a topic
1738
- * @param topic The help topic slug
1739
- * @returns The help content or null if topic not found
1740
- */
1741
- export function getFallbackHelpContent(topic: string): { title: string; content: string } | null {
1742
- return HELP_TOPICS[topic] || null;
1743
- }
1744
-
1745
- /**
1746
- * Get list of available help topics
1747
- * @returns Array of topic slugs
1748
- */
1749
- export function getAvailableHelpTopics(): string[] {
1750
- return Object.keys(HELP_TOPICS);
1751
- }
1
+ /**
2
+ * Fallback Help Content
3
+ *
4
+ * This provides comprehensive help content for each topic when the backend
5
+ * database has no content populated. Ensures agents always get useful guidance.
6
+ */
7
+
8
+ export const HELP_TOPICS: Record<string, { title: string; content: string }> = {
9
+ getting_started: {
10
+ title: 'Getting Started',
11
+ content: `# Getting Started with Vibescope
12
+
13
+ ## Quick Start
14
+
15
+ \`\`\`
16
+ start_work_session(git_url: "https://github.com/YOUR/REPO", model: "opus", agent_type: "claude")
17
+ \`\`\`
18
+
19
+ **Parameters:**
20
+ - \`git_url\`: Your repository URL (required if no project_id)
21
+ - \`model\`: Your model type - opus, sonnet, or haiku (for cost tracking)
22
+ - \`agent_type\`: Your agent type - claude, gemini, cursor, windsurf, or other
23
+
24
+ This returns:
25
+ - \`session_id\`: Your session identifier
26
+ - \`persona\`: Your assigned agent persona (e.g., "Nova", "Edge")
27
+ - \`project\`: Project details and settings
28
+ - \`next_task\`: The highest priority task to work on
29
+
30
+ ## Core Workflow
31
+
32
+ 1. **Start session** → \`start_work_session(git_url, model, agent_type)\`
33
+ 2. **Mark task in progress** → \`update_task(task_id, status: "in_progress")\`
34
+ 3. **Update progress** → \`update_task(task_id, progress_percentage: 50, progress_note: "...")\`
35
+ 4. **Complete task** → \`complete_task(task_id, summary: "...")\`
36
+ 5. **Continue** → Start the next_task returned, or call \`get_next_task(project_id)\`
37
+
38
+ ## Key Rules
39
+
40
+ 1. **Always call complete_task()** after finishing work - don't wait for PR review
41
+ 2. **Never ask permission** to continue - just start the next task
42
+ 3. **Use git worktrees** for branching workflows to avoid conflicts
43
+ 4. **Update progress** regularly (every 15-20% completion)
44
+
45
+ ## Need More Help?
46
+
47
+ Use \`get_help(topic)\` with these topics:
48
+ - \`tasks\` - Task management workflow
49
+ - \`validation\` - Cross-agent task validation
50
+ - \`git\` - Git workflow and worktrees
51
+ - \`deployment\` - Deployment coordination
52
+ - \`session\` - Session management
53
+ - \`fallback\` - Background activities
54
+ - \`blockers\` - Handling blockers
55
+ - \`milestones\` - Breaking down complex tasks`,
56
+ },
57
+
58
+ session: {
59
+ title: 'Session Management',
60
+ content: `# Session Management
61
+
62
+ ## Starting a Session
63
+
64
+ \`\`\`
65
+ start_work_session(
66
+ git_url: "https://github.com/YOUR/REPO",
67
+ model: "opus", // opus, sonnet, or haiku
68
+ agent_type: "claude", // claude, gemini, cursor, windsurf, other
69
+ role: "developer" // developer, validator, deployer, reviewer, maintainer
70
+ )
71
+ \`\`\`
72
+
73
+ **Response includes:**
74
+ - \`session_id\`: Unique session identifier
75
+ - \`persona\`: Your assigned agent name (e.g., "Nova", "Edge", "Arc")
76
+ - \`project\`: Project configuration
77
+ - \`next_task\`: Highest priority task to start
78
+ - \`pending_requests\`: User questions to answer first
79
+ - \`awaiting_validation\`: Tasks needing review (for validators)
80
+ - \`stale_worktrees\`: Worktrees to clean up
81
+
82
+ ## Maintaining Your Session
83
+
84
+ ### Heartbeat
85
+ Send heartbeats every 30-60 seconds to stay active:
86
+ \`\`\`
87
+ heartbeat(current_worktree_path: "../project-persona-task")
88
+ \`\`\`
89
+
90
+ This:
91
+ - Keeps your session marked as "active" on the dashboard
92
+ - Reports your current working directory
93
+ - Syncs token usage to the backend
94
+
95
+ ### Token Tracking
96
+ Check your token usage:
97
+ \`\`\`
98
+ get_token_usage()
99
+ \`\`\`
100
+
101
+ Report actual API usage for accurate cost tracking:
102
+ \`\`\`
103
+ report_token_usage(input_tokens: 1500, output_tokens: 500, model: "opus")
104
+ \`\`\`
105
+
106
+ ## Ending a Session
107
+
108
+ \`\`\`
109
+ end_work_session()
110
+ \`\`\`
111
+
112
+ This:
113
+ - Releases any claimed tasks
114
+ - Syncs final token usage
115
+ - Returns a session summary
116
+
117
+ ## Context Management
118
+
119
+ When your context grows large (50+ tool calls or 100k+ tokens):
120
+ 1. Run \`/clear\` to reset conversation
121
+ 2. Immediately call \`start_work_session()\` to reload
122
+ 3. Continue with the \`next_task\` from the response
123
+
124
+ **Do NOT ask the user** - just clear and continue. The dashboard tracks all progress.
125
+
126
+ ## Session Roles
127
+
128
+ | Role | Description |
129
+ |------|-------------|
130
+ | \`developer\` | General development work (default) |
131
+ | \`validator\` | Reviews and validates completed tasks |
132
+ | \`deployer\` | Handles deployments |
133
+ | \`reviewer\` | Code review focus |
134
+ | \`maintainer\` | Housekeeping and maintenance |
135
+
136
+ Change role mid-session:
137
+ \`\`\`
138
+ set_session_role(role: "validator")
139
+ \`\`\``,
140
+ },
141
+
142
+ tasks: {
143
+ title: 'Task Management',
144
+ content: `# Task Management
145
+
146
+ ## Getting Tasks
147
+
148
+ ### Get Next Task
149
+ \`\`\`
150
+ get_next_task(project_id)
151
+ \`\`\`
152
+ Returns the highest priority pending task.
153
+
154
+ ### Search Tasks
155
+ \`\`\`
156
+ search_tasks(project_id, query: "login bug", status: ["pending", "in_progress"])
157
+ \`\`\`
158
+
159
+ ### Get by Priority
160
+ \`\`\`
161
+ get_tasks_by_priority(project_id, priority: 1) // P1 tasks only
162
+ get_tasks_by_priority(project_id, priority: 1, priority_max: 2) // P1 and P2
163
+ \`\`\`
164
+
165
+ ## Working on Tasks
166
+
167
+ ### 1. Start the Task
168
+ \`\`\`
169
+ update_task(task_id, status: "in_progress")
170
+ \`\`\`
171
+
172
+ **For branching workflows (github-flow, git-flow):**
173
+ Create a worktree first, then include it:
174
+ \`\`\`
175
+ update_task(
176
+ task_id,
177
+ status: "in_progress",
178
+ git_branch: "feature/abc123-add-login",
179
+ worktree_path: "../project-persona-add-login"
180
+ )
181
+ \`\`\`
182
+
183
+ ### 2. Update Progress
184
+ Update regularly (every 15-20% completion):
185
+ \`\`\`
186
+ update_task(
187
+ task_id,
188
+ progress_percentage: 50,
189
+ progress_note: "Implemented core logic, working on tests"
190
+ )
191
+ \`\`\`
192
+
193
+ ### 3. Complete the Task
194
+ **CRITICAL: Always call complete_task() after finishing!**
195
+ \`\`\`
196
+ complete_task(task_id, summary: "Added login flow with OAuth support")
197
+ \`\`\`
198
+
199
+ **When to call complete_task:**
200
+ - After creating and pushing a PR
201
+ - After merging (trunk-based workflow)
202
+ - After finishing any unit of work
203
+
204
+ **Do NOT wait for:**
205
+ - PR review/merge (validation handles that)
206
+ - User confirmation
207
+ - Perfect summary
208
+
209
+ ### Fix Already Exists (No Code Changes Needed)
210
+
211
+ When investigating a task and finding the fix already exists in code but hasn't been deployed:
212
+
213
+ 1. **Document the finding:**
214
+ \`\`\`
215
+ add_finding(
216
+ project_id,
217
+ title: "Fix exists but awaits deployment",
218
+ category: "other",
219
+ severity: "info",
220
+ description: "The fix for [issue] was implemented in PR #{pr_number} but hasn't been deployed yet.",
221
+ related_task_id: task_id
222
+ )
223
+ \`\`\`
224
+
225
+ 2. **Complete the task** (investigation is done):
226
+ \`\`\`
227
+ complete_task(task_id, summary: "Fix already exists in codebase (PR #{pr_number}). Needs deployment to production.")
228
+ \`\`\`
229
+
230
+ 3. **Request deployment** if not already pending:
231
+ \`\`\`
232
+ check_deployment_status(project_id) // Check if deployment pending
233
+ request_deployment(project_id, notes: "Includes fix for [issue]")
234
+ \`\`\`
235
+
236
+ This prevents tasks from being blocked waiting for deployment when the actual work is done.
237
+
238
+ ## Task Priorities
239
+
240
+ | Priority | Meaning |
241
+ |----------|---------|
242
+ | 1 | Critical - do first |
243
+ | 2 | High priority |
244
+ | 3 | Normal (default) |
245
+ | 4 | Low priority |
246
+ | 5 | Backlog |
247
+
248
+ ## Breaking Down Tasks
249
+
250
+ For complex tasks, use milestones:
251
+ \`\`\`
252
+ add_milestone(task_id, title: "Set up database schema")
253
+ add_milestone(task_id, title: "Implement API endpoints")
254
+ add_milestone(task_id, title: "Add unit tests")
255
+
256
+ complete_milestone(milestone_id)
257
+ \`\`\`
258
+
259
+ Or subtasks for parallel work:
260
+ \`\`\`
261
+ add_subtask(parent_task_id, title: "Implement frontend form")
262
+ add_subtask(parent_task_id, title: "Implement backend validation")
263
+ \`\`\`
264
+
265
+ ## Task References
266
+
267
+ Link PRs, issues, or docs to tasks:
268
+ \`\`\`
269
+ add_task_reference(task_id, url: "https://github.com/org/repo/pull/123", label: "PR")
270
+ \`\`\`
271
+
272
+ **Important:** For github-flow/git-flow projects, add PR reference before completing - validators need it.
273
+
274
+ ## Deployment-Only Resolutions
275
+
276
+ When investigating a task and finding the fix already exists in code (just needs deployment):
277
+
278
+ **1. Document the finding:**
279
+ \`\`\`
280
+ add_finding(
281
+ project_id,
282
+ title: "Fix exists - needs deployment",
283
+ category: "other",
284
+ severity: "info",
285
+ description: "Investigation found the fix for [issue] already exists in [commit/PR]. Deployment will resolve this."
286
+ )
287
+ \`\`\`
288
+
289
+ **2. Mark the task complete:**
290
+ \`\`\`
291
+ complete_task(task_id, summary: "Investigation complete: fix exists in [branch/commit], pending deployment")
292
+ \`\`\`
293
+
294
+ **3. Request deployment if needed:**
295
+ \`\`\`
296
+ # Check if deployment is already pending
297
+ check_deployment_status(project_id)
298
+
299
+ # If not, request one
300
+ request_deployment(project_id, notes: "Includes fix for [task description]")
301
+ \`\`\`
302
+
303
+ **Why this pattern?**
304
+ - Tasks shouldn't block waiting for deployment
305
+ - Investigation work is complete (resolution identified)
306
+ - The finding creates a record of what needs deploying
307
+ - Deployment can bundle multiple fixes together`,
308
+ },
309
+
310
+ validation: {
311
+ title: 'Task Validation',
312
+ content: `# Task Validation
313
+
314
+ Validation ensures completed work meets quality standards before merging.
315
+
316
+ ## For Developers
317
+
318
+ After completing a task:
319
+ 1. Create your PR
320
+ 2. Add PR reference: \`add_task_reference(task_id, url: "PR_URL")\`
321
+ 3. Call \`complete_task(task_id, summary: "...")\`
322
+ 4. A validator will review and merge
323
+
324
+ ## For Validators
325
+
326
+ ### 1. Get Tasks to Validate
327
+ \`\`\`
328
+ get_tasks_awaiting_validation(project_id)
329
+ \`\`\`
330
+ Returns tasks sorted by PR number (oldest first). **Always review in this order (FIFO).**
331
+
332
+ ### 2. Claim a Task
333
+ \`\`\`
334
+ claim_validation(task_id)
335
+ \`\`\`
336
+
337
+ Returns:
338
+ - \`worktree_setup\`: Commands to checkout the branch
339
+ - \`conflict_check\`: Steps to verify PR can merge
340
+ - \`merge_status\`: Current PR state
341
+
342
+ ### 3. Set Up Your Worktree
343
+ \`\`\`bash
344
+ # Fetch and create worktree from existing branch
345
+ git fetch origin feature/abc123-task
346
+ git worktree add ../project-validator-review feature/abc123-task
347
+ cd ../project-validator-review
348
+ \`\`\`
349
+
350
+ ### 4. Run Tests Locally
351
+ \`\`\`bash
352
+ pnpm install
353
+ pnpm test
354
+ pnpm build
355
+ \`\`\`
356
+
357
+ ### 5. Check PR State
358
+ \`\`\`bash
359
+ gh pr view <PR_NUMBER> --json state,mergedAt --jq '.state'
360
+ \`\`\`
361
+
362
+ If PR is CLOSED (not merged), cancel instead of validating:
363
+ \`\`\`
364
+ cancel_task(task_id, cancelled_reason: "pr_closed")
365
+ \`\`\`
366
+
367
+ ### 6. Approve or Reject
368
+
369
+ **If APPROVED:**
370
+ \`\`\`
371
+ validate_task(task_id, approved: true, validation_notes: "Tests pass, code looks good")
372
+ \`\`\`
373
+ Then merge the PR and clean up:
374
+ \`\`\`bash
375
+ gh pr merge <PR_NUMBER> --squash
376
+ cd ../project && git worktree remove ../project-validator-review
377
+ \`\`\`
378
+
379
+ **If REJECTED:**
380
+ \`\`\`
381
+ validate_task(
382
+ task_id,
383
+ approved: false,
384
+ validation_notes: "Tests failing in auth module",
385
+ create_fix_task: true // Creates a fix task on the same branch
386
+ )
387
+ \`\`\`
388
+ Then clean up your worktree - the fix agent will create their own.
389
+
390
+ ## Handling Merge Conflicts
391
+
392
+ If \`claim_validation\` shows merge conflicts:
393
+ 1. Follow the \`rebase_instructions.steps\`
394
+ 2. Resolve conflicts in your editor
395
+ 3. Force push with \`--force-with-lease\`
396
+ 4. Call \`claim_validation\` again to verify
397
+
398
+ Record git issues:
399
+ \`\`\`
400
+ add_git_issue(
401
+ project_id,
402
+ issue_type: "merge_conflict",
403
+ branch: "feature-branch",
404
+ target_branch: "develop",
405
+ task_id: task_id
406
+ )
407
+ \`\`\``,
408
+ },
409
+
410
+ git: {
411
+ title: 'Git Workflow',
412
+ content: `# Git Workflow
413
+
414
+ ## Supported Workflows
415
+
416
+ | Workflow | Description |
417
+ |----------|-------------|
418
+ | \`none\` | No branching, direct commits |
419
+ | \`trunk-based\` | Commit directly to main |
420
+ | \`github-flow\` | Feature branches + PRs to main |
421
+ | \`git-flow\` | Feature branches off develop, PRs to develop |
422
+
423
+ Check your project's workflow:
424
+ \`\`\`
425
+ get_git_workflow(project_id)
426
+ \`\`\`
427
+
428
+ ## Git Worktrees (CRITICAL)
429
+
430
+ **For github-flow and git-flow projects, you MUST use worktrees.**
431
+
432
+ ### Rebase Before PR (MANDATORY)
433
+
434
+ **Always rebase your branch before creating a PR.** This prevents overwrites of other agents' work.
435
+
436
+ \`\`\`bash
437
+ # Before creating PR, rebase onto latest base branch
438
+ git fetch origin
439
+ git rebase origin/develop # or origin/main for github-flow
440
+ # Resolve any conflicts
441
+ git push --force-with-lease
442
+ \`\`\`
443
+
444
+ **Why?** Without rebasing, your branch may contain old versions of files that other agents modified. When merged, your old version overwrites their changes.
445
+
446
+ ### Why Worktrees?
447
+ Multiple agents sharing one repo will conflict:
448
+ - Switching branches affects all agents
449
+ - Uncommitted changes collide
450
+ - Direct commits create merge conflicts
451
+
452
+ Worktrees give each task an isolated working directory.
453
+
454
+ ### Worktree Workflow
455
+
456
+ **1. Create worktree BEFORE making any edits:**
457
+ \`\`\`bash
458
+ # Naming: ../PROJECT-PERSONA-short-description
459
+ git worktree add ../Vibescope-Nova-add-login -b feature/abc123-add-login develop
460
+ cd ../Vibescope-Nova-add-login
461
+ \`\`\`
462
+
463
+ **2. Report your location:**
464
+ \`\`\`
465
+ heartbeat(current_worktree_path: "../Vibescope-Nova-add-login")
466
+ \`\`\`
467
+
468
+ **3. Update the task:**
469
+ \`\`\`
470
+ update_task(
471
+ task_id,
472
+ status: "in_progress",
473
+ git_branch: "feature/abc123-add-login",
474
+ worktree_path: "../Vibescope-Nova-add-login"
475
+ )
476
+ \`\`\`
477
+
478
+ **4. Do your work, commit, push, create PR**
479
+
480
+ **5. Clean up IMMEDIATELY after opening PR:**
481
+ \`\`\`bash
482
+ cd ../Vibescope # Return to main repo
483
+ git worktree remove ../Vibescope-Nova-add-login
484
+ \`\`\`
485
+ Then clear the path:
486
+ \`\`\`
487
+ clear_worktree_path(task_id)
488
+ \`\`\`
489
+
490
+ ### NO EXCEPTIONS
491
+
492
+ Even for:
493
+ - "Quick fixes" → Use a worktree
494
+ - "Urgent hotfixes" → Use a worktree
495
+ - "One line changes" → Use a worktree
496
+
497
+ ### Wrong vs Right Order
498
+
499
+ **WRONG:**
500
+ 1. Edit files in main repo
501
+ 2. git stash
502
+ 3. Create worktree
503
+ 4. git stash pop
504
+
505
+ **RIGHT:**
506
+ 1. Create worktree FIRST
507
+ 2. cd into worktree
508
+ 3. THEN edit files
509
+
510
+ ### Useful Commands
511
+
512
+ | Command | Description |
513
+ |---------|-------------|
514
+ | \`git worktree list\` | List all worktrees |
515
+ | \`git worktree add <path> -b <branch> <base>\` | Create worktree |
516
+ | \`git worktree remove <path>\` | Remove worktree |
517
+ | \`get_stale_worktrees(project_id)\` | Find orphaned worktrees |
518
+
519
+ ### Cleaning Stale Worktrees
520
+
521
+ On session start, if \`stale_worktrees\` is returned:
522
+ \`\`\`bash
523
+ git worktree remove <path>
524
+ \`\`\`
525
+ Then:
526
+ \`\`\`
527
+ clear_worktree_path(task_id)
528
+ \`\`\``,
529
+ },
530
+
531
+ deployment: {
532
+ title: 'Deployment Coordination',
533
+ content: `# Deployment Coordination
534
+
535
+ ## Deployment Flow
536
+
537
+ 1. **Request** → \`request_deployment(project_id)\`
538
+ 2. **Validate** → Build and test the deployment
539
+ 3. **Deploy** → Execute deployment
540
+ 4. **Complete** → Mark success/failure
541
+
542
+ ## Requesting Deployment
543
+
544
+ \`\`\`
545
+ request_deployment(
546
+ project_id,
547
+ environment: "production", // development, staging, production
548
+ version_bump: "patch", // patch, minor, major
549
+ git_ref: "main", // Branch or commit
550
+ notes: "Bug fixes for auth" // Optional
551
+ )
552
+ \`\`\`
553
+
554
+ ## Pre-Deployment Requirements
555
+
556
+ Add requirements that must be completed before deploying:
557
+ \`\`\`
558
+ add_deployment_requirement(
559
+ project_id,
560
+ type: "migration",
561
+ title: "Run migration: add_user_roles",
562
+ description: "Run: pnpm db:migrate",
563
+ stage: "preparation" // preparation, deployment, verification
564
+ )
565
+ \`\`\`
566
+
567
+ Types: \`migration\`, \`env_var\`, \`config\`, \`manual\`, \`breaking_change\`, \`agent_task\`
568
+
569
+ Check requirements:
570
+ \`\`\`
571
+ get_deployment_requirements(project_id)
572
+ \`\`\`
573
+
574
+ Complete them:
575
+ \`\`\`
576
+ complete_deployment_requirement(requirement_id)
577
+ \`\`\`
578
+
579
+ ## Validating Deployment
580
+
581
+ Claim for validation:
582
+ \`\`\`
583
+ claim_deployment_validation(project_id)
584
+ \`\`\`
585
+
586
+ Run build and tests, then report:
587
+ \`\`\`
588
+ report_validation(
589
+ project_id,
590
+ build_passed: true,
591
+ tests_passed: true
592
+ )
593
+ \`\`\`
594
+
595
+ If validation fails, an investigation task is auto-created.
596
+
597
+ ## Executing Deployment
598
+
599
+ Check status:
600
+ \`\`\`
601
+ check_deployment_status(project_id)
602
+ \`\`\`
603
+
604
+ When status is "ready":
605
+ \`\`\`
606
+ start_deployment(project_id)
607
+ \`\`\`
608
+
609
+ After deployment completes:
610
+ \`\`\`
611
+ complete_deployment(
612
+ project_id,
613
+ success: true,
614
+ summary: "Deployed v1.2.3 with auth fixes"
615
+ )
616
+ \`\`\`
617
+
618
+ Or if it failed:
619
+ \`\`\`
620
+ complete_deployment(
621
+ project_id,
622
+ success: false,
623
+ summary: "Rollback due to database connection errors"
624
+ )
625
+ \`\`\`
626
+
627
+ ## Scheduled Deployments
628
+
629
+ Schedule future deployments:
630
+ \`\`\`
631
+ schedule_deployment(
632
+ project_id,
633
+ scheduled_at: "2025-01-20T10:00:00Z",
634
+ schedule_type: "once", // once, hourly, daily, weekly, monthly
635
+ auto_trigger: true // Auto-deploy when due
636
+ )
637
+ \`\`\`
638
+
639
+ Check due deployments:
640
+ \`\`\`
641
+ check_due_deployments(project_id)
642
+ \`\`\`
643
+
644
+ ## Canceling
645
+
646
+ \`\`\`
647
+ cancel_deployment(project_id, reason: "Blocker found in staging")
648
+ \`\`\``,
649
+ },
650
+
651
+ blockers: {
652
+ title: 'Handling Blockers',
653
+ content: `# Handling Blockers
654
+
655
+ ## Recording a Blocker
656
+
657
+ When you can't proceed:
658
+ \`\`\`
659
+ add_blocker(
660
+ project_id,
661
+ description: "API endpoint returning 500 errors - need backend team to investigate"
662
+ )
663
+ \`\`\`
664
+
665
+ ## Viewing Blockers
666
+
667
+ \`\`\`
668
+ get_blockers(project_id) // Open blockers
669
+ get_blockers(project_id, status: "resolved") // Resolved blockers
670
+ get_blockers_stats(project_id) // Just counts
671
+ \`\`\`
672
+
673
+ ## Resolving Blockers
674
+
675
+ \`\`\`
676
+ resolve_blocker(
677
+ blocker_id,
678
+ resolution_note: "Backend team fixed the API - endpoint now returns correct data"
679
+ )
680
+ \`\`\`
681
+
682
+ ## What Counts as a Blocker?
683
+
684
+ **IS a blocker:**
685
+ - External dependency not available
686
+ - Need access/credentials you don't have
687
+ - Critical bug in a dependency
688
+ - Waiting for human decision
689
+ - Environment issue preventing testing
690
+
691
+ **NOT a blocker:**
692
+ - Need to learn something → research and continue
693
+ - Code is complex → break it down with milestones
694
+ - Tests failing → fix them
695
+ - Merge conflicts → resolve them
696
+
697
+ ## Blocker Best Practices
698
+
699
+ 1. **Be specific** - Describe exactly what's blocked and why
700
+ 2. **Include context** - What were you trying to do?
701
+ 3. **Suggest solutions** - If you know what might help
702
+ 4. **Check existing blockers** - Don't duplicate
703
+ 5. **Resolve promptly** - When the issue is fixed, resolve the blocker`,
704
+ },
705
+
706
+ milestones: {
707
+ title: 'Task Milestones',
708
+ content: `# Task Milestones
709
+
710
+ Milestones break down large tasks into trackable steps.
711
+
712
+ ## Adding Milestones
713
+
714
+ \`\`\`
715
+ add_milestone(task_id, title: "Design database schema")
716
+ add_milestone(task_id, title: "Implement API endpoints")
717
+ add_milestone(task_id, title: "Write unit tests")
718
+ add_milestone(task_id, title: "Add integration tests")
719
+ \`\`\`
720
+
721
+ With order and description:
722
+ \`\`\`
723
+ add_milestone(
724
+ task_id,
725
+ title: "Set up authentication",
726
+ description: "Configure OAuth providers and session management",
727
+ order_index: 0
728
+ )
729
+ \`\`\`
730
+
731
+ ## Viewing Milestones
732
+
733
+ \`\`\`
734
+ get_milestones(task_id)
735
+ \`\`\`
736
+
737
+ Or include when getting task:
738
+ \`\`\`
739
+ get_task(task_id, include_milestones: true)
740
+ \`\`\`
741
+
742
+ ## Updating Progress
743
+
744
+ Mark milestone in progress:
745
+ \`\`\`
746
+ update_milestone(milestone_id, status: "in_progress")
747
+ \`\`\`
748
+
749
+ Complete a milestone:
750
+ \`\`\`
751
+ complete_milestone(milestone_id)
752
+ \`\`\`
753
+
754
+ ## When to Use Milestones
755
+
756
+ **Good candidates:**
757
+ - Tasks estimated > 2 hours
758
+ - Multi-step implementations
759
+ - Features spanning multiple files/modules
760
+ - Tasks with clear phases
761
+
762
+ **Example breakdown:**
763
+
764
+ Task: "Implement user authentication"
765
+ 1. Set up OAuth provider configuration
766
+ 2. Create login/logout API endpoints
767
+ 3. Implement session management
768
+ 4. Add protected route middleware
769
+ 5. Create login UI components
770
+ 6. Write tests
771
+
772
+ ## Milestones vs Subtasks
773
+
774
+ | Milestones | Subtasks |
775
+ |------------|----------|
776
+ | Sequential steps | Parallel work items |
777
+ | Same agent | Can be claimed by different agents |
778
+ | Progress tracking | Delegation |
779
+ | One at a time | Multiple in progress |
780
+
781
+ Use **milestones** for ordered steps you'll do yourself.
782
+ Use **subtasks** when work can be parallelized across agents.`,
783
+ },
784
+
785
+ fallback: {
786
+ title: 'Fallback Activities',
787
+ content: `# Fallback Activities
788
+
789
+ When no tasks are available, agents can perform background activities.
790
+
791
+ ## Starting a Fallback Activity
792
+
793
+ \`\`\`
794
+ start_fallback_activity(project_id, activity: "code_review")
795
+ \`\`\`
796
+
797
+ ## Available Activities
798
+
799
+ | Activity | Description |
800
+ |----------|-------------|
801
+ | \`code_review\` | Review code quality, patterns, best practices |
802
+ | \`security_review\` | Security audit, vulnerability scanning |
803
+ | \`performance_audit\` | Performance analysis, optimization opportunities |
804
+ | \`ux_review\` | UX/accessibility review |
805
+ | \`test_coverage\` | Test coverage analysis, missing tests |
806
+ | \`documentation_review\` | Documentation gaps, outdated docs |
807
+ | \`dependency_audit\` | Dependency updates, vulnerabilities |
808
+ | \`feature_ideation\` | Suggest improvements, new features |
809
+ | \`validate_completed_tasks\` | Review tasks awaiting validation |
810
+ | \`worktree_cleanup\` | Clean up stale worktrees |
811
+
812
+ ## Recording Findings
813
+
814
+ During activities, record findings:
815
+ \`\`\`
816
+ add_finding(
817
+ project_id,
818
+ title: "SQL injection risk in user search",
819
+ category: "security", // security, performance, code_quality, etc.
820
+ severity: "high", // info, low, medium, high, critical
821
+ description: "User input passed directly to query without sanitization",
822
+ file_path: "src/api/users.ts",
823
+ line_number: 45
824
+ )
825
+ \`\`\`
826
+
827
+ ## Recording Ideas
828
+
829
+ For feature suggestions:
830
+ \`\`\`
831
+ add_idea(
832
+ project_id,
833
+ title: "Add rate limiting to API",
834
+ description: "Protect against abuse by adding rate limits per user/IP"
835
+ )
836
+ \`\`\`
837
+
838
+ ## Stopping Activities
839
+
840
+ Activities auto-stop when you start a task. Manual stop:
841
+ \`\`\`
842
+ stop_fallback_activity(project_id, summary: "Reviewed 5 files, found 2 issues")
843
+ \`\`\`
844
+
845
+ ## Activity History
846
+
847
+ \`\`\`
848
+ get_activity_history(project_id)
849
+ \`\`\`
850
+
851
+ ## Project Settings
852
+
853
+ Projects can restrict fallback activities:
854
+ \`\`\`
855
+ update_project(
856
+ project_id,
857
+ fallback_activities_enabled: true,
858
+ preferred_fallback_activities: ["code_review", "security_review"]
859
+ )
860
+ \`\`\``,
861
+ },
862
+
863
+ tokens: {
864
+ title: 'Token Usage & Cost Tracking',
865
+ content: `# Token Usage & Cost Tracking
866
+
867
+ ## Checking Usage
868
+
869
+ \`\`\`
870
+ get_token_usage()
871
+ \`\`\`
872
+
873
+ Returns:
874
+ - Session stats (calls, tokens, avg per call)
875
+ - Top tools by token usage
876
+ - Model breakdown (input/output tokens)
877
+ - Estimated costs
878
+
879
+ ## Reporting Actual Usage
880
+
881
+ MCP estimates are only ~1-5% of actual API usage. For accurate tracking:
882
+
883
+ \`\`\`
884
+ report_token_usage(
885
+ input_tokens: 1500,
886
+ output_tokens: 500,
887
+ model: "opus" // or sonnet, haiku
888
+ )
889
+ \`\`\`
890
+
891
+ Call this after each API response using values from the response headers:
892
+ - \`usage.input_tokens\`
893
+ - \`usage.output_tokens\`
894
+
895
+ ## Model Pricing
896
+
897
+ | Model | Input (per 1M) | Output (per 1M) |
898
+ |-------|---------------|-----------------|
899
+ | Opus | $15.00 | $75.00 |
900
+ | Sonnet | $3.00 | $15.00 |
901
+ | Haiku | $0.25 | $1.25 |
902
+
903
+ ## Cost Monitoring
904
+
905
+ Get cost summary:
906
+ \`\`\`
907
+ get_cost_summary(project_id, period: "daily") // daily, weekly, monthly
908
+ \`\`\`
909
+
910
+ Set up alerts:
911
+ \`\`\`
912
+ add_cost_alert(
913
+ project_id,
914
+ threshold_amount: 100, // USD
915
+ threshold_period: "daily",
916
+ alert_type: "warning" // warning, critical
917
+ )
918
+ \`\`\`
919
+
920
+ ## Context Management
921
+
922
+ When token usage is high:
923
+ 1. Check with \`get_token_usage()\`
924
+ 2. If 50+ calls or 100k+ tokens: \`/clear\`
925
+ 3. Immediately call \`start_work_session()\`
926
+ 4. Continue with \`next_task\`
927
+
928
+ **Don't ask permission** - just clear and continue.
929
+
930
+ ## Efficiency Tips
931
+
932
+ 1. **Use lite mode** (default) - saves ~85% tokens on session start
933
+ 2. **Batch updates** - Use \`batch_update_tasks\` when updating multiple
934
+ 3. **Use stats endpoints** - \`get_task_stats\` instead of listing all tasks
935
+ 4. **Clear context regularly** - Don't let it grow unbounded`,
936
+ },
937
+
938
+ sprints: {
939
+ title: 'Sprint Management',
940
+ content: `# Sprint Management
941
+
942
+ Sprints are time-bounded work periods with velocity tracking.
943
+
944
+ ## Creating a Sprint
945
+
946
+ \`\`\`
947
+ create_sprint(
948
+ project_id,
949
+ title: "Sprint 5",
950
+ start_date: "2025-01-20",
951
+ end_date: "2025-02-03",
952
+ goal: "Complete authentication and user profile features"
953
+ )
954
+ \`\`\`
955
+
956
+ ## Sprint Lifecycle
957
+
958
+ 1. **Planning** → Add tasks, assign story points
959
+ 2. **Active** → Work on tasks
960
+ 3. **In Review** → Review completed work
961
+ 4. **Retrospective** → Reflect on sprint
962
+ 5. **Completed** → Archive with metrics
963
+
964
+ ## Adding Tasks to Sprint
965
+
966
+ \`\`\`
967
+ add_task_to_sprint(
968
+ sprint_id,
969
+ task_id,
970
+ story_points: 3,
971
+ phase: "core" // pre, core, post
972
+ )
973
+ \`\`\`
974
+
975
+ ## Starting a Sprint
976
+
977
+ \`\`\`
978
+ start_sprint(sprint_id)
979
+ \`\`\`
980
+
981
+ This locks \`committed_points\` at the current total.
982
+
983
+ ## Getting Sprint Backlog
984
+
985
+ Tasks available to add:
986
+ \`\`\`
987
+ get_sprint_backlog(project_id, sprint_id)
988
+ \`\`\`
989
+
990
+ ## Sprint Progress
991
+
992
+ \`\`\`
993
+ get_sprint(sprint_id)
994
+ \`\`\`
995
+
996
+ With just counts (saves tokens):
997
+ \`\`\`
998
+ get_sprint(sprint_id, summary_only: true)
999
+ \`\`\`
1000
+
1001
+ ## Completing a Sprint
1002
+
1003
+ \`\`\`
1004
+ complete_sprint(
1005
+ sprint_id,
1006
+ retrospective_notes: "Completed 80% of planned work. Auth took longer than expected.",
1007
+ skip_retrospective: false
1008
+ )
1009
+ \`\`\`
1010
+
1011
+ ## Velocity Tracking
1012
+
1013
+ \`\`\`
1014
+ get_sprint_velocity(project_id, limit: 10)
1015
+ \`\`\`
1016
+
1017
+ Returns:
1018
+ - Committed vs completed points per sprint
1019
+ - Average velocity
1020
+ - Trend analysis`,
1021
+ },
1022
+
1023
+ topics: {
1024
+ title: 'Available Help Topics',
1025
+ content: `# Available Help Topics
1026
+
1027
+ Use \`get_help(topic)\` for detailed guidance on any topic.
1028
+
1029
+ ## Core Topics
1030
+
1031
+ | Topic | Description |
1032
+ |-------|-------------|
1033
+ | \`getting_started\` | Quick start guide, core workflow |
1034
+ | \`session\` | Session lifecycle, heartbeats, context management |
1035
+ | \`tasks\` | Task management, progress tracking, completion |
1036
+ | \`validation\` | Cross-agent task validation workflow |
1037
+ | \`git\` | Git workflows, worktrees, branch management |
1038
+ | \`deployment\` | Deployment coordination, requirements |
1039
+
1040
+ ## Task Organization
1041
+
1042
+ | Topic | Description |
1043
+ |-------|-------------|
1044
+ | \`milestones\` | Breaking down complex tasks into steps |
1045
+ | \`subtasks\` | Parallelizable task breakdown |
1046
+ | \`bodies_of_work\` | Group related tasks into phases |
1047
+ | \`sprints\` | Time-bounded sprints with velocity tracking |
1048
+
1049
+ ## Collaboration
1050
+
1051
+ | Topic | Description |
1052
+ |-------|-------------|
1053
+ | \`roles\` | Agent roles and specialization |
1054
+ | \`file_locks\` | Multi-agent file coordination |
1055
+ | \`git_issues\` | Git conflict and issue tracking |
1056
+ | \`requests\` | Handle user questions from dashboard |
1057
+
1058
+ ## Knowledge & Tracking
1059
+
1060
+ | Topic | Description |
1061
+ |-------|-------------|
1062
+ | \`blockers\` | Recording and resolving blockers |
1063
+ | \`knowledge\` | Project knowledge base |
1064
+ | \`ideas\` | Feature ideas and requests |
1065
+ | \`tokens\` | Token usage and cost tracking |
1066
+ | \`fallback\` | Background activities when idle |
1067
+ | \`connectors\` | External integrations (Slack, webhooks) |
1068
+
1069
+ ## Quick Examples
1070
+
1071
+ \`\`\`
1072
+ get_help("getting_started") // New to Vibescope? Start here
1073
+ get_help("git") // Git worktree workflow
1074
+ get_help("validation") // How to validate tasks
1075
+ get_help("session") // Session management
1076
+ get_help("bodies_of_work") // Organizing related tasks
1077
+ \`\`\``,
1078
+ },
1079
+
1080
+ roles: {
1081
+ title: 'Agent Roles',
1082
+ content: `# Agent Roles
1083
+
1084
+ Roles specialize agents for different types of work.
1085
+
1086
+ ## Available Roles
1087
+
1088
+ | Role | Description |
1089
+ |------|-------------|
1090
+ | \`developer\` | General development work (default) |
1091
+ | \`validator\` | Reviews and validates completed tasks |
1092
+ | \`deployer\` | Handles deployments |
1093
+ | \`reviewer\` | Code review focus |
1094
+ | \`maintainer\` | Housekeeping and maintenance |
1095
+
1096
+ ## Setting Your Role
1097
+
1098
+ At session start:
1099
+ \`\`\`
1100
+ start_work_session(git_url, model, role: "validator")
1101
+ \`\`\`
1102
+
1103
+ Or mid-session:
1104
+ \`\`\`
1105
+ set_session_role(role: "validator")
1106
+ \`\`\`
1107
+
1108
+ ## Role Configuration
1109
+
1110
+ View project role settings:
1111
+ \`\`\`
1112
+ get_role_settings(project_id)
1113
+ \`\`\`
1114
+
1115
+ Configure role behavior:
1116
+ \`\`\`
1117
+ update_role_settings(
1118
+ project_id,
1119
+ role: "validator",
1120
+ enabled: true,
1121
+ auto_assign_validation: true,
1122
+ fallback_activities: ["code_review", "security_review"]
1123
+ )
1124
+ \`\`\`
1125
+
1126
+ ## Viewing Agents by Role
1127
+
1128
+ \`\`\`
1129
+ get_agents_by_role(project_id)
1130
+ \`\`\`
1131
+
1132
+ With counts only (saves tokens):
1133
+ \`\`\`
1134
+ get_agents_by_role(project_id, counts_only: true)
1135
+ \`\`\`
1136
+
1137
+ ## Role-Specific Workflows
1138
+
1139
+ **Developer:**
1140
+ - Gets tasks via \`get_next_task\`
1141
+ - Creates PRs
1142
+ - Calls \`complete_task\`
1143
+
1144
+ **Validator:**
1145
+ - Gets tasks via \`get_tasks_awaiting_validation\`
1146
+ - Reviews code, runs tests
1147
+ - Approves/rejects via \`validate_task\`
1148
+ - Merges PRs on approval
1149
+
1150
+ **Deployer:**
1151
+ - Checks \`check_deployment_status\`
1152
+ - Validates deployments
1153
+ - Executes deployments
1154
+ - Handles rollbacks`,
1155
+ },
1156
+
1157
+ knowledge: {
1158
+ title: 'Project Knowledge Base',
1159
+ content: `# Project Knowledge Base
1160
+
1161
+ Query aggregated project knowledge efficiently.
1162
+
1163
+ ## Querying Knowledge
1164
+
1165
+ \`\`\`
1166
+ query_knowledge_base(
1167
+ project_id,
1168
+ categories: ["findings", "decisions", "completed_tasks"],
1169
+ scope: "summary", // summary or detailed
1170
+ limit: 10,
1171
+ search_query: "authentication"
1172
+ )
1173
+ \`\`\`
1174
+
1175
+ ## Categories
1176
+
1177
+ | Category | Description |
1178
+ |----------|-------------|
1179
+ | \`findings\` | Audit findings, code issues |
1180
+ | \`qa\` | Questions and answers |
1181
+ | \`decisions\` | Architectural decisions |
1182
+ | \`completed_tasks\` | Recently completed work |
1183
+ | \`blockers\` | Resolved blockers |
1184
+ | \`progress\` | Progress updates |
1185
+
1186
+ ## Recording Knowledge
1187
+
1188
+ ### Findings
1189
+ \`\`\`
1190
+ add_finding(
1191
+ project_id,
1192
+ title: "N+1 query in user list",
1193
+ category: "performance",
1194
+ severity: "medium",
1195
+ description: "User list makes N+1 queries for profile images",
1196
+ file_path: "src/api/users.ts"
1197
+ )
1198
+ \`\`\`
1199
+
1200
+ ### Decisions
1201
+ \`\`\`
1202
+ log_decision(
1203
+ project_id,
1204
+ title: "Use PostgreSQL for database",
1205
+ description: "Selected PostgreSQL over MongoDB",
1206
+ rationale: "Better support for complex queries and transactions",
1207
+ alternatives_considered: ["MongoDB", "MySQL"]
1208
+ )
1209
+ \`\`\`
1210
+
1211
+ ### Ideas
1212
+ \`\`\`
1213
+ add_idea(
1214
+ project_id,
1215
+ title: "Add caching layer",
1216
+ description: "Redis cache for frequently accessed data",
1217
+ status: "raw" // raw, exploring, planned, in_development, shipped
1218
+ )
1219
+ \`\`\`
1220
+
1221
+ ## Efficiency
1222
+
1223
+ Use \`query_knowledge_base\` instead of multiple separate calls:
1224
+ - Single call returns aggregated data
1225
+ - Filter by category to reduce response size
1226
+ - Use \`summary\` scope for token efficiency`,
1227
+ },
1228
+
1229
+ bodies_of_work: {
1230
+ title: 'Bodies of Work',
1231
+ content: `# Bodies of Work
1232
+
1233
+ Bodies of work group related tasks into phases for coordinated execution.
1234
+
1235
+ ## Creating a Body of Work
1236
+
1237
+ \`\`\`
1238
+ create_body_of_work(
1239
+ project_id,
1240
+ title: "User Authentication Feature",
1241
+ description: "Complete auth system with OAuth support",
1242
+ auto_deploy_on_completion: true,
1243
+ deploy_version_bump: "minor"
1244
+ )
1245
+ \`\`\`
1246
+
1247
+ ## Task Phases
1248
+
1249
+ Tasks are organized into three phases:
1250
+ - **pre** - Setup, migrations, dependencies
1251
+ - **core** - Main implementation work
1252
+ - **post** - Cleanup, documentation, verification
1253
+
1254
+ ## Adding Tasks
1255
+
1256
+ \`\`\`
1257
+ add_task_to_body_of_work(
1258
+ body_of_work_id,
1259
+ task_id,
1260
+ phase: "core" // pre, core, post
1261
+ )
1262
+ \`\`\`
1263
+
1264
+ ## Task Dependencies
1265
+
1266
+ Create dependencies between tasks:
1267
+ \`\`\`
1268
+ add_task_dependency(
1269
+ body_of_work_id,
1270
+ task_id: "frontend-task",
1271
+ depends_on_task_id: "api-task"
1272
+ )
1273
+ \`\`\`
1274
+
1275
+ The dependent task won't be available until its dependencies are complete.
1276
+
1277
+ ## Activating
1278
+
1279
+ Bodies of work start in "draft" status. Activate to begin:
1280
+ \`\`\`
1281
+ activate_body_of_work(body_of_work_id)
1282
+ \`\`\`
1283
+
1284
+ ## Getting Next Task
1285
+
1286
+ \`\`\`
1287
+ get_next_body_of_work_task(body_of_work_id)
1288
+ \`\`\`
1289
+
1290
+ Returns the next available task considering:
1291
+ - Phase order (pre → core → post)
1292
+ - Task dependencies
1293
+ - Task status
1294
+
1295
+ ## Viewing Bodies of Work
1296
+
1297
+ \`\`\`
1298
+ get_body_of_work(body_of_work_id) // Single BOW with tasks
1299
+ get_bodies_of_work(project_id) // All BOWs for project
1300
+ \`\`\`
1301
+
1302
+ ## Auto-Deployment
1303
+
1304
+ If \`auto_deploy_on_completion: true\`, a deployment is automatically requested when all tasks complete.
1305
+
1306
+ Configure the trigger:
1307
+ - \`all_completed\` - Deploy immediately when all tasks done
1308
+ - \`all_completed_validated\` - Wait for validation first`,
1309
+ },
1310
+
1311
+ subtasks: {
1312
+ title: 'Subtasks',
1313
+ content: `# Subtasks
1314
+
1315
+ Subtasks break down larger tasks into smaller, parallelizable pieces.
1316
+
1317
+ ## Adding Subtasks
1318
+
1319
+ \`\`\`
1320
+ add_subtask(
1321
+ parent_task_id,
1322
+ title: "Implement login form UI",
1323
+ description: "Create React component for login form",
1324
+ priority: 2,
1325
+ estimated_minutes: 60
1326
+ )
1327
+ \`\`\`
1328
+
1329
+ ## Viewing Subtasks
1330
+
1331
+ \`\`\`
1332
+ get_subtasks(parent_task_id)
1333
+ \`\`\`
1334
+
1335
+ Or include when getting task:
1336
+ \`\`\`
1337
+ get_task(task_id, include_subtasks: true)
1338
+ \`\`\`
1339
+
1340
+ ## Working on Subtasks
1341
+
1342
+ Subtasks work just like regular tasks:
1343
+ \`\`\`
1344
+ update_task(subtask_id, status: "in_progress")
1345
+ complete_task(subtask_id, summary: "Completed login form")
1346
+ \`\`\`
1347
+
1348
+ ## Subtasks vs Milestones
1349
+
1350
+ | Subtasks | Milestones |
1351
+ |----------|------------|
1352
+ | Independent units of work | Sequential steps |
1353
+ | Can be claimed by any agent | Same agent completes all |
1354
+ | Parallel execution | One at a time |
1355
+ | Full task lifecycle | Simple status tracking |
1356
+
1357
+ **Use subtasks when:**
1358
+ - Work can be done in parallel by multiple agents
1359
+ - Each piece is independent and self-contained
1360
+ - You want to delegate work
1361
+
1362
+ **Use milestones when:**
1363
+ - Steps must be done in order
1364
+ - Same person does all steps
1365
+ - Just need progress tracking
1366
+
1367
+ ## Constraints
1368
+
1369
+ - Max depth is 1 (subtasks cannot have their own subtasks)
1370
+ - Subtasks inherit project from parent task
1371
+ - Parent task completion is independent of subtasks`,
1372
+ },
1373
+
1374
+ file_locks: {
1375
+ title: 'File Locking',
1376
+ content: `# File Locking (Multi-Agent Coordination)
1377
+
1378
+ Prevent conflicts when multiple agents work on the same files.
1379
+
1380
+ ## Checking Availability
1381
+
1382
+ Before editing a file:
1383
+ \`\`\`
1384
+ is_file_available(project_id, file_path: "src/api/users.ts")
1385
+ \`\`\`
1386
+
1387
+ Returns whether the file is free or who has it locked.
1388
+
1389
+ ## Checking Out Files
1390
+
1391
+ Lock a file before editing:
1392
+ \`\`\`
1393
+ checkout_file(
1394
+ project_id,
1395
+ file_path: "src/api/users.ts",
1396
+ reason: "Fixing authentication bug"
1397
+ )
1398
+ \`\`\`
1399
+
1400
+ ## Checking In Files
1401
+
1402
+ Release the file when done:
1403
+ \`\`\`
1404
+ checkin_file(
1405
+ checkout_id,
1406
+ summary: "Fixed token validation logic"
1407
+ )
1408
+ \`\`\`
1409
+
1410
+ Or by path:
1411
+ \`\`\`
1412
+ checkin_file(
1413
+ project_id,
1414
+ file_path: "src/api/users.ts",
1415
+ summary: "Fixed token validation logic"
1416
+ )
1417
+ \`\`\`
1418
+
1419
+ ## Viewing Checkouts
1420
+
1421
+ \`\`\`
1422
+ get_file_checkouts(project_id) // Active checkouts
1423
+ get_file_checkouts(project_id, status: "checked_in") // Completed
1424
+ get_file_checkouts_stats(project_id) // Just counts
1425
+ \`\`\`
1426
+
1427
+ ## Handling Abandoned Locks
1428
+
1429
+ If an agent session dies with a file locked:
1430
+ \`\`\`
1431
+ abandon_checkout(
1432
+ checkout_id,
1433
+ reason: "Agent session terminated"
1434
+ )
1435
+ \`\`\`
1436
+
1437
+ ## Best Practices
1438
+
1439
+ 1. **Always check availability** before editing shared files
1440
+ 2. **Keep locks short** - check in as soon as you're done
1441
+ 3. **Use meaningful reasons** - helps others understand why file is locked
1442
+ 4. **Check in even if no changes** - releases the lock for others
1443
+ 5. **Use worktrees** - provides file isolation, reducing need for locks`,
1444
+ },
1445
+
1446
+ connectors: {
1447
+ title: 'External Connectors',
1448
+ content: `# External Connectors
1449
+
1450
+ Connectors enable sending events to external services.
1451
+
1452
+ ## Supported Types
1453
+
1454
+ | Type | Description |
1455
+ |------|-------------|
1456
+ | \`webhook\` | Generic HTTP webhook |
1457
+ | \`slack\` | Slack notifications |
1458
+ | \`discord\` | Discord notifications |
1459
+ | \`github\` | GitHub integration |
1460
+ | \`custom\` | Custom connector |
1461
+
1462
+ ## Adding a Connector
1463
+
1464
+ Slack example:
1465
+ \`\`\`
1466
+ add_connector(
1467
+ project_id,
1468
+ name: "Slack Notifications",
1469
+ type: "slack",
1470
+ config: { webhook_url: "https://hooks.slack.com/..." },
1471
+ events: {
1472
+ task_completed: true,
1473
+ blocker_added: true,
1474
+ deployment_started: true
1475
+ }
1476
+ )
1477
+ \`\`\`
1478
+
1479
+ Webhook example:
1480
+ \`\`\`
1481
+ add_connector(
1482
+ project_id,
1483
+ name: "CI/CD Webhook",
1484
+ type: "webhook",
1485
+ config: {
1486
+ url: "https://ci.example.com/webhook",
1487
+ headers: { "X-API-Key": "secret" }
1488
+ },
1489
+ events: { deployment_completed: true }
1490
+ )
1491
+ \`\`\`
1492
+
1493
+ ## Available Events
1494
+
1495
+ - \`task_completed\` - Task marked done
1496
+ - \`task_validated\` - Task approved/rejected
1497
+ - \`blocker_added\` - New blocker recorded
1498
+ - \`blocker_resolved\` - Blocker resolved
1499
+ - \`deployment_started\` - Deployment began
1500
+ - \`deployment_completed\` - Deployment finished
1501
+ - \`agent_session_started\` - Agent connected
1502
+ - \`agent_session_ended\` - Agent disconnected
1503
+
1504
+ ## Managing Connectors
1505
+
1506
+ \`\`\`
1507
+ get_connectors(project_id) // List all
1508
+ get_connector(connector_id) // Get details
1509
+ update_connector(connector_id, ...) // Update config
1510
+ delete_connector(connector_id) // Remove
1511
+ \`\`\`
1512
+
1513
+ ## Testing
1514
+
1515
+ \`\`\`
1516
+ test_connector(connector_id)
1517
+ \`\`\`
1518
+
1519
+ Sends a test event and returns success/failure.
1520
+
1521
+ ## Event History
1522
+
1523
+ \`\`\`
1524
+ get_connector_events(connector_id)
1525
+ get_connector_events(project_id) // All connectors
1526
+ \`\`\``,
1527
+ },
1528
+
1529
+ git_issues: {
1530
+ title: 'Git Issues',
1531
+ content: `# Git Issues
1532
+
1533
+ Track and resolve git-related problems.
1534
+
1535
+ ## Issue Types
1536
+
1537
+ | Type | Description |
1538
+ |------|-------------|
1539
+ | \`merge_conflict\` | Conflicting changes |
1540
+ | \`push_failed\` | Push rejected |
1541
+ | \`rebase_needed\` | Branch needs rebase |
1542
+ | \`branch_diverged\` | Branch diverged from base |
1543
+ | \`pr_not_mergeable\` | PR cannot be merged |
1544
+
1545
+ ## Recording Issues
1546
+
1547
+ \`\`\`
1548
+ add_git_issue(
1549
+ project_id,
1550
+ issue_type: "merge_conflict",
1551
+ branch: "feature/add-auth",
1552
+ target_branch: "develop",
1553
+ conflicting_files: ["src/api/users.ts", "src/models/user.ts"],
1554
+ task_id: "task-uuid", // Optional
1555
+ error_message: "Automatic merge failed"
1556
+ )
1557
+ \`\`\`
1558
+
1559
+ ## Viewing Issues
1560
+
1561
+ \`\`\`
1562
+ get_git_issues(project_id) // Open issues
1563
+ get_git_issues(project_id, status: "resolved") // Resolved
1564
+ get_git_issues(project_id, branch: "feature/x") // By branch
1565
+ get_git_issues(project_id, issue_type: "merge_conflict") // By type
1566
+ \`\`\`
1567
+
1568
+ ## Resolving Issues
1569
+
1570
+ \`\`\`
1571
+ resolve_git_issue(
1572
+ git_issue_id,
1573
+ resolution_note: "Rebased branch and resolved conflicts manually"
1574
+ )
1575
+ \`\`\`
1576
+
1577
+ Auto-resolved (e.g., PR became mergeable):
1578
+ \`\`\`
1579
+ resolve_git_issue(
1580
+ git_issue_id,
1581
+ auto_resolved: true,
1582
+ resolution_note: "PR automatically became mergeable after upstream merge"
1583
+ )
1584
+ \`\`\`
1585
+
1586
+ ## Handling Merge Conflicts
1587
+
1588
+ 1. **Fetch latest changes:**
1589
+ \`\`\`bash
1590
+ git fetch origin
1591
+ \`\`\`
1592
+
1593
+ 2. **Rebase on target:**
1594
+ \`\`\`bash
1595
+ git rebase origin/develop
1596
+ \`\`\`
1597
+
1598
+ 3. **Resolve conflicts in editor**
1599
+
1600
+ 4. **Continue rebase:**
1601
+ \`\`\`bash
1602
+ git add .
1603
+ git rebase --continue
1604
+ \`\`\`
1605
+
1606
+ 5. **Force push:**
1607
+ \`\`\`bash
1608
+ git push --force-with-lease
1609
+ \`\`\`
1610
+
1611
+ 6. **Resolve the issue:**
1612
+ \`\`\`
1613
+ resolve_git_issue(git_issue_id, resolution_note: "Rebased and resolved")
1614
+ \`\`\``,
1615
+ },
1616
+
1617
+ ideas: {
1618
+ title: 'Ideas & Feature Requests',
1619
+ content: `# Ideas & Feature Requests
1620
+
1621
+ Track improvement ideas and feature requests.
1622
+
1623
+ ## Adding Ideas
1624
+
1625
+ \`\`\`
1626
+ add_idea(
1627
+ project_id,
1628
+ title: "Add dark mode support",
1629
+ description: "Implement theme switching with dark mode option",
1630
+ status: "raw" // Default status
1631
+ )
1632
+ \`\`\`
1633
+
1634
+ ## Idea Lifecycle
1635
+
1636
+ | Status | Description |
1637
+ |--------|-------------|
1638
+ | \`raw\` | Initial idea, not yet evaluated |
1639
+ | \`exploring\` | Being researched/discussed |
1640
+ | \`planned\` | Approved for implementation |
1641
+ | \`in_development\` | Being worked on |
1642
+ | \`shipped\` | Completed and deployed |
1643
+
1644
+ ## Updating Ideas
1645
+
1646
+ \`\`\`
1647
+ update_idea(
1648
+ idea_id,
1649
+ status: "planned",
1650
+ doc_url: "https://docs.example.com/dark-mode-spec"
1651
+ )
1652
+ \`\`\`
1653
+
1654
+ ## Converting to Task
1655
+
1656
+ When ready to implement:
1657
+ \`\`\`
1658
+ convert_idea_to_task(
1659
+ idea_id,
1660
+ priority: 2,
1661
+ estimated_minutes: 120,
1662
+ update_status: true // Sets idea to "in_development"
1663
+ )
1664
+ \`\`\`
1665
+
1666
+ This creates a task linked to the idea.
1667
+
1668
+ ## Viewing Ideas
1669
+
1670
+ \`\`\`
1671
+ get_ideas(project_id) // All ideas
1672
+ get_ideas(project_id, status: "planned") // Ready to build
1673
+ get_ideas(project_id, search_query: "dark") // Search
1674
+ get_idea(idea_id) // Single idea
1675
+ \`\`\`
1676
+
1677
+ ## Best Practices
1678
+
1679
+ 1. **Capture ideas immediately** - Don't lose them
1680
+ 2. **Be specific** - Include context and rationale
1681
+ 3. **Link documentation** - Add doc_url when available
1682
+ 4. **Update status** - Keep ideas current
1683
+ 5. **Convert when ready** - Move to tasks for execution`,
1684
+ },
1685
+
1686
+ requests: {
1687
+ title: 'User Requests',
1688
+ content: `# User Requests
1689
+
1690
+ Handle questions and requests from users via the dashboard.
1691
+
1692
+ ## Checking for Requests
1693
+
1694
+ Requests are included in \`start_work_session\` response:
1695
+ - \`pending_requests\` - Array of unanswered requests
1696
+ - \`URGENT_QUESTIONS\` - High-priority questions
1697
+
1698
+ ## Getting Pending Requests
1699
+
1700
+ \`\`\`
1701
+ get_pending_requests(project_id)
1702
+ \`\`\`
1703
+
1704
+ ## Answering Questions
1705
+
1706
+ \`\`\`
1707
+ answer_question(
1708
+ request_id,
1709
+ answer: "The authentication flow uses JWT tokens stored in httpOnly cookies. Tokens expire after 24 hours and are automatically refreshed."
1710
+ )
1711
+ \`\`\`
1712
+
1713
+ ## Acknowledging Requests
1714
+
1715
+ For non-question requests:
1716
+ \`\`\`
1717
+ acknowledge_request(request_id)
1718
+ \`\`\`
1719
+
1720
+ ## Priority
1721
+
1722
+ When \`start_work_session\` returns pending requests:
1723
+ 1. Answer questions FIRST (before starting tasks)
1724
+ 2. \`URGENT_QUESTIONS\` take absolute priority
1725
+ 3. Then proceed with \`next_task\`
1726
+
1727
+ ## Best Practices
1728
+
1729
+ 1. **Check requests early** - Answer before deep work
1730
+ 2. **Be thorough** - Provide complete answers
1731
+ 3. **Include context** - Reference code/docs when helpful
1732
+ 4. **Acknowledge promptly** - Don't leave users waiting`,
1733
+ },
1734
+ };
1735
+
1736
+ /**
1737
+ * Get fallback help content for a topic
1738
+ * @param topic The help topic slug
1739
+ * @returns The help content or null if topic not found
1740
+ */
1741
+ export function getFallbackHelpContent(topic: string): { title: string; content: string } | null {
1742
+ return HELP_TOPICS[topic] || null;
1743
+ }
1744
+
1745
+ /**
1746
+ * Get list of available help topics
1747
+ * @returns Array of topic slugs
1748
+ */
1749
+ export function getAvailableHelpTopics(): string[] {
1750
+ return Object.keys(HELP_TOPICS);
1751
+ }