@vibescope/mcp-server 0.2.4 → 0.2.5

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 (84) hide show
  1. package/CHANGELOG.md +84 -84
  2. package/README.md +194 -181
  3. package/dist/cli.d.ts +6 -3
  4. package/dist/cli.js +28 -10
  5. package/dist/handlers/tool-docs.js +828 -828
  6. package/dist/index.js +73 -73
  7. package/dist/knowledge.d.ts +6 -0
  8. package/dist/knowledge.js +218 -0
  9. package/dist/setup.d.ts +22 -0
  10. package/dist/setup.js +313 -0
  11. package/dist/templates/agent-guidelines.js +185 -185
  12. package/dist/tools.js +65 -65
  13. package/dist/utils.js +11 -11
  14. package/docs/TOOLS.md +2053 -2053
  15. package/package.json +1 -1
  16. package/scripts/generate-docs.ts +212 -212
  17. package/scripts/version-bump.ts +203 -203
  18. package/src/api-client.test.ts +723 -723
  19. package/src/api-client.ts +2499 -2499
  20. package/src/cli.ts +27 -10
  21. package/src/handlers/__test-setup__.ts +236 -236
  22. package/src/handlers/__test-utils__.ts +87 -87
  23. package/src/handlers/blockers.test.ts +468 -468
  24. package/src/handlers/blockers.ts +163 -163
  25. package/src/handlers/bodies-of-work.test.ts +704 -704
  26. package/src/handlers/bodies-of-work.ts +526 -526
  27. package/src/handlers/connectors.test.ts +834 -834
  28. package/src/handlers/connectors.ts +229 -229
  29. package/src/handlers/cost.test.ts +462 -462
  30. package/src/handlers/cost.ts +285 -285
  31. package/src/handlers/decisions.test.ts +382 -382
  32. package/src/handlers/decisions.ts +153 -153
  33. package/src/handlers/deployment.test.ts +551 -551
  34. package/src/handlers/deployment.ts +541 -541
  35. package/src/handlers/discovery.test.ts +206 -206
  36. package/src/handlers/discovery.ts +390 -390
  37. package/src/handlers/fallback.test.ts +537 -537
  38. package/src/handlers/fallback.ts +194 -194
  39. package/src/handlers/file-checkouts.test.ts +750 -750
  40. package/src/handlers/file-checkouts.ts +185 -185
  41. package/src/handlers/findings.test.ts +633 -633
  42. package/src/handlers/findings.ts +239 -239
  43. package/src/handlers/git-issues.test.ts +631 -631
  44. package/src/handlers/git-issues.ts +136 -136
  45. package/src/handlers/ideas.test.ts +644 -644
  46. package/src/handlers/ideas.ts +207 -207
  47. package/src/handlers/index.ts +84 -84
  48. package/src/handlers/milestones.test.ts +475 -475
  49. package/src/handlers/milestones.ts +180 -180
  50. package/src/handlers/organizations.test.ts +826 -826
  51. package/src/handlers/organizations.ts +315 -315
  52. package/src/handlers/progress.test.ts +269 -269
  53. package/src/handlers/progress.ts +77 -77
  54. package/src/handlers/project.test.ts +546 -546
  55. package/src/handlers/project.ts +239 -239
  56. package/src/handlers/requests.test.ts +303 -303
  57. package/src/handlers/requests.ts +99 -99
  58. package/src/handlers/roles.test.ts +303 -303
  59. package/src/handlers/roles.ts +226 -226
  60. package/src/handlers/session.test.ts +875 -875
  61. package/src/handlers/session.ts +738 -738
  62. package/src/handlers/sprints.test.ts +732 -732
  63. package/src/handlers/sprints.ts +537 -537
  64. package/src/handlers/tasks.test.ts +907 -907
  65. package/src/handlers/tasks.ts +945 -945
  66. package/src/handlers/tool-categories.test.ts +66 -66
  67. package/src/handlers/tool-docs.ts +1096 -1096
  68. package/src/handlers/types.test.ts +259 -259
  69. package/src/handlers/types.ts +175 -175
  70. package/src/handlers/validation.test.ts +582 -582
  71. package/src/handlers/validation.ts +97 -97
  72. package/src/index.ts +792 -792
  73. package/src/setup.test.ts +231 -0
  74. package/src/setup.ts +370 -0
  75. package/src/templates/agent-guidelines.ts +210 -210
  76. package/src/token-tracking.test.ts +453 -453
  77. package/src/token-tracking.ts +164 -164
  78. package/src/tools.ts +3562 -3562
  79. package/src/utils.test.ts +683 -683
  80. package/src/utils.ts +436 -436
  81. package/src/validators.test.ts +223 -223
  82. package/src/validators.ts +249 -249
  83. package/tsconfig.json +16 -16
  84. package/vitest.config.ts +14 -14
@@ -5,183 +5,183 @@
5
5
  * in every project using Vibescope for agent tracking. These guidelines ensure
6
6
  * agents follow proper workflows and maintain visibility.
7
7
  */
8
- export const AGENT_GUIDELINES_TEMPLATE = `# Vibescope Agent Guidelines
9
-
10
- ## Quick Start
11
-
12
- \`\`\`
13
- start_work_session(git_url: "https://github.com/YOUR/REPO", model: "opus")
14
- \`\`\`
15
-
16
- **IMPORTANT:** Always pass your model (opus/sonnet/haiku) to enable cost tracking. Check your system prompt for "You are powered by the model named..." to determine your model.
17
-
18
- This returns your persona, project info, and \`next_task\`. Start working immediately.
19
-
20
- ## CRITICAL: MCP Connection Required
21
-
22
- **If the Vibescope MCP server fails to connect, you MUST end your session immediately.**
23
-
24
- ### Why This Is Non-Negotiable
25
-
26
- Working without MCP connection causes:
27
- - **No progress visibility** - Humans can't see what you're doing
28
- - **Lost work tracking** - Tasks aren't tracked, time is wasted
29
- - **Workflow violations** - Other agents may conflict with your work
30
- - **Dashboard confusion** - Project state becomes inconsistent
31
-
32
- ### Connection Failure Handling
33
-
34
- **If \`start_work_session\` fails or returns an error:**
35
-
36
- 1. **Do NOT proceed with any work**
37
- 2. **Inform the user** that MCP connection failed
38
- 3. **End the session** - do not attempt workarounds
39
- 4. **Provide troubleshooting steps:**
40
- - Check if MCP server is configured: \`claude mcp list\`
41
- - Verify API key is set: check \`.mcp.json\` or environment
42
- - Restart Claude Code after fixing configuration
43
-
44
- **Example error responses you might see:**
45
- \`\`\`
46
- Error: Failed to start session
47
- Error: VIBESCOPE_API_KEY not set
48
- Error: Network error connecting to Vibescope API
49
- Error: MCP server 'vibescope' not found
50
- \`\`\`
51
-
52
- ### Recovery Steps
53
-
54
- If MCP connection fails, tell the user:
55
-
56
- \`\`\`
57
- MCP connection to Vibescope failed. I cannot proceed without task tracking.
58
-
59
- To fix:
60
- 1. Run: claude mcp list (verify vibescope is configured)
61
- 2. Check API key: ensure VIBESCOPE_API_KEY is set
62
- 3. Restart Claude Code
63
- 4. Try again with: start_work_session(git_url: "...")
64
-
65
- I am ending this session to prevent untracked work.
66
- \`\`\`
67
-
68
- **Never "work around" a broken MCP connection.** The whole point of Vibescope is visibility and coordination. Working without it defeats the purpose.
69
-
70
- ## Core Workflow
71
-
72
- 1. **Start session** → \`start_work_session(git_url, model)\` - Always include your model!
73
- 2. **Mark task in progress** → \`update_task(task_id, status: "in_progress")\` - Returns git workflow instructions!
74
- 3. **Set up worktree** → Create isolated worktree for this task (see Git Workflow below)
75
- 4. **Update progress** → \`update_task(task_id, progress_percentage: 50, progress_note: "...")\`
76
- 5. **Complete task** → \`complete_task(task_id, summary: "...")\` - **MANDATORY, see below!**
77
- 6. **Clean up** → Remove worktree, then start next task immediately
78
-
79
- ## CRITICAL: Always Call complete_task (MANDATORY)
80
-
81
- **You MUST call \`complete_task()\` when you finish a task.** This is not optional.
82
-
83
- ### When to Call complete_task
84
-
85
- Call \`complete_task()\` immediately after:
86
- - ✅ Creating and pushing a PR
87
- - ✅ Merging changes (for trunk-based workflow)
88
- - ✅ Finishing any unit of work, even if no code changes
89
-
90
- **Do NOT wait for:**
91
- - ❌ PR to be reviewed/merged (that's what validation is for)
92
- - ❌ User confirmation
93
- - ❌ "Perfect" summary - a brief summary is fine
94
-
95
- ### The Rule
96
-
97
- \`\`\`
98
- PR created + pushed → complete_task() → THEN worry about next steps
99
- \`\`\`
100
-
101
- **If you create a PR and don't call \`complete_task()\`, you have failed the workflow.**
102
-
103
- ## CRITICAL: Git Worktrees for Multi-Agent
104
-
105
- When multiple agents share a repository, you **MUST** use git worktrees to prevent conflicts.
106
-
107
- **Before starting ANY task:**
108
- \`\`\`bash
109
- # For git-flow: ensure you're on develop first, then create worktree
110
- git checkout develop
111
- git pull origin develop
112
- git worktree add ../worktree-<task-short-id> -b feature/<task-id>-<title>
113
- cd ../worktree-<task-short-id>
114
- \`\`\`
115
-
116
- **After task is merged:**
117
- \`\`\`bash
118
- git worktree remove ../worktree-<task-short-id>
119
- \`\`\`
120
-
121
- **Why?** Branch switching in shared repos causes file conflicts between agents. Worktrees provide isolated directories.
122
-
123
- Run \`get_help("git")\` for full worktree documentation.
124
-
125
- ## CRITICAL: Never Ask Permission
126
-
127
- **You must NEVER:**
128
- - Ask "Should I continue to the next task?" → Just continue
129
- - Ask "Should I clear my context?" → Just clear it
130
- - Ask "What should I do next?" → Check \`next_task\` or use fallback activities
131
- - Say "All tasks are done, let me know what to do" → Use \`get_next_task\` or start fallback activity
132
- - Wait for confirmation before clearing context → Just do it
133
-
134
- **You must ALWAYS:**
135
- - Call \`complete_task()\` immediately after creating/pushing a PR - this is non-negotiable
136
- - Immediately start the next task after completing one
137
- - Clear context and restart session automatically when needed
138
- - Keep working until there are genuinely no tasks and no fallback activities
139
-
140
- ## Continuous Work
141
-
142
- **IMPORTANT: Never stop working!** When you complete a task:
143
- 1. \`complete_task\` returns \`next_task\` → Start it immediately
144
- 2. No \`next_task\`? → Call \`get_next_task(project_id)\`
145
- 3. Still no tasks? → Start a \`fallback_activity\` (code_review, security_review, etc.)
146
-
147
- **When context grows large or responses slow down:**
148
- 1. Run \`/clear\` to reset conversation
149
- 2. Immediately call \`start_work_session(git_url, model)\` to reload context
150
- 3. Continue with \`next_task\` from the response
151
-
152
- **Do NOT ask the user if you should clear context. Just do it.** The dashboard tracks all your progress, so nothing is lost when you clear.
153
-
154
- ## Need Help?
155
-
156
- Use \`get_help(topic)\` for detailed guidance:
157
-
158
- | Topic | Description |
159
- |-------|-------------|
160
- | \`getting_started\` | Basic workflow overview |
161
- | \`tasks\` | Working on tasks, progress tracking |
162
- | \`validation\` | Cross-agent task validation |
163
- | \`deployment\` | Deployment coordination |
164
- | \`git\` | Git workflow configuration |
165
- | \`blockers\` | Handling blockers |
166
- | \`milestones\` | Breaking down complex tasks |
167
- | \`fallback\` | Background activities when idle |
168
- | \`session\` | Session management |
169
- | \`topics\` | List all available topics |
170
-
171
- ## MCP Server Not Connected?
172
-
173
- ### Quick Setup (Claude Code)
174
-
175
- \`\`\`bash
176
- claude mcp add vibescope npx @vibescope/mcp-server@latest \\
177
- --env VIBESCOPE_API_KEY=your_key
178
- \`\`\`
179
-
180
- ### Manual Setup
181
-
182
- 1. Copy \`.mcp.json.example\` to \`.mcp.json\`
183
- 2. Get \`VIBESCOPE_API_KEY\` from https://vibescope.dev/dashboard/settings
184
- 3. Restart Claude Code
8
+ export const AGENT_GUIDELINES_TEMPLATE = `# Vibescope Agent Guidelines
9
+
10
+ ## Quick Start
11
+
12
+ \`\`\`
13
+ start_work_session(git_url: "https://github.com/YOUR/REPO", model: "opus")
14
+ \`\`\`
15
+
16
+ **IMPORTANT:** Always pass your model (opus/sonnet/haiku) to enable cost tracking. Check your system prompt for "You are powered by the model named..." to determine your model.
17
+
18
+ This returns your persona, project info, and \`next_task\`. Start working immediately.
19
+
20
+ ## CRITICAL: MCP Connection Required
21
+
22
+ **If the Vibescope MCP server fails to connect, you MUST end your session immediately.**
23
+
24
+ ### Why This Is Non-Negotiable
25
+
26
+ Working without MCP connection causes:
27
+ - **No progress visibility** - Humans can't see what you're doing
28
+ - **Lost work tracking** - Tasks aren't tracked, time is wasted
29
+ - **Workflow violations** - Other agents may conflict with your work
30
+ - **Dashboard confusion** - Project state becomes inconsistent
31
+
32
+ ### Connection Failure Handling
33
+
34
+ **If \`start_work_session\` fails or returns an error:**
35
+
36
+ 1. **Do NOT proceed with any work**
37
+ 2. **Inform the user** that MCP connection failed
38
+ 3. **End the session** - do not attempt workarounds
39
+ 4. **Provide troubleshooting steps:**
40
+ - Check if MCP server is configured: \`claude mcp list\`
41
+ - Verify API key is set: check \`.mcp.json\` or environment
42
+ - Restart Claude Code after fixing configuration
43
+
44
+ **Example error responses you might see:**
45
+ \`\`\`
46
+ Error: Failed to start session
47
+ Error: VIBESCOPE_API_KEY not set
48
+ Error: Network error connecting to Vibescope API
49
+ Error: MCP server 'vibescope' not found
50
+ \`\`\`
51
+
52
+ ### Recovery Steps
53
+
54
+ If MCP connection fails, tell the user:
55
+
56
+ \`\`\`
57
+ MCP connection to Vibescope failed. I cannot proceed without task tracking.
58
+
59
+ To fix:
60
+ 1. Run: claude mcp list (verify vibescope is configured)
61
+ 2. Check API key: ensure VIBESCOPE_API_KEY is set
62
+ 3. Restart Claude Code
63
+ 4. Try again with: start_work_session(git_url: "...")
64
+
65
+ I am ending this session to prevent untracked work.
66
+ \`\`\`
67
+
68
+ **Never "work around" a broken MCP connection.** The whole point of Vibescope is visibility and coordination. Working without it defeats the purpose.
69
+
70
+ ## Core Workflow
71
+
72
+ 1. **Start session** → \`start_work_session(git_url, model)\` - Always include your model!
73
+ 2. **Mark task in progress** → \`update_task(task_id, status: "in_progress")\` - Returns git workflow instructions!
74
+ 3. **Set up worktree** → Create isolated worktree for this task (see Git Workflow below)
75
+ 4. **Update progress** → \`update_task(task_id, progress_percentage: 50, progress_note: "...")\`
76
+ 5. **Complete task** → \`complete_task(task_id, summary: "...")\` - **MANDATORY, see below!**
77
+ 6. **Clean up** → Remove worktree, then start next task immediately
78
+
79
+ ## CRITICAL: Always Call complete_task (MANDATORY)
80
+
81
+ **You MUST call \`complete_task()\` when you finish a task.** This is not optional.
82
+
83
+ ### When to Call complete_task
84
+
85
+ Call \`complete_task()\` immediately after:
86
+ - ✅ Creating and pushing a PR
87
+ - ✅ Merging changes (for trunk-based workflow)
88
+ - ✅ Finishing any unit of work, even if no code changes
89
+
90
+ **Do NOT wait for:**
91
+ - ❌ PR to be reviewed/merged (that's what validation is for)
92
+ - ❌ User confirmation
93
+ - ❌ "Perfect" summary - a brief summary is fine
94
+
95
+ ### The Rule
96
+
97
+ \`\`\`
98
+ PR created + pushed → complete_task() → THEN worry about next steps
99
+ \`\`\`
100
+
101
+ **If you create a PR and don't call \`complete_task()\`, you have failed the workflow.**
102
+
103
+ ## CRITICAL: Git Worktrees for Multi-Agent
104
+
105
+ When multiple agents share a repository, you **MUST** use git worktrees to prevent conflicts.
106
+
107
+ **Before starting ANY task:**
108
+ \`\`\`bash
109
+ # For git-flow: ensure you're on develop first, then create worktree
110
+ git checkout develop
111
+ git pull origin develop
112
+ git worktree add ../worktree-<task-short-id> -b feature/<task-id>-<title>
113
+ cd ../worktree-<task-short-id>
114
+ \`\`\`
115
+
116
+ **After task is merged:**
117
+ \`\`\`bash
118
+ git worktree remove ../worktree-<task-short-id>
119
+ \`\`\`
120
+
121
+ **Why?** Branch switching in shared repos causes file conflicts between agents. Worktrees provide isolated directories.
122
+
123
+ Run \`get_help("git")\` for full worktree documentation.
124
+
125
+ ## CRITICAL: Never Ask Permission
126
+
127
+ **You must NEVER:**
128
+ - Ask "Should I continue to the next task?" → Just continue
129
+ - Ask "Should I clear my context?" → Just clear it
130
+ - Ask "What should I do next?" → Check \`next_task\` or use fallback activities
131
+ - Say "All tasks are done, let me know what to do" → Use \`get_next_task\` or start fallback activity
132
+ - Wait for confirmation before clearing context → Just do it
133
+
134
+ **You must ALWAYS:**
135
+ - Call \`complete_task()\` immediately after creating/pushing a PR - this is non-negotiable
136
+ - Immediately start the next task after completing one
137
+ - Clear context and restart session automatically when needed
138
+ - Keep working until there are genuinely no tasks and no fallback activities
139
+
140
+ ## Continuous Work
141
+
142
+ **IMPORTANT: Never stop working!** When you complete a task:
143
+ 1. \`complete_task\` returns \`next_task\` → Start it immediately
144
+ 2. No \`next_task\`? → Call \`get_next_task(project_id)\`
145
+ 3. Still no tasks? → Start a \`fallback_activity\` (code_review, security_review, etc.)
146
+
147
+ **When context grows large or responses slow down:**
148
+ 1. Run \`/clear\` to reset conversation
149
+ 2. Immediately call \`start_work_session(git_url, model)\` to reload context
150
+ 3. Continue with \`next_task\` from the response
151
+
152
+ **Do NOT ask the user if you should clear context. Just do it.** The dashboard tracks all your progress, so nothing is lost when you clear.
153
+
154
+ ## Need Help?
155
+
156
+ Use \`get_help(topic)\` for detailed guidance:
157
+
158
+ | Topic | Description |
159
+ |-------|-------------|
160
+ | \`getting_started\` | Basic workflow overview |
161
+ | \`tasks\` | Working on tasks, progress tracking |
162
+ | \`validation\` | Cross-agent task validation |
163
+ | \`deployment\` | Deployment coordination |
164
+ | \`git\` | Git workflow configuration |
165
+ | \`blockers\` | Handling blockers |
166
+ | \`milestones\` | Breaking down complex tasks |
167
+ | \`fallback\` | Background activities when idle |
168
+ | \`session\` | Session management |
169
+ | \`topics\` | List all available topics |
170
+
171
+ ## MCP Server Not Connected?
172
+
173
+ ### Quick Setup (Claude Code)
174
+
175
+ \`\`\`bash
176
+ claude mcp add vibescope npx @vibescope/mcp-server@latest \\
177
+ --env VIBESCOPE_API_KEY=your_key
178
+ \`\`\`
179
+
180
+ ### Manual Setup
181
+
182
+ 1. Copy \`.mcp.json.example\` to \`.mcp.json\`
183
+ 2. Get \`VIBESCOPE_API_KEY\` from https://vibescope.dev/dashboard/settings
184
+ 3. Restart Claude Code
185
185
  `;
186
186
  /**
187
187
  * Get the agent guidelines template
@@ -195,13 +195,13 @@ export function getAgentGuidelinesTemplate() {
195
195
  * @returns A brief summary of key guidelines
196
196
  */
197
197
  export function getAgentGuidelinesSummary() {
198
- return `## Essential Agent Guidelines
199
-
200
- 1. **MCP Connection Required** - If start_work_session fails, END SESSION IMMEDIATELY
201
- 2. **Always call complete_task()** - After creating a PR, call complete_task() right away
202
- 3. **Use git worktrees** - Create worktrees for each task to avoid conflicts
203
- 4. **Never ask permission** - Just continue working, clear context when needed
204
- 5. **Continuous work** - Never stop; use get_next_task or fallback activities
205
-
198
+ return `## Essential Agent Guidelines
199
+
200
+ 1. **MCP Connection Required** - If start_work_session fails, END SESSION IMMEDIATELY
201
+ 2. **Always call complete_task()** - After creating a PR, call complete_task() right away
202
+ 3. **Use git worktrees** - Create worktrees for each task to avoid conflicts
203
+ 4. **Never ask permission** - Just continue working, clear context when needed
204
+ 5. **Continuous work** - Never stop; use get_next_task or fallback activities
205
+
206
206
  For full guidelines, create a \`.claude/CLAUDE.md\` file in your project with the agent guidelines template.`;
207
207
  }