@corbat-tech/coding-standards-mcp 1.0.2 → 1.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.
Files changed (104) hide show
  1. package/README.md +170 -269
  2. package/assets/demo.gif +0 -0
  3. package/assets/demo.tape +63 -0
  4. package/dist/agent.d.ts +5 -6
  5. package/dist/agent.d.ts.map +1 -1
  6. package/dist/agent.js +95 -217
  7. package/dist/agent.js.map +1 -1
  8. package/dist/cli/init.js +1 -1
  9. package/dist/cli/init.js.map +1 -1
  10. package/dist/config.d.ts +15 -26
  11. package/dist/config.d.ts.map +1 -1
  12. package/dist/errors.d.ts +58 -0
  13. package/dist/errors.d.ts.map +1 -0
  14. package/dist/errors.js +112 -0
  15. package/dist/errors.js.map +1 -0
  16. package/dist/guardrails.d.ts +35 -0
  17. package/dist/guardrails.d.ts.map +1 -0
  18. package/dist/guardrails.js +303 -0
  19. package/dist/guardrails.js.map +1 -0
  20. package/dist/index.js +1 -1
  21. package/dist/index.js.map +1 -1
  22. package/dist/logger.d.ts +36 -0
  23. package/dist/logger.d.ts.map +1 -0
  24. package/dist/logger.js +63 -0
  25. package/dist/logger.js.map +1 -0
  26. package/dist/metrics.d.ts +40 -0
  27. package/dist/metrics.d.ts.map +1 -0
  28. package/dist/metrics.js +97 -0
  29. package/dist/metrics.js.map +1 -0
  30. package/dist/profiles.d.ts +1 -1
  31. package/dist/profiles.d.ts.map +1 -1
  32. package/dist/profiles.js +240 -109
  33. package/dist/profiles.js.map +1 -1
  34. package/dist/prompts.js +1 -1
  35. package/dist/prompts.js.map +1 -1
  36. package/dist/tools/definitions.d.ts +104 -0
  37. package/dist/tools/definitions.d.ts.map +1 -0
  38. package/dist/tools/definitions.js +171 -0
  39. package/dist/tools/definitions.js.map +1 -0
  40. package/dist/tools/handlers/get-context.d.ts +12 -0
  41. package/dist/tools/handlers/get-context.d.ts.map +1 -0
  42. package/dist/tools/handlers/get-context.js +118 -0
  43. package/dist/tools/handlers/get-context.js.map +1 -0
  44. package/dist/tools/handlers/health.d.ts +11 -0
  45. package/dist/tools/handlers/health.d.ts.map +1 -0
  46. package/dist/tools/handlers/health.js +57 -0
  47. package/dist/tools/handlers/health.js.map +1 -0
  48. package/dist/tools/handlers/index.d.ts +11 -0
  49. package/dist/tools/handlers/index.d.ts.map +1 -0
  50. package/dist/tools/handlers/index.js +11 -0
  51. package/dist/tools/handlers/index.js.map +1 -0
  52. package/dist/tools/handlers/init.d.ts +12 -0
  53. package/dist/tools/handlers/init.d.ts.map +1 -0
  54. package/dist/tools/handlers/init.js +102 -0
  55. package/dist/tools/handlers/init.js.map +1 -0
  56. package/dist/tools/handlers/profiles.d.ts +11 -0
  57. package/dist/tools/handlers/profiles.d.ts.map +1 -0
  58. package/dist/tools/handlers/profiles.js +25 -0
  59. package/dist/tools/handlers/profiles.js.map +1 -0
  60. package/dist/tools/handlers/search.d.ts +12 -0
  61. package/dist/tools/handlers/search.d.ts.map +1 -0
  62. package/dist/tools/handlers/search.js +58 -0
  63. package/dist/tools/handlers/search.js.map +1 -0
  64. package/dist/tools/handlers/validate.d.ts +12 -0
  65. package/dist/tools/handlers/validate.d.ts.map +1 -0
  66. package/dist/tools/handlers/validate.js +76 -0
  67. package/dist/tools/handlers/validate.js.map +1 -0
  68. package/dist/tools/index.d.ts +22 -0
  69. package/dist/tools/index.d.ts.map +1 -0
  70. package/dist/tools/index.js +72 -0
  71. package/dist/tools/index.js.map +1 -0
  72. package/dist/tools/schemas.d.ts +29 -0
  73. package/dist/tools/schemas.d.ts.map +1 -0
  74. package/dist/tools/schemas.js +20 -0
  75. package/dist/tools/schemas.js.map +1 -0
  76. package/dist/tools.js +2 -2
  77. package/dist/tools.js.map +1 -1
  78. package/dist/types.d.ts +417 -2588
  79. package/dist/types.d.ts.map +1 -1
  80. package/dist/types.js +99 -47
  81. package/dist/types.js.map +1 -1
  82. package/dist/utils/index.d.ts +1 -1
  83. package/dist/utils/index.d.ts.map +1 -1
  84. package/dist/utils/index.js +1 -1
  85. package/dist/utils/index.js.map +1 -1
  86. package/dist/utils/retry.d.ts.map +1 -1
  87. package/dist/utils/retry.js +3 -2
  88. package/dist/utils/retry.js.map +1 -1
  89. package/package.json +10 -9
  90. package/profiles/examples/microservice-kafka.yaml +122 -0
  91. package/profiles/examples/startup-fast.yaml +67 -0
  92. package/profiles/examples/strict-enterprise.yaml +62 -0
  93. package/profiles/templates/angular.yaml +614 -0
  94. package/profiles/templates/csharp-dotnet.yaml +529 -0
  95. package/profiles/templates/flutter.yaml +547 -0
  96. package/profiles/templates/go.yaml +1276 -0
  97. package/profiles/templates/java-spring-backend.yaml +326 -0
  98. package/profiles/templates/kotlin-spring.yaml +417 -0
  99. package/profiles/templates/nextjs.yaml +536 -0
  100. package/profiles/templates/nodejs.yaml +594 -0
  101. package/profiles/templates/python.yaml +546 -0
  102. package/profiles/templates/react.yaml +456 -0
  103. package/profiles/templates/rust.yaml +508 -0
  104. package/profiles/templates/vue.yaml +483 -0
package/README.md CHANGED
@@ -1,88 +1,51 @@
1
1
  <div align="center">
2
2
 
3
- # CORBAT - Coding Standards MCP
3
+ # CORBAT MCP
4
+ #### AI Coding Standards Server
4
5
 
5
- ### Stop repeating yourself. Start coding.
6
-
7
- **Your architecture rules, TDD workflow, and SOLID principles — injected automatically into every AI response.**
6
+ **AI-generated code that passes code review on the first try.**
8
7
 
9
8
  [![npm version](https://img.shields.io/npm/v/@corbat-tech/coding-standards-mcp.svg)](https://www.npmjs.com/package/@corbat-tech/coding-standards-mcp)
10
9
  [![CI](https://github.com/corbat-tech/coding-standards-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/corbat-tech/coding-standards-mcp/actions/workflows/ci.yml)
10
+ [![Coverage](https://img.shields.io/badge/coverage-82%25-brightgreen.svg)](https://github.com/corbat-tech/coding-standards-mcp)
11
11
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
12
12
  [![MCP](https://img.shields.io/badge/MCP-1.0-blue.svg)](https://modelcontextprotocol.io/)
13
13
 
14
- </div>
15
-
16
- <p align="center">
17
- <img src="assets/demo.gif" alt="CORBAT Demo" width="800">
18
- </p>
19
-
20
14
  ---
21
15
 
22
- ## The Problem
23
-
24
- Every time you ask AI to write code, you repeat the same instructions:
25
-
26
- ```
27
- "Create a payment service. Use hexagonal architecture. Follow TDD.
28
- Apply SOLID. Use our naming conventions. Ensure 80% coverage..."
29
- ```
30
-
31
- **This is tedious, error-prone, and inconsistent.**
16
+ [![Cursor](https://img.shields.io/badge/Cursor-✓-black?style=flat-square&logo=cursor)](docs/setup.md#cursor)
17
+ [![VS Code](https://img.shields.io/badge/VS_Code-✓-007ACC?style=flat-square&logo=visualstudiocode)](docs/setup.md#vs-code)
18
+ [![Windsurf](https://img.shields.io/badge/Windsurf-✓-00C7B7?style=flat-square)](docs/setup.md#windsurf)
19
+ [![JetBrains](https://img.shields.io/badge/JetBrains-✓-orange?style=flat-square&logo=jetbrains)](docs/setup.md#jetbrains-ides)
20
+ [![Zed](https://img.shields.io/badge/Zed-✓-084CCF?style=flat-square)](docs/setup.md#zed)
21
+ [![Claude](https://img.shields.io/badge/Claude-✓-cc785c?style=flat-square)](docs/setup.md#claude-desktop)
32
22
 
33
- ## The Solution
23
+ **Works with GitHub Copilot, Continue, Cline, Tabnine, Amazon Q, and [25+ more tools](docs/compatibility.md)**
34
24
 
35
- Define your standards once. Corbat MCP injects them automatically.
36
-
37
- ```
38
- You: "Create a payment service"
39
-
40
- Corbat: ✓ Detected Java/Spring project
41
- ✓ Applied hexagonal architecture
42
- ✓ Enforced TDD workflow
43
- ✓ Injected SOLID principles
44
- ✓ Set 80%+ coverage requirement
45
- ```
46
-
47
- **One prompt. Full compliance.**
25
+ </div>
48
26
 
49
27
  ---
50
28
 
51
- ## Why Corbat MCP vs Alternatives?
29
+ ## The Problem
30
+
31
+ AI-generated code works, but rarely passes code review:
52
32
 
53
- | Feature | Corbat MCP | Linters (ESLint, etc.) | Manual prompts |
54
- |---------|:------:|:----------------------:|:--------------:|
55
- | Enforces **before** code is written | | | |
56
- | Architecture patterns (hexagonal, DDD) | | | ⚠️ |
57
- | TDD workflow enforcement | | | ⚠️ |
58
- | Task-specific guardrails | | | |
59
- | Auto-detects your stack | | | ❌ |
60
- | Zero repetition | ✅ | ✅ | ❌ |
33
+ | Without Corbat | With Corbat |
34
+ |----------------|-------------|
35
+ | No dependency injection | Proper DI with interfaces |
36
+ | Missing error handling | Custom error types with context |
37
+ | Basic tests (if any) | 80%+ coverage with TDD |
38
+ | God classes, long methods | SOLID, max 20 lines/method |
39
+ | Fails SonarQube | Passes quality gates |
61
40
 
62
- **Linters catch errors after the fact. Corbat MCP prevents them.**
41
+ **Result:** Production-ready code that passes code review.
63
42
 
64
43
  ---
65
44
 
66
45
  ## Quick Start
67
46
 
68
- **Step 1** Connect to Claude:
47
+ **1. Add to your MCP config:**
69
48
 
70
- <table>
71
- <tr>
72
- <td><b>Claude Code</b></td>
73
- <td>
74
-
75
- ```bash
76
- claude mcp add corbat -- npx -y @corbat-tech/coding-standards-mcp
77
- ```
78
-
79
- </td>
80
- </tr>
81
- <tr>
82
- <td><b>Claude Desktop</b></td>
83
- <td>
84
-
85
- Edit `~/.config/Claude/claude_desktop_config.json`:
86
49
  ```json
87
50
  {
88
51
  "mcpServers": {
@@ -94,273 +57,211 @@ Edit `~/.config/Claude/claude_desktop_config.json`:
94
57
  }
95
58
  ```
96
59
 
97
- </td>
98
- </tr>
99
- </table>
60
+ **2. Config file location:**
100
61
 
101
- **Step 2** Use it:
102
- ```
103
- "Create a user service"
104
- ```
62
+ | Tool | Location |
63
+ |------|----------|
64
+ | Cursor | `.cursor/mcp.json` |
65
+ | VS Code | `.vscode/mcp.json` |
66
+ | Windsurf | `~/.codeium/windsurf/mcp_config.json` |
67
+ | JetBrains | Settings → AI Assistant → MCP |
68
+ | Claude Desktop | `~/.config/Claude/claude_desktop_config.json` |
69
+ | Claude Code | `claude mcp add corbat -- npx -y @corbat-tech/coding-standards-mcp` |
105
70
 
106
- Corbat MCP auto-detects your stack and applies all standards. **That's it.**
71
+ > [Complete setup guide](docs/setup.md) for all 25+ tools
107
72
 
108
- ---
73
+ **3. Done!** Corbat auto-detects your stack.
109
74
 
110
- ## What You Get
111
-
112
- When you ask Claude to create code, Corbat MCP injects this context automatically:
113
-
114
- ```markdown
115
- # Task: Create payment service
116
-
117
- ## Detected
118
- - Stack: Java 21 · Spring Boot 3 · Maven
119
- - Task type: FEATURE
120
- - Profile: java-spring-backend
121
-
122
- ## Guardrails
123
-
124
- ### MUST
125
- ✓ Write tests BEFORE implementation (TDD)
126
- ✓ Use hexagonal architecture (domain/application/infrastructure)
127
- ✓ Apply SOLID principles
128
- ✓ Ensure 80%+ test coverage
129
- ✓ Validate all inputs
130
- ✓ Document public APIs
131
-
132
- ### AVOID
133
- ✗ God classes (>200 lines) or god methods (>20 lines)
134
- ✗ Hard-coded configuration values
135
- ✗ Mixing business logic with infrastructure
136
- ✗ Circular dependencies between layers
137
-
138
- ## Workflow
139
- 1. CLARIFY → Confirm requirements
140
- 2. PLAN → Create task checklist
141
- 3. BUILD → TDD cycle: Red → Green → Refactor
142
- 4. VERIFY → Tests pass, linter clean
143
- 5. REVIEW → Self-check against standards
144
-
145
- ## Naming Conventions
146
- - Classes: PascalCase (PaymentService)
147
- - Methods: camelCase (processPayment)
148
- - Constants: SCREAMING_SNAKE_CASE
149
- - Packages: lowercase (com.example.payment)
150
75
  ```
76
+ You: "Create a payment service"
151
77
 
152
- **Claude now generates code that follows ALL your standards.**
78
+ Corbat: Detected: Java 21, Spring Boot 3, Maven
79
+ ✓ Profile: java-spring-backend
80
+ ✓ Architecture: Hexagonal + DDD
81
+ ✓ Testing: TDD, 80%+ coverage
82
+ ```
153
83
 
154
84
  ---
155
85
 
156
- ## Task-Specific Guardrails
157
-
158
- Corbat MCP adapts its rules based on what you're doing:
159
-
160
- <table>
161
- <tr>
162
- <th>Task</th>
163
- <th>MUST</th>
164
- <th>AVOID</th>
165
- </tr>
166
- <tr>
167
- <td><b>Feature</b></td>
168
- <td>TDD, 80%+ coverage, SOLID, hexagonal</td>
169
- <td>God classes, coupled layers</td>
170
- </tr>
171
- <tr>
172
- <td><b>Bugfix</b></td>
173
- <td>Failing test first, minimal changes</td>
174
- <td>Refactoring, adding features</td>
175
- </tr>
176
- <tr>
177
- <td><b>Refactor</b></td>
178
- <td>Tests pass before AND after, incremental</td>
179
- <td>Behavior changes, big bang</td>
180
- </tr>
181
- <tr>
182
- <td><b>Test</b></td>
183
- <td>AAA pattern, one assertion, descriptive names</td>
184
- <td>Implementation details, flaky tests</td>
185
- </tr>
186
- </table>
86
+ ## Benchmark Results
187
87
 
188
- ---
88
+ Tested across 20 real-world scenarios:
189
89
 
190
- ## Compatibility
90
+ | Metric | Without | With | Impact |
91
+ |--------|:-------:|:----:|:------:|
92
+ | **Quality Score** | 63/100 | 93/100 | +48% |
93
+ | **Code Smells** | 43 | 0 | -100% |
94
+ | **SOLID Compliance** | 50% | 89% | +78% |
95
+ | **Tests Generated** | 219 | 558 | +155% |
96
+ | **SonarQube** | FAIL | PASS | Fixed |
191
97
 
192
- | Client | Status |
193
- |--------|:------:|
194
- | Claude Code (CLI) | ✅ Tested |
195
- | Claude Desktop | ✅ Tested |
196
- | Cursor | ⚠️ Experimental |
197
- | Windsurf | ⚠️ Experimental |
198
- | Other MCP clients | ✅ Standard protocol |
98
+ [View detailed benchmark report with code samples](docs/comparison-tests/RESULTS-REPORT.md)
199
99
 
200
100
  ---
201
101
 
202
- ## Built-in Profiles
203
-
204
- | Profile | Best for | Architecture |
205
- |---------|----------|--------------|
206
- | `java-spring-backend` | Enterprise Java | Hexagonal + DDD |
207
- | `nodejs` | Node.js/TypeScript APIs | Clean Architecture |
208
- | `python` | Python/FastAPI | Clean Architecture |
209
- | `react` | React applications | Feature-based |
210
- | `angular` | Angular 19+ applications | Feature-based + Signals |
211
- | `vue` | Vue 3.5+ applications | Feature-based + Composition |
212
- | `minimal` | MVPs, prototypes | Basic standards |
102
+ ## Code Comparison
213
103
 
214
- **Auto-detection**: Corbat MCP reads `pom.xml`, `package.json`, `requirements.txt`, etc. to select the right profile.
215
-
216
- ---
104
+ ### Before: Without Corbat MCP
217
105
 
218
- ## Customize (Optional)
219
-
220
- ### Option A: Interactive generator
221
- ```bash
222
- npx corbat-init
223
- ```
106
+ ```typescript
107
+ class UserService {
108
+ private users: User[] = [];
224
109
 
225
- ### Option B: Manual config
226
-
227
- Create `.corbat.json` in your project root:
110
+ getUser(id: string) {
111
+ return this.users.find(u => u.id === id);
112
+ }
228
113
 
229
- ```json
230
- {
231
- "profile": "nodejs",
232
- "rules": {
233
- "always": [
234
- "Use TypeScript strict mode",
235
- "Prefer functional programming"
236
- ],
237
- "never": [
238
- "Use any type"
239
- ]
114
+ createUser(name: string, email: string) {
115
+ const user = { id: Date.now(), name, email };
116
+ this.users.push(user);
117
+ return user;
240
118
  }
241
119
  }
120
+ // Problems: returns undefined, no validation, no DI, no tests
242
121
  ```
243
122
 
244
- ---
245
-
246
- ## Available Tools
247
-
248
- | Tool | Purpose |
249
- |------|---------|
250
- | `get_context` | **Primary** — Returns all standards for your task |
251
- | `validate` | Check code against standards |
252
- | `search` | Search standards documentation |
253
- | `profiles` | List available profiles |
254
- | `health` | Server status check |
255
-
256
- ## Available Prompts
123
+ ### After: With Corbat MCP
257
124
 
258
- | Prompt | Purpose |
259
- |--------|---------|
260
- | `implement` | Guided implementation with TDD workflow |
261
- | `review` | Expert code review (architecture, SOLID, security) |
125
+ ```typescript
126
+ interface UserRepository {
127
+ findById(id: UserId): User | null;
128
+ save(user: User): void;
129
+ }
262
130
 
263
- ---
131
+ class UserService {
132
+ constructor(
133
+ private readonly repository: UserRepository,
134
+ private readonly idGenerator: IdGenerator
135
+ ) {}
264
136
 
265
- ## How It Works
137
+ getUser(id: UserId): User {
138
+ const user = this.repository.findById(id);
139
+ if (!user) throw new UserNotFoundError(id);
140
+ return user;
141
+ }
266
142
 
267
- ```
268
- ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
269
- │ Your Prompt │────▶│ Corbat MCP │────▶│ Claude + Rules │
270
- │ │ │ │ │ │
271
- │ "Create user │ │ 1. Detect stack │ │ Generates code │
272
- │ service" │ │ 2. Classify task│ │ following ALL │
273
- │ │ │ 3. Load profile │ │ your standards │
274
- │ │ │ 4. Inject rules │ │ │
275
- └─────────────────┘ └─────────────────┘ └─────────────────┘
143
+ createUser(input: CreateUserInput): User {
144
+ this.validateInput(input);
145
+ const user = User.create(
146
+ this.idGenerator.generate(),
147
+ input.name.trim(),
148
+ input.email.toLowerCase()
149
+ );
150
+ this.repository.save(user);
151
+ return user;
152
+ }
153
+ }
154
+ // ✓ Dependency injection ✓ Custom errors ✓ Validation ✓ 15 tests
276
155
  ```
277
156
 
278
157
  ---
279
158
 
280
- ## Included Documentation
281
-
282
- Corbat MCP comes with 15 standards documents you can search:
283
-
284
- - **Architecture**: Hexagonal, DDD, Clean Architecture
285
- - **Code Quality**: SOLID, Clean Code, Naming Conventions
286
- - **Testing**: TDD, Unit/Integration/E2E guidelines
287
- - **DevOps**: Docker, Kubernetes, CI/CD
288
- - **Observability**: Logging, Metrics, Tracing
159
+ ## Built-in Profiles
289
160
 
290
- Use `search` tool: *"search kafka"* Returns event-driven architecture guidelines.
161
+ | Profile | Stack | Architecture | Testing |
162
+ |---------|-------|--------------|---------|
163
+ | `java-spring-backend` | Java 21 + Spring Boot 3 | Hexagonal + DDD + CQRS | TDD, 80%+ coverage |
164
+ | `kotlin-spring` | Kotlin + Spring Boot 3 | Hexagonal + Coroutines | Kotest, MockK |
165
+ | `nodejs` | Node.js + TypeScript | Clean Architecture | Vitest |
166
+ | `nextjs` | Next.js 14+ | Feature-based + RSC | Vitest, Playwright |
167
+ | `react` | React 18+ | Feature-based | Testing Library |
168
+ | `vue` | Vue 3.5+ | Feature-based | Vitest |
169
+ | `angular` | Angular 19+ | Feature modules | Jest |
170
+ | `python` | Python + FastAPI | Hexagonal + async | pytest |
171
+ | `go` | Go 1.22+ | Clean + idiomatic | Table-driven tests |
172
+ | `rust` | Rust + Axum | Clean + ownership | Built-in + proptest |
173
+ | `csharp-dotnet` | C# 12 + ASP.NET Core 8 | Clean + CQRS | xUnit, FluentAssertions |
174
+ | `flutter` | Dart 3 + Flutter | Clean + BLoC/Riverpod | flutter_test |
175
+ | `minimal` | Any | Basic quality rules | Optional |
176
+
177
+ **Auto-detection:** Corbat reads `pom.xml`, `package.json`, `go.mod`, `Cargo.toml`, `pubspec.yaml`, `*.csproj` to select the right profile.
178
+
179
+ ### Architecture Patterns Enforced
180
+
181
+ - **Hexagonal Architecture** — Ports & Adapters, infrastructure isolation
182
+ - **Domain-Driven Design** — Aggregates, Value Objects, Domain Events
183
+ - **SOLID Principles** — Single responsibility, dependency inversion
184
+ - **Clean Code** — Max 20 lines/method, meaningful names, no magic numbers
185
+ - **Error Handling** — Custom exceptions with context, no generic catches
186
+ - **Testing** — TDD workflow, unit + integration, mocking strategies
291
187
 
292
188
  ---
293
189
 
294
- ## Troubleshooting
190
+ ## Customize
295
191
 
296
- <details>
297
- <summary><b>Claude can't find corbat</b></summary>
192
+ ### Ready-to-use templates
298
193
 
299
- 1. Verify npm/npx is in PATH: `which npx`
300
- 2. Test manually: `npx @corbat-tech/coding-standards-mcp`
301
- 3. Restart Claude completely
302
- 4. Check Claude's MCP logs
194
+ Copy a production-ready configuration for your stack:
303
195
 
304
- </details>
196
+ **[Browse 14 templates](docs/templates.md)** — Java, Python, Node.js, React, Vue, Angular, Go, Kotlin, Rust, Flutter, and more.
305
197
 
306
- <details>
307
- <summary><b>Wrong stack detected</b></summary>
198
+ ### Generate a custom profile
308
199
 
309
- Override with `.corbat.json`:
310
- ```json
311
- { "profile": "nodejs" }
200
+ ```bash
201
+ npx corbat-init
312
202
  ```
313
203
 
314
- Or specify in prompt: *"...using profile nodejs"*
315
-
316
- </details>
204
+ Interactive wizard that auto-detects your stack and lets you configure architecture, DDD patterns, and quality metrics.
317
205
 
318
- <details>
319
- <summary><b>Standards not being applied</b></summary>
206
+ ### Manual config
320
207
 
321
- 1. Check if `.corbat.json` exists in project root
322
- 2. Verify profile exists in `profiles/templates/`
323
- 3. Try explicit: *"Use corbat get_context for: your task"*
324
-
325
- </details>
326
-
327
- <details>
328
- <summary><b>Permission errors (macOS/Linux)</b></summary>
208
+ Create `.corbat.json` in your project root:
329
209
 
330
- ```bash
331
- # Clear npx cache and retry
332
- npx clear-npx-cache
333
- npx @corbat-tech/coding-standards-mcp
210
+ ```json
211
+ {
212
+ "profile": "java-spring-backend",
213
+ "architecture": {
214
+ "pattern": "hexagonal",
215
+ "layers": ["domain", "application", "infrastructure", "api"]
216
+ },
217
+ "ddd": {
218
+ "aggregates": true,
219
+ "valueObjects": true,
220
+ "domainEvents": true
221
+ },
222
+ "quality": {
223
+ "maxMethodLines": 20,
224
+ "maxClassLines": 200,
225
+ "minCoverage": 80
226
+ },
227
+ "rules": {
228
+ "always": ["Use records for DTOs", "Prefer Optional over null"],
229
+ "never": ["Use field injection", "Catch generic Exception"]
230
+ }
231
+ }
334
232
  ```
335
233
 
336
- </details>
337
-
338
234
  ---
339
235
 
340
- ## Project Quality
236
+ ## How It Works
341
237
 
342
- | Metric | Value |
343
- |--------|-------|
344
- | Test coverage | 80%+ |
345
- | Tests passing | 78 |
346
- | TypeScript | Strict mode |
347
- | Linting | Biome |
348
- | Architecture validation | dependency-cruiser |
238
+ ```
239
+ Your Prompt ──▶ Corbat MCP ──▶ AI + Standards
240
+
241
+ ├─ 1. Detect stack (pom.xml, package.json...)
242
+ ├─ 2. Classify task (feature, bugfix, refactor)
243
+ ├─ 3. Load profile with architecture rules
244
+ └─ 4. Inject guardrails before code generation
245
+ ```
349
246
 
350
247
  ---
351
248
 
352
- ## Links
249
+ ## Documentation
353
250
 
354
- - [Full Documentation](docs/full-documentation.md)
355
- - [Model Context Protocol](https://modelcontextprotocol.io/)
356
- - [Report Issues](https://github.com/corbat-tech/coding-standards-mcp/issues)
251
+ | Resource | Description |
252
+ |----------|-------------|
253
+ | [Setup Guide](docs/setup.md) | Installation for all 25+ tools |
254
+ | [Templates](docs/templates.md) | Ready-to-use `.corbat.json` configurations |
255
+ | [Compatibility](docs/compatibility.md) | Full list of supported tools |
256
+ | [Benchmark Report](docs/comparison-tests/RESULTS-REPORT.md) | 20 real-world tests with code samples |
257
+ | [API Reference](docs/full-documentation.md) | Tools, prompts, and configuration |
357
258
 
358
259
  ---
359
260
 
360
261
  <div align="center">
361
262
 
362
- **Define once. Apply everywhere. Ship faster.**
263
+ **Stop fixing AI code. Start shipping it.**
363
264
 
364
- [Get Started](#quick-start) · [Documentation](docs/full-documentation.md) · [Report Bug](https://github.com/corbat-tech/coding-standards-mcp/issues)
265
+ *Recommended by [corbat-tech](https://corbat.tech) We use Claude Code internally, but Corbat MCP works with any MCP-compatible tool.*
365
266
 
366
267
  </div>
package/assets/demo.gif CHANGED
Binary file
@@ -0,0 +1,63 @@
1
+ # VHS Demo for CORBAT MCP - Ultra compact version
2
+
3
+ Output assets/demo.gif
4
+
5
+ Set Shell "bash"
6
+ Set FontSize 15
7
+ Set Width 800
8
+ Set Height 400
9
+ Set Theme "Catppuccin Mocha"
10
+ Set TypingSpeed 25ms
11
+ Set Padding 20
12
+
13
+ Type "# CORBAT MCP - AI code that passes code review"
14
+ Enter
15
+ Sleep 300ms
16
+
17
+ Type "# Problem: Claude writes code, but it fails quality gates"
18
+ Enter
19
+ Sleep 400ms
20
+
21
+ Enter
22
+ Type "# Solution: One command, professional-grade code forever"
23
+ Enter
24
+ Sleep 300ms
25
+
26
+ Type "claude mcp add corbat -- npx -y @corbat-tech/coding-standards-mcp"
27
+ Enter
28
+ Sleep 500ms
29
+
30
+ Enter
31
+ Type "# You: 'Create a payment service'"
32
+ Enter
33
+ Sleep 300ms
34
+
35
+ Type "# Corbat: Detects stack, injects architecture rules, enforces TDD"
36
+ Enter
37
+ Sleep 400ms
38
+
39
+ Enter
40
+ Type "# Results (20 benchmarks):"
41
+ Enter
42
+ Sleep 200ms
43
+
44
+ Type "# Quality: 63 -> 93 (+48%)"
45
+ Enter
46
+ Sleep 150ms
47
+
48
+ Type "# Smells: 43 -> 0 (-100%)"
49
+ Enter
50
+ Sleep 150ms
51
+
52
+ Type "# Tests: 219 -> 558 (+155%)"
53
+ Enter
54
+ Sleep 150ms
55
+
56
+ Type "# SonarQube: FAIL -> PASS"
57
+ Enter
58
+ Sleep 500ms
59
+
60
+ Enter
61
+ Type "# Stop fixing AI code. Start shipping it."
62
+ Enter
63
+ Sleep 5s
package/dist/agent.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- import { type DetectedStack, type Guardrails, type ProjectConfig, type TaskType } from './types.js';
1
+ import { type ExtendedGuardrails, formatGuardrailsAsMarkdown, loadGuardrails } from './guardrails.js';
2
+ import { type DetectedStack, type ProjectConfig, type TaskType } from './types.js';
3
+ export { loadGuardrails, formatGuardrailsAsMarkdown, type ExtendedGuardrails };
2
4
  /**
3
5
  * Load project configuration from .corbat.json
4
6
  */
@@ -9,8 +11,9 @@ export declare function loadProjectConfig(projectDir: string): Promise<ProjectCo
9
11
  export declare function detectProjectStack(projectDir: string): Promise<DetectedStack | null>;
10
12
  /**
11
13
  * Get guardrails for a specific task type.
14
+ * Loads from YAML files and merges with project-specific overrides.
12
15
  */
13
- export declare function getGuardrails(taskType: TaskType, projectConfig?: ProjectConfig | null): Guardrails;
16
+ export declare function getGuardrails(taskType: TaskType, projectConfig?: ProjectConfig | null): Promise<ExtendedGuardrails>;
14
17
  /**
15
18
  * Get project rules (always rules + task-specific rules).
16
19
  */
@@ -46,8 +49,4 @@ export declare function getTechnicalDecision(category: string, _context: string,
46
49
  recommendation: string;
47
50
  reasoning: string;
48
51
  } | null;
49
- /**
50
- * Format guardrails as markdown.
51
- */
52
- export declare function formatGuardrailsAsMarkdown(guardrails: Guardrails): string;
53
52
  //# sourceMappingURL=agent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.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