vibecheck-mcp-server 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +108 -47
- package/agent-checkpoint.js +10 -10
- package/architect-tools.js +12 -12
- package/audit-mcp.js +5 -5
- package/codebase-architect-tools.js +26 -26
- package/consolidated-tools.js +522 -0
- package/hygiene-tools.js +8 -8
- package/index-v1.js +50 -50
- package/index.js +851 -168
- package/index.old.js +52 -52
- package/intelligence-tools.js +29 -29
- package/intent-drift-tools.js +21 -21
- package/package.json +10 -10
- package/premium-tools.js +37 -37
- package/test-mcp.js +8 -8
- package/test-tools.js +36 -36
- package/tier-auth.js +6 -6
- package/truth-context.js +581 -0
- package/truth-firewall-tools.js +964 -0
- package/{guardrail-2.0-tools.js → vibecheck-2.0-tools.js} +14 -14
- package/{guardrail-tools.js → vibecheck-tools.js} +34 -34
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
#
|
|
1
|
+
# vibecheck MCP Server
|
|
2
2
|
|
|
3
|
-
Professional Model Context Protocol server for
|
|
3
|
+
Professional Model Context Protocol server for vibecheck AI.
|
|
4
4
|
|
|
5
5
|
> "Stop shipping pretend features."
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm install -g
|
|
10
|
+
npm install -g vibecheck-mcp-server
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## Configuration
|
|
@@ -27,20 +27,20 @@ npm start
|
|
|
27
27
|
These tools provide a top-notch, zero-friction UX:
|
|
28
28
|
|
|
29
29
|
### Ship Check Commands
|
|
30
|
-
- `run_ship` -
|
|
31
|
-
- `run_reality` -
|
|
32
|
-
- `run_mockproof` -
|
|
33
|
-
- `run_airlock` -
|
|
30
|
+
- `run_ship` - vibecheck: Ship Check (GO/NO-GO)
|
|
31
|
+
- `run_reality` - vibecheck: Run Reality Mode
|
|
32
|
+
- `run_mockproof` - vibecheck: Run MockProof Gate
|
|
33
|
+
- `run_airlock` - vibecheck: Run Airlock (SupplyChain)
|
|
34
34
|
|
|
35
35
|
### Report & Artifact Commands
|
|
36
|
-
- `get_last_run` -
|
|
36
|
+
- `get_last_run` - vibecheck: Open Last Run Report
|
|
37
37
|
- `open_artifact` - Open Report/Replay/Trace/SARIF/Badge
|
|
38
|
-
- `rerun_last_check` -
|
|
38
|
+
- `rerun_last_check` - vibecheck: Re-run Last Check
|
|
39
39
|
- `export_sarif` - Export findings as SARIF
|
|
40
40
|
|
|
41
41
|
### Setup & Policy Commands
|
|
42
|
-
- `run_doctor` -
|
|
43
|
-
- `edit_policies` -
|
|
42
|
+
- `run_doctor` - vibecheck: Doctor (Fix my setup)
|
|
43
|
+
- `edit_policies` - vibecheck: Policies (Quick Edit)
|
|
44
44
|
- `get_status` - Get server status and workspace info
|
|
45
45
|
- `policy_patch` - Apply atomic policy changes
|
|
46
46
|
|
|
@@ -53,35 +53,35 @@ These tools provide a top-notch, zero-friction UX:
|
|
|
53
53
|
### Evidence & Diagnostics
|
|
54
54
|
- `explain_finding` - Get detailed finding explanation
|
|
55
55
|
|
|
56
|
-
## AI
|
|
56
|
+
## AI vibecheck Tools (Prompt Firewall + Output Verification)
|
|
57
57
|
|
|
58
58
|
These tools provide AI safety and verification capabilities:
|
|
59
59
|
|
|
60
60
|
| Tool | Description |
|
|
61
61
|
|------|-------------|
|
|
62
|
-
| `
|
|
63
|
-
| `
|
|
64
|
-
| `
|
|
65
|
-
| `
|
|
66
|
-
| `
|
|
67
|
-
| `
|
|
68
|
-
| `
|
|
62
|
+
| `vibecheck.verify` | 🛡️ Verify AI agent output before applying - checks secrets, dangerous commands, path traversal |
|
|
63
|
+
| `vibecheck.quality` | 📊 Code quality analysis - complexity, maintainability, technical debt metrics |
|
|
64
|
+
| `vibecheck.smells` | 👃 Code smell detection - anti-patterns, naming issues, structural problems |
|
|
65
|
+
| `vibecheck.hallucination` | 🔍 Hallucination check - verify claims against actual source code |
|
|
66
|
+
| `vibecheck.breaking` | ⚠️ Breaking change detection - API changes, removed methods, type changes |
|
|
67
|
+
| `vibecheck.mdc` | 📝 MDC Generator - source-anchored documentation generation |
|
|
68
|
+
| `vibecheck.coverage` | 🧪 Test coverage mapping - identify untested components |
|
|
69
69
|
|
|
70
70
|
### Example Usage
|
|
71
71
|
|
|
72
72
|
```json
|
|
73
73
|
// Verify AI-generated code before applying
|
|
74
74
|
{
|
|
75
|
-
"tool": "
|
|
75
|
+
"tool": "vibecheck.verify",
|
|
76
76
|
"arguments": {
|
|
77
|
-
"input": "{\"format\":\"
|
|
77
|
+
"input": "{\"format\":\"vibecheck-v1\",\"diff\":\"...\",\"commands\":[]}",
|
|
78
78
|
"mode": "build"
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
// Check code quality
|
|
83
83
|
{
|
|
84
|
-
"tool": "
|
|
84
|
+
"tool": "vibecheck.quality",
|
|
85
85
|
"arguments": {
|
|
86
86
|
"projectPath": ".",
|
|
87
87
|
"threshold": 70
|
|
@@ -90,7 +90,7 @@ These tools provide AI safety and verification capabilities:
|
|
|
90
90
|
|
|
91
91
|
// Detect code smells
|
|
92
92
|
{
|
|
93
|
-
"tool": "
|
|
93
|
+
"tool": "vibecheck.smells",
|
|
94
94
|
"arguments": {
|
|
95
95
|
"projectPath": ".",
|
|
96
96
|
"severity": "high"
|
|
@@ -104,9 +104,9 @@ Pre-write validation that blocks AI agents until issues are fixed:
|
|
|
104
104
|
|
|
105
105
|
| Tool | Description |
|
|
106
106
|
|------|-------------|
|
|
107
|
-
| `
|
|
108
|
-
| `
|
|
109
|
-
| `
|
|
107
|
+
| `vibecheck_checkpoint` | 🛡️ Validate code before writing - blocks on TODOs, mocks, console.log, etc. |
|
|
108
|
+
| `vibecheck_set_strictness` | ⚙️ Set checkpoint strictness: chill, standard, strict, paranoid |
|
|
109
|
+
| `vibecheck_checkpoint_status` | 📊 Get current checkpoint status and blocking violations |
|
|
110
110
|
|
|
111
111
|
## Architect Tools
|
|
112
112
|
|
|
@@ -114,10 +114,10 @@ AI agents consult the Architect before writing code:
|
|
|
114
114
|
|
|
115
115
|
| Tool | Description |
|
|
116
116
|
|------|-------------|
|
|
117
|
-
| `
|
|
118
|
-
| `
|
|
119
|
-
| `
|
|
120
|
-
| `
|
|
117
|
+
| `vibecheck_architect_review` | 🏛️ Review code against architecture patterns |
|
|
118
|
+
| `vibecheck_architect_suggest` | 💡 Get architectural guidance before writing code |
|
|
119
|
+
| `vibecheck_architect_patterns` | 📋 List all active architecture patterns |
|
|
120
|
+
| `vibecheck_architect_set_strictness` | ⚙️ Set architect strictness level |
|
|
121
121
|
|
|
122
122
|
## Codebase Architect Tools
|
|
123
123
|
|
|
@@ -125,12 +125,12 @@ Deep codebase knowledge for AI agents:
|
|
|
125
125
|
|
|
126
126
|
| Tool | Description |
|
|
127
127
|
|------|-------------|
|
|
128
|
-
| `
|
|
129
|
-
| `
|
|
130
|
-
| `
|
|
131
|
-
| `
|
|
128
|
+
| `vibecheck_architect_context` | 🧠 Load full codebase context (tech stack, conventions, patterns) |
|
|
129
|
+
| `vibecheck_architect_guide` | 🏛️ Get guidance for creating/modifying code |
|
|
130
|
+
| `vibecheck_architect_validate` | ✅ Validate code against codebase patterns |
|
|
131
|
+
| `vibecheck_architect_dependencies` | 🔗 Understand file relationships and impact |
|
|
132
132
|
|
|
133
|
-
##
|
|
133
|
+
## vibecheck 2.0 Tools (Consolidated)
|
|
134
134
|
|
|
135
135
|
Six core tools for the complete workflow:
|
|
136
136
|
|
|
@@ -149,13 +149,74 @@ Capture intent before writing code, monitor for drift:
|
|
|
149
149
|
|
|
150
150
|
| Tool | Description |
|
|
151
151
|
|------|-------------|
|
|
152
|
-
| `
|
|
153
|
-
| `
|
|
154
|
-
| `
|
|
155
|
-
| `
|
|
156
|
-
| `
|
|
157
|
-
| `
|
|
158
|
-
| `
|
|
152
|
+
| `vibecheck_intent_start` | 🎯 Start a new step with explicit intent |
|
|
153
|
+
| `vibecheck_intent_check` | ✅ Check if code changes align with stated intent |
|
|
154
|
+
| `vibecheck_intent_validate_prompt` | 🔒 Validate new prompts against locked intent |
|
|
155
|
+
| `vibecheck_intent_status` | 📊 Get current Intent Drift Guard status |
|
|
156
|
+
| `vibecheck_intent_complete` | ✅ Complete step and generate proof artifact |
|
|
157
|
+
| `vibecheck_intent_lock` | 🔒 Lock intent to prevent scope expansion |
|
|
158
|
+
| `vibecheck_intent_unlock` | 🔓 Unlock intent, allow scope changes |
|
|
159
|
+
|
|
160
|
+
## Fix Missions v1 + Reality v2 Tools
|
|
161
|
+
|
|
162
|
+
Production-ready AI fix loop and runtime verification:
|
|
163
|
+
|
|
164
|
+
| Tool | Description |
|
|
165
|
+
|------|-------------|
|
|
166
|
+
| `vibecheck.fix` | 🛠 Fix Missions v1 — AI-powered surgical fixes with verification loop |
|
|
167
|
+
| `vibecheck.reality` | 🧪 Reality Mode v2 — Two-pass auth verification (anon + auth), Dead UI detection |
|
|
168
|
+
| `vibecheck.prove` | 🔬 One Command Reality Proof — orchestrates ctx → reality → ship → fix loop |
|
|
169
|
+
| `vibecheck.share` | 📦 Share Bundle — generate PR comment / review bundle from fix missions |
|
|
170
|
+
|
|
171
|
+
### vibecheck.reality Options
|
|
172
|
+
|
|
173
|
+
```json
|
|
174
|
+
{
|
|
175
|
+
"tool": "vibecheck.reality",
|
|
176
|
+
"arguments": {
|
|
177
|
+
"url": "http://localhost:3000",
|
|
178
|
+
"verifyAuth": true,
|
|
179
|
+
"auth": "user@example.com:password",
|
|
180
|
+
"storageState": ".vibecheck/reality/storageState.json",
|
|
181
|
+
"truthpack": ".vibecheck/truth/truthpack.json",
|
|
182
|
+
"headed": false,
|
|
183
|
+
"maxPages": 18,
|
|
184
|
+
"maxDepth": 2,
|
|
185
|
+
"danger": false
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### vibecheck.fix Options
|
|
191
|
+
|
|
192
|
+
```json
|
|
193
|
+
{
|
|
194
|
+
"tool": "vibecheck.fix",
|
|
195
|
+
"arguments": {
|
|
196
|
+
"promptOnly": false,
|
|
197
|
+
"apply": true,
|
|
198
|
+
"autopilot": true,
|
|
199
|
+
"share": true,
|
|
200
|
+
"maxMissions": 8,
|
|
201
|
+
"maxSteps": 10
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### vibecheck.prove Options
|
|
207
|
+
|
|
208
|
+
```json
|
|
209
|
+
{
|
|
210
|
+
"tool": "vibecheck.prove",
|
|
211
|
+
"arguments": {
|
|
212
|
+
"url": "http://localhost:3000",
|
|
213
|
+
"auth": "user@example.com:password",
|
|
214
|
+
"maxFixRounds": 3,
|
|
215
|
+
"skipReality": false,
|
|
216
|
+
"skipFix": false
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
```
|
|
159
220
|
|
|
160
221
|
## Core Analysis Tools
|
|
161
222
|
|
|
@@ -165,7 +226,7 @@ Capture intent before writing code, monitor for drift:
|
|
|
165
226
|
- `setup_design_system` - Set up and lock design system
|
|
166
227
|
- `register_api_endpoint` - Register API endpoint
|
|
167
228
|
- `get_project_health` - Get project health score
|
|
168
|
-
- `
|
|
229
|
+
- `get_vibechecks_rules` - Get vibechecks rules
|
|
169
230
|
- `architect_analyze` - Intelligent project analysis
|
|
170
231
|
- `build_knowledge_base` - Build codebase knowledge
|
|
171
232
|
- `semantic_search` - Search code by meaning
|
|
@@ -175,9 +236,9 @@ Capture intent before writing code, monitor for drift:
|
|
|
175
236
|
|
|
176
237
|
## Resources
|
|
177
238
|
|
|
178
|
-
- `
|
|
179
|
-
- `
|
|
180
|
-
- `
|
|
239
|
+
- `vibechecks://rules` - Vibechecks rules document
|
|
240
|
+
- `vibechecks://templates` - Available templates
|
|
241
|
+
- `vibechecks://design-tokens` - Design system tokens
|
|
181
242
|
|
|
182
243
|
## Documentation
|
|
183
244
|
|
|
@@ -186,6 +247,6 @@ See [MCP-PREMIUM-TOOLS.md](../docs/MCP-PREMIUM-TOOLS.md) for detailed tool docum
|
|
|
186
247
|
## Privacy & Trust
|
|
187
248
|
|
|
188
249
|
- Runs locally
|
|
189
|
-
- Artifacts saved to `.
|
|
250
|
+
- Artifacts saved to `.vibecheck/`
|
|
190
251
|
- No upload unless you export/share
|
|
191
252
|
|
package/agent-checkpoint.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Agent
|
|
2
|
+
* Agent Vibechecks - MCP Server Integration
|
|
3
3
|
*
|
|
4
4
|
* This MCP tool intercepts file writes from AI agents and validates
|
|
5
5
|
* them against checkpoint rules BEFORE the write happens.
|
|
@@ -149,7 +149,7 @@ function validateContent(filePath, content) {
|
|
|
149
149
|
const line = lines[lineNumber - 1] || "";
|
|
150
150
|
|
|
151
151
|
// Check for ignore directive
|
|
152
|
-
if (line.includes("@
|
|
152
|
+
if (line.includes("@vibecheck-ignore")) continue;
|
|
153
153
|
|
|
154
154
|
violations.push({
|
|
155
155
|
rule: rule.id,
|
|
@@ -192,11 +192,11 @@ function formatViolations(filePath, violations) {
|
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
/**
|
|
195
|
-
* MCP Tool Definitions for Agent
|
|
195
|
+
* MCP Tool Definitions for Agent Vibechecks
|
|
196
196
|
*/
|
|
197
197
|
const AGENT_CHECKPOINT_TOOLS = [
|
|
198
198
|
{
|
|
199
|
-
name: "
|
|
199
|
+
name: "vibecheck_checkpoint",
|
|
200
200
|
description: `🛡️ AGENT CHECKPOINT - Validates code before writing.
|
|
201
201
|
|
|
202
202
|
IMPORTANT: Call this tool BEFORE writing any code to check for:
|
|
@@ -228,7 +228,7 @@ Do NOT skip this checkpoint.`,
|
|
|
228
228
|
},
|
|
229
229
|
},
|
|
230
230
|
{
|
|
231
|
-
name: "
|
|
231
|
+
name: "vibecheck_set_strictness",
|
|
232
232
|
description: `Set the checkpoint strictness level:
|
|
233
233
|
- chill: TODOs, FIXMEs, mock data, placeholders
|
|
234
234
|
- standard: + console.log, debugger, localhost URLs
|
|
@@ -247,7 +247,7 @@ Do NOT skip this checkpoint.`,
|
|
|
247
247
|
},
|
|
248
248
|
},
|
|
249
249
|
{
|
|
250
|
-
name: "
|
|
250
|
+
name: "vibecheck_checkpoint_status",
|
|
251
251
|
description: "Get current checkpoint status and any blocking violations",
|
|
252
252
|
inputSchema: {
|
|
253
253
|
type: "object",
|
|
@@ -261,7 +261,7 @@ Do NOT skip this checkpoint.`,
|
|
|
261
261
|
*/
|
|
262
262
|
async function handleCheckpointTool(name, args) {
|
|
263
263
|
switch (name) {
|
|
264
|
-
case "
|
|
264
|
+
case "vibecheck_checkpoint": {
|
|
265
265
|
const { file_path, content, strictness } = args;
|
|
266
266
|
|
|
267
267
|
if (strictness) {
|
|
@@ -300,7 +300,7 @@ async function handleCheckpointTool(name, args) {
|
|
|
300
300
|
};
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
-
case "
|
|
303
|
+
case "vibecheck_set_strictness": {
|
|
304
304
|
const { level } = args;
|
|
305
305
|
currentStrictness = level;
|
|
306
306
|
|
|
@@ -318,10 +318,10 @@ async function handleCheckpointTool(name, args) {
|
|
|
318
318
|
};
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
-
case "
|
|
321
|
+
case "vibecheck_checkpoint_status": {
|
|
322
322
|
const blockedList = Array.from(blockedFiles.entries());
|
|
323
323
|
|
|
324
|
-
let status = `🛡️ Agent
|
|
324
|
+
let status = `🛡️ Agent Vibechecks Status\n`;
|
|
325
325
|
status += `═══════════════════════════\n`;
|
|
326
326
|
status += `Strictness: ${currentStrictness.toUpperCase()}\n`;
|
|
327
327
|
status += `Files checked: ${stats.checked}\n`;
|
package/architect-tools.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Tools that let AI agents consult the Architect before writing code:
|
|
5
5
|
*
|
|
6
|
-
* 1.
|
|
7
|
-
* 2.
|
|
8
|
-
* 3.
|
|
9
|
-
* 4.
|
|
6
|
+
* 1. vibecheck_architect_review - Review code against architecture patterns
|
|
7
|
+
* 2. vibecheck_architect_suggest - Get suggestions before writing code
|
|
8
|
+
* 3. vibecheck_architect_learn - Learn patterns from existing code
|
|
9
|
+
* 4. vibecheck_architect_patterns - List active patterns
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import fs from "fs";
|
|
@@ -459,7 +459,7 @@ export const serviceName = new ServiceName(dependency);`,
|
|
|
459
459
|
*/
|
|
460
460
|
const ARCHITECT_TOOLS = [
|
|
461
461
|
{
|
|
462
|
-
name: "
|
|
462
|
+
name: "vibecheck_architect_review",
|
|
463
463
|
description: `🏛️ ARCHITECT REVIEW - Review code against architecture patterns BEFORE committing.
|
|
464
464
|
|
|
465
465
|
Call this tool to check if code follows project architecture:
|
|
@@ -488,7 +488,7 @@ If blocked, you MUST fix the violations before proceeding.`,
|
|
|
488
488
|
},
|
|
489
489
|
|
|
490
490
|
{
|
|
491
|
-
name: "
|
|
491
|
+
name: "vibecheck_architect_suggest",
|
|
492
492
|
description: `💡 ARCHITECT SUGGEST - Get architectural guidance BEFORE writing code.
|
|
493
493
|
|
|
494
494
|
Call this FIRST when you're about to create:
|
|
@@ -517,7 +517,7 @@ Returns: recommended patterns, templates, and rules to follow.`,
|
|
|
517
517
|
},
|
|
518
518
|
|
|
519
519
|
{
|
|
520
|
-
name: "
|
|
520
|
+
name: "vibecheck_architect_patterns",
|
|
521
521
|
description: `📋 List all active architecture patterns and their rules.`,
|
|
522
522
|
inputSchema: {
|
|
523
523
|
type: "object",
|
|
@@ -532,7 +532,7 @@ Returns: recommended patterns, templates, and rules to follow.`,
|
|
|
532
532
|
},
|
|
533
533
|
|
|
534
534
|
{
|
|
535
|
-
name: "
|
|
535
|
+
name: "vibecheck_architect_set_strictness",
|
|
536
536
|
description: `⚙️ Set architect strictness level:
|
|
537
537
|
- relaxed: Only block on critical issues
|
|
538
538
|
- standard: Block on errors, warn on issues
|
|
@@ -555,7 +555,7 @@ Returns: recommended patterns, templates, and rules to follow.`,
|
|
|
555
555
|
*/
|
|
556
556
|
async function handleArchitectTool(name, args) {
|
|
557
557
|
switch (name) {
|
|
558
|
-
case "
|
|
558
|
+
case "vibecheck_architect_review": {
|
|
559
559
|
const { file_path, content } = args;
|
|
560
560
|
const result = reviewCode(file_path, content);
|
|
561
561
|
|
|
@@ -595,7 +595,7 @@ async function handleArchitectTool(name, args) {
|
|
|
595
595
|
};
|
|
596
596
|
}
|
|
597
597
|
|
|
598
|
-
case "
|
|
598
|
+
case "vibecheck_architect_suggest": {
|
|
599
599
|
const { intent, context } = args;
|
|
600
600
|
const suggestions = getSuggestions(intent, context || "");
|
|
601
601
|
|
|
@@ -628,7 +628,7 @@ async function handleArchitectTool(name, args) {
|
|
|
628
628
|
};
|
|
629
629
|
}
|
|
630
630
|
|
|
631
|
-
case "
|
|
631
|
+
case "vibecheck_architect_patterns": {
|
|
632
632
|
const { category } = args;
|
|
633
633
|
|
|
634
634
|
let output = "\n📋 ARCHITECTURE PATTERNS\n";
|
|
@@ -670,7 +670,7 @@ async function handleArchitectTool(name, args) {
|
|
|
670
670
|
};
|
|
671
671
|
}
|
|
672
672
|
|
|
673
|
-
case "
|
|
673
|
+
case "vibecheck_architect_set_strictness": {
|
|
674
674
|
const { level } = args;
|
|
675
675
|
strictnessLevel = level;
|
|
676
676
|
|
package/audit-mcp.js
CHANGED
|
@@ -8,18 +8,18 @@ import * as fs from 'fs';
|
|
|
8
8
|
import * as path from 'path';
|
|
9
9
|
import * as crypto from 'crypto';
|
|
10
10
|
|
|
11
|
-
const AUDIT_DIR = ".
|
|
11
|
+
const AUDIT_DIR = ".vibecheck/audit";
|
|
12
12
|
const AUDIT_FILE = "audit.log.jsonl";
|
|
13
13
|
const GENESIS_HASH = "0".repeat(64);
|
|
14
14
|
|
|
15
15
|
function getCurrentTier() {
|
|
16
|
-
return process.env.
|
|
16
|
+
return process.env.VIBECHECK_TIER || "free";
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
function getCurrentActor() {
|
|
20
20
|
const env = process.env;
|
|
21
|
-
const userId = env.
|
|
22
|
-
const userName = env.
|
|
21
|
+
const userId = env.VIBECHECK_USER_ID || env.USER || env.USERNAME || "mcp-client";
|
|
22
|
+
const userName = env.VIBECHECK_USER_NAME || env.USERNAME;
|
|
23
23
|
|
|
24
24
|
return {
|
|
25
25
|
id: userId,
|
|
@@ -168,7 +168,7 @@ export function emit(input, basePath = process.cwd()) {
|
|
|
168
168
|
|
|
169
169
|
return event;
|
|
170
170
|
} catch (err) {
|
|
171
|
-
if (process.env.
|
|
171
|
+
if (process.env.VIBECHECK_DEBUG) {
|
|
172
172
|
console.error("[audit] Failed to emit event:", err.message);
|
|
173
173
|
}
|
|
174
174
|
return null;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Codebase-Aware Architect MCP Tools
|
|
3
3
|
*
|
|
4
4
|
* These tools give AI agents access to deep codebase knowledge:
|
|
5
|
-
* 1.
|
|
6
|
-
* 2.
|
|
7
|
-
* 3.
|
|
8
|
-
* 4.
|
|
9
|
-
* 5.
|
|
5
|
+
* 1. vibecheck_architect_context - Get full codebase context
|
|
6
|
+
* 2. vibecheck_architect_guide - Get guidance for creating/modifying code
|
|
7
|
+
* 3. vibecheck_architect_validate - Validate code against codebase patterns
|
|
8
|
+
* 4. vibecheck_architect_patterns - Get specific patterns from codebase
|
|
9
|
+
* 5. vibecheck_architect_dependencies - Understand file relationships
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import fs from "fs";
|
|
@@ -18,10 +18,10 @@ let contextLoadedAt = null;
|
|
|
18
18
|
const CACHE_TTL_MS = 5 * 60 * 1000; // 5 minutes
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* Load context from .
|
|
21
|
+
* Load context from .vibecheck/ directory
|
|
22
22
|
*/
|
|
23
23
|
async function loadCodebaseContext(projectPath) {
|
|
24
|
-
const
|
|
24
|
+
const vibecheckDir = path.join(projectPath, ".vibecheck");
|
|
25
25
|
|
|
26
26
|
// Check cache
|
|
27
27
|
if (
|
|
@@ -33,12 +33,12 @@ async function loadCodebaseContext(projectPath) {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
const context = {
|
|
36
|
-
projectSummary: await loadJsonFile(
|
|
37
|
-
dependencyGraph: await loadJsonFile(
|
|
38
|
-
apiContracts: await loadJsonFile(
|
|
39
|
-
teamConventions: await loadJsonFile(
|
|
40
|
-
gitContext: await loadJsonFile(
|
|
41
|
-
patterns: await loadJsonFile(
|
|
36
|
+
projectSummary: await loadJsonFile(vibecheckDir, "project-summary.json"),
|
|
37
|
+
dependencyGraph: await loadJsonFile(vibecheckDir, "dependency-graph.json"),
|
|
38
|
+
apiContracts: await loadJsonFile(vibecheckDir, "api-contracts.json"),
|
|
39
|
+
teamConventions: await loadJsonFile(vibecheckDir, "team-conventions.json"),
|
|
40
|
+
gitContext: await loadJsonFile(vibecheckDir, "git-context.json"),
|
|
41
|
+
patterns: await loadJsonFile(vibecheckDir, "patterns.json"),
|
|
42
42
|
// Also load generated rules files
|
|
43
43
|
cursorRules: await loadTextFile(projectPath, ".cursorrules"),
|
|
44
44
|
windsurfRules: await loadTextFile(
|
|
@@ -461,7 +461,7 @@ function toKebabCase(str) {
|
|
|
461
461
|
|
|
462
462
|
const CODEBASE_ARCHITECT_TOOLS = [
|
|
463
463
|
{
|
|
464
|
-
name: "
|
|
464
|
+
name: "vibecheck_architect_context",
|
|
465
465
|
description: `🧠 GET CODEBASE CONTEXT - Load deep knowledge about this project.
|
|
466
466
|
|
|
467
467
|
Returns:
|
|
@@ -484,7 +484,7 @@ Call this FIRST before writing any code to understand the codebase.`,
|
|
|
484
484
|
},
|
|
485
485
|
|
|
486
486
|
{
|
|
487
|
-
name: "
|
|
487
|
+
name: "vibecheck_architect_guide",
|
|
488
488
|
description: `🏛️ GET ARCHITECT GUIDANCE - Get specific guidance for creating or modifying code.
|
|
489
489
|
|
|
490
490
|
Before creating a new file, call this to get:
|
|
@@ -516,7 +516,7 @@ This ensures your code fits the existing codebase style.`,
|
|
|
516
516
|
},
|
|
517
517
|
|
|
518
518
|
{
|
|
519
|
-
name: "
|
|
519
|
+
name: "vibecheck_architect_validate",
|
|
520
520
|
description: `✅ VALIDATE CODE - Check if code follows codebase patterns and conventions.
|
|
521
521
|
|
|
522
522
|
Returns:
|
|
@@ -546,7 +546,7 @@ Call this AFTER writing code to ensure it fits the codebase.`,
|
|
|
546
546
|
},
|
|
547
547
|
|
|
548
548
|
{
|
|
549
|
-
name: "
|
|
549
|
+
name: "vibecheck_architect_patterns",
|
|
550
550
|
description: `📐 GET PATTERNS - Get specific code patterns from the codebase.
|
|
551
551
|
|
|
552
552
|
Returns templates and examples for:
|
|
@@ -575,7 +575,7 @@ Use this to see exactly how similar code is structured in this project.`,
|
|
|
575
575
|
},
|
|
576
576
|
|
|
577
577
|
{
|
|
578
|
-
name: "
|
|
578
|
+
name: "vibecheck_architect_dependencies",
|
|
579
579
|
description: `🔗 GET DEPENDENCIES - Understand file relationships and impact.
|
|
580
580
|
|
|
581
581
|
Returns:
|
|
@@ -609,7 +609,7 @@ async function handleCodebaseArchitectTool(name, args) {
|
|
|
609
609
|
const projectPath = args.project_path || process.cwd();
|
|
610
610
|
|
|
611
611
|
switch (name) {
|
|
612
|
-
case "
|
|
612
|
+
case "vibecheck_architect_context": {
|
|
613
613
|
const context = await loadCodebaseContext(projectPath);
|
|
614
614
|
|
|
615
615
|
let output = "\n🧠 CODEBASE CONTEXT\n";
|
|
@@ -665,12 +665,12 @@ async function handleCodebaseArchitectTool(name, args) {
|
|
|
665
665
|
}
|
|
666
666
|
|
|
667
667
|
output += "\n" + "═".repeat(50) + "\n";
|
|
668
|
-
output += "Use
|
|
668
|
+
output += "Use vibecheck_architect_guide for specific guidance.\n";
|
|
669
669
|
|
|
670
670
|
return { content: [{ type: "text", text: output }] };
|
|
671
671
|
}
|
|
672
672
|
|
|
673
|
-
case "
|
|
673
|
+
case "vibecheck_architect_guide": {
|
|
674
674
|
const { intent, target_path } = args;
|
|
675
675
|
const context = await loadCodebaseContext(projectPath);
|
|
676
676
|
const guidance = getGuidance(context, intent, target_path);
|
|
@@ -678,7 +678,7 @@ async function handleCodebaseArchitectTool(name, args) {
|
|
|
678
678
|
return { content: [{ type: "text", text: guidance }] };
|
|
679
679
|
}
|
|
680
680
|
|
|
681
|
-
case "
|
|
681
|
+
case "vibecheck_architect_validate": {
|
|
682
682
|
const { file_path, content } = args;
|
|
683
683
|
const context = await loadCodebaseContext(projectPath);
|
|
684
684
|
const result = validateCode(context, file_path, content);
|
|
@@ -718,7 +718,7 @@ async function handleCodebaseArchitectTool(name, args) {
|
|
|
718
718
|
};
|
|
719
719
|
}
|
|
720
720
|
|
|
721
|
-
case "
|
|
721
|
+
case "vibecheck_architect_patterns": {
|
|
722
722
|
const { pattern_type } = args;
|
|
723
723
|
const context = await loadCodebaseContext(projectPath);
|
|
724
724
|
|
|
@@ -751,7 +751,7 @@ async function handleCodebaseArchitectTool(name, args) {
|
|
|
751
751
|
Object.keys(patterns).every((k) => (patterns[k]?.length || 0) === 0)
|
|
752
752
|
) {
|
|
753
753
|
output +=
|
|
754
|
-
"No patterns found. Run `
|
|
754
|
+
"No patterns found. Run `vibecheck context` to generate codebase analysis.\n";
|
|
755
755
|
}
|
|
756
756
|
|
|
757
757
|
output += "═".repeat(50) + "\n";
|
|
@@ -759,7 +759,7 @@ async function handleCodebaseArchitectTool(name, args) {
|
|
|
759
759
|
return { content: [{ type: "text", text: output }] };
|
|
760
760
|
}
|
|
761
761
|
|
|
762
|
-
case "
|
|
762
|
+
case "vibecheck_architect_dependencies": {
|
|
763
763
|
const { file_path } = args;
|
|
764
764
|
const context = await loadCodebaseContext(projectPath);
|
|
765
765
|
|
|
@@ -815,7 +815,7 @@ async function handleCodebaseArchitectTool(name, args) {
|
|
|
815
815
|
}
|
|
816
816
|
} else {
|
|
817
817
|
output += "No dependency data available.\n";
|
|
818
|
-
output += "Run `
|
|
818
|
+
output += "Run `vibecheck context` to generate dependency graph.\n";
|
|
819
819
|
}
|
|
820
820
|
|
|
821
821
|
output += "\n" + "═".repeat(50) + "\n";
|