@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,74 @@
|
|
|
1
|
+
import pRetry, { AbortError } from 'p-retry';
|
|
2
|
+
/**
|
|
3
|
+
* Default retry options.
|
|
4
|
+
*/
|
|
5
|
+
const DEFAULT_OPTIONS = {
|
|
6
|
+
maxAttempts: 3,
|
|
7
|
+
baseDelayMs: 100,
|
|
8
|
+
maxDelayMs: 5000,
|
|
9
|
+
verbose: false,
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Execute an async operation with exponential backoff retry.
|
|
13
|
+
*
|
|
14
|
+
* @param operation - The async function to execute
|
|
15
|
+
* @param options - Retry configuration options
|
|
16
|
+
* @returns The result of the operation
|
|
17
|
+
* @throws The last error if all retries fail
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const content = await withRetry(
|
|
22
|
+
* () => readFile(filePath, 'utf-8'),
|
|
23
|
+
* { maxAttempts: 3, baseDelayMs: 100 }
|
|
24
|
+
* );
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export async function withRetry(operation, options = {}) {
|
|
28
|
+
const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
29
|
+
const pRetryOptions = {
|
|
30
|
+
retries: opts.maxAttempts - 1,
|
|
31
|
+
minTimeout: opts.baseDelayMs,
|
|
32
|
+
maxTimeout: opts.maxDelayMs,
|
|
33
|
+
factor: 2,
|
|
34
|
+
onFailedAttempt: opts.verbose
|
|
35
|
+
? (error) => {
|
|
36
|
+
console.error(`Retry attempt ${error.attemptNumber}/${opts.maxAttempts} failed: ${error.message}`);
|
|
37
|
+
}
|
|
38
|
+
: undefined,
|
|
39
|
+
};
|
|
40
|
+
return pRetry(operation, pRetryOptions);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Check if an error is retryable (transient).
|
|
44
|
+
* File system errors like EBUSY, EAGAIN, ETIMEDOUT are retryable.
|
|
45
|
+
*/
|
|
46
|
+
export function isRetryableError(error) {
|
|
47
|
+
if (error instanceof Error) {
|
|
48
|
+
const nodeError = error;
|
|
49
|
+
const retryableCodes = ['EBUSY', 'EAGAIN', 'ETIMEDOUT', 'ECONNRESET', 'ENOTFOUND'];
|
|
50
|
+
return retryableCodes.includes(nodeError.code || '');
|
|
51
|
+
}
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Execute a file operation with retry only for transient errors.
|
|
56
|
+
*
|
|
57
|
+
* @param operation - The async file operation to execute
|
|
58
|
+
* @param options - Retry configuration options
|
|
59
|
+
* @returns The result of the operation
|
|
60
|
+
*/
|
|
61
|
+
export async function withFileRetry(operation, options = {}) {
|
|
62
|
+
return withRetry(async () => {
|
|
63
|
+
try {
|
|
64
|
+
return await operation();
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
if (!isRetryableError(error)) {
|
|
68
|
+
throw new AbortError(error instanceof Error ? error.message : String(error));
|
|
69
|
+
}
|
|
70
|
+
throw error;
|
|
71
|
+
}
|
|
72
|
+
}, options);
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=retry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../../src/utils/retry.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,UAAU,EAAiC,MAAM,SAAS,CAAC;AAgB5E;;GAEG;AACH,MAAM,eAAe,GAA2B;IAC9C,WAAW,EAAE,CAAC;IACd,WAAW,EAAE,GAAG;IAChB,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,KAAK;CACf,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAI,SAA2B,EAAE,UAAwB,EAAE;IACxF,MAAM,IAAI,GAAG,EAAE,GAAG,eAAe,EAAE,GAAG,OAAO,EAAE,CAAC;IAEhD,MAAM,aAAa,GAAkB;QACnC,OAAO,EAAE,IAAI,CAAC,WAAW,GAAG,CAAC;QAC7B,UAAU,EAAE,IAAI,CAAC,WAAW;QAC5B,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,MAAM,EAAE,CAAC;QACT,eAAe,EAAE,IAAI,CAAC,OAAO;YAC3B,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE;gBACR,OAAO,CAAC,KAAK,CAAC,iBAAiB,KAAK,CAAC,aAAa,IAAI,IAAI,CAAC,WAAW,YAAY,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACrG,CAAC;YACH,CAAC,CAAC,SAAS;KACd,CAAC;IAEF,OAAO,MAAM,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;AAC1C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,MAAM,SAAS,GAAG,KAA8B,CAAC;QACjD,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;QACnF,OAAO,cAAc,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAI,SAA2B,EAAE,UAAwB,EAAE;IAC5F,OAAO,SAAS,CAAC,KAAK,IAAI,EAAE;QAC1B,IAAI,CAAC;YACH,OAAO,MAAM,SAAS,EAAE,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC7B,MAAM,IAAI,UAAU,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAC/E,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,EAAE,OAAO,CAAC,CAAC;AACd,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@corbat-tech/coding-standards-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "AI coding standards that apply themselves - MCP server for Claude",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"corbat-mcp": "dist/index.js",
|
|
9
|
+
"corbat-init": "dist/cli/init.js"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/corbat-tech/corbat-mcp.git"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/corbat-tech/corbat-mcp#readme",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/corbat-tech/corbat-mcp/issues"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc",
|
|
21
|
+
"start": "node dist/index.js",
|
|
22
|
+
"init": "node dist/cli/init.js",
|
|
23
|
+
"dev": "node --import tsx src/index.ts",
|
|
24
|
+
"test": "vitest run",
|
|
25
|
+
"test:watch": "vitest",
|
|
26
|
+
"test:coverage": "vitest run --coverage",
|
|
27
|
+
"clean": "rm -rf dist",
|
|
28
|
+
"prepublishOnly": "npm run validate && npm run build",
|
|
29
|
+
"lint": "biome lint .",
|
|
30
|
+
"lint:fix": "biome lint --write .",
|
|
31
|
+
"format": "biome format --write .",
|
|
32
|
+
"format:check": "biome format .",
|
|
33
|
+
"check": "biome check .",
|
|
34
|
+
"check:fix": "biome check --write .",
|
|
35
|
+
"validate": "npm run check && npm run test",
|
|
36
|
+
"validate:arch": "depcruise src --config .dependency-cruiser.cjs"
|
|
37
|
+
},
|
|
38
|
+
"keywords": [
|
|
39
|
+
"mcp",
|
|
40
|
+
"model-context-protocol",
|
|
41
|
+
"claude",
|
|
42
|
+
"ai",
|
|
43
|
+
"coding-standards",
|
|
44
|
+
"best-practices",
|
|
45
|
+
"hexagonal-architecture",
|
|
46
|
+
"ddd",
|
|
47
|
+
"clean-code",
|
|
48
|
+
"tdd"
|
|
49
|
+
],
|
|
50
|
+
"author": "Corbat <info@corbat.tech> (https://corbat.tech)",
|
|
51
|
+
"license": "MIT",
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"access": "public"
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=18.0.0"
|
|
57
|
+
},
|
|
58
|
+
"files": [
|
|
59
|
+
"dist",
|
|
60
|
+
"profiles",
|
|
61
|
+
"standards",
|
|
62
|
+
"assets"
|
|
63
|
+
],
|
|
64
|
+
"dependencies": {
|
|
65
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
66
|
+
"p-retry": "^6.2.0",
|
|
67
|
+
"yaml": "^2.3.4",
|
|
68
|
+
"zod": "^3.22.4"
|
|
69
|
+
},
|
|
70
|
+
"devDependencies": {
|
|
71
|
+
"@biomejs/biome": "^1.9.4",
|
|
72
|
+
"@types/node": "^20.10.0",
|
|
73
|
+
"@vitest/coverage-v8": "^1.0.0",
|
|
74
|
+
"dependency-cruiser": "^16.5.0",
|
|
75
|
+
"tsx": "^4.6.0",
|
|
76
|
+
"typescript": "^5.3.0",
|
|
77
|
+
"vitest": "^1.0.0"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Corbat MCP Profiles
|
|
2
|
+
|
|
3
|
+
Los perfiles definen los estándares de código y mejores prácticas que el LLM aplicará durante el desarrollo.
|
|
4
|
+
|
|
5
|
+
## Estructura de Carpetas
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
profiles/
|
|
9
|
+
├── templates/ # Perfiles oficiales (NO editar)
|
|
10
|
+
│ ├── java-spring-backend.yaml # Java + Spring Boot enterprise
|
|
11
|
+
│ ├── nodejs.yaml # Node.js + TypeScript
|
|
12
|
+
│ ├── python.yaml # Python + FastAPI/Django
|
|
13
|
+
│ ├── react.yaml # React + TypeScript
|
|
14
|
+
│ ├── angular.yaml # Angular 19+ + TypeScript
|
|
15
|
+
│ ├── vue.yaml # Vue 3.5+ + TypeScript
|
|
16
|
+
│ ├── minimal.yaml # Configuración mínima
|
|
17
|
+
│ └── _template.yaml # Plantilla para crear nuevos perfiles
|
|
18
|
+
│
|
|
19
|
+
├── custom/ # TUS perfiles personalizados
|
|
20
|
+
│ └── (tus archivos .yaml)
|
|
21
|
+
│
|
|
22
|
+
└── README.md # Esta guía
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Uso Rápido
|
|
26
|
+
|
|
27
|
+
### 1. Usar un perfil existente
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# En tu cliente MCP, especifica el perfil:
|
|
31
|
+
get_coding_standards(profile: "java-spring-backend")
|
|
32
|
+
get_coding_standards(profile: "nodejs")
|
|
33
|
+
get_coding_standards(profile: "react")
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 2. Crear un perfil personalizado
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# 1. Copia la plantilla
|
|
40
|
+
cp profiles/templates/_template.yaml profiles/custom/mi-proyecto.yaml
|
|
41
|
+
|
|
42
|
+
# 2. Edita con tu configuración
|
|
43
|
+
code profiles/custom/mi-proyecto.yaml
|
|
44
|
+
|
|
45
|
+
# 3. Usa tu perfil
|
|
46
|
+
get_coding_standards(profile: "mi-proyecto")
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Perfiles Disponibles
|
|
50
|
+
|
|
51
|
+
| Perfil | Descripción | Stack |
|
|
52
|
+
|--------|-------------|-------|
|
|
53
|
+
| `java-spring-backend` | Enterprise backend con arquitectura hexagonal, DDD, CQRS | Java 21, Spring Boot 3.x |
|
|
54
|
+
| `nodejs` | Backend/fullstack con TypeScript | Node.js, TypeScript, Express/Nest |
|
|
55
|
+
| `python` | Backend con tipado estricto | Python 3.11+, FastAPI/Django |
|
|
56
|
+
| `react` | Aplicaciones React modernas | React 18+, TypeScript |
|
|
57
|
+
| `angular` | Aplicaciones Angular modernas con signals y zoneless | Angular 19+, TypeScript |
|
|
58
|
+
| `vue` | Aplicaciones Vue modernas con Composition API | Vue 3.5+, TypeScript |
|
|
59
|
+
| `minimal` | Configuración mínima para empezar | Cualquiera |
|
|
60
|
+
|
|
61
|
+
## Estructura de un Perfil
|
|
62
|
+
|
|
63
|
+
```yaml
|
|
64
|
+
# Metadatos
|
|
65
|
+
name: "Nombre del perfil"
|
|
66
|
+
description: "Descripción breve"
|
|
67
|
+
|
|
68
|
+
# Arquitectura
|
|
69
|
+
architecture:
|
|
70
|
+
type: hexagonal | clean | layered | onion
|
|
71
|
+
layers: [...]
|
|
72
|
+
|
|
73
|
+
# DDD (opcional)
|
|
74
|
+
ddd:
|
|
75
|
+
enabled: true
|
|
76
|
+
patterns: {...}
|
|
77
|
+
|
|
78
|
+
# Calidad de código
|
|
79
|
+
codeQuality:
|
|
80
|
+
maxMethodLines: 20
|
|
81
|
+
minimumTestCoverage: 80
|
|
82
|
+
|
|
83
|
+
# Convenciones de nombrado
|
|
84
|
+
naming:
|
|
85
|
+
general: {...}
|
|
86
|
+
suffixes: {...}
|
|
87
|
+
|
|
88
|
+
# Testing
|
|
89
|
+
testing:
|
|
90
|
+
framework: "JUnit5"
|
|
91
|
+
types: {...}
|
|
92
|
+
|
|
93
|
+
# Tecnologías específicas
|
|
94
|
+
technologies:
|
|
95
|
+
- name: java
|
|
96
|
+
version: "21"
|
|
97
|
+
specificRules: {...}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Secciones Disponibles
|
|
101
|
+
|
|
102
|
+
| Sección | Propósito |
|
|
103
|
+
|---------|-----------|
|
|
104
|
+
| `architecture` | Patrón arquitectónico y capas |
|
|
105
|
+
| `ddd` | Patrones Domain-Driven Design |
|
|
106
|
+
| `cqrs` | Command Query Responsibility Segregation |
|
|
107
|
+
| `eventDriven` | Arquitectura basada en eventos |
|
|
108
|
+
| `codeQuality` | Métricas y principios de calidad |
|
|
109
|
+
| `naming` | Convenciones de nombrado |
|
|
110
|
+
| `testing` | Frameworks y tipos de tests |
|
|
111
|
+
| `httpClients` | Clientes HTTP y APIs |
|
|
112
|
+
| `observability` | Logging, métricas, tracing |
|
|
113
|
+
| `security` | Autenticación, autorización |
|
|
114
|
+
| `errorHandling` | Manejo de errores |
|
|
115
|
+
| `database` | Migraciones, auditoría |
|
|
116
|
+
| `technologies` | Stack tecnológico específico |
|
|
117
|
+
|
|
118
|
+
## Ejemplos de Personalización
|
|
119
|
+
|
|
120
|
+
### Proyecto microservicio simple
|
|
121
|
+
|
|
122
|
+
```yaml
|
|
123
|
+
# profiles/custom/order-service.yaml
|
|
124
|
+
name: "Order Service"
|
|
125
|
+
description: "Microservicio de órdenes"
|
|
126
|
+
|
|
127
|
+
architecture:
|
|
128
|
+
type: hexagonal
|
|
129
|
+
enforceLayerDependencies: true
|
|
130
|
+
|
|
131
|
+
ddd:
|
|
132
|
+
enabled: true
|
|
133
|
+
patterns:
|
|
134
|
+
aggregates: true
|
|
135
|
+
domainEvents: true
|
|
136
|
+
|
|
137
|
+
codeQuality:
|
|
138
|
+
minimumTestCoverage: 85
|
|
139
|
+
|
|
140
|
+
technologies:
|
|
141
|
+
- name: java
|
|
142
|
+
version: "21"
|
|
143
|
+
- name: spring-boot
|
|
144
|
+
version: "3.2"
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Proyecto frontend React
|
|
148
|
+
|
|
149
|
+
```yaml
|
|
150
|
+
# profiles/custom/admin-dashboard.yaml
|
|
151
|
+
name: "Admin Dashboard"
|
|
152
|
+
description: "Panel de administración React"
|
|
153
|
+
|
|
154
|
+
architecture:
|
|
155
|
+
type: clean
|
|
156
|
+
layers:
|
|
157
|
+
- name: ui
|
|
158
|
+
description: "Componentes visuales"
|
|
159
|
+
packages: ["components/*"]
|
|
160
|
+
- name: features
|
|
161
|
+
description: "Lógica de features"
|
|
162
|
+
packages: ["features/*"]
|
|
163
|
+
- name: shared
|
|
164
|
+
description: "Código compartido"
|
|
165
|
+
packages: ["shared/*"]
|
|
166
|
+
|
|
167
|
+
codeQuality:
|
|
168
|
+
maxMethodLines: 30
|
|
169
|
+
minimumTestCoverage: 70
|
|
170
|
+
|
|
171
|
+
technologies:
|
|
172
|
+
- name: react
|
|
173
|
+
version: "18"
|
|
174
|
+
- name: typescript
|
|
175
|
+
version: "5"
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Tips
|
|
179
|
+
|
|
180
|
+
1. **Empieza con `minimal.yaml`** si no estás seguro de qué necesitas
|
|
181
|
+
2. **Copia `_template.yaml`** para crear perfiles desde cero
|
|
182
|
+
3. **No modifiques `templates/`** - usa `custom/` para tus cambios
|
|
183
|
+
4. **Solo incluye secciones que uses** - el resto usará defaults sensatos
|
|
184
|
+
5. **Un perfil por proyecto** es la recomendación para equipos
|
|
185
|
+
|
|
186
|
+
## Contribuir Perfiles
|
|
187
|
+
|
|
188
|
+
Si creas un perfil útil que podría beneficiar a otros:
|
|
189
|
+
|
|
190
|
+
1. Asegúrate de que sea genérico (no específico de tu empresa)
|
|
191
|
+
2. Documenta las decisiones de diseño
|
|
192
|
+
3. Abre un PR añadiéndolo a `templates/`
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
Para más información sobre el workflow de desarrollo, usa:
|
|
197
|
+
```
|
|
198
|
+
get_development_workflow()
|
|
199
|
+
```
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# ============================================================================
|
|
2
|
+
# CORBAT MCP - Profile Template
|
|
3
|
+
# ============================================================================
|
|
4
|
+
# Copy this file to profiles/custom/ and customize for your project.
|
|
5
|
+
#
|
|
6
|
+
# Usage:
|
|
7
|
+
# 1. cp profiles/templates/_template.yaml profiles/custom/my-project.yaml
|
|
8
|
+
# 2. Edit my-project.yaml with your project's standards
|
|
9
|
+
# 3. Use profile "my-project" in your MCP calls
|
|
10
|
+
#
|
|
11
|
+
# Tips:
|
|
12
|
+
# - Only include sections relevant to your project
|
|
13
|
+
# - Remove sections you don't need (they'll use sensible defaults)
|
|
14
|
+
# - See profiles/templates/ for complete examples
|
|
15
|
+
# ============================================================================
|
|
16
|
+
|
|
17
|
+
# REQUIRED: Name and description
|
|
18
|
+
name: "My Project Standards"
|
|
19
|
+
description: "Brief description of your project's coding standards"
|
|
20
|
+
|
|
21
|
+
# ----------------------------------------------------------------------------
|
|
22
|
+
# ARCHITECTURE (choose one type)
|
|
23
|
+
# ----------------------------------------------------------------------------
|
|
24
|
+
architecture:
|
|
25
|
+
# Options: hexagonal | clean | layered | onion | none
|
|
26
|
+
type: hexagonal
|
|
27
|
+
enforceLayerDependencies: true
|
|
28
|
+
|
|
29
|
+
# Define your layers (customize as needed)
|
|
30
|
+
layers:
|
|
31
|
+
- name: domain
|
|
32
|
+
description: "Core business logic"
|
|
33
|
+
allowedDependencies: []
|
|
34
|
+
packages:
|
|
35
|
+
- "*.domain"
|
|
36
|
+
|
|
37
|
+
- name: application
|
|
38
|
+
description: "Use cases and services"
|
|
39
|
+
allowedDependencies:
|
|
40
|
+
- domain
|
|
41
|
+
packages:
|
|
42
|
+
- "*.application"
|
|
43
|
+
|
|
44
|
+
- name: infrastructure
|
|
45
|
+
description: "External adapters"
|
|
46
|
+
allowedDependencies:
|
|
47
|
+
- domain
|
|
48
|
+
- application
|
|
49
|
+
packages:
|
|
50
|
+
- "*.infrastructure"
|
|
51
|
+
|
|
52
|
+
# ----------------------------------------------------------------------------
|
|
53
|
+
# DDD (optional - remove if not using DDD)
|
|
54
|
+
# ----------------------------------------------------------------------------
|
|
55
|
+
ddd:
|
|
56
|
+
enabled: true
|
|
57
|
+
ubiquitousLanguageEnforced: true
|
|
58
|
+
patterns:
|
|
59
|
+
aggregates: true
|
|
60
|
+
valueObjects: true
|
|
61
|
+
domainEvents: true
|
|
62
|
+
repositories: true
|
|
63
|
+
|
|
64
|
+
# ----------------------------------------------------------------------------
|
|
65
|
+
# CODE QUALITY
|
|
66
|
+
# ----------------------------------------------------------------------------
|
|
67
|
+
codeQuality:
|
|
68
|
+
maxMethodLines: 20
|
|
69
|
+
maxClassLines: 200
|
|
70
|
+
maxFileLines: 400
|
|
71
|
+
maxMethodParameters: 4
|
|
72
|
+
maxCyclomaticComplexity: 10
|
|
73
|
+
requireDocumentation: true
|
|
74
|
+
requireTests: true
|
|
75
|
+
minimumTestCoverage: 80
|
|
76
|
+
|
|
77
|
+
principles:
|
|
78
|
+
- "SOLID principles"
|
|
79
|
+
- "DRY (Don't Repeat Yourself)"
|
|
80
|
+
- "KISS (Keep It Simple)"
|
|
81
|
+
|
|
82
|
+
# ----------------------------------------------------------------------------
|
|
83
|
+
# NAMING CONVENTIONS
|
|
84
|
+
# ----------------------------------------------------------------------------
|
|
85
|
+
naming:
|
|
86
|
+
general:
|
|
87
|
+
class: PascalCase
|
|
88
|
+
method: camelCase
|
|
89
|
+
variable: camelCase
|
|
90
|
+
constant: SCREAMING_SNAKE_CASE
|
|
91
|
+
|
|
92
|
+
suffixes:
|
|
93
|
+
controller: "Controller"
|
|
94
|
+
service: "Service"
|
|
95
|
+
repository: "Repository"
|
|
96
|
+
|
|
97
|
+
testing:
|
|
98
|
+
unitTest: "Test"
|
|
99
|
+
integrationTest: "IT"
|
|
100
|
+
testMethod: "should_ExpectedBehavior_When_Condition"
|
|
101
|
+
|
|
102
|
+
# ----------------------------------------------------------------------------
|
|
103
|
+
# TESTING
|
|
104
|
+
# ----------------------------------------------------------------------------
|
|
105
|
+
testing:
|
|
106
|
+
framework: "JUnit5" # or: Jest, Pytest, Vitest, etc.
|
|
107
|
+
assertionLibrary: "AssertJ"
|
|
108
|
+
mockingLibrary: "Mockito"
|
|
109
|
+
|
|
110
|
+
types:
|
|
111
|
+
unit:
|
|
112
|
+
suffix: "Test"
|
|
113
|
+
coverage: 80
|
|
114
|
+
|
|
115
|
+
integration:
|
|
116
|
+
suffix: "IT"
|
|
117
|
+
useTestcontainers: true
|
|
118
|
+
|
|
119
|
+
# ----------------------------------------------------------------------------
|
|
120
|
+
# TECHNOLOGIES (list your stack)
|
|
121
|
+
# ----------------------------------------------------------------------------
|
|
122
|
+
technologies:
|
|
123
|
+
- name: java
|
|
124
|
+
version: "21"
|
|
125
|
+
specificRules:
|
|
126
|
+
useRecordsForValueObjects: true
|
|
127
|
+
|
|
128
|
+
- name: spring-boot
|
|
129
|
+
version: "3.x"
|
|
130
|
+
specificRules:
|
|
131
|
+
useConstructorInjection: true
|
|
132
|
+
|
|
133
|
+
# ============================================================================
|
|
134
|
+
# OPTIONAL SECTIONS (uncomment and customize as needed)
|
|
135
|
+
# ============================================================================
|
|
136
|
+
|
|
137
|
+
# cqrs:
|
|
138
|
+
# enabled: true
|
|
139
|
+
# separation: "logical"
|
|
140
|
+
|
|
141
|
+
# eventDriven:
|
|
142
|
+
# enabled: true
|
|
143
|
+
# approach: "domain-events"
|
|
144
|
+
|
|
145
|
+
# observability:
|
|
146
|
+
# enabled: true
|
|
147
|
+
# logging:
|
|
148
|
+
# framework: "SLF4J"
|
|
149
|
+
# format: "JSON"
|
|
150
|
+
|
|
151
|
+
# security:
|
|
152
|
+
# authentication:
|
|
153
|
+
# method: "JWT"
|
|
154
|
+
# authorization:
|
|
155
|
+
# method: "RBAC"
|
|
156
|
+
|
|
157
|
+
# database:
|
|
158
|
+
# migrations:
|
|
159
|
+
# tool: "Flyway"
|