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,236 @@
|
|
|
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
|
+
* SpecAgent - Specification Writer
|
|
9
|
+
* Specialized in creating detailed functional and technical specifications
|
|
10
|
+
*/
|
|
11
|
+
export const SpecAgent = {
|
|
12
|
+
name: "SpecAgent",
|
|
13
|
+
displayName: "Specification Agent",
|
|
14
|
+
description: "Expert in writing clear, comprehensive specifications from requirements",
|
|
15
|
+
capabilities: [
|
|
16
|
+
"Analyze requirements and acceptance criteria",
|
|
17
|
+
"Structure specifications following templates",
|
|
18
|
+
"Identify gaps and ambiguities in requirements",
|
|
19
|
+
"Generate user stories and acceptance criteria",
|
|
20
|
+
"Document functional and non-functional requirements",
|
|
21
|
+
],
|
|
22
|
+
systemPrompt: `You are SpecAgent, an expert technical writer specialized in software specifications.
|
|
23
|
+
|
|
24
|
+
## Your Role
|
|
25
|
+
You transform raw requirements, user stories, and Azure DevOps work items into well-structured, comprehensive specification documents.
|
|
26
|
+
|
|
27
|
+
## Core Principles
|
|
28
|
+
1. **Clarity First**: Write for all stakeholders - developers, QA, product owners, and business users.
|
|
29
|
+
2. **Traceability**: Always link requirements back to their source (ADO work items, user requests).
|
|
30
|
+
3. **Completeness**: Cover functional requirements, edge cases, error handling, and non-functional aspects.
|
|
31
|
+
4. **Structure**: Follow the provided templates strictly for consistency across projects.
|
|
32
|
+
|
|
33
|
+
## Writing Guidelines
|
|
34
|
+
- Use active voice and clear, concise language
|
|
35
|
+
- Include concrete examples for complex requirements
|
|
36
|
+
- Define all technical terms and acronyms
|
|
37
|
+
- Use tables for structured data (requirements, test cases)
|
|
38
|
+
- Mark uncertain or missing information with [TO FILL] placeholders
|
|
39
|
+
|
|
40
|
+
## When Analyzing Requirements
|
|
41
|
+
1. Identify the core user need and business value
|
|
42
|
+
2. Extract explicit and implicit requirements
|
|
43
|
+
3. List assumptions that need validation
|
|
44
|
+
4. Note potential risks and dependencies
|
|
45
|
+
5. Consider edge cases and error scenarios
|
|
46
|
+
|
|
47
|
+
## Output Format
|
|
48
|
+
Always structure your output according to the template provided. Include:
|
|
49
|
+
- Clear section headers
|
|
50
|
+
- Requirement IDs for traceability
|
|
51
|
+
- Priority indicators (Must Have, Should Have, Could Have)
|
|
52
|
+
- Acceptance criteria in Given/When/Then format when applicable`,
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* PlanAgent - Technical Planning Specialist
|
|
56
|
+
* Specialized in breaking down features into implementable tasks
|
|
57
|
+
*/
|
|
58
|
+
export const PlanAgent = {
|
|
59
|
+
name: "PlanAgent",
|
|
60
|
+
displayName: "Planning Agent",
|
|
61
|
+
description: "Expert in technical planning and task decomposition",
|
|
62
|
+
capabilities: [
|
|
63
|
+
"Break down features into technical tasks",
|
|
64
|
+
"Estimate effort and complexity",
|
|
65
|
+
"Identify dependencies between tasks",
|
|
66
|
+
"Suggest implementation approaches",
|
|
67
|
+
"Create sprint-ready work items",
|
|
68
|
+
],
|
|
69
|
+
systemPrompt: `You are PlanAgent, an expert technical architect specialized in implementation planning.
|
|
70
|
+
|
|
71
|
+
## Your Role
|
|
72
|
+
You transform specifications and requirements into actionable, well-structured implementation plans with clear tasks, dependencies, and estimates.
|
|
73
|
+
|
|
74
|
+
## Core Principles
|
|
75
|
+
1. **Actionable Tasks**: Each task should be completable by a single developer in 1-3 days.
|
|
76
|
+
2. **Clear Dependencies**: Explicitly identify what must be done before each task.
|
|
77
|
+
3. **Risk-Aware**: Highlight technical risks and suggest mitigation strategies.
|
|
78
|
+
4. **Pragmatic**: Balance ideal solutions with practical constraints (time, resources, tech debt).
|
|
79
|
+
|
|
80
|
+
## Task Decomposition Guidelines
|
|
81
|
+
- Start with the end-to-end happy path
|
|
82
|
+
- Add error handling and edge cases as separate tasks
|
|
83
|
+
- Include tasks for testing, documentation, and deployment
|
|
84
|
+
- Consider database migrations, API changes, and breaking changes
|
|
85
|
+
- Account for code review and QA time
|
|
86
|
+
|
|
87
|
+
## Estimation Approach
|
|
88
|
+
- Use relative sizing (S/M/L/XL) or story points
|
|
89
|
+
- Factor in unknowns and learning curves
|
|
90
|
+
- Include buffer for integration and testing
|
|
91
|
+
- Be explicit about assumptions affecting estimates
|
|
92
|
+
|
|
93
|
+
## Output Format
|
|
94
|
+
For each task, provide:
|
|
95
|
+
- Clear title (verb + object)
|
|
96
|
+
- Description with acceptance criteria
|
|
97
|
+
- Size/effort estimate
|
|
98
|
+
- Dependencies (task IDs)
|
|
99
|
+
- Technical notes and implementation hints
|
|
100
|
+
- Risk flags if applicable`,
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* GovAgent - Governance & Quality Reviewer
|
|
104
|
+
* Specialized in reviewing documents for completeness and compliance
|
|
105
|
+
*/
|
|
106
|
+
export const GovAgent = {
|
|
107
|
+
name: "GovAgent",
|
|
108
|
+
displayName: "Governance Agent",
|
|
109
|
+
description: "Expert in quality assurance and compliance review",
|
|
110
|
+
capabilities: [
|
|
111
|
+
"Review specifications for completeness",
|
|
112
|
+
"Check compliance with standards",
|
|
113
|
+
"Identify inconsistencies and gaps",
|
|
114
|
+
"Validate traceability",
|
|
115
|
+
"Suggest improvements",
|
|
116
|
+
],
|
|
117
|
+
systemPrompt: `You are GovAgent, an expert quality assurance specialist focused on documentation governance.
|
|
118
|
+
|
|
119
|
+
## Your Role
|
|
120
|
+
You review specifications, plans, and documentation to ensure they meet quality standards, are complete, consistent, and compliant with organizational guidelines.
|
|
121
|
+
|
|
122
|
+
## Core Principles
|
|
123
|
+
1. **Completeness**: Ensure all required sections are filled and adequate.
|
|
124
|
+
2. **Consistency**: Check for contradictions between sections.
|
|
125
|
+
3. **Clarity**: Verify content is understandable by target audience.
|
|
126
|
+
4. **Compliance**: Validate adherence to templates and standards.
|
|
127
|
+
5. **Traceability**: Confirm requirements link to sources and tests.
|
|
128
|
+
|
|
129
|
+
## Review Checklist
|
|
130
|
+
- [ ] All template sections are present and filled
|
|
131
|
+
- [ ] Requirements have unique IDs and priorities
|
|
132
|
+
- [ ] Acceptance criteria are testable (Given/When/Then)
|
|
133
|
+
- [ ] Dependencies and risks are documented
|
|
134
|
+
- [ ] Stakeholders and approvers are identified
|
|
135
|
+
- [ ] Technical terms are defined or linked
|
|
136
|
+
- [ ] No [TO FILL] placeholders in final versions
|
|
137
|
+
|
|
138
|
+
## Feedback Guidelines
|
|
139
|
+
- Be specific: reference exact sections and lines
|
|
140
|
+
- Be constructive: suggest improvements, not just problems
|
|
141
|
+
- Prioritize: distinguish critical issues from nice-to-haves
|
|
142
|
+
- Be actionable: provide clear steps to resolve issues
|
|
143
|
+
|
|
144
|
+
## Output Format
|
|
145
|
+
Provide a structured review with:
|
|
146
|
+
1. **Summary**: Overall assessment (Approved/Needs Work/Rejected)
|
|
147
|
+
2. **Critical Issues**: Must fix before approval
|
|
148
|
+
3. **Recommendations**: Suggested improvements
|
|
149
|
+
4. **Questions**: Items needing clarification
|
|
150
|
+
5. **Checklist Status**: Pass/Fail for each review criterion`,
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* TestAgent - Test Strategy Specialist
|
|
154
|
+
* Specialized in creating test plans and test cases
|
|
155
|
+
*/
|
|
156
|
+
export const TestAgent = {
|
|
157
|
+
name: "TestAgent",
|
|
158
|
+
displayName: "Testing Agent",
|
|
159
|
+
description: "Expert in test strategy and test case design",
|
|
160
|
+
capabilities: [
|
|
161
|
+
"Create test strategies from specifications",
|
|
162
|
+
"Design test cases and scenarios",
|
|
163
|
+
"Identify edge cases and boundary conditions",
|
|
164
|
+
"Define test data requirements",
|
|
165
|
+
"Suggest automation approaches",
|
|
166
|
+
],
|
|
167
|
+
systemPrompt: `You are TestAgent, an expert QA engineer specialized in test strategy and design.
|
|
168
|
+
|
|
169
|
+
## Your Role
|
|
170
|
+
You analyze specifications and requirements to create comprehensive test strategies, test cases, and test data requirements.
|
|
171
|
+
|
|
172
|
+
## Core Principles
|
|
173
|
+
1. **Coverage**: Ensure all requirements have corresponding test cases.
|
|
174
|
+
2. **Risk-Based**: Prioritize testing based on risk and business impact.
|
|
175
|
+
3. **Practical**: Design tests that can be executed and automated.
|
|
176
|
+
4. **Clear**: Write test cases that anyone can understand and execute.
|
|
177
|
+
|
|
178
|
+
## Test Design Guidelines
|
|
179
|
+
- Start with happy path scenarios
|
|
180
|
+
- Add negative tests for error conditions
|
|
181
|
+
- Include boundary value tests
|
|
182
|
+
- Consider security and performance aspects
|
|
183
|
+
- Design for both manual and automated execution
|
|
184
|
+
|
|
185
|
+
## Test Case Format
|
|
186
|
+
Each test case should include:
|
|
187
|
+
- Unique ID linked to requirement
|
|
188
|
+
- Clear preconditions
|
|
189
|
+
- Step-by-step actions
|
|
190
|
+
- Expected results for each step
|
|
191
|
+
- Test data requirements
|
|
192
|
+
- Priority and automation candidate flag
|
|
193
|
+
|
|
194
|
+
## Output Format
|
|
195
|
+
1. **Test Strategy**: Overall approach and scope
|
|
196
|
+
2. **Test Scenarios**: High-level test scenarios
|
|
197
|
+
3. **Test Cases**: Detailed test cases with steps
|
|
198
|
+
4. **Test Data**: Required test data and setup
|
|
199
|
+
5. **Automation Notes**: What to automate and how`,
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* Registry of all available agents
|
|
203
|
+
*/
|
|
204
|
+
export const AgentRegistry = {
|
|
205
|
+
SpecAgent,
|
|
206
|
+
PlanAgent,
|
|
207
|
+
GovAgent,
|
|
208
|
+
TestAgent,
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Get an agent definition by name
|
|
212
|
+
*/
|
|
213
|
+
export function getAgent(name) {
|
|
214
|
+
const agent = AgentRegistry[name];
|
|
215
|
+
if (!agent) {
|
|
216
|
+
throw new Error(`Unknown agent: ${name}. Available: ${Object.keys(AgentRegistry).join(", ")}`);
|
|
217
|
+
}
|
|
218
|
+
return agent;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Get the system prompt for an agent
|
|
222
|
+
*/
|
|
223
|
+
export function getAgentPrompt(name) {
|
|
224
|
+
return getAgent(name).systemPrompt;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* List all available agents with their descriptions
|
|
228
|
+
*/
|
|
229
|
+
export function listAgents() {
|
|
230
|
+
return Object.values(AgentRegistry).map(({ name, displayName, description }) => ({
|
|
231
|
+
name,
|
|
232
|
+
displayName,
|
|
233
|
+
description,
|
|
234
|
+
}));
|
|
235
|
+
}
|
|
236
|
+
//# sourceMappingURL=agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/prompts/agents.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAkBH;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAoB;IACxC,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,yEAAyE;IACtF,YAAY,EAAE;QACZ,8CAA8C;QAC9C,8CAA8C;QAC9C,+CAA+C;QAC/C,+CAA+C;QAC/C,qDAAqD;KACtD;IACD,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gEA8BgD;CAC/D,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAoB;IAC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CAAC;IACjG,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,IAAe;IAC5C,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;QAC/E,IAAI;QACJ,WAAW;QACX,WAAW;KACZ,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Schema Definitions
|
|
3
|
+
*
|
|
4
|
+
* Zod schemas for validating workflow YAML files
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
/**
|
|
8
|
+
* Schema for a single workflow step
|
|
9
|
+
*/
|
|
10
|
+
export declare const WorkflowStepSchema: z.ZodObject<{
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
action: z.ZodEnum<{
|
|
14
|
+
fetch_ado: "fetch_ado";
|
|
15
|
+
generate_content: "generate_content";
|
|
16
|
+
review: "review";
|
|
17
|
+
create_file: "create_file";
|
|
18
|
+
call_agent: "call_agent";
|
|
19
|
+
}>;
|
|
20
|
+
description: z.ZodString;
|
|
21
|
+
agent: z.ZodOptional<z.ZodString>;
|
|
22
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
23
|
+
outputs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
24
|
+
next: z.ZodOptional<z.ZodString>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
/**
|
|
27
|
+
* Schema for workflow metadata
|
|
28
|
+
*/
|
|
29
|
+
export declare const WorkflowMetadataSchema: z.ZodObject<{
|
|
30
|
+
version: z.ZodDefault<z.ZodString>;
|
|
31
|
+
author: z.ZodOptional<z.ZodString>;
|
|
32
|
+
created: z.ZodOptional<z.ZodString>;
|
|
33
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
/**
|
|
36
|
+
* Schema for a complete workflow definition
|
|
37
|
+
*/
|
|
38
|
+
export declare const WorkflowSchema: z.ZodObject<{
|
|
39
|
+
name: z.ZodString;
|
|
40
|
+
displayName: z.ZodString;
|
|
41
|
+
description: z.ZodString;
|
|
42
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
43
|
+
version: z.ZodDefault<z.ZodString>;
|
|
44
|
+
author: z.ZodOptional<z.ZodString>;
|
|
45
|
+
created: z.ZodOptional<z.ZodString>;
|
|
46
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
template: z.ZodString;
|
|
49
|
+
defaultAgent: z.ZodDefault<z.ZodString>;
|
|
50
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
51
|
+
id: z.ZodString;
|
|
52
|
+
name: z.ZodString;
|
|
53
|
+
action: z.ZodEnum<{
|
|
54
|
+
fetch_ado: "fetch_ado";
|
|
55
|
+
generate_content: "generate_content";
|
|
56
|
+
review: "review";
|
|
57
|
+
create_file: "create_file";
|
|
58
|
+
call_agent: "call_agent";
|
|
59
|
+
}>;
|
|
60
|
+
description: z.ZodString;
|
|
61
|
+
agent: z.ZodOptional<z.ZodString>;
|
|
62
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
63
|
+
outputs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
64
|
+
next: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, z.core.$strip>>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
export type WorkflowStep = z.infer<typeof WorkflowStepSchema>;
|
|
68
|
+
export type WorkflowMetadata = z.infer<typeof WorkflowMetadataSchema>;
|
|
69
|
+
export type Workflow = z.infer<typeof WorkflowSchema>;
|
|
70
|
+
//# sourceMappingURL=workflowSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflowSchema.d.ts","sourceRoot":"","sources":["../../src/schemas/workflowSchema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;iBAU7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;iBAKjC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQzB,CAAC;AAGH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Schema Definitions
|
|
3
|
+
*
|
|
4
|
+
* Zod schemas for validating workflow YAML files
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
/**
|
|
8
|
+
* Schema for a single workflow step
|
|
9
|
+
*/
|
|
10
|
+
export const WorkflowStepSchema = z.object({
|
|
11
|
+
id: z.string().describe("Unique identifier for the step"),
|
|
12
|
+
name: z.string().describe("Human-readable step name"),
|
|
13
|
+
action: z.enum(["fetch_ado", "generate_content", "review", "create_file", "call_agent"])
|
|
14
|
+
.describe("The type of action to perform"),
|
|
15
|
+
description: z.string().describe("Detailed description of what this step does"),
|
|
16
|
+
agent: z.string().optional().describe("Agent to use for this step (e.g., SpecAgent, PlanAgent)"),
|
|
17
|
+
inputs: z.record(z.string(), z.string()).optional().describe("Input parameters for the step"),
|
|
18
|
+
outputs: z.array(z.string()).optional().describe("Expected outputs from this step"),
|
|
19
|
+
next: z.string().optional().describe("Next step ID (if not sequential)"),
|
|
20
|
+
});
|
|
21
|
+
/**
|
|
22
|
+
* Schema for workflow metadata
|
|
23
|
+
*/
|
|
24
|
+
export const WorkflowMetadataSchema = z.object({
|
|
25
|
+
version: z.string().default("1.0"),
|
|
26
|
+
author: z.string().optional(),
|
|
27
|
+
created: z.string().optional(),
|
|
28
|
+
tags: z.array(z.string()).optional(),
|
|
29
|
+
});
|
|
30
|
+
/**
|
|
31
|
+
* Schema for a complete workflow definition
|
|
32
|
+
*/
|
|
33
|
+
export const WorkflowSchema = z.object({
|
|
34
|
+
name: z.string().describe("Workflow identifier"),
|
|
35
|
+
displayName: z.string().describe("Human-readable workflow name"),
|
|
36
|
+
description: z.string().describe("What this workflow accomplishes"),
|
|
37
|
+
metadata: WorkflowMetadataSchema.optional(),
|
|
38
|
+
template: z.string().describe("Associated template file (e.g., functional-spec.md)"),
|
|
39
|
+
defaultAgent: z.string().default("SpecAgent").describe("Default agent for this workflow"),
|
|
40
|
+
steps: z.array(WorkflowStepSchema).min(1).describe("Ordered list of workflow steps"),
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=workflowSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflowSchema.js","sourceRoot":"","sources":["../../src/schemas/workflowSchema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;IACzD,IAAI,EAAE,CAAC,CAAC,MAAM,EAA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C,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;IAChD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IAChE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IACnE,QAAQ,EAAE,sBAAsB,CAAC,QAAQ,EAAE;IAC3C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qDAAqD,CAAC;IACpF,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IACzF,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,gCAAgC,CAAC;CACrF,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Tools
|
|
3
|
+
*
|
|
4
|
+
* MCP tools for interacting with agent system prompts
|
|
5
|
+
*/
|
|
6
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
7
|
+
/**
|
|
8
|
+
* Register agent-related tools on the MCP server
|
|
9
|
+
*/
|
|
10
|
+
export declare function registerAgentTools(server: McpServer): void;
|
|
11
|
+
//# sourceMappingURL=agentTools.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Tools
|
|
3
|
+
*
|
|
4
|
+
* MCP tools for interacting with agent system prompts
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { AgentRegistry, getAgent, listAgents } from "../prompts/agents.js";
|
|
8
|
+
/**
|
|
9
|
+
* Register agent-related tools on the MCP server
|
|
10
|
+
*/
|
|
11
|
+
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
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
content: [{
|
|
26
|
+
type: "text",
|
|
27
|
+
text: JSON.stringify({ agents: formatted }, null, 2),
|
|
28
|
+
}],
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
// 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"),
|
|
35
|
+
}, async ({ agent_name }) => {
|
|
36
|
+
try {
|
|
37
|
+
const agent = getAgent(agent_name);
|
|
38
|
+
const response = `# Agent: ${agent.displayName}
|
|
39
|
+
|
|
40
|
+
## Description
|
|
41
|
+
${agent.description}
|
|
42
|
+
|
|
43
|
+
## Capabilities
|
|
44
|
+
${agent.capabilities.map((c) => `- ${c}`).join("\n")}
|
|
45
|
+
|
|
46
|
+
## System Prompt
|
|
47
|
+
\`\`\`
|
|
48
|
+
${agent.systemPrompt}
|
|
49
|
+
\`\`\`
|
|
50
|
+
`;
|
|
51
|
+
return {
|
|
52
|
+
content: [{
|
|
53
|
+
type: "text",
|
|
54
|
+
text: response,
|
|
55
|
+
}],
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
return {
|
|
60
|
+
content: [{
|
|
61
|
+
type: "text",
|
|
62
|
+
text: `❌ Error: ${error instanceof Error ? error.message : String(error)}`,
|
|
63
|
+
}],
|
|
64
|
+
isError: true,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
// 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"),
|
|
72
|
+
task_description: z.string()
|
|
73
|
+
.describe("Description of the task for the agent to perform"),
|
|
74
|
+
context: z.string().optional()
|
|
75
|
+
.describe("Additional context or data for the agent (e.g., work item details)"),
|
|
76
|
+
}, async ({ agent_name, task_description, context }) => {
|
|
77
|
+
try {
|
|
78
|
+
const agent = getAgent(agent_name);
|
|
79
|
+
const response = `# 🤖 ${agent.displayName} Activated
|
|
80
|
+
|
|
81
|
+
## System Context
|
|
82
|
+
${agent.systemPrompt}
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Task Assignment
|
|
87
|
+
|
|
88
|
+
**Task:** ${task_description}
|
|
89
|
+
|
|
90
|
+
${context ? `## Provided Context\n\n${context}\n\n---` : ""}
|
|
91
|
+
|
|
92
|
+
## Instructions
|
|
93
|
+
|
|
94
|
+
You are now operating as **${agent.displayName}**. Follow the system context above to complete the assigned task.
|
|
95
|
+
|
|
96
|
+
Use your capabilities:
|
|
97
|
+
${agent.capabilities.map((c) => `- ${c}`).join("\n")}
|
|
98
|
+
|
|
99
|
+
Proceed with the task.
|
|
100
|
+
`;
|
|
101
|
+
return {
|
|
102
|
+
content: [{
|
|
103
|
+
type: "text",
|
|
104
|
+
text: response,
|
|
105
|
+
}],
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
return {
|
|
110
|
+
content: [{
|
|
111
|
+
type: "text",
|
|
112
|
+
text: `❌ Error: ${error instanceof Error ? error.message : String(error)}`,
|
|
113
|
+
}],
|
|
114
|
+
isError: true,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=agentTools.js.map
|
|
@@ -0,0 +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,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAkB,MAAM,sBAAsB,CAAC;AAE3F;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAiB;IAElD,gDAAgD;IAChD,MAAM,CAAC,IAAI,CACT,aAAa,EACb,qHAAqH,EACrH,EAAE,EACF,KAAK,IAAI,EAAE;QACT,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;QAC5B,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACrC,MAAM,IAAI,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACvC,OAAO;gBACL,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,WAAW,EAAE,KAAK,CAAC,WAAW;gBAC9B,WAAW,EAAE,KAAK,CAAC,WAAW;gBAC9B,YAAY,EAAE,IAAI,CAAC,YAAY;aAChC,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAe;oBACrB,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CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Orchestration Tools
|
|
3
|
+
*
|
|
4
|
+
* MCP tools for automated workflow orchestration.
|
|
5
|
+
* These tools drive the workflow engine and return instructions for Copilot.
|
|
6
|
+
*/
|
|
7
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
8
|
+
/**
|
|
9
|
+
* Register orchestration tools on the MCP server
|
|
10
|
+
*/
|
|
11
|
+
export declare function registerOrchestrationTools(server: McpServer): void;
|
|
12
|
+
//# sourceMappingURL=orchestrationTools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrationTools.d.ts","sourceRoot":"","sources":["../../src/tools/orchestrationTools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAiDzE;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAkYlE"}
|