vibe-gate-mcp 0.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/.env.example +51 -0
- package/CHANGELOG.md +27 -0
- package/LICENSE +21 -0
- package/README.md +112 -0
- package/dist/index.mjs +3547 -0
- package/docs/INSTALLATION.md +104 -0
- package/docs/SEMANTIC_DIFF_PAYLOAD.md +76 -0
- package/docs/TROUBLESHOOTING.md +62 -0
- package/docs/USAGE.md +125 -0
- package/docs/VIBE-GATE.md +66 -0
- package/docs/project/VARIABLES.md +50 -0
- package/docs/project/api/mcp-tools.md +115 -0
- package/examples/cursor-mcp.project.json +13 -0
- package/examples/cursor-mcp.user-local-dev.json +16 -0
- package/package.json +96 -0
- package/rules.json +42 -0
- package/schemas/rules.schema.json +38 -0
package/.env.example
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# Vibe-Gate — copy to `.env` next to this package (or set the same keys in MCP env)
|
|
3
|
+
# NEVER commit real keys. Required: pick ONE provider + its API key.
|
|
4
|
+
# =============================================================================
|
|
5
|
+
|
|
6
|
+
# --- Required: Critic provider ---
|
|
7
|
+
# One of: openai | anthropic | google | minimax | opencode
|
|
8
|
+
CRITIC_PROVIDER=openai
|
|
9
|
+
|
|
10
|
+
# --- Required: API key for the chosen provider (uncomment ONE block) ---
|
|
11
|
+
|
|
12
|
+
# OpenAI
|
|
13
|
+
OPENAI_API_KEY=
|
|
14
|
+
|
|
15
|
+
# Anthropic
|
|
16
|
+
# ANTHROPIC_API_KEY=
|
|
17
|
+
|
|
18
|
+
# Google Gemini
|
|
19
|
+
# GOOGLE_GENERATIVE_AI_API_KEY=
|
|
20
|
+
|
|
21
|
+
# MiniMax (direct)
|
|
22
|
+
# MINIMAX_API_KEY=
|
|
23
|
+
|
|
24
|
+
# OpenCode (https://opencode.ai/auth)
|
|
25
|
+
# OPENCODE_API_KEY=
|
|
26
|
+
# OPENCODE_PLAN=go
|
|
27
|
+
|
|
28
|
+
# --- Optional: model / persona ---
|
|
29
|
+
# CRITIC_MODEL=gpt-5.4
|
|
30
|
+
# CRITIC_PERSONA=clean-code-monk
|
|
31
|
+
# personas: security-first | performance-freak | clean-code-monk
|
|
32
|
+
|
|
33
|
+
# --- Workspace (usually set by the IDE, not here) ---
|
|
34
|
+
# Cursor: "VIBE_WORKSPACE_ROOT": "${workspaceFolder}" in mcp.json
|
|
35
|
+
# VIBE_WORKSPACE_ROOT=
|
|
36
|
+
|
|
37
|
+
# --- Human unlock (OPTIONAL opt-in — not recommended for default AI↔AI flow) ---
|
|
38
|
+
# Prefer Critic resubmit over human intervention. Only enable if you want an extra
|
|
39
|
+
# gate on log_human_decision after true max-round DEADLOCK.
|
|
40
|
+
# VIBE_HUMAN_CONFIRMATION_TOKEN=replace-with-a-long-random-secret
|
|
41
|
+
|
|
42
|
+
# --- Debug (optional) ---
|
|
43
|
+
# DEBUG=1
|
|
44
|
+
|
|
45
|
+
# =============================================================================
|
|
46
|
+
# OpenCode Go example (subscription):
|
|
47
|
+
# CRITIC_PROVIDER=opencode
|
|
48
|
+
# OPENCODE_API_KEY=YOUR_OPENCODE_API_KEY
|
|
49
|
+
# OPENCODE_PLAN=go
|
|
50
|
+
# CRITIC_MODEL=minimax-m3
|
|
51
|
+
# =============================================================================
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.0] - 2026-08-28
|
|
9
|
+
|
|
10
|
+
Initial release of `vibe-gate-mcp`.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **MCP server (stdio)** with tools:
|
|
15
|
+
- `submit_phase_review` — Implementer → Critic adversarial review
|
|
16
|
+
- `log_human_decision` — human deadlock decisions → `.vibe/preferences.log`
|
|
17
|
+
- **Preferred payload: `files[]`** — workspace-relative source paths; MCP reads disk and builds FILE:…CONTENT: (`SEMANTIC_DIFF_SOURCE_FILES` limits)
|
|
18
|
+
- **Payload sources:** `semanticDiffPath` (pre-built payload file) or inline `semanticDiff` — exactly one source
|
|
19
|
+
- **`updateStatus` / `PHASE_STATUS_POLICY`** — skip `.vibe/status.json` for probes (`mcp-smoke-`, `vibe-gate-probe-`)
|
|
20
|
+
- **npm CLI:** `bin` → `dist/index.mjs` (shebang); `npx -y vibe-gate-mcp`
|
|
21
|
+
- **Config:** Critic providers (OpenAI, Anthropic, Google, MiniMax, OpenCode); personas; Zod-validated env
|
|
22
|
+
- **Conflict loop:** up to 3 rounds; DEBT logging; project preferences
|
|
23
|
+
- **Docs & examples:** INSTALLATION, USAGE, SEMANTIC_DIFF_PAYLOAD, VARIABLES, Cursor mcp.json templates, `.env.example`
|
|
24
|
+
|
|
25
|
+
### Quality
|
|
26
|
+
|
|
27
|
+
- TypeScript strict, ESLint + SonarJS (cognitive complexity ≤ 15), Vitest, Husky (dev checkout only)
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vibe-Gate Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Vibe-Gate (MCP)
|
|
2
|
+
|
|
3
|
+
An **Adversarial Quality Gate** for AI-assisted IDEs: the IDE agent and a Critic LLM debate code; the human decides only on deadlock.
|
|
4
|
+
|
|
5
|
+
## Quick start (npm / npx)
|
|
6
|
+
|
|
7
|
+
### 1. Critic API key
|
|
8
|
+
|
|
9
|
+
Create a `.env` where you run vibe-gate **or** put the same keys in MCP `env`.
|
|
10
|
+
|
|
11
|
+
Copy from the package’s [`.env.example`](.env.example):
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Minimal OpenAI example
|
|
15
|
+
CRITIC_PROVIDER=openai
|
|
16
|
+
OPENAI_API_KEY=YOUR_OPENAI_API_KEY
|
|
17
|
+
|
|
18
|
+
# Or OpenCode (https://opencode.ai/auth)
|
|
19
|
+
# CRITIC_PROVIDER=opencode
|
|
20
|
+
# OPENCODE_API_KEY=...
|
|
21
|
+
# OPENCODE_PLAN=go
|
|
22
|
+
# CRITIC_MODEL=minimax-m3
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
| Provider | `CRITIC_PROVIDER` | Required key env |
|
|
26
|
+
| ------------- | ----------------- | ----------------------------------------------- |
|
|
27
|
+
| OpenAI | `openai` | `OPENAI_API_KEY` |
|
|
28
|
+
| Anthropic | `anthropic` | `ANTHROPIC_API_KEY` |
|
|
29
|
+
| Google Gemini | `google` | `GOOGLE_GENERATIVE_AI_API_KEY` |
|
|
30
|
+
| MiniMax | `minimax` | `MINIMAX_API_KEY` |
|
|
31
|
+
| OpenCode | `opencode` | `OPENCODE_API_KEY` (+ optional `OPENCODE_PLAN`) |
|
|
32
|
+
|
|
33
|
+
Full list: [docs/project/VARIABLES.md](docs/project/VARIABLES.md).
|
|
34
|
+
|
|
35
|
+
### 2. Cursor MCP (any consumer repo)
|
|
36
|
+
|
|
37
|
+
Project or user [`.cursor/mcp.json`](examples/cursor-mcp.project.json):
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"mcpServers": {
|
|
42
|
+
"vibe-gate": {
|
|
43
|
+
"command": "npx",
|
|
44
|
+
"args": ["-y", "vibe-gate-mcp"],
|
|
45
|
+
"env": {
|
|
46
|
+
"VIBE_WORKSPACE_ROOT": "${workspaceFolder}",
|
|
47
|
+
"CRITIC_PROVIDER": "openai",
|
|
48
|
+
"OPENAI_API_KEY": "YOUR_OPENAI_API_KEY"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Prefer keys in a local `.env` next to the package or in the consumer project under `VIBE_WORKSPACE_ROOT` (never commit secrets). MCP `env` overrides `.env`.
|
|
56
|
+
|
|
57
|
+
### 3. Call the tool (agents)
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"phaseId": "phase-1-§3",
|
|
62
|
+
"report": "What changed, why, file:line — no TODOs",
|
|
63
|
+
"files": ["src/a.ts", "src/b.ts"],
|
|
64
|
+
"round": 1
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Prefer `files[]`** — MCP reads disk and builds FILE:…CONTENT:. See [docs/SEMANTIC_DIFF_PAYLOAD.md](docs/SEMANTIC_DIFF_PAYLOAD.md).
|
|
69
|
+
|
|
70
|
+
## Local development (this repo)
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
corepack yarn install
|
|
74
|
+
npm run build
|
|
75
|
+
npm test
|
|
76
|
+
cp .env.example .env # fill Critic key
|
|
77
|
+
npm start # stdio MCP
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
User MCP while developing: [examples/cursor-mcp.user-local-dev.json](examples/cursor-mcp.user-local-dev.json) (`node dist/index.mjs` + `VIBE_WORKSPACE_ROOT=${workspaceFolder}`).
|
|
81
|
+
|
|
82
|
+
After `npm run build`, **restart** the vibe-gate MCP server in the IDE.
|
|
83
|
+
|
|
84
|
+
## Publish
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npm pack --dry-run # inspect the exact tarball contents
|
|
88
|
+
npm publish # package name: vibe-gate-mcp
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Consumers then use `npx -y vibe-gate-mcp` as above.
|
|
92
|
+
|
|
93
|
+
## Payload sources — prefer `files[]`
|
|
94
|
+
|
|
95
|
+
| Priority | Field | Use |
|
|
96
|
+
| -------- | ------------------ | ---------------------- |
|
|
97
|
+
| 1 | `files[]` | Normal batches |
|
|
98
|
+
| 2 | `semanticDiffPath` | Pre-built payload file |
|
|
99
|
+
| 3 | `semanticDiff` | Tiny inline payloads |
|
|
100
|
+
|
|
101
|
+
Probes: `updateStatus: false` or `phaseId` prefixes `mcp-smoke-` / `vibe-gate-probe-`.
|
|
102
|
+
|
|
103
|
+
## Documentation
|
|
104
|
+
|
|
105
|
+
| Doc | Description |
|
|
106
|
+
| -------------------------------------------------------------- | ------------------------- |
|
|
107
|
+
| [docs/INSTALLATION.md](docs/INSTALLATION.md) | Install + multi-repo MCP |
|
|
108
|
+
| [docs/USAGE.md](docs/USAGE.md) | First run |
|
|
109
|
+
| [docs/SEMANTIC_DIFF_PAYLOAD.md](docs/SEMANTIC_DIFF_PAYLOAD.md) | `files[]` contract |
|
|
110
|
+
| [docs/TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md) | Stale MCP, path errors |
|
|
111
|
+
| [docs/project/VARIABLES.md](docs/project/VARIABLES.md) | Env SSoT |
|
|
112
|
+
| [examples/](examples/) | Cursor mcp.json templates |
|