specky-sdd 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.
Files changed (78) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +446 -0
  3. package/dist/constants.d.ts +68 -0
  4. package/dist/constants.d.ts.map +1 -0
  5. package/dist/constants.js +120 -0
  6. package/dist/constants.js.map +1 -0
  7. package/dist/index.d.ts +10 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +95 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/schemas/common.d.ts +8 -0
  12. package/dist/schemas/common.d.ts.map +1 -0
  13. package/dist/schemas/common.js +18 -0
  14. package/dist/schemas/common.js.map +1 -0
  15. package/dist/schemas/pipeline.d.ts +296 -0
  16. package/dist/schemas/pipeline.d.ts.map +1 -0
  17. package/dist/schemas/pipeline.js +132 -0
  18. package/dist/schemas/pipeline.js.map +1 -0
  19. package/dist/schemas/transcript.d.ts +59 -0
  20. package/dist/schemas/transcript.d.ts.map +1 -0
  21. package/dist/schemas/transcript.js +61 -0
  22. package/dist/schemas/transcript.js.map +1 -0
  23. package/dist/schemas/utility.d.ts +92 -0
  24. package/dist/schemas/utility.d.ts.map +1 -0
  25. package/dist/schemas/utility.js +82 -0
  26. package/dist/schemas/utility.js.map +1 -0
  27. package/dist/services/codebase-scanner.d.ts +24 -0
  28. package/dist/services/codebase-scanner.d.ts.map +1 -0
  29. package/dist/services/codebase-scanner.js +185 -0
  30. package/dist/services/codebase-scanner.js.map +1 -0
  31. package/dist/services/ears-validator.d.ts +29 -0
  32. package/dist/services/ears-validator.d.ts.map +1 -0
  33. package/dist/services/ears-validator.js +163 -0
  34. package/dist/services/ears-validator.js.map +1 -0
  35. package/dist/services/file-manager.d.ts +56 -0
  36. package/dist/services/file-manager.d.ts.map +1 -0
  37. package/dist/services/file-manager.js +203 -0
  38. package/dist/services/file-manager.js.map +1 -0
  39. package/dist/services/state-machine.d.ts +46 -0
  40. package/dist/services/state-machine.d.ts.map +1 -0
  41. package/dist/services/state-machine.js +167 -0
  42. package/dist/services/state-machine.js.map +1 -0
  43. package/dist/services/template-engine.d.ts +37 -0
  44. package/dist/services/template-engine.d.ts.map +1 -0
  45. package/dist/services/template-engine.js +111 -0
  46. package/dist/services/template-engine.js.map +1 -0
  47. package/dist/services/transcript-parser.d.ts +61 -0
  48. package/dist/services/transcript-parser.d.ts.map +1 -0
  49. package/dist/services/transcript-parser.js +810 -0
  50. package/dist/services/transcript-parser.js.map +1 -0
  51. package/dist/tools/analysis.d.ts +10 -0
  52. package/dist/tools/analysis.d.ts.map +1 -0
  53. package/dist/tools/analysis.js +95 -0
  54. package/dist/tools/analysis.js.map +1 -0
  55. package/dist/tools/pipeline.d.ts +11 -0
  56. package/dist/tools/pipeline.d.ts.map +1 -0
  57. package/dist/tools/pipeline.js +583 -0
  58. package/dist/tools/pipeline.js.map +1 -0
  59. package/dist/tools/transcript.d.ts +14 -0
  60. package/dist/tools/transcript.d.ts.map +1 -0
  61. package/dist/tools/transcript.js +813 -0
  62. package/dist/tools/transcript.js.map +1 -0
  63. package/dist/tools/utility.d.ts +10 -0
  64. package/dist/tools/utility.d.ts.map +1 -0
  65. package/dist/tools/utility.js +239 -0
  66. package/dist/tools/utility.js.map +1 -0
  67. package/dist/types.d.ts +161 -0
  68. package/dist/types.d.ts.map +1 -0
  69. package/dist/types.js +6 -0
  70. package/dist/types.js.map +1 -0
  71. package/package.json +53 -0
  72. package/templates/analysis.md +54 -0
  73. package/templates/bugfix.md +45 -0
  74. package/templates/constitution.md +56 -0
  75. package/templates/design.md +47 -0
  76. package/templates/specification.md +49 -0
  77. package/templates/sync-report.md +43 -0
  78. package/templates/tasks.md +38 -0
@@ -0,0 +1,583 @@
1
+ /**
2
+ * Pipeline Tools — 8 tools for the SDD pipeline.
3
+ * Thin tools: validate input → call service → format output.
4
+ */
5
+ import { join } from "node:path";
6
+ import { CHARACTER_LIMIT, Phase, PHASE_ORDER } from "../constants.js";
7
+ import { initInputSchema, discoverInputSchema, writeSpecInputSchema, clarifyInputSchema, writeDesignInputSchema, writeTasksInputSchema, runAnalysisInputSchema, advancePhaseInputSchema, } from "../schemas/pipeline.js";
8
+ function formatError(toolName, error) {
9
+ return `[${toolName}] Error: ${error.message}`;
10
+ }
11
+ function truncate(text) {
12
+ if (text.length <= CHARACTER_LIMIT)
13
+ return text;
14
+ return text.slice(0, CHARACTER_LIMIT) + "\n\n[TRUNCATED] Response exceeded 25,000 characters. Use sdd_get_status to see current state.";
15
+ }
16
+ export function registerPipelineTools(server, fileManager, stateMachine, templateEngine, earsValidator) {
17
+ // ─── sdd_init ───
18
+ server.registerTool("sdd_init", {
19
+ title: "Initialize SDD Pipeline",
20
+ description: "Creates .specs/ directory, writes CONSTITUTION.md skeleton, and initializes the state machine. Call this first before any other SDD tool.",
21
+ inputSchema: initInputSchema,
22
+ annotations: {
23
+ readOnlyHint: false,
24
+ destructiveHint: false,
25
+ idempotentHint: false,
26
+ openWorldHint: false,
27
+ },
28
+ }, async ({ project_name, spec_dir, principles, constraints }) => {
29
+ try {
30
+ const featureDir = join(spec_dir, `001-${project_name}`);
31
+ // Ensure spec directory
32
+ await fileManager.ensureSpecDir(spec_dir);
33
+ // Render CONSTITUTION.md
34
+ const content = await templateEngine.renderWithFrontmatter("constitution", {
35
+ title: `${project_name} — Constitution`,
36
+ feature_id: `001-${project_name}`,
37
+ project_name,
38
+ author: "SDD Pipeline",
39
+ principles: principles || ["Simplicity", "Traceability", "Quality"],
40
+ constraints: constraints || ["No external API dependencies"],
41
+ description: `Foundational charter for ${project_name}`,
42
+ license: "MIT",
43
+ scope_in: "Core project features",
44
+ scope_out: "Future enhancements not in initial scope",
45
+ });
46
+ const filePath = await fileManager.writeSpecFile(featureDir, "CONSTITUTION.md", content);
47
+ // Initialize state machine
48
+ const state = stateMachine.createDefaultState(project_name);
49
+ state.features = [featureDir];
50
+ state.phases[Phase.Init] = {
51
+ status: "completed",
52
+ started_at: new Date().toISOString(),
53
+ completed_at: new Date().toISOString(),
54
+ };
55
+ await stateMachine.saveState(spec_dir, state);
56
+ const result = {
57
+ status: "initialized",
58
+ project_name,
59
+ feature_dir: featureDir,
60
+ files_created: ["CONSTITUTION.md", ".sdd-state.json"],
61
+ next_action: "Call sdd_discover with your project idea to get discovery questions.",
62
+ };
63
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
64
+ }
65
+ catch (error) {
66
+ return {
67
+ content: [{ type: "text", text: formatError("sdd_init", error) }],
68
+ isError: true,
69
+ };
70
+ }
71
+ });
72
+ // ─── sdd_discover ───
73
+ server.registerTool("sdd_discover", {
74
+ title: "Discover Project Requirements",
75
+ description: "Returns 7 structured discovery questions tailored to your project idea. Covers: scope, users, constraints, integrations, performance, security, and deployment.",
76
+ inputSchema: discoverInputSchema,
77
+ annotations: {
78
+ readOnlyHint: true,
79
+ destructiveHint: false,
80
+ idempotentHint: true,
81
+ openWorldHint: false,
82
+ },
83
+ }, async ({ project_idea, codebase_summary, spec_dir, feature_number }) => {
84
+ try {
85
+ const questions = [
86
+ {
87
+ id: "Q1",
88
+ category: "Scope",
89
+ question: `What is the primary problem "${project_idea}" solves? What are the boundaries of the first release?`,
90
+ why_it_matters: "Defines what is in and out of scope to prevent feature creep.",
91
+ example_answer: "The first release focuses on core CRUD operations. Analytics dashboard is deferred to v2.",
92
+ },
93
+ {
94
+ id: "Q2",
95
+ category: "Users",
96
+ question: "Who are the primary users? What are their technical skill levels?",
97
+ why_it_matters: "User personas drive UI complexity, error handling depth, and documentation needs.",
98
+ example_answer: "Primary users are developers with 2+ years experience. Secondary users are technical PMs.",
99
+ },
100
+ {
101
+ id: "Q3",
102
+ category: "Constraints",
103
+ question: "What technical constraints exist? (language, framework, hosting, budget, timeline)",
104
+ why_it_matters: "Constraints narrow design choices and prevent wasted effort on infeasible approaches.",
105
+ example_answer: "Must use TypeScript, deploy on Azure, and be production-ready within 8 weeks.",
106
+ },
107
+ {
108
+ id: "Q4",
109
+ category: "Integrations",
110
+ question: "What external systems, APIs, or services does this need to integrate with?",
111
+ why_it_matters: "Integration points are the primary source of complexity and failure modes.",
112
+ example_answer: "Integrates with GitHub API for repository data and Azure AD for authentication.",
113
+ },
114
+ {
115
+ id: "Q5",
116
+ category: "Performance",
117
+ question: "What are the expected load characteristics? (concurrent users, data volume, response time requirements)",
118
+ why_it_matters: "Performance requirements drive architecture decisions (caching, async processing, database choice).",
119
+ example_answer: "Expected 100 concurrent users, <500ms API response time, <10GB data storage.",
120
+ },
121
+ {
122
+ id: "Q6",
123
+ category: "Security",
124
+ question: "What are the security and compliance requirements? (authentication, authorization, data sensitivity, regulations)",
125
+ why_it_matters: "Security requirements affect architecture, data handling, and deployment choices from day one.",
126
+ example_answer: "OAuth 2.0 authentication, role-based access control, no PII stored outside encrypted databases.",
127
+ },
128
+ {
129
+ id: "Q7",
130
+ category: "Deployment",
131
+ question: "How will this be deployed and operated? (CI/CD, monitoring, rollback strategy)",
132
+ why_it_matters: "Deployment strategy influences testing requirements, configuration management, and observability design.",
133
+ example_answer: "GitHub Actions CI/CD, Docker containers on AKS, Prometheus monitoring, blue-green deployments.",
134
+ },
135
+ ];
136
+ if (codebase_summary) {
137
+ questions[2].question += ` (Note: existing codebase detected — consider compatibility with current stack.)`;
138
+ }
139
+ // Record discover phase
140
+ await stateMachine.recordPhaseStart(spec_dir, Phase.Discover);
141
+ const result = {
142
+ project_idea,
143
+ questions,
144
+ instructions: "Answer each question, then call sdd_write_spec with your answers and requirements.",
145
+ };
146
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
147
+ }
148
+ catch (error) {
149
+ return {
150
+ content: [{ type: "text", text: formatError("sdd_discover", error) }],
151
+ isError: true,
152
+ };
153
+ }
154
+ });
155
+ // ─── sdd_write_spec ───
156
+ server.registerTool("sdd_write_spec", {
157
+ title: "Write Specification",
158
+ description: "Generates and writes SPECIFICATION.md with all requirements in EARS notation. Validates each requirement against EARS patterns.",
159
+ inputSchema: writeSpecInputSchema,
160
+ annotations: {
161
+ readOnlyHint: false,
162
+ destructiveHint: false,
163
+ idempotentHint: false,
164
+ openWorldHint: false,
165
+ },
166
+ }, async ({ feature_name, feature_number, discovery_answers, requirements, spec_dir, force }) => {
167
+ try {
168
+ const featureDir = join(spec_dir, `${feature_number}-${feature_name.toLowerCase().replace(/\s+/g, "-")}`);
169
+ // Validate EARS patterns
170
+ const validationIssues = [];
171
+ for (const req of requirements) {
172
+ const result = earsValidator.validate(req.text);
173
+ if (!result.valid && result.issues) {
174
+ validationIssues.push(`${req.id}: ${result.issues.join("; ")}`);
175
+ }
176
+ }
177
+ // Build requirement sections
178
+ const reqSections = requirements.map((req) => {
179
+ const pattern = earsValidator.detectPattern(req.text);
180
+ return [
181
+ `### ${req.id}: (${pattern})`,
182
+ "",
183
+ req.text,
184
+ "",
185
+ "**Acceptance Criteria:**",
186
+ ...req.acceptance_criteria.map((ac) => `- ${ac}`),
187
+ "",
188
+ "---",
189
+ "",
190
+ ].join("\n");
191
+ });
192
+ // Build acceptance criteria table
193
+ const acTable = requirements
194
+ .map((req) => `| ${req.id} | ${req.text.slice(0, 60)}... | Acceptance test |`)
195
+ .join("\n");
196
+ const content = await templateEngine.renderWithFrontmatter("specification", {
197
+ title: `${feature_name} — Specification`,
198
+ feature_id: `${feature_number}-${feature_name.toLowerCase().replace(/\s+/g, "-")}`,
199
+ project_name: feature_name,
200
+ requirements_core: reqSections.join("\n"),
201
+ requirements_functional: "",
202
+ requirements_nonfunctional: "",
203
+ acceptance_criteria_table: acTable,
204
+ ears_compliance: `${requirements.length}/${requirements.length}`,
205
+ testability_score: `${requirements.length}/${requirements.length}`,
206
+ traceability_score: `${requirements.length}/${requirements.length}`,
207
+ uniqueness_score: `${requirements.length}/${requirements.length}`,
208
+ });
209
+ const filePath = await fileManager.writeSpecFile(featureDir, "SPECIFICATION.md", content, force);
210
+ // Update state
211
+ await stateMachine.recordPhaseStart(spec_dir, Phase.Specify);
212
+ await stateMachine.recordPhaseComplete(spec_dir, Phase.Specify);
213
+ const result = {
214
+ status: "specification_written",
215
+ file: filePath,
216
+ requirement_count: requirements.length,
217
+ validation_issues: validationIssues.length > 0 ? validationIssues : undefined,
218
+ next_action: "Review the specification. Call sdd_advance_phase when ready, then sdd_clarify for disambiguation.",
219
+ };
220
+ return { content: [{ type: "text", text: truncate(JSON.stringify(result, null, 2)) }] };
221
+ }
222
+ catch (error) {
223
+ return {
224
+ content: [{ type: "text", text: formatError("sdd_write_spec", error) }],
225
+ isError: true,
226
+ };
227
+ }
228
+ });
229
+ // ─── sdd_clarify ───
230
+ server.registerTool("sdd_clarify", {
231
+ title: "Clarify Requirements",
232
+ description: "Reads SPECIFICATION.md and returns up to 5 disambiguation questions targeting ambiguous or incomplete requirements.",
233
+ inputSchema: clarifyInputSchema,
234
+ annotations: {
235
+ readOnlyHint: true,
236
+ destructiveHint: false,
237
+ idempotentHint: true,
238
+ openWorldHint: false,
239
+ },
240
+ }, async ({ spec_dir, feature_number }) => {
241
+ try {
242
+ // Find feature directory
243
+ const features = await fileManager.listFeatures(spec_dir);
244
+ const feature = features.find((f) => f.number === feature_number);
245
+ if (!feature) {
246
+ throw new Error(`Feature ${feature_number} not found in ${spec_dir}`);
247
+ }
248
+ // Read specification
249
+ const specContent = await fileManager.readSpecFile(feature.directory, "SPECIFICATION.md");
250
+ // Extract requirements (simple regex-based extraction)
251
+ const reqRegex = /### (REQ-[A-Z]+-\d{3}):.*?\n\n(.*?)(?=\n###|\n---|\n##|$)/gs;
252
+ const reqs = [];
253
+ let match;
254
+ while ((match = reqRegex.exec(specContent)) !== null) {
255
+ reqs.push({ id: match[1], text: match[2].trim() });
256
+ }
257
+ // Generate clarification questions for ambiguous requirements
258
+ const questions = [];
259
+ let qNum = 1;
260
+ for (const req of reqs) {
261
+ if (qNum > 5)
262
+ break;
263
+ const validation = earsValidator.validate(req.text);
264
+ if (!validation.valid || (validation.issues && validation.issues.length > 0)) {
265
+ questions.push({
266
+ id: `CQ-${String(qNum).padStart(3, "0")}`,
267
+ requirement_id: req.id,
268
+ ambiguous_text: req.text.slice(0, 200),
269
+ question: `This requirement has issues: ${(validation.issues || []).join("; ")}. How should it be clarified?`,
270
+ alternatives: [
271
+ validation.suggestion || "Rewrite using EARS notation.",
272
+ "Add measurable acceptance criteria.",
273
+ "Split into multiple specific requirements.",
274
+ ],
275
+ });
276
+ qNum++;
277
+ }
278
+ }
279
+ // If no ambiguous requirements found, generate general questions
280
+ if (questions.length === 0) {
281
+ questions.push({
282
+ id: "CQ-001",
283
+ requirement_id: "GENERAL",
284
+ ambiguous_text: "All requirements pass EARS validation.",
285
+ question: "All requirements conform to EARS notation. Are there any edge cases or error scenarios not covered?",
286
+ alternatives: [
287
+ "Add error handling requirements.",
288
+ "Add performance/scalability requirements.",
289
+ "Requirements are complete — proceed to design.",
290
+ ],
291
+ });
292
+ }
293
+ await stateMachine.recordPhaseStart(spec_dir, Phase.Clarify);
294
+ const result = {
295
+ status: "clarification_questions",
296
+ question_count: questions.length,
297
+ questions,
298
+ instructions: "Answer the clarification questions, then call sdd_write_design to proceed.",
299
+ };
300
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
301
+ }
302
+ catch (error) {
303
+ return {
304
+ content: [{ type: "text", text: formatError("sdd_clarify", error) }],
305
+ isError: true,
306
+ };
307
+ }
308
+ });
309
+ // ─── sdd_write_design ───
310
+ server.registerTool("sdd_write_design", {
311
+ title: "Write Design Document",
312
+ description: "Generates and writes DESIGN.md with architecture overview, Mermaid diagrams, ADRs, and API contracts.",
313
+ inputSchema: writeDesignInputSchema,
314
+ annotations: {
315
+ readOnlyHint: false,
316
+ destructiveHint: false,
317
+ idempotentHint: false,
318
+ openWorldHint: false,
319
+ },
320
+ }, async ({ architecture_overview, mermaid_diagrams, adrs, api_contracts, spec_dir, feature_number, force }) => {
321
+ try {
322
+ const features = await fileManager.listFeatures(spec_dir);
323
+ const feature = features.find((f) => f.number === feature_number);
324
+ if (!feature) {
325
+ throw new Error(`Feature ${feature_number} not found in ${spec_dir}`);
326
+ }
327
+ // Build diagrams section
328
+ const diagramsContent = mermaid_diagrams
329
+ .map((d) => `### ${d.title}\n\n\`\`\`mermaid\n${d.code}\n\`\`\`\n`)
330
+ .join("\n---\n\n");
331
+ // Build ADRs section
332
+ const adrsContent = adrs
333
+ ? adrs
334
+ .map((a, i) => `### ADR-${String(i + 1).padStart(3, "0")}: ${a.title}\n\n**Decision:** ${a.decision}\n\n**Rationale:** ${a.rationale}\n\n**Consequences:** ${a.consequences}\n`)
335
+ .join("\n---\n\n")
336
+ : "[TODO: Add Architecture Decision Records]";
337
+ // Build API contracts section
338
+ const apiContent = api_contracts
339
+ ? api_contracts
340
+ .map((c) => `### ${c.method} ${c.endpoint}\n\n${c.description}\n\n**Request:** ${c.request || "N/A"}\n\n**Response:** ${c.response || "N/A"}\n`)
341
+ .join("\n---\n\n")
342
+ : "[TODO: Add API contracts if applicable]";
343
+ const content = await templateEngine.renderWithFrontmatter("design", {
344
+ title: `${feature.name} — Design`,
345
+ feature_id: `${feature_number}-${feature.name}`,
346
+ project_name: feature.name,
347
+ architecture_overview,
348
+ diagrams: mermaid_diagrams.map((d) => d.title),
349
+ adrs: adrs ? adrs.map((a) => a.title) : [],
350
+ api_contracts: apiContent,
351
+ data_models: "[TODO: data_models]",
352
+ error_handling: "[TODO: error_handling]",
353
+ requirement_references: "[TODO: requirement_references]",
354
+ });
355
+ // Replace the template diagram/ADR placeholders with actual content
356
+ let finalContent = content;
357
+ // Replace the diagrams section
358
+ const diagramSectionRegex = /## 2\. System Diagrams\n\n([\s\S]*?)(?=\n---\n\n## 3)/;
359
+ finalContent = finalContent.replace(diagramSectionRegex, `## 2. System Diagrams\n\n${diagramsContent}`);
360
+ // Replace the ADR section
361
+ const adrSectionRegex = /## 3\. Architecture Decision Records\n\n([\s\S]*?)(?=\n---\n\n## 4)/;
362
+ finalContent = finalContent.replace(adrSectionRegex, `## 3. Architecture Decision Records\n\n${adrsContent}`);
363
+ const filePath = await fileManager.writeSpecFile(feature.directory, "DESIGN.md", finalContent, force);
364
+ await stateMachine.recordPhaseStart(spec_dir, Phase.Design);
365
+ await stateMachine.recordPhaseComplete(spec_dir, Phase.Design);
366
+ const result = {
367
+ status: "design_written",
368
+ file: filePath,
369
+ diagram_count: mermaid_diagrams.length,
370
+ adr_count: adrs?.length || 0,
371
+ next_action: "Review the design. Call sdd_advance_phase, then sdd_write_tasks.",
372
+ };
373
+ return { content: [{ type: "text", text: truncate(JSON.stringify(result, null, 2)) }] };
374
+ }
375
+ catch (error) {
376
+ return {
377
+ content: [{ type: "text", text: formatError("sdd_write_design", error) }],
378
+ isError: true,
379
+ };
380
+ }
381
+ });
382
+ // ─── sdd_write_tasks ───
383
+ server.registerTool("sdd_write_tasks", {
384
+ title: "Write Task Breakdown",
385
+ description: "Generates and writes TASKS.md with pre-implementation gates, sequenced tasks with [P] parallel markers, effort estimates, and requirement traceability.",
386
+ inputSchema: writeTasksInputSchema,
387
+ annotations: {
388
+ readOnlyHint: false,
389
+ destructiveHint: false,
390
+ idempotentHint: false,
391
+ openWorldHint: false,
392
+ },
393
+ }, async ({ tasks, pre_impl_gates, spec_dir, feature_number, force }) => {
394
+ try {
395
+ const features = await fileManager.listFeatures(spec_dir);
396
+ const feature = features.find((f) => f.number === feature_number);
397
+ if (!feature) {
398
+ throw new Error(`Feature ${feature_number} not found in ${spec_dir}`);
399
+ }
400
+ // Build task table
401
+ const taskTable = tasks
402
+ .map((t) => `| ${t.id} | ${t.title} | ${t.parallel ? "[P]" : ""} | ${t.effort} | ${t.dependencies.join(", ") || "—"} | ${t.traces_to.join(", ") || "—"} |`)
403
+ .join("\n");
404
+ // Build gates
405
+ const gatesList = pre_impl_gates.map((g) => `**Gate ${g.id}:** ${g.check} (${g.constitution_article})`);
406
+ const parallelCount = tasks.filter((t) => t.parallel).length;
407
+ const content = await templateEngine.renderWithFrontmatter("tasks", {
408
+ title: `${feature.name} — Tasks`,
409
+ feature_id: `${feature_number}-${feature.name}`,
410
+ project_name: feature.name,
411
+ gates: gatesList,
412
+ task_table: taskTable,
413
+ dependency_graph: tasks.map((t) => `${t.id}: ${t.title} → [${t.dependencies.join(", ")}]`).join("\n"),
414
+ effort_summary: "",
415
+ total_tasks: String(tasks.length),
416
+ parallel_tasks: String(parallelCount),
417
+ total_effort: `${tasks.length} tasks`,
418
+ });
419
+ const filePath = await fileManager.writeSpecFile(feature.directory, "TASKS.md", content, force);
420
+ await stateMachine.recordPhaseStart(spec_dir, Phase.Tasks);
421
+ await stateMachine.recordPhaseComplete(spec_dir, Phase.Tasks);
422
+ const result = {
423
+ status: "tasks_written",
424
+ file: filePath,
425
+ task_count: tasks.length,
426
+ parallel_tasks: parallelCount,
427
+ next_action: "Review the tasks. Call sdd_advance_phase, then sdd_run_analysis for quality gate.",
428
+ };
429
+ return { content: [{ type: "text", text: truncate(JSON.stringify(result, null, 2)) }] };
430
+ }
431
+ catch (error) {
432
+ return {
433
+ content: [{ type: "text", text: formatError("sdd_write_tasks", error) }],
434
+ isError: true,
435
+ };
436
+ }
437
+ });
438
+ // ─── sdd_run_analysis ───
439
+ server.registerTool("sdd_run_analysis", {
440
+ title: "Run Specification Analysis",
441
+ description: "Reads all spec files, generates ANALYSIS.md with traceability matrix and coverage report, and returns a gate decision (APPROVE, CHANGES_NEEDED, or BLOCK).",
442
+ inputSchema: runAnalysisInputSchema,
443
+ annotations: {
444
+ readOnlyHint: false,
445
+ destructiveHint: false,
446
+ idempotentHint: false,
447
+ openWorldHint: false,
448
+ },
449
+ }, async ({ spec_dir, feature_number, force }) => {
450
+ try {
451
+ const features = await fileManager.listFeatures(spec_dir);
452
+ const feature = features.find((f) => f.number === feature_number);
453
+ if (!feature) {
454
+ throw new Error(`Feature ${feature_number} not found in ${spec_dir}`);
455
+ }
456
+ // Read available spec files
457
+ const files = await fileManager.listSpecFiles(feature.directory);
458
+ const hasConstitution = files.includes("CONSTITUTION.md");
459
+ const hasSpec = files.includes("SPECIFICATION.md");
460
+ const hasDesign = files.includes("DESIGN.md");
461
+ const hasTasks = files.includes("TASKS.md");
462
+ // Calculate coverage
463
+ const totalChecks = 4;
464
+ const passedChecks = [hasConstitution, hasSpec, hasDesign, hasTasks].filter(Boolean).length;
465
+ const coveragePercent = Math.round((passedChecks / totalChecks) * 100);
466
+ // Determine gate decision
467
+ const gaps = [];
468
+ if (!hasConstitution)
469
+ gaps.push("CONSTITUTION.md missing");
470
+ if (!hasSpec)
471
+ gaps.push("SPECIFICATION.md missing");
472
+ if (!hasDesign)
473
+ gaps.push("DESIGN.md missing");
474
+ if (!hasTasks)
475
+ gaps.push("TASKS.md missing");
476
+ let decision;
477
+ const reasons = [];
478
+ if (coveragePercent >= 90) {
479
+ decision = "APPROVE";
480
+ reasons.push("All core specification documents are present.");
481
+ }
482
+ else if (coveragePercent >= 70) {
483
+ decision = "CHANGES_NEEDED";
484
+ reasons.push(`Coverage at ${coveragePercent}% — some documents missing.`);
485
+ }
486
+ else {
487
+ decision = "BLOCK";
488
+ reasons.push(`Coverage at ${coveragePercent}% — critical documents missing.`);
489
+ }
490
+ // Build traceability matrix
491
+ const traceMatrix = `| CONSTITUTION.md | ${hasConstitution ? "Present" : "Missing"} | — | — | ${hasConstitution ? "✅" : "❌"} |
492
+ | SPECIFICATION.md | ${hasSpec ? "Present" : "Missing"} | — | — | ${hasSpec ? "✅" : "❌"} |
493
+ | DESIGN.md | ${hasDesign ? "Present" : "Missing"} | — | — | ${hasDesign ? "✅" : "❌"} |
494
+ | TASKS.md | ${hasTasks ? "Present" : "Missing"} | — | — | ${hasTasks ? "✅" : "❌"} |`;
495
+ const gateDecision = {
496
+ decision,
497
+ reasons,
498
+ coverage_percent: coveragePercent,
499
+ gaps,
500
+ decided_at: new Date().toISOString(),
501
+ };
502
+ const content = await templateEngine.renderWithFrontmatter("analysis", {
503
+ title: `${feature.name} — Analysis`,
504
+ feature_id: `${feature_number}-${feature.name}`,
505
+ project_name: feature.name,
506
+ gate_decision: decision,
507
+ coverage_percent: String(coveragePercent),
508
+ traceability_matrix: traceMatrix,
509
+ design_coverage: hasDesign ? "100%" : "0%",
510
+ task_coverage: hasTasks ? "100%" : "0%",
511
+ test_coverage: "Pending",
512
+ gaps,
513
+ recommendations: gaps.length > 0
514
+ ? gaps.map((g) => `Create ${g.replace(" missing", "")}`)
515
+ : ["All documents present — proceed to implementation."],
516
+ ears_compliance: hasSpec ? "Pass" : "N/A",
517
+ ears_status: hasSpec ? "✅" : "❌",
518
+ coverage_status: coveragePercent >= 90 ? "✅" : "❌",
519
+ orphan_count: "0",
520
+ orphan_status: "✅",
521
+ });
522
+ const filePath = await fileManager.writeSpecFile(feature.directory, "ANALYSIS.md", content, force);
523
+ // Update state with gate decision
524
+ const state = await stateMachine.loadState(spec_dir);
525
+ state.gate_decision = gateDecision;
526
+ await stateMachine.saveState(spec_dir, state);
527
+ await stateMachine.recordPhaseStart(spec_dir, Phase.Analyze);
528
+ await stateMachine.recordPhaseComplete(spec_dir, Phase.Analyze);
529
+ const result = {
530
+ status: "analysis_complete",
531
+ file: filePath,
532
+ gate_decision: gateDecision,
533
+ next_action: decision === "APPROVE"
534
+ ? "Pipeline complete! Proceed to implementation."
535
+ : `Address the following gaps: ${gaps.join(", ")}`,
536
+ };
537
+ return { content: [{ type: "text", text: truncate(JSON.stringify(result, null, 2)) }] };
538
+ }
539
+ catch (error) {
540
+ return {
541
+ content: [{ type: "text", text: formatError("sdd_run_analysis", error) }],
542
+ isError: true,
543
+ };
544
+ }
545
+ });
546
+ // ─── sdd_advance_phase ───
547
+ server.registerTool("sdd_advance_phase", {
548
+ title: "Advance Pipeline Phase",
549
+ description: "Validates that the current phase's required files exist, then transitions the state machine to the next phase.",
550
+ inputSchema: advancePhaseInputSchema,
551
+ annotations: {
552
+ readOnlyHint: false,
553
+ destructiveHint: false,
554
+ idempotentHint: false,
555
+ openWorldHint: false,
556
+ },
557
+ }, async ({ spec_dir, feature_number }) => {
558
+ try {
559
+ const state = await stateMachine.advancePhase(spec_dir, feature_number);
560
+ const currentIndex = PHASE_ORDER.indexOf(state.current_phase);
561
+ const nextPhase = currentIndex < PHASE_ORDER.length - 1
562
+ ? PHASE_ORDER[currentIndex + 1]
563
+ : null;
564
+ const result = {
565
+ status: "phase_advanced",
566
+ current_phase: state.current_phase,
567
+ next_phase: nextPhase,
568
+ timestamp: new Date().toISOString(),
569
+ next_action: nextPhase
570
+ ? `Proceed with ${nextPhase} phase.`
571
+ : "Pipeline is complete.",
572
+ };
573
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
574
+ }
575
+ catch (error) {
576
+ return {
577
+ content: [{ type: "text", text: formatError("sdd_advance_phase", error) }],
578
+ isError: true,
579
+ };
580
+ }
581
+ });
582
+ }
583
+ //# sourceMappingURL=pipeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/tools/pipeline.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAKtE,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAEhC,SAAS,WAAW,CAAC,QAAgB,EAAE,KAAY;IACjD,OAAO,IAAI,QAAQ,YAAY,KAAK,CAAC,OAAO,EAAE,CAAC;AACjD,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY;IAC5B,IAAI,IAAI,CAAC,MAAM,IAAI,eAAe;QAAE,OAAO,IAAI,CAAC;IAChD,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,eAAe,CAAC,GAAG,+FAA+F,CAAC;AAC1I,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,MAAiB,EACjB,WAAwB,EACxB,YAA0B,EAC1B,cAA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,EAAE,IAAI,EAAE,WAAW,CAAC,mBAAmB,EAAE,KAAc,CAAC,EAAE,CAAC;gBAC5F,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Transcript Automation Tools — sdd_import_transcript + sdd_auto_pipeline.
3
+ *
4
+ * sdd_import_transcript: Parse VTT/SRT/TXT/MD → structured analysis
5
+ * sdd_auto_pipeline: Parse transcript → run FULL pipeline → all 5 spec files written
6
+ */
7
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
8
+ import type { FileManager } from "../services/file-manager.js";
9
+ import type { StateMachine } from "../services/state-machine.js";
10
+ import type { TemplateEngine } from "../services/template-engine.js";
11
+ import type { EarsValidator } from "../services/ears-validator.js";
12
+ import type { TranscriptParser } from "../services/transcript-parser.js";
13
+ export declare function registerTranscriptTools(server: McpServer, fileManager: FileManager, stateMachine: StateMachine, templateEngine: TemplateEngine, earsValidator: EarsValidator, transcriptParser: TranscriptParser): void;
14
+ //# sourceMappingURL=transcript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../../src/tools/transcript.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAqBzE,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,SAAS,EACjB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,GACjC,IAAI,CAurBN"}