sdd-mcp-server 1.4.4 → 1.5.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/README.md +18 -9
- package/dist/__tests__/legacy/setup.d.ts +44 -0
- package/dist/__tests__/legacy/setup.js +178 -0
- package/dist/__tests__/legacy/setup.js.map +1 -0
- package/dist/__tests__/legacy/test-helpers/mock-factories.d.ts +26 -0
- package/dist/__tests__/legacy/test-helpers/mock-factories.js +466 -0
- package/dist/__tests__/legacy/test-helpers/mock-factories.js.map +1 -0
- package/dist/adapters/cli/SDDToolAdapter.d.ts +12 -9
- package/dist/adapters/cli/SDDToolAdapter.js +344 -462
- package/dist/adapters/cli/SDDToolAdapter.js.map +1 -1
- package/dist/application/services/RequirementsClarificationService.d.ts +73 -0
- package/dist/application/services/RequirementsClarificationService.js +523 -0
- package/dist/application/services/RequirementsClarificationService.js.map +1 -0
- package/dist/application/services/staticSteering.d.ts +6 -0
- package/dist/application/services/staticSteering.js +567 -0
- package/dist/application/services/staticSteering.js.map +1 -0
- package/dist/domain/types.d.ts +47 -0
- package/dist/domain/types.js +8 -0
- package/dist/domain/types.js.map +1 -1
- package/dist/index.js +118 -17
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/di/container.d.ts +2 -2
- package/dist/infrastructure/di/container.js +102 -60
- package/dist/infrastructure/di/container.js.map +1 -1
- package/dist/infrastructure/di/types.d.ts +1 -0
- package/dist/infrastructure/di/types.js +39 -38
- package/dist/infrastructure/di/types.js.map +1 -1
- package/mcp-server.js +2030 -1324
- package/package.json +1 -1
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { injectable, inject } from 'inversify';
|
|
14
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
15
|
+
import { TYPES } from '../../infrastructure/di/types.js';
|
|
16
|
+
import { QuestionCategory } from '../../domain/types.js';
|
|
17
|
+
let RequirementsClarificationService = class RequirementsClarificationService {
|
|
18
|
+
fileSystem;
|
|
19
|
+
logger;
|
|
20
|
+
constructor(fileSystem, logger) {
|
|
21
|
+
this.fileSystem = fileSystem;
|
|
22
|
+
this.logger = logger;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Analyzes a project description to determine if clarification is needed
|
|
26
|
+
*/
|
|
27
|
+
async analyzeDescription(description, projectPath) {
|
|
28
|
+
const correlationId = uuidv4();
|
|
29
|
+
this.logger.info('Analyzing project description for clarification needs', {
|
|
30
|
+
correlationId,
|
|
31
|
+
descriptionLength: description.length
|
|
32
|
+
});
|
|
33
|
+
// Load existing steering docs for context
|
|
34
|
+
const steeringContext = await this.loadSteeringContext(projectPath);
|
|
35
|
+
// Perform analysis
|
|
36
|
+
const analysis = this.performAnalysis(description, steeringContext);
|
|
37
|
+
this.logger.debug('Description analysis completed', {
|
|
38
|
+
correlationId,
|
|
39
|
+
qualityScore: analysis.qualityScore,
|
|
40
|
+
needsClarification: analysis.needsClarification
|
|
41
|
+
});
|
|
42
|
+
if (!analysis.needsClarification) {
|
|
43
|
+
return {
|
|
44
|
+
needsClarification: false,
|
|
45
|
+
analysis
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
// Generate clarification questions
|
|
49
|
+
const questions = this.generateQuestions(analysis, steeringContext);
|
|
50
|
+
return {
|
|
51
|
+
needsClarification: true,
|
|
52
|
+
questions,
|
|
53
|
+
analysis
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Validates and processes clarification answers
|
|
58
|
+
*/
|
|
59
|
+
validateAnswers(questions, answers) {
|
|
60
|
+
const missingRequired = [];
|
|
61
|
+
for (const question of questions) {
|
|
62
|
+
if (question.required && !answers[question.id]) {
|
|
63
|
+
missingRequired.push(question.question);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
valid: missingRequired.length === 0,
|
|
68
|
+
missingRequired
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Synthesizes an enriched project description from original + answers
|
|
73
|
+
*/
|
|
74
|
+
synthesizeDescription(originalDescription, questions, answers) {
|
|
75
|
+
const correlationId = uuidv4();
|
|
76
|
+
this.logger.info('Synthesizing enriched project description', {
|
|
77
|
+
correlationId,
|
|
78
|
+
questionCount: questions.length
|
|
79
|
+
});
|
|
80
|
+
// Extract answers by category
|
|
81
|
+
const why = this.extractAnswersByCategory(questions, answers, QuestionCategory.WHY);
|
|
82
|
+
const who = this.extractAnswersByCategory(questions, answers, QuestionCategory.WHO);
|
|
83
|
+
const what = this.extractAnswersByCategory(questions, answers, QuestionCategory.WHAT);
|
|
84
|
+
const how = this.extractAnswersByCategory(questions, answers, QuestionCategory.HOW);
|
|
85
|
+
const successCriteria = this.extractAnswersByCategory(questions, answers, QuestionCategory.SUCCESS);
|
|
86
|
+
// Build enriched description
|
|
87
|
+
const enriched = this.buildEnrichedDescription({
|
|
88
|
+
original: originalDescription,
|
|
89
|
+
why,
|
|
90
|
+
who,
|
|
91
|
+
what,
|
|
92
|
+
how,
|
|
93
|
+
successCriteria
|
|
94
|
+
});
|
|
95
|
+
return {
|
|
96
|
+
original: originalDescription,
|
|
97
|
+
why,
|
|
98
|
+
who,
|
|
99
|
+
what,
|
|
100
|
+
how: how || undefined,
|
|
101
|
+
successCriteria,
|
|
102
|
+
enriched
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Performs the core analysis of the description
|
|
107
|
+
*/
|
|
108
|
+
performAnalysis(description, steeringContext) {
|
|
109
|
+
const missingElements = [];
|
|
110
|
+
const ambiguousTerms = [];
|
|
111
|
+
// Check for WHY (business justification, problem statement)
|
|
112
|
+
const hasWhy = this.detectWhy(description);
|
|
113
|
+
if (!hasWhy && !steeringContext.hasProductContext) {
|
|
114
|
+
missingElements.push('Business justification or problem statement (WHY)');
|
|
115
|
+
}
|
|
116
|
+
// Check for WHO (target users)
|
|
117
|
+
const hasWho = this.detectWho(description);
|
|
118
|
+
if (!hasWho && !steeringContext.hasTargetUsers) {
|
|
119
|
+
missingElements.push('Target users or personas (WHO)');
|
|
120
|
+
}
|
|
121
|
+
// Check for WHAT (core features, scope)
|
|
122
|
+
const hasWhat = this.detectWhat(description);
|
|
123
|
+
if (!hasWhat) {
|
|
124
|
+
missingElements.push('Core features or scope definition (WHAT)');
|
|
125
|
+
}
|
|
126
|
+
// Check for success criteria
|
|
127
|
+
const hasSuccessCriteria = this.detectSuccessCriteria(description);
|
|
128
|
+
if (!hasSuccessCriteria) {
|
|
129
|
+
missingElements.push('Success criteria or metrics');
|
|
130
|
+
}
|
|
131
|
+
// Detect ambiguous terms
|
|
132
|
+
ambiguousTerms.push(...this.detectAmbiguousTerms(description));
|
|
133
|
+
// Calculate quality score (0-100)
|
|
134
|
+
const qualityScore = this.calculateQualityScore({
|
|
135
|
+
hasWhy,
|
|
136
|
+
hasWho,
|
|
137
|
+
hasWhat,
|
|
138
|
+
hasSuccessCriteria,
|
|
139
|
+
ambiguousTermCount: ambiguousTerms.length,
|
|
140
|
+
descriptionLength: description.length
|
|
141
|
+
});
|
|
142
|
+
// Need clarification if score < 70 or missing critical elements
|
|
143
|
+
const needsClarification = qualityScore < 70 || missingElements.length > 0;
|
|
144
|
+
return {
|
|
145
|
+
qualityScore,
|
|
146
|
+
missingElements,
|
|
147
|
+
ambiguousTerms,
|
|
148
|
+
needsClarification,
|
|
149
|
+
hasWhy,
|
|
150
|
+
hasWho,
|
|
151
|
+
hasWhat,
|
|
152
|
+
hasSuccessCriteria
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Generates targeted clarification questions based on analysis
|
|
157
|
+
*/
|
|
158
|
+
generateQuestions(analysis, steeringContext) {
|
|
159
|
+
const questions = [];
|
|
160
|
+
// WHY questions - always high priority
|
|
161
|
+
if (!analysis.hasWhy && !steeringContext.hasProductContext) {
|
|
162
|
+
questions.push({
|
|
163
|
+
id: uuidv4(),
|
|
164
|
+
category: QuestionCategory.WHY,
|
|
165
|
+
question: 'What business problem does this project solve? Why is it needed?',
|
|
166
|
+
why: 'Understanding the business justification ensures we build the right solution',
|
|
167
|
+
examples: [
|
|
168
|
+
'Our customer support team spends 5 hours/day on repetitive inquiries',
|
|
169
|
+
'Users are abandoning checkout because the process takes too long',
|
|
170
|
+
'Developers waste time searching for undocumented APIs'
|
|
171
|
+
],
|
|
172
|
+
required: true
|
|
173
|
+
});
|
|
174
|
+
questions.push({
|
|
175
|
+
id: uuidv4(),
|
|
176
|
+
category: QuestionCategory.WHY,
|
|
177
|
+
question: 'What value does this project provide to users or the business?',
|
|
178
|
+
why: 'Clarifying value proposition helps prioritize features and measure success',
|
|
179
|
+
examples: [
|
|
180
|
+
'Reduce support ticket volume by 40%',
|
|
181
|
+
'Increase conversion rate by improving checkout speed',
|
|
182
|
+
'Save developers 2 hours/week with better documentation'
|
|
183
|
+
],
|
|
184
|
+
required: true
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
// WHO questions
|
|
188
|
+
if (!analysis.hasWho && !steeringContext.hasTargetUsers) {
|
|
189
|
+
questions.push({
|
|
190
|
+
id: uuidv4(),
|
|
191
|
+
category: QuestionCategory.WHO,
|
|
192
|
+
question: 'Who are the primary users of this project?',
|
|
193
|
+
why: 'Knowing the target users shapes UX, features, and technical decisions',
|
|
194
|
+
examples: [
|
|
195
|
+
'Customer support agents using ticketing systems',
|
|
196
|
+
'E-commerce shoppers on mobile devices',
|
|
197
|
+
'Backend developers integrating APIs'
|
|
198
|
+
],
|
|
199
|
+
required: true
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
// WHAT questions
|
|
203
|
+
if (!analysis.hasWhat) {
|
|
204
|
+
questions.push({
|
|
205
|
+
id: uuidv4(),
|
|
206
|
+
category: QuestionCategory.WHAT,
|
|
207
|
+
question: 'What are the 3-5 core features for the MVP?',
|
|
208
|
+
why: 'Defining MVP scope prevents scope creep and ensures focused delivery',
|
|
209
|
+
examples: [
|
|
210
|
+
'Auto-response system, ticket categorization, analytics dashboard',
|
|
211
|
+
'Product search, cart management, payment integration',
|
|
212
|
+
'API explorer, code examples, interactive documentation'
|
|
213
|
+
],
|
|
214
|
+
required: true
|
|
215
|
+
});
|
|
216
|
+
questions.push({
|
|
217
|
+
id: uuidv4(),
|
|
218
|
+
category: QuestionCategory.WHAT,
|
|
219
|
+
question: 'What is explicitly OUT OF SCOPE for this project?',
|
|
220
|
+
why: 'Boundary definition prevents feature creep and manages expectations',
|
|
221
|
+
examples: [
|
|
222
|
+
'Admin panel (future phase)',
|
|
223
|
+
'Mobile app (web only for MVP)',
|
|
224
|
+
'Multi-language support (English only initially)'
|
|
225
|
+
],
|
|
226
|
+
required: false
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
// SUCCESS questions
|
|
230
|
+
if (!analysis.hasSuccessCriteria) {
|
|
231
|
+
questions.push({
|
|
232
|
+
id: uuidv4(),
|
|
233
|
+
category: QuestionCategory.SUCCESS,
|
|
234
|
+
question: 'How will you measure if this project is successful?',
|
|
235
|
+
why: 'Quantifiable metrics enable objective evaluation and iteration',
|
|
236
|
+
examples: [
|
|
237
|
+
'Support ticket volume reduced by 30% within 3 months',
|
|
238
|
+
'Page load time under 2 seconds, conversion rate > 3%',
|
|
239
|
+
'API documentation rated 4.5/5 stars by developers'
|
|
240
|
+
],
|
|
241
|
+
required: true
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
// HOW questions (technical approach) - only if no tech steering
|
|
245
|
+
if (!steeringContext.hasTechContext) {
|
|
246
|
+
questions.push({
|
|
247
|
+
id: uuidv4(),
|
|
248
|
+
category: QuestionCategory.HOW,
|
|
249
|
+
question: 'Are there any technical constraints or preferences? (language, platform, existing systems)',
|
|
250
|
+
why: 'Technical constraints shape architecture and technology choices',
|
|
251
|
+
examples: [
|
|
252
|
+
'Must integrate with existing Salesforce CRM',
|
|
253
|
+
'TypeScript + React preferred, hosted on AWS',
|
|
254
|
+
'Python-based, needs to run on-premise'
|
|
255
|
+
],
|
|
256
|
+
required: false
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
// Ambiguity clarification
|
|
260
|
+
for (const ambiguous of analysis.ambiguousTerms.slice(0, 3)) {
|
|
261
|
+
questions.push({
|
|
262
|
+
id: uuidv4(),
|
|
263
|
+
category: QuestionCategory.WHAT,
|
|
264
|
+
question: `You mentioned "${ambiguous.term}". ${ambiguous.suggestion}`,
|
|
265
|
+
why: 'Removing ambiguity ensures shared understanding',
|
|
266
|
+
examples: ambiguous.context ? [ambiguous.context] : undefined,
|
|
267
|
+
required: false
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
return questions;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Load steering documents for context
|
|
274
|
+
*/
|
|
275
|
+
async loadSteeringContext(projectPath) {
|
|
276
|
+
if (!projectPath) {
|
|
277
|
+
return {
|
|
278
|
+
hasProductContext: false,
|
|
279
|
+
hasTargetUsers: false,
|
|
280
|
+
hasTechContext: false
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
const context = {
|
|
284
|
+
hasProductContext: false,
|
|
285
|
+
hasTargetUsers: false,
|
|
286
|
+
hasTechContext: false
|
|
287
|
+
};
|
|
288
|
+
try {
|
|
289
|
+
// Check product.md
|
|
290
|
+
const productPath = `${projectPath}/.kiro/steering/product.md`;
|
|
291
|
+
if (await this.fileSystem.exists(productPath)) {
|
|
292
|
+
const productContent = await this.fileSystem.readFile(productPath);
|
|
293
|
+
context.hasProductContext = productContent.length > 200; // Has substantial content
|
|
294
|
+
context.hasTargetUsers = /target\s+users|user\s+persona/i.test(productContent);
|
|
295
|
+
}
|
|
296
|
+
// Check tech.md
|
|
297
|
+
const techPath = `${projectPath}/.kiro/steering/tech.md`;
|
|
298
|
+
if (await this.fileSystem.exists(techPath)) {
|
|
299
|
+
const techContent = await this.fileSystem.readFile(techPath);
|
|
300
|
+
context.hasTechContext = techContent.length > 200;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
catch (error) {
|
|
304
|
+
this.logger.warn('Failed to load steering context', {
|
|
305
|
+
error: error.message
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
return context;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Detects if description contains WHY (business justification)
|
|
312
|
+
*/
|
|
313
|
+
detectWhy(description) {
|
|
314
|
+
const whyPatterns = [
|
|
315
|
+
/\bproblem\b/i,
|
|
316
|
+
/\bsolve[sd]?\b/i,
|
|
317
|
+
/\bchallenge\b/i,
|
|
318
|
+
/\bpain\s+point/i,
|
|
319
|
+
/\bissue\b/i,
|
|
320
|
+
/\bwhy\b/i,
|
|
321
|
+
/\bbecause\b/i,
|
|
322
|
+
/\benables?\b/i,
|
|
323
|
+
/\bvalue\s+proposition/i,
|
|
324
|
+
/\bbenefit/i,
|
|
325
|
+
/\bjustification/i,
|
|
326
|
+
/\bgoal\b/i,
|
|
327
|
+
/\bobjective\b/i,
|
|
328
|
+
/\bpurpose\b/i
|
|
329
|
+
];
|
|
330
|
+
return whyPatterns.some(pattern => pattern.test(description));
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Detects if description contains WHO (target users)
|
|
334
|
+
*/
|
|
335
|
+
detectWho(description) {
|
|
336
|
+
const whoPatterns = [
|
|
337
|
+
/\buser[s]?\b/i,
|
|
338
|
+
/\bcustomer[s]?\b/i,
|
|
339
|
+
/\btarget\s+(audience|users?|customers?)/i,
|
|
340
|
+
/\bpersona[s]?\b/i,
|
|
341
|
+
/\bstakeholder[s]?\b/i,
|
|
342
|
+
/\b(developer|designer|admin|manager)[s]?\b/i,
|
|
343
|
+
/\bfor\s+(teams?|companies|individuals)/i
|
|
344
|
+
];
|
|
345
|
+
return whoPatterns.some(pattern => pattern.test(description));
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Detects if description contains WHAT (features, scope)
|
|
349
|
+
*/
|
|
350
|
+
detectWhat(description) {
|
|
351
|
+
const whatPatterns = [
|
|
352
|
+
/\bfeature[s]?\b/i,
|
|
353
|
+
/\bfunctionality\b/i,
|
|
354
|
+
/\bcapabilit(y|ies)/i,
|
|
355
|
+
/\bprovides?\b/i,
|
|
356
|
+
/\binclude[s]?\b/i,
|
|
357
|
+
/\bsupport[s]?\b/i,
|
|
358
|
+
/\ballow[s]?\b/i,
|
|
359
|
+
/\benable[s]?\b/i,
|
|
360
|
+
/\bMVP\b/i,
|
|
361
|
+
/\bscope\b/i
|
|
362
|
+
];
|
|
363
|
+
return whatPatterns.some(pattern => pattern.test(description));
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Detects if description contains success criteria
|
|
367
|
+
*/
|
|
368
|
+
detectSuccessCriteria(description) {
|
|
369
|
+
const successPatterns = [
|
|
370
|
+
/\bmetric[s]?\b/i,
|
|
371
|
+
/\bKPI[s]?\b/i,
|
|
372
|
+
/\bmeasure[sd]?\b/i,
|
|
373
|
+
/\bsuccess\s+(criteria|metric)/i,
|
|
374
|
+
/\b\d+%/,
|
|
375
|
+
/\bperformance\s+target/i,
|
|
376
|
+
/\bgoal[s]?\b.*\d+/i
|
|
377
|
+
];
|
|
378
|
+
return successPatterns.some(pattern => pattern.test(description));
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Detects ambiguous terms that need clarification
|
|
382
|
+
*/
|
|
383
|
+
detectAmbiguousTerms(description) {
|
|
384
|
+
const ambiguousTerms = [];
|
|
385
|
+
const ambiguityMap = [
|
|
386
|
+
{
|
|
387
|
+
pattern: /\bfast\b/gi,
|
|
388
|
+
suggestion: 'Can you specify a target response time? (e.g., "< 200ms API response", "page loads in 2s")'
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
pattern: /\bscalable\b/gi,
|
|
392
|
+
suggestion: 'What scale do you need to support? (e.g., "1000 concurrent users", "100k requests/hour")'
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
pattern: /\buser[- ]friendly\b/gi,
|
|
396
|
+
suggestion: 'What makes it user-friendly? (e.g., "3-click checkout", "mobile-responsive", "keyboard shortcuts")'
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
pattern: /\beasy\s+to\s+use\b/gi,
|
|
400
|
+
suggestion: 'What does easy mean for your users? (e.g., "no training required", "5-minute onboarding", "intuitive navigation")'
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
pattern: /\bhigh\s+quality\b/gi,
|
|
404
|
+
suggestion: 'How do you define quality? (e.g., "zero critical bugs in production", "90% test coverage", "< 5% error rate")'
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
pattern: /\breliable\b/gi,
|
|
408
|
+
suggestion: 'What reliability level do you need? (e.g., "99.9% uptime", "zero data loss", "automatic failover")'
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
pattern: /\bsecure\b/gi,
|
|
412
|
+
suggestion: 'What security requirements apply? (e.g., "SOC 2 compliant", "end-to-end encryption", "OAuth 2.0")'
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
pattern: /\bmodern\b/gi,
|
|
416
|
+
suggestion: 'What technologies or approaches are you considering? (e.g., "React + TypeScript", "microservices", "serverless")'
|
|
417
|
+
}
|
|
418
|
+
];
|
|
419
|
+
for (const { pattern, suggestion } of ambiguityMap) {
|
|
420
|
+
const matches = description.match(pattern);
|
|
421
|
+
if (matches) {
|
|
422
|
+
for (const match of matches) {
|
|
423
|
+
const context = this.extractContext(description, match);
|
|
424
|
+
ambiguousTerms.push({
|
|
425
|
+
term: match,
|
|
426
|
+
context,
|
|
427
|
+
suggestion
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
return ambiguousTerms;
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Extracts surrounding context for an ambiguous term
|
|
436
|
+
*/
|
|
437
|
+
extractContext(text, term) {
|
|
438
|
+
const index = text.toLowerCase().indexOf(term.toLowerCase());
|
|
439
|
+
if (index === -1)
|
|
440
|
+
return '';
|
|
441
|
+
const start = Math.max(0, index - 30);
|
|
442
|
+
const end = Math.min(text.length, index + term.length + 30);
|
|
443
|
+
return '...' + text.slice(start, end).trim() + '...';
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Calculates quality score based on completeness and clarity
|
|
447
|
+
*/
|
|
448
|
+
calculateQualityScore(metrics) {
|
|
449
|
+
let score = 0;
|
|
450
|
+
// WHY is most important (30 points)
|
|
451
|
+
if (metrics.hasWhy)
|
|
452
|
+
score += 30;
|
|
453
|
+
// WHO is critical (20 points)
|
|
454
|
+
if (metrics.hasWho)
|
|
455
|
+
score += 20;
|
|
456
|
+
// WHAT is essential (20 points)
|
|
457
|
+
if (metrics.hasWhat)
|
|
458
|
+
score += 20;
|
|
459
|
+
// Success criteria (15 points)
|
|
460
|
+
if (metrics.hasSuccessCriteria)
|
|
461
|
+
score += 15;
|
|
462
|
+
// Penalize ambiguous terms (up to -15 points)
|
|
463
|
+
const ambiguityPenalty = Math.min(15, metrics.ambiguousTermCount * 5);
|
|
464
|
+
score -= ambiguityPenalty;
|
|
465
|
+
// Length bonus (up to 15 points) - adequate detail
|
|
466
|
+
if (metrics.descriptionLength > 100)
|
|
467
|
+
score += 5;
|
|
468
|
+
if (metrics.descriptionLength > 300)
|
|
469
|
+
score += 5;
|
|
470
|
+
if (metrics.descriptionLength > 500)
|
|
471
|
+
score += 5;
|
|
472
|
+
return Math.max(0, Math.min(100, score));
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Extracts answers for a specific category
|
|
476
|
+
*/
|
|
477
|
+
extractAnswersByCategory(questions, answers, category) {
|
|
478
|
+
const categoryQuestions = questions.filter(q => q.category === category);
|
|
479
|
+
const categoryAnswers = categoryQuestions
|
|
480
|
+
.map(q => answers[q.id])
|
|
481
|
+
.filter(a => a && a.trim().length > 0);
|
|
482
|
+
return categoryAnswers.join(' ');
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Builds the enriched description from all components
|
|
486
|
+
*/
|
|
487
|
+
buildEnrichedDescription(components) {
|
|
488
|
+
const parts = [];
|
|
489
|
+
// Start with original if it has content
|
|
490
|
+
if (components.original && components.original.trim().length > 0) {
|
|
491
|
+
parts.push(`## Original Description\n${components.original}`);
|
|
492
|
+
}
|
|
493
|
+
// Add WHY
|
|
494
|
+
if (components.why) {
|
|
495
|
+
parts.push(`## Business Justification (Why)\n${components.why}`);
|
|
496
|
+
}
|
|
497
|
+
// Add WHO
|
|
498
|
+
if (components.who) {
|
|
499
|
+
parts.push(`## Target Users (Who)\n${components.who}`);
|
|
500
|
+
}
|
|
501
|
+
// Add WHAT
|
|
502
|
+
if (components.what) {
|
|
503
|
+
parts.push(`## Core Features (What)\n${components.what}`);
|
|
504
|
+
}
|
|
505
|
+
// Add HOW (optional)
|
|
506
|
+
if (components.how) {
|
|
507
|
+
parts.push(`## Technical Approach (How)\n${components.how}`);
|
|
508
|
+
}
|
|
509
|
+
// Add success criteria
|
|
510
|
+
if (components.successCriteria) {
|
|
511
|
+
parts.push(`## Success Criteria\n${components.successCriteria}`);
|
|
512
|
+
}
|
|
513
|
+
return parts.join('\n\n');
|
|
514
|
+
}
|
|
515
|
+
};
|
|
516
|
+
RequirementsClarificationService = __decorate([
|
|
517
|
+
injectable(),
|
|
518
|
+
__param(0, inject(TYPES.FileSystemPort)),
|
|
519
|
+
__param(1, inject(TYPES.LoggerPort)),
|
|
520
|
+
__metadata("design:paramtypes", [Object, Object])
|
|
521
|
+
], RequirementsClarificationService);
|
|
522
|
+
export { RequirementsClarificationService };
|
|
523
|
+
//# sourceMappingURL=RequirementsClarificationService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequirementsClarificationService.js","sourceRoot":"","sources":["../../../src/application/services/RequirementsClarificationService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAEzD,OAAO,EAKL,gBAAgB,EAEjB,MAAM,uBAAuB,CAAC;AAOxB,IAAM,gCAAgC,GAAtC,MAAM,gCAAgC;IAEM;IACJ;IAF7C,YACiD,UAA0B,EAC9B,MAAkB;QADd,eAAU,GAAV,UAAU,CAAgB;QAC9B,WAAM,GAAN,MAAM,CAAY;IAC5D,CAAC;IAEJ;;OAEG;IACH,KAAK,CAAC,kBAAkB,CACtB,WAAmB,EACnB,WAAoB;QAEpB,MAAM,aAAa,GAAG,MAAM,EAAE,CAAC;QAE/B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,uDAAuD,EAAE;YACxE,aAAa;YACb,iBAAiB,EAAE,WAAW,CAAC,MAAM;SACtC,CAAC,CAAC;QAEH,0CAA0C;QAC1C,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;QAEpE,mBAA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4BAA4B,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;QAChE,CAAC;QAED,UAAU;QACV,IAAI,UAAU,CAAC,GAAG,EAAE,CAAC;YACnB,KAAK,CAAC,IAAI,CAAC,oCAAoC,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC;QACnE,CAAC;QAED,UAAU;QACV,IAAI,UAAU,CAAC,GAAG,EAAE,CAAC;YACnB,KAAK,CAAC,IAAI,CAAC,0BAA0B,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC;QACzD,CAAC;QAED,WAAW;QACX,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC;YACpB,KAAK,CAAC,IAAI,CAAC,4BAA4B,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;QAC5D,CAAC;QAED,qBAAqB;QACrB,IAAI,UAAU,CAAC,GAAG,EAAE,CAAC;YACnB,KAAK,CAAC,IAAI,CAAC,gCAAgC,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC;QAC/D,CAAC;QAED,uBAAuB;QACvB,IAAI,UAAU,CAAC,eAAe,EAAE,CAAC;YAC/B,KAAK,CAAC,IAAI,CAAC,wBAAwB,UAAU,CAAC,eAAe,EAAE,CAAC,CAAC;QACnE,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;CACF,CAAA;AAllBY,gCAAgC;IAD5C,UAAU,EAAE;IAGR,WAAA,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;IAC5B,WAAA,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;;GAHhB,gCAAgC,CAklB5C"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SteeringDocumentService } from './SteeringDocumentService.js';
|
|
2
|
+
/**
|
|
3
|
+
* Ensure the static steering documents exist for a project, creating them when missing.
|
|
4
|
+
* This centralises the shared logic used by different entrypoints (CLI, simplified MCP, etc.)
|
|
5
|
+
*/
|
|
6
|
+
export declare function ensureStaticSteeringDocuments(projectPath: string, steeringService: SteeringDocumentService): Promise<void>;
|