@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,600 @@
|
|
|
1
|
+
import { classifyTaskType, detectProjectStack, formatGuardrailsAsMarkdown, getGuardrails, getProjectRules, loadProjectConfig, } from './agent.js';
|
|
2
|
+
import { config } from './config.js';
|
|
3
|
+
import { formatProfileAsMarkdown, getProfile, loadStandards } from './profiles.js';
|
|
4
|
+
/**
|
|
5
|
+
* Prompt definitions for MCP.
|
|
6
|
+
*/
|
|
7
|
+
export const prompts = [
|
|
8
|
+
{
|
|
9
|
+
name: 'code_review',
|
|
10
|
+
description: 'Review code applying the coding standards from a profile. Provides detailed feedback on compliance, issues, and suggestions.',
|
|
11
|
+
arguments: [
|
|
12
|
+
{
|
|
13
|
+
name: 'profile',
|
|
14
|
+
description: 'Profile ID to use for standards (optional, defaults to "default")',
|
|
15
|
+
required: false,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'code',
|
|
19
|
+
description: 'The code to review',
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'refactor_suggestion',
|
|
26
|
+
description: 'Suggest refactoring based on coding standards and best practices. Returns improved code with explanations.',
|
|
27
|
+
arguments: [
|
|
28
|
+
{
|
|
29
|
+
name: 'profile',
|
|
30
|
+
description: 'Profile ID to use for standards (optional)',
|
|
31
|
+
required: false,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'code',
|
|
35
|
+
description: 'The code to refactor',
|
|
36
|
+
required: true,
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'architecture_check',
|
|
42
|
+
description: 'Check if code follows the architecture guidelines (layer dependencies, DDD patterns, structure).',
|
|
43
|
+
arguments: [
|
|
44
|
+
{
|
|
45
|
+
name: 'profile',
|
|
46
|
+
description: 'Profile ID to use for standards (optional)',
|
|
47
|
+
required: false,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'description',
|
|
51
|
+
description: 'Description of the code structure or the code itself',
|
|
52
|
+
required: true,
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'implement_feature',
|
|
58
|
+
description: 'Guide for implementing a feature following the structured LLM development workflow: Clarify → Plan → Build (TDD) → Verify → Review → Refine.',
|
|
59
|
+
arguments: [
|
|
60
|
+
{
|
|
61
|
+
name: 'profile',
|
|
62
|
+
description: 'Profile ID to use for standards (optional)',
|
|
63
|
+
required: false,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'feature',
|
|
67
|
+
description: 'Description of the feature to implement',
|
|
68
|
+
required: true,
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'context',
|
|
72
|
+
description: 'Additional context about the project, tech stack, or constraints (optional)',
|
|
73
|
+
required: false,
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'expert_review',
|
|
79
|
+
description: 'Perform an expert review of code adopting a specific role (Architect, Backend Dev, Security Engineer, etc.) following the structured review process.',
|
|
80
|
+
arguments: [
|
|
81
|
+
{
|
|
82
|
+
name: 'role',
|
|
83
|
+
description: 'Expert role to adopt: "architect", "backend", "frontend", "security", "performance", "dba", "devops"',
|
|
84
|
+
required: true,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: 'code',
|
|
88
|
+
description: 'The code or implementation to review',
|
|
89
|
+
required: true,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'profile',
|
|
93
|
+
description: 'Profile ID to use for standards (optional)',
|
|
94
|
+
required: false,
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
// ============================================================================
|
|
99
|
+
// AGENT MODE PROMPTS
|
|
100
|
+
// ============================================================================
|
|
101
|
+
{
|
|
102
|
+
name: 'agent_mode',
|
|
103
|
+
description: 'AGENT MODE: Comprehensive prompt that auto-injects ALL relevant context (guardrails, standards, architecture, workflow) for any task. Use this for a fully autonomous development experience.',
|
|
104
|
+
arguments: [
|
|
105
|
+
{
|
|
106
|
+
name: 'task',
|
|
107
|
+
description: 'The task to implement (e.g., "Create a payment service", "Fix the login bug")',
|
|
108
|
+
required: true,
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'project_dir',
|
|
112
|
+
description: 'Project directory path for auto-detection and .corbat.json loading (optional)',
|
|
113
|
+
required: false,
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'profile',
|
|
117
|
+
description: 'Override profile ID (optional, will be auto-detected if not provided)',
|
|
118
|
+
required: false,
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'quick_implement',
|
|
124
|
+
description: 'Quick implementation mode with essential guardrails. Less verbose than agent_mode but still ensures quality. Good for smaller tasks.',
|
|
125
|
+
arguments: [
|
|
126
|
+
{
|
|
127
|
+
name: 'task',
|
|
128
|
+
description: 'The task to implement',
|
|
129
|
+
required: true,
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'profile',
|
|
133
|
+
description: 'Profile ID to use (optional)',
|
|
134
|
+
required: false,
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
},
|
|
138
|
+
];
|
|
139
|
+
/**
|
|
140
|
+
* Handle prompt requests.
|
|
141
|
+
*/
|
|
142
|
+
export async function handleGetPrompt(name, args) {
|
|
143
|
+
const profileId = args?.profile || config.defaultProfile;
|
|
144
|
+
const profile = await getProfile(profileId);
|
|
145
|
+
if (!profile)
|
|
146
|
+
return null;
|
|
147
|
+
const standards = await loadStandards();
|
|
148
|
+
const profileMarkdown = formatProfileAsMarkdown(profileId, profile);
|
|
149
|
+
const standardsMarkdown = standards.map((s) => `## ${s.name}\n\n${s.content}`).join('\n\n---\n\n');
|
|
150
|
+
const context = `${profileMarkdown}\n\n---\n\n# Standards Documentation\n\n${standardsMarkdown}`;
|
|
151
|
+
switch (name) {
|
|
152
|
+
case 'code_review': {
|
|
153
|
+
const code = args?.code;
|
|
154
|
+
if (!code)
|
|
155
|
+
return null;
|
|
156
|
+
return {
|
|
157
|
+
messages: [
|
|
158
|
+
{
|
|
159
|
+
role: 'user',
|
|
160
|
+
content: {
|
|
161
|
+
type: 'text',
|
|
162
|
+
text: `You are a senior code reviewer. Review the following code applying these coding standards:
|
|
163
|
+
|
|
164
|
+
${context}
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Code to Review:
|
|
169
|
+
|
|
170
|
+
\`\`\`
|
|
171
|
+
${code}
|
|
172
|
+
\`\`\`
|
|
173
|
+
|
|
174
|
+
Provide:
|
|
175
|
+
1. **Standards Compliance Assessment** - How well does the code follow the standards?
|
|
176
|
+
2. **Specific Issues Found** - List each issue with line references if possible
|
|
177
|
+
3. **Suggested Improvements** - Concrete changes to improve the code
|
|
178
|
+
4. **Overall Quality Score** - Rate from 1-10 with justification`,
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
],
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
case 'refactor_suggestion': {
|
|
185
|
+
const code = args?.code;
|
|
186
|
+
if (!code)
|
|
187
|
+
return null;
|
|
188
|
+
return {
|
|
189
|
+
messages: [
|
|
190
|
+
{
|
|
191
|
+
role: 'user',
|
|
192
|
+
content: {
|
|
193
|
+
type: 'text',
|
|
194
|
+
text: `You are a senior software architect. Suggest refactoring for the following code based on these standards:
|
|
195
|
+
|
|
196
|
+
${context}
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Code to Refactor:
|
|
201
|
+
|
|
202
|
+
\`\`\`
|
|
203
|
+
${code}
|
|
204
|
+
\`\`\`
|
|
205
|
+
|
|
206
|
+
Provide:
|
|
207
|
+
1. **Current Issues** - What problems exist in the current code?
|
|
208
|
+
2. **Refactored Code** - The improved version applying the standards
|
|
209
|
+
3. **Changes Explained** - Why each change was made and which standard it addresses`,
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
],
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
case 'architecture_check': {
|
|
216
|
+
const description = args?.description;
|
|
217
|
+
if (!description)
|
|
218
|
+
return null;
|
|
219
|
+
return {
|
|
220
|
+
messages: [
|
|
221
|
+
{
|
|
222
|
+
role: 'user',
|
|
223
|
+
content: {
|
|
224
|
+
type: 'text',
|
|
225
|
+
text: `You are a software architect expert in hexagonal architecture and DDD. Analyze the following code/structure against these architecture guidelines:
|
|
226
|
+
|
|
227
|
+
${context}
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## Code/Structure to Analyze:
|
|
232
|
+
|
|
233
|
+
${description}
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
Provide:
|
|
238
|
+
1. **Architecture Compliance** - Does it follow the specified architecture pattern?
|
|
239
|
+
2. **Layer Dependency Violations** - Are there any forbidden dependencies between layers?
|
|
240
|
+
3. **DDD Pattern Assessment** - Are domain patterns used correctly?
|
|
241
|
+
4. **Recommendations** - Specific changes to improve architecture compliance`,
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
],
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
case 'implement_feature': {
|
|
248
|
+
const feature = args?.feature;
|
|
249
|
+
if (!feature)
|
|
250
|
+
return null;
|
|
251
|
+
const additionalContext = args?.context || '';
|
|
252
|
+
return {
|
|
253
|
+
messages: [
|
|
254
|
+
{
|
|
255
|
+
role: 'user',
|
|
256
|
+
content: {
|
|
257
|
+
type: 'text',
|
|
258
|
+
text: `You are a senior software engineer implementing a feature. Follow this STRUCTURED WORKFLOW strictly:
|
|
259
|
+
|
|
260
|
+
# Coding Standards & Best Practices
|
|
261
|
+
${context}
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
# DEVELOPMENT WORKFLOW
|
|
266
|
+
|
|
267
|
+
You MUST follow these phases in order:
|
|
268
|
+
|
|
269
|
+
## PHASE 1: CLARIFICACIÓN
|
|
270
|
+
Before writing any code, analyze the request and ASK if you detect:
|
|
271
|
+
- Ambiguous requirements
|
|
272
|
+
- Missing functional context
|
|
273
|
+
- Contradictory requirements
|
|
274
|
+
- Unclear acceptance criteria
|
|
275
|
+
|
|
276
|
+
If everything is clear, explicitly state your understanding of the requirements.
|
|
277
|
+
|
|
278
|
+
## PHASE 2: PLANIFICACIÓN
|
|
279
|
+
Create a detailed implementation plan:
|
|
280
|
+
1. List all requirements and constraints
|
|
281
|
+
2. Evaluate 2-3 alternative approaches (if applicable)
|
|
282
|
+
3. Create a task checklist with this format:
|
|
283
|
+
[ ] Task 1 - Description
|
|
284
|
+
[ ] 1.1 Write tests
|
|
285
|
+
[ ] 1.2 Implement
|
|
286
|
+
[ ] Task 2 - Description
|
|
287
|
+
...
|
|
288
|
+
|
|
289
|
+
## PHASE 3: IMPLEMENTACIÓN (TDD)
|
|
290
|
+
For EACH task, follow TDD strictly:
|
|
291
|
+
1. RED: Write a failing test first
|
|
292
|
+
2. GREEN: Write minimum code to pass
|
|
293
|
+
3. REFACTOR: Clean up while keeping tests green
|
|
294
|
+
|
|
295
|
+
Include:
|
|
296
|
+
- Unit tests (80%+ coverage)
|
|
297
|
+
- Integration tests (for critical flows)
|
|
298
|
+
- Architecture tests (if applicable)
|
|
299
|
+
|
|
300
|
+
## PHASE 4: VERIFICACIÓN
|
|
301
|
+
Ensure:
|
|
302
|
+
- [ ] Code compiles without errors
|
|
303
|
+
- [ ] All tests pass
|
|
304
|
+
- [ ] Linter passes
|
|
305
|
+
- [ ] Application starts correctly
|
|
306
|
+
|
|
307
|
+
## PHASE 5: REVISIÓN EXPERTA
|
|
308
|
+
Adopt the role of a Senior Expert (Architect/Backend Dev/etc.) and review:
|
|
309
|
+
1. CRITICAL issues (must fix)
|
|
310
|
+
2. RECOMMENDED improvements (should fix)
|
|
311
|
+
3. SUGGESTIONS (nice to have)
|
|
312
|
+
|
|
313
|
+
## PHASE 6: REFINAMIENTO
|
|
314
|
+
Apply improvements in up to 3 cycles:
|
|
315
|
+
- Cycle 1: Fix all CRITICAL issues
|
|
316
|
+
- Cycle 2: Apply RECOMMENDED improvements
|
|
317
|
+
- Cycle 3: Final polish
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
# FEATURE TO IMPLEMENT:
|
|
322
|
+
${feature}
|
|
323
|
+
|
|
324
|
+
${additionalContext ? `# ADDITIONAL CONTEXT:\n${additionalContext}` : ''}
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
BEGIN with Phase 1 (Clarificación). If you have questions, ask them now. If requirements are clear, proceed to Phase 2.`,
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
],
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
case 'expert_review': {
|
|
335
|
+
const role = args?.role;
|
|
336
|
+
const code = args?.code;
|
|
337
|
+
if (!role || !code)
|
|
338
|
+
return null;
|
|
339
|
+
const roleDescriptions = {
|
|
340
|
+
architect: 'Software Architect with 15+ years of experience in distributed systems, hexagonal architecture, and DDD',
|
|
341
|
+
backend: 'Senior Backend Developer with 15+ years of experience in API design, performance optimization, and clean code',
|
|
342
|
+
frontend: 'Senior Frontend Developer with 15+ years of experience in UI/UX, component design, and state management',
|
|
343
|
+
security: 'Security Engineer with 15+ years of experience in application security, OWASP, and secure coding practices',
|
|
344
|
+
performance: 'Performance Engineer with 15+ years of experience in optimization, profiling, and scalability',
|
|
345
|
+
dba: 'Database Administrator with 15+ years of experience in query optimization, data modeling, and database design',
|
|
346
|
+
devops: 'DevOps Engineer with 15+ years of experience in CI/CD, infrastructure as code, and cloud architecture',
|
|
347
|
+
};
|
|
348
|
+
const roleDesc = roleDescriptions[role.toLowerCase()] || `Senior ${role} Expert with 15+ years of experience`;
|
|
349
|
+
return {
|
|
350
|
+
messages: [
|
|
351
|
+
{
|
|
352
|
+
role: 'user',
|
|
353
|
+
content: {
|
|
354
|
+
type: 'text',
|
|
355
|
+
text: `# EXPERT REVIEW
|
|
356
|
+
|
|
357
|
+
You are a ${roleDesc}.
|
|
358
|
+
|
|
359
|
+
You are reviewing this code FROM SCRATCH, with NO knowledge of how it was implemented. Your goal is to find issues that the original developer might have missed.
|
|
360
|
+
|
|
361
|
+
## Coding Standards to Apply:
|
|
362
|
+
${context}
|
|
363
|
+
|
|
364
|
+
---
|
|
365
|
+
|
|
366
|
+
## Code to Review:
|
|
367
|
+
\`\`\`
|
|
368
|
+
${code}
|
|
369
|
+
\`\`\`
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
## Your Review Must Include:
|
|
374
|
+
|
|
375
|
+
### 1. CRITICAL ISSUES (Must be fixed)
|
|
376
|
+
Issues that could cause:
|
|
377
|
+
- Bugs or incorrect behavior
|
|
378
|
+
- Security vulnerabilities
|
|
379
|
+
- Architecture violations
|
|
380
|
+
- Severe performance problems
|
|
381
|
+
- Data loss or corruption
|
|
382
|
+
|
|
383
|
+
For each critical issue:
|
|
384
|
+
- Location (file/line if possible)
|
|
385
|
+
- Problem description
|
|
386
|
+
- Recommended fix
|
|
387
|
+
|
|
388
|
+
### 2. RECOMMENDED IMPROVEMENTS (Should be fixed)
|
|
389
|
+
- Code readability improvements
|
|
390
|
+
- Minor performance optimizations
|
|
391
|
+
- Missing best practices
|
|
392
|
+
- Documentation gaps
|
|
393
|
+
- Additional tests needed
|
|
394
|
+
|
|
395
|
+
### 3. SUGGESTIONS (Nice to have)
|
|
396
|
+
- Optional refactorings
|
|
397
|
+
- Alternative patterns to consider
|
|
398
|
+
- Future improvements
|
|
399
|
+
|
|
400
|
+
### 4. OVERALL ASSESSMENT
|
|
401
|
+
- Quality score (1-10)
|
|
402
|
+
- Summary of main concerns
|
|
403
|
+
- What was done well
|
|
404
|
+
|
|
405
|
+
Be thorough, critical, and specific. Do not assume the code is correct just because it exists.`,
|
|
406
|
+
},
|
|
407
|
+
},
|
|
408
|
+
],
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
// ============================================================================
|
|
412
|
+
// AGENT MODE PROMPTS
|
|
413
|
+
// ============================================================================
|
|
414
|
+
case 'agent_mode': {
|
|
415
|
+
const task = args?.task;
|
|
416
|
+
if (!task)
|
|
417
|
+
return null;
|
|
418
|
+
const projectDir = args?.project_dir;
|
|
419
|
+
const profileOverride = args?.profile;
|
|
420
|
+
// Classify task type
|
|
421
|
+
const taskType = classifyTaskType(task);
|
|
422
|
+
// Try to detect project stack and load config
|
|
423
|
+
let detectedStack = null;
|
|
424
|
+
let projectConfig = null;
|
|
425
|
+
if (projectDir) {
|
|
426
|
+
detectedStack = await detectProjectStack(projectDir);
|
|
427
|
+
projectConfig = await loadProjectConfig(projectDir);
|
|
428
|
+
}
|
|
429
|
+
// Determine profile
|
|
430
|
+
const finalProfileId = profileOverride || projectConfig?.profile || detectedStack?.suggestedProfile || profileId;
|
|
431
|
+
const finalProfile = await getProfile(finalProfileId);
|
|
432
|
+
if (!finalProfile)
|
|
433
|
+
return null;
|
|
434
|
+
// Get guardrails and rules
|
|
435
|
+
const guardrails = getGuardrails(taskType, projectConfig);
|
|
436
|
+
const projectRules = getProjectRules(taskType, projectConfig);
|
|
437
|
+
// Build comprehensive agent context
|
|
438
|
+
const agentContext = [
|
|
439
|
+
'# CORBAT AGENT MODE',
|
|
440
|
+
'',
|
|
441
|
+
'> You are operating in AGENT MODE with full coding standards context.',
|
|
442
|
+
'> Follow ALL guidelines below strictly. This ensures consistent, high-quality code.',
|
|
443
|
+
'',
|
|
444
|
+
'---',
|
|
445
|
+
'',
|
|
446
|
+
'## TASK ANALYSIS',
|
|
447
|
+
'',
|
|
448
|
+
`**Task:** ${task}`,
|
|
449
|
+
`**Classified as:** ${taskType.toUpperCase()}`,
|
|
450
|
+
`**Active Profile:** ${finalProfileId}`,
|
|
451
|
+
'',
|
|
452
|
+
];
|
|
453
|
+
// Add detected stack
|
|
454
|
+
if (detectedStack) {
|
|
455
|
+
agentContext.push('## DETECTED PROJECT STACK', '');
|
|
456
|
+
agentContext.push(`| Property | Value |`);
|
|
457
|
+
agentContext.push(`|----------|-------|`);
|
|
458
|
+
agentContext.push(`| Language | ${detectedStack.language} |`);
|
|
459
|
+
agentContext.push(`| Framework | ${detectedStack.framework || 'N/A'} |`);
|
|
460
|
+
agentContext.push(`| Build Tool | ${detectedStack.buildTool || 'N/A'} |`);
|
|
461
|
+
agentContext.push(`| Test Framework | ${detectedStack.testFramework || 'N/A'} |`);
|
|
462
|
+
agentContext.push('');
|
|
463
|
+
}
|
|
464
|
+
// Add guardrails - CRITICAL
|
|
465
|
+
agentContext.push('---', '');
|
|
466
|
+
agentContext.push('## GUARDRAILS (Non-negotiable)', '');
|
|
467
|
+
agentContext.push(formatGuardrailsAsMarkdown(guardrails));
|
|
468
|
+
agentContext.push('');
|
|
469
|
+
// Add project-specific rules
|
|
470
|
+
if (projectRules.length > 0) {
|
|
471
|
+
agentContext.push('---', '', '## PROJECT-SPECIFIC RULES', '');
|
|
472
|
+
for (const rule of projectRules) {
|
|
473
|
+
agentContext.push(`- 📌 ${rule}`);
|
|
474
|
+
}
|
|
475
|
+
agentContext.push('');
|
|
476
|
+
}
|
|
477
|
+
// Add full profile
|
|
478
|
+
agentContext.push('---', '');
|
|
479
|
+
agentContext.push(formatProfileAsMarkdown(finalProfileId, finalProfile));
|
|
480
|
+
// Add selected standards
|
|
481
|
+
agentContext.push('---', '', '## RELEVANT STANDARDS', '');
|
|
482
|
+
for (const standard of standards.slice(0, 3)) {
|
|
483
|
+
agentContext.push(`### ${standard.name}`, '');
|
|
484
|
+
const truncated = standard.content.length > 1500
|
|
485
|
+
? standard.content.slice(0, 1500) + '\n\n...(see full doc with search_standards)'
|
|
486
|
+
: standard.content;
|
|
487
|
+
agentContext.push(truncated, '');
|
|
488
|
+
}
|
|
489
|
+
// Add workflow
|
|
490
|
+
agentContext.push('---', '', '## MANDATORY WORKFLOW', '');
|
|
491
|
+
agentContext.push(`
|
|
492
|
+
You MUST follow this workflow:
|
|
493
|
+
|
|
494
|
+
### PHASE 1: CLARIFY
|
|
495
|
+
- Analyze the task for ambiguities
|
|
496
|
+
- ASK questions if requirements are unclear
|
|
497
|
+
- Confirm understanding before proceeding
|
|
498
|
+
|
|
499
|
+
### PHASE 2: PLAN
|
|
500
|
+
- List all requirements
|
|
501
|
+
- Create task checklist:
|
|
502
|
+
\`\`\`
|
|
503
|
+
[ ] 1. Task - Description
|
|
504
|
+
[ ] 1.1 Write tests
|
|
505
|
+
[ ] 1.2 Implement
|
|
506
|
+
\`\`\`
|
|
507
|
+
|
|
508
|
+
### PHASE 3: BUILD (TDD)
|
|
509
|
+
For EACH task:
|
|
510
|
+
1. 🔴 RED: Write failing test first
|
|
511
|
+
2. 🟢 GREEN: Implement minimum to pass
|
|
512
|
+
3. 🔵 REFACTOR: Clean up, tests stay green
|
|
513
|
+
|
|
514
|
+
### PHASE 4: VERIFY
|
|
515
|
+
- [ ] Code compiles
|
|
516
|
+
- [ ] All tests pass
|
|
517
|
+
- [ ] Linter passes
|
|
518
|
+
- [ ] No regressions
|
|
519
|
+
|
|
520
|
+
### PHASE 5: SELF-REVIEW
|
|
521
|
+
Adopt expert role and find:
|
|
522
|
+
- CRITICAL issues (must fix)
|
|
523
|
+
- RECOMMENDED improvements
|
|
524
|
+
- SUGGESTIONS
|
|
525
|
+
|
|
526
|
+
### PHASE 6: REFINE
|
|
527
|
+
Fix issues in up to 3 cycles until quality criteria met.
|
|
528
|
+
`);
|
|
529
|
+
agentContext.push('---', '', '## BEGIN IMPLEMENTATION', '');
|
|
530
|
+
agentContext.push(`Start with Phase 1 (CLARIFY). If requirements are clear, proceed to Phase 2 (PLAN).`);
|
|
531
|
+
return {
|
|
532
|
+
messages: [
|
|
533
|
+
{
|
|
534
|
+
role: 'user',
|
|
535
|
+
content: {
|
|
536
|
+
type: 'text',
|
|
537
|
+
text: agentContext.join('\n'),
|
|
538
|
+
},
|
|
539
|
+
},
|
|
540
|
+
],
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
case 'quick_implement': {
|
|
544
|
+
const task = args?.task;
|
|
545
|
+
if (!task)
|
|
546
|
+
return null;
|
|
547
|
+
const taskType = classifyTaskType(task);
|
|
548
|
+
const guardrails = getGuardrails(taskType, null);
|
|
549
|
+
const quickContext = `# QUICK IMPLEMENTATION MODE
|
|
550
|
+
|
|
551
|
+
## Task
|
|
552
|
+
${task}
|
|
553
|
+
|
|
554
|
+
## Task Type: ${taskType.toUpperCase()}
|
|
555
|
+
|
|
556
|
+
## Essential Guardrails
|
|
557
|
+
|
|
558
|
+
### MUST DO:
|
|
559
|
+
${guardrails.mandatory
|
|
560
|
+
.slice(0, 4)
|
|
561
|
+
.map((r) => `- ✅ ${r}`)
|
|
562
|
+
.join('\n')}
|
|
563
|
+
|
|
564
|
+
### MUST AVOID:
|
|
565
|
+
${guardrails.avoid
|
|
566
|
+
.slice(0, 4)
|
|
567
|
+
.map((r) => `- ❌ ${r}`)
|
|
568
|
+
.join('\n')}
|
|
569
|
+
|
|
570
|
+
## Profile Standards
|
|
571
|
+
${context}
|
|
572
|
+
|
|
573
|
+
---
|
|
574
|
+
|
|
575
|
+
## Quick Workflow
|
|
576
|
+
|
|
577
|
+
1. **Understand** - Clarify if needed
|
|
578
|
+
2. **Plan** - Brief task list
|
|
579
|
+
3. **Implement** - With tests (TDD preferred)
|
|
580
|
+
4. **Verify** - Tests pass, linter clean
|
|
581
|
+
5. **Review** - Quick self-check
|
|
582
|
+
|
|
583
|
+
Begin implementation. Ask questions if requirements are unclear.`;
|
|
584
|
+
return {
|
|
585
|
+
messages: [
|
|
586
|
+
{
|
|
587
|
+
role: 'user',
|
|
588
|
+
content: {
|
|
589
|
+
type: 'text',
|
|
590
|
+
text: quickContext,
|
|
591
|
+
},
|
|
592
|
+
},
|
|
593
|
+
],
|
|
594
|
+
};
|
|
595
|
+
}
|
|
596
|
+
default:
|
|
597
|
+
return null;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
//# sourceMappingURL=prompts-legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts-legacy.js","sourceRoot":"","sources":["../src/prompts-legacy.ts"],"names":[],"mappings":"AAAA,OAAO,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C,EAAE,CAAC;iBACtB,IAAI,CAAC,IAAI,CAAC;;;EAGX,OAAO;;;;;;;;;;;;iEAYwD,CAAC;YAE5D,OAAO;gBACL,QAAQ,EAAE;oBACR;wBACE,IAAI,EAAE,MAAM;wBACZ,OAAO,EAAE;4BACP,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,YAAY;yBACnB;qBACF;iBACF;aACF,CAAC;QACJ,CAAC;QAED;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SIMPLIFIED PROMPT DEFINITIONS (2 prompts instead of 7)
|
|
3
|
+
*
|
|
4
|
+
* Design principles:
|
|
5
|
+
* - One prompt for implementation
|
|
6
|
+
* - One prompt for review
|
|
7
|
+
* - Both are comprehensive but concise
|
|
8
|
+
*/
|
|
9
|
+
export declare const prompts: {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
arguments: {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
required: boolean;
|
|
16
|
+
}[];
|
|
17
|
+
}[];
|
|
18
|
+
/**
|
|
19
|
+
* Handle prompt requests.
|
|
20
|
+
*/
|
|
21
|
+
export declare function handleGetPrompt(name: string, args: Record<string, string> | undefined): Promise<{
|
|
22
|
+
messages: Array<{
|
|
23
|
+
role: 'user';
|
|
24
|
+
content: {
|
|
25
|
+
type: 'text';
|
|
26
|
+
text: string;
|
|
27
|
+
};
|
|
28
|
+
}>;
|
|
29
|
+
} | null>;
|
|
30
|
+
//# sourceMappingURL=prompts-v2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts-v2.d.ts","sourceRoot":"","sources":["../src/prompts-v2.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO;;;;;;;;GAkCnB,CAAC;AAEF;;GAEG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GACvC,OAAO,CAAC;IACT,QAAQ,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC,CAAC;CAC5E,GAAG,IAAI,CAAC,CASR"}
|