smart-spec-kit-mcp 2.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/README.md +262 -0
- package/dist/engine/sessionManager.d.ts +137 -0
- package/dist/engine/sessionManager.d.ts.map +1 -0
- package/dist/engine/sessionManager.js +128 -0
- package/dist/engine/sessionManager.js.map +1 -0
- package/dist/engine/workflowEngine.d.ts +57 -0
- package/dist/engine/workflowEngine.d.ts.map +1 -0
- package/dist/engine/workflowEngine.js +400 -0
- package/dist/engine/workflowEngine.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +122 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/agents.d.ts +61 -0
- package/dist/prompts/agents.d.ts.map +1 -0
- package/dist/prompts/agents.js +236 -0
- package/dist/prompts/agents.js.map +1 -0
- package/dist/schemas/workflowSchema.d.ts +70 -0
- package/dist/schemas/workflowSchema.d.ts.map +1 -0
- package/dist/schemas/workflowSchema.js +42 -0
- package/dist/schemas/workflowSchema.js.map +1 -0
- package/dist/tools/agentTools.d.ts +11 -0
- package/dist/tools/agentTools.d.ts.map +1 -0
- package/dist/tools/agentTools.js +119 -0
- package/dist/tools/agentTools.js.map +1 -0
- package/dist/tools/orchestrationTools.d.ts +12 -0
- package/dist/tools/orchestrationTools.d.ts.map +1 -0
- package/dist/tools/orchestrationTools.js +375 -0
- package/dist/tools/orchestrationTools.js.map +1 -0
- package/dist/tools/workflowTools.d.ts +11 -0
- package/dist/tools/workflowTools.d.ts.map +1 -0
- package/dist/tools/workflowTools.js +236 -0
- package/dist/tools/workflowTools.js.map +1 -0
- package/dist/utils/markdownGenerator.d.ts +70 -0
- package/dist/utils/markdownGenerator.d.ts.map +1 -0
- package/dist/utils/markdownGenerator.js +206 -0
- package/dist/utils/markdownGenerator.js.map +1 -0
- package/dist/utils/vsCodeConfigGenerator.d.ts +32 -0
- package/dist/utils/vsCodeConfigGenerator.d.ts.map +1 -0
- package/dist/utils/vsCodeConfigGenerator.js +88 -0
- package/dist/utils/vsCodeConfigGenerator.js.map +1 -0
- package/dist/utils/workflowLoader.d.ts +99 -0
- package/dist/utils/workflowLoader.d.ts.map +1 -0
- package/dist/utils/workflowLoader.js +281 -0
- package/dist/utils/workflowLoader.js.map +1 -0
- package/package.json +61 -0
- package/templates/bugfix-report.md +184 -0
- package/templates/functional-spec.md +191 -0
- package/workflows/bugfix.yaml +99 -0
- package/workflows/feature-full.yaml +344 -0
- package/workflows/feature-standard.yaml +92 -0
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Engine
|
|
3
|
+
*
|
|
4
|
+
* Orchestrates automatic workflow execution.
|
|
5
|
+
* Each step returns instructions for Copilot to execute the next action.
|
|
6
|
+
*/
|
|
7
|
+
import { loadWorkflow, loadTemplate, } from "../utils/workflowLoader.js";
|
|
8
|
+
import { sessionStore, } from "./sessionManager.js";
|
|
9
|
+
import { getAgent } from "../prompts/agents.js";
|
|
10
|
+
/**
|
|
11
|
+
* Start a new workflow execution
|
|
12
|
+
*/
|
|
13
|
+
export async function startWorkflow(workflowName, contextId) {
|
|
14
|
+
// Load workflow definition
|
|
15
|
+
const workflow = await loadWorkflow(workflowName);
|
|
16
|
+
const firstStep = workflow.steps[0];
|
|
17
|
+
if (!firstStep) {
|
|
18
|
+
throw new Error(`Workflow "${workflowName}" has no steps defined`);
|
|
19
|
+
}
|
|
20
|
+
// Create session
|
|
21
|
+
const session = await sessionStore.create(workflowName, contextId, firstStep.id);
|
|
22
|
+
// Generate the first step action
|
|
23
|
+
return generateStepAction(session, workflow, 0);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Execute the next step in a workflow
|
|
27
|
+
*/
|
|
28
|
+
export async function executeStep(sessionId, previousOutput) {
|
|
29
|
+
const session = sessionStore.get(sessionId);
|
|
30
|
+
if (!session) {
|
|
31
|
+
throw new Error(`Session "${sessionId}" not found. Start a new workflow first.`);
|
|
32
|
+
}
|
|
33
|
+
if (session.status !== "active") {
|
|
34
|
+
throw new Error(`Session "${sessionId}" is ${session.status}, cannot continue.`);
|
|
35
|
+
}
|
|
36
|
+
const workflow = await loadWorkflow(session.workflowName);
|
|
37
|
+
const currentStep = workflow.steps[session.currentStepIndex];
|
|
38
|
+
if (!currentStep) {
|
|
39
|
+
throw new Error(`Invalid step index ${session.currentStepIndex}`);
|
|
40
|
+
}
|
|
41
|
+
// Store the output from previous action
|
|
42
|
+
if (previousOutput) {
|
|
43
|
+
await storeStepOutput(session, currentStep.id, previousOutput);
|
|
44
|
+
}
|
|
45
|
+
// Mark current step as completed
|
|
46
|
+
session.history.push({
|
|
47
|
+
stepId: currentStep.id,
|
|
48
|
+
stepName: currentStep.name,
|
|
49
|
+
status: "completed",
|
|
50
|
+
timestamp: new Date().toISOString(),
|
|
51
|
+
output: typeof previousOutput === "string" ? previousOutput : JSON.stringify(previousOutput),
|
|
52
|
+
});
|
|
53
|
+
// Move to next step
|
|
54
|
+
session.currentStepIndex += 1;
|
|
55
|
+
// Check if workflow is complete
|
|
56
|
+
if (session.currentStepIndex >= workflow.steps.length) {
|
|
57
|
+
session.status = "completed";
|
|
58
|
+
await sessionStore.update(session);
|
|
59
|
+
return {
|
|
60
|
+
success: true,
|
|
61
|
+
sessionId: session.sessionId,
|
|
62
|
+
currentStep: {
|
|
63
|
+
index: session.currentStepIndex - 1,
|
|
64
|
+
id: currentStep.id,
|
|
65
|
+
name: currentStep.name,
|
|
66
|
+
},
|
|
67
|
+
userMessage: generateCompletionMessage(session, workflow),
|
|
68
|
+
nextAction: {
|
|
69
|
+
type: "workflow_complete",
|
|
70
|
+
description: "Workflow terminé avec succès",
|
|
71
|
+
requiresApproval: false,
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
// Update session with new step
|
|
76
|
+
const nextStep = workflow.steps[session.currentStepIndex];
|
|
77
|
+
if (nextStep) {
|
|
78
|
+
session.currentStepId = nextStep.id;
|
|
79
|
+
}
|
|
80
|
+
await sessionStore.update(session);
|
|
81
|
+
// Generate action for next step
|
|
82
|
+
return generateStepAction(session, workflow, session.currentStepIndex);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Get current session status
|
|
86
|
+
*/
|
|
87
|
+
export async function getSessionStatus(sessionId) {
|
|
88
|
+
const session = sessionId
|
|
89
|
+
? sessionStore.get(sessionId)
|
|
90
|
+
: sessionStore.getActiveSession();
|
|
91
|
+
if (!session) {
|
|
92
|
+
return {
|
|
93
|
+
session: null,
|
|
94
|
+
summary: "Aucune session active. Utilisez `start_workflow` pour démarrer.",
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
const workflow = await loadWorkflow(session.workflowName);
|
|
98
|
+
const currentStep = workflow.steps[session.currentStepIndex];
|
|
99
|
+
return {
|
|
100
|
+
session,
|
|
101
|
+
summary: `
|
|
102
|
+
**Session:** ${session.sessionId}
|
|
103
|
+
**Workflow:** ${workflow.displayName}
|
|
104
|
+
**Context:** ${session.contextId}
|
|
105
|
+
**Status:** ${session.status}
|
|
106
|
+
**Progression:** ${session.currentStepIndex + 1}/${workflow.steps.length}
|
|
107
|
+
**Étape actuelle:** ${currentStep?.name ?? "Terminé"}
|
|
108
|
+
`.trim(),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Generate the action for a specific step
|
|
113
|
+
*/
|
|
114
|
+
async function generateStepAction(session, workflow, stepIndex) {
|
|
115
|
+
const step = workflow.steps[stepIndex];
|
|
116
|
+
if (!step) {
|
|
117
|
+
throw new Error(`Step index ${stepIndex} out of bounds`);
|
|
118
|
+
}
|
|
119
|
+
const progressInfo = `[${stepIndex + 1}/${workflow.steps.length}]`;
|
|
120
|
+
switch (step.action) {
|
|
121
|
+
case "fetch_ado":
|
|
122
|
+
return {
|
|
123
|
+
success: true,
|
|
124
|
+
sessionId: session.sessionId,
|
|
125
|
+
currentStep: { index: stepIndex, id: step.id, name: step.name },
|
|
126
|
+
userMessage: `
|
|
127
|
+
## 🔄 ${progressInfo} ${step.name}
|
|
128
|
+
|
|
129
|
+
${step.description}
|
|
130
|
+
|
|
131
|
+
**Action automatique:** Je vais récupérer les données depuis Azure DevOps.
|
|
132
|
+
`.trim(),
|
|
133
|
+
nextAction: {
|
|
134
|
+
type: "call_mcp_tool",
|
|
135
|
+
description: "Récupération du work item Azure DevOps",
|
|
136
|
+
requiresApproval: true,
|
|
137
|
+
copilotInstruction: `
|
|
138
|
+
**INSTRUCTION POUR COPILOT:**
|
|
139
|
+
|
|
140
|
+
Exécute cette action puis rappelle-moi avec le résultat:
|
|
141
|
+
|
|
142
|
+
1. Utilise l'outil \`azure-devops\` → \`get_work_item\` avec l'ID: \`${session.contextId}\`
|
|
143
|
+
2. Une fois le résultat obtenu, appelle \`spec-kit\` → \`execute_step\` avec:
|
|
144
|
+
- sessionId: "${session.sessionId}"
|
|
145
|
+
- previousOutput: [LE JSON DU WORK ITEM]
|
|
146
|
+
|
|
147
|
+
\`\`\`
|
|
148
|
+
Commande: Récupère le work item #${session.contextId} depuis Azure DevOps
|
|
149
|
+
\`\`\`
|
|
150
|
+
`.trim(),
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
case "generate_content":
|
|
154
|
+
case "call_agent":
|
|
155
|
+
const agent = getAgent((step.agent ?? workflow.defaultAgent));
|
|
156
|
+
const template = await loadTemplate(workflow.template);
|
|
157
|
+
return {
|
|
158
|
+
success: true,
|
|
159
|
+
sessionId: session.sessionId,
|
|
160
|
+
currentStep: { index: stepIndex, id: step.id, name: step.name },
|
|
161
|
+
userMessage: `
|
|
162
|
+
## 🤖 ${progressInfo} ${step.name}
|
|
163
|
+
|
|
164
|
+
${step.description}
|
|
165
|
+
|
|
166
|
+
**Agent:** ${agent.displayName}
|
|
167
|
+
**Action:** Génération automatique en cours...
|
|
168
|
+
`.trim(),
|
|
169
|
+
nextAction: {
|
|
170
|
+
type: "call_mcp_tool",
|
|
171
|
+
description: `Génération avec ${agent.displayName}`,
|
|
172
|
+
requiresApproval: true,
|
|
173
|
+
copilotInstruction: generateAgentInstruction(session, step, agent, template),
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
case "review":
|
|
177
|
+
const reviewAgent = getAgent((step.agent ?? "GovAgent"));
|
|
178
|
+
return {
|
|
179
|
+
success: true,
|
|
180
|
+
sessionId: session.sessionId,
|
|
181
|
+
currentStep: { index: stepIndex, id: step.id, name: step.name },
|
|
182
|
+
userMessage: `
|
|
183
|
+
## ✅ ${progressInfo} ${step.name}
|
|
184
|
+
|
|
185
|
+
${step.description}
|
|
186
|
+
|
|
187
|
+
**Agent:** ${reviewAgent.displayName}
|
|
188
|
+
**Action:** Validation en cours...
|
|
189
|
+
`.trim(),
|
|
190
|
+
nextAction: {
|
|
191
|
+
type: "call_mcp_tool",
|
|
192
|
+
description: `Validation avec ${reviewAgent.displayName}`,
|
|
193
|
+
requiresApproval: true,
|
|
194
|
+
copilotInstruction: generateReviewInstruction(session, step, reviewAgent),
|
|
195
|
+
},
|
|
196
|
+
};
|
|
197
|
+
case "create_file":
|
|
198
|
+
return {
|
|
199
|
+
success: true,
|
|
200
|
+
sessionId: session.sessionId,
|
|
201
|
+
currentStep: { index: stepIndex, id: step.id, name: step.name },
|
|
202
|
+
userMessage: `
|
|
203
|
+
## 📄 ${progressInfo} ${step.name}
|
|
204
|
+
|
|
205
|
+
${step.description}
|
|
206
|
+
|
|
207
|
+
**Action:** Création du fichier de spécification.
|
|
208
|
+
`.trim(),
|
|
209
|
+
nextAction: {
|
|
210
|
+
type: "user_confirmation",
|
|
211
|
+
description: "Création du fichier de sortie",
|
|
212
|
+
requiresApproval: true,
|
|
213
|
+
confirmationPrompt: `
|
|
214
|
+
Voulez-vous créer le fichier de spécification ?
|
|
215
|
+
|
|
216
|
+
**Fichier:** \`specs/${session.contextId}-spec.md\`
|
|
217
|
+
|
|
218
|
+
Répondez "oui" pour créer le fichier, ou "modifier" pour ajuster le contenu d'abord.
|
|
219
|
+
`.trim(),
|
|
220
|
+
copilotInstruction: `
|
|
221
|
+
**INSTRUCTION POUR COPILOT:**
|
|
222
|
+
|
|
223
|
+
Demande à l'utilisateur de confirmer la création du fichier.
|
|
224
|
+
Si confirmé, crée le fichier avec le contenu de la spécification générée.
|
|
225
|
+
Puis appelle \`spec-kit\` → \`execute_step\` avec:
|
|
226
|
+
- sessionId: "${session.sessionId}"
|
|
227
|
+
- previousOutput: { "fileCreated": true, "path": "specs/${session.contextId}-spec.md" }
|
|
228
|
+
`.trim(),
|
|
229
|
+
},
|
|
230
|
+
};
|
|
231
|
+
default:
|
|
232
|
+
return {
|
|
233
|
+
success: false,
|
|
234
|
+
sessionId: session.sessionId,
|
|
235
|
+
currentStep: { index: stepIndex, id: step.id, name: step.name },
|
|
236
|
+
userMessage: `Action inconnue: ${step.action}`,
|
|
237
|
+
nextAction: {
|
|
238
|
+
type: "error",
|
|
239
|
+
description: `Type d'action non supporté: ${step.action}`,
|
|
240
|
+
requiresApproval: false,
|
|
241
|
+
},
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Generate instruction for agent-based content generation
|
|
247
|
+
*/
|
|
248
|
+
function generateAgentInstruction(session, step, agent, template) {
|
|
249
|
+
const workItemData = session.data.workItemData
|
|
250
|
+
? JSON.stringify(session.data.workItemData, null, 2)
|
|
251
|
+
: "[Données non disponibles - récupérez d'abord le work item]";
|
|
252
|
+
return `
|
|
253
|
+
**INSTRUCTION POUR COPILOT:**
|
|
254
|
+
|
|
255
|
+
Tu es maintenant **${agent.displayName}**. Exécute cette tâche:
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
## System Prompt
|
|
259
|
+
${agent.systemPrompt}
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## Tâche: ${step.name}
|
|
263
|
+
${step.description}
|
|
264
|
+
|
|
265
|
+
## Données du Work Item
|
|
266
|
+
\`\`\`json
|
|
267
|
+
${workItemData}
|
|
268
|
+
\`\`\`
|
|
269
|
+
|
|
270
|
+
## Template à utiliser
|
|
271
|
+
\`\`\`markdown
|
|
272
|
+
${template.slice(0, 1500)}
|
|
273
|
+
${template.length > 1500 ? "\n[...template tronqué...]" : ""}
|
|
274
|
+
\`\`\`
|
|
275
|
+
|
|
276
|
+
## Instructions
|
|
277
|
+
1. Génère le contenu en suivant le template
|
|
278
|
+
2. Remplis les sections avec les données du work item
|
|
279
|
+
3. Marque les sections incertaines avec [TO FILL]
|
|
280
|
+
4. Une fois terminé, appelle \`spec-kit\` → \`execute_step\` avec:
|
|
281
|
+
- sessionId: "${session.sessionId}"
|
|
282
|
+
- previousOutput: [LE CONTENU MARKDOWN GÉNÉRÉ]
|
|
283
|
+
`.trim();
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Generate instruction for review steps
|
|
287
|
+
*/
|
|
288
|
+
function generateReviewInstruction(session, step, agent) {
|
|
289
|
+
const contentToReview = session.data.specification
|
|
290
|
+
?? session.data.technicalPlan
|
|
291
|
+
?? "[Contenu à reviewer non disponible]";
|
|
292
|
+
return `
|
|
293
|
+
**INSTRUCTION POUR COPILOT:**
|
|
294
|
+
|
|
295
|
+
Tu es maintenant **${agent.displayName}**. Effectue cette revue:
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
## System Prompt
|
|
299
|
+
${agent.systemPrompt}
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## Tâche: ${step.name}
|
|
303
|
+
${step.description}
|
|
304
|
+
|
|
305
|
+
## Contenu à valider
|
|
306
|
+
\`\`\`markdown
|
|
307
|
+
${typeof contentToReview === "string" ? contentToReview.slice(0, 2000) : JSON.stringify(contentToReview).slice(0, 2000)}
|
|
308
|
+
\`\`\`
|
|
309
|
+
|
|
310
|
+
## Instructions
|
|
311
|
+
1. Analyse le contenu selon les critères de validation
|
|
312
|
+
2. Liste les points conformes ✅
|
|
313
|
+
3. Liste les problèmes à corriger ❌
|
|
314
|
+
4. Donne un verdict: APPROVED / NEEDS_WORK / REJECTED
|
|
315
|
+
5. Appelle \`spec-kit\` → \`execute_step\` avec:
|
|
316
|
+
- sessionId: "${session.sessionId}"
|
|
317
|
+
- previousOutput: { "status": "[VERDICT]", "issues": [...], "recommendations": [...] }
|
|
318
|
+
`.trim();
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Store output from a step into session data
|
|
322
|
+
*/
|
|
323
|
+
async function storeStepOutput(session, stepId, output) {
|
|
324
|
+
// Parse output based on step type
|
|
325
|
+
if (stepId.includes("fetch") || stepId.includes("ado")) {
|
|
326
|
+
session.data.workItemData = typeof output === "string"
|
|
327
|
+
? JSON.parse(output)
|
|
328
|
+
: output;
|
|
329
|
+
}
|
|
330
|
+
else if (stepId.includes("spec") || stepId.includes("generate")) {
|
|
331
|
+
session.data.specification = typeof output === "string"
|
|
332
|
+
? output
|
|
333
|
+
: JSON.stringify(output, null, 2);
|
|
334
|
+
}
|
|
335
|
+
else if (stepId.includes("plan")) {
|
|
336
|
+
session.data.technicalPlan = typeof output === "string"
|
|
337
|
+
? output
|
|
338
|
+
: JSON.stringify(output, null, 2);
|
|
339
|
+
}
|
|
340
|
+
else if (stepId.includes("review") || stepId.includes("valid")) {
|
|
341
|
+
const validationType = stepId.includes("rgpd") ? "rgpd"
|
|
342
|
+
: stepId.includes("security") ? "security"
|
|
343
|
+
: stepId.includes("arch") ? "architecture"
|
|
344
|
+
: stepId.includes("design") ? "design"
|
|
345
|
+
: "general";
|
|
346
|
+
if (!session.data.validations) {
|
|
347
|
+
session.data.validations = {};
|
|
348
|
+
}
|
|
349
|
+
const validationData = typeof output === "string"
|
|
350
|
+
? { status: "completed", issues: [], raw: output }
|
|
351
|
+
: output;
|
|
352
|
+
session.data.validations[validationType] = validationData;
|
|
353
|
+
}
|
|
354
|
+
await sessionStore.update(session);
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Generate completion message
|
|
358
|
+
*/
|
|
359
|
+
function generateCompletionMessage(session, workflow) {
|
|
360
|
+
const stepsCompleted = session.history.length;
|
|
361
|
+
const validations = session.data.validations ?? {};
|
|
362
|
+
return `
|
|
363
|
+
# ✅ Workflow "${workflow.displayName}" Terminé!
|
|
364
|
+
|
|
365
|
+
## Résumé
|
|
366
|
+
- **Context ID:** ${session.contextId}
|
|
367
|
+
- **Étapes complétées:** ${stepsCompleted}/${workflow.steps.length}
|
|
368
|
+
- **Durée:** ${calculateDuration(session.createdAt, session.updatedAt)}
|
|
369
|
+
|
|
370
|
+
## Artefacts générés
|
|
371
|
+
${session.data.specification ? "- ✅ Spécification fonctionnelle" : ""}
|
|
372
|
+
${session.data.technicalPlan ? "- ✅ Plan technique" : ""}
|
|
373
|
+
${Object.keys(validations).length > 0 ? `- ✅ Validations: ${Object.keys(validations).join(", ")}` : ""}
|
|
374
|
+
|
|
375
|
+
## Prochaines étapes suggérées
|
|
376
|
+
1. Revoir le fichier de spécification généré
|
|
377
|
+
2. Créer les tâches dans Azure DevOps
|
|
378
|
+
3. Assigner les tâches à l'équipe
|
|
379
|
+
|
|
380
|
+
---
|
|
381
|
+
*Session ID: ${session.sessionId}*
|
|
382
|
+
`.trim();
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Calculate human-readable duration
|
|
386
|
+
*/
|
|
387
|
+
function calculateDuration(start, end) {
|
|
388
|
+
const startDate = new Date(start);
|
|
389
|
+
const endDate = new Date(end);
|
|
390
|
+
const diffMs = endDate.getTime() - startDate.getTime();
|
|
391
|
+
const diffMins = Math.floor(diffMs / 60000);
|
|
392
|
+
if (diffMins < 1)
|
|
393
|
+
return "< 1 minute";
|
|
394
|
+
if (diffMins < 60)
|
|
395
|
+
return `${diffMins} minute${diffMins > 1 ? "s" : ""}`;
|
|
396
|
+
const hours = Math.floor(diffMins / 60);
|
|
397
|
+
const mins = diffMins % 60;
|
|
398
|
+
return `${hours}h ${mins}m`;
|
|
399
|
+
}
|
|
400
|
+
//# sourceMapp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AAC,IAAI,EAAE,CAAC;AACX,CAAC;AAED;;GAEG;AACH,SAAS,iBAAiB,CAAC,KAAa,EAAE,GAAW;IACnD,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;IAClC,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9B,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC;IACvD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;IAE5C,IAAI,QAAQ,GAAG,CAAC;QAAE,OAAO,YAAY,CAAC;IACtC,IAAI,QAAQ,GAAG,EAAE;QAAE,OAAO,GAAG,QAAQ,UAAU,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAEzE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAC,CAAC;IACxC,MAAM,IAAI,GAAG,QAAQ,GAAG,EAAE,CAAC;IAC3B,OAAO,GAAG,KAAK,KAAK,IAAI,GAAG,CAAC;AAC9B,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Spec-Kit MCP Server v2.0
|
|
4
|
+
*
|
|
5
|
+
* An automated workflow orchestration server for AI-driven specification engineering.
|
|
6
|
+
* Guides GitHub Copilot through multi-step workflows automatically.
|
|
7
|
+
*
|
|
8
|
+
* Architecture:
|
|
9
|
+
* - Session Manager: Tracks workflow state across calls
|
|
10
|
+
* - Workflow Engine: Orchestrates step execution
|
|
11
|
+
* - Orchestration Tools: MCP interface for Copilot
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Spec-Kit MCP Server v2.0
|
|
4
|
+
*
|
|
5
|
+
* An automated workflow orchestration server for AI-driven specification engineering.
|
|
6
|
+
* Guides GitHub Copilot through multi-step workflows automatically.
|
|
7
|
+
*
|
|
8
|
+
* Architecture:
|
|
9
|
+
* - Session Manager: Tracks workflow state across calls
|
|
10
|
+
* - Workflow Engine: Orchestrates step execution
|
|
11
|
+
* - Orchestration Tools: MCP interface for Copilot
|
|
12
|
+
*/
|
|
13
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
14
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
15
|
+
import { z } from "zod";
|
|
16
|
+
import { registerOrchestrationTools } from "./tools/orchestrationTools.js";
|
|
17
|
+
import { sessionStore } from "./engine/sessionManager.js";
|
|
18
|
+
// Server metadata
|
|
19
|
+
const SERVER_NAME = "spec-kit";
|
|
20
|
+
const SERVER_VERSION = "2.0.0";
|
|
21
|
+
/**
|
|
22
|
+
* Initialize and configure the MCP Server
|
|
23
|
+
*/
|
|
24
|
+
function createServer() {
|
|
25
|
+
const server = new McpServer({
|
|
26
|
+
name: SERVER_NAME,
|
|
27
|
+
version: SERVER_VERSION,
|
|
28
|
+
});
|
|
29
|
+
// Register tools
|
|
30
|
+
registerCoreTools(server);
|
|
31
|
+
registerOrchestrationTools(server);
|
|
32
|
+
return server;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Register core utility tools
|
|
36
|
+
*/
|
|
37
|
+
function registerCoreTools(server) {
|
|
38
|
+
// Tool: ping - Health check
|
|
39
|
+
server.tool("ping", "Vérifie que le serveur Spec-Kit est opérationnel.", {
|
|
40
|
+
message: z.string().optional().describe("Message optionnel à renvoyer"),
|
|
41
|
+
}, async ({ message }) => {
|
|
42
|
+
const activeSession = sessionStore.getActiveSession();
|
|
43
|
+
return {
|
|
44
|
+
content: [{
|
|
45
|
+
type: "text",
|
|
46
|
+
text: JSON.stringify({
|
|
47
|
+
status: "ok",
|
|
48
|
+
server: SERVER_NAME,
|
|
49
|
+
version: SERVER_VERSION,
|
|
50
|
+
timestamp: new Date().toISOString(),
|
|
51
|
+
activeSession: activeSession?.sessionId ?? null,
|
|
52
|
+
echo: message ?? null,
|
|
53
|
+
}, null, 2),
|
|
54
|
+
}],
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
// Tool: help - Show available commands
|
|
58
|
+
server.tool("help", "Affiche l'aide et les commandes disponibles.", {}, async () => {
|
|
59
|
+
return {
|
|
60
|
+
content: [{
|
|
61
|
+
type: "text",
|
|
62
|
+
text: `
|
|
63
|
+
# 🚀 Spec-Kit MCP Server v${SERVER_VERSION}
|
|
64
|
+
|
|
65
|
+
## Commandes Principales
|
|
66
|
+
|
|
67
|
+
### Démarrer un workflow
|
|
68
|
+
\`\`\`
|
|
69
|
+
start_workflow workflow_name="feature-standard" context_id="12345"
|
|
70
|
+
\`\`\`
|
|
71
|
+
|
|
72
|
+
### Continuer l'exécution
|
|
73
|
+
\`\`\`
|
|
74
|
+
execute_step previous_output="[résultat de l'étape précédente]"
|
|
75
|
+
\`\`\`
|
|
76
|
+
|
|
77
|
+
### Voir le statut
|
|
78
|
+
\`\`\`
|
|
79
|
+
workflow_status
|
|
80
|
+
\`\`\`
|
|
81
|
+
|
|
82
|
+
### Lister les workflows
|
|
83
|
+
\`\`\`
|
|
84
|
+
list_workflows
|
|
85
|
+
\`\`\`
|
|
86
|
+
|
|
87
|
+
## Workflows Disponibles
|
|
88
|
+
|
|
89
|
+
- **feature-standard** - Spécification fonctionnelle (5 étapes)
|
|
90
|
+
- **feature-full** - Spec complète avec gouvernance (10 étapes)
|
|
91
|
+
- **bugfix** - Correction de bug (5 étapes)
|
|
92
|
+
|
|
93
|
+
## Mode d'emploi
|
|
94
|
+
|
|
95
|
+
1. Démarrez un workflow avec l'ID du work item Azure DevOps
|
|
96
|
+
2. Le serveur guide automatiquement chaque étape
|
|
97
|
+
3. Validez chaque action proposée
|
|
98
|
+
4. Les artefacts sont générés automatiquement
|
|
99
|
+
`.trim(),
|
|
100
|
+
}],
|
|
101
|
+
};
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Main entry point
|
|
106
|
+
*/
|
|
107
|
+
async function main() {
|
|
108
|
+
// Initialize session store
|
|
109
|
+
await sessionStore.init();
|
|
110
|
+
const server = createServer();
|
|
111
|
+
const transport = new StdioServerTransport();
|
|
112
|
+
// Connect server to transport
|
|
113
|
+
await server.connect(transport);
|
|
114
|
+
// Log to stderr (stdout is reserved for MCP protocol)
|
|
115
|
+
console.error(`[${SERVER_NAME}] Server v${SERVER_VERSION} started - Automated orchestration ready`);
|
|
116
|
+
}
|
|
117
|
+
// Run the server
|
|
118
|
+
main().catch((error) => {
|
|
119
|
+
console.error("[spec-kit] Fatal error:", error);
|
|
120
|
+
process.exit(1);
|
|
121
|
+
});
|
|
122
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,kBAAkB;AAClB,MAAM,WAAW,GAAG,UAAU,CAAC;AAC/B,MAAM,cAAc,GAAG,OAAO,C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AoC/B,CAAC,IAAI,EAAE;iBACT,CAAC;SACH,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,IAAI;IACjB,2BAA2B;IAC3B,MAAM,YAAY,CAAC,IAAI,EAAE,CAAC;IAE1B,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAE7C,8BAA8B;IAC9B,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,sDAAsD;IACtD,OAAO,CAAC,KAAK,CAAC,IAAI,WAAW,aAAa,cAAc,0CAA0C,CAAC,CAAC;AACtG,CAAC;AAED,iBAAiB;AACjB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC9B,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;IAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent System Prompts
|
|
3
|
+
*
|
|
4
|
+
* Defines the system prompts for different AI agents used in the Spec-Kit platform.
|
|
5
|
+
* These prompts guide Copilot's behavior when executing specific workflow steps.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Available agent types
|
|
9
|
+
*/
|
|
10
|
+
export type AgentType = "SpecAgent" | "PlanAgent" | "GovAgent" | "TestAgent";
|
|
11
|
+
/**
|
|
12
|
+
* Agent definition with system prompt and capabilities
|
|
13
|
+
*/
|
|
14
|
+
export interface AgentDefinition {
|
|
15
|
+
name: AgentType;
|
|
16
|
+
displayName: string;
|
|
17
|
+
description: string;
|
|
18
|
+
systemPrompt: string;
|
|
19
|
+
capabilities: string[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* SpecAgent - Specification Writer
|
|
23
|
+
* Specialized in creating detailed functional and technical specifications
|
|
24
|
+
*/
|
|
25
|
+
export declare const SpecAgent: AgentDefinition;
|
|
26
|
+
/**
|
|
27
|
+
* PlanAgent - Technical Planning Specialist
|
|
28
|
+
* Specialized in breaking down features into implementable tasks
|
|
29
|
+
*/
|
|
30
|
+
export declare const PlanAgent: AgentDefinition;
|
|
31
|
+
/**
|
|
32
|
+
* GovAgent - Governance & Quality Reviewer
|
|
33
|
+
* Specialized in reviewing documents for completeness and compliance
|
|
34
|
+
*/
|
|
35
|
+
export declare const GovAgent: AgentDefinition;
|
|
36
|
+
/**
|
|
37
|
+
* TestAgent - Test Strategy Specialist
|
|
38
|
+
* Specialized in creating test plans and test cases
|
|
39
|
+
*/
|
|
40
|
+
export declare const TestAgent: AgentDefinition;
|
|
41
|
+
/**
|
|
42
|
+
* Registry of all available agents
|
|
43
|
+
*/
|
|
44
|
+
export declare const AgentRegistry: Record<AgentType, AgentDefinition>;
|
|
45
|
+
/**
|
|
46
|
+
* Get an agent definition by name
|
|
47
|
+
*/
|
|
48
|
+
export declare function getAgent(name: AgentType): AgentDefinition;
|
|
49
|
+
/**
|
|
50
|
+
* Get the system prompt for an agent
|
|
51
|
+
*/
|
|
52
|
+
export declare function getAgentPrompt(name: AgentType): string;
|
|
53
|
+
/**
|
|
54
|
+
* List all available agents with their descriptions
|
|
55
|
+
*/
|
|
56
|
+
export declare function listAgents(): Array<{
|
|
57
|
+
name: AgentType;
|
|
58
|
+
displayName: string;
|
|
59
|
+
description: string;
|
|
60
|
+
}>;
|
|
61
|
+
//# sourceMappingURL=agents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/prompts/agents.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,CAAC;AAE7E;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,eA0CvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,eA2CvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,eA6CtB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,eA4CvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,SAAS,EAAE,eAAe,CAK5D,CAAC;AAEF;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,eAAe,CAMzD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAEtD;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,KAAK,CAAC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,CAMjG"}
|