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,334 @@
|
|
|
1
|
+
# Elite Vibecoding Methodology
|
|
2
|
+
|
|
3
|
+
The complete methodology that Midas teaches and enforces.
|
|
4
|
+
|
|
5
|
+
## Core Philosophy
|
|
6
|
+
|
|
7
|
+
**Vibecoding** = Using AI as a pair programmer, not a replacement. You drive the vision, AI handles implementation.
|
|
8
|
+
|
|
9
|
+
**The 80/20 Rule:** AI handles ~80% of boilerplate and patterns. You handle the 20% that requires judgment, architecture, and domain knowledge.
|
|
10
|
+
|
|
11
|
+
**The Genie Mindset:** You have a genie. It will build anything — if you learn how to ask.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## The Two Phases
|
|
16
|
+
|
|
17
|
+
### Phase 1: Eagle Sight (Pre-Build)
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
💡 IDEA → 🔍 RESEARCH → 🧠 BRAINLIFT → 📋 PRD → 🗺️ GAMEPLAN → ⚡ BUILD
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
| Step | What It Is | Time |
|
|
24
|
+
|------|------------|------|
|
|
25
|
+
| 💡 Idea | The spark — what and why | 5 min |
|
|
26
|
+
| 🔍 Research | Landscape scan — what exists | 30-60 min |
|
|
27
|
+
| 🧠 Brainlift | Your edge — what AI doesn't know | 15-30 min |
|
|
28
|
+
| 📋 PRD | Requirements — what exactly to build | 30-60 min |
|
|
29
|
+
| 🗺️ Gameplan | Strategy — how to build it | 15-30 min |
|
|
30
|
+
|
|
31
|
+
**Total: 2-3 hours** → Saves 20-40 hours of confused building
|
|
32
|
+
|
|
33
|
+
#### Brainlift Template
|
|
34
|
+
|
|
35
|
+
```markdown
|
|
36
|
+
# Brainlift
|
|
37
|
+
|
|
38
|
+
## Contrarian Insights
|
|
39
|
+
- [What do YOU know that contradicts conventional wisdom?]
|
|
40
|
+
- [What have you learned from experience that AI can't know?]
|
|
41
|
+
|
|
42
|
+
## Domain Knowledge
|
|
43
|
+
- [Industry-specific context]
|
|
44
|
+
- [User behavior patterns you've observed]
|
|
45
|
+
|
|
46
|
+
## Hard-Won Lessons
|
|
47
|
+
- [What NOT to do based on past experience]
|
|
48
|
+
- [Hidden gotchas in this space]
|
|
49
|
+
|
|
50
|
+
## Current Context
|
|
51
|
+
- [Recent market changes]
|
|
52
|
+
- [Technology updates post-training-cutoff]
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
#### PRD Template
|
|
56
|
+
|
|
57
|
+
```markdown
|
|
58
|
+
# PRD: [Project Name]
|
|
59
|
+
|
|
60
|
+
## Overview
|
|
61
|
+
[One-paragraph description]
|
|
62
|
+
|
|
63
|
+
## Goals
|
|
64
|
+
1. [Primary goal]
|
|
65
|
+
2. [Secondary goal]
|
|
66
|
+
|
|
67
|
+
## Non-Goals (Equally Important!)
|
|
68
|
+
- [What you're explicitly NOT building]
|
|
69
|
+
|
|
70
|
+
## User Stories
|
|
71
|
+
- As a [user type], I want to [action] so that [benefit]
|
|
72
|
+
|
|
73
|
+
## Technical Requirements
|
|
74
|
+
- [Performance, security, integration requirements]
|
|
75
|
+
|
|
76
|
+
## Success Metrics
|
|
77
|
+
- [How you'll measure success]
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
#### Gameplan Template
|
|
81
|
+
|
|
82
|
+
```markdown
|
|
83
|
+
# Gameplan: [Project Name]
|
|
84
|
+
|
|
85
|
+
## Tech Stack
|
|
86
|
+
[Stack choice with justification]
|
|
87
|
+
|
|
88
|
+
## Architecture Overview
|
|
89
|
+
[High-level system design]
|
|
90
|
+
|
|
91
|
+
## Phase 1: Foundation
|
|
92
|
+
- [ ] Task 1
|
|
93
|
+
- [ ] Task 2
|
|
94
|
+
|
|
95
|
+
## Phase 2: Core Features
|
|
96
|
+
- [ ] Task 1
|
|
97
|
+
- [ ] Task 2
|
|
98
|
+
|
|
99
|
+
## Risk Mitigation
|
|
100
|
+
- Risk: [issue] → Mitigation: [solution]
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
### Phase 2: The 7-Step Process (Build)
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
▲
|
|
109
|
+
/░\ 1. USER RULES (.cursorrules)
|
|
110
|
+
/░░░\ (Identity + Guardrails)
|
|
111
|
+
/▓▓▓▓▓\ 2. INDEX CODEBASE STRUCTURE
|
|
112
|
+
/▓▓▓▓▓▓▓\ (Architecture Context)
|
|
113
|
+
/▒▒▒▒▒▒▒▒▒\ 3. READ SPECIFIC FILES
|
|
114
|
+
/▒▒▒▒▒▒▒▒▒▒▒\ (Implementation Details)
|
|
115
|
+
/█████████████\ 4. RESEARCH DOCS + ONLINE
|
|
116
|
+
/███████████████\ (External Knowledge)
|
|
117
|
+
↓
|
|
118
|
+
5. WRITE CODE + TESTS → 6. RUN TESTS → 7. LOG → FIX → REPEAT
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Each layer builds on the one above. You can't skip layers.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## The Three Principles
|
|
126
|
+
|
|
127
|
+
### 1. Oneshot Paradigm
|
|
128
|
+
|
|
129
|
+
When something breaks, **go back with full context** instead of patching forward.
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
❌ Prompt → Broken → Fix → More broken → Fix → Chaos
|
|
133
|
+
✅ Prompt → Broken → STOP → Original prompt + error log → Works
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**The Formula:**
|
|
137
|
+
```
|
|
138
|
+
[Original Prompt] + [Error Log] + [What to Avoid] = Working Solution
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**The 3-Strike Rule:**
|
|
142
|
+
```
|
|
143
|
+
Strike 1: "Fix this" → Still broken
|
|
144
|
+
Strike 2: "Try this" → Different error
|
|
145
|
+
Strike 3: "What about..." → Even more broken
|
|
146
|
+
STOP! → Oneshot with full context → Works
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### 2. Tornado Building
|
|
150
|
+
|
|
151
|
+
Three forces spinning together solve any problem:
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
┌─────────────┐
|
|
155
|
+
│ RESEARCH │
|
|
156
|
+
│ + DOCS │
|
|
157
|
+
└──────┬──────┘
|
|
158
|
+
│
|
|
159
|
+
╭───────────┼───────────╮
|
|
160
|
+
╱ │ ╲
|
|
161
|
+
┌──────────┐ │ ┌──────────┐
|
|
162
|
+
│ LOGS │◄───┴───►│ TESTS │
|
|
163
|
+
└────┬─────┘ └────┬─────┘
|
|
164
|
+
│ │
|
|
165
|
+
╰────────┬───────────╯
|
|
166
|
+
▼
|
|
167
|
+
┌─────────────────┐
|
|
168
|
+
│ SOLUTION EMERGES│
|
|
169
|
+
└─────────────────┘
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Each feeds the others:
|
|
173
|
+
- RESEARCH → informs what to LOG → informs what to TEST
|
|
174
|
+
- Test failures → inform more RESEARCH
|
|
175
|
+
|
|
176
|
+
### 3. Horizon Thinking
|
|
177
|
+
|
|
178
|
+
AI thinks **vertical** (top-to-bottom implementation).
|
|
179
|
+
You provide **horizontal** (context, patterns, constraints).
|
|
180
|
+
|
|
181
|
+
```
|
|
182
|
+
YOU
|
|
183
|
+
│
|
|
184
|
+
◄─────────────────────┼─────────────────────► HORIZONTAL
|
|
185
|
+
│
|
|
186
|
+
Patterns │ Constraints
|
|
187
|
+
History │ Integrations
|
|
188
|
+
Domain Knowledge │ Future Plans
|
|
189
|
+
│
|
|
190
|
+
─┼─
|
|
191
|
+
│
|
|
192
|
+
│ AI
|
|
193
|
+
▼ VERTICAL
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Wrong output? Widen your horizontal context.**
|
|
197
|
+
|
|
198
|
+
The Horizon Checklist:
|
|
199
|
+
```
|
|
200
|
+
□ INTEGRATIONS "This connects to [existing system]"
|
|
201
|
+
□ PATTERNS "Follow the pattern in [file]"
|
|
202
|
+
□ CONSTRAINTS "Cannot use [limitation]"
|
|
203
|
+
□ HISTORY "We use X because [reason]"
|
|
204
|
+
□ FUTURE "Must support [planned feature] later"
|
|
205
|
+
□ DOMAIN "Users typically [behavior]"
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## Context Management
|
|
211
|
+
|
|
212
|
+
### The Context Pyramid
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
Layer 1: USER RULES (Identity + Guardrails)
|
|
216
|
+
Layer 2: CODEBASE (Architecture Context)
|
|
217
|
+
Layer 3: SPECIFIC FILES (Implementation Details)
|
|
218
|
+
Layer 4: RESEARCH (External Knowledge)
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### When to Start Fresh
|
|
222
|
+
|
|
223
|
+
- After shipping a feature (clean slate)
|
|
224
|
+
- AI keeps making the same mistake
|
|
225
|
+
- Switching to unrelated work
|
|
226
|
+
- Responses get confused/repetitive
|
|
227
|
+
|
|
228
|
+
### Bringing Context into New Chats
|
|
229
|
+
|
|
230
|
+
1. Reference user rules first
|
|
231
|
+
2. Point to specific files with `@filename`
|
|
232
|
+
3. Provide horizontal context (patterns, constraints)
|
|
233
|
+
4. Summarize previous decisions
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## AI Strengths vs Your Job
|
|
238
|
+
|
|
239
|
+
### Let AI Handle
|
|
240
|
+
- Boilerplate code
|
|
241
|
+
- Type definitions
|
|
242
|
+
- Unit tests
|
|
243
|
+
- Refactoring
|
|
244
|
+
- Documentation
|
|
245
|
+
- Error message parsing
|
|
246
|
+
- Regex patterns
|
|
247
|
+
- SQL queries
|
|
248
|
+
- CSS/styling
|
|
249
|
+
- API integrations
|
|
250
|
+
|
|
251
|
+
### You Control
|
|
252
|
+
- Architecture decisions
|
|
253
|
+
- Security-critical code
|
|
254
|
+
- Business logic
|
|
255
|
+
- Performance optimization
|
|
256
|
+
- Database schema design
|
|
257
|
+
- UX decisions
|
|
258
|
+
- Code review
|
|
259
|
+
- Deployment/infra
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## Testing Loop
|
|
264
|
+
|
|
265
|
+
```
|
|
266
|
+
1. AI generates code
|
|
267
|
+
2. You READ it (actually read it)
|
|
268
|
+
3. Run it locally
|
|
269
|
+
4. Check edge cases
|
|
270
|
+
5. Run tests
|
|
271
|
+
6. Build passes
|
|
272
|
+
7. Only then commit
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Test-Driven Vibecoding
|
|
276
|
+
|
|
277
|
+
```
|
|
278
|
+
Step 1: "Write a test for [function]"
|
|
279
|
+
Step 2: "Implement to make test pass"
|
|
280
|
+
Step 3: Run test → verify
|
|
281
|
+
Step 4: "Add edge case tests"
|
|
282
|
+
Step 5: Iterate until solid
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## Speed Techniques
|
|
288
|
+
|
|
289
|
+
### Token Efficiency
|
|
290
|
+
- Use file references instead of pasting
|
|
291
|
+
- Don't repeat context AI has
|
|
292
|
+
- Stop mid-generation if you have enough
|
|
293
|
+
- One clear ask per message
|
|
294
|
+
|
|
295
|
+
### Batch Operations
|
|
296
|
+
```
|
|
297
|
+
❌ "Create User model" → "Create Post model" → "Create Comment model"
|
|
298
|
+
✅ "Create these models: User, Post, Comment with these relationships..."
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### Template Reuse
|
|
302
|
+
```
|
|
303
|
+
"Create CommentsService following the exact pattern in PostsService"
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
## Security Mindset
|
|
309
|
+
|
|
310
|
+
### Core Principles
|
|
311
|
+
- Never Trust User Input
|
|
312
|
+
- Defense in Depth
|
|
313
|
+
- Least Privilege
|
|
314
|
+
- Fail Securely
|
|
315
|
+
- Security by Design
|
|
316
|
+
|
|
317
|
+
### Cost Control (Paid Services)
|
|
318
|
+
- SHOW THE MATH - Calculate max monthly cost
|
|
319
|
+
- LIMIT EVERYTHING - No operation without maximum
|
|
320
|
+
- PREVENT LOOPS - Circuit breakers for recursion
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## Common Antipatterns
|
|
325
|
+
|
|
326
|
+
| Antipattern | Fix |
|
|
327
|
+
|-------------|-----|
|
|
328
|
+
| YOLO Prompting (huge requests) | One feature at a time |
|
|
329
|
+
| Blind Trust | Read and test everything |
|
|
330
|
+
| Context Neglect | Complete context sandwich |
|
|
331
|
+
| Fix Forward Forever | Oneshot after 3 strikes |
|
|
332
|
+
| Security Afterthought | Security from day 1 |
|
|
333
|
+
| No Tests | Tests alongside code |
|
|
334
|
+
| Dependency Bloat | Ask "Can this be done without a library?" |
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
# Expert Prompts Library
|
|
2
|
+
|
|
3
|
+
All the expert prompts that Midas exposes.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Session Prompts
|
|
8
|
+
|
|
9
|
+
### master_prompt
|
|
10
|
+
|
|
11
|
+
The prompt that sets up an entire development session:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
# Read and understand user rules, research each for complete understanding
|
|
15
|
+
|
|
16
|
+
# Ask me any clarifying questions (hallucination avoidance)
|
|
17
|
+
|
|
18
|
+
# Make todos of all tasks, use high IQ strategy for safety and
|
|
19
|
+
# correctness as you create and order each, add todos for testing
|
|
20
|
+
# of all code changes and additions, research documentation and
|
|
21
|
+
# best practices online, don't start yet
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**Why it works:**
|
|
25
|
+
1. Loads rules first (foundation)
|
|
26
|
+
2. Forces clarifying questions (prevents hallucination)
|
|
27
|
+
3. Creates structured plan (prevents chaos)
|
|
28
|
+
4. Doesn't start yet (planning before execution)
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
### execution_prompt
|
|
33
|
+
|
|
34
|
+
After planning, kick off execution:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
# Continue todos, do each comprehensively and in highest IQ way possible
|
|
38
|
+
|
|
39
|
+
# Build test and write AND run test scripts then fix and repeat
|
|
40
|
+
# process of writing tests and running them until all tests pass
|
|
41
|
+
|
|
42
|
+
# Short commit message once individual todos are complete and proceed
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Why it works:**
|
|
46
|
+
- Separates planning from execution
|
|
47
|
+
- Forces test-driven approach
|
|
48
|
+
- Incremental commits (clean history)
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Refactoring Prompts
|
|
53
|
+
|
|
54
|
+
### safe_refactor
|
|
55
|
+
|
|
56
|
+
When moving code between files:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
SAFE REFACTORING GUIDE:
|
|
60
|
+
|
|
61
|
+
0. Comment out code on original file first
|
|
62
|
+
1. Split large classes into smaller, focused class files
|
|
63
|
+
2. Copy code verbatim - Don't modify logic when moving to new files
|
|
64
|
+
3. Extract logical groups - Move related functions/components together
|
|
65
|
+
4. Use proper exports/imports - Maintain all references between files
|
|
66
|
+
5. Keep dependencies intact - Ensure imports are accessible to new files
|
|
67
|
+
6. Test frequently - Verify functionality after each extraction
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Why Step 0 is crucial:** Commenting first means you can instantly restore if something breaks.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Feature Development Prompts
|
|
75
|
+
|
|
76
|
+
### feature_planning
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
I need to implement [FEATURE].
|
|
80
|
+
|
|
81
|
+
1. First, read these files to understand current implementation:
|
|
82
|
+
- [file1]
|
|
83
|
+
- [file2]
|
|
84
|
+
|
|
85
|
+
2. Research the documentation for [LIBRARY/API]
|
|
86
|
+
|
|
87
|
+
3. Create a plan with:
|
|
88
|
+
- Files to create/modify
|
|
89
|
+
- Tests to write
|
|
90
|
+
- Edge cases to handle
|
|
91
|
+
|
|
92
|
+
4. Don't write code yet - just the plan.
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
### feature_implementation
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
Now implement [FEATURE] following the plan.
|
|
101
|
+
|
|
102
|
+
Requirements:
|
|
103
|
+
- Write the test file FIRST
|
|
104
|
+
- Then implement to make tests pass
|
|
105
|
+
- Each function should do ONE thing
|
|
106
|
+
- No external dependencies unless absolutely necessary
|
|
107
|
+
- Add error handling for: [list edge cases]
|
|
108
|
+
|
|
109
|
+
After each file, run: npm run test
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Bug Fixing Prompts
|
|
115
|
+
|
|
116
|
+
### bug_investigation
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
There's a bug where [DESCRIBE BEHAVIOR].
|
|
120
|
+
|
|
121
|
+
Expected: [WHAT SHOULD HAPPEN]
|
|
122
|
+
Actual: [WHAT HAPPENS]
|
|
123
|
+
|
|
124
|
+
Here's the error log:
|
|
125
|
+
```
|
|
126
|
+
[PASTE ERROR]
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
1. Read the relevant files
|
|
130
|
+
2. Identify the root cause (not just symptoms)
|
|
131
|
+
3. Explain WHY the bug occurs
|
|
132
|
+
4. Don't fix yet - just diagnose
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
### bug_fix
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
Now fix the bug.
|
|
141
|
+
|
|
142
|
+
Requirements:
|
|
143
|
+
- Write a test that FAILS with the current bug
|
|
144
|
+
- Fix the code to make the test pass
|
|
145
|
+
- Verify no other tests broke
|
|
146
|
+
- Explain what you changed and why
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Code Review Prompts
|
|
152
|
+
|
|
153
|
+
### security_review
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
Review this code for security vulnerabilities:
|
|
157
|
+
|
|
158
|
+
[PASTE CODE or @file reference]
|
|
159
|
+
|
|
160
|
+
Check specifically for:
|
|
161
|
+
- SQL injection
|
|
162
|
+
- XSS vulnerabilities
|
|
163
|
+
- Authentication bypasses
|
|
164
|
+
- Authorization flaws
|
|
165
|
+
- Data exposure
|
|
166
|
+
- Insecure dependencies
|
|
167
|
+
- Hardcoded secrets
|
|
168
|
+
|
|
169
|
+
For each issue found:
|
|
170
|
+
1. Describe the vulnerability
|
|
171
|
+
2. Show the vulnerable code
|
|
172
|
+
3. Provide the fix
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
### performance_review
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
Review this code for performance issues:
|
|
181
|
+
|
|
182
|
+
[PASTE CODE or @file reference]
|
|
183
|
+
|
|
184
|
+
Check for:
|
|
185
|
+
- N+1 queries
|
|
186
|
+
- Unnecessary re-renders
|
|
187
|
+
- Memory leaks
|
|
188
|
+
- Blocking operations
|
|
189
|
+
- Missing caching opportunities
|
|
190
|
+
- Inefficient algorithms
|
|
191
|
+
|
|
192
|
+
For each issue:
|
|
193
|
+
1. Current complexity (O notation if applicable)
|
|
194
|
+
2. Impact on user experience
|
|
195
|
+
3. Suggested optimization
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Research Prompts
|
|
201
|
+
|
|
202
|
+
### technology_comparison
|
|
203
|
+
|
|
204
|
+
```
|
|
205
|
+
I need to choose between [OPTION A] and [OPTION B] for [USE CASE].
|
|
206
|
+
|
|
207
|
+
My requirements:
|
|
208
|
+
- [Requirement 1]
|
|
209
|
+
- [Requirement 2]
|
|
210
|
+
- [Requirement 3]
|
|
211
|
+
|
|
212
|
+
Compare them on:
|
|
213
|
+
1. Learning curve
|
|
214
|
+
2. Performance
|
|
215
|
+
3. Community/support
|
|
216
|
+
4. Cost
|
|
217
|
+
5. Integration with my stack: [LIST STACK]
|
|
218
|
+
|
|
219
|
+
Give me a recommendation with reasoning.
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
### best_practices_research
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
Research current best practices for [TOPIC] in 2024.
|
|
228
|
+
|
|
229
|
+
I'm using: [TECH STACK]
|
|
230
|
+
|
|
231
|
+
I need to know:
|
|
232
|
+
1. Industry standard approach
|
|
233
|
+
2. Common pitfalls to avoid
|
|
234
|
+
3. Security considerations
|
|
235
|
+
4. Performance implications
|
|
236
|
+
5. Code examples
|
|
237
|
+
|
|
238
|
+
Cite sources where possible.
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Problem-Solving Prompts
|
|
244
|
+
|
|
245
|
+
### oneshot_retry
|
|
246
|
+
|
|
247
|
+
When first attempt fails:
|
|
248
|
+
|
|
249
|
+
```
|
|
250
|
+
[ORIGINAL REQUEST]
|
|
251
|
+
|
|
252
|
+
Here's what happened on first attempt:
|
|
253
|
+
- Error: [PASTE ERROR]
|
|
254
|
+
- What I observed: [DESCRIBE BEHAVIOR]
|
|
255
|
+
|
|
256
|
+
What I learned:
|
|
257
|
+
- [Insight 1]
|
|
258
|
+
- [Insight 2]
|
|
259
|
+
|
|
260
|
+
Requirements for retry:
|
|
261
|
+
- [Specific requirement based on learning]
|
|
262
|
+
- [Another requirement]
|
|
263
|
+
- Avoid: [What NOT to do]
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
### tornado_trigger
|
|
269
|
+
|
|
270
|
+
When stuck on a problem:
|
|
271
|
+
|
|
272
|
+
```
|
|
273
|
+
I need to [implement feature / fix bug].
|
|
274
|
+
|
|
275
|
+
Before writing code:
|
|
276
|
+
1. RESEARCH: Look up the documentation for [relevant APIs/libraries]
|
|
277
|
+
2. Identify common pitfalls and best practices
|
|
278
|
+
|
|
279
|
+
Then:
|
|
280
|
+
3. LOGS: Add strategic console.logs at decision points
|
|
281
|
+
4. TESTS: Write tests that verify the expected behavior
|
|
282
|
+
|
|
283
|
+
Show me all three parts, then implement the solution.
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
### horizon_expansion
|
|
289
|
+
|
|
290
|
+
When output doesn't fit:
|
|
291
|
+
|
|
292
|
+
```
|
|
293
|
+
The output doesn't match what I need.
|
|
294
|
+
|
|
295
|
+
HORIZONTAL CONTEXT (what AI was missing):
|
|
296
|
+
|
|
297
|
+
Integrations:
|
|
298
|
+
- This connects to [existing system]
|
|
299
|
+
- Must use [existing pattern/service]
|
|
300
|
+
|
|
301
|
+
Constraints:
|
|
302
|
+
- Cannot use [limitation]
|
|
303
|
+
- Must stay under [limit]
|
|
304
|
+
|
|
305
|
+
Patterns:
|
|
306
|
+
- Follow the pattern in [file]
|
|
307
|
+
- Use [naming convention]
|
|
308
|
+
|
|
309
|
+
History:
|
|
310
|
+
- We use X because [reason]
|
|
311
|
+
|
|
312
|
+
Please regenerate with this context.
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## The Prompt Formula
|
|
318
|
+
|
|
319
|
+
Every effective prompt follows:
|
|
320
|
+
|
|
321
|
+
```
|
|
322
|
+
[CONTEXT] + [TASK] + [CONSTRAINTS] + [OUTPUT FORMAT]
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
**Example:**
|
|
326
|
+
```
|
|
327
|
+
CONTEXT: "We have a Next.js 14 app with Prisma and PostgreSQL."
|
|
328
|
+
TASK: "Add rate limiting to the /api/auth endpoints."
|
|
329
|
+
CONSTRAINTS: "Use Redis. Max 5 attempts per minute per IP."
|
|
330
|
+
OUTPUT: "Provide the middleware code and explain implementation."
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## Quick Reference Phrases
|
|
336
|
+
|
|
337
|
+
| Situation | Key Phrase |
|
|
338
|
+
|-----------|------------|
|
|
339
|
+
| Prevent hallucination | "Ask me clarifying questions first" |
|
|
340
|
+
| Force planning | "Don't write code yet - just the plan" |
|
|
341
|
+
| Ensure testing | "Write the test FIRST, then implement" |
|
|
342
|
+
| Safe refactoring | "Comment out before moving" |
|
|
343
|
+
| Root cause analysis | "Explain WHY, don't just fix" |
|
|
344
|
+
| Current practices | "Research best practices for 2024" |
|
|
345
|
+
| Simplicity | "Give me the simplest possible implementation" |
|
|
346
|
+
| No dependencies | "Can this be done without adding a library?" |
|
|
347
|
+
| Focus | "Each function should do ONE thing" |
|