@corbat-tech/coding-standards-mcp 1.0.3 → 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 (91) hide show
  1. package/README.md +153 -341
  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/errors.d.ts +58 -0
  7. package/dist/errors.d.ts.map +1 -0
  8. package/dist/errors.js +112 -0
  9. package/dist/errors.js.map +1 -0
  10. package/dist/guardrails.d.ts +35 -0
  11. package/dist/guardrails.d.ts.map +1 -0
  12. package/dist/guardrails.js +303 -0
  13. package/dist/guardrails.js.map +1 -0
  14. package/dist/index.js +1 -1
  15. package/dist/index.js.map +1 -1
  16. package/dist/logger.d.ts +36 -0
  17. package/dist/logger.d.ts.map +1 -0
  18. package/dist/logger.js +63 -0
  19. package/dist/logger.js.map +1 -0
  20. package/dist/metrics.d.ts +40 -0
  21. package/dist/metrics.d.ts.map +1 -0
  22. package/dist/metrics.js +97 -0
  23. package/dist/metrics.js.map +1 -0
  24. package/dist/profiles.d.ts +1 -1
  25. package/dist/profiles.d.ts.map +1 -1
  26. package/dist/profiles.js +239 -108
  27. package/dist/profiles.js.map +1 -1
  28. package/dist/prompts.js +1 -1
  29. package/dist/prompts.js.map +1 -1
  30. package/dist/tools/definitions.d.ts +104 -0
  31. package/dist/tools/definitions.d.ts.map +1 -0
  32. package/dist/tools/definitions.js +171 -0
  33. package/dist/tools/definitions.js.map +1 -0
  34. package/dist/tools/handlers/get-context.d.ts +12 -0
  35. package/dist/tools/handlers/get-context.d.ts.map +1 -0
  36. package/dist/tools/handlers/get-context.js +118 -0
  37. package/dist/tools/handlers/get-context.js.map +1 -0
  38. package/dist/tools/handlers/health.d.ts +11 -0
  39. package/dist/tools/handlers/health.d.ts.map +1 -0
  40. package/dist/tools/handlers/health.js +57 -0
  41. package/dist/tools/handlers/health.js.map +1 -0
  42. package/dist/tools/handlers/index.d.ts +11 -0
  43. package/dist/tools/handlers/index.d.ts.map +1 -0
  44. package/dist/tools/handlers/index.js +11 -0
  45. package/dist/tools/handlers/index.js.map +1 -0
  46. package/dist/tools/handlers/init.d.ts +12 -0
  47. package/dist/tools/handlers/init.d.ts.map +1 -0
  48. package/dist/tools/handlers/init.js +102 -0
  49. package/dist/tools/handlers/init.js.map +1 -0
  50. package/dist/tools/handlers/profiles.d.ts +11 -0
  51. package/dist/tools/handlers/profiles.d.ts.map +1 -0
  52. package/dist/tools/handlers/profiles.js +25 -0
  53. package/dist/tools/handlers/profiles.js.map +1 -0
  54. package/dist/tools/handlers/search.d.ts +12 -0
  55. package/dist/tools/handlers/search.d.ts.map +1 -0
  56. package/dist/tools/handlers/search.js +58 -0
  57. package/dist/tools/handlers/search.js.map +1 -0
  58. package/dist/tools/handlers/validate.d.ts +12 -0
  59. package/dist/tools/handlers/validate.d.ts.map +1 -0
  60. package/dist/tools/handlers/validate.js +76 -0
  61. package/dist/tools/handlers/validate.js.map +1 -0
  62. package/dist/tools/index.d.ts +22 -0
  63. package/dist/tools/index.d.ts.map +1 -0
  64. package/dist/tools/index.js +72 -0
  65. package/dist/tools/index.js.map +1 -0
  66. package/dist/tools/schemas.d.ts +29 -0
  67. package/dist/tools/schemas.d.ts.map +1 -0
  68. package/dist/tools/schemas.js +20 -0
  69. package/dist/tools/schemas.js.map +1 -0
  70. package/dist/tools.js +2 -2
  71. package/dist/tools.js.map +1 -1
  72. package/dist/types.d.ts +141 -71
  73. package/dist/types.d.ts.map +1 -1
  74. package/dist/types.js +92 -40
  75. package/dist/types.js.map +1 -1
  76. package/package.json +2 -2
  77. package/profiles/examples/microservice-kafka.yaml +122 -0
  78. package/profiles/examples/startup-fast.yaml +67 -0
  79. package/profiles/examples/strict-enterprise.yaml +62 -0
  80. package/profiles/templates/angular.yaml +614 -0
  81. package/profiles/templates/csharp-dotnet.yaml +529 -0
  82. package/profiles/templates/flutter.yaml +547 -0
  83. package/profiles/templates/go.yaml +1276 -0
  84. package/profiles/templates/java-spring-backend.yaml +326 -0
  85. package/profiles/templates/kotlin-spring.yaml +417 -0
  86. package/profiles/templates/nextjs.yaml +536 -0
  87. package/profiles/templates/nodejs.yaml +594 -0
  88. package/profiles/templates/python.yaml +546 -0
  89. package/profiles/templates/react.yaml +456 -0
  90. package/profiles/templates/rust.yaml +508 -0
  91. package/profiles/templates/vue.yaml +483 -0
package/README.md CHANGED
@@ -1,49 +1,107 @@
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
 
14
+ ---
15
+
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)
22
+
23
+ **Works with GitHub Copilot, Continue, Cline, Tabnine, Amazon Q, and [25+ more tools](docs/compatibility.md)**
24
+
15
25
  </div>
16
26
 
17
- <p align="center">
18
- <img src="assets/demo.gif" alt="CORBAT Demo" width="800">
19
- </p>
27
+ ---
28
+
29
+ ## The Problem
30
+
31
+ AI-generated code works, but rarely passes code review:
32
+
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 |
40
+
41
+ **Result:** Production-ready code that passes code review.
20
42
 
21
43
  ---
22
44
 
23
- ## The Real Problem With AI-Generated Code
45
+ ## Quick Start
24
46
 
25
- When you ask Claude to write code, it works. But does it pass code review?
47
+ **1. Add to your MCP config:**
26
48
 
49
+ ```json
50
+ {
51
+ "mcpServers": {
52
+ "corbat": {
53
+ "command": "npx",
54
+ "args": ["-y", "@corbat-tech/coding-standards-mcp"]
55
+ }
56
+ }
57
+ }
27
58
  ```
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
59
+
60
+ **2. Config file location:**
61
+
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` |
70
+
71
+ > [Complete setup guide](docs/setup.md) for all 25+ tools
72
+
73
+ **3. Done!** Corbat auto-detects your stack.
74
+
34
75
  ```
76
+ You: "Create a payment service"
35
77
 
36
- **You spend hours fixing AI-generated code to meet your team's 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
+ ```
37
83
 
38
84
  ---
39
85
 
40
- ## What If Claude Wrote Code Like Your Senior Engineers?
86
+ ## Benchmark Results
87
+
88
+ Tested across 20 real-world scenarios:
89
+
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 |
97
+
98
+ [View detailed benchmark report with code samples](docs/comparison-tests/RESULTS-REPORT.md)
99
+
100
+ ---
41
101
 
42
- <table>
43
- <tr>
44
- <td width="50%">
102
+ ## Code Comparison
45
103
 
46
- ### Without Corbat MCP
104
+ ### Before: Without Corbat MCP
47
105
 
48
106
  ```typescript
49
107
  class UserService {
@@ -59,18 +117,10 @@ class UserService {
59
117
  return user;
60
118
  }
61
119
  }
120
+ // Problems: returns undefined, no validation, no DI, no tests
62
121
  ```
63
122
 
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
123
+ ### After: With Corbat MCP
74
124
 
75
125
  ```typescript
76
126
  interface UserRepository {
@@ -101,355 +151,117 @@ class UserService {
101
151
  return user;
102
152
  }
103
153
  }
104
- ```
105
-
106
- - Dependency injection
107
- - Custom error types
108
- - Input validation & normalization
109
- - Repository pattern (ports & adapters)
110
- - 15 comprehensive tests
111
-
112
- </td>
113
- </tr>
114
- </table>
115
-
116
- ---
117
-
118
- ## Benchmark Results: The Numbers Don't Lie
119
-
120
- We tested Claude generating identical tasks **with and without** Corbat MCP across 20 scenarios.
121
-
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>
160
-
161
- > **Key finding:** Code generated with Corbat MCP passes SonarQube quality gates. Without it, code fails.
162
-
163
- [View Full Benchmark Report](docs/comparison-tests/RESULTS-REPORT.md)
164
-
165
- ---
166
-
167
- ## Why Corbat MCP vs Other Solutions?
168
-
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 |
175
-
176
- **Linters and analyzers catch problems after the fact. Corbat MCP prevents them.**
177
-
178
- ### vs Other Coding MCPs
179
-
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 |
187
-
188
- ---
189
-
190
- ## Quick Start (2 minutes)
191
-
192
- **Step 1** — Add to Claude:
193
-
194
- <table>
195
- <tr>
196
- <td><b>Claude Code</b></td>
197
- <td>
198
-
199
- ```bash
200
- claude mcp add corbat -- npx -y @corbat-tech/coding-standards-mcp
201
- ```
202
-
203
- </td>
204
- </tr>
205
- <tr>
206
- <td><b>Claude Desktop</b></td>
207
- <td>
208
-
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"]
216
- }
217
- }
218
- }
219
- ```
220
-
221
- </td>
222
- </tr>
223
- </table>
224
-
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.
238
-
239
- ---
240
-
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)
154
+ // ✓ Dependency injection ✓ Custom errors ✓ Validation ✓ 15 tests
264
155
  ```
265
156
 
266
157
  ---
267
158
 
268
- ## Smart Guardrails by Task Type
269
-
270
- Corbat MCP automatically detects what you're doing and applies different rules:
271
-
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 |
278
-
279
- ```
280
- You: "Fix the login timeout bug"
281
-
282
- Corbat detects: BUGFIX
283
- Applies: Failing test first Minimal fix Verify no regressions
284
- ```
285
-
286
- ---
287
-
288
- ## Built-in Profiles for Every Stack
289
-
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 |
299
-
300
- **Auto-detection:** Corbat reads `pom.xml`, `package.json`, `requirements.txt` to select the right profile automatically.
301
-
302
- ---
303
-
304
- ## ROI for Development Teams
305
-
306
- Based on our benchmark data:
307
-
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) |
159
+ ## Built-in Profiles
160
+
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
315
187
 
316
188
  ---
317
189
 
318
- ## How It Works
190
+ ## Customize
319
191
 
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
- ```
192
+ ### Ready-to-use templates
330
193
 
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
194
+ Copy a production-ready configuration for your stack:
336
195
 
337
- ---
196
+ **[Browse 14 templates](docs/templates.md)** — Java, Python, Node.js, React, Vue, Angular, Go, Kotlin, Rust, Flutter, and more.
338
197
 
339
- ## Customize (Optional)
198
+ ### Generate a custom profile
340
199
 
341
- ### Interactive Setup
342
200
  ```bash
343
201
  npx corbat-init
344
202
  ```
345
203
 
346
- ### Manual Config
204
+ Interactive wizard that auto-detects your stack and lets you configure architecture, DDD patterns, and quality metrics.
205
+
206
+ ### Manual config
347
207
 
348
208
  Create `.corbat.json` in your project root:
349
209
 
350
210
  ```json
351
211
  {
352
- "profile": "nodejs",
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
+ },
353
227
  "rules": {
354
- "always": [
355
- "Use TypeScript strict mode",
356
- "Prefer functional programming"
357
- ],
358
- "never": [
359
- "Use any type"
360
- ]
228
+ "always": ["Use records for DTOs", "Prefer Optional over null"],
229
+ "never": ["Use field injection", "Catch generic Exception"]
361
230
  }
362
231
  }
363
232
  ```
364
233
 
365
234
  ---
366
235
 
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>
236
+ ## How It Works
419
237
 
420
- Override with `.corbat.json`:
421
- ```json
422
- { "profile": "nodejs" }
423
238
  ```
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>
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
+ ```
437
246
 
438
247
  ---
439
248
 
440
- ## Links
249
+ ## Documentation
441
250
 
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)
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 |
446
258
 
447
259
  ---
448
260
 
449
261
  <div align="center">
450
262
 
451
- **Stop fixing AI-generated code. Start shipping it.**
263
+ **Stop fixing AI code. Start shipping it.**
452
264
 
453
- [Get Started](#quick-start-2-minutes) · [View Benchmarks](docs/comparison-tests/RESULTS-REPORT.md) · [Documentation](docs/full-documentation.md)
265
+ *Recommended by [corbat-tech](https://corbat.tech) We use Claude Code internally, but Corbat MCP works with any MCP-compatible tool.*
454
266
 
455
267
  </div>
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.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,aAAa,EAElB,KAAK,QAAQ,EACd,MAAM,YAAY,CAAC;AAgQpB;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAWzF;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CA6E1F;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,EAAE,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,GAAG,UAAU,CAalG;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,GAAG,MAAM,EAAE,CAkBlG;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,QAAQ,CAuF9D;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CACtC,MAAM,EACN;IACE,O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