@vibescope/mcp-server 0.2.0 → 0.2.2

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 (104) hide show
  1. package/README.md +60 -7
  2. package/dist/api-client.d.ts +251 -1
  3. package/dist/api-client.js +82 -3
  4. package/dist/handlers/blockers.js +9 -8
  5. package/dist/handlers/bodies-of-work.js +96 -63
  6. package/dist/handlers/connectors.d.ts +45 -0
  7. package/dist/handlers/connectors.js +183 -0
  8. package/dist/handlers/cost.d.ts +10 -0
  9. package/dist/handlers/cost.js +112 -50
  10. package/dist/handlers/decisions.js +32 -19
  11. package/dist/handlers/deployment.js +144 -122
  12. package/dist/handlers/discovery.d.ts +7 -0
  13. package/dist/handlers/discovery.js +96 -7
  14. package/dist/handlers/fallback.js +29 -23
  15. package/dist/handlers/file-checkouts.d.ts +20 -0
  16. package/dist/handlers/file-checkouts.js +133 -0
  17. package/dist/handlers/findings.d.ts +6 -0
  18. package/dist/handlers/findings.js +96 -40
  19. package/dist/handlers/git-issues.js +40 -36
  20. package/dist/handlers/ideas.js +49 -31
  21. package/dist/handlers/index.d.ts +3 -0
  22. package/dist/handlers/index.js +9 -0
  23. package/dist/handlers/milestones.js +39 -32
  24. package/dist/handlers/organizations.js +99 -91
  25. package/dist/handlers/progress.js +24 -13
  26. package/dist/handlers/project.js +68 -28
  27. package/dist/handlers/requests.js +18 -14
  28. package/dist/handlers/roles.d.ts +18 -0
  29. package/dist/handlers/roles.js +130 -0
  30. package/dist/handlers/session.js +58 -17
  31. package/dist/handlers/sprints.js +93 -81
  32. package/dist/handlers/tasks.d.ts +2 -0
  33. package/dist/handlers/tasks.js +189 -91
  34. package/dist/handlers/types.d.ts +64 -2
  35. package/dist/handlers/types.js +48 -1
  36. package/dist/handlers/validation.js +21 -17
  37. package/dist/index.js +7 -2716
  38. package/dist/token-tracking.d.ts +74 -0
  39. package/dist/token-tracking.js +122 -0
  40. package/dist/tools.js +685 -9
  41. package/dist/utils.d.ts +5 -0
  42. package/dist/utils.js +17 -0
  43. package/docs/TOOLS.md +2053 -0
  44. package/package.json +4 -1
  45. package/scripts/generate-docs.ts +212 -0
  46. package/src/api-client.test.ts +718 -0
  47. package/src/api-client.ts +320 -6
  48. package/src/handlers/__test-setup__.ts +16 -0
  49. package/src/handlers/blockers.test.ts +31 -19
  50. package/src/handlers/blockers.ts +9 -8
  51. package/src/handlers/bodies-of-work.test.ts +55 -32
  52. package/src/handlers/bodies-of-work.ts +115 -115
  53. package/src/handlers/connectors.test.ts +834 -0
  54. package/src/handlers/connectors.ts +229 -0
  55. package/src/handlers/cost.test.ts +34 -44
  56. package/src/handlers/cost.ts +136 -85
  57. package/src/handlers/decisions.test.ts +37 -27
  58. package/src/handlers/decisions.ts +35 -30
  59. package/src/handlers/deployment.ts +180 -208
  60. package/src/handlers/discovery.test.ts +4 -5
  61. package/src/handlers/discovery.ts +98 -8
  62. package/src/handlers/fallback.test.ts +26 -22
  63. package/src/handlers/fallback.ts +36 -33
  64. package/src/handlers/file-checkouts.test.ts +670 -0
  65. package/src/handlers/file-checkouts.ts +165 -0
  66. package/src/handlers/findings.test.ts +178 -19
  67. package/src/handlers/findings.ts +112 -74
  68. package/src/handlers/git-issues.test.ts +51 -43
  69. package/src/handlers/git-issues.ts +44 -84
  70. package/src/handlers/ideas.test.ts +28 -23
  71. package/src/handlers/ideas.ts +61 -59
  72. package/src/handlers/index.ts +9 -0
  73. package/src/handlers/milestones.test.ts +33 -28
  74. package/src/handlers/milestones.ts +52 -50
  75. package/src/handlers/organizations.test.ts +104 -83
  76. package/src/handlers/organizations.ts +117 -142
  77. package/src/handlers/progress.test.ts +20 -14
  78. package/src/handlers/progress.ts +26 -24
  79. package/src/handlers/project.test.ts +34 -27
  80. package/src/handlers/project.ts +95 -63
  81. package/src/handlers/requests.test.ts +27 -18
  82. package/src/handlers/requests.ts +21 -17
  83. package/src/handlers/roles.test.ts +303 -0
  84. package/src/handlers/roles.ts +208 -0
  85. package/src/handlers/session.test.ts +47 -0
  86. package/src/handlers/session.ts +71 -26
  87. package/src/handlers/sprints.test.ts +71 -50
  88. package/src/handlers/sprints.ts +113 -146
  89. package/src/handlers/tasks.test.ts +77 -15
  90. package/src/handlers/tasks.ts +231 -156
  91. package/src/handlers/tool-categories.test.ts +66 -0
  92. package/src/handlers/types.ts +81 -2
  93. package/src/handlers/validation.test.ts +78 -45
  94. package/src/handlers/validation.ts +23 -25
  95. package/src/index.ts +12 -2732
  96. package/src/token-tracking.test.ts +453 -0
  97. package/src/token-tracking.ts +164 -0
  98. package/src/tools.ts +685 -9
  99. package/src/utils.test.ts +2 -2
  100. package/src/utils.ts +17 -0
  101. package/dist/config/tool-categories.d.ts +0 -31
  102. package/dist/config/tool-categories.js +0 -253
  103. package/dist/knowledge.d.ts +0 -6
  104. package/dist/knowledge.js +0 -218
package/src/utils.test.ts CHANGED
@@ -43,8 +43,8 @@ describe('AGENT_PERSONAS', () => {
43
43
  // ============================================================================
44
44
 
45
45
  describe('FALLBACK_ACTIVITIES', () => {
46
- it('should have 11 activities', () => {
47
- expect(FALLBACK_ACTIVITIES).toHaveLength(11);
46
+ it('should have 12 activities', () => {
47
+ expect(FALLBACK_ACTIVITIES).toHaveLength(12);
48
48
  });
49
49
 
50
50
  it('should have required fields on each activity', () => {
package/src/utils.ts CHANGED
@@ -133,6 +133,23 @@ export const FALLBACK_ACTIVITIES = [
133
133
  description: 'Review tasks completed by other agents to ensure quality.',
134
134
  prompt: 'Call get_tasks_awaiting_validation to find completed tasks that need review. Validate each one by checking the implementation and running tests if applicable.',
135
135
  },
136
+ {
137
+ activity: 'worktree_cleanup',
138
+ title: 'Clean up stale worktrees',
139
+ description: 'Find and remove git worktrees from completed or abandoned tasks.',
140
+ prompt: `Clean up stale git worktrees to reclaim disk space and prevent confusion:
141
+
142
+ 1. Call get_stale_worktrees(project_id) to find worktrees needing cleanup
143
+ 2. For each stale worktree returned:
144
+ a. Check if the worktree directory exists: ls -la <worktree_path>
145
+ b. If it exists, remove it: git worktree remove <worktree_path>
146
+ c. If removal fails (untracked files), use: git worktree remove --force <worktree_path>
147
+ d. Call clear_worktree_path(task_id) to mark it as cleaned up
148
+ 3. Run 'git worktree list' to verify cleanup
149
+ 4. Log any issues encountered with add_blocker if worktrees cannot be removed
150
+
151
+ This prevents disk bloat from accumulated worktrees and keeps the workspace clean.`,
152
+ },
136
153
  ] as const;
137
154
 
138
155
  export type FallbackActivity = typeof FALLBACK_ACTIVITIES[number];
@@ -1,31 +0,0 @@
1
- /**
2
- * Tool Categories Configuration
3
- *
4
- * Defines the categorization of MCP tools for discovery.
5
- * Moved to separate config for lazy-loading optimization.
6
- */
7
- export interface ToolEntry {
8
- name: string;
9
- brief: string;
10
- }
11
- export interface CategoryEntry {
12
- description: string;
13
- tools: ToolEntry[];
14
- }
15
- export declare const TOOL_CATEGORIES: Record<string, CategoryEntry>;
16
- /**
17
- * Get list of category names
18
- */
19
- export declare function getCategoryNames(): string[];
20
- /**
21
- * Get category summary (without full tool list)
22
- */
23
- export declare function getCategorySummary(): Array<{
24
- name: string;
25
- description: string;
26
- tool_count: number;
27
- }>;
28
- /**
29
- * Get tools in a specific category
30
- */
31
- export declare function getCategoryTools(category: string): CategoryEntry | undefined;
@@ -1,253 +0,0 @@
1
- /**
2
- * Tool Categories Configuration
3
- *
4
- * Defines the categorization of MCP tools for discovery.
5
- * Moved to separate config for lazy-loading optimization.
6
- */
7
- export const TOOL_CATEGORIES = {
8
- session: {
9
- description: 'Session lifecycle and monitoring',
10
- tools: [
11
- { name: 'start_work_session', brief: 'Initialize session, get next task' },
12
- { name: 'get_help', brief: 'Get workflow guidance' },
13
- { name: 'get_token_usage', brief: 'View token stats' },
14
- { name: 'heartbeat', brief: 'Maintain active status' },
15
- { name: 'end_work_session', brief: 'End session, release tasks' },
16
- ],
17
- },
18
- project: {
19
- description: 'Project CRUD and configuration',
20
- tools: [
21
- { name: 'get_project_context', brief: 'Full project info' },
22
- { name: 'get_git_workflow', brief: 'Git branching config' },
23
- { name: 'create_project', brief: 'Create new project' },
24
- { name: 'update_project', brief: 'Modify project settings' },
25
- { name: 'update_project_readme', brief: 'Sync README to dashboard' },
26
- ],
27
- },
28
- tasks: {
29
- description: 'Task management and tracking',
30
- tools: [
31
- { name: 'get_tasks', brief: 'List project tasks' },
32
- { name: 'get_next_task', brief: 'Get highest priority task' },
33
- { name: 'add_task', brief: 'Create new task' },
34
- { name: 'update_task', brief: 'Update task status/progress' },
35
- { name: 'complete_task', brief: 'Mark task done' },
36
- { name: 'delete_task', brief: 'Remove a task' },
37
- { name: 'batch_update_tasks', brief: 'Update multiple tasks' },
38
- { name: 'batch_complete_tasks', brief: 'Complete multiple tasks' },
39
- { name: 'add_task_reference', brief: 'Add URL to task' },
40
- { name: 'remove_task_reference', brief: 'Remove URL from task' },
41
- ],
42
- },
43
- milestones: {
44
- description: 'Task breakdown into steps',
45
- tools: [
46
- { name: 'add_milestone', brief: 'Add step to task' },
47
- { name: 'update_milestone', brief: 'Update milestone' },
48
- { name: 'complete_milestone', brief: 'Mark step done' },
49
- { name: 'delete_milestone', brief: 'Remove milestone' },
50
- { name: 'get_milestones', brief: 'List task milestones' },
51
- ],
52
- },
53
- progress: {
54
- description: 'Progress logging and activity',
55
- tools: [
56
- { name: 'log_progress', brief: 'Record progress update' },
57
- { name: 'get_activity_feed', brief: 'Combined activity feed' },
58
- ],
59
- },
60
- blockers: {
61
- description: 'Blocker management',
62
- tools: [
63
- { name: 'add_blocker', brief: 'Record a blocker' },
64
- { name: 'resolve_blocker', brief: 'Mark resolved' },
65
- { name: 'get_blockers', brief: 'List blockers' },
66
- { name: 'delete_blocker', brief: 'Remove blocker' },
67
- ],
68
- },
69
- decisions: {
70
- description: 'Architectural decisions',
71
- tools: [
72
- { name: 'log_decision', brief: 'Record decision' },
73
- { name: 'get_decisions', brief: 'List decisions' },
74
- { name: 'delete_decision', brief: 'Remove decision' },
75
- ],
76
- },
77
- ideas: {
78
- description: 'Feature ideas tracking',
79
- tools: [
80
- { name: 'add_idea', brief: 'Record an idea' },
81
- { name: 'update_idea', brief: 'Update idea status' },
82
- { name: 'get_ideas', brief: 'List ideas' },
83
- { name: 'delete_idea', brief: 'Remove idea' },
84
- { name: 'convert_idea_to_task', brief: 'Convert idea to task' },
85
- ],
86
- },
87
- findings: {
88
- description: 'Audit findings/knowledge base',
89
- tools: [
90
- { name: 'add_finding', brief: 'Record audit finding' },
91
- { name: 'get_findings', brief: 'List findings' },
92
- { name: 'update_finding', brief: 'Update finding status' },
93
- { name: 'delete_finding', brief: 'Remove finding' },
94
- ],
95
- },
96
- validation: {
97
- description: 'Cross-agent task validation',
98
- tools: [
99
- { name: 'get_tasks_awaiting_validation', brief: 'Unvalidated tasks' },
100
- { name: 'claim_validation', brief: 'Claim task for review' },
101
- { name: 'validate_task', brief: 'Approve/reject task' },
102
- ],
103
- },
104
- deployment: {
105
- description: 'Deployment coordination',
106
- tools: [
107
- { name: 'request_deployment', brief: 'Request deploy' },
108
- { name: 'claim_deployment_validation', brief: 'Claim for validation' },
109
- { name: 'report_validation', brief: 'Report build/test results' },
110
- { name: 'check_deployment_status', brief: 'Get deploy status' },
111
- { name: 'start_deployment', brief: 'Begin deployment' },
112
- { name: 'complete_deployment', brief: 'Mark deploy done' },
113
- { name: 'cancel_deployment', brief: 'Cancel deployment' },
114
- { name: 'add_deployment_requirement', brief: 'Add pre-deploy step' },
115
- { name: 'complete_deployment_requirement', brief: 'Mark step done' },
116
- { name: 'get_deployment_requirements', brief: 'List pre-deploy steps' },
117
- { name: 'schedule_deployment', brief: 'Schedule future deployment' },
118
- { name: 'get_scheduled_deployments', brief: 'List scheduled deployments' },
119
- { name: 'update_scheduled_deployment', brief: 'Update schedule config' },
120
- { name: 'delete_scheduled_deployment', brief: 'Delete schedule' },
121
- { name: 'trigger_scheduled_deployment', brief: 'Manual trigger' },
122
- { name: 'check_due_deployments', brief: 'Check due schedules' },
123
- ],
124
- },
125
- fallback: {
126
- description: 'Background activities when idle',
127
- tools: [
128
- { name: 'start_fallback_activity', brief: 'Start background work' },
129
- { name: 'stop_fallback_activity', brief: 'Stop background work' },
130
- { name: 'get_activity_history', brief: 'Activity history' },
131
- { name: 'get_activity_schedules', brief: 'Activity schedules' },
132
- ],
133
- },
134
- bodies_of_work: {
135
- description: 'Group tasks into bodies of work',
136
- tools: [
137
- { name: 'create_body_of_work', brief: 'Create task group' },
138
- { name: 'update_body_of_work', brief: 'Update settings' },
139
- { name: 'get_body_of_work', brief: 'Get with tasks' },
140
- { name: 'get_bodies_of_work', brief: 'List bodies of work' },
141
- { name: 'delete_body_of_work', brief: 'Remove body of work' },
142
- { name: 'add_task_to_body_of_work', brief: 'Add task to group' },
143
- { name: 'remove_task_from_body_of_work', brief: 'Remove from group' },
144
- { name: 'activate_body_of_work', brief: 'Activate for work' },
145
- ],
146
- },
147
- requests: {
148
- description: 'User request handling',
149
- tools: [
150
- { name: 'get_pending_requests', brief: 'Unhandled requests' },
151
- { name: 'acknowledge_request', brief: 'Mark handled' },
152
- { name: 'answer_question', brief: 'Answer user question' },
153
- ],
154
- },
155
- organizations: {
156
- description: 'Organization and team management',
157
- tools: [
158
- { name: 'list_organizations', brief: 'List user orgs' },
159
- { name: 'create_organization', brief: 'Create new org' },
160
- { name: 'update_organization', brief: 'Update org settings' },
161
- { name: 'delete_organization', brief: 'Delete org' },
162
- { name: 'list_org_members', brief: 'List org members' },
163
- { name: 'invite_member', brief: 'Invite by email' },
164
- { name: 'update_member_role', brief: 'Change member role' },
165
- { name: 'remove_member', brief: 'Remove from org' },
166
- { name: 'leave_organization', brief: 'Leave an org' },
167
- { name: 'share_project_with_org', brief: 'Share project' },
168
- { name: 'update_project_share', brief: 'Update share perms' },
169
- { name: 'unshare_project', brief: 'Remove share' },
170
- { name: 'list_project_shares', brief: 'List project shares' },
171
- ],
172
- },
173
- cost: {
174
- description: 'Cost monitoring and alerts',
175
- tools: [
176
- { name: 'get_cost_summary', brief: 'Cost by period' },
177
- { name: 'get_cost_alerts', brief: 'List cost alerts' },
178
- { name: 'add_cost_alert', brief: 'Add threshold alert' },
179
- { name: 'update_cost_alert', brief: 'Update alert config' },
180
- { name: 'delete_cost_alert', brief: 'Remove alert' },
181
- { name: 'get_task_costs', brief: 'Cost per task' },
182
- ],
183
- },
184
- knowledge: {
185
- description: 'Queryable knowledge base from project data',
186
- tools: [
187
- { name: 'query_knowledge_base', brief: 'Aggregated project knowledge in one call' },
188
- ],
189
- },
190
- subtasks: {
191
- description: 'Subtask management',
192
- tools: [
193
- { name: 'add_subtask', brief: 'Add subtask to parent' },
194
- { name: 'get_subtasks', brief: 'List subtasks' },
195
- ],
196
- },
197
- sprints: {
198
- description: 'Sprint planning and tracking',
199
- tools: [
200
- { name: 'create_sprint', brief: 'Create new sprint' },
201
- { name: 'update_sprint', brief: 'Update sprint' },
202
- { name: 'get_sprint', brief: 'Get sprint details' },
203
- { name: 'get_sprints', brief: 'List sprints' },
204
- { name: 'delete_sprint', brief: 'Remove sprint' },
205
- { name: 'start_sprint', brief: 'Start sprint' },
206
- { name: 'complete_sprint', brief: 'End sprint' },
207
- { name: 'add_task_to_sprint', brief: 'Add task' },
208
- { name: 'remove_task_from_sprint', brief: 'Remove task' },
209
- { name: 'get_sprint_backlog', brief: 'Available tasks' },
210
- { name: 'get_sprint_velocity', brief: 'Velocity metrics' },
211
- ],
212
- },
213
- git_issues: {
214
- description: 'Git issue tracking',
215
- tools: [
216
- { name: 'add_git_issue', brief: 'Record git issue' },
217
- { name: 'resolve_git_issue', brief: 'Mark resolved' },
218
- { name: 'get_git_issues', brief: 'List git issues' },
219
- { name: 'delete_git_issue', brief: 'Remove issue' },
220
- ],
221
- },
222
- dependencies: {
223
- description: 'Task dependencies',
224
- tools: [
225
- { name: 'add_task_dependency', brief: 'Add dependency' },
226
- { name: 'remove_task_dependency', brief: 'Remove dependency' },
227
- { name: 'get_task_dependencies', brief: 'List dependencies' },
228
- { name: 'get_next_body_of_work_task', brief: 'Next available task' },
229
- ],
230
- },
231
- };
232
- /**
233
- * Get list of category names
234
- */
235
- export function getCategoryNames() {
236
- return Object.keys(TOOL_CATEGORIES);
237
- }
238
- /**
239
- * Get category summary (without full tool list)
240
- */
241
- export function getCategorySummary() {
242
- return Object.entries(TOOL_CATEGORIES).map(([name, cat]) => ({
243
- name,
244
- description: cat.description,
245
- tool_count: cat.tools.length,
246
- }));
247
- }
248
- /**
249
- * Get tools in a specific category
250
- */
251
- export function getCategoryTools(category) {
252
- return TOOL_CATEGORIES[category];
253
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * Knowledge Base
3
- *
4
- * Embedded help topics for on-demand agent guidance.
5
- */
6
- export declare const KNOWLEDGE_BASE: Record<string, string>;
package/dist/knowledge.js DELETED
@@ -1,218 +0,0 @@
1
- /**
2
- * Knowledge Base
3
- *
4
- * Embedded help topics for on-demand agent guidance.
5
- */
6
- export const KNOWLEDGE_BASE = {
7
- getting_started: `# Getting Started
8
- 1. Call start_work_session(git_url) to initialize
9
- 2. Response includes next_task - start working on it immediately
10
- 3. Use update_task to mark in_progress and track progress
11
- 4. Call complete_task when done - it returns your next task
12
- 5. Use get_help(topic) when you need guidance on specific workflows`,
13
- tasks: `# Task Workflow
14
- - Mark task in_progress with update_task before starting
15
- - Update progress_percentage regularly (every 15-20% progress)
16
- - Include progress_note to auto-log milestones
17
- - One task at a time - complete current before starting another
18
- - complete_task returns next_task and context counts (validation, blockers, deployment)
19
- - Priority: 1=highest, 5=lowest`,
20
- validation: `# Task Validation
21
- Completed tasks need validation before PR merge. PRIORITIZE validation over new tasks.
22
-
23
- ## Validator Workflow
24
-
25
- ### 1. Claim Task
26
- claim_validation(task_id) → Returns worktree_setup with existing branch
27
-
28
- ### 2. Set Up Worktree (EXISTING branch)
29
- git fetch origin feature/task-branch
30
- git worktree add ../PROJECT-task-ID feature/task-branch
31
- cd ../PROJECT-task-ID
32
-
33
- ### 3. Run Tests Locally
34
- pnpm install && pnpm test && pnpm build
35
-
36
- ### 4. Approve or Reject
37
-
38
- **APPROVE** → Validator merges PR:
39
- validate_task(task_id, approved: true, validation_notes: "...")
40
- # Response includes merge instructions with PR URL
41
- gh pr merge <NUMBER> --squash
42
- git worktree remove ../PROJECT-task-ID
43
-
44
- **REJECT** → Create fix task:
45
- validate_task(task_id, approved: false, validation_notes: "Issues...", create_fix_task: true)
46
- # Creates fix task with SAME branch/PR
47
- # Fix agent picks up, pushes fixes to same PR
48
- git worktree remove ../PROJECT-task-ID
49
-
50
- ## Key Rules
51
- - Validators check out EXISTING branches
52
- - On approval: validator merges immediately
53
- - On rejection: use create_fix_task: true
54
- - Always clean up worktree after validation`,
55
- deployment: `# Deployment Workflow
56
- 1. Ensure all completed tasks are validated first
57
- 2. request_deployment(project_id, environment: "production")
58
- 3. claim_deployment_validation(project_id) - claim for validation
59
- 4. Run: pnpm build && pnpm test
60
- 5. report_validation(project_id, build_passed: true, tests_passed: true)
61
- 6. start_deployment(project_id) - returns project's deployment_instructions
62
- 7. Follow the instructions (e.g., push to main, run deploy command)
63
- 8. complete_deployment(project_id, success: true, summary: "...")`,
64
- git: `# Git Workflow
65
-
66
- Call get_git_workflow(project_id) for project-specific config.
67
-
68
- ## Workflow Types
69
- - **none**: No branching strategy
70
- - **trunk-based**: Commit directly to main, small frequent commits
71
- - **github-flow**: Feature branches, merge via PR after validation
72
- - **git-flow**: develop/release/feature branches
73
-
74
- ## Lifecycle Integration
75
-
76
- ### 1. Starting a Task
77
- When you call update_task(status: "in_progress"), the response includes:
78
- - **branch_name**: Suggested branch (e.g., feature/a1b2c3d4-task-title)
79
- - **base_branch**: Branch to branch from
80
- - **steps**: Git commands to create the branch
81
- - **reminder**: Call to update task with git_branch
82
-
83
- ### 2. Completing a Task
84
- When you call complete_task, the response includes:
85
- - **steps**: Push commands
86
- - **pr_suggestion**: { title, body_template } - ready-to-use PR content
87
- - **next_step**: Reminder that merge happens AFTER validation
88
-
89
- Add the PR link via add_task_reference(task_id, url, label: "Pull Request").
90
-
91
- ### 3. Validation Approved
92
- When validate_task(approved: true) is called, the response includes:
93
- - **target_branch**: Where to merge
94
- - **feature_branch**: Branch being merged
95
- - **steps**: Merge options (UI or command line)
96
- - **cleanup**: Branch deletion commands
97
- - **note**: Confirmation it's safe to merge
98
-
99
- ## Multi-Agent Worktrees (CRITICAL)
100
-
101
- When multiple agents share a repository, you MUST use git worktrees to prevent conflicts.
102
-
103
- ### Why Worktrees?
104
- - Branch switching in shared repos causes file conflicts between agents
105
- - Uncommitted changes from one agent block another's work
106
- - Worktrees provide isolated working directories with shared .git
107
-
108
- ### Setup (Once Per Task)
109
- \`\`\`bash
110
- # From main repo, create worktree for your task
111
- git worktree add ../worktree-<task-short-id> -b feature/<task-id>-<title>
112
-
113
- # Work in the worktree directory
114
- cd ../worktree-<task-short-id>
115
- \`\`\`
116
-
117
- ### Cleanup (After Task Merged)
118
- \`\`\`bash
119
- # Remove worktree after PR merged
120
- git worktree remove ../worktree-<task-short-id>
121
- git branch -d feature/<task-id>-<title>
122
- \`\`\`
123
-
124
- ### Worktree Rules
125
- - ALWAYS create a worktree before starting work on a task
126
- - Each agent works in their own worktree directory
127
- - Never switch branches in the main repo when other agents are active
128
- - Commit and push frequently to avoid losing work
129
-
130
- ## Handling Merge Conflicts
131
-
132
- When claim_validation detects conflicts (via GitHub API):
133
- 1. Response includes merge_conflict with rebase_instructions
134
- 2. Checkout the feature branch locally
135
- 3. Rebase onto target branch: \`git rebase origin/<target>\`
136
- 4. Resolve conflicts, then: \`git add . && git rebase --continue\`
137
- 5. Force push: \`git push origin <branch> --force-with-lease\`
138
- 6. Re-claim validation to verify PR is now mergeable
139
-
140
- ## Key Rules
141
- - Create worktree + branch when starting task (multi-agent environments)
142
- - Push and create PR when completing task
143
- - Wait for validation before merging
144
- - Resolve merge conflicts via rebase before approval
145
- - Clean up worktree and branch after successful merge`,
146
- blockers: `# Working with Blockers
147
- When stuck and need human input:
148
- 1. add_blocker(project_id, description: "What's blocking")
149
- 2. Ask your question to the user
150
- 3. resolve_blocker(blocker_id, resolution_note: "How resolved")
151
- Only use for genuine blockers requiring decisions - not routine questions.`,
152
- milestones: `# Task Milestones
153
- For complex tasks, break into milestones:
154
- 1. add_milestone(task_id, title: "Design schema")
155
- 2. add_milestone(task_id, title: "Implement API")
156
- 3. Update with complete_milestone(milestone_id) as you go
157
- Dashboard shows progress bar with completed/total.`,
158
- fallback: `# Fallback Activities
159
- When no tasks available, get_next_task suggests activities:
160
- - feature_ideation, code_review, performance_audit
161
- - security_review, test_coverage, documentation_review
162
- 1. start_fallback_activity(project_id, activity: "code_review")
163
- 2. Do the work, use add_finding for issues, add_idea for improvements
164
- 3. stop_fallback_activity(project_id, summary: "...")`,
165
- session: `# Session Management
166
- - start_work_session initializes and returns next_task (lite mode default)
167
- - Use mode:'full' for complete context when needed
168
- - heartbeat every 30-60 seconds maintains active status
169
- - end_work_session releases claimed tasks and returns summary
170
- - NEVER STOP: After completing a task, immediately start the next one
171
- - When context grows large: /clear then start_work_session to continue fresh
172
- - Your progress is saved to the dashboard - nothing is lost on /clear`,
173
- tokens: `# Token Efficiency
174
- Be mindful of token costs - every tool call has a cost.
175
- - Use mode:'lite' (default) - saves ~85% vs full mode
176
- - Call get_token_usage() to check consumption
177
- - /compact when context grows large
178
- - Batch related updates when possible
179
- - Trust lite mode; only use full mode for initial exploration`,
180
- sprints: `# Sprints
181
- Sprints are time-bounded bodies of work with velocity tracking.
182
-
183
- ## Lifecycle
184
- 1. **planning**: Create sprint, add tasks with story points
185
- 2. **active**: Sprint in progress, working on tasks
186
- 3. **in_review**: Sprint ended, reviewing completion
187
- 4. **retrospective**: Post-sprint reflection
188
- 5. **completed**: Final state, velocity recorded
189
-
190
- ## Workflow
191
- 1. create_sprint(project_id, title, start_date, end_date, goal)
192
- 2. get_sprint_backlog(project_id) - view available tasks
193
- 3. add_task_to_sprint(sprint_id, task_id, story_points) - add tasks
194
- 4. start_sprint(sprint_id) - locks committed_points
195
- 5. Work on tasks normally (they're assigned to the sprint)
196
- 6. complete_sprint(sprint_id) - calculates final velocity
197
-
198
- ## Velocity Tracking
199
- - committed_points: Total story points at sprint start
200
- - velocity_points: Story points completed by sprint end
201
- - get_sprint_velocity(project_id) - shows history and average velocity
202
-
203
- ## Auto-Deployment
204
- Set auto_deploy_on_completion: true when creating sprint.
205
- Triggers deployment when sprint completes.`,
206
- topics: `# Available Help Topics
207
- - getting_started: Basic workflow overview
208
- - tasks: Working on tasks, progress tracking
209
- - validation: Cross-agent task validation
210
- - deployment: Deployment coordination
211
- - git: Git workflow configuration
212
- - blockers: Handling blockers
213
- - milestones: Breaking down complex tasks
214
- - fallback: Background activities when idle
215
- - session: Session management
216
- - tokens: Token efficiency tips
217
- - sprints: Time-bounded task groupings with velocity tracking`,
218
- };