@corbat-tech/coding-standards-mcp 1.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.
- package/LICENSE +21 -0
- package/README.md +371 -0
- package/assets/demo.gif +0 -0
- package/dist/agent.d.ts +53 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +629 -0
- package/dist/agent.js.map +1 -0
- package/dist/cli/init.d.ts +3 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +651 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/config.d.ts +73 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +105 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +73 -0
- package/dist/index.js.map +1 -0
- package/dist/profiles.d.ts +39 -0
- package/dist/profiles.d.ts.map +1 -0
- package/dist/profiles.js +526 -0
- package/dist/profiles.js.map +1 -0
- package/dist/prompts-legacy.d.ts +25 -0
- package/dist/prompts-legacy.d.ts.map +1 -0
- package/dist/prompts-legacy.js +600 -0
- package/dist/prompts-legacy.js.map +1 -0
- package/dist/prompts-v2.d.ts +30 -0
- package/dist/prompts-v2.d.ts.map +1 -0
- package/dist/prompts-v2.js +310 -0
- package/dist/prompts-v2.js.map +1 -0
- package/dist/prompts.d.ts +30 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +310 -0
- package/dist/prompts.js.map +1 -0
- package/dist/resources.d.ts +18 -0
- package/dist/resources.d.ts.map +1 -0
- package/dist/resources.js +95 -0
- package/dist/resources.js.map +1 -0
- package/dist/tools-legacy.d.ts +196 -0
- package/dist/tools-legacy.d.ts.map +1 -0
- package/dist/tools-legacy.js +1230 -0
- package/dist/tools-legacy.js.map +1 -0
- package/dist/tools-v2.d.ts +92 -0
- package/dist/tools-v2.d.ts.map +1 -0
- package/dist/tools-v2.js +410 -0
- package/dist/tools-v2.js.map +1 -0
- package/dist/tools.d.ts +92 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +410 -0
- package/dist/tools.js.map +1 -0
- package/dist/types.d.ts +3054 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +515 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +5 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/retry.d.ts +44 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/utils/retry.js +74 -0
- package/dist/utils/retry.js.map +1 -0
- package/package.json +79 -0
- package/profiles/README.md +199 -0
- package/profiles/custom/.gitkeep +2 -0
- package/profiles/templates/_template.yaml +159 -0
- package/profiles/templates/angular.yaml +494 -0
- package/profiles/templates/java-spring-backend.yaml +512 -0
- package/profiles/templates/minimal.yaml +102 -0
- package/profiles/templates/nodejs.yaml +338 -0
- package/profiles/templates/python.yaml +340 -0
- package/profiles/templates/react.yaml +331 -0
- package/profiles/templates/vue.yaml +598 -0
- package/standards/architecture/ddd.md +173 -0
- package/standards/architecture/hexagonal.md +97 -0
- package/standards/cicd/github-actions.md +567 -0
- package/standards/clean-code/naming.md +175 -0
- package/standards/clean-code/principles.md +179 -0
- package/standards/containerization/dockerfile.md +419 -0
- package/standards/database/selection-guide.md +443 -0
- package/standards/documentation/guidelines.md +189 -0
- package/standards/event-driven/domain-events.md +527 -0
- package/standards/kubernetes/deployment.md +518 -0
- package/standards/observability/guidelines.md +665 -0
- package/standards/project-setup/initialization-checklist.md +650 -0
- package/standards/spring-boot/best-practices.md +598 -0
- package/standards/testing/guidelines.md +559 -0
- package/standards/workflow/llm-development-workflow.md +542 -0
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
# ============================================================================
|
|
2
|
+
# CORBAT MCP - Default Profile
|
|
3
|
+
# ============================================================================
|
|
4
|
+
# Enterprise-grade coding standards for Spring Boot backend applications.
|
|
5
|
+
# Based on industry best practices: Hexagonal Architecture, DDD, CQRS, Clean Code.
|
|
6
|
+
# ============================================================================
|
|
7
|
+
|
|
8
|
+
name: "Corbat Default Standards"
|
|
9
|
+
description: "Complete enterprise backend standards with Hexagonal Architecture, DDD, CQRS, Event-Driven Design, and comprehensive testing"
|
|
10
|
+
|
|
11
|
+
# ----------------------------------------------------------------------------
|
|
12
|
+
# ARCHITECTURE
|
|
13
|
+
# ----------------------------------------------------------------------------
|
|
14
|
+
architecture:
|
|
15
|
+
type: hexagonal
|
|
16
|
+
enforceLayerDependencies: true
|
|
17
|
+
layers:
|
|
18
|
+
- name: domain
|
|
19
|
+
description: "Core business logic. Contains entities, value objects, aggregates, domain events, and repository interfaces. NO external dependencies."
|
|
20
|
+
allowedDependencies: []
|
|
21
|
+
packages:
|
|
22
|
+
- "*.domain"
|
|
23
|
+
- "*.domain.model"
|
|
24
|
+
- "*.domain.event"
|
|
25
|
+
- "*.domain.exception"
|
|
26
|
+
- "*.domain.port.in"
|
|
27
|
+
- "*.domain.port.out"
|
|
28
|
+
- "*.domain.service"
|
|
29
|
+
|
|
30
|
+
- name: application
|
|
31
|
+
description: "Use cases and application services. Orchestrates domain objects. Contains commands, queries, and handlers. Depends only on domain."
|
|
32
|
+
allowedDependencies:
|
|
33
|
+
- domain
|
|
34
|
+
packages:
|
|
35
|
+
- "*.application"
|
|
36
|
+
- "*.application.usecase"
|
|
37
|
+
- "*.application.command"
|
|
38
|
+
- "*.application.query"
|
|
39
|
+
- "*.application.handler"
|
|
40
|
+
|
|
41
|
+
- name: infrastructure
|
|
42
|
+
description: "External adapters: REST controllers, database repositories, messaging, external APIs. Implements domain interfaces."
|
|
43
|
+
allowedDependencies:
|
|
44
|
+
- domain
|
|
45
|
+
- application
|
|
46
|
+
packages:
|
|
47
|
+
- "*.infrastructure"
|
|
48
|
+
- "*.infrastructure.adapter.in.rest"
|
|
49
|
+
- "*.infrastructure.adapter.out.persistence"
|
|
50
|
+
- "*.infrastructure.adapter.out.messaging"
|
|
51
|
+
- "*.infrastructure.adapter.out.http"
|
|
52
|
+
- "*.infrastructure.config"
|
|
53
|
+
|
|
54
|
+
archUnit:
|
|
55
|
+
enabled: true
|
|
56
|
+
recommended: true # Recommended but not mandatory
|
|
57
|
+
rules:
|
|
58
|
+
- "Domain layer should not depend on application layer"
|
|
59
|
+
- "Domain layer should not depend on infrastructure layer"
|
|
60
|
+
- "Application layer should not depend on infrastructure layer"
|
|
61
|
+
- "Controllers should only use use cases, not repositories directly"
|
|
62
|
+
- "No Spring annotations in domain layer"
|
|
63
|
+
|
|
64
|
+
# ----------------------------------------------------------------------------
|
|
65
|
+
# DOMAIN-DRIVEN DESIGN
|
|
66
|
+
# ----------------------------------------------------------------------------
|
|
67
|
+
ddd:
|
|
68
|
+
enabled: true
|
|
69
|
+
ubiquitousLanguageEnforced: true
|
|
70
|
+
patterns:
|
|
71
|
+
aggregates: true
|
|
72
|
+
entities: true
|
|
73
|
+
valueObjects: true
|
|
74
|
+
domainEvents: true
|
|
75
|
+
repositories: true
|
|
76
|
+
domainServices: true
|
|
77
|
+
factories: true
|
|
78
|
+
specifications: false
|
|
79
|
+
|
|
80
|
+
valueObjectGuidelines:
|
|
81
|
+
useRecords: true
|
|
82
|
+
immutable: true
|
|
83
|
+
selfValidating: true
|
|
84
|
+
examples:
|
|
85
|
+
- "OrderId, CustomerId, ProductId (Identity Value Objects)"
|
|
86
|
+
- "Money, Email, PhoneNumber (Business Value Objects)"
|
|
87
|
+
- "Address, DateRange, Quantity (Composite Value Objects)"
|
|
88
|
+
|
|
89
|
+
aggregateGuidelines:
|
|
90
|
+
singleEntryPoint: true
|
|
91
|
+
protectInvariants: true
|
|
92
|
+
smallAggregates: true
|
|
93
|
+
referenceByIdentity: true
|
|
94
|
+
|
|
95
|
+
# ----------------------------------------------------------------------------
|
|
96
|
+
# CQRS (Command Query Responsibility Segregation)
|
|
97
|
+
# ----------------------------------------------------------------------------
|
|
98
|
+
cqrs:
|
|
99
|
+
enabled: true
|
|
100
|
+
separation: "logical" # logical | physical
|
|
101
|
+
patterns:
|
|
102
|
+
commands:
|
|
103
|
+
suffix: "Command"
|
|
104
|
+
handler: "CommandHandler"
|
|
105
|
+
examples:
|
|
106
|
+
- "CreateOrderCommand"
|
|
107
|
+
- "CancelOrderCommand"
|
|
108
|
+
- "UpdateCustomerCommand"
|
|
109
|
+
queries:
|
|
110
|
+
suffix: "Query"
|
|
111
|
+
handler: "QueryHandler"
|
|
112
|
+
examples:
|
|
113
|
+
- "GetOrderByIdQuery"
|
|
114
|
+
- "ListOrdersByCustomerQuery"
|
|
115
|
+
- "SearchProductsQuery"
|
|
116
|
+
|
|
117
|
+
# ----------------------------------------------------------------------------
|
|
118
|
+
# EVENT-DRIVEN ARCHITECTURE
|
|
119
|
+
# ----------------------------------------------------------------------------
|
|
120
|
+
eventDriven:
|
|
121
|
+
enabled: true
|
|
122
|
+
approach: "domain-events" # domain-events | event-sourcing
|
|
123
|
+
patterns:
|
|
124
|
+
domainEvents:
|
|
125
|
+
suffix: "Event"
|
|
126
|
+
pastTense: true
|
|
127
|
+
examples:
|
|
128
|
+
- "OrderCreatedEvent"
|
|
129
|
+
- "OrderShippedEvent"
|
|
130
|
+
- "PaymentReceivedEvent"
|
|
131
|
+
eventPublishing:
|
|
132
|
+
interface: "DomainEventPublisher"
|
|
133
|
+
async: true
|
|
134
|
+
messaging:
|
|
135
|
+
broker: "kafka" # kafka | rabbitmq | sqs
|
|
136
|
+
topicNaming: "domain.aggregate.event"
|
|
137
|
+
examples:
|
|
138
|
+
- "orders.order.created"
|
|
139
|
+
- "payments.payment.received"
|
|
140
|
+
|
|
141
|
+
# ----------------------------------------------------------------------------
|
|
142
|
+
# CODE QUALITY
|
|
143
|
+
# ----------------------------------------------------------------------------
|
|
144
|
+
codeQuality:
|
|
145
|
+
maxMethodLines: 20
|
|
146
|
+
maxClassLines: 200
|
|
147
|
+
maxFileLines: 400
|
|
148
|
+
maxMethodParameters: 4
|
|
149
|
+
maxCyclomaticComplexity: 10
|
|
150
|
+
requireDocumentation: true
|
|
151
|
+
requireTests: true
|
|
152
|
+
minimumTestCoverage: 80
|
|
153
|
+
|
|
154
|
+
principles:
|
|
155
|
+
- "SOLID principles"
|
|
156
|
+
- "DRY (Don't Repeat Yourself)"
|
|
157
|
+
- "KISS (Keep It Simple, Stupid)"
|
|
158
|
+
- "YAGNI (You Aren't Gonna Need It)"
|
|
159
|
+
- "Favor composition over inheritance"
|
|
160
|
+
- "Program to interfaces, not implementations"
|
|
161
|
+
|
|
162
|
+
# ----------------------------------------------------------------------------
|
|
163
|
+
# NAMING CONVENTIONS
|
|
164
|
+
# ----------------------------------------------------------------------------
|
|
165
|
+
naming:
|
|
166
|
+
general:
|
|
167
|
+
class: PascalCase
|
|
168
|
+
interface: PascalCase
|
|
169
|
+
method: camelCase
|
|
170
|
+
variable: camelCase
|
|
171
|
+
constant: SCREAMING_SNAKE_CASE
|
|
172
|
+
package: lowercase.dot.separated
|
|
173
|
+
enum: PascalCase
|
|
174
|
+
enumValue: SCREAMING_SNAKE_CASE
|
|
175
|
+
|
|
176
|
+
suffixes:
|
|
177
|
+
controller: "Controller"
|
|
178
|
+
service: "Service"
|
|
179
|
+
repository: "Repository"
|
|
180
|
+
useCase: "UseCase"
|
|
181
|
+
command: "Command"
|
|
182
|
+
query: "Query"
|
|
183
|
+
event: "Event"
|
|
184
|
+
handler: "Handler"
|
|
185
|
+
mapper: "Mapper"
|
|
186
|
+
dto: "Request|Response|Dto"
|
|
187
|
+
exception: "Exception"
|
|
188
|
+
config: "Config|Configuration"
|
|
189
|
+
properties: "Properties"
|
|
190
|
+
|
|
191
|
+
testing:
|
|
192
|
+
unitTest: "Test"
|
|
193
|
+
integrationTest: "IT"
|
|
194
|
+
e2eTest: "E2ETest"
|
|
195
|
+
testMethod: "should_ExpectedBehavior_When_Condition"
|
|
196
|
+
fixture: "Fixtures|TestBuilder|Mother"
|
|
197
|
+
|
|
198
|
+
# ----------------------------------------------------------------------------
|
|
199
|
+
# TESTING
|
|
200
|
+
# ----------------------------------------------------------------------------
|
|
201
|
+
testing:
|
|
202
|
+
framework: "JUnit5"
|
|
203
|
+
assertionLibrary: "AssertJ"
|
|
204
|
+
mockingLibrary: "Mockito"
|
|
205
|
+
|
|
206
|
+
types:
|
|
207
|
+
unit:
|
|
208
|
+
suffix: "Test"
|
|
209
|
+
location: "src/test/java"
|
|
210
|
+
coverage: 80
|
|
211
|
+
fastExecution: true
|
|
212
|
+
mavenPhase: "test"
|
|
213
|
+
|
|
214
|
+
integration:
|
|
215
|
+
suffix: "IT"
|
|
216
|
+
location: "src/test/java"
|
|
217
|
+
mavenPlugin: "maven-failsafe-plugin"
|
|
218
|
+
mavenPhase: "integration-test"
|
|
219
|
+
useTestcontainers: true
|
|
220
|
+
|
|
221
|
+
e2e:
|
|
222
|
+
suffix: "E2ETest"
|
|
223
|
+
location: "src/test/java"
|
|
224
|
+
|
|
225
|
+
architecture:
|
|
226
|
+
tool: "ArchUnit"
|
|
227
|
+
recommended: true
|
|
228
|
+
location: "src/test/java/**/architecture"
|
|
229
|
+
|
|
230
|
+
patterns:
|
|
231
|
+
arrange_act_assert: true
|
|
232
|
+
given_when_then: true
|
|
233
|
+
testDataBuilders: true
|
|
234
|
+
fixtures: true
|
|
235
|
+
|
|
236
|
+
testcontainers:
|
|
237
|
+
enabled: true
|
|
238
|
+
containers:
|
|
239
|
+
- "PostgreSQLContainer"
|
|
240
|
+
- "KafkaContainer"
|
|
241
|
+
- "LocalStackContainer"
|
|
242
|
+
- "WireMockContainer"
|
|
243
|
+
|
|
244
|
+
# ----------------------------------------------------------------------------
|
|
245
|
+
# HTTP CLIENTS
|
|
246
|
+
# ----------------------------------------------------------------------------
|
|
247
|
+
httpClients:
|
|
248
|
+
simple:
|
|
249
|
+
tool: "HttpInterface"
|
|
250
|
+
description: "Declarative HTTP client using Spring 6 HTTP Interface. Best for simple REST API calls."
|
|
251
|
+
useWhen:
|
|
252
|
+
- "Simple CRUD operations"
|
|
253
|
+
- "Standard REST endpoints"
|
|
254
|
+
- "No complex error handling needed"
|
|
255
|
+
example: |
|
|
256
|
+
@HttpExchange("/api/v1/users")
|
|
257
|
+
public interface UserClient {
|
|
258
|
+
@GetExchange("/{id}")
|
|
259
|
+
UserResponse getUser(@PathVariable String id);
|
|
260
|
+
|
|
261
|
+
@PostExchange
|
|
262
|
+
UserResponse createUser(@RequestBody CreateUserRequest request);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
complex:
|
|
266
|
+
tool: "RestClient"
|
|
267
|
+
description: "Fluent API for complex HTTP operations. Use when you need fine-grained control."
|
|
268
|
+
useWhen:
|
|
269
|
+
- "Custom error handling"
|
|
270
|
+
- "Dynamic headers or query params"
|
|
271
|
+
- "Complex request/response transformations"
|
|
272
|
+
- "Retry policies"
|
|
273
|
+
- "Circuit breaker integration"
|
|
274
|
+
example: |
|
|
275
|
+
@Component
|
|
276
|
+
@RequiredArgsConstructor
|
|
277
|
+
public class PaymentGatewayClient {
|
|
278
|
+
private final RestClient restClient;
|
|
279
|
+
|
|
280
|
+
public PaymentResponse processPayment(PaymentRequest request) {
|
|
281
|
+
return restClient.post()
|
|
282
|
+
.uri("/payments")
|
|
283
|
+
.header("X-Idempotency-Key", request.idempotencyKey())
|
|
284
|
+
.body(request)
|
|
285
|
+
.retrieve()
|
|
286
|
+
.onStatus(HttpStatusCode::is4xxClientError, this::handleClientError)
|
|
287
|
+
.body(PaymentResponse.class);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
# ----------------------------------------------------------------------------
|
|
292
|
+
# OBSERVABILITY
|
|
293
|
+
# ----------------------------------------------------------------------------
|
|
294
|
+
observability:
|
|
295
|
+
enabled: true
|
|
296
|
+
|
|
297
|
+
logging:
|
|
298
|
+
framework: "SLF4J + Logback"
|
|
299
|
+
format: "JSON"
|
|
300
|
+
structuredLogging: true
|
|
301
|
+
correlationId: true
|
|
302
|
+
mdc:
|
|
303
|
+
- "traceId"
|
|
304
|
+
- "spanId"
|
|
305
|
+
- "userId"
|
|
306
|
+
- "requestId"
|
|
307
|
+
levels:
|
|
308
|
+
production: "INFO"
|
|
309
|
+
development: "DEBUG"
|
|
310
|
+
avoid:
|
|
311
|
+
- "System.out.println"
|
|
312
|
+
- "printStackTrace"
|
|
313
|
+
- "Logging sensitive data"
|
|
314
|
+
|
|
315
|
+
metrics:
|
|
316
|
+
framework: "Micrometer"
|
|
317
|
+
registry: "prometheus"
|
|
318
|
+
customMetrics:
|
|
319
|
+
- type: "counter"
|
|
320
|
+
examples: ["orders.created", "payments.processed"]
|
|
321
|
+
- type: "gauge"
|
|
322
|
+
examples: ["orders.pending.count", "connections.active"]
|
|
323
|
+
- type: "timer"
|
|
324
|
+
examples: ["order.processing.time", "external.api.latency"]
|
|
325
|
+
naming: "snake_case with dots"
|
|
326
|
+
|
|
327
|
+
tracing:
|
|
328
|
+
framework: "Micrometer Tracing"
|
|
329
|
+
propagation: "W3C"
|
|
330
|
+
samplingRate: 1.0
|
|
331
|
+
exporters:
|
|
332
|
+
- "Jaeger"
|
|
333
|
+
- "Zipkin"
|
|
334
|
+
- "OTLP"
|
|
335
|
+
spanAttributes:
|
|
336
|
+
- "http.method"
|
|
337
|
+
- "http.url"
|
|
338
|
+
- "http.status_code"
|
|
339
|
+
- "db.operation"
|
|
340
|
+
- "messaging.destination"
|
|
341
|
+
|
|
342
|
+
healthChecks:
|
|
343
|
+
actuatorEndpoints:
|
|
344
|
+
- "/actuator/health"
|
|
345
|
+
- "/actuator/health/liveness"
|
|
346
|
+
- "/actuator/health/readiness"
|
|
347
|
+
- "/actuator/info"
|
|
348
|
+
- "/actuator/metrics"
|
|
349
|
+
- "/actuator/prometheus"
|
|
350
|
+
customHealthIndicators: true
|
|
351
|
+
examples:
|
|
352
|
+
- "DatabaseHealthIndicator"
|
|
353
|
+
- "KafkaHealthIndicator"
|
|
354
|
+
- "ExternalApiHealthIndicator"
|
|
355
|
+
|
|
356
|
+
# ----------------------------------------------------------------------------
|
|
357
|
+
# API DOCUMENTATION
|
|
358
|
+
# ----------------------------------------------------------------------------
|
|
359
|
+
apiDocumentation:
|
|
360
|
+
enabled: true
|
|
361
|
+
tool: "SpringDoc OpenAPI"
|
|
362
|
+
version: "3.0"
|
|
363
|
+
|
|
364
|
+
requirements:
|
|
365
|
+
- "All endpoints must be documented"
|
|
366
|
+
- "Request/Response examples required"
|
|
367
|
+
- "Error responses documented"
|
|
368
|
+
- "Authentication documented"
|
|
369
|
+
|
|
370
|
+
annotations:
|
|
371
|
+
operation: "@Operation"
|
|
372
|
+
parameter: "@Parameter"
|
|
373
|
+
schema: "@Schema"
|
|
374
|
+
response: "@ApiResponse"
|
|
375
|
+
|
|
376
|
+
output:
|
|
377
|
+
- "/api-docs"
|
|
378
|
+
- "/swagger-ui.html"
|
|
379
|
+
|
|
380
|
+
# ----------------------------------------------------------------------------
|
|
381
|
+
# SECURITY
|
|
382
|
+
# ----------------------------------------------------------------------------
|
|
383
|
+
security:
|
|
384
|
+
authentication:
|
|
385
|
+
method: "JWT"
|
|
386
|
+
storage: "HTTP-only Cookie or Authorization Header"
|
|
387
|
+
|
|
388
|
+
authorization:
|
|
389
|
+
framework: "Spring Security"
|
|
390
|
+
method: "Role-based (RBAC)"
|
|
391
|
+
|
|
392
|
+
practices:
|
|
393
|
+
- "Never store secrets in code"
|
|
394
|
+
- "Use environment variables or secret managers"
|
|
395
|
+
- "Enable HTTPS in production"
|
|
396
|
+
- "Validate and sanitize all input"
|
|
397
|
+
- "Use parameterized queries"
|
|
398
|
+
- "Implement proper CORS configuration"
|
|
399
|
+
- "Set security headers (CSP, X-Frame-Options, etc.)"
|
|
400
|
+
|
|
401
|
+
# ----------------------------------------------------------------------------
|
|
402
|
+
# ERROR HANDLING
|
|
403
|
+
# ----------------------------------------------------------------------------
|
|
404
|
+
errorHandling:
|
|
405
|
+
format: "RFC 7807 Problem Details"
|
|
406
|
+
globalHandler: "GlobalExceptionHandler"
|
|
407
|
+
|
|
408
|
+
structure:
|
|
409
|
+
- "type: URI identifying the problem type"
|
|
410
|
+
- "title: Short summary"
|
|
411
|
+
- "status: HTTP status code"
|
|
412
|
+
- "detail: Detailed explanation"
|
|
413
|
+
- "instance: URI of the specific occurrence"
|
|
414
|
+
|
|
415
|
+
customExceptions:
|
|
416
|
+
domain:
|
|
417
|
+
- "DomainException (base)"
|
|
418
|
+
- "EntityNotFoundException"
|
|
419
|
+
- "BusinessRuleViolationException"
|
|
420
|
+
- "InvalidOperationException"
|
|
421
|
+
application:
|
|
422
|
+
- "ValidationException"
|
|
423
|
+
- "UnauthorizedException"
|
|
424
|
+
|
|
425
|
+
# ----------------------------------------------------------------------------
|
|
426
|
+
# DATABASE
|
|
427
|
+
# ----------------------------------------------------------------------------
|
|
428
|
+
database:
|
|
429
|
+
migrations:
|
|
430
|
+
tool: "Flyway"
|
|
431
|
+
location: "db/migration"
|
|
432
|
+
naming: "V{version}__{description}.sql"
|
|
433
|
+
|
|
434
|
+
auditing:
|
|
435
|
+
enabled: true
|
|
436
|
+
fields:
|
|
437
|
+
- "createdAt"
|
|
438
|
+
- "createdBy"
|
|
439
|
+
- "updatedAt"
|
|
440
|
+
- "updatedBy"
|
|
441
|
+
|
|
442
|
+
mapping:
|
|
443
|
+
tool: "MapStruct"
|
|
444
|
+
nullHandling: "strict"
|
|
445
|
+
|
|
446
|
+
softDelete:
|
|
447
|
+
recommended: true
|
|
448
|
+
field: "deletedAt"
|
|
449
|
+
|
|
450
|
+
# ----------------------------------------------------------------------------
|
|
451
|
+
# OBJECT MAPPING
|
|
452
|
+
# ----------------------------------------------------------------------------
|
|
453
|
+
mapping:
|
|
454
|
+
tool: "MapStruct"
|
|
455
|
+
componentModel: "spring"
|
|
456
|
+
nullValueHandling: "RETURN_NULL"
|
|
457
|
+
|
|
458
|
+
patterns:
|
|
459
|
+
- "Domain to DTO"
|
|
460
|
+
- "DTO to Command"
|
|
461
|
+
- "Entity to Domain"
|
|
462
|
+
- "Domain to Entity"
|
|
463
|
+
|
|
464
|
+
example: |
|
|
465
|
+
@Mapper(componentModel = "spring")
|
|
466
|
+
public interface OrderMapper {
|
|
467
|
+
OrderResponse toResponse(Order order);
|
|
468
|
+
Order toDomain(OrderEntity entity);
|
|
469
|
+
OrderEntity toEntity(Order order);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
# ----------------------------------------------------------------------------
|
|
473
|
+
# TECHNOLOGIES
|
|
474
|
+
# ----------------------------------------------------------------------------
|
|
475
|
+
technologies:
|
|
476
|
+
- name: java
|
|
477
|
+
version: "21"
|
|
478
|
+
specificRules:
|
|
479
|
+
useRecordsForValueObjects: true
|
|
480
|
+
useRecordsForDTOs: true
|
|
481
|
+
useSealedClassesForAggregates: false
|
|
482
|
+
preferOptionalOverNull: true
|
|
483
|
+
useStreamApiForCollections: true
|
|
484
|
+
usePatternMatching: true
|
|
485
|
+
useTextBlocks: true
|
|
486
|
+
|
|
487
|
+
- name: spring-boot
|
|
488
|
+
version: "3.x"
|
|
489
|
+
specificRules:
|
|
490
|
+
useConstructorInjection: true
|
|
491
|
+
avoidFieldInjection: true
|
|
492
|
+
useProblemDetailsForErrors: true
|
|
493
|
+
useValidationAnnotations: true
|
|
494
|
+
separateConfigurationClasses: true
|
|
495
|
+
useConfigurationProperties: true
|
|
496
|
+
|
|
497
|
+
- name: build
|
|
498
|
+
tool: "Maven"
|
|
499
|
+
specificRules:
|
|
500
|
+
usePropertyVersions: true
|
|
501
|
+
separateProfiles: true
|
|
502
|
+
useFailsafeForIT: true
|
|
503
|
+
|
|
504
|
+
- name: testing
|
|
505
|
+
specificRules:
|
|
506
|
+
useJUnit5: true
|
|
507
|
+
useMockito: true
|
|
508
|
+
useAssertJ: true
|
|
509
|
+
useTestcontainers: true
|
|
510
|
+
useArchUnit: true
|
|
511
|
+
testNamingPattern: "should_ExpectedBehavior_When_Condition"
|
|
512
|
+
integrationTestSuffix: "IT"
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# ============================================================================
|
|
2
|
+
# CORBAT MCP - Minimal Profile
|
|
3
|
+
# ============================================================================
|
|
4
|
+
# Lightweight standards for small projects, MVPs, and prototypes.
|
|
5
|
+
# Use this when you want basic guidelines without enterprise complexity.
|
|
6
|
+
# ============================================================================
|
|
7
|
+
|
|
8
|
+
name: "Minimal Standards"
|
|
9
|
+
description: "Lightweight coding standards for small projects and MVPs. Focus on simplicity and speed over ceremony."
|
|
10
|
+
|
|
11
|
+
# ----------------------------------------------------------------------------
|
|
12
|
+
# ARCHITECTURE (Simple layered)
|
|
13
|
+
# ----------------------------------------------------------------------------
|
|
14
|
+
architecture:
|
|
15
|
+
type: layered
|
|
16
|
+
enforceLayerDependencies: false
|
|
17
|
+
layers:
|
|
18
|
+
- name: controllers
|
|
19
|
+
description: "HTTP handlers and request/response mapping"
|
|
20
|
+
allowedDependencies: [services]
|
|
21
|
+
|
|
22
|
+
- name: services
|
|
23
|
+
description: "Business logic"
|
|
24
|
+
allowedDependencies: [repositories]
|
|
25
|
+
|
|
26
|
+
- name: repositories
|
|
27
|
+
description: "Data access"
|
|
28
|
+
allowedDependencies: []
|
|
29
|
+
|
|
30
|
+
# ----------------------------------------------------------------------------
|
|
31
|
+
# CODE QUALITY (Relaxed)
|
|
32
|
+
# ----------------------------------------------------------------------------
|
|
33
|
+
codeQuality:
|
|
34
|
+
maxMethodLines: 40
|
|
35
|
+
maxClassLines: 400
|
|
36
|
+
maxFileLines: 600
|
|
37
|
+
maxMethodParameters: 5
|
|
38
|
+
maxCyclomaticComplexity: 15
|
|
39
|
+
requireDocumentation: false
|
|
40
|
+
requireTests: false
|
|
41
|
+
minimumTestCoverage: 50
|
|
42
|
+
|
|
43
|
+
principles:
|
|
44
|
+
- "KISS (Keep It Simple)"
|
|
45
|
+
- "DRY (Don't Repeat Yourself)"
|
|
46
|
+
- "Make it work, then make it right"
|
|
47
|
+
|
|
48
|
+
# ----------------------------------------------------------------------------
|
|
49
|
+
# NAMING CONVENTIONS
|
|
50
|
+
# ----------------------------------------------------------------------------
|
|
51
|
+
naming:
|
|
52
|
+
general:
|
|
53
|
+
class: PascalCase
|
|
54
|
+
interface: PascalCase
|
|
55
|
+
method: camelCase
|
|
56
|
+
variable: camelCase
|
|
57
|
+
constant: SCREAMING_SNAKE_CASE
|
|
58
|
+
file: kebab-case
|
|
59
|
+
|
|
60
|
+
suffixes:
|
|
61
|
+
controller: "Controller"
|
|
62
|
+
service: "Service"
|
|
63
|
+
repository: "Repository"
|
|
64
|
+
|
|
65
|
+
# ----------------------------------------------------------------------------
|
|
66
|
+
# TESTING (Basic)
|
|
67
|
+
# ----------------------------------------------------------------------------
|
|
68
|
+
testing:
|
|
69
|
+
framework: "Any"
|
|
70
|
+
types:
|
|
71
|
+
unit:
|
|
72
|
+
suffix: "Test"
|
|
73
|
+
coverage: 50
|
|
74
|
+
fastExecution: true
|
|
75
|
+
|
|
76
|
+
patterns:
|
|
77
|
+
arrange_act_assert: true
|
|
78
|
+
|
|
79
|
+
# ----------------------------------------------------------------------------
|
|
80
|
+
# ERROR HANDLING
|
|
81
|
+
# ----------------------------------------------------------------------------
|
|
82
|
+
errorHandling:
|
|
83
|
+
format: "Simple JSON"
|
|
84
|
+
structure:
|
|
85
|
+
- "message: Error description"
|
|
86
|
+
- "code: Error code (optional)"
|
|
87
|
+
|
|
88
|
+
# ----------------------------------------------------------------------------
|
|
89
|
+
# GUIDELINES
|
|
90
|
+
# ----------------------------------------------------------------------------
|
|
91
|
+
# When to use this profile:
|
|
92
|
+
# - MVPs and prototypes
|
|
93
|
+
# - Small personal projects
|
|
94
|
+
# - Learning projects
|
|
95
|
+
# - Hackathons
|
|
96
|
+
# - Scripts and utilities
|
|
97
|
+
#
|
|
98
|
+
# When to upgrade to a more complete profile:
|
|
99
|
+
# - Team grows beyond 2-3 developers
|
|
100
|
+
# - Project will be maintained long-term
|
|
101
|
+
# - Production deployment with real users
|
|
102
|
+
# - Complex domain logic emerges
|