midas-mcp 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.
- package/README.md +167 -0
- package/dist/docs/CHEATSHEET.md +122 -0
- package/dist/docs/INGREDIENTS.md +173 -0
- package/dist/docs/METHODOLOGY.md +334 -0
- package/dist/docs/PROMPTS.md +347 -0
- package/dist/docs/SPEC.md +330 -0
- package/dist/docs/USER_RULES.md +90 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/development.d.ts +3 -0
- package/dist/prompts/development.d.ts.map +1 -0
- package/dist/prompts/development.js +90 -0
- package/dist/prompts/development.js.map +1 -0
- package/dist/prompts/index.d.ts +3 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +11 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/research.d.ts +3 -0
- package/dist/prompts/research.d.ts.map +1 -0
- package/dist/prompts/research.js +56 -0
- package/dist/prompts/research.js.map +1 -0
- package/dist/prompts/review.d.ts +3 -0
- package/dist/prompts/review.d.ts.map +1 -0
- package/dist/prompts/review.js +76 -0
- package/dist/prompts/review.js.map +1 -0
- package/dist/prompts/session.d.ts +3 -0
- package/dist/prompts/session.d.ts.map +1 -0
- package/dist/prompts/session.js +35 -0
- package/dist/prompts/session.js.map +1 -0
- package/dist/resources/index.d.ts +3 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +63 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +65 -0
- package/dist/server.js.map +1 -0
- package/dist/state/phase.d.ts +32 -0
- package/dist/state/phase.d.ts.map +1 -0
- package/dist/state/phase.js +125 -0
- package/dist/state/phase.js.map +1 -0
- package/dist/tools/audit.d.ts +23 -0
- package/dist/tools/audit.d.ts.map +1 -0
- package/dist/tools/audit.js +212 -0
- package/dist/tools/audit.js.map +1 -0
- package/dist/tools/docs.d.ts +23 -0
- package/dist/tools/docs.d.ts.map +1 -0
- package/dist/tools/docs.js +66 -0
- package/dist/tools/docs.js.map +1 -0
- package/dist/tools/horizon.d.ts +20 -0
- package/dist/tools/horizon.d.ts.map +1 -0
- package/dist/tools/horizon.js +75 -0
- package/dist/tools/horizon.js.map +1 -0
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +13 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/oneshot.d.ts +21 -0
- package/dist/tools/oneshot.d.ts.map +1 -0
- package/dist/tools/oneshot.js +27 -0
- package/dist/tools/oneshot.js.map +1 -0
- package/dist/tools/phase.d.ts +51 -0
- package/dist/tools/phase.d.ts.map +1 -0
- package/dist/tools/phase.js +152 -0
- package/dist/tools/phase.js.map +1 -0
- package/dist/tools/tornado.d.ts +20 -0
- package/dist/tools/tornado.d.ts.map +1 -0
- package/dist/tools/tornado.js +61 -0
- package/dist/tools/tornado.js.map +1 -0
- package/docs/CHEATSHEET.md +122 -0
- package/docs/INGREDIENTS.md +173 -0
- package/docs/METHODOLOGY.md +334 -0
- package/docs/PROMPTS.md +347 -0
- package/docs/SPEC.md +330 -0
- package/docs/USER_RULES.md +90 -0
- package/package.json +42 -0
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
# Midas MCP Technical Specification
|
|
2
|
+
|
|
3
|
+
Technical design for the midas-mcp server.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Architecture
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
midas-mcp/
|
|
11
|
+
├── src/
|
|
12
|
+
│ ├── index.ts # MCP server entry point
|
|
13
|
+
│ ├── server.ts # Server setup and configuration
|
|
14
|
+
│ ├── tools/
|
|
15
|
+
│ │ ├── index.ts # Tool exports
|
|
16
|
+
│ │ ├── phase.ts # Phase tracking tools
|
|
17
|
+
│ │ ├── audit.ts # 12 ingredients audit
|
|
18
|
+
│ │ ├── docs.ts # Check docs completeness
|
|
19
|
+
│ │ ├── oneshot.ts # Oneshot paradigm helper
|
|
20
|
+
│ │ ├── tornado.ts # Tornado cycle trigger
|
|
21
|
+
│ │ └── horizon.ts # Horizon expansion helper
|
|
22
|
+
│ ├── prompts/
|
|
23
|
+
│ │ ├── index.ts # Prompt exports
|
|
24
|
+
│ │ ├── session.ts # Master/execution prompts
|
|
25
|
+
│ │ ├── development.ts # Feature/bug prompts
|
|
26
|
+
│ │ ├── review.ts # Security/performance review
|
|
27
|
+
│ │ └── research.ts # Research prompts
|
|
28
|
+
│ ├── resources/
|
|
29
|
+
│ │ ├── index.ts # Resource exports
|
|
30
|
+
│ │ ├── methodology.ts # Core methodology content
|
|
31
|
+
│ │ ├── prompts.ts # Prompt library content
|
|
32
|
+
│ │ └── ingredients.ts # 12 ingredients content
|
|
33
|
+
│ └── state/
|
|
34
|
+
│ └── phase.ts # Phase state machine
|
|
35
|
+
├── docs/
|
|
36
|
+
│ ├── METHODOLOGY.md # Source content
|
|
37
|
+
│ ├── PROMPTS.md # Source content
|
|
38
|
+
│ ├── INGREDIENTS.md # Source content
|
|
39
|
+
│ ├── USER_RULES.md # Source content
|
|
40
|
+
│ └── SPEC.md # This file
|
|
41
|
+
├── package.json
|
|
42
|
+
├── tsconfig.json
|
|
43
|
+
└── README.md
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Phase State Machine
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
type EagleSightStep =
|
|
52
|
+
| 'IDEA'
|
|
53
|
+
| 'RESEARCH'
|
|
54
|
+
| 'BRAINLIFT'
|
|
55
|
+
| 'PRD'
|
|
56
|
+
| 'GAMEPLAN';
|
|
57
|
+
|
|
58
|
+
type BuildStep =
|
|
59
|
+
| 'RULES_LOADED'
|
|
60
|
+
| 'CODEBASE_INDEXED'
|
|
61
|
+
| 'FILES_READ'
|
|
62
|
+
| 'RESEARCHING'
|
|
63
|
+
| 'IMPLEMENTING'
|
|
64
|
+
| 'TESTING'
|
|
65
|
+
| 'DEBUGGING';
|
|
66
|
+
|
|
67
|
+
type Phase =
|
|
68
|
+
| { phase: 'IDLE' }
|
|
69
|
+
| { phase: 'EAGLE_SIGHT'; step: EagleSightStep }
|
|
70
|
+
| { phase: 'BUILD'; step: BuildStep }
|
|
71
|
+
| { phase: 'SHIPPED' };
|
|
72
|
+
|
|
73
|
+
interface PhaseState {
|
|
74
|
+
current: Phase;
|
|
75
|
+
history: Phase[];
|
|
76
|
+
startedAt: string;
|
|
77
|
+
docs: {
|
|
78
|
+
brainlift: boolean;
|
|
79
|
+
prd: boolean;
|
|
80
|
+
gameplan: boolean;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Tools Specification
|
|
88
|
+
|
|
89
|
+
### midas_start_project
|
|
90
|
+
|
|
91
|
+
Initializes a new project with Eagle Sight.
|
|
92
|
+
|
|
93
|
+
**Input:**
|
|
94
|
+
```typescript
|
|
95
|
+
{
|
|
96
|
+
projectName: string;
|
|
97
|
+
projectPath?: string; // defaults to cwd
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Behavior:**
|
|
102
|
+
1. Creates `docs/` folder
|
|
103
|
+
2. Creates `docs/brainlift.md` with template
|
|
104
|
+
3. Creates `docs/prd.md` with template
|
|
105
|
+
4. Creates `docs/gameplan.md` with template
|
|
106
|
+
5. Sets phase to `EAGLE_SIGHT.IDEA`
|
|
107
|
+
6. Returns guidance for next step
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
### midas_get_phase
|
|
112
|
+
|
|
113
|
+
Returns current phase and recommended actions.
|
|
114
|
+
|
|
115
|
+
**Input:** none
|
|
116
|
+
|
|
117
|
+
**Output:**
|
|
118
|
+
```typescript
|
|
119
|
+
{
|
|
120
|
+
current: Phase;
|
|
121
|
+
nextSteps: string[];
|
|
122
|
+
prompt?: string; // suggested prompt for this phase
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
### midas_set_phase
|
|
129
|
+
|
|
130
|
+
Manually set the current phase.
|
|
131
|
+
|
|
132
|
+
**Input:**
|
|
133
|
+
```typescript
|
|
134
|
+
{
|
|
135
|
+
phase: 'EAGLE_SIGHT' | 'BUILD' | 'SHIPPED';
|
|
136
|
+
step?: string;
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
### midas_audit
|
|
143
|
+
|
|
144
|
+
Audit project against 12 ingredients.
|
|
145
|
+
|
|
146
|
+
**Input:**
|
|
147
|
+
```typescript
|
|
148
|
+
{
|
|
149
|
+
projectPath?: string;
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**Output:**
|
|
154
|
+
```typescript
|
|
155
|
+
{
|
|
156
|
+
scores: {
|
|
157
|
+
[ingredient: string]: {
|
|
158
|
+
exists: boolean;
|
|
159
|
+
score: number; // 0-100
|
|
160
|
+
issues: string[];
|
|
161
|
+
suggestions: string[];
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
overall: number;
|
|
165
|
+
level: 'functional' | 'integrated' | 'protected' | 'production';
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
### midas_check_docs
|
|
172
|
+
|
|
173
|
+
Verify Eagle Sight docs exist and are complete.
|
|
174
|
+
|
|
175
|
+
**Input:**
|
|
176
|
+
```typescript
|
|
177
|
+
{
|
|
178
|
+
projectPath?: string;
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
**Output:**
|
|
183
|
+
```typescript
|
|
184
|
+
{
|
|
185
|
+
brainlift: { exists: boolean; complete: boolean; issues: string[] };
|
|
186
|
+
prd: { exists: boolean; complete: boolean; issues: string[] };
|
|
187
|
+
gameplan: { exists: boolean; complete: boolean; issues: string[] };
|
|
188
|
+
ready: boolean;
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
### midas_oneshot
|
|
195
|
+
|
|
196
|
+
Construct a Oneshot retry prompt.
|
|
197
|
+
|
|
198
|
+
**Input:**
|
|
199
|
+
```typescript
|
|
200
|
+
{
|
|
201
|
+
originalPrompt: string;
|
|
202
|
+
error: string;
|
|
203
|
+
learnings?: string[];
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**Output:**
|
|
208
|
+
```typescript
|
|
209
|
+
{
|
|
210
|
+
prompt: string; // constructed oneshot prompt
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
### midas_tornado
|
|
217
|
+
|
|
218
|
+
Guide through tornado cycle.
|
|
219
|
+
|
|
220
|
+
**Input:**
|
|
221
|
+
```typescript
|
|
222
|
+
{
|
|
223
|
+
problem: string;
|
|
224
|
+
currentStep?: 'research' | 'logs' | 'tests';
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
**Output:**
|
|
229
|
+
```typescript
|
|
230
|
+
{
|
|
231
|
+
nextStep: 'research' | 'logs' | 'tests';
|
|
232
|
+
guidance: string;
|
|
233
|
+
prompt: string;
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
### midas_horizon
|
|
240
|
+
|
|
241
|
+
Expand horizontal context.
|
|
242
|
+
|
|
243
|
+
**Input:**
|
|
244
|
+
```typescript
|
|
245
|
+
{
|
|
246
|
+
currentOutput: string;
|
|
247
|
+
expectedOutput: string;
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
**Output:**
|
|
252
|
+
```typescript
|
|
253
|
+
{
|
|
254
|
+
missingContext: string[];
|
|
255
|
+
expandedPrompt: string;
|
|
256
|
+
checklist: string[];
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## Prompts Specification
|
|
263
|
+
|
|
264
|
+
Each prompt is exposed via MCP prompt capability.
|
|
265
|
+
|
|
266
|
+
### Session Prompts
|
|
267
|
+
- `master_prompt` - Initialize session
|
|
268
|
+
- `execution_prompt` - Start building
|
|
269
|
+
|
|
270
|
+
### Development Prompts
|
|
271
|
+
- `feature_planning` - Plan before implementing
|
|
272
|
+
- `feature_implementation` - Implement with TDD
|
|
273
|
+
- `bug_investigation` - Diagnose before fixing
|
|
274
|
+
- `bug_fix` - Fix with test-first
|
|
275
|
+
|
|
276
|
+
### Review Prompts
|
|
277
|
+
- `security_review` - Check for vulnerabilities
|
|
278
|
+
- `performance_review` - Check for bottlenecks
|
|
279
|
+
- `safe_refactor` - Move code safely
|
|
280
|
+
|
|
281
|
+
### Problem-Solving Prompts
|
|
282
|
+
- `oneshot_retry` - Retry with full context
|
|
283
|
+
- `tornado_trigger` - Research + Logs + Tests
|
|
284
|
+
- `horizon_expansion` - Add missing context
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## Resources Specification
|
|
289
|
+
|
|
290
|
+
Resources are served via MCP resource capability.
|
|
291
|
+
|
|
292
|
+
| URI | Content |
|
|
293
|
+
|-----|---------|
|
|
294
|
+
| `midas://methodology` | METHODOLOGY.md |
|
|
295
|
+
| `midas://prompts` | PROMPTS.md |
|
|
296
|
+
| `midas://ingredients` | INGREDIENTS.md |
|
|
297
|
+
| `midas://user-rules` | USER_RULES.md |
|
|
298
|
+
| `midas://cheatsheet` | Quick reference |
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## Implementation Notes
|
|
303
|
+
|
|
304
|
+
### Dependencies
|
|
305
|
+
- `@modelcontextprotocol/sdk` - MCP SDK
|
|
306
|
+
- `zod` - Input validation
|
|
307
|
+
|
|
308
|
+
### State Persistence
|
|
309
|
+
Phase state stored in `.midas/state.json` in project root.
|
|
310
|
+
|
|
311
|
+
### Error Handling
|
|
312
|
+
All tools return structured errors:
|
|
313
|
+
```typescript
|
|
314
|
+
{
|
|
315
|
+
error: string;
|
|
316
|
+
code: 'NOT_FOUND' | 'INVALID_INPUT' | 'PHASE_ERROR';
|
|
317
|
+
suggestion?: string;
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
### Logging
|
|
322
|
+
Use structured logging for debugging:
|
|
323
|
+
```typescript
|
|
324
|
+
console.error(JSON.stringify({
|
|
325
|
+
level: 'error',
|
|
326
|
+
tool: 'midas_audit',
|
|
327
|
+
message: 'Failed to scan project',
|
|
328
|
+
error: err.message
|
|
329
|
+
}));
|
|
330
|
+
```
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# User Rules Reference
|
|
2
|
+
|
|
3
|
+
Expert user rules for .cursorrules files.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Documentation Style
|
|
8
|
+
|
|
9
|
+
- No emojis, no ALL CAPS, no markdown tables with dashes/pipes
|
|
10
|
+
- No em dashes, no excessive formatting
|
|
11
|
+
- Bold key words inside sentences for emphasis
|
|
12
|
+
- Write tersely, casually, high IQ
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Paid Services (Firebase, APIs, etc.)
|
|
17
|
+
|
|
18
|
+
- **SHOW THE MATH** - Calculate and comment max monthly cost
|
|
19
|
+
- **LIMIT EVERYTHING** - No operation without explicit maximum
|
|
20
|
+
- **PREVENT LOOPS** - Code must not trigger itself without guards
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Security
|
|
25
|
+
|
|
26
|
+
- Build exhaustively secure, unhackable
|
|
27
|
+
- Comprehensive .gitignore from day 1
|
|
28
|
+
- Production-ready always
|
|
29
|
+
- Never git push an API key
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Code Quality
|
|
34
|
+
|
|
35
|
+
- Single responsibility principle
|
|
36
|
+
- Achieve each task in minimum tokens
|
|
37
|
+
- Testflight-deployable builds
|
|
38
|
+
- Add logs and look up documentation to debug
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Workflow
|
|
43
|
+
|
|
44
|
+
- Don't delete scripts when done, move to scripts folder
|
|
45
|
+
- Try to compile/build before git committing, fix errors as needed
|
|
46
|
+
- Simple short git commit after changes, no emojis or special characters
|
|
47
|
+
- Deploy Firebase rules/functions/indexes when changed
|
|
48
|
+
- Deploy Firebase cloud functions when updated
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Testing
|
|
53
|
+
|
|
54
|
+
- Use iPhone 16 or 16 Pro for Xcode iOS simulator
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Full Rules Template
|
|
59
|
+
|
|
60
|
+
```plaintext
|
|
61
|
+
# DOCUMENTATION
|
|
62
|
+
- No emojis, no ALL CAPS, no tables with dashes/pipes
|
|
63
|
+
- No em dashes, no excessive formatting
|
|
64
|
+
- Bold for emphasis, write tersely, casually, high IQ
|
|
65
|
+
|
|
66
|
+
# PAID SERVICES
|
|
67
|
+
- SHOW THE MATH - Calculate and comment max monthly cost
|
|
68
|
+
- LIMIT EVERYTHING - No operation without explicit maximum
|
|
69
|
+
- PREVENT LOOPS - Code must not trigger itself without guards
|
|
70
|
+
|
|
71
|
+
# SECURITY
|
|
72
|
+
- Build exhaustively secure, unhackable
|
|
73
|
+
- Comprehensive .gitignore from day 1
|
|
74
|
+
- Production-ready always
|
|
75
|
+
- Never git push an API key
|
|
76
|
+
|
|
77
|
+
# CODE QUALITY
|
|
78
|
+
- Single responsibility principle
|
|
79
|
+
- Achieve each task in minimum tokens
|
|
80
|
+
- Add logs and look up documentation to debug
|
|
81
|
+
|
|
82
|
+
# WORKFLOW
|
|
83
|
+
- Don't delete scripts, move to scripts folder
|
|
84
|
+
- Compile/build before git committing
|
|
85
|
+
- Simple short git commit, no emojis or special characters
|
|
86
|
+
- Deploy Firebase rules/functions/indexes when changed
|
|
87
|
+
|
|
88
|
+
# TESTING
|
|
89
|
+
- Use iPhone 16 or 16 Pro for Xcode iOS simulator
|
|
90
|
+
```
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
|
+
import { createServer } from './server.js';
|
|
4
|
+
async function main() {
|
|
5
|
+
const server = createServer();
|
|
6
|
+
const transport = new StdioServerTransport();
|
|
7
|
+
await server.connect(transport);
|
|
8
|
+
// Log to stderr (stdout is for MCP protocol)
|
|
9
|
+
console.error('Midas MCP server running');
|
|
10
|
+
}
|
|
11
|
+
main().catch((error) => {
|
|
12
|
+
console.error('Fatal error:', error);
|
|
13
|
+
process.exit(1);
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAE7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,6CAA6C;IAC7C,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;AAC5C,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"development.d.ts","sourceRoot":"","sources":["../../src/prompts/development.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA8GlE"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export function registerDevelopmentPrompts(server) {
|
|
3
|
+
// Feature planning
|
|
4
|
+
server.prompt('feature_planning', 'Plan a feature before implementing', { feature: z.string().describe('The feature to plan') }, (args) => ({
|
|
5
|
+
messages: [
|
|
6
|
+
{
|
|
7
|
+
role: 'user',
|
|
8
|
+
content: {
|
|
9
|
+
type: 'text',
|
|
10
|
+
text: `I need to implement: ${args.feature}
|
|
11
|
+
|
|
12
|
+
1. First, read the relevant files to understand current implementation
|
|
13
|
+
2. Research the documentation for any libraries/APIs involved
|
|
14
|
+
3. Create a plan with:
|
|
15
|
+
- Files to create/modify
|
|
16
|
+
- Tests to write
|
|
17
|
+
- Edge cases to handle
|
|
18
|
+
|
|
19
|
+
4. Don't write code yet - just the plan.`,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
}));
|
|
24
|
+
// Feature implementation
|
|
25
|
+
server.prompt('feature_implementation', 'Implement a feature with TDD', { feature: z.string().describe('The feature to implement') }, (args) => ({
|
|
26
|
+
messages: [
|
|
27
|
+
{
|
|
28
|
+
role: 'user',
|
|
29
|
+
content: {
|
|
30
|
+
type: 'text',
|
|
31
|
+
text: `Now implement: ${args.feature}
|
|
32
|
+
|
|
33
|
+
Requirements:
|
|
34
|
+
- Write the test file FIRST
|
|
35
|
+
- Then implement to make tests pass
|
|
36
|
+
- Each function should do ONE thing
|
|
37
|
+
- No external dependencies unless absolutely necessary
|
|
38
|
+
- Add error handling for edge cases
|
|
39
|
+
|
|
40
|
+
After each file, run the tests.`,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
}));
|
|
45
|
+
// Bug investigation
|
|
46
|
+
server.prompt('bug_investigation', 'Diagnose a bug before fixing', {
|
|
47
|
+
behavior: z.string().describe('What is happening'),
|
|
48
|
+
expected: z.string().describe('What should happen'),
|
|
49
|
+
error: z.string().optional().describe('Error message if any'),
|
|
50
|
+
}, (args) => ({
|
|
51
|
+
messages: [
|
|
52
|
+
{
|
|
53
|
+
role: 'user',
|
|
54
|
+
content: {
|
|
55
|
+
type: 'text',
|
|
56
|
+
text: `There's a bug where: ${args.behavior}
|
|
57
|
+
|
|
58
|
+
Expected: ${args.expected}
|
|
59
|
+
${args.error ? `\nError:\n\`\`\`\n${args.error}\n\`\`\`` : ''}
|
|
60
|
+
|
|
61
|
+
1. Read the relevant files
|
|
62
|
+
2. Identify the root cause (not just symptoms)
|
|
63
|
+
3. Explain WHY the bug occurs
|
|
64
|
+
4. Don't fix yet - just diagnose`,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
}));
|
|
69
|
+
// Bug fix
|
|
70
|
+
server.prompt('bug_fix', 'Fix a bug with test-first approach', { diagnosis: z.string().describe('The diagnosed root cause') }, (args) => ({
|
|
71
|
+
messages: [
|
|
72
|
+
{
|
|
73
|
+
role: 'user',
|
|
74
|
+
content: {
|
|
75
|
+
type: 'text',
|
|
76
|
+
text: `Now fix the bug.
|
|
77
|
+
|
|
78
|
+
Diagnosis: ${args.diagnosis}
|
|
79
|
+
|
|
80
|
+
Requirements:
|
|
81
|
+
- Write a test that FAILS with the current bug
|
|
82
|
+
- Fix the code to make the test pass
|
|
83
|
+
- Verify no other tests broke
|
|
84
|
+
- Explain what you changed and why`,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=development.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"development.js","sourceRoot":"","sources":["../../src/prompts/development.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,UAAU,0BAA0B,CAAC,MAAiB;IAC1D,mBAAmB;IACnB,MAAM,CAAC,MAAM,CACX,kBAAkB,EAClB,oCAAoC,EACpC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,EACvD,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACT,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,wBAAwB,IAAI,CAAC,OAAO;;;;;;;;;yCASb;iBAC9B;aACF;SACF;KACF,CAAC,CACH,CAAC;IAEF,yBAAyB;IACzB,MAAM,CAAC,MAAM,CACX,wBAAwB,EACxB,8BAA8B,EAC9B,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC,EAAE,EAC5D,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACT,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,kBAAkB,IAAI,CAAC,OAAO;;;;;;;;;gCAShB;iBACrB;aACF;SACF;KACF,CAAC,CACH,CAAC;IAEF,oBAAoB;IACpB,MAAM,CAAC,MAAM,CACX,mBAAmB,EACn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G,IAAI,CAK1D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { registerSessionPrompts } from './session.js';
|
|
2
|
+
import { registerDevelopmentPrompts } from './development.js';
|
|
3
|
+
import { registerReviewPrompts } from './review.js';
|
|
4
|
+
import { registerResearchPrompts } from './research.js';
|
|
5
|
+
export function registerAllPrompts(server) {
|
|
6
|
+
registerSessionPrompts(server);
|
|
7
|
+
registerDevelopmentPrompts(server);
|
|
8
|
+
registerReviewPrompts(server);
|
|
9
|
+
registerResearchPrompts(server);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAExD,MAAM,UAAU,kBAAkB,CAAC,MAAiB;IAClD,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC/B,0BAA0B,CAAC,MAAM,CAAC,CAAC;IACnC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC9B,uBAAuB,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"research.d.ts","sourceRoot":"","sources":["../../src/prompts/research.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAgE/D"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export function registerResearchPrompts(server) {
|
|
3
|
+
// Technology comparison
|
|
4
|
+
server.prompt('technology_comparison', 'Compare technologies for a use case', {
|
|
5
|
+
optionA: z.string().describe('First technology option'),
|
|
6
|
+
optionB: z.string().describe('Second technology option'),
|
|
7
|
+
useCase: z.string().describe('What you need it for'),
|
|
8
|
+
requirements: z.string().optional().describe('Specific requirements'),
|
|
9
|
+
}, (args) => ({
|
|
10
|
+
messages: [
|
|
11
|
+
{
|
|
12
|
+
role: 'user',
|
|
13
|
+
content: {
|
|
14
|
+
type: 'text',
|
|
15
|
+
text: `I need to choose between ${args.optionA} and ${args.optionB} for ${args.useCase}.
|
|
16
|
+
|
|
17
|
+
${args.requirements ? `My requirements:\n${args.requirements}\n` : ''}
|
|
18
|
+
Compare them on:
|
|
19
|
+
1. Learning curve
|
|
20
|
+
2. Performance
|
|
21
|
+
3. Community/support
|
|
22
|
+
4. Cost
|
|
23
|
+
5. Integration with existing stack
|
|
24
|
+
|
|
25
|
+
Give me a recommendation with reasoning.`,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
}));
|
|
30
|
+
// Best practices research
|
|
31
|
+
server.prompt('best_practices', 'Research current best practices for a topic', {
|
|
32
|
+
topic: z.string().describe('Topic to research'),
|
|
33
|
+
stack: z.string().optional().describe('Your tech stack'),
|
|
34
|
+
}, (args) => ({
|
|
35
|
+
messages: [
|
|
36
|
+
{
|
|
37
|
+
role: 'user',
|
|
38
|
+
content: {
|
|
39
|
+
type: 'text',
|
|
40
|
+
text: `Research current best practices for: ${args.topic}
|
|
41
|
+
|
|
42
|
+
${args.stack ? `I'm using: ${args.stack}\n` : ''}
|
|
43
|
+
I need to know:
|
|
44
|
+
1. Industry standard approach
|
|
45
|
+
2. Common pitfalls to avoid
|
|
46
|
+
3. Security considerations
|
|
47
|
+
4. Performance implications
|
|
48
|
+
5. Code examples
|
|
49
|
+
|
|
50
|
+
Cite sources where possible.`,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
}));
|
|
55
|
+
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