@spec-driven-steroids/mcp 0.2.2

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Lindoélio Lázaro
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,75 @@
1
+ #!/usr/bin/env node
2
+ interface FormattedError {
3
+ errorType: string;
4
+ context: string;
5
+ suggestedFix: string;
6
+ skillDocLink?: string;
7
+ }
8
+ export declare function formatError(error: FormattedError): string;
9
+ export declare function findLineNumber(content: string, pattern: RegExp): number;
10
+ export declare function addLineInfo(error: string, line: number): string;
11
+ /**
12
+ * Tool: verify_spec_structure
13
+ * Validates spec folder structure and file existence
14
+ */
15
+ declare function verifySpecStructure(slug: string, targetDir?: string): Promise<{
16
+ valid: boolean;
17
+ errors: string[];
18
+ warnings: string[];
19
+ }>;
20
+ /**
21
+ * Tool: verify_requirements_file
22
+ * Validates a requirements.md file has all required content
23
+ */
24
+ declare function verifyRequirementsFile(content: string): {
25
+ valid: boolean;
26
+ errors: string[];
27
+ requirementsFound: string[];
28
+ earsPatterns: string[];
29
+ };
30
+ /**
31
+ * Tool: verify_design_file
32
+ * Validates a design.md file has all required content and proper structure
33
+ */
34
+ declare function verifyDesignFile(content: string, requirementsContent?: string): {
35
+ valid: boolean;
36
+ errors: string[];
37
+ warnings: string[];
38
+ traceabilityReport: {
39
+ linked: string[];
40
+ orphaned: string[];
41
+ invalidReqRefs: string[];
42
+ };
43
+ };
44
+ /**
45
+ * Tool: verify_tasks_file
46
+ * Validates a tasks.md file has all required content and proper structure
47
+ */
48
+ declare function verifyTasksFile(content: string): {
49
+ valid: boolean;
50
+ errors: string[];
51
+ tasksFound: number;
52
+ phases: string[];
53
+ traceabilityReport: {
54
+ linked: string[];
55
+ missingTraces: string[];
56
+ };
57
+ };
58
+ /**
59
+ * Tool: verify_complete_spec
60
+ * Validates all three spec files together for complete workflow validation
61
+ */
62
+ declare function verifyCompleteSpec(slug: string, targetDir?: string): Promise<{
63
+ valid: boolean;
64
+ overallErrors: string[];
65
+ requirementsErrors: string[];
66
+ designErrors: string[];
67
+ tasksErrors: string[];
68
+ traceabilityReport: {
69
+ complete: boolean;
70
+ orphans: string[];
71
+ circular: string[];
72
+ };
73
+ }>;
74
+ export { verifySpecStructure, verifyRequirementsFile, verifyDesignFile, verifyTasksFile, verifyCompleteSpec };
75
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAiBA,UAAU,cAAc;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,c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,CAAC;QACjB,aAAa,EAAE,MAAM,EAAE,CAAC;KACzB,CAAC;CACH,CAkIA;AAED;;;GAGG;AACH,iBAAe,kBAAkB,CAC/B,IAAI,EAAE,MAAM,EACZ,SAAS,GAAE,MAAsB,GAChC,OAAO,CAAC;IACT,KAAK,EAAE,OAAO,CAAC;IACf,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,kBAAkB,EAAE;QAClB,QAAQ,EAAE,OAAO,CAAC;QAClB,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;CACH,CAAC,CA8GD;AAwKD,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EACnB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,753 @@
1
+ #!/usr/bin/env node
2
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
5
+ import fs from "fs/promises";
6
+ import path from "path";
7
+ const SKILL_DOCS = {
8
+ requirements: "packages/standards/src/templates/universal/skills/spec-driven-requirements-writer/SKILL.md",
9
+ design: "packages/standards/src/templates/universal/skills/spec-driven-technical-designer/SKILL.md",
10
+ tasks: "packages/standards/src/templates/universal/skills/spec-driven-task-decomposer/SKILL.md",
11
+ implementation: "packages/standards/src/templates/universal/skills/spec-driven-task-implementer/SKILL.md"
12
+ };
13
+ export function formatError(error) {
14
+ const { errorType, context, suggestedFix, skillDocLink } = error;
15
+ let message = `[${errorType}] → ${context} → ${suggestedFix}`;
16
+ if (skillDocLink) {
17
+ message += `\n See: ${skillDocLink}`;
18
+ }
19
+ return message;
20
+ }
21
+ export function findLineNumber(content, pattern) {
22
+ const lines = content.split('\n');
23
+ for (let i = 0; i < lines.length; i++) {
24
+ if (pattern.test(lines[i])) {
25
+ return i + 1;
26
+ }
27
+ }
28
+ return -1;
29
+ }
30
+ export function addLineInfo(error, line) {
31
+ if (line > 0) {
32
+ return `${error}\n Line: ${line}`;
33
+ }
34
+ return error;
35
+ }
36
+ function unique(values) {
37
+ return [...new Set(values)];
38
+ }
39
+ function stripInlineMarkdown(value) {
40
+ return value.replace(/[*_`]/g, '');
41
+ }
42
+ function extractRequirementIds(content) {
43
+ const fromHeadings = Array.from(content.matchAll(/^###\s+Requirement\s+(\d+)\s*:/gmi), (match) => `REQ-${match[1]}`);
44
+ const explicit = content.match(/REQ-\d+/g) || [];
45
+ return unique([...fromHeadings, ...explicit]);
46
+ }
47
+ function extractAcceptanceCriteriaRefs(content) {
48
+ const refs = [];
49
+ const explicit = content.match(/REQ-\d+\.\d+/g) || [];
50
+ refs.push(...explicit);
51
+ const lines = content.split('\n');
52
+ let currentReq = null;
53
+ for (const line of lines) {
54
+ const heading = line.match(/^###\s+Requirement\s+(\d+)\s*:/i);
55
+ if (heading) {
56
+ currentReq = heading[1];
57
+ continue;
58
+ }
59
+ if (!currentReq) {
60
+ continue;
61
+ }
62
+ const criteria = line.match(/^\s*(\d+)(?:\.\d+)?(?:\.)?\s+/);
63
+ if (criteria) {
64
+ refs.push(`REQ-${currentReq}.${criteria[1]}`);
65
+ }
66
+ }
67
+ return unique(refs);
68
+ }
69
+ const server = new Server({
70
+ name: "spec-driven-steroids-mcp",
71
+ version: "0.2.1",
72
+ }, {
73
+ capabilities: {
74
+ tools: {},
75
+ },
76
+ });
77
+ /**
78
+ * Tool: verify_spec_structure
79
+ * Validates spec folder structure and file existence
80
+ */
81
+ async function verifySpecStructure(slug, targetDir = process.cwd()) {
82
+ const errors = [];
83
+ const warnings = [];
84
+ const specDir = path.join(targetDir, "specs", "changes", slug);
85
+ // Check if directory exists
86
+ let files = [];
87
+ try {
88
+ const stats = await fs.stat(specDir);
89
+ if (!stats.isDirectory()) {
90
+ const fileContent = await fs.readFile(specDir, "utf-8").catch(() => "");
91
+ if (fileContent.trim().length === 0) {
92
+ files = [];
93
+ }
94
+ else {
95
+ errors.push(formatError({
96
+ errorType: "Structure Error",
97
+ context: `Path is not a directory: ${specDir}`,
98
+ suggestedFix: "Create spec directory with: mkdir -p specs/changes/{slug}"
99
+ }));
100
+ return { valid: false, errors, warnings };
101
+ }
102
+ }
103
+ else {
104
+ files = await fs.readdir(specDir);
105
+ }
106
+ }
107
+ catch {
108
+ errors.push(formatError({
109
+ errorType: "Structure Error",
110
+ context: `Spec directory does not exist: ${specDir}`,
111
+ suggestedFix: "Create spec directory with: mkdir -p specs/changes/{slug}"
112
+ }));
113
+ return { valid: false, errors, warnings };
114
+ }
115
+ // Check for required files
116
+ const requiredFiles = ["requirements.md", "design.md", "tasks.md"];
117
+ for (const requiredFile of requiredFiles) {
118
+ if (!files.includes(requiredFile)) {
119
+ const skillMap = {
120
+ "requirements.md": SKILL_DOCS.requirements,
121
+ "design.md": SKILL_DOCS.design,
122
+ "tasks.md": SKILL_DOCS.tasks
123
+ };
124
+ errors.push(formatError({
125
+ errorType: "Structure Error",
126
+ context: `Missing required file: ${requiredFile}`,
127
+ suggestedFix: `Create ${requiredFile} with proper structure`,
128
+ skillDocLink: skillMap[requiredFile]
129
+ }));
130
+ }
131
+ }
132
+ // Check for unexpected files
133
+ const allowedFiles = [...requiredFiles];
134
+ const unexpectedFiles = files.filter(f => !allowedFiles.includes(f));
135
+ if (unexpectedFiles.length > 0) {
136
+ errors.push(formatError({
137
+ errorType: "Structure Error",
138
+ context: `Unexpected files found: ${unexpectedFiles.join(", ")}`,
139
+ suggestedFix: "Only requirements.md, design.md, and tasks.md are allowed. Remove or rename extra files"
140
+ }));
141
+ }
142
+ return {
143
+ valid: errors.length === 0,
144
+ errors,
145
+ warnings
146
+ };
147
+ }
148
+ /**
149
+ * Tool: verify_requirements_file
150
+ * Validates a requirements.md file has all required content
151
+ */
152
+ function verifyRequirementsFile(content) {
153
+ const errors = [];
154
+ const requirementsFound = [];
155
+ const earsPatterns = [];
156
+ const enforceDocumentSections = content.includes('# Requirements Document');
157
+ // Check for required sections
158
+ if (enforceDocumentSections && !content.includes('## Introduction')) {
159
+ errors.push(formatError({
160
+ errorType: "Structure Error",
161
+ context: "Introduction section not found",
162
+ suggestedFix: "Add ## Introduction section at top with project background and objectives",
163
+ skillDocLink: SKILL_DOCS.requirements
164
+ }));
165
+ }
166
+ if (enforceDocumentSections && !content.includes('## Glossary')) {
167
+ errors.push(formatError({
168
+ errorType: "Structure Error",
169
+ context: "Glossary section not found",
170
+ suggestedFix: "Add ## Glossary section defining key terms",
171
+ skillDocLink: SKILL_DOCS.requirements
172
+ }));
173
+ }
174
+ if (enforceDocumentSections && !content.includes('## Requirements')) {
175
+ errors.push(formatError({
176
+ errorType: "Structure Error",
177
+ context: "Requirements section not found",
178
+ suggestedFix: "Add ## Requirements section with REQ-X numbering",
179
+ skillDocLink: SKILL_DOCS.requirements
180
+ }));
181
+ }
182
+ // Extract requirement IDs
183
+ const reqMatches = extractRequirementIds(content);
184
+ if (reqMatches.length > 0) {
185
+ requirementsFound.push(...reqMatches);
186
+ }
187
+ else {
188
+ errors.push(formatError({
189
+ errorType: "Format Error",
190
+ context: "No REQ-X IDs found",
191
+ suggestedFix: "Number each requirement with REQ-1, REQ-2, etc.",
192
+ skillDocLink: SKILL_DOCS.requirements
193
+ }));
194
+ }
195
+ // Extract EARS patterns
196
+ const earsKeywords = ["WHEN", "IF", "THEN", "SHALL", "WHILE", "WHERE"];
197
+ for (const keyword of earsKeywords) {
198
+ if (content.includes(keyword)) {
199
+ earsPatterns.push(keyword);
200
+ }
201
+ }
202
+ if (earsPatterns.length === 0) {
203
+ errors.push(formatError({
204
+ errorType: "Format Error",
205
+ context: "No EARS patterns detected",
206
+ suggestedFix: "Use EARS keywords (WHEN, IF, THEN, SHALL, WHILE, WHERE) to structure requirements",
207
+ skillDocLink: SKILL_DOCS.requirements
208
+ }));
209
+ }
210
+ // Check for acceptance criteria numbering
211
+ const acceptanceCriteriaMatches = content.match(/^\s*\d+(?:\.\d+)?(?:\.)?\s+/gm);
212
+ if (!acceptanceCriteriaMatches || acceptanceCriteriaMatches.length === 0) {
213
+ errors.push(formatError({
214
+ errorType: "Format Error",
215
+ context: "No 1.1, 1.2, etc. numbering found",
216
+ suggestedFix: "Add numbered acceptance criteria for each requirement",
217
+ skillDocLink: SKILL_DOCS.requirements
218
+ }));
219
+ }
220
+ return {
221
+ valid: errors.length === 0,
222
+ errors,
223
+ requirementsFound,
224
+ earsPatterns
225
+ };
226
+ }
227
+ /**
228
+ * Tool: verify_design_file
229
+ * Validates a design.md file has all required content and proper structure
230
+ */
231
+ function verifyDesignFile(content, requirementsContent) {
232
+ const errors = [];
233
+ const warnings = [];
234
+ const linked = [];
235
+ const orphaned = [];
236
+ const invalidReqRefs = [];
237
+ const enforceDocumentSections = /##\s+(Overview|Code Anatomy|Traceability Matrix)/i.test(content) || content.includes('# Design Document');
238
+ // Check for required sections (only when validating a full design document)
239
+ if (enforceDocumentSections && !content.includes('## Overview')) {
240
+ errors.push(formatError({
241
+ errorType: "Structure Error",
242
+ context: "Overview section not found",
243
+ suggestedFix: "Add ## Overview section describing high-level design approach",
244
+ skillDocLink: SKILL_DOCS.design
245
+ }));
246
+ }
247
+ if (enforceDocumentSections && !content.includes('## System Architecture')) {
248
+ errors.push(formatError({
249
+ errorType: "Structure Error",
250
+ context: "System Architecture section not found",
251
+ suggestedFix: "Add ## System Architecture section with Mermaid diagrams",
252
+ skillDocLink: SKILL_DOCS.design
253
+ }));
254
+ }
255
+ if (enforceDocumentSections && !content.includes('## Code Anatomy')) {
256
+ errors.push(formatError({
257
+ errorType: "Structure Error",
258
+ context: "Code Anatomy section not found",
259
+ suggestedFix: "Add ## Code Anatomy section with file paths and details",
260
+ skillDocLink: SKILL_DOCS.design
261
+ }));
262
+ }
263
+ // Check for Mermaid diagrams
264
+ if (!content.includes('```mermaid')) {
265
+ errors.push(formatError({
266
+ errorType: "Structure Error",
267
+ context: "No Mermaid diagram code blocks found",
268
+ suggestedFix: "Add Mermaid diagram in ```mermaid ... ``` code blocks",
269
+ skillDocLink: SKILL_DOCS.design
270
+ }));
271
+ }
272
+ // Extract design element IDs
273
+ const desMatches = Array.from(content.matchAll(/^###\s+(DES-\d+)\b/gm), (match) => match[1]);
274
+ if (!desMatches || desMatches.length === 0) {
275
+ errors.push(formatError({
276
+ errorType: "Format Error",
277
+ context: "No DES-X design element IDs found",
278
+ suggestedFix: "Number design elements with DES-1, DES-2, etc.",
279
+ skillDocLink: SKILL_DOCS.design
280
+ }));
281
+ }
282
+ else {
283
+ const uniqueDes = unique(desMatches);
284
+ const reqIds = requirementsContent ? extractAcceptanceCriteriaRefs(requirementsContent) : [];
285
+ const lines = content.split('\n');
286
+ const hasAnyTraceabilityTags = /_Implements:/i.test(content);
287
+ if (!hasAnyTraceabilityTags) {
288
+ return {
289
+ valid: errors.length === 0,
290
+ errors,
291
+ warnings,
292
+ traceabilityReport: {
293
+ linked,
294
+ orphaned,
295
+ invalidReqRefs
296
+ }
297
+ };
298
+ }
299
+ for (let i = 0; i < uniqueDes.length; i++) {
300
+ const desId = uniqueDes[i];
301
+ const start = lines.findIndex((line) => new RegExp(`^###\\s+${desId}\\b`).test(line));
302
+ const end = i < uniqueDes.length - 1
303
+ ? lines.findIndex((line, index) => index > start && new RegExp(`^###\\s+${uniqueDes[i + 1]}\\b`).test(line))
304
+ : lines.length;
305
+ const section = lines.slice(start, end > -1 ? end : lines.length).join('\n');
306
+ const implementsLine = section.match(/_Implements:[^\n]+/i)?.[0] || '';
307
+ const reqRefs = implementsLine.match(/REQ-\d+(?:\.\d+)?/g) || [];
308
+ if (reqRefs.length === 0) {
309
+ const line = findLineNumber(content, new RegExp(`^###\\s+${desId}\\b`, 'm'));
310
+ const orphan = addLineInfo(desId, line);
311
+ orphaned.push(orphan);
312
+ errors.push(formatError({
313
+ errorType: "Traceability Error",
314
+ context: `${desId} has no requirement traceability link`,
315
+ suggestedFix: `Add _Implements: REQ-X.Y_ under ${desId}`,
316
+ skillDocLink: SKILL_DOCS.design
317
+ }));
318
+ continue;
319
+ }
320
+ for (const reqRef of reqRefs) {
321
+ linked.push(`${desId} -> ${reqRef}`);
322
+ if (reqIds.length > 0 && !reqIds.includes(reqRef)) {
323
+ const line = findLineNumber(content, new RegExp(reqRef.replace('.', '\\.'), 'm'));
324
+ const invalid = addLineInfo(formatError({
325
+ errorType: "Traceability Error",
326
+ context: `${desId} refers to non-existent requirement ${reqRef}`,
327
+ suggestedFix: `Fix requirement reference or create missing ${reqRef} in requirements.md`,
328
+ skillDocLink: SKILL_DOCS.design
329
+ }), line);
330
+ invalidReqRefs.push(invalid);
331
+ errors.push(invalid);
332
+ }
333
+ }
334
+ }
335
+ }
336
+ // Check for Traceability Matrix
337
+ if (enforceDocumentSections && !content.includes('## Traceability Matrix')) {
338
+ warnings.push(formatError({
339
+ errorType: "Structure Error",
340
+ context: "Traceability Matrix section not found",
341
+ suggestedFix: "Add ## Traceability Matrix section linking DES to REQ",
342
+ skillDocLink: SKILL_DOCS.design
343
+ }));
344
+ }
345
+ return {
346
+ valid: errors.length === 0,
347
+ errors,
348
+ warnings,
349
+ traceabilityReport: {
350
+ linked,
351
+ orphaned,
352
+ invalidReqRefs
353
+ }
354
+ };
355
+ }
356
+ /**
357
+ * Tool: verify_tasks_file
358
+ * Validates a tasks.md file has all required content and proper structure
359
+ */
360
+ function verifyTasksFile(content) {
361
+ const errors = [];
362
+ const linked = [];
363
+ const missingTraces = [];
364
+ const phases = [];
365
+ // Check for Overview section
366
+ if (!content.includes('## Overview')) {
367
+ errors.push(formatError({
368
+ errorType: "Structure Error",
369
+ context: "Overview section not found",
370
+ suggestedFix: "Add ## Overview section with phases list",
371
+ skillDocLink: SKILL_DOCS.tasks
372
+ }));
373
+ }
374
+ // Extract phases
375
+ const phaseMatches = content.match(/^##\s*Phase\s+\d+\s*:[^\n]*/gmi);
376
+ if (!phaseMatches || phaseMatches.length === 0) {
377
+ errors.push(formatError({
378
+ errorType: "Structure Error",
379
+ context: "No phase headers found",
380
+ suggestedFix: "Add phase sections using ## Phase 1:, ## Phase 2:, etc.",
381
+ skillDocLink: SKILL_DOCS.tasks
382
+ }));
383
+ }
384
+ else {
385
+ phases.push(...phaseMatches);
386
+ }
387
+ // Check for Final Checkpoint phase
388
+ const hasFinalCheckpoint = phases.some((phase) => /Final\s+Checkpoint/i.test(stripInlineMarkdown(phase)));
389
+ if (phases.length > 1 && !hasFinalCheckpoint) {
390
+ errors.push(formatError({
391
+ errorType: "Structure Error",
392
+ context: "Final Checkpoint phase not found",
393
+ suggestedFix: "Add ## Phase X: Final Checkpoint section at end",
394
+ skillDocLink: SKILL_DOCS.tasks
395
+ }));
396
+ }
397
+ // Extract task IDs from checkbox format
398
+ const lines = content.split('\n');
399
+ const taskMatches = content.match(/^- \[[^\]]\]\s+.*$/gm);
400
+ if (!taskMatches || taskMatches.length === 0) {
401
+ errors.push(formatError({
402
+ errorType: "Structure Error",
403
+ context: "No tasks in checkbox format found",
404
+ suggestedFix: "Add tasks with format - [ ] 1.1, - [ ] 1.2, etc.",
405
+ skillDocLink: SKILL_DOCS.tasks
406
+ }));
407
+ }
408
+ else {
409
+ let currentPhaseHeader = "";
410
+ for (let index = 0; index < lines.length; index++) {
411
+ const line = lines[index];
412
+ if (/^##\s*Phase\s+\d+\s*:/i.test(line)) {
413
+ currentPhaseHeader = line;
414
+ }
415
+ const taskMatch = line.match(/^- \[([^\]])\]\s+(.*)$/);
416
+ if (!taskMatch) {
417
+ continue;
418
+ }
419
+ const marker = taskMatch[1];
420
+ const taskLabel = taskMatch[2].trim();
421
+ const taskId = taskLabel.match(/\d+\.\d+/)?.[0] || taskLabel;
422
+ const lineNumber = index + 1;
423
+ if (![' ', '~', 'x'].includes(marker)) {
424
+ errors.push(formatError({
425
+ errorType: "Format Error",
426
+ context: "Invalid status marker detected",
427
+ suggestedFix: "Use only: [ ] (pending), [~] (in progress), [x] (completed)",
428
+ skillDocLink: SKILL_DOCS.tasks
429
+ }));
430
+ }
431
+ if (/Final\s+Checkpoint/i.test(stripInlineMarkdown(currentPhaseHeader))) {
432
+ continue;
433
+ }
434
+ const taskBlock = [line];
435
+ for (let j = index + 1; j < lines.length; j++) {
436
+ if (/^- \[[^\]]\]\s+/.test(lines[j]) || /^##\s*Phase\s+\d+\s*:/i.test(lines[j])) {
437
+ break;
438
+ }
439
+ taskBlock.push(lines[j]);
440
+ }
441
+ const taskText = taskBlock.join('\n');
442
+ const traceMatch = taskText.match(/_Implements:\s*([^_\n]+)_/i);
443
+ if (!traceMatch) {
444
+ missingTraces.push(addLineInfo(taskId, lineNumber));
445
+ continue;
446
+ }
447
+ linked.push(`${taskId} → ${traceMatch[1].trim()}`);
448
+ }
449
+ }
450
+ // Determine if traceability is required based on document structure
451
+ // If any task has a numbered ID (like 1.1, 1.2), traceability is required
452
+ const hasNumberedTaskIds = /- \[[^\]]\]\s+\d+\.\d+\b/.test(content);
453
+ const hasAnyImplementsTags = /_Implements:/i.test(content);
454
+ const traceabilityRequired = (hasNumberedTaskIds && hasFinalCheckpoint) || hasAnyImplementsTags;
455
+ if (traceabilityRequired && missingTraces.length > 0) {
456
+ errors.push(formatError({
457
+ errorType: "Traceability Error",
458
+ context: `Missing traceability links for ${missingTraces.length} task(s)`,
459
+ suggestedFix: "Add _Implements: DES-X_ (and optional REQ-X.Y) to each non-checkpoint task",
460
+ skillDocLink: SKILL_DOCS.tasks
461
+ }));
462
+ }
463
+ // Validation passes if no errors and (either no missing traces or traceability not required)
464
+ const isValid = errors.length === 0 && (!traceabilityRequired || missingTraces.length === 0);
465
+ return {
466
+ valid: isValid,
467
+ errors,
468
+ tasksFound: taskMatches?.length || 0,
469
+ phases,
470
+ traceabilityReport: {
471
+ linked,
472
+ missingTraces
473
+ }
474
+ };
475
+ }
476
+ /**
477
+ * Tool: verify_complete_spec
478
+ * Validates all three spec files together for complete workflow validation
479
+ */
480
+ async function verifyCompleteSpec(slug, targetDir = process.cwd()) {
481
+ const overallErrors = [];
482
+ const requirementsErrors = [];
483
+ const designErrors = [];
484
+ const tasksErrors = [];
485
+ const specDir = path.join(targetDir, "specs", "changes", slug);
486
+ // Check folder structure
487
+ const structureResult = await verifySpecStructure(slug, targetDir);
488
+ if (!structureResult.valid) {
489
+ overallErrors.push(...structureResult.errors);
490
+ }
491
+ // Read files
492
+ let requirementsContent = "";
493
+ let designContent = "";
494
+ let tasksContent = "";
495
+ try {
496
+ requirementsContent = await fs.readFile(path.join(specDir, "requirements.md"), "utf-8");
497
+ }
498
+ catch (e) {
499
+ const error = formatError({
500
+ errorType: "File Error",
501
+ context: "Cannot read requirements.md",
502
+ suggestedFix: "Ensure file exists in specs/changes/{slug}/ directory"
503
+ });
504
+ requirementsErrors.push(error);
505
+ overallErrors.push(error);
506
+ }
507
+ try {
508
+ designContent = await fs.readFile(path.join(specDir, "design.md"), "utf-8");
509
+ }
510
+ catch (e) {
511
+ const error = formatError({
512
+ errorType: "File Error",
513
+ context: "Cannot read design.md",
514
+ suggestedFix: "Ensure file exists in specs/changes/{slug}/ directory"
515
+ });
516
+ designErrors.push(error);
517
+ overallErrors.push(error);
518
+ }
519
+ try {
520
+ tasksContent = await fs.readFile(path.join(specDir, "tasks.md"), "utf-8");
521
+ }
522
+ catch (e) {
523
+ const error = formatError({
524
+ errorType: "File Error",
525
+ context: "Cannot read tasks.md",
526
+ suggestedFix: "Ensure file exists in specs/changes/{slug}/ directory"
527
+ });
528
+ tasksErrors.push(error);
529
+ overallErrors.push(error);
530
+ }
531
+ // Validate individual files
532
+ if (requirementsContent) {
533
+ const reqResult = verifyRequirementsFile(requirementsContent);
534
+ if (!reqResult.valid) {
535
+ requirementsErrors.push(...reqResult.errors);
536
+ }
537
+ }
538
+ if (designContent) {
539
+ const desResult = verifyDesignFile(designContent, requirementsContent);
540
+ if (!desResult.valid) {
541
+ designErrors.push(...desResult.errors);
542
+ }
543
+ }
544
+ if (tasksContent) {
545
+ const taskResult = verifyTasksFile(tasksContent);
546
+ if (!taskResult.valid) {
547
+ tasksErrors.push(...taskResult.errors);
548
+ }
549
+ }
550
+ // Cross-validate traceability
551
+ const orphans = [];
552
+ const circular = [];
553
+ // Check for orphaned design elements (no tasks implement them)
554
+ const desIds = designContent ? designContent.match(/DES-\d+/g) || [] : [];
555
+ const taskDesIds = tasksContent ? tasksContent.match(/_Implements:\s*DES-\d+/g) || [] : [];
556
+ for (const desId of desIds) {
557
+ const hasTask = taskDesIds.some(t => t.includes(desId));
558
+ if (!hasTask) {
559
+ const line = findLineNumber(designContent, new RegExp(desId));
560
+ orphans.push(addLineInfo(formatError({
561
+ errorType: "Traceability Error",
562
+ context: `${desId} has no implementing tasks`,
563
+ suggestedFix: `Add tasks with _Implements: ${desId}_ tag`,
564
+ skillDocLink: SKILL_DOCS.design
565
+ }), line));
566
+ }
567
+ }
568
+ return {
569
+ valid: overallErrors.length === 0 && requirementsErrors.length === 0 && designErrors.length === 0 && tasksErrors.length === 0,
570
+ overallErrors,
571
+ requirementsErrors,
572
+ designErrors,
573
+ tasksErrors,
574
+ traceabilityReport: {
575
+ complete: orphans.length === 0,
576
+ orphans,
577
+ circular
578
+ }
579
+ };
580
+ }
581
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
582
+ return {
583
+ tools: [
584
+ {
585
+ name: "verify_spec_structure",
586
+ description: "Validates spec folder structure and file existence (requires: requirements.md, design.md, tasks.md in specs/changes/<slug>/).",
587
+ inputSchema: {
588
+ type: "object",
589
+ properties: {
590
+ slug: {
591
+ type: "string",
592
+ description: "Short identifier for the spec (e.g., 'rate-limiter-impl')."
593
+ },
594
+ targetDir: {
595
+ type: "string",
596
+ description: "Base directory to check (default: current working directory)."
597
+ }
598
+ },
599
+ required: ["slug"]
600
+ }
601
+ },
602
+ {
603
+ name: "verify_requirements_file",
604
+ description: "Validates a requirements.md file has all required sections, EARS patterns, and proper numbering.",
605
+ inputSchema: {
606
+ type: "object",
607
+ properties: {
608
+ content: {
609
+ type: "string",
610
+ description: "The Markdown content of requirements.md file."
611
+ }
612
+ },
613
+ required: ["content"]
614
+ }
615
+ },
616
+ {
617
+ name: "verify_design_file",
618
+ description: "Validates a design.md file has all required sections, Mermaid diagrams, design element numbering, and traceability links.",
619
+ inputSchema: {
620
+ type: "object",
621
+ properties: {
622
+ content: {
623
+ type: "string",
624
+ description: "The Markdown content of design.md file."
625
+ },
626
+ requirementsContent: {
627
+ type: "string",
628
+ description: "The content from requirements.md for traceability verification (optional but recommended)."
629
+ }
630
+ },
631
+ required: ["content"]
632
+ }
633
+ },
634
+ {
635
+ name: "verify_tasks_file",
636
+ description: "Validates a tasks.md file has proper structure, numbering, traceability, and includes Final Checkpoint phase.",
637
+ inputSchema: {
638
+ type: "object",
639
+ properties: {
640
+ content: {
641
+ type: "string",
642
+ description: "The Markdown content of tasks.md file."
643
+ },
644
+ designContent: {
645
+ type: "string",
646
+ description: "The content from design.md for traceability verification (optional but recommended)."
647
+ }
648
+ },
649
+ required: ["content"]
650
+ }
651
+ },
652
+ {
653
+ name: "verify_complete_spec",
654
+ description: "Validates all three spec files (requirements.md, design.md, tasks.md) together for complete workflow validation and cross-file traceability.",
655
+ inputSchema: {
656
+ type: "object",
657
+ properties: {
658
+ slug: {
659
+ type: "string",
660
+ description: "Short identifier for the spec (e.g., 'rate-limiter-impl')."
661
+ },
662
+ targetDir: {
663
+ type: "string",
664
+ description: "Base directory to check (default: current working directory)."
665
+ }
666
+ },
667
+ required: ["slug"]
668
+ }
669
+ }
670
+ ]
671
+ };
672
+ });
673
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
674
+ const { name, arguments: args } = request.params;
675
+ if (!args) {
676
+ throw new Error(`No arguments provided for tool: ${name}`);
677
+ }
678
+ switch (name) {
679
+ case "verify_spec_structure": {
680
+ const result = await verifySpecStructure(args.slug, args.targetDir);
681
+ return {
682
+ content: [
683
+ {
684
+ type: "text",
685
+ text: JSON.stringify(result, null, 2)
686
+ }
687
+ ],
688
+ isError: !result.valid
689
+ };
690
+ }
691
+ case "verify_requirements_file": {
692
+ const result = verifyRequirementsFile(args.content);
693
+ return {
694
+ content: [
695
+ {
696
+ type: "text",
697
+ text: JSON.stringify(result, null, 2)
698
+ }
699
+ ],
700
+ isError: !result.valid
701
+ };
702
+ }
703
+ case "verify_design_file": {
704
+ const result = verifyDesignFile(args.content, args.requirementsContent);
705
+ return {
706
+ content: [
707
+ {
708
+ type: "text",
709
+ text: JSON.stringify(result, null, 2)
710
+ }
711
+ ],
712
+ isError: !result.valid
713
+ };
714
+ }
715
+ case "verify_tasks_file": {
716
+ const result = verifyTasksFile(args.content);
717
+ return {
718
+ content: [
719
+ {
720
+ type: "text",
721
+ text: JSON.stringify(result, null, 2)
722
+ }
723
+ ],
724
+ isError: !result.valid
725
+ };
726
+ }
727
+ case "verify_complete_spec": {
728
+ const result = await verifyCompleteSpec(args.slug, args.targetDir);
729
+ return {
730
+ content: [
731
+ {
732
+ type: "text",
733
+ text: JSON.stringify(result, null, 2)
734
+ }
735
+ ],
736
+ isError: !result.valid
737
+ };
738
+ }
739
+ default:
740
+ throw new Error(`Unknown tool: ${name}`);
741
+ }
742
+ });
743
+ export { verifySpecStructure, verifyRequirementsFile, verifyDesignFile, verifyTasksFile, verifyCompleteSpec };
744
+ async function main() {
745
+ const transport = new StdioServerTransport();
746
+ await server.connect(transport);
747
+ console.error("Spec-Driven Steroids MCP Server running on stdio");
748
+ }
749
+ main().catch((error) => {
750
+ console.error("Fatal error in MCP Server:", error);
751
+ process.exit(1);
752
+ });
753
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAA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+ {
2
+ "name": "@spec-driven-steroids/mcp",
3
+ "version": "0.2.2",
4
+ "description": "MCP Server for Spec Driven Steroids structure enforcement",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "spec-driven-mcp": "dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "package.json",
13
+ "README.md",
14
+ "LICENSE"
15
+ ],
16
+ "dependencies": {
17
+ "@modelcontextprotocol/sdk": "^1.26.0"
18
+ },
19
+ "devDependencies": {
20
+ "@types/node": "^25.2.1",
21
+ "typescript": "^5.9.3",
22
+ "@spec-driven-steroids/test-utils": "0.1.0"
23
+ },
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/lindoelio/spec-driven-steroids.git"
27
+ },
28
+ "author": "Lindoélio Lázaro <lindoelio@gmail.com>",
29
+ "license": "MIT",
30
+ "engines": {
31
+ "node": ">=20.0.0"
32
+ },
33
+ "scripts": {
34
+ "build": "tsc",
35
+ "start": "node dist/index.js",
36
+ "dev": "tsc -w",
37
+ "test": "vitest run",
38
+ "test:ui": "vitest --ui",
39
+ "test:coverage": "vitest --coverage"
40
+ }
41
+ }