@corbat-tech/coding-standards-mcp 1.0.3 → 2.0.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 (99) hide show
  1. package/README.md +233 -337
  2. package/dist/agent.d.ts +5 -6
  3. package/dist/agent.d.ts.map +1 -1
  4. package/dist/agent.js +95 -217
  5. package/dist/agent.js.map +1 -1
  6. package/dist/analysis/code-analyzer.d.ts +44 -0
  7. package/dist/analysis/code-analyzer.d.ts.map +1 -0
  8. package/dist/analysis/code-analyzer.js +528 -0
  9. package/dist/analysis/code-analyzer.js.map +1 -0
  10. package/dist/errors.d.ts +58 -0
  11. package/dist/errors.d.ts.map +1 -0
  12. package/dist/errors.js +112 -0
  13. package/dist/errors.js.map +1 -0
  14. package/dist/guardrails.d.ts +35 -0
  15. package/dist/guardrails.d.ts.map +1 -0
  16. package/dist/guardrails.js +303 -0
  17. package/dist/guardrails.js.map +1 -0
  18. package/dist/index.js +1 -1
  19. package/dist/index.js.map +1 -1
  20. package/dist/logger.d.ts +36 -0
  21. package/dist/logger.d.ts.map +1 -0
  22. package/dist/logger.js +63 -0
  23. package/dist/logger.js.map +1 -0
  24. package/dist/metrics.d.ts +40 -0
  25. package/dist/metrics.d.ts.map +1 -0
  26. package/dist/metrics.js +97 -0
  27. package/dist/metrics.js.map +1 -0
  28. package/dist/profiles.d.ts +1 -1
  29. package/dist/profiles.d.ts.map +1 -1
  30. package/dist/profiles.js +239 -108
  31. package/dist/profiles.js.map +1 -1
  32. package/dist/prompts.js +1 -1
  33. package/dist/prompts.js.map +1 -1
  34. package/dist/tools/definitions.d.ts +143 -0
  35. package/dist/tools/definitions.d.ts.map +1 -0
  36. package/dist/tools/definitions.js +229 -0
  37. package/dist/tools/definitions.js.map +1 -0
  38. package/dist/tools/handlers/get-context.d.ts +12 -0
  39. package/dist/tools/handlers/get-context.d.ts.map +1 -0
  40. package/dist/tools/handlers/get-context.js +233 -0
  41. package/dist/tools/handlers/get-context.js.map +1 -0
  42. package/dist/tools/handlers/health.d.ts +11 -0
  43. package/dist/tools/handlers/health.d.ts.map +1 -0
  44. package/dist/tools/handlers/health.js +57 -0
  45. package/dist/tools/handlers/health.js.map +1 -0
  46. package/dist/tools/handlers/index.d.ts +12 -0
  47. package/dist/tools/handlers/index.d.ts.map +1 -0
  48. package/dist/tools/handlers/index.js +12 -0
  49. package/dist/tools/handlers/index.js.map +1 -0
  50. package/dist/tools/handlers/init.d.ts +12 -0
  51. package/dist/tools/handlers/init.d.ts.map +1 -0
  52. package/dist/tools/handlers/init.js +102 -0
  53. package/dist/tools/handlers/init.js.map +1 -0
  54. package/dist/tools/handlers/profiles.d.ts +11 -0
  55. package/dist/tools/handlers/profiles.d.ts.map +1 -0
  56. package/dist/tools/handlers/profiles.js +25 -0
  57. package/dist/tools/handlers/profiles.js.map +1 -0
  58. package/dist/tools/handlers/search.d.ts +12 -0
  59. package/dist/tools/handlers/search.d.ts.map +1 -0
  60. package/dist/tools/handlers/search.js +58 -0
  61. package/dist/tools/handlers/search.js.map +1 -0
  62. package/dist/tools/handlers/validate.d.ts +15 -0
  63. package/dist/tools/handlers/validate.d.ts.map +1 -0
  64. package/dist/tools/handlers/validate.js +71 -0
  65. package/dist/tools/handlers/validate.js.map +1 -0
  66. package/dist/tools/handlers/verify.d.ts +38 -0
  67. package/dist/tools/handlers/verify.d.ts.map +1 -0
  68. package/dist/tools/handlers/verify.js +172 -0
  69. package/dist/tools/handlers/verify.js.map +1 -0
  70. package/dist/tools/index.d.ts +22 -0
  71. package/dist/tools/index.d.ts.map +1 -0
  72. package/dist/tools/index.js +75 -0
  73. package/dist/tools/index.js.map +1 -0
  74. package/dist/tools/schemas.d.ts +29 -0
  75. package/dist/tools/schemas.d.ts.map +1 -0
  76. package/dist/tools/schemas.js +20 -0
  77. package/dist/tools/schemas.js.map +1 -0
  78. package/dist/tools.js +2 -2
  79. package/dist/tools.js.map +1 -1
  80. package/dist/types.d.ts +141 -71
  81. package/dist/types.d.ts.map +1 -1
  82. package/dist/types.js +92 -40
  83. package/dist/types.js.map +1 -1
  84. package/package.json +2 -2
  85. package/profiles/examples/microservice-kafka.yaml +122 -0
  86. package/profiles/examples/startup-fast.yaml +67 -0
  87. package/profiles/examples/strict-enterprise.yaml +62 -0
  88. package/profiles/templates/angular.yaml +614 -0
  89. package/profiles/templates/csharp-dotnet.yaml +529 -0
  90. package/profiles/templates/flutter.yaml +547 -0
  91. package/profiles/templates/go.yaml +1276 -0
  92. package/profiles/templates/java-spring-backend.yaml +326 -0
  93. package/profiles/templates/kotlin-spring.yaml +417 -0
  94. package/profiles/templates/nextjs.yaml +536 -0
  95. package/profiles/templates/nodejs.yaml +594 -0
  96. package/profiles/templates/python.yaml +546 -0
  97. package/profiles/templates/react.yaml +456 -0
  98. package/profiles/templates/rust.yaml +508 -0
  99. package/profiles/templates/vue.yaml +483 -0
package/README.md CHANGED
@@ -1,455 +1,351 @@
1
1
  <div align="center">
2
2
 
3
3
  # CORBAT MCP
4
- #### Coding Standards Server for Claude
4
+ #### AI Coding Standards Server
5
5
 
6
- ### AI-generated code that passes code review on the first try.
7
-
8
- **The only MCP that makes Claude generate professional-grade code — with proper architecture, comprehensive tests, and zero code smells.**
6
+ **AI-generated code that passes code review on the first try.**
9
7
 
10
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)
11
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)
12
11
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
13
12
  [![MCP](https://img.shields.io/badge/MCP-1.0-blue.svg)](https://modelcontextprotocol.io/)
14
13
 
15
- </div>
16
-
17
- <p align="center">
18
- <img src="assets/demo.gif" alt="CORBAT Demo" width="800">
19
- </p>
20
-
21
14
  ---
22
15
 
23
- ## The Real Problem With AI-Generated Code
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)
24
22
 
25
- When you ask Claude to write code, it works. But does it pass code review?
23
+ **Works with GitHub Copilot, Continue, Cline, Tabnine, Amazon Q, and [25+ more tools](docs/compatibility.md)**
26
24
 
27
- ```
28
- ❌ No dependency injection
29
- ❌ Missing error handling
30
- ❌ Basic tests (if any)
31
- ❌ No input validation
32
- ❌ God classes and long methods
33
- ❌ Fails SonarQube quality gates
34
- ```
35
-
36
- **You spend hours fixing AI-generated code to meet your team's standards.**
25
+ </div>
37
26
 
38
27
  ---
39
28
 
40
- ## What If Claude Wrote Code Like Your Senior Engineers?
29
+ ## The Problem
41
30
 
42
- <table>
43
- <tr>
44
- <td width="50%">
31
+ AI-generated code works, but rarely passes code review:
45
32
 
46
- ### Without Corbat MCP
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 |
47
40
 
48
- ```typescript
49
- class UserService {
50
- private users: User[] = [];
51
-
52
- getUser(id: string) {
53
- return this.users.find(u => u.id === id);
54
- }
55
-
56
- createUser(name: string, email: string) {
57
- const user = { id: Date.now(), name, email };
58
- this.users.push(user);
59
- return user;
60
- }
61
- }
62
- ```
41
+ **Result:** Production-ready code that passes code review.
63
42
 
64
- - Returns `undefined` on not found
65
- - No validation
66
- - No error types
67
- - No interfaces
68
- - 6 basic tests
69
-
70
- </td>
71
- <td width="50%">
72
-
73
- ### With Corbat MCP
74
-
75
- ```typescript
76
- interface UserRepository {
77
- findById(id: UserId): User | null;
78
- save(user: User): void;
79
- }
43
+ ---
80
44
 
81
- class UserService {
82
- constructor(
83
- private readonly repository: UserRepository,
84
- private readonly idGenerator: IdGenerator
85
- ) {}
45
+ ## Quick Start
86
46
 
87
- getUser(id: UserId): User {
88
- const user = this.repository.findById(id);
89
- if (!user) throw new UserNotFoundError(id);
90
- return user;
91
- }
47
+ **1. Add to your MCP config:**
92
48
 
93
- createUser(input: CreateUserInput): User {
94
- this.validateInput(input);
95
- const user = User.create(
96
- this.idGenerator.generate(),
97
- input.name.trim(),
98
- input.email.toLowerCase()
99
- );
100
- this.repository.save(user);
101
- return user;
49
+ ```json
50
+ {
51
+ "mcpServers": {
52
+ "corbat": {
53
+ "command": "npx",
54
+ "args": ["-y", "@corbat-tech/coding-standards-mcp"]
55
+ }
102
56
  }
103
57
  }
104
58
  ```
105
59
 
106
- - Dependency injection
107
- - Custom error types
108
- - Input validation & normalization
109
- - Repository pattern (ports & adapters)
110
- - 15 comprehensive tests
60
+ **2. Config file location:**
111
61
 
112
- </td>
113
- </tr>
114
- </table>
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` |
115
70
 
116
- ---
71
+ > [Complete setup guide](docs/setup.md) for all 25+ tools
117
72
 
118
- ## Benchmark Results: The Numbers Don't Lie
73
+ **3. Done!** Corbat auto-detects your stack.
119
74
 
120
- We tested Claude generating identical tasks **with and without** Corbat MCP across 20 scenarios.
75
+ ```
76
+ You: "Create a payment service"
121
77
 
122
- <table>
123
- <tr>
124
- <th>Metric</th>
125
- <th>Without MCP</th>
126
- <th>With MCP</th>
127
- <th>Improvement</th>
128
- </tr>
129
- <tr>
130
- <td><b>Quality Score</b></td>
131
- <td>63/100</td>
132
- <td>93/100</td>
133
- <td><b>+48%</b></td>
134
- </tr>
135
- <tr>
136
- <td><b>Code Smells</b></td>
137
- <td>43</td>
138
- <td>0</td>
139
- <td><b>-100%</b></td>
140
- </tr>
141
- <tr>
142
- <td><b>SOLID Compliance</b></td>
143
- <td>50%</td>
144
- <td>89%</td>
145
- <td><b>+78%</b></td>
146
- </tr>
147
- <tr>
148
- <td><b>Test Coverage</b></td>
149
- <td>219 tests</td>
150
- <td>558 tests</td>
151
- <td><b>+155%</b></td>
152
- </tr>
153
- <tr>
154
- <td><b>SonarQube Gate</b></td>
155
- <td>FAIL</td>
156
- <td>PASS</td>
157
- <td><b>Fixed</b></td>
158
- </tr>
159
- </table>
78
+ Corbat: ✓ Detected: Java 21, Spring Boot 3, Maven
79
+ ✓ Profile: java-spring-backend
80
+ ✓ Architecture: Hexagonal + DDD
81
+ Testing: TDD, 80%+ coverage
82
+ ```
160
83
 
161
- > **Key finding:** Code generated with Corbat MCP passes SonarQube quality gates. Without it, code fails.
84
+ ---
162
85
 
163
- [View Full Benchmark Report](docs/comparison-tests/RESULTS-REPORT.md)
86
+ ## Benchmark Results v2.0
164
87
 
165
- ---
88
+ ### Overall Impact
166
89
 
167
- ## Why Corbat MCP vs Other Solutions?
90
+ <div align="center">
168
91
 
169
- | Approach | When it acts | What it catches | Auto-detects stack |
170
- |----------|:------------:|:---------------:|:------------------:|
171
- | **Corbat MCP** | **BEFORE** code is written | Architecture, SOLID, TDD, DDD | **Yes** |
172
- | ESLint/Prettier | After code exists | Syntax, formatting | No |
173
- | SonarQube | After PR/commit | Code smells, bugs | No |
174
- | Manual prompts | Every time | Whatever you remember | No |
92
+ | Metric | Without Corbat | With Corbat | **Improvement** |
93
+ |--------|:--------------:|:-----------:|:---------------:|
94
+ | **Quality Score** | 4.6/10 | 7.7/10 | **+67%** |
95
+ | **Custom Errors** | 3 | 18 | **+500%** |
96
+ | **Interfaces/Ports** | 19 | 41 | **+116%** |
97
+ | **Files (modularity)** | 55 | 95 | **+73%** |
175
98
 
176
- **Linters and analyzers catch problems after the fact. Corbat MCP prevents them.**
99
+ </div>
177
100
 
178
- ### vs Other Coding MCPs
101
+ ### By Complexity Level
179
102
 
180
- | Feature | Corbat MCP | Generic coding MCPs |
181
- |---------|:----------:|:-------------------:|
182
- | Task-specific guardrails (feature vs bugfix vs refactor) | **Yes** | No |
183
- | Auto-detects your stack from project files | **Yes** | No |
184
- | Enforces architectural patterns (Hexagonal, DDD) | **Yes** | Limited |
185
- | Comprehensive benchmark data | **Yes** | No |
186
- | 7 production-ready profiles | **Yes** | Basic |
103
+ | Category | Scenarios | Without | With | **Improvement** |
104
+ |----------|-----------|:-------:|:----:|:---------------:|
105
+ | **Basic** | UserService, REST API, React Form | 4.0 | 7.6 | **+90%** |
106
+ | **Intermediate** | Kafka Consumer, FastAPI, Go HTTP | 4.3 | 7.2 | **+67%** |
107
+ | **Advanced** | Saga, Circuit Breaker, Event Sourcing | 5.6 | 8.2 | **+46%** |
187
108
 
188
- ---
109
+ ### Pattern Detection
189
110
 
190
- ## Quick Start (2 minutes)
111
+ | Pattern | Without Corbat | With Corbat |
112
+ |---------|:--------------:|:-----------:|
113
+ | Hexagonal Architecture | 0/10 scenarios | **10/10** |
114
+ | Repository Pattern | 2/10 | **7/10** |
115
+ | Custom Error Types | 1/10 | **8/10** |
116
+ | Dependency Injection | 2/10 | **10/10** |
117
+ | Saga Pattern | 0/10 | **1/1** (when needed) |
191
118
 
192
- **Step 1** Add to Claude:
119
+ ### Real Example: Saga Pattern (Scenario 07)
193
120
 
194
121
  <table>
195
122
  <tr>
196
- <td><b>Claude Code</b></td>
123
+ <th>Without Corbat</th>
124
+ <th>With Corbat</th>
125
+ </tr>
126
+ <tr>
197
127
  <td>
198
128
 
199
- ```bash
200
- claude mcp add corbat -- npx -y @corbat-tech/coding-standards-mcp
129
+ ```java
130
+ // Hardcoded rollback, not extensible
131
+ try {
132
+ targetAccount.credit(amount);
133
+ } catch (Exception e) {
134
+ rollbackDebit(sourceAccount, amount);
135
+ throw new TransferException(...);
136
+ }
201
137
  ```
202
138
 
203
139
  </td>
204
- </tr>
205
- <tr>
206
- <td><b>Claude Desktop</b></td>
207
140
  <td>
208
141
 
209
- Edit `~/.config/Claude/claude_desktop_config.json`:
210
- ```json
211
- {
212
- "mcpServers": {
213
- "corbat": {
214
- "command": "npx",
215
- "args": ["-y", "@corbat-tech/coding-standards-mcp"]
142
+ ```java
143
+ // Reusable Saga Pattern
144
+ public interface SagaStep<T> {
145
+ void execute(T context);
146
+ void compensate(T context);
147
+ }
148
+
149
+ public class SagaOrchestrator<T> {
150
+ public void execute(T context) {
151
+ for (SagaStep<T> step : steps) {
152
+ step.execute(context);
153
+ executedSteps.add(step);
216
154
  }
217
155
  }
156
+ // Auto-rollback on failure
218
157
  }
219
158
  ```
220
159
 
221
160
  </td>
222
161
  </tr>
162
+ <tr>
163
+ <td>9 files, 292 LOC, manual rollback</td>
164
+ <td><b>17 files, 707 LOC, orchestrated compensation</b></td>
165
+ </tr>
223
166
  </table>
224
167
 
225
- **Step 2** Just code:
226
-
227
- ```
228
- You: "Create a payment service"
229
-
230
- Corbat: ✓ Detected Java/Spring project
231
- ✓ Loaded java-spring-backend profile
232
- ✓ Applied hexagonal architecture rules
233
- ✓ Enforced TDD workflow
234
- ✓ Set 80%+ coverage requirement
235
- ```
236
-
237
- **That's it.** Claude now generates code that passes code review.
168
+ [View full benchmark analysis with 10 scenarios](benchmarks/v2/ANALYSIS.md)
238
169
 
239
170
  ---
240
171
 
241
- ## What Gets Injected Automatically
242
-
243
- When you ask Claude to create code, Corbat MCP injects professional standards:
244
-
245
- ```markdown
246
- ## Detected
247
- - Stack: Java 21 · Spring Boot 3 · Maven
248
- - Task type: FEATURE
249
- - Profile: java-spring-backend
250
-
251
- ## MUST
252
- ✓ Write tests BEFORE implementation (TDD)
253
- ✓ Use hexagonal architecture (domain → application → infrastructure)
254
- ✓ Apply SOLID principles
255
- ✓ Ensure 80%+ test coverage
256
- ✓ Create custom error types with context
257
- ✓ Validate all inputs at boundaries
258
-
259
- ## AVOID
260
- ✗ God classes (>200 lines) or god methods (>20 lines)
261
- ✗ Hard-coded configuration values
262
- ✗ Mixing business logic with infrastructure
263
- ✗ Returning null/undefined (use Result types or throw)
264
- ```
265
-
266
- ---
172
+ ## Code Comparison
267
173
 
268
- ## Smart Guardrails by Task Type
174
+ ### Before: Without Corbat MCP
269
175
 
270
- Corbat MCP automatically detects what you're doing and applies different rules:
176
+ ```typescript
177
+ class UserService {
178
+ private users: Map<string, User> = new Map();
271
179
 
272
- | Task | Key Rules |
273
- |------|-----------|
274
- | **Feature** | TDD workflow, 80%+ coverage, SOLID, hexagonal architecture |
275
- | **Bugfix** | Write failing test first, minimal changes, document root cause |
276
- | **Refactor** | Tests pass before AND after, no behavior changes, incremental |
277
- | **Test** | AAA pattern, one assertion per test, descriptive names |
180
+ getById(id: string): User | undefined {
181
+ return this.users.get(id);
182
+ }
278
183
 
184
+ createUser(input: CreateUserInput): User {
185
+ if (!input.name) throw new Error('Name is required');
186
+ const user = { id: uuidv4(), ...input };
187
+ this.users.set(user.id, user);
188
+ return user;
189
+ }
190
+ }
191
+ // ✗ Returns undefined ✗ Generic errors ✗ No DI ✗ Hardcoded storage
279
192
  ```
280
- You: "Fix the login timeout bug"
281
193
 
282
- Corbat detects: BUGFIX
283
- Applies: Failing test first → Minimal fix → Verify no regressions
284
- ```
194
+ ### After: With Corbat MCP
285
195
 
286
- ---
196
+ ```typescript
197
+ // Port (interface)
198
+ interface UserRepository {
199
+ findById(id: string): User | null;
200
+ save(user: User): void;
201
+ existsByEmail(email: string): boolean;
202
+ }
287
203
 
288
- ## Built-in Profiles for Every Stack
204
+ // Custom errors
205
+ class UserNotFoundError extends Error { /*...*/ }
206
+ class UserAlreadyExistsError extends Error { /*...*/ }
207
+ class InvalidUserInputError extends Error { /*...*/ }
289
208
 
290
- | Profile | Stack | Architecture |
291
- |---------|-------|--------------|
292
- | `java-spring-backend` | Java 21, Spring Boot 3 | Hexagonal + DDD + CQRS |
293
- | `nodejs` | Node.js, TypeScript | Clean Architecture |
294
- | `python` | Python, FastAPI | Clean Architecture |
295
- | `react` | React 18+ | Feature-based components |
296
- | `angular` | Angular 19+ | Feature-based + Signals |
297
- | `vue` | Vue 3.5+ | Composition API |
298
- | `minimal` | Any | Basic quality standards |
209
+ // Service with DI
210
+ class UserService {
211
+ constructor(
212
+ private readonly repository: UserRepository,
213
+ private readonly idGenerator: IdGenerator
214
+ ) {}
299
215
 
300
- **Auto-detection:** Corbat reads `pom.xml`, `package.json`, `requirements.txt` to select the right profile automatically.
216
+ getUserById(id: string): User {
217
+ const user = this.repository.findById(id);
218
+ if (!user) throw new UserNotFoundError(id);
219
+ return user;
220
+ }
301
221
 
302
- ---
222
+ createUser(input: CreateUserInput): User {
223
+ this.validateInput(input);
224
+ this.ensureEmailNotTaken(input.email);
225
+ const user = createUser(this.idGenerator.generate(), input);
226
+ this.repository.save(user);
227
+ return user;
228
+ }
229
+ }
230
+ // ✓ Repository interface ✓ 3 custom errors ✓ DI ✓ 11 tests ✓ Testable
231
+ ```
303
232
 
304
- ## ROI for Development Teams
233
+ **Result:** 3 files 7 files | 129 LOC → 308 LOC | 0 interfaces → 4 interfaces | 0 custom errors → 3
305
234
 
306
- Based on our benchmark data:
235
+ ---
307
236
 
308
- | Benefit | Impact |
309
- |---------|--------|
310
- | Code review time | **-40%** (fewer issues to catch) |
311
- | Bug density | **-50%** (better test coverage) |
312
- | Onboarding time | **-30%** (consistent architecture) |
313
- | Technical debt | **-90%** (zero code smells) |
314
- | Debugging time | **-60%** (custom errors with context) |
237
+ ## Built-in Profiles
238
+
239
+ | Profile | Stack | Architecture | Testing |
240
+ |---------|-------|--------------|---------|
241
+ | `java-spring-backend` | Java 21 + Spring Boot 3 | Hexagonal + DDD + CQRS | TDD, 80%+ coverage |
242
+ | `kotlin-spring` | Kotlin + Spring Boot 3 | Hexagonal + Coroutines | Kotest, MockK |
243
+ | `nodejs` | Node.js + TypeScript | Clean Architecture | Vitest |
244
+ | `nextjs` | Next.js 14+ | Feature-based + RSC | Vitest, Playwright |
245
+ | `react` | React 18+ | Feature-based | Testing Library |
246
+ | `vue` | Vue 3.5+ | Feature-based | Vitest |
247
+ | `angular` | Angular 19+ | Feature modules | Jest |
248
+ | `python` | Python + FastAPI | Hexagonal + async | pytest |
249
+ | `go` | Go 1.22+ | Clean + idiomatic | Table-driven tests |
250
+ | `rust` | Rust + Axum | Clean + ownership | Built-in + proptest |
251
+ | `csharp-dotnet` | C# 12 + ASP.NET Core 8 | Clean + CQRS | xUnit, FluentAssertions |
252
+ | `flutter` | Dart 3 + Flutter | Clean + BLoC/Riverpod | flutter_test |
253
+ | `minimal` | Any | Basic quality rules | Optional |
254
+
255
+ **Auto-detection:** Corbat reads `pom.xml`, `package.json`, `go.mod`, `Cargo.toml`, `pubspec.yaml`, `*.csproj` to select the right profile.
256
+
257
+ ### Architecture Patterns Enforced
258
+
259
+ - **Hexagonal Architecture** — Ports & Adapters, infrastructure isolation
260
+ - **Domain-Driven Design** — Aggregates, Value Objects, Domain Events
261
+ - **SOLID Principles** — Single responsibility, dependency inversion
262
+ - **Clean Code** — Max 20 lines/method, meaningful names, no magic numbers
263
+ - **Error Handling** — Custom exceptions with context, no generic catches
264
+ - **Testing** — TDD workflow, unit + integration, mocking strategies
315
265
 
316
266
  ---
317
267
 
318
- ## How It Works
268
+ ## Customize
319
269
 
320
- ```
321
- ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
322
- │ Your Prompt │────▶│ Corbat MCP │────▶│ Claude + Rules │
323
- │ │ │ │ │ │
324
- │ "Create user │ │ 1. Detect stack │ │ Generates code │
325
- │ service" │ │ 2. Classify task│ │ that passes │
326
- │ │ │ 3. Load profile │ │ code review │
327
- │ │ │ 4. Inject rules │ │ │
328
- └─────────────────┘ └─────────────────┘ └─────────────────┘
329
- ```
270
+ ### Ready-to-use templates
330
271
 
331
- Corbat MCP acts as a **quality layer** between you and Claude. It automatically:
332
- 1. **Detects** your project's technology stack
333
- 2. **Classifies** the type of task (feature, bugfix, refactor, test)
334
- 3. **Loads** the appropriate profile with architecture rules
335
- 4. **Injects** guardrails before Claude generates any code
272
+ Copy a production-ready configuration for your stack:
336
273
 
337
- ---
274
+ **[Browse 14 templates](docs/templates.md)** — Java, Python, Node.js, React, Vue, Angular, Go, Kotlin, Rust, Flutter, and more.
338
275
 
339
- ## Customize (Optional)
276
+ ### Generate a custom profile
340
277
 
341
- ### Interactive Setup
342
278
  ```bash
343
279
  npx corbat-init
344
280
  ```
345
281
 
346
- ### Manual Config
282
+ Interactive wizard that auto-detects your stack and lets you configure architecture, DDD patterns, and quality metrics.
283
+
284
+ ### Manual config
347
285
 
348
286
  Create `.corbat.json` in your project root:
349
287
 
350
288
  ```json
351
289
  {
352
- "profile": "nodejs",
290
+ "profile": "java-spring-backend",
291
+ "architecture": {
292
+ "pattern": "hexagonal",
293
+ "layers": ["domain", "application", "infrastructure", "api"]
294
+ },
295
+ "ddd": {
296
+ "aggregates": true,
297
+ "valueObjects": true,
298
+ "domainEvents": true
299
+ },
300
+ "quality": {
301
+ "maxMethodLines": 20,
302
+ "maxClassLines": 200,
303
+ "minCoverage": 80
304
+ },
353
305
  "rules": {
354
- "always": [
355
- "Use TypeScript strict mode",
356
- "Prefer functional programming"
357
- ],
358
- "never": [
359
- "Use any type"
360
- ]
306
+ "always": ["Use records for DTOs", "Prefer Optional over null"],
307
+ "never": ["Use field injection", "Catch generic Exception"]
361
308
  }
362
309
  }
363
310
  ```
364
311
 
365
312
  ---
366
313
 
367
- ## Available Tools
368
-
369
- | Tool | Purpose |
370
- |------|---------|
371
- | `get_context` | **Primary** — Returns all standards for your task |
372
- | `validate` | Check code against standards (returns compliance score) |
373
- | `search` | Search 15 standards documents |
374
- | `profiles` | List all available profiles |
375
- | `health` | Server status and diagnostics |
376
-
377
- ---
378
-
379
- ## Compatibility
380
-
381
- | Client | Status |
382
- |--------|:------:|
383
- | Claude Code (CLI) | ✅ Tested |
384
- | Claude Desktop | ✅ Tested |
385
- | Cursor | ⚠️ Experimental |
386
- | Windsurf | ⚠️ Experimental |
387
- | Other MCP clients | ✅ Standard protocol |
388
-
389
- ---
390
-
391
- ## Included Documentation
392
-
393
- Corbat MCP comes with 15 searchable standards documents:
394
-
395
- - **Architecture:** Hexagonal, DDD, Clean Architecture
396
- - **Code Quality:** SOLID principles, Clean Code, Naming Conventions
397
- - **Testing:** TDD workflow, Unit/Integration/E2E guidelines
398
- - **DevOps:** Docker, Kubernetes, CI/CD best practices
399
- - **Observability:** Structured logging, Metrics, Distributed tracing
400
-
401
- Use the search tool: `"search kafka"` → Returns event-driven architecture guidelines.
402
-
403
- ---
404
-
405
- ## Troubleshooting
406
-
407
- <details>
408
- <summary><b>Claude can't find corbat</b></summary>
409
-
410
- 1. Verify npm/npx is in PATH: `which npx`
411
- 2. Test manually: `npx @corbat-tech/coding-standards-mcp`
412
- 3. Restart Claude completely
413
- 4. Check Claude's MCP logs
414
-
415
- </details>
416
-
417
- <details>
418
- <summary><b>Wrong stack detected</b></summary>
314
+ ## How It Works
419
315
 
420
- Override with `.corbat.json`:
421
- ```json
422
- { "profile": "nodejs" }
423
316
  ```
424
-
425
- Or specify in prompt: *"...using profile nodejs"*
426
-
427
- </details>
428
-
429
- <details>
430
- <summary><b>Standards not being applied</b></summary>
431
-
432
- 1. Check if `.corbat.json` exists in project root
433
- 2. Verify profile exists
434
- 3. Try explicit: *"Use corbat get_context for: your task"*
435
-
436
- </details>
317
+ Your Prompt ──▶ Corbat MCP ──▶ AI + Standards
318
+
319
+ ├─ 1. Detect stack (pom.xml, package.json...)
320
+ ├─ 2. Classify task (feature, bugfix, refactor)
321
+ ├─ 3. Load profile with architecture rules
322
+ └─ 4. Inject guardrails before code generation
323
+ ```
437
324
 
438
325
  ---
439
326
 
440
- ## Links
327
+ ## Documentation
441
328
 
442
- - [Full Documentation](docs/full-documentation.md)
443
- - [Benchmark Report](docs/comparison-tests/RESULTS-REPORT.md)
444
- - [Model Context Protocol](https://modelcontextprotocol.io/)
445
- - [Report Issues](https://github.com/corbat-tech/coding-standards-mcp/issues)
329
+ | Resource | Description |
330
+ |----------|-------------|
331
+ | [Setup Guide](docs/setup.md) | Installation for all 25+ tools |
332
+ | [Templates](docs/templates.md) | Ready-to-use `.corbat.json` configurations |
333
+ | [Compatibility](docs/compatibility.md) | Full list of supported tools |
334
+ | [Benchmark v2 Analysis](benchmarks/v2/ANALYSIS.md) | 10 scenarios with detailed comparison |
335
+ | [API Reference](docs/full-documentation.md) | Tools, prompts, and configuration |
446
336
 
447
337
  ---
448
338
 
449
339
  <div align="center">
450
340
 
451
- **Stop fixing AI-generated code. Start shipping it.**
341
+ **Stop fixing AI code. Start shipping it.**
342
+
343
+ | Without Corbat | With Corbat |
344
+ |:--------------:|:-----------:|
345
+ | 4.6/10 quality | **7.7/10 quality** |
346
+ | 3 custom errors | **18 custom errors** |
347
+ | 0% hexagonal | **100% hexagonal** |
452
348
 
453
- [Get Started](#quick-start-2-minutes) · [View Benchmarks](docs/comparison-tests/RESULTS-REPORT.md) · [Documentation](docs/full-documentation.md)
349
+ *Recommended by [corbat-tech](https://corbat.tech) We use Claude Code internally, but Corbat MCP works with any MCP-compatible tool.*
454
350
 
455
351
  </div>