@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
package/dist/agent.js
ADDED
|
@@ -0,0 +1,629 @@
|
|
|
1
|
+
import { access, readFile } from 'node:fs/promises';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { ProjectConfigSchema, } from './types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Default guardrails by task type.
|
|
6
|
+
*/
|
|
7
|
+
const DEFAULT_GUARDRAILS = {
|
|
8
|
+
feature: {
|
|
9
|
+
taskType: 'feature',
|
|
10
|
+
mandatory: [
|
|
11
|
+
'Follow TDD: write tests before implementation',
|
|
12
|
+
'Ensure 80%+ unit test coverage for new code',
|
|
13
|
+
'Apply SOLID principles',
|
|
14
|
+
'Follow project naming conventions',
|
|
15
|
+
'Document public APIs',
|
|
16
|
+
'Validate inputs at boundaries',
|
|
17
|
+
],
|
|
18
|
+
recommended: [
|
|
19
|
+
'Keep methods under 20 lines',
|
|
20
|
+
'Keep classes under 200 lines',
|
|
21
|
+
'Use dependency injection',
|
|
22
|
+
'Apply single responsibility principle',
|
|
23
|
+
'Write integration tests for critical paths',
|
|
24
|
+
],
|
|
25
|
+
avoid: [
|
|
26
|
+
'God classes or methods',
|
|
27
|
+
'Hard-coded configuration',
|
|
28
|
+
'Mixing business logic with infrastructure',
|
|
29
|
+
'Circular dependencies',
|
|
30
|
+
'Over-engineering for hypothetical futures',
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
bugfix: {
|
|
34
|
+
taskType: 'bugfix',
|
|
35
|
+
mandatory: [
|
|
36
|
+
'First write a failing test that reproduces the bug',
|
|
37
|
+
'Make the minimum change necessary to fix',
|
|
38
|
+
'Verify fix does not break existing tests',
|
|
39
|
+
'Document root cause in commit message',
|
|
40
|
+
],
|
|
41
|
+
recommended: [
|
|
42
|
+
'Add regression test if not already covered',
|
|
43
|
+
'Consider if bug exists elsewhere (same pattern)',
|
|
44
|
+
'Update documentation if behavior changed',
|
|
45
|
+
],
|
|
46
|
+
avoid: [
|
|
47
|
+
'Refactoring unrelated code',
|
|
48
|
+
'Adding features while fixing bugs',
|
|
49
|
+
'Changing APIs without necessity',
|
|
50
|
+
'Fixing symptoms instead of root cause',
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
refactor: {
|
|
54
|
+
taskType: 'refactor',
|
|
55
|
+
mandatory: [
|
|
56
|
+
'All existing tests must pass before AND after',
|
|
57
|
+
'No behavior changes (only structure)',
|
|
58
|
+
'Commit in small, reviewable increments',
|
|
59
|
+
'Extract one concept at a time',
|
|
60
|
+
],
|
|
61
|
+
recommended: [
|
|
62
|
+
'Increase test coverage if below threshold',
|
|
63
|
+
'Apply design patterns where appropriate',
|
|
64
|
+
'Improve naming and readability',
|
|
65
|
+
'Remove dead code',
|
|
66
|
+
],
|
|
67
|
+
avoid: [
|
|
68
|
+
'Changing behavior during refactor',
|
|
69
|
+
'Big bang refactoring',
|
|
70
|
+
'Refactoring without tests',
|
|
71
|
+
'Premature abstraction',
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
test: {
|
|
75
|
+
taskType: 'test',
|
|
76
|
+
mandatory: [
|
|
77
|
+
'Follow Arrange-Act-Assert pattern',
|
|
78
|
+
'One logical assertion per test',
|
|
79
|
+
'Test names describe behavior (should_X_when_Y)',
|
|
80
|
+
'Tests must be independent and repeatable',
|
|
81
|
+
],
|
|
82
|
+
recommended: [
|
|
83
|
+
'Use test fixtures for complex setup',
|
|
84
|
+
'Mock external dependencies',
|
|
85
|
+
'Test edge cases and error conditions',
|
|
86
|
+
'Use parameterized tests for variations',
|
|
87
|
+
],
|
|
88
|
+
avoid: [
|
|
89
|
+
'Testing implementation details',
|
|
90
|
+
'Flaky tests',
|
|
91
|
+
'Tests that depend on order',
|
|
92
|
+
'Assertions without clear purpose',
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
documentation: {
|
|
96
|
+
taskType: 'documentation',
|
|
97
|
+
mandatory: [
|
|
98
|
+
'Use clear, concise language',
|
|
99
|
+
'Include code examples where applicable',
|
|
100
|
+
'Keep documentation close to code',
|
|
101
|
+
'Document the WHY, not just the WHAT',
|
|
102
|
+
],
|
|
103
|
+
recommended: [
|
|
104
|
+
'Use consistent formatting',
|
|
105
|
+
'Include diagrams for complex flows',
|
|
106
|
+
'Document assumptions and constraints',
|
|
107
|
+
'Keep README updated',
|
|
108
|
+
],
|
|
109
|
+
avoid: [
|
|
110
|
+
'Outdated documentation',
|
|
111
|
+
'Duplicating code in comments',
|
|
112
|
+
'Over-documenting obvious code',
|
|
113
|
+
'Documentation without context',
|
|
114
|
+
],
|
|
115
|
+
},
|
|
116
|
+
performance: {
|
|
117
|
+
taskType: 'performance',
|
|
118
|
+
mandatory: [
|
|
119
|
+
'Measure before optimizing (baseline metrics)',
|
|
120
|
+
'Profile to identify actual bottlenecks',
|
|
121
|
+
'Document performance requirements',
|
|
122
|
+
'Add performance tests/benchmarks',
|
|
123
|
+
],
|
|
124
|
+
recommended: [
|
|
125
|
+
'Consider caching strategies',
|
|
126
|
+
'Optimize database queries',
|
|
127
|
+
'Use async/non-blocking where appropriate',
|
|
128
|
+
'Consider lazy loading',
|
|
129
|
+
],
|
|
130
|
+
avoid: [
|
|
131
|
+
'Premature optimization',
|
|
132
|
+
'Optimizing without measurements',
|
|
133
|
+
'Sacrificing readability without significant gain',
|
|
134
|
+
'Micro-optimizations in non-critical paths',
|
|
135
|
+
],
|
|
136
|
+
},
|
|
137
|
+
security: {
|
|
138
|
+
taskType: 'security',
|
|
139
|
+
mandatory: [
|
|
140
|
+
'Validate ALL user inputs',
|
|
141
|
+
'Use parameterized queries (prevent SQL injection)',
|
|
142
|
+
'Escape output (prevent XSS)',
|
|
143
|
+
'Apply principle of least privilege',
|
|
144
|
+
'Never log sensitive data',
|
|
145
|
+
],
|
|
146
|
+
recommended: [
|
|
147
|
+
'Use established security libraries',
|
|
148
|
+
'Implement rate limiting',
|
|
149
|
+
'Add security headers',
|
|
150
|
+
'Use HTTPS everywhere',
|
|
151
|
+
'Implement proper authentication/authorization',
|
|
152
|
+
],
|
|
153
|
+
avoid: [
|
|
154
|
+
'Rolling your own crypto',
|
|
155
|
+
'Hardcoded secrets',
|
|
156
|
+
'Trusting client-side validation alone',
|
|
157
|
+
'Exposing stack traces to users',
|
|
158
|
+
'Using deprecated crypto algorithms',
|
|
159
|
+
],
|
|
160
|
+
},
|
|
161
|
+
infrastructure: {
|
|
162
|
+
taskType: 'infrastructure',
|
|
163
|
+
mandatory: [
|
|
164
|
+
'Infrastructure as Code (no manual changes)',
|
|
165
|
+
'Version control all configurations',
|
|
166
|
+
'Test in staging before production',
|
|
167
|
+
'Document deployment procedures',
|
|
168
|
+
],
|
|
169
|
+
recommended: [
|
|
170
|
+
'Use immutable infrastructure',
|
|
171
|
+
'Implement health checks',
|
|
172
|
+
'Set up proper monitoring/alerting',
|
|
173
|
+
'Plan for rollback',
|
|
174
|
+
],
|
|
175
|
+
avoid: [
|
|
176
|
+
'Manual server configuration',
|
|
177
|
+
'Snowflake servers',
|
|
178
|
+
'Deploying directly to production',
|
|
179
|
+
'Ignoring resource limits',
|
|
180
|
+
],
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
const STACK_PATTERNS = [
|
|
184
|
+
// Java Spring
|
|
185
|
+
{
|
|
186
|
+
files: ['pom.xml', 'build.gradle', 'build.gradle.kts'],
|
|
187
|
+
language: 'Java',
|
|
188
|
+
framework: 'Spring Boot',
|
|
189
|
+
buildTool: 'Maven/Gradle',
|
|
190
|
+
testFramework: 'JUnit5',
|
|
191
|
+
profile: 'java-spring-backend',
|
|
192
|
+
confidence: 'high',
|
|
193
|
+
},
|
|
194
|
+
// Angular (must come before generic Node.js)
|
|
195
|
+
{
|
|
196
|
+
files: ['angular.json'],
|
|
197
|
+
language: 'TypeScript',
|
|
198
|
+
framework: 'Angular',
|
|
199
|
+
buildTool: 'Angular CLI',
|
|
200
|
+
testFramework: 'Jest/Vitest',
|
|
201
|
+
profile: 'angular',
|
|
202
|
+
confidence: 'high',
|
|
203
|
+
},
|
|
204
|
+
// Node.js/TypeScript
|
|
205
|
+
{
|
|
206
|
+
files: ['package.json', 'tsconfig.json'],
|
|
207
|
+
language: 'TypeScript',
|
|
208
|
+
framework: 'Node.js',
|
|
209
|
+
buildTool: 'npm/pnpm',
|
|
210
|
+
testFramework: 'Vitest/Jest',
|
|
211
|
+
profile: 'nodejs',
|
|
212
|
+
confidence: 'high',
|
|
213
|
+
},
|
|
214
|
+
// Python
|
|
215
|
+
{
|
|
216
|
+
files: ['pyproject.toml', 'requirements.txt', 'setup.py'],
|
|
217
|
+
language: 'Python',
|
|
218
|
+
framework: 'FastAPI/Django',
|
|
219
|
+
buildTool: 'pip/poetry',
|
|
220
|
+
testFramework: 'pytest',
|
|
221
|
+
profile: 'python',
|
|
222
|
+
confidence: 'high',
|
|
223
|
+
},
|
|
224
|
+
// React (Vite)
|
|
225
|
+
{
|
|
226
|
+
files: ['package.json', 'vite.config.ts', 'vite.config.js'],
|
|
227
|
+
language: 'TypeScript',
|
|
228
|
+
framework: 'React',
|
|
229
|
+
buildTool: 'Vite',
|
|
230
|
+
testFramework: 'Vitest',
|
|
231
|
+
profile: 'react',
|
|
232
|
+
confidence: 'medium',
|
|
233
|
+
},
|
|
234
|
+
// Generic JavaScript
|
|
235
|
+
{
|
|
236
|
+
files: ['package.json'],
|
|
237
|
+
language: 'JavaScript',
|
|
238
|
+
buildTool: 'npm',
|
|
239
|
+
profile: 'nodejs',
|
|
240
|
+
confidence: 'low',
|
|
241
|
+
},
|
|
242
|
+
];
|
|
243
|
+
/**
|
|
244
|
+
* Load project configuration from .corbat.json
|
|
245
|
+
*/
|
|
246
|
+
export async function loadProjectConfig(projectDir) {
|
|
247
|
+
const configPath = join(projectDir, '.corbat.json');
|
|
248
|
+
try {
|
|
249
|
+
await access(configPath);
|
|
250
|
+
const content = await readFile(configPath, 'utf-8');
|
|
251
|
+
const rawConfig = JSON.parse(content);
|
|
252
|
+
return ProjectConfigSchema.parse(rawConfig);
|
|
253
|
+
}
|
|
254
|
+
catch {
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Detect project stack from file system.
|
|
260
|
+
*/
|
|
261
|
+
export async function detectProjectStack(projectDir) {
|
|
262
|
+
const detectedFiles = [];
|
|
263
|
+
for (const pattern of STACK_PATTERNS) {
|
|
264
|
+
for (const file of pattern.files) {
|
|
265
|
+
const filePath = join(projectDir, file);
|
|
266
|
+
try {
|
|
267
|
+
await access(filePath);
|
|
268
|
+
detectedFiles.push(file);
|
|
269
|
+
}
|
|
270
|
+
catch {
|
|
271
|
+
// File doesn't exist, continue
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
if (detectedFiles.length > 0) {
|
|
275
|
+
// Additional detection for more specific frameworks
|
|
276
|
+
let framework = pattern.framework;
|
|
277
|
+
let testFramework = pattern.testFramework;
|
|
278
|
+
let suggestedProfile = pattern.profile;
|
|
279
|
+
// Check for specific framework indicators
|
|
280
|
+
if (detectedFiles.includes('package.json')) {
|
|
281
|
+
try {
|
|
282
|
+
const packageJson = JSON.parse(await readFile(join(projectDir, 'package.json'), 'utf-8'));
|
|
283
|
+
const deps = { ...packageJson.dependencies, ...packageJson.devDependencies };
|
|
284
|
+
// Frontend frameworks (set profile accordingly)
|
|
285
|
+
if (deps.react) {
|
|
286
|
+
framework = 'React';
|
|
287
|
+
suggestedProfile = 'react';
|
|
288
|
+
}
|
|
289
|
+
else if (deps.vue) {
|
|
290
|
+
framework = 'Vue';
|
|
291
|
+
suggestedProfile = 'vue';
|
|
292
|
+
}
|
|
293
|
+
else if (deps['@angular/core']) {
|
|
294
|
+
framework = 'Angular';
|
|
295
|
+
suggestedProfile = 'angular';
|
|
296
|
+
}
|
|
297
|
+
else if (deps.express) {
|
|
298
|
+
framework = 'Express';
|
|
299
|
+
}
|
|
300
|
+
else if (deps.fastify) {
|
|
301
|
+
framework = 'Fastify';
|
|
302
|
+
}
|
|
303
|
+
else if (deps.nestjs || deps['@nestjs/core']) {
|
|
304
|
+
framework = 'NestJS';
|
|
305
|
+
}
|
|
306
|
+
if (deps.vitest)
|
|
307
|
+
testFramework = 'Vitest';
|
|
308
|
+
else if (deps.jest)
|
|
309
|
+
testFramework = 'Jest';
|
|
310
|
+
else if (deps.mocha)
|
|
311
|
+
testFramework = 'Mocha';
|
|
312
|
+
}
|
|
313
|
+
catch {
|
|
314
|
+
// Unable to parse package.json
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
// Check for Spring Boot specific indicators
|
|
318
|
+
if (detectedFiles.includes('pom.xml')) {
|
|
319
|
+
try {
|
|
320
|
+
const pomContent = await readFile(join(projectDir, 'pom.xml'), 'utf-8');
|
|
321
|
+
if (pomContent.includes('spring-boot')) {
|
|
322
|
+
framework = 'Spring Boot';
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
catch {
|
|
326
|
+
// Unable to read pom.xml
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
return {
|
|
330
|
+
language: pattern.language,
|
|
331
|
+
framework,
|
|
332
|
+
buildTool: pattern.buildTool,
|
|
333
|
+
testFramework,
|
|
334
|
+
suggestedProfile,
|
|
335
|
+
confidence: pattern.confidence,
|
|
336
|
+
detectedFiles,
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
return null;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Get guardrails for a specific task type.
|
|
344
|
+
*/
|
|
345
|
+
export function getGuardrails(taskType, projectConfig) {
|
|
346
|
+
// Start with defaults
|
|
347
|
+
const guardrails = { ...DEFAULT_GUARDRAILS[taskType] };
|
|
348
|
+
// Override with project-specific guardrails if available
|
|
349
|
+
if (projectConfig?.guardrails?.[taskType]) {
|
|
350
|
+
const projectGuardrails = projectConfig.guardrails[taskType];
|
|
351
|
+
guardrails.mandatory = [...guardrails.mandatory, ...projectGuardrails.mandatory];
|
|
352
|
+
guardrails.recommended = [...guardrails.recommended, ...projectGuardrails.recommended];
|
|
353
|
+
guardrails.avoid = [...guardrails.avoid, ...projectGuardrails.avoid];
|
|
354
|
+
}
|
|
355
|
+
return guardrails;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Get project rules (always rules + task-specific rules).
|
|
359
|
+
*/
|
|
360
|
+
export function getProjectRules(taskType, projectConfig) {
|
|
361
|
+
if (!projectConfig?.rules)
|
|
362
|
+
return [];
|
|
363
|
+
const rules = [...(projectConfig.rules.always || [])];
|
|
364
|
+
switch (taskType) {
|
|
365
|
+
case 'feature':
|
|
366
|
+
rules.push(...(projectConfig.rules.onNewFile || []));
|
|
367
|
+
break;
|
|
368
|
+
case 'test':
|
|
369
|
+
rules.push(...(projectConfig.rules.onTest || []));
|
|
370
|
+
break;
|
|
371
|
+
case 'refactor':
|
|
372
|
+
rules.push(...(projectConfig.rules.onRefactor || []));
|
|
373
|
+
break;
|
|
374
|
+
}
|
|
375
|
+
return rules;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Classify task type from description.
|
|
379
|
+
*/
|
|
380
|
+
export function classifyTaskType(description) {
|
|
381
|
+
const desc = description.toLowerCase();
|
|
382
|
+
// Bug/fix patterns
|
|
383
|
+
if (desc.includes('fix') ||
|
|
384
|
+
desc.includes('bug') ||
|
|
385
|
+
desc.includes('error') ||
|
|
386
|
+
desc.includes('issue') ||
|
|
387
|
+
desc.includes('problem') ||
|
|
388
|
+
desc.includes('broken')) {
|
|
389
|
+
return 'bugfix';
|
|
390
|
+
}
|
|
391
|
+
// Refactor patterns
|
|
392
|
+
if (desc.includes('refactor') ||
|
|
393
|
+
desc.includes('cleanup') ||
|
|
394
|
+
desc.includes('clean up') ||
|
|
395
|
+
desc.includes('reorganize') ||
|
|
396
|
+
desc.includes('restructure') ||
|
|
397
|
+
desc.includes('improve structure')) {
|
|
398
|
+
return 'refactor';
|
|
399
|
+
}
|
|
400
|
+
// Test patterns
|
|
401
|
+
if (desc.includes('test') ||
|
|
402
|
+
desc.includes('spec') ||
|
|
403
|
+
desc.includes('coverage') ||
|
|
404
|
+
desc.includes('unit test') ||
|
|
405
|
+
desc.includes('integration test')) {
|
|
406
|
+
return 'test';
|
|
407
|
+
}
|
|
408
|
+
// Documentation patterns
|
|
409
|
+
if (desc.includes('document') ||
|
|
410
|
+
desc.includes('readme') ||
|
|
411
|
+
desc.includes('comment') ||
|
|
412
|
+
desc.includes('jsdoc') ||
|
|
413
|
+
desc.includes('javadoc')) {
|
|
414
|
+
return 'documentation';
|
|
415
|
+
}
|
|
416
|
+
// Performance patterns
|
|
417
|
+
if (desc.includes('performance') ||
|
|
418
|
+
desc.includes('optimize') ||
|
|
419
|
+
desc.includes('speed') ||
|
|
420
|
+
desc.includes('slow') ||
|
|
421
|
+
desc.includes('memory') ||
|
|
422
|
+
desc.includes('cache')) {
|
|
423
|
+
return 'performance';
|
|
424
|
+
}
|
|
425
|
+
// Security patterns
|
|
426
|
+
if (desc.includes('security') ||
|
|
427
|
+
desc.includes('auth') ||
|
|
428
|
+
desc.includes('permission') ||
|
|
429
|
+
desc.includes('vulnerability') ||
|
|
430
|
+
desc.includes('secure') ||
|
|
431
|
+
desc.includes('encrypt')) {
|
|
432
|
+
return 'security';
|
|
433
|
+
}
|
|
434
|
+
// Infrastructure patterns
|
|
435
|
+
if (desc.includes('deploy') ||
|
|
436
|
+
desc.includes('docker') ||
|
|
437
|
+
desc.includes('kubernetes') ||
|
|
438
|
+
desc.includes('ci/cd') ||
|
|
439
|
+
desc.includes('pipeline') ||
|
|
440
|
+
desc.includes('infrastructure')) {
|
|
441
|
+
return 'infrastructure';
|
|
442
|
+
}
|
|
443
|
+
// Default to feature
|
|
444
|
+
return 'feature';
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Technical decision templates by category.
|
|
448
|
+
*/
|
|
449
|
+
export const TECHNICAL_DECISIONS = {
|
|
450
|
+
database: {
|
|
451
|
+
options: [
|
|
452
|
+
{
|
|
453
|
+
name: 'PostgreSQL',
|
|
454
|
+
description: 'Advanced open-source relational database',
|
|
455
|
+
pros: ['ACID compliant', 'Rich feature set', 'Excellent JSON support', 'Strong community'],
|
|
456
|
+
cons: ['More complex setup', 'Higher resource usage'],
|
|
457
|
+
useWhen: ['Complex queries needed', 'Data integrity critical', 'JSON flexibility needed'],
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
name: 'MySQL',
|
|
461
|
+
description: 'Popular open-source relational database',
|
|
462
|
+
pros: ['Simple to use', 'Wide adoption', 'Good performance for reads'],
|
|
463
|
+
cons: ['Less advanced features', 'Replication complexity'],
|
|
464
|
+
useWhen: ['Simple CRUD operations', 'Read-heavy workloads', 'Team familiarity'],
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
name: 'MongoDB',
|
|
468
|
+
description: 'Document-oriented NoSQL database',
|
|
469
|
+
pros: ['Flexible schema', 'Horizontal scaling', 'Developer friendly'],
|
|
470
|
+
cons: ['No ACID by default', 'Memory intensive', 'Complex aggregations'],
|
|
471
|
+
useWhen: ['Schema evolution expected', 'Document-oriented data', 'Rapid prototyping'],
|
|
472
|
+
},
|
|
473
|
+
],
|
|
474
|
+
defaultRecommendation: 'PostgreSQL',
|
|
475
|
+
},
|
|
476
|
+
cache: {
|
|
477
|
+
options: [
|
|
478
|
+
{
|
|
479
|
+
name: 'Redis',
|
|
480
|
+
description: 'In-memory data structure store',
|
|
481
|
+
pros: ['Very fast', 'Rich data structures', 'Pub/sub support', 'Persistence options'],
|
|
482
|
+
cons: ['Memory bound', 'Single-threaded'],
|
|
483
|
+
useWhen: ['High-performance caching', 'Session storage', 'Real-time features'],
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
name: 'In-memory (local)',
|
|
487
|
+
description: 'Application-level caching',
|
|
488
|
+
pros: ['No external dependency', 'Fastest access', 'Simple setup'],
|
|
489
|
+
cons: ['Not shared across instances', 'Limited by heap size', 'Lost on restart'],
|
|
490
|
+
useWhen: ['Single instance deployment', 'Small cache size', 'Local reference data'],
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
name: 'Memcached',
|
|
494
|
+
description: 'Distributed memory caching',
|
|
495
|
+
pros: ['Simple', 'Multi-threaded', 'Predictable performance'],
|
|
496
|
+
cons: ['Limited data types', 'No persistence', 'No pub/sub'],
|
|
497
|
+
useWhen: ['Simple key-value caching', 'Multiple servers', 'Volatile data only'],
|
|
498
|
+
},
|
|
499
|
+
],
|
|
500
|
+
defaultRecommendation: 'Redis',
|
|
501
|
+
},
|
|
502
|
+
messaging: {
|
|
503
|
+
options: [
|
|
504
|
+
{
|
|
505
|
+
name: 'Apache Kafka',
|
|
506
|
+
description: 'Distributed streaming platform',
|
|
507
|
+
pros: ['High throughput', 'Durable', 'Replay capability', 'Strong ordering'],
|
|
508
|
+
cons: ['Complex setup', 'Higher latency', 'Operational overhead'],
|
|
509
|
+
useWhen: ['Event sourcing', 'High volume', 'Data pipeline', 'Audit requirements'],
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
name: 'RabbitMQ',
|
|
513
|
+
description: 'Message broker with routing',
|
|
514
|
+
pros: ['Flexible routing', 'Lower latency', 'Easier setup', 'Good for RPC'],
|
|
515
|
+
cons: ['Lower throughput', 'Less durable by default'],
|
|
516
|
+
useWhen: ['Complex routing', 'Request-reply patterns', 'Lower volume'],
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
name: 'AWS SQS',
|
|
520
|
+
description: 'Managed message queue service',
|
|
521
|
+
pros: ['Fully managed', 'Highly available', 'Pay per use', 'Simple'],
|
|
522
|
+
cons: ['AWS lock-in', 'Limited features', 'Higher latency'],
|
|
523
|
+
useWhen: ['AWS infrastructure', 'Simple queuing', 'Minimal ops'],
|
|
524
|
+
},
|
|
525
|
+
],
|
|
526
|
+
defaultRecommendation: 'Apache Kafka',
|
|
527
|
+
},
|
|
528
|
+
authentication: {
|
|
529
|
+
options: [
|
|
530
|
+
{
|
|
531
|
+
name: 'JWT (JSON Web Tokens)',
|
|
532
|
+
description: 'Stateless token-based authentication',
|
|
533
|
+
pros: ['Stateless', 'Scalable', 'Cross-domain support', 'Self-contained'],
|
|
534
|
+
cons: ['Cannot revoke easily', 'Token size', 'Key management'],
|
|
535
|
+
useWhen: ['Microservices', 'API authentication', 'Cross-domain auth'],
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
name: 'Session-based',
|
|
539
|
+
description: 'Server-side session storage',
|
|
540
|
+
pros: ['Easy revocation', 'Simple implementation', 'Smaller payload'],
|
|
541
|
+
cons: ['Server state', 'Scaling challenges', 'CSRF concerns'],
|
|
542
|
+
useWhen: ['Monolithic apps', 'Web applications', 'High security needs'],
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
name: 'OAuth 2.0 / OIDC',
|
|
546
|
+
description: 'Delegated authorization protocol',
|
|
547
|
+
pros: ['Standard protocol', 'Third-party auth', 'Fine-grained scopes'],
|
|
548
|
+
cons: ['Complex implementation', 'Multiple flows'],
|
|
549
|
+
useWhen: ['Third-party integration', 'SSO requirements', 'API access delegation'],
|
|
550
|
+
},
|
|
551
|
+
],
|
|
552
|
+
defaultRecommendation: 'JWT (JSON Web Tokens)',
|
|
553
|
+
},
|
|
554
|
+
testing: {
|
|
555
|
+
options: [
|
|
556
|
+
{
|
|
557
|
+
name: 'Unit + Integration + E2E',
|
|
558
|
+
description: 'Full testing pyramid',
|
|
559
|
+
pros: ['Comprehensive coverage', 'Fast feedback', 'Confidence in changes'],
|
|
560
|
+
cons: ['Time investment', 'Maintenance overhead'],
|
|
561
|
+
useWhen: ['Production systems', 'Team projects', 'Critical business logic'],
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
name: 'Unit + Integration only',
|
|
565
|
+
description: 'Focus on unit and integration tests',
|
|
566
|
+
pros: ['Good balance', 'Faster execution', 'Less flaky'],
|
|
567
|
+
cons: ['May miss UI issues', 'Less end-to-end confidence'],
|
|
568
|
+
useWhen: ['API services', 'Libraries', 'Time constraints'],
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
name: 'TDD (Test-Driven Development)',
|
|
572
|
+
description: 'Write tests before implementation',
|
|
573
|
+
pros: ['Better design', 'High coverage', 'Living documentation'],
|
|
574
|
+
cons: ['Learning curve', 'Initial slowdown'],
|
|
575
|
+
useWhen: ['Complex business logic', 'Quality-critical code', 'New features'],
|
|
576
|
+
},
|
|
577
|
+
],
|
|
578
|
+
defaultRecommendation: 'Unit + Integration + E2E',
|
|
579
|
+
},
|
|
580
|
+
};
|
|
581
|
+
/**
|
|
582
|
+
* Get a technical decision recommendation.
|
|
583
|
+
*/
|
|
584
|
+
export function getTechnicalDecision(category, _context, projectConfig) {
|
|
585
|
+
const decision = TECHNICAL_DECISIONS[category];
|
|
586
|
+
if (!decision)
|
|
587
|
+
return null;
|
|
588
|
+
// Check if project has a predefined decision
|
|
589
|
+
const predefinedDecision = projectConfig?.decisions?.[category];
|
|
590
|
+
if (predefinedDecision) {
|
|
591
|
+
const option = decision.options.find((o) => o.name.toLowerCase() === predefinedDecision.toLowerCase());
|
|
592
|
+
if (option) {
|
|
593
|
+
return {
|
|
594
|
+
options: decision.options,
|
|
595
|
+
recommendation: option.name,
|
|
596
|
+
reasoning: `Project configuration specifies ${option.name} for ${category}. This aligns with the team's architectural decisions.`,
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
return {
|
|
601
|
+
options: decision.options,
|
|
602
|
+
recommendation: decision.defaultRecommendation,
|
|
603
|
+
reasoning: `${decision.defaultRecommendation} is recommended as the default choice for ${category} based on industry best practices and versatility.`,
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* Format guardrails as markdown.
|
|
608
|
+
*/
|
|
609
|
+
export function formatGuardrailsAsMarkdown(guardrails) {
|
|
610
|
+
const lines = [
|
|
611
|
+
`# Guardrails for ${guardrails.taskType.toUpperCase()} task`,
|
|
612
|
+
'',
|
|
613
|
+
'## MANDATORY (must follow)',
|
|
614
|
+
'',
|
|
615
|
+
];
|
|
616
|
+
for (const rule of guardrails.mandatory) {
|
|
617
|
+
lines.push(`- ✅ ${rule}`);
|
|
618
|
+
}
|
|
619
|
+
lines.push('', '## RECOMMENDED (should follow)', '');
|
|
620
|
+
for (const rule of guardrails.recommended) {
|
|
621
|
+
lines.push(`- 💡 ${rule}`);
|
|
622
|
+
}
|
|
623
|
+
lines.push('', '## AVOID (do not do)', '');
|
|
624
|
+
for (const rule of guardrails.avoid) {
|
|
625
|
+
lines.push(`- ❌ ${rule}`);
|
|
626
|
+
}
|
|
627
|
+
return lines.join('\n');
|
|
628
|
+
}
|
|
629
|
+
//# sourceMappingURL=agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAIL,mBAAmB,GAEpB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,MAAM,kBAAkB,GAAiC;IACvD,OAAO,EAAE;QACP,QAAQ,EAAE,SAAS;QACnB,SAAS,EAAE;YACT,+CAA+C;YAC/C,6CAA6C;YAC7C,wBAAwB;YACxB,mCAAmC;YACnC,sBAAsB;YACtB,+BAA+B;SAChC;QACD,WAAW,EAAE;YACX,6BAA6B;YAC7B,8BAA8B;YAC9B,0BAA0B;YAC1B,uCAAuC;YACvC,4CAA4C;SAC7C;QACD,KAAK,EAAE;YACL,wBAAwB;YACxB,0BAA0B;YAC1B,2CAA2C;YAC3C,uBAAuB;YACvB,2CAA2C;SAC5C;KACF;IACD,MAAM,EAAE;QACN,QAAQ,EAAE,QAAQ;QAClB,SAAS,EAAE;YACT,oDAAoD;YACpD,0CAA0C;YAC1C,0CAA0C;YAC1C,uCAAuC;SACxC;QACD,WAAW,EAAE;YACX,4CAA4C;YAC5C,iDAAiD;YACjD,0CAA0C;SAC3C;QACD,KAAK,EAAE;YACL,4BAA4B;YAC5B,mCAAmC;YACnC,iCAAiC;YACjC,uCAAuC;SACxC;KACF;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,UAAU;QACpB,SAAS,EAAE;YACT,+CAA+C;YAC/C,sCAAs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