@vibescope/mcp-server 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/api-client.d.ts +56 -1
- package/dist/api-client.js +17 -2
- package/dist/handlers/bodies-of-work.js +3 -2
- package/dist/handlers/deployment.js +3 -2
- package/dist/handlers/discovery.d.ts +3 -0
- package/dist/handlers/discovery.js +20 -652
- package/dist/handlers/fallback.js +18 -9
- package/dist/handlers/findings.d.ts +8 -1
- package/dist/handlers/findings.js +24 -3
- package/dist/handlers/session.js +23 -8
- package/dist/handlers/sprints.js +3 -2
- package/dist/handlers/tasks.js +22 -1
- package/dist/handlers/tool-docs.d.ts +4 -3
- package/dist/handlers/tool-docs.js +252 -5
- package/dist/handlers/validation.js +13 -1
- package/dist/index.js +25 -7
- package/dist/tools.js +30 -4
- package/package.json +1 -1
- package/src/api-client.ts +72 -2
- package/src/handlers/__test-setup__.ts +5 -0
- package/src/handlers/bodies-of-work.ts +27 -11
- package/src/handlers/deployment.ts +4 -2
- package/src/handlers/discovery.ts +23 -740
- package/src/handlers/fallback.test.ts +78 -0
- package/src/handlers/fallback.ts +20 -9
- package/src/handlers/findings.test.ts +129 -2
- package/src/handlers/findings.ts +32 -3
- package/src/handlers/session.test.ts +37 -2
- package/src/handlers/session.ts +29 -8
- package/src/handlers/sprints.ts +19 -6
- package/src/handlers/tasks.test.ts +61 -0
- package/src/handlers/tasks.ts +26 -1
- package/src/handlers/tool-docs.ts +1024 -0
- package/src/handlers/validation.test.ts +52 -0
- package/src/handlers/validation.ts +14 -1
- package/src/index.ts +25 -7
- package/src/tools.ts +30 -4
- package/src/knowledge.ts +0 -230
|
@@ -494,4 +494,56 @@ describe('validateTask', () => {
|
|
|
494
494
|
validateTask({ task_id: VALID_UUID, approved: false }, ctx)
|
|
495
495
|
).rejects.toThrow('Failed to validate task');
|
|
496
496
|
});
|
|
497
|
+
|
|
498
|
+
describe('PR requirement', () => {
|
|
499
|
+
it('should return error when PR is required but not present', async () => {
|
|
500
|
+
mockApiClient.validateTask.mockResolvedValue({
|
|
501
|
+
ok: false,
|
|
502
|
+
error: 'pr_required',
|
|
503
|
+
data: {
|
|
504
|
+
message: 'This project uses git-flow workflow which requires a Pull Request before validation approval.',
|
|
505
|
+
workflow: 'git-flow',
|
|
506
|
+
},
|
|
507
|
+
});
|
|
508
|
+
const ctx = createMockContext();
|
|
509
|
+
|
|
510
|
+
const result = await validateTask(
|
|
511
|
+
{ task_id: VALID_UUID, approved: true },
|
|
512
|
+
ctx
|
|
513
|
+
);
|
|
514
|
+
|
|
515
|
+
expect(result.result).toMatchObject({
|
|
516
|
+
error: 'pr_required',
|
|
517
|
+
workflow: 'git-flow',
|
|
518
|
+
action_required: expect.stringContaining('add_task_reference'),
|
|
519
|
+
});
|
|
520
|
+
});
|
|
521
|
+
|
|
522
|
+
it('should pass skip_pr_check to API', async () => {
|
|
523
|
+
mockApiClient.validateTask.mockResolvedValue({
|
|
524
|
+
ok: true,
|
|
525
|
+
data: {
|
|
526
|
+
success: true,
|
|
527
|
+
validated_task_id: VALID_UUID,
|
|
528
|
+
self_validated: false,
|
|
529
|
+
},
|
|
530
|
+
});
|
|
531
|
+
const ctx = createMockContext({ sessionId: 'validator-session' });
|
|
532
|
+
|
|
533
|
+
await validateTask(
|
|
534
|
+
{
|
|
535
|
+
task_id: VALID_UUID,
|
|
536
|
+
approved: true,
|
|
537
|
+
skip_pr_check: true,
|
|
538
|
+
},
|
|
539
|
+
ctx
|
|
540
|
+
);
|
|
541
|
+
|
|
542
|
+
expect(mockApiClient.validateTask).toHaveBeenCalledWith(
|
|
543
|
+
VALID_UUID,
|
|
544
|
+
{ approved: true, skip_pr_check: true },
|
|
545
|
+
'validator-session'
|
|
546
|
+
);
|
|
547
|
+
});
|
|
548
|
+
});
|
|
497
549
|
});
|
|
@@ -47,10 +47,11 @@ export const claimValidation: Handler = async (args, ctx) => {
|
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
export const validateTask: Handler = async (args, ctx) => {
|
|
50
|
-
const { task_id, validation_notes, approved } = args as {
|
|
50
|
+
const { task_id, validation_notes, approved, skip_pr_check } = args as {
|
|
51
51
|
task_id: string;
|
|
52
52
|
validation_notes?: string;
|
|
53
53
|
approved: boolean;
|
|
54
|
+
skip_pr_check?: boolean;
|
|
54
55
|
};
|
|
55
56
|
|
|
56
57
|
validateRequired(task_id, 'task_id');
|
|
@@ -67,9 +68,21 @@ export const validateTask: Handler = async (args, ctx) => {
|
|
|
67
68
|
const response = await apiClient.validateTask(task_id, {
|
|
68
69
|
approved,
|
|
69
70
|
validation_notes,
|
|
71
|
+
skip_pr_check,
|
|
70
72
|
}, currentSessionId || undefined);
|
|
71
73
|
|
|
72
74
|
if (!response.ok) {
|
|
75
|
+
// Handle PR required error specially
|
|
76
|
+
if (response.error === 'pr_required') {
|
|
77
|
+
return {
|
|
78
|
+
result: {
|
|
79
|
+
error: 'pr_required',
|
|
80
|
+
message: response.data?.message || 'A Pull Request is required before validation approval. Create a PR and add it via add_task_reference.',
|
|
81
|
+
workflow: response.data?.workflow,
|
|
82
|
+
action_required: 'Create a PR for this task and add it via add_task_reference(task_id, pr_url, label: "Pull Request")',
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
}
|
|
73
86
|
throw new Error(response.error || 'Failed to validate task');
|
|
74
87
|
}
|
|
75
88
|
|
package/src/index.ts
CHANGED
|
@@ -1052,8 +1052,8 @@ Returns session info, persona, and next task. Use mode:'full' for complete conte
|
|
|
1052
1052
|
},
|
|
1053
1053
|
task_type: {
|
|
1054
1054
|
type: 'string',
|
|
1055
|
-
enum: ['frontend', 'backend', 'database', 'mcp', 'testing', 'docs', 'infra', 'other'],
|
|
1056
|
-
description: 'Task category
|
|
1055
|
+
enum: ['frontend', 'backend', 'database', 'feature', 'bugfix', 'design', 'mcp', 'testing', 'docs', 'infra', 'other'],
|
|
1056
|
+
description: 'Task category (frontend, backend, database, feature, bugfix, design, mcp, testing, docs, infra, other)',
|
|
1057
1057
|
},
|
|
1058
1058
|
},
|
|
1059
1059
|
required: ['project_id', 'title'],
|
|
@@ -1101,8 +1101,8 @@ Returns session info, persona, and next task. Use mode:'full' for complete conte
|
|
|
1101
1101
|
},
|
|
1102
1102
|
task_type: {
|
|
1103
1103
|
type: 'string',
|
|
1104
|
-
enum: ['frontend', 'backend', 'database', 'mcp', 'testing', 'docs', 'infra', 'other'],
|
|
1105
|
-
description: 'Task category (frontend, backend, database, mcp, testing, docs, infra, other)',
|
|
1104
|
+
enum: ['frontend', 'backend', 'database', 'feature', 'bugfix', 'design', 'mcp', 'testing', 'docs', 'infra', 'other'],
|
|
1105
|
+
description: 'Task category (frontend, backend, database, feature, bugfix, design, mcp, testing, docs, infra, other)',
|
|
1106
1106
|
},
|
|
1107
1107
|
},
|
|
1108
1108
|
required: ['task_id'],
|
|
@@ -1817,6 +1817,10 @@ Returns subtasks with aggregate completion stats.`,
|
|
|
1817
1817
|
type: 'string',
|
|
1818
1818
|
description: 'Session ID from start_work_session (optional, uses current session if not provided)',
|
|
1819
1819
|
},
|
|
1820
|
+
current_worktree_path: {
|
|
1821
|
+
type: ['string', 'null'],
|
|
1822
|
+
description: 'Report your current git worktree path (e.g., "../project-task-abc123"). Set to null to clear.',
|
|
1823
|
+
},
|
|
1820
1824
|
},
|
|
1821
1825
|
},
|
|
1822
1826
|
},
|
|
@@ -1866,7 +1870,7 @@ Returns subtasks with aggregate completion stats.`,
|
|
|
1866
1870
|
},
|
|
1867
1871
|
{
|
|
1868
1872
|
name: 'validate_task',
|
|
1869
|
-
description: 'Validate a completed task. Include test results in validation_notes.',
|
|
1873
|
+
description: 'Validate a completed task. Include test results in validation_notes. For github-flow/git-flow projects, a PR must exist before approval (add via add_task_reference).',
|
|
1870
1874
|
inputSchema: {
|
|
1871
1875
|
type: 'object',
|
|
1872
1876
|
properties: {
|
|
@@ -1882,6 +1886,10 @@ Returns subtasks with aggregate completion stats.`,
|
|
|
1882
1886
|
type: 'boolean',
|
|
1883
1887
|
description: 'Whether the task passes validation (true = approved, false = needs more work)',
|
|
1884
1888
|
},
|
|
1889
|
+
skip_pr_check: {
|
|
1890
|
+
type: 'boolean',
|
|
1891
|
+
description: 'Skip PR existence check (use only for tasks that legitimately do not need a PR)',
|
|
1892
|
+
},
|
|
1885
1893
|
},
|
|
1886
1894
|
required: ['task_id', 'approved'],
|
|
1887
1895
|
},
|
|
@@ -2589,7 +2597,8 @@ Bodies of work allow organizing related tasks with optional auto-deployment on c
|
|
|
2589
2597
|
},
|
|
2590
2598
|
{
|
|
2591
2599
|
name: 'get_body_of_work',
|
|
2592
|
-
description: `Get a body of work with all its tasks organized by phase
|
|
2600
|
+
description: `Get a body of work with all its tasks organized by phase.
|
|
2601
|
+
Use summary_only: true to get task counts and next task instead of full task arrays (saves tokens).`,
|
|
2593
2602
|
inputSchema: {
|
|
2594
2603
|
type: 'object',
|
|
2595
2604
|
properties: {
|
|
@@ -2597,6 +2606,10 @@ Bodies of work allow organizing related tasks with optional auto-deployment on c
|
|
|
2597
2606
|
type: 'string',
|
|
2598
2607
|
description: 'Body of work UUID',
|
|
2599
2608
|
},
|
|
2609
|
+
summary_only: {
|
|
2610
|
+
type: 'boolean',
|
|
2611
|
+
description: 'Return task counts and next task instead of full task arrays (default: false)',
|
|
2612
|
+
},
|
|
2600
2613
|
},
|
|
2601
2614
|
required: ['body_of_work_id'],
|
|
2602
2615
|
},
|
|
@@ -2872,7 +2885,8 @@ Sprints start in 'planning' status where tasks can be added with story points.`,
|
|
|
2872
2885
|
{
|
|
2873
2886
|
name: 'get_sprint',
|
|
2874
2887
|
description: `Get a sprint with all its tasks organized by phase (pre/core/post).
|
|
2875
|
-
Includes progress percentage, velocity points, and committed points
|
|
2888
|
+
Includes progress percentage, velocity points, and committed points.
|
|
2889
|
+
Use summary_only: true to get task counts and next task instead of full task arrays (saves tokens).`,
|
|
2876
2890
|
inputSchema: {
|
|
2877
2891
|
type: 'object',
|
|
2878
2892
|
properties: {
|
|
@@ -2880,6 +2894,10 @@ Includes progress percentage, velocity points, and committed points.`,
|
|
|
2880
2894
|
type: 'string',
|
|
2881
2895
|
description: 'Sprint UUID',
|
|
2882
2896
|
},
|
|
2897
|
+
summary_only: {
|
|
2898
|
+
type: 'boolean',
|
|
2899
|
+
description: 'Return task counts and next task instead of full task arrays (default: false)',
|
|
2900
|
+
},
|
|
2883
2901
|
},
|
|
2884
2902
|
required: ['sprint_id'],
|
|
2885
2903
|
},
|
package/src/tools.ts
CHANGED
|
@@ -884,15 +884,29 @@ Returns session info, persona, role, and next task. Use mode:'full' for complete
|
|
|
884
884
|
},
|
|
885
885
|
{
|
|
886
886
|
name: 'get_findings',
|
|
887
|
-
description: `Get findings for a project, optionally filtered by category, severity, or status.`,
|
|
887
|
+
description: `Get findings for a project, optionally filtered by category, severity, or status. Use summary_only=true to reduce token usage by returning only essential fields (id, title, category, severity, status). For just counts, use get_findings_stats instead.`,
|
|
888
888
|
inputSchema: {
|
|
889
889
|
type: 'object',
|
|
890
890
|
properties: {
|
|
891
891
|
project_id: { type: 'string', description: 'Project UUID' },
|
|
892
892
|
category: { type: 'string', enum: ['performance', 'security', 'code_quality', 'accessibility', 'documentation', 'architecture', 'testing', 'other'], description: 'Filter by category (optional)' },
|
|
893
893
|
severity: { type: 'string', enum: ['info', 'low', 'medium', 'high', 'critical'], description: 'Filter by severity (optional)' },
|
|
894
|
-
status: { type: 'string', enum: ['open', 'addressed', 'dismissed', 'wontfix'], description: 'Filter by status (default:
|
|
895
|
-
limit: { type: 'number', description: 'Max number of findings to return (default 50)' },
|
|
894
|
+
status: { type: 'string', enum: ['open', 'addressed', 'dismissed', 'wontfix'], description: 'Filter by status (default: open)' },
|
|
895
|
+
limit: { type: 'number', description: 'Max number of findings to return (default 50, max 200)' },
|
|
896
|
+
offset: { type: 'number', description: 'Number of findings to skip for pagination (default 0)' },
|
|
897
|
+
search_query: { type: 'string', description: 'Search findings by title' },
|
|
898
|
+
summary_only: { type: 'boolean', description: 'When true, returns only id, title, category, severity, status (reduces tokens by ~80%). Default: false' },
|
|
899
|
+
},
|
|
900
|
+
required: ['project_id'],
|
|
901
|
+
},
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
name: 'get_findings_stats',
|
|
905
|
+
description: `Get aggregate statistics about findings for a project. Returns total count and breakdowns by status, severity, and category. Much more token-efficient than get_findings when you just need to understand the overall state.`,
|
|
906
|
+
inputSchema: {
|
|
907
|
+
type: 'object',
|
|
908
|
+
properties: {
|
|
909
|
+
project_id: { type: 'string', description: 'Project UUID' },
|
|
896
910
|
},
|
|
897
911
|
required: ['project_id'],
|
|
898
912
|
},
|
|
@@ -1103,6 +1117,10 @@ Returns subtasks with aggregate completion stats.`,
|
|
|
1103
1117
|
type: 'string',
|
|
1104
1118
|
description: 'Session ID from start_work_session (optional, uses current session if not provided)',
|
|
1105
1119
|
},
|
|
1120
|
+
current_worktree_path: {
|
|
1121
|
+
type: ['string', 'null'],
|
|
1122
|
+
description: 'Report your current git worktree path (e.g., "../project-task-abc123"). Set to null to clear.',
|
|
1123
|
+
},
|
|
1106
1124
|
},
|
|
1107
1125
|
},
|
|
1108
1126
|
},
|
|
@@ -1152,7 +1170,7 @@ Returns subtasks with aggregate completion stats.`,
|
|
|
1152
1170
|
},
|
|
1153
1171
|
{
|
|
1154
1172
|
name: 'validate_task',
|
|
1155
|
-
description: 'Validate a completed task. Include test results in validation_notes.',
|
|
1173
|
+
description: 'Validate a completed task. Include test results in validation_notes. For github-flow/git-flow projects, a PR must exist before approval (add via add_task_reference).',
|
|
1156
1174
|
inputSchema: {
|
|
1157
1175
|
type: 'object',
|
|
1158
1176
|
properties: {
|
|
@@ -1168,6 +1186,10 @@ Returns subtasks with aggregate completion stats.`,
|
|
|
1168
1186
|
type: 'boolean',
|
|
1169
1187
|
description: 'Whether the task passes validation (true = approved, false = needs more work)',
|
|
1170
1188
|
},
|
|
1189
|
+
skip_pr_check: {
|
|
1190
|
+
type: 'boolean',
|
|
1191
|
+
description: 'Skip PR existence check (use only for tasks that legitimately do not need a PR)',
|
|
1192
|
+
},
|
|
1171
1193
|
},
|
|
1172
1194
|
required: ['task_id', 'approved'],
|
|
1173
1195
|
},
|
|
@@ -1351,6 +1373,10 @@ Returns subtasks with aggregate completion stats.`,
|
|
|
1351
1373
|
type: 'boolean',
|
|
1352
1374
|
description: 'When true, converted task blocks all other work until complete',
|
|
1353
1375
|
},
|
|
1376
|
+
recurring: {
|
|
1377
|
+
type: 'boolean',
|
|
1378
|
+
description: 'When true, requirement resets to pending when a new deployment is requested',
|
|
1379
|
+
},
|
|
1354
1380
|
},
|
|
1355
1381
|
required: ['project_id', 'type', 'title'],
|
|
1356
1382
|
},
|
package/src/knowledge.ts
DELETED
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Knowledge Base
|
|
3
|
-
*
|
|
4
|
-
* Embedded help topics for on-demand agent guidance.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export const KNOWLEDGE_BASE: Record<string, string> = {
|
|
8
|
-
getting_started: `# Getting Started
|
|
9
|
-
1. Call start_work_session(git_url) to initialize
|
|
10
|
-
2. Response includes next_task - start working on it immediately
|
|
11
|
-
3. Use update_task to mark in_progress and track progress
|
|
12
|
-
4. Call complete_task when done - it returns your next task
|
|
13
|
-
5. Use get_help(topic) when you need guidance on specific workflows`,
|
|
14
|
-
|
|
15
|
-
tasks: `# Task Workflow
|
|
16
|
-
- Mark task in_progress with update_task before starting
|
|
17
|
-
- Update progress_percentage regularly (every 15-20% progress)
|
|
18
|
-
- Include progress_note to auto-log milestones
|
|
19
|
-
- One task at a time - complete current before starting another
|
|
20
|
-
- complete_task returns next_task and context counts (validation, blockers, deployment)
|
|
21
|
-
- Priority: 1=highest, 5=lowest`,
|
|
22
|
-
|
|
23
|
-
validation: `# Task Validation
|
|
24
|
-
Completed tasks need validation before PR merge. PRIORITIZE validation over new tasks.
|
|
25
|
-
|
|
26
|
-
## Validator Workflow
|
|
27
|
-
|
|
28
|
-
### 1. Claim Task
|
|
29
|
-
claim_validation(task_id) → Returns worktree_setup with existing branch
|
|
30
|
-
|
|
31
|
-
### 2. Set Up Worktree (EXISTING branch)
|
|
32
|
-
git fetch origin feature/task-branch
|
|
33
|
-
git worktree add ../PROJECT-task-ID feature/task-branch
|
|
34
|
-
cd ../PROJECT-task-ID
|
|
35
|
-
|
|
36
|
-
### 3. Run Tests Locally
|
|
37
|
-
pnpm install && pnpm test && pnpm build
|
|
38
|
-
|
|
39
|
-
### 4. Approve or Reject
|
|
40
|
-
|
|
41
|
-
**APPROVE** → Validator merges PR:
|
|
42
|
-
validate_task(task_id, approved: true, validation_notes: "...")
|
|
43
|
-
# Response includes merge instructions with PR URL
|
|
44
|
-
gh pr merge <NUMBER> --squash
|
|
45
|
-
git worktree remove ../PROJECT-task-ID
|
|
46
|
-
|
|
47
|
-
**REJECT** → Create fix task:
|
|
48
|
-
validate_task(task_id, approved: false, validation_notes: "Issues...", create_fix_task: true)
|
|
49
|
-
# Creates fix task with SAME branch/PR
|
|
50
|
-
# Fix agent picks up, pushes fixes to same PR
|
|
51
|
-
git worktree remove ../PROJECT-task-ID
|
|
52
|
-
|
|
53
|
-
## Key Rules
|
|
54
|
-
- Validators check out EXISTING branches
|
|
55
|
-
- On approval: validator merges immediately
|
|
56
|
-
- On rejection: use create_fix_task: true
|
|
57
|
-
- Always clean up worktree after validation`,
|
|
58
|
-
|
|
59
|
-
deployment: `# Deployment Workflow
|
|
60
|
-
1. Ensure all completed tasks are validated first
|
|
61
|
-
2. request_deployment(project_id, environment: "production")
|
|
62
|
-
3. claim_deployment_validation(project_id) - claim for validation
|
|
63
|
-
4. Run: pnpm build && pnpm test
|
|
64
|
-
5. report_validation(project_id, build_passed: true, tests_passed: true)
|
|
65
|
-
6. start_deployment(project_id) - returns project's deployment_instructions
|
|
66
|
-
7. Follow the instructions (e.g., push to main, run deploy command)
|
|
67
|
-
8. complete_deployment(project_id, success: true, summary: "...")`,
|
|
68
|
-
|
|
69
|
-
git: `# Git Workflow
|
|
70
|
-
|
|
71
|
-
Call get_git_workflow(project_id) for project-specific config.
|
|
72
|
-
|
|
73
|
-
## Workflow Types
|
|
74
|
-
- **none**: No branching strategy
|
|
75
|
-
- **trunk-based**: Commit directly to main, small frequent commits
|
|
76
|
-
- **github-flow**: Feature branches, merge via PR after validation
|
|
77
|
-
- **git-flow**: develop/release/feature branches
|
|
78
|
-
|
|
79
|
-
## Lifecycle Integration
|
|
80
|
-
|
|
81
|
-
### 1. Starting a Task
|
|
82
|
-
When you call update_task(status: "in_progress"), the response includes:
|
|
83
|
-
- **branch_name**: Suggested branch (e.g., feature/a1b2c3d4-task-title)
|
|
84
|
-
- **base_branch**: Branch to branch from
|
|
85
|
-
- **steps**: Git commands to create the branch
|
|
86
|
-
- **reminder**: Call to update task with git_branch
|
|
87
|
-
|
|
88
|
-
### 2. Completing a Task
|
|
89
|
-
When you call complete_task, the response includes:
|
|
90
|
-
- **steps**: Push commands
|
|
91
|
-
- **pr_suggestion**: { title, body_template } - ready-to-use PR content
|
|
92
|
-
- **next_step**: Reminder that merge happens AFTER validation
|
|
93
|
-
|
|
94
|
-
Add the PR link via add_task_reference(task_id, url, label: "Pull Request").
|
|
95
|
-
|
|
96
|
-
### 3. Validation Approved
|
|
97
|
-
When validate_task(approved: true) is called, the response includes:
|
|
98
|
-
- **target_branch**: Where to merge
|
|
99
|
-
- **feature_branch**: Branch being merged
|
|
100
|
-
- **steps**: Merge options (UI or command line)
|
|
101
|
-
- **cleanup**: Branch deletion commands
|
|
102
|
-
- **note**: Confirmation it's safe to merge
|
|
103
|
-
|
|
104
|
-
## Multi-Agent Worktrees (CRITICAL)
|
|
105
|
-
|
|
106
|
-
When multiple agents share a repository, you MUST use git worktrees to prevent conflicts.
|
|
107
|
-
|
|
108
|
-
### Why Worktrees?
|
|
109
|
-
- Branch switching in shared repos causes file conflicts between agents
|
|
110
|
-
- Uncommitted changes from one agent block another's work
|
|
111
|
-
- Worktrees provide isolated working directories with shared .git
|
|
112
|
-
|
|
113
|
-
### Setup (Once Per Task)
|
|
114
|
-
\`\`\`bash
|
|
115
|
-
# From main repo, create worktree for your task
|
|
116
|
-
git worktree add ../worktree-<task-short-id> -b feature/<task-id>-<title>
|
|
117
|
-
|
|
118
|
-
# Work in the worktree directory
|
|
119
|
-
cd ../worktree-<task-short-id>
|
|
120
|
-
\`\`\`
|
|
121
|
-
|
|
122
|
-
### Cleanup (After Task Merged)
|
|
123
|
-
\`\`\`bash
|
|
124
|
-
# Remove worktree after PR merged
|
|
125
|
-
git worktree remove ../worktree-<task-short-id>
|
|
126
|
-
git branch -d feature/<task-id>-<title>
|
|
127
|
-
\`\`\`
|
|
128
|
-
|
|
129
|
-
### Worktree Rules
|
|
130
|
-
- ALWAYS create a worktree before starting work on a task
|
|
131
|
-
- Each agent works in their own worktree directory
|
|
132
|
-
- Never switch branches in the main repo when other agents are active
|
|
133
|
-
- Commit and push frequently to avoid losing work
|
|
134
|
-
|
|
135
|
-
## Handling Merge Conflicts
|
|
136
|
-
|
|
137
|
-
When claim_validation detects conflicts (via GitHub API):
|
|
138
|
-
1. Response includes merge_conflict with rebase_instructions
|
|
139
|
-
2. Checkout the feature branch locally
|
|
140
|
-
3. Rebase onto target branch: \`git rebase origin/<target>\`
|
|
141
|
-
4. Resolve conflicts, then: \`git add . && git rebase --continue\`
|
|
142
|
-
5. Force push: \`git push origin <branch> --force-with-lease\`
|
|
143
|
-
6. Re-claim validation to verify PR is now mergeable
|
|
144
|
-
|
|
145
|
-
## Key Rules
|
|
146
|
-
- Create worktree + branch when starting task (multi-agent environments)
|
|
147
|
-
- Push and create PR when completing task
|
|
148
|
-
- Wait for validation before merging
|
|
149
|
-
- Resolve merge conflicts via rebase before approval
|
|
150
|
-
- Clean up worktree and branch after successful merge`,
|
|
151
|
-
|
|
152
|
-
blockers: `# Working with Blockers
|
|
153
|
-
When stuck and need human input:
|
|
154
|
-
1. add_blocker(project_id, description: "What's blocking")
|
|
155
|
-
2. Ask your question to the user
|
|
156
|
-
3. resolve_blocker(blocker_id, resolution_note: "How resolved")
|
|
157
|
-
Only use for genuine blockers requiring decisions - not routine questions.`,
|
|
158
|
-
|
|
159
|
-
milestones: `# Task Milestones
|
|
160
|
-
For complex tasks, break into milestones:
|
|
161
|
-
1. add_milestone(task_id, title: "Design schema")
|
|
162
|
-
2. add_milestone(task_id, title: "Implement API")
|
|
163
|
-
3. Update with complete_milestone(milestone_id) as you go
|
|
164
|
-
Dashboard shows progress bar with completed/total.`,
|
|
165
|
-
|
|
166
|
-
fallback: `# Fallback Activities
|
|
167
|
-
When no tasks available, get_next_task suggests activities:
|
|
168
|
-
- feature_ideation, code_review, performance_audit
|
|
169
|
-
- security_review, test_coverage, documentation_review
|
|
170
|
-
1. start_fallback_activity(project_id, activity: "code_review")
|
|
171
|
-
2. Do the work, use add_finding for issues, add_idea for improvements
|
|
172
|
-
3. stop_fallback_activity(project_id, summary: "...")`,
|
|
173
|
-
|
|
174
|
-
session: `# Session Management
|
|
175
|
-
- start_work_session initializes and returns next_task (lite mode default)
|
|
176
|
-
- Use mode:'full' for complete context when needed
|
|
177
|
-
- heartbeat every 30-60 seconds maintains active status
|
|
178
|
-
- end_work_session releases claimed tasks and returns summary
|
|
179
|
-
- NEVER STOP: After completing a task, immediately start the next one
|
|
180
|
-
- When context grows large: /clear then start_work_session to continue fresh
|
|
181
|
-
- Your progress is saved to the dashboard - nothing is lost on /clear`,
|
|
182
|
-
|
|
183
|
-
tokens: `# Token Efficiency
|
|
184
|
-
Be mindful of token costs - every tool call has a cost.
|
|
185
|
-
- Use mode:'lite' (default) - saves ~85% vs full mode
|
|
186
|
-
- Call get_token_usage() to check consumption
|
|
187
|
-
- /compact when context grows large
|
|
188
|
-
- Batch related updates when possible
|
|
189
|
-
- Trust lite mode; only use full mode for initial exploration`,
|
|
190
|
-
|
|
191
|
-
sprints: `# Sprints
|
|
192
|
-
Sprints are time-bounded bodies of work with velocity tracking.
|
|
193
|
-
|
|
194
|
-
## Lifecycle
|
|
195
|
-
1. **planning**: Create sprint, add tasks with story points
|
|
196
|
-
2. **active**: Sprint in progress, working on tasks
|
|
197
|
-
3. **in_review**: Sprint ended, reviewing completion
|
|
198
|
-
4. **retrospective**: Post-sprint reflection
|
|
199
|
-
5. **completed**: Final state, velocity recorded
|
|
200
|
-
|
|
201
|
-
## Workflow
|
|
202
|
-
1. create_sprint(project_id, title, start_date, end_date, goal)
|
|
203
|
-
2. get_sprint_backlog(project_id) - view available tasks
|
|
204
|
-
3. add_task_to_sprint(sprint_id, task_id, story_points) - add tasks
|
|
205
|
-
4. start_sprint(sprint_id) - locks committed_points
|
|
206
|
-
5. Work on tasks normally (they're assigned to the sprint)
|
|
207
|
-
6. complete_sprint(sprint_id) - calculates final velocity
|
|
208
|
-
|
|
209
|
-
## Velocity Tracking
|
|
210
|
-
- committed_points: Total story points at sprint start
|
|
211
|
-
- velocity_points: Story points completed by sprint end
|
|
212
|
-
- get_sprint_velocity(project_id) - shows history and average velocity
|
|
213
|
-
|
|
214
|
-
## Auto-Deployment
|
|
215
|
-
Set auto_deploy_on_completion: true when creating sprint.
|
|
216
|
-
Triggers deployment when sprint completes.`,
|
|
217
|
-
|
|
218
|
-
topics: `# Available Help Topics
|
|
219
|
-
- getting_started: Basic workflow overview
|
|
220
|
-
- tasks: Working on tasks, progress tracking
|
|
221
|
-
- validation: Cross-agent task validation
|
|
222
|
-
- deployment: Deployment coordination
|
|
223
|
-
- git: Git workflow configuration
|
|
224
|
-
- blockers: Handling blockers
|
|
225
|
-
- milestones: Breaking down complex tasks
|
|
226
|
-
- fallback: Background activities when idle
|
|
227
|
-
- session: Session management
|
|
228
|
-
- tokens: Token efficiency tips
|
|
229
|
-
- sprints: Time-bounded task groupings with velocity tracking`,
|
|
230
|
-
};
|