smart-spec-kit-mcp 2.2.5 → 2.2.7

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 (33) hide show
  1. package/README.md +115 -26
  2. package/dist/tools/agentTools.d.ts +2 -1
  3. package/dist/tools/agentTools.d.ts.map +1 -1
  4. package/dist/tools/agentTools.js +21 -22
  5. package/dist/tools/agentTools.js.map +1 -1
  6. package/dist/utils/agentLoader.d.ts +53 -0
  7. package/dist/utils/agentLoader.d.ts.map +1 -0
  8. package/dist/utils/agentLoader.js +225 -0
  9. package/dist/utils/agentLoader.js.map +1 -0
  10. package/dist/utils/starterKitInstaller.d.ts.map +1 -1
  11. package/dist/utils/starterKitInstaller.js +27 -1
  12. package/dist/utils/starterKitInstaller.js.map +1 -1
  13. package/dist/utils/workflowLoader.d.ts +1 -1
  14. package/dist/utils/workflowLoader.js +3 -3
  15. package/dist/utils/workflowLoader.js.map +1 -1
  16. package/docs/DOCUMENTATION.md +247 -6
  17. package/package.json +1 -1
  18. package/starter-kit/agents/GovAgent.md +53 -0
  19. package/starter-kit/agents/PlanAgent.md +51 -0
  20. package/starter-kit/agents/SpecAgent.md +51 -0
  21. package/starter-kit/agents/TestAgent.md +52 -0
  22. package/starter-kit/agents/_CustomAgent.template.md +69 -0
  23. package/starter-kit/templates/bugfix-report.md +22 -2
  24. package/starter-kit/templates/functional-spec.md +12 -1
  25. package/starter-kit/templates/plan-template.md +6 -1
  26. package/starter-kit/templates/tasks-template.md +4 -3
  27. package/templates/bugfix-report.md +0 -184
  28. package/templates/functional-spec.md +0 -191
  29. package/workflows/bugfix-quick.yaml +0 -53
  30. package/workflows/bugfix.yaml +0 -99
  31. package/workflows/feature-full.yaml +0 -344
  32. package/workflows/feature-quick.yaml +0 -69
  33. package/workflows/feature-standard.yaml +0 -92
package/README.md CHANGED
@@ -76,47 +76,67 @@ Puis rechargez VS Code: `Ctrl+Shift+P` → "Developer: Reload Window"
76
76
 
77
77
  ## 📁 Structure du Projet
78
78
 
79
- Après installation, votre projet contient:
79
+ ### Structure interne du package Spec-Kit
80
80
 
81
81
  ```text
82
- votre-projet/
83
- ├── .github/
84
- │ ├── prompts/ # Slash commands pour Copilot
85
- │ │ ├── speckit.specify.prompt.md
86
- │ │ ├── speckit.plan.prompt.md
87
- │ │ ├── speckit.tasks.prompt.md
88
- │ │ ├── speckit.implement.prompt.md
89
- │ │ ├── speckit.clarify.prompt.md
90
- │ │ ├── speckit.validate.prompt.md
91
- │ │ ├── speckit.memory.prompt.md
92
- │ │ └── speckit.help.prompt.md
93
- │ └── copilot-instructions.md # Guide Copilot sur l'utilisation de Spec-Kit
94
- ├── .spec-kit/
95
- │ ├── prompts/ # Prompts (lus par les outils MCP)
82
+ smart-spec-kit-mcp/
83
+ ├── starter-kit/ # Source unique de la configuration
84
+ │ ├── prompts/ # Prompts MCP (specify, plan, implement, etc.)
96
85
  │ │ ├── specify.md
97
86
  │ │ ├── plan.md
98
87
  │ │ ├── tasks.md
99
88
  │ │ ├── implement.md
100
89
  │ │ ├── clarify.md
101
- │ │ └── validate.md
90
+ │ │ ├── validate.md
91
+ │ │ └── memory.md
102
92
  │ ├── templates/ # Templates de documents
103
93
  │ │ ├── functional-spec.md
94
+ │ │ ├── bugfix-report.md
104
95
  │ │ ├── plan-template.md
105
96
  │ │ └── tasks-template.md
97
+ │ ├── workflows/ # Workflows YAML prédéfinis
98
+ │ │ ├── feature-quick.yaml # 3-step (spécification rapide)
99
+ │ │ ├── feature-standard.yaml # 4-step (complet)
100
+ │ │ ├── feature-full.yaml # 5-step (détaillé)
101
+ │ │ ├── bugfix-quick.yaml # 2-step (bugfix rapide)
102
+ │ │ └── bugfix.yaml
103
+ │ ├── agents/ # Agents IA customisables
104
+ │ │ ├── SpecAgent.md # Rédacteur de spécifications
105
+ │ │ ├── PlanAgent.md # Planificateur technique
106
+ │ │ ├── GovAgent.md # Validateur gouvernance
107
+ │ │ ├── TestAgent.md # Stratège de tests
108
+ │ │ └── _CustomAgent.template.md # Template pour créer vos agents
106
109
  │ ├── rules/ # Règles de validation
107
- │ │ ├── security-rules.md # Règles de sécurité
108
- │ │ └── rgpd-rules.md # Conformité RGPD
110
+ │ │ ├── security-rules.md # Règles OWASP
111
+ │ │ └── rgpd-rules.md # Conformité GDPR
109
112
  │ ├── memory/ # Contexte projet
110
113
  │ │ └── constitution.md # Principes du projet
111
- └── workflows/ # Workflows automatisés
112
- ├── feature-quick.yaml # Quick wins (léger)
113
- ├── feature-standard.yaml
114
- │ ├── feature-full.yaml
115
- │ └── bugfix.yaml
114
+ ├── github-prompts/ # Slash commands pour Copilot
115
+ │ └── speckit.*.prompt.md
116
+ └── copilot-instructions.md # Guide Copilot
117
+ ```
118
+
119
+ ### Structure après installation dans votre projet
120
+
121
+ ```text
122
+ votre-projet/
123
+ ├── .github/
124
+ │ └── copilot-instructions.md # Copié lors du setup
125
+ ├── .spec-kit/ # Configuration locale (personnalisations)
126
+ │ ├── prompts/ # Override les prompts par défaut
127
+ │ ├── templates/ # Override les templates par défaut
128
+ │ ├── workflows/ # Vos workflows personnalisés
129
+ │ ├── agents/ # Vos agents personnalisés ← NOUVEAU
130
+ │ ├── rules/ # Vos règles de validation
131
+ │ └── memory/
132
+ │ └── constitution.md # Principes de votre projet
116
133
  └── specs/ # Spécifications générées
117
134
  └── validations/ # Rapports de validation
118
135
  ```
119
136
 
137
+ **Note**: Les workflows, templates et agents par défaut viennent de `starter-kit/` du package.
138
+ Vous pouvez personnaliser en créant des fichiers dans `.spec-kit/`.
139
+
120
140
  ---
121
141
 
122
142
  ## 🎮 Commandes Disponibles
@@ -180,6 +200,7 @@ Vous pouvez aussi utiliser ces phrases dans Copilot Chat:
180
200
  ```
181
201
 
182
202
  Ou avec la commande par mots-clés:
203
+
183
204
  ```text
184
205
  speckit: spec pour un système de notifications push
185
206
  ```
@@ -249,6 +270,71 @@ steps:
249
270
  description: "Génère le plan"
250
271
  ```
251
272
 
273
+ #### À propos des "Agents"
274
+
275
+ ⚠️ **Important** : Les agents Spec-Kit (SpecAgent, PlanAgent, GovAgent, TestAgent) **ne sont PAS** des agents GitHub Copilot.
276
+
277
+ Ce sont des **system prompts prédéfinis** qui guident le comportement de Copilot :
278
+
279
+ | Agent | Rôle | Fichier |
280
+ |-------|------|---------|
281
+ | **SpecAgent** | Rédacteur de spécifications | `SpecAgent.md` |
282
+ | **PlanAgent** | Planificateur technique | `PlanAgent.md` |
283
+ | **GovAgent** | Validateur de gouvernance | `GovAgent.md` |
284
+ | **TestAgent** | Stratège de tests | `TestAgent.md` |
285
+
286
+ Quand vous mettez `agent: SpecAgent` dans une étape, Spec-Kit envoie le system prompt de SpecAgent à Copilot.
287
+
288
+ #### Créer un Agent Personnalisé
289
+
290
+ Les agents sont maintenant **entièrement customisables** depuis `.spec-kit/agents/` :
291
+
292
+ ```markdown
293
+ # .spec-kit/agents/SecurityAgent.md
294
+
295
+ ---
296
+ name: SecurityAgent
297
+ displayName: "Security Review Agent"
298
+ description: "Expert en sécurité applicative"
299
+ capabilities:
300
+ - Identifier les vulnérabilités
301
+ - Recommander les bonnes pratiques
302
+ ---
303
+
304
+ ## System Prompt
305
+
306
+ Tu es SecurityAgent, un expert en sécurité applicative...
307
+ ```
308
+
309
+ Puis utilisez dans vos workflows :
310
+
311
+ ```yaml
312
+ steps:
313
+ - id: security-review
314
+ agent: SecurityAgent # Votre agent custom !
315
+ action: call_agent
316
+ ```
317
+
318
+ Pour plus de détails : [Understanding Spec-Kit Agents](docs/DOCUMENTATION.md#understanding-spec-kit-agents)
319
+
320
+ #### Validation du Schéma de Workflow
321
+
322
+ Chaque workflow YAML est validé automatiquement contre un schéma Zod. Les champs obligatoires sont :
323
+ - `name` - Identifiant unique
324
+ - `displayName` - Nom visible
325
+ - `description` - Description
326
+ - `template` - Fichier template
327
+ - `steps` - Au moins une étape
328
+
329
+ Erreur si validation échoue :
330
+ ```
331
+ Error: Invalid workflow "mon-workflow":
332
+ - steps.0.action: Invalid enum value
333
+ - name: Required
334
+ ```
335
+
336
+ Pour plus de détails sur le schéma, voir [Workflow Validation Schema](docs/DOCUMENTATION.md#workflow-validation-schema).
337
+
252
338
  ---
253
339
 
254
340
  ## ❓ Obtenir de l'Aide
@@ -283,9 +369,12 @@ Pour récupérer automatiquement les work items:
283
369
  },
284
370
  "azure-devops": {
285
371
  "command": "npx",
286
- "args": ["-y", "@anthropic-ai/azure-devops-mcp"],
372
+ "args": [
373
+ "-y",
374
+ "@azure-devops/mcp",
375
+ "your-org",
376
+ ],
287
377
  "env": {
288
- "AZURE_DEVOPS_ORG_URL": "https://dev.azure.com/your-org",
289
378
  "AZURE_DEVOPS_PAT": "your-token"
290
379
  }
291
380
  }
@@ -326,7 +415,7 @@ Pour une documentation détaillée sur tous les outils et fonctionnalités:
326
415
  - **[docs/DOCUMENTATION.md](docs/DOCUMENTATION.md)** - Documentation complète des outils MCP et workflows
327
416
  - **[docs/PACKAGING.md](docs/PACKAGING.md)** - Guide de packaging et distribution
328
417
  - **[PROJECT_CONTEXT.md](PROJECT_CONTEXT.md)** - Contexte du projet Spec-Kit
329
- - **[TASK_QUEUE.md](TASK_QUEUE.md)** - Tâches en cours et prévues
418
+ - **[TODO.md](TODO.md)** - Tâches en cours et prévues
330
419
  - **[TROUBLESHOOTING.md](TROUBLESHOOTING.md)** - Guide de dépannage complet
331
420
 
332
421
  ---
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * Agent Tools
3
3
  *
4
- * MCP tools for interacting with agent system prompts
4
+ * MCP tools for interacting with agent system prompts.
5
+ * Supports both built-in agents and custom agents from .spec-kit/agents/
5
6
  */
6
7
  import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
7
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"agentTools.d.ts","sourceRoot":"","sources":["../../src/tools/agentTools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIzE;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAgI1D"}
1
+ {"version":3,"file":"agentTools.d.ts","sourceRoot":"","sources":["../../src/tools/agentTools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIzE;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA+H1D"}
@@ -1,26 +1,25 @@
1
1
  /**
2
2
  * Agent Tools
3
3
  *
4
- * MCP tools for interacting with agent system prompts
4
+ * MCP tools for interacting with agent system prompts.
5
+ * Supports both built-in agents and custom agents from .spec-kit/agents/
5
6
  */
6
7
  import { z } from "zod";
7
- import { AgentRegistry, getAgent, listAgents } from "../prompts/agents.js";
8
+ import { loadAgent, listAgentsDetailed } from "../utils/agentLoader.js";
8
9
  /**
9
10
  * Register agent-related tools on the MCP server
10
11
  */
11
12
  export function registerAgentTools(server) {
12
- // Tool: list_agents - List all available agents
13
- server.tool("list_agents", "List all available AI agents and their capabilities. Use this to understand which agent to use for a specific task.", {}, async () => {
14
- const agents = listAgents();
15
- const formatted = agents.map((agent) => {
16
- const full = AgentRegistry[agent.name];
17
- return {
18
- name: agent.name,
19
- displayName: agent.displayName,
20
- description: agent.description,
21
- capabilities: full.capabilities,
22
- };
23
- });
13
+ // Tool: list_agents - List all available agents (built-in + custom)
14
+ server.tool("list_agents", "List all available AI agents and their capabilities. Includes both built-in agents and custom agents from .spec-kit/agents/.", {}, async () => {
15
+ const agents = await listAgentsDetailed();
16
+ const formatted = agents.map((agent) => ({
17
+ name: agent.name,
18
+ displayName: agent.displayName,
19
+ description: agent.description,
20
+ capabilities: agent.capabilities,
21
+ source: agent.source, // "local" or "builtin"
22
+ }));
24
23
  return {
25
24
  content: [{
26
25
  type: "text",
@@ -29,12 +28,12 @@ export function registerAgentTools(server) {
29
28
  };
30
29
  });
31
30
  // Tool: get_agent_prompt - Get system prompt for an agent
32
- server.tool("get_agent_prompt", "Retrieve the full system prompt for a specific agent. Use this to understand how an agent behaves and its guidelines.", {
33
- agent_name: z.enum(["SpecAgent", "PlanAgent", "GovAgent", "TestAgent"])
34
- .describe("Name of the agent to get prompt for"),
31
+ server.tool("get_agent_prompt", "Retrieve the full system prompt for a specific agent. Supports built-in agents and custom agents from .spec-kit/agents/.", {
32
+ agent_name: z.string()
33
+ .describe("Name of the agent to get prompt for (e.g., SpecAgent, PlanAgent, or a custom agent name)"),
35
34
  }, async ({ agent_name }) => {
36
35
  try {
37
- const agent = getAgent(agent_name);
36
+ const agent = await loadAgent(agent_name);
38
37
  const response = `# Agent: ${agent.displayName}
39
38
 
40
39
  ## Description
@@ -66,16 +65,16 @@ ${agent.systemPrompt}
66
65
  }
67
66
  });
68
67
  // Tool: invoke_agent - Get agent context for a specific task
69
- server.tool("invoke_agent", "Prepare an agent context for a specific task. Returns the agent's system prompt combined with task instructions.", {
70
- agent_name: z.enum(["SpecAgent", "PlanAgent", "GovAgent", "TestAgent"])
71
- .describe("Name of the agent to invoke"),
68
+ server.tool("invoke_agent", "Prepare an agent context for a specific task. Returns the agent's system prompt combined with task instructions. Supports custom agents.", {
69
+ agent_name: z.string()
70
+ .describe("Name of the agent to invoke (e.g., SpecAgent, PlanAgent, or a custom agent name)"),
72
71
  task_description: z.string()
73
72
  .describe("Description of the task for the agent to perform"),
74
73
  context: z.string().optional()
75
74
  .describe("Additional context or data for the agent (e.g., work item details)"),
76
75
  }, async ({ agent_name, task_description, context }) => {
77
76
  try {
78
- const agent = getAgent(agent_name);
77
+ const agent = await loadAgent(agent_name);
79
78
  const response = `# 🤖 ${agent.displayName} Activated
80
79
 
81
80
  ## System Context
@@ -1 +1 @@
1
- {"version":3,"file":"agentTools.js","sourceRoot":"","sources":["../../src/tools/agentTools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,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K,CAAC,EAAE;qBAC3E,CAAC;gBACF,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Agent Loader
3
+ *
4
+ * Loads agent definitions with local override support.
5
+ *
6
+ * Resolution order:
7
+ * 1. Local project: .spec-kit/agents/
8
+ * 2. Package defaults: Built-in agents (src/prompts/agents.ts)
9
+ *
10
+ * This allows any project to customize agents or create new ones.
11
+ */
12
+ import { type AgentDefinition, type AgentType } from "../prompts/agents.js";
13
+ /**
14
+ * Extended agent type that includes custom agents
15
+ */
16
+ export type ExtendedAgentType = AgentType | string;
17
+ /**
18
+ * Load a single agent by name
19
+ *
20
+ * Resolution order:
21
+ * 1. Local override: .spec-kit/agents/{name}.md
22
+ * 2. Built-in agent from AgentRegistry
23
+ */
24
+ export declare function loadAgent(name: ExtendedAgentType): Promise<AgentDefinition>;
25
+ /**
26
+ * Get the system prompt for an agent
27
+ */
28
+ export declare function getAgentPrompt(name: ExtendedAgentType): Promise<string>;
29
+ /**
30
+ * List all available agents (local + built-in)
31
+ * Local agents override built-in agents with the same name
32
+ */
33
+ export declare function listAllAgents(): Promise<Array<{
34
+ name: string;
35
+ displayName: string;
36
+ description: string;
37
+ source: "local" | "builtin";
38
+ }>>;
39
+ /**
40
+ * List agents with full details (including capabilities)
41
+ */
42
+ export declare function listAgentsDetailed(): Promise<Array<{
43
+ name: string;
44
+ displayName: string;
45
+ description: string;
46
+ capabilities: string[];
47
+ source: "local" | "builtin";
48
+ }>>;
49
+ /**
50
+ * Check if an agent exists (local or built-in)
51
+ */
52
+ export declare function agentExists(name: string): Promise<boolean>;
53
+ //# sourceMappingURL=agentLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentLoader.d.ts","sourceRoot":"","sources":["../../src/utils/agentLoader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,EAAiB,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAM3F;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,MAAM,CAAC;AA4GnD;;;;;;GAMG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC,CAwBjF;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAG7E;AAED;;;GAGG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,KAAK,CAAC;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;CAC7B,CAAC,CAAC,CA0CF;AAED;;GAEG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,KAAK,CAAC;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;CAC7B,CAAC,CAAC,CA6CF;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAShE"}
@@ -0,0 +1,225 @@
1
+ /**
2
+ * Agent Loader
3
+ *
4
+ * Loads agent definitions with local override support.
5
+ *
6
+ * Resolution order:
7
+ * 1. Local project: .spec-kit/agents/
8
+ * 2. Package defaults: Built-in agents (src/prompts/agents.ts)
9
+ *
10
+ * This allows any project to customize agents or create new ones.
11
+ */
12
+ import * as fs from "node:fs/promises";
13
+ import * as path from "node:path";
14
+ import yaml from "js-yaml";
15
+ import { AgentRegistry } from "../prompts/agents.js";
16
+ // Directory name for local agents
17
+ const AGENTS_DIR = "agents";
18
+ const LOCAL_CONFIG_DIR = ".spec-kit";
19
+ /**
20
+ * Get the current working directory (user's project)
21
+ */
22
+ function getProjectRoot() {
23
+ return process.cwd();
24
+ }
25
+ /**
26
+ * Check if a file exists
27
+ */
28
+ async function fileExists(filePath) {
29
+ try {
30
+ await fs.access(filePath);
31
+ return true;
32
+ }
33
+ catch {
34
+ return false;
35
+ }
36
+ }
37
+ /**
38
+ * Parse a Markdown agent file with YAML frontmatter
39
+ *
40
+ * Expected format:
41
+ * ```
42
+ * ---
43
+ * name: MyAgent
44
+ * displayName: "My Custom Agent"
45
+ * description: "What this agent does"
46
+ * capabilities:
47
+ * - Capability 1
48
+ * - Capability 2
49
+ * ---
50
+ *
51
+ * ## System Prompt
52
+ *
53
+ * Your system prompt content here...
54
+ * ```
55
+ */
56
+ async function parseAgentFile(filePath) {
57
+ try {
58
+ const content = await fs.readFile(filePath, "utf-8");
59
+ // Extract frontmatter (between --- markers)
60
+ const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);
61
+ if (!frontmatterMatch) {
62
+ console.warn(`Agent file ${filePath} has no valid frontmatter`);
63
+ return null;
64
+ }
65
+ const frontmatterRaw = frontmatterMatch[1] ?? "";
66
+ const systemPrompt = frontmatterMatch[2]?.trim() || "";
67
+ // Parse YAML frontmatter
68
+ const frontmatter = yaml.load(frontmatterRaw);
69
+ if (!frontmatter.name || !frontmatter.displayName || !frontmatter.description) {
70
+ console.warn(`Agent file ${filePath} missing required fields (name, displayName, description)`);
71
+ return null;
72
+ }
73
+ return {
74
+ name: frontmatter.name,
75
+ displayName: frontmatter.displayName,
76
+ description: frontmatter.description,
77
+ capabilities: frontmatter.capabilities || [],
78
+ systemPrompt: systemPrompt,
79
+ };
80
+ }
81
+ catch (error) {
82
+ console.warn(`Failed to parse agent file ${filePath}:`, error);
83
+ return null;
84
+ }
85
+ }
86
+ /**
87
+ * Get the local agents directory path
88
+ */
89
+ function getLocalAgentsDir() {
90
+ return path.join(getProjectRoot(), LOCAL_CONFIG_DIR, AGENTS_DIR);
91
+ }
92
+ /**
93
+ * List all local agent files
94
+ */
95
+ async function listLocalAgentFiles() {
96
+ const agentsDir = getLocalAgentsDir();
97
+ try {
98
+ const files = await fs.readdir(agentsDir);
99
+ return files.filter(f => f.endsWith(".md"));
100
+ }
101
+ catch {
102
+ // Directory doesn't exist
103
+ return [];
104
+ }
105
+ }
106
+ /**
107
+ * Load a single agent by name
108
+ *
109
+ * Resolution order:
110
+ * 1. Local override: .spec-kit/agents/{name}.md
111
+ * 2. Built-in agent from AgentRegistry
112
+ */
113
+ export async function loadAgent(name) {
114
+ // 1. Try local override first
115
+ const localPath = path.join(getLocalAgentsDir(), `${name}.md`);
116
+ if (await fileExists(localPath)) {
117
+ const localAgent = await parseAgentFile(localPath);
118
+ if (localAgent) {
119
+ return localAgent;
120
+ }
121
+ }
122
+ // 2. Fall back to built-in agent
123
+ const builtinAgent = AgentRegistry[name];
124
+ if (builtinAgent) {
125
+ return builtinAgent;
126
+ }
127
+ // 3. Agent not found
128
+ const available = await listAllAgents();
129
+ throw new Error(`Agent "${name}" not found.\n` +
130
+ `Available agents: ${available.map(a => a.name).join(", ") || "none"}\n\n` +
131
+ `Tip: Create custom agents in .spec-kit/agents/${name}.md`);
132
+ }
133
+ /**
134
+ * Get the system prompt for an agent
135
+ */
136
+ export async function getAgentPrompt(name) {
137
+ const agent = await loadAgent(name);
138
+ return agent.systemPrompt;
139
+ }
140
+ /**
141
+ * List all available agents (local + built-in)
142
+ * Local agents override built-in agents with the same name
143
+ */
144
+ export async function listAllAgents() {
145
+ const results = [];
146
+ const seen = new Set();
147
+ // 1. Load local agents first (they take priority)
148
+ const localFiles = await listLocalAgentFiles();
149
+ for (const file of localFiles) {
150
+ const filePath = path.join(getLocalAgentsDir(), file);
151
+ const agent = await parseAgentFile(filePath);
152
+ if (agent && !seen.has(agent.name)) {
153
+ seen.add(agent.name);
154
+ results.push({
155
+ name: agent.name,
156
+ displayName: agent.displayName,
157
+ description: agent.description,
158
+ source: "local",
159
+ });
160
+ }
161
+ }
162
+ // 2. Add built-in agents (if not overridden)
163
+ for (const [name, agent] of Object.entries(AgentRegistry)) {
164
+ if (!seen.has(name)) {
165
+ seen.add(name);
166
+ results.push({
167
+ name: agent.name,
168
+ displayName: agent.displayName,
169
+ description: agent.description,
170
+ source: "builtin",
171
+ });
172
+ }
173
+ }
174
+ return results;
175
+ }
176
+ /**
177
+ * List agents with full details (including capabilities)
178
+ */
179
+ export async function listAgentsDetailed() {
180
+ const results = [];
181
+ const seen = new Set();
182
+ // 1. Load local agents first
183
+ const localFiles = await listLocalAgentFiles();
184
+ for (const file of localFiles) {
185
+ const filePath = path.join(getLocalAgentsDir(), file);
186
+ const agent = await parseAgentFile(filePath);
187
+ if (agent && !seen.has(agent.name)) {
188
+ seen.add(agent.name);
189
+ results.push({
190
+ name: agent.name,
191
+ displayName: agent.displayName,
192
+ description: agent.description,
193
+ capabilities: agent.capabilities,
194
+ source: "local",
195
+ });
196
+ }
197
+ }
198
+ // 2. Add built-in agents
199
+ for (const [name, agent] of Object.entries(AgentRegistry)) {
200
+ if (!seen.has(name)) {
201
+ seen.add(name);
202
+ results.push({
203
+ name: agent.name,
204
+ displayName: agent.displayName,
205
+ description: agent.description,
206
+ capabilities: agent.capabilities,
207
+ source: "builtin",
208
+ });
209
+ }
210
+ }
211
+ return results;
212
+ }
213
+ /**
214
+ * Check if an agent exists (local or built-in)
215
+ */
216
+ export async function agentExists(name) {
217
+ // Check local
218
+ const localPath = path.join(getLocalAgentsDir(), `${name}.md`);
219
+ if (await fileExists(localPath)) {
220
+ return true;
221
+ }
222
+ // Check built-in
223
+ return name in AgentRegistry;
224
+ }
225
+ //# sourceMappingURL=agentLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentLoader.js","sourceRoot":"","sources":["../../src/utils/agentLoader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CA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ils/starterKitInstaller.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAsEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE;IACP,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACjB,GACL,OAAO,CAAC,aAAa,CAAC,CA8KxB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAW7C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAqGtF;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;IACrE,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC,CASD"}
1
+ {"version":3,"file":"starterKitInstaller.d.ts","sourceRoot":"","sources":["../../src/utils/starterKitInstaller.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAuEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE;IACP,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACjB,GACL,OAAO,CAAC,aAAa,CAAC,CAkMxB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAW7C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CA2GtF;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;IACrE,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC,CASD"}
@@ -15,6 +15,7 @@ const PROMPTS_DIR = "prompts";
15
15
  const TEMPLATES_DIR = "templates";
16
16
  const MEMORY_DIR = "memory";
17
17
  const RULES_DIR = "rules";
18
+ const AGENTS_DIR = "agents";
18
19
  const SPECS_DIR = "specs";
19
20
  /**
20
21
  * Get the package root directory (where the npm package is installed)
@@ -206,7 +207,26 @@ export async function installStarterKit(projectPath, options = {}) {
206
207
  }
207
208
  }
208
209
  }
209
- // 5. Create specs/ directory
210
+ // 5. Install agents to .spec-kit/agents/
211
+ const agentsSrc = path.join(starterKitPath, "agents");
212
+ const agentsDest = path.join(projectPath, SPEC_KIT_DIR, AGENTS_DIR);
213
+ if (await exists(agentsSrc)) {
214
+ const agentsExist = await exists(agentsDest);
215
+ if (agentsExist && !options.force) {
216
+ result.skipped.push(`${SPEC_KIT_DIR}/${AGENTS_DIR}`);
217
+ }
218
+ else {
219
+ try {
220
+ await copyDir(agentsSrc, agentsDest);
221
+ result.created.push(`${SPEC_KIT_DIR}/${AGENTS_DIR}`);
222
+ }
223
+ catch (error) {
224
+ result.errors.push(`Failed to copy agents: ${error}`);
225
+ result.success = false;
226
+ }
227
+ }
228
+ }
229
+ // 6. Create specs/ directory
210
230
  const specsDir = path.join(projectPath, SPECS_DIR);
211
231
  if (!(await exists(specsDir))) {
212
232
  try {
@@ -310,6 +330,12 @@ export function formatInstallReport(result, projectPath) {
310
330
  report += "│ ├── rules/ # Validation rules (security, RGPD)\n";
311
331
  report += "│ │ ├── security-rules.md\n";
312
332
  report += "│ │ └── rgpd-rules.md\n";
333
+ report += "│ ├── agents/ # Customizable AI agents\n";
334
+ report += "│ │ ├── SpecAgent.md\n";
335
+ report += "│ │ ├── PlanAgent.md\n";
336
+ report += "│ │ ├── GovAgent.md\n";
337
+ report += "│ │ ├── TestAgent.md\n";
338
+ report += "│ │ └── _CustomAgent.template.md\n";
313
339
  report += "│ └── memory/ # Project context\n";
314
340
  report += "│ └── constitution.md # Project principles\n";
315
341
  report += "├── specs/ # Generated specifications\n";