@esreekarreddy/ai-prompts 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.
Files changed (107) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +361 -0
  3. package/chains/_index.md +33 -0
  4. package/chains/bug-fix.md +222 -0
  5. package/chains/new-feature.md +216 -0
  6. package/chains/production-launch.md +291 -0
  7. package/chains/refactor.md +210 -0
  8. package/chains/security-hardening.md +242 -0
  9. package/contexts/guides/api-design.md +229 -0
  10. package/contexts/guides/error-handling.md +219 -0
  11. package/contexts/patterns/agentic-coding.md +368 -0
  12. package/contexts/patterns/mcp-server-patterns.md +267 -0
  13. package/contexts/patterns/repository-pattern.md +163 -0
  14. package/contexts/patterns/service-layer.md +185 -0
  15. package/contexts/stacks/fastapi.md +187 -0
  16. package/contexts/stacks/nextjs-14.md +149 -0
  17. package/contexts/stacks/prisma.md +228 -0
  18. package/dist/index.d.ts +129 -0
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +284 -0
  21. package/dist/index.js.map +1 -0
  22. package/examples/architecture-docs/sample-architecture.md +270 -0
  23. package/examples/code-reviews/sample-review.md +232 -0
  24. package/examples/prds/sample-prd.md +179 -0
  25. package/instructions/_index.md +57 -0
  26. package/instructions/personas/code-reviewer.md +83 -0
  27. package/instructions/personas/devops-engineer.md +90 -0
  28. package/instructions/personas/security-expert.md +69 -0
  29. package/instructions/personas/senior-engineer.md +243 -0
  30. package/instructions/personas/ux-engineer.md +88 -0
  31. package/instructions/standards/fastapi.md +241 -0
  32. package/instructions/standards/go.md +427 -0
  33. package/instructions/standards/nextjs.md +350 -0
  34. package/instructions/standards/nodejs.md +284 -0
  35. package/instructions/standards/python.md +245 -0
  36. package/instructions/standards/react.md +227 -0
  37. package/instructions/standards/rust.md +318 -0
  38. package/instructions/standards/typescript-react.md +822 -0
  39. package/instructions/standards/typescript.md +294 -0
  40. package/instructions/workflows/feature-development.md +222 -0
  41. package/instructions/workflows/incident-response.md +192 -0
  42. package/instructions/workflows/pr-review.md +149 -0
  43. package/instructions/workflows/tdd.md +160 -0
  44. package/package.json +84 -0
  45. package/prompts/_index.md +70 -0
  46. package/prompts/agentic/agentic-loop.md +83 -0
  47. package/prompts/agentic/context-manager.md +37 -0
  48. package/prompts/agentic/test-driven-fix.md +41 -0
  49. package/prompts/analysis/deep-debugger.md +488 -0
  50. package/prompts/design/design-system-extractor.md +147 -0
  51. package/prompts/development/code-cleaner.md +119 -0
  52. package/prompts/development/debugger.md +64 -0
  53. package/prompts/development/tech-debt-audit.md +88 -0
  54. package/prompts/planning/architecture-analyzer.md +72 -0
  55. package/prompts/planning/implementation-plan.md +98 -0
  56. package/prompts/planning/prd-generator.md +66 -0
  57. package/prompts/planning/scope-killer.md +74 -0
  58. package/prompts/quality/critical-path-tester.md +133 -0
  59. package/prompts/quality/pre-launch-checklist.md +137 -0
  60. package/prompts/quality/security-audit.md +115 -0
  61. package/prompts/quality/security-fixer.md +117 -0
  62. package/prompts/quality/security-hardening.md +157 -0
  63. package/prompts/system/master-system-prompt.md +252 -0
  64. package/skills/_index.md +60 -0
  65. package/skills/code-review-advanced.md +435 -0
  66. package/skills/code-review.md +86 -0
  67. package/skills/debugging.md +86 -0
  68. package/skills/documentation.md +97 -0
  69. package/skills/pr-description.md +116 -0
  70. package/skills/project-setup.md +123 -0
  71. package/skills/refactoring.md +93 -0
  72. package/skills/testing.md +134 -0
  73. package/snippets/_index.md +57 -0
  74. package/snippets/constraints/mvp-only.md +50 -0
  75. package/snippets/constraints/no-external-deps.md +45 -0
  76. package/snippets/constraints/read-only.md +45 -0
  77. package/snippets/constraints/security-first.md +50 -0
  78. package/snippets/modifiers/be-ruthless.md +52 -0
  79. package/snippets/modifiers/be-thorough.md +50 -0
  80. package/snippets/modifiers/effort-high.md +56 -0
  81. package/snippets/modifiers/explain-reasoning.md +50 -0
  82. package/snippets/modifiers/megathink.md +314 -0
  83. package/snippets/modifiers/meta-cot.md +101 -0
  84. package/snippets/modifiers/no-code-yet.md +55 -0
  85. package/snippets/modifiers/step-by-step.md +50 -0
  86. package/snippets/modifiers/ultrathink.md +359 -0
  87. package/snippets/output-formats/checklist.md +61 -0
  88. package/snippets/output-formats/json.md +53 -0
  89. package/snippets/output-formats/markdown-table.md +44 -0
  90. package/snippets/output-formats/numbered-list.md +44 -0
  91. package/templates/_index.md +101 -0
  92. package/templates/claude-md/auto-enhance.md +258 -0
  93. package/templates/claude-md/cli-tool.md +243 -0
  94. package/templates/claude-md/full.md +449 -0
  95. package/templates/claude-md/minimal.md +52 -0
  96. package/templates/claude-md/nextjs-app.md +207 -0
  97. package/templates/claude-md/nodejs-service.md +251 -0
  98. package/templates/claude-md/python-api.md +236 -0
  99. package/templates/copilot/instructions.md +33 -0
  100. package/templates/cursor-rules/fullstack.txt +98 -0
  101. package/templates/cursor-rules/minimal.txt +20 -0
  102. package/templates/cursor-rules/nextjs.txt +61 -0
  103. package/templates/cursor-rules/python.txt +79 -0
  104. package/templates/docs/adr-template.md +119 -0
  105. package/templates/docs/api-spec-template.md +277 -0
  106. package/templates/docs/prd-template.md +140 -0
  107. package/templates/docs/runbook-template.md +238 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sreekar Reddy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,361 @@
1
+ <p align="center">
2
+ <h1 align="center">MCP Prompt Library</h1>
3
+ <p align="center">
4
+ <strong>90+ curated prompts, workflows, and coding standards for AI-assisted development</strong>
5
+ </p>
6
+ </p>
7
+
8
+ <p align="center">
9
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License"></a>
10
+ <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg" alt="Node.js"></a>
11
+ <a href="https://modelcontextprotocol.io"><img src="https://img.shields.io/badge/MCP-compatible-purple.svg" alt="MCP Compatible"></a>
12
+ <img src="https://img.shields.io/badge/tests-99%20passed-success.svg" alt="Tests">
13
+ </p>
14
+
15
+ <p align="center">
16
+ <a href="#quick-start">Quick Start</a> •
17
+ <a href="#features">Features</a> •
18
+ <a href="#mcp-server">MCP Server</a> •
19
+ <a href="#library-contents">Library</a> •
20
+ <a href="#integrations">Integrations</a>
21
+ </p>
22
+
23
+ ---
24
+
25
+ ## Why This Exists
26
+
27
+ AI assistants are powerful, but they're only as good as the prompts you give them. Most developers:
28
+
29
+ - **Repeat the same prompts** across projects
30
+ - **Forget effective prompts** they used before
31
+ - **Struggle to compose** complex multi-step workflows
32
+ - **Lack consistency** in AI-assisted development patterns
33
+
34
+ **MCP Prompt Library** solves this by providing:
35
+
36
+ | What | How |
37
+ |------|-----|
38
+ | **90+ battle-tested prompts** | Organized by development phase (planning, development, quality, design) |
39
+ | **MCP server with 15 tools** | Direct integration with Claude, OpenCode, Cursor, and any MCP-compatible client |
40
+ | **Smart suggestions** | AI recommends prompts based on what you're doing |
41
+ | **Workflow chains** | Multi-step guided processes for features, bugs, refactoring, security |
42
+ | **Composable snippets** | Mix modifiers like `ultrathink` + `security-first` on any prompt |
43
+
44
+ ---
45
+
46
+ ## Quick Start
47
+
48
+ ### 1. Clone & Build
49
+
50
+ ```bash
51
+ git clone https://github.com/esreekarreddy/mcp-prompt-library.git
52
+ cd mcp-prompt-library/mcp-server
53
+ npm install && npm run build
54
+ ```
55
+
56
+ ### 2. Configure Your AI Tool
57
+
58
+ See [Integrations](#integrations) for your specific tool (OpenCode, Claude Desktop, Cursor).
59
+
60
+ ### 3. Start Using
61
+
62
+ Once connected, your AI assistant has access to all prompts:
63
+
64
+ ```
65
+ "suggest prompts for what I'm doing"
66
+ "get the PRD generator prompt"
67
+ "start the new-feature chain"
68
+ "compose prd-generator with ultrathink"
69
+ ```
70
+
71
+ ---
72
+
73
+ ## Features
74
+
75
+ ### Smart Intent Detection
76
+
77
+ Tell your AI what you're doing, and it suggests the right prompts:
78
+
79
+ | You Say | It Suggests |
80
+ |---------|-------------|
81
+ | "I need to build a new feature" | PRD generator, new-feature chain |
82
+ | "Stuck on a bug" | Deep debugger, debugging skill, bug-fix chain |
83
+ | "Security review before launch" | Security audit, security-hardening chain |
84
+ | "This code is a mess" | Code cleaner, refactoring skill, refactor chain |
85
+ | "Complex architecture decision" | Megathink modifier, senior-engineer persona |
86
+
87
+ ### Workflow Chains
88
+
89
+ Multi-step guided workflows for complex tasks:
90
+
91
+ | Chain | Steps | Use Case |
92
+ |-------|-------|----------|
93
+ | `new-feature` | 7 | From PRD to deployment |
94
+ | `bug-fix` | 7 | Systematic debugging to resolution |
95
+ | `refactor` | 6 | Safe refactoring with verification |
96
+ | `security-hardening` | 7 | Comprehensive security review |
97
+ | `production-launch` | 7 | Pre-launch checklist to deployment |
98
+
99
+ ```bash
100
+ # Start a chain
101
+ node dist/cli.js chains # List available chains
102
+ start_chain chain="new-feature" # Via MCP tool
103
+ ```
104
+
105
+ ### Composable Prompts
106
+
107
+ Combine any prompts with modifiers:
108
+
109
+ ```bash
110
+ # CLI
111
+ node dist/cli.js compose prd-generator ultrathink security-first
112
+
113
+ # MCP Tool
114
+ compose_prompt items=["prd-generator", "ultrathink", "security-first"]
115
+ ```
116
+
117
+ ### Quick Modifiers
118
+
119
+ Instant prompt enhancers:
120
+
121
+ | Modifier | Effect |
122
+ |----------|--------|
123
+ | `ultrathink` | Deep analysis with extended reasoning |
124
+ | `megathink` | Maximum thinking for architecture decisions |
125
+ | `critique` | Harsh, unfiltered feedback mode |
126
+ | `debug` | Systematic debugging approach |
127
+ | `plan` | Planning mode - no code yet |
128
+ | `secure` | Security-focused review |
129
+ | `simplify` | Explain like I'm 12 |
130
+
131
+ ---
132
+
133
+ ## MCP Server
134
+
135
+ The MCP (Model Context Protocol) server exposes **15 tools** to your AI assistant:
136
+
137
+ ### Library Tools
138
+ | Tool | Purpose |
139
+ |------|---------|
140
+ | `get_prompt` | Fetch any prompt by name (fuzzy matching works) |
141
+ | `search_prompts` | Search library by keywords |
142
+ | `suggest_prompts` | Smart suggestions based on your intent |
143
+ | `enhance_prompt` | Analyze request and suggest approach + relevant prompts |
144
+ | `save_to_library` | Save new prompts to the library |
145
+ | `library_stats` | Library statistics |
146
+ | `random_prompt` | Random prompt for inspiration |
147
+
148
+ ### Chain Tools
149
+ | Tool | Purpose |
150
+ |------|---------|
151
+ | `list_chains` | View available workflow chains |
152
+ | `start_chain` | Begin a multi-step workflow |
153
+ | `chain_next` | Advance to next step |
154
+ | `chain_status` | View workflow progress |
155
+ | `chain_step` | Jump to specific step |
156
+
157
+ ### Utility Tools
158
+ | Tool | Purpose |
159
+ |------|---------|
160
+ | `compose_prompt` | Combine multiple prompts |
161
+ | `quick_prompt` | Instant one-liner modifiers |
162
+ | `detect_context` | Analyze project → suggest stack-specific prompts |
163
+
164
+ ### How It Works
165
+
166
+ ```
167
+ You: "Build a user authentication system"
168
+
169
+ AI calls: suggest_prompts("Build a user authentication system")
170
+
171
+ Returns: security-audit, new-feature chain, auth patterns
172
+
173
+ AI calls: start_chain("new-feature")
174
+
175
+ AI guides you through: PRD → Architecture → Implementation → Testing → Deploy
176
+ ```
177
+
178
+ ---
179
+
180
+ ## Library Contents
181
+
182
+ **90+ curated resources** across 8 categories:
183
+
184
+ ```
185
+ mcp-prompt-library/
186
+ ├── prompts/ (18) - Copy-paste ready prompts
187
+ │ ├── planning/ PRD generator, scope killer, architecture
188
+ │ ├── development/ Debugger, code cleaner, tech debt
189
+ │ ├── quality/ Security audit, testing, pre-launch
190
+ │ ├── design/ Design system extractor
191
+ │ ├── analysis/ Deep debugger
192
+ │ ├── agentic/ Context manager, agentic loop, test-driven fix
193
+ │ └── system/ Master system prompt for AI setup
194
+ ├── skills/ (8) - AI behavior definitions
195
+ │ └── code-review, debugging, testing, refactoring, documentation...
196
+ ├── instructions/ (18) - Reusable system prompts
197
+ │ ├── personas/ Senior engineer, security expert, DevOps, UX
198
+ │ ├── standards/ TypeScript, React, Python, Go, Rust, FastAPI, Next.js
199
+ │ └── workflows/ TDD, PR review, incident response, feature development
200
+ ├── templates/ (16) - Project scaffolding
201
+ │ ├── claude-md/ CLAUDE.md for Next.js, Python, Node.js, CLI tools
202
+ │ ├── cursor-rules/ .cursorrules for various stacks
203
+ │ ├── copilot/ GitHub Copilot instructions
204
+ │ └── docs/ PRD, ADR, API spec, runbook templates
205
+ ├── chains/ (5) - Multi-step workflows
206
+ │ └── new-feature, bug-fix, refactor, security-hardening, production-launch
207
+ ├── snippets/ (17) - Composable modifiers
208
+ │ ├── modifiers/ ultrathink, megathink, step-by-step, meta-cot
209
+ │ ├── output-formats/ JSON, markdown table, checklist, numbered list
210
+ │ └── constraints/ Security first, MVP only, read-only, no external deps
211
+ ├── contexts/ (9) - Reference documentation
212
+ │ ├── stacks/ Next.js 14, FastAPI, Prisma
213
+ │ ├── patterns/ MCP server patterns, agentic coding
214
+ │ └── guides/ API design, error handling
215
+ └── examples/ (3) - Gold-standard samples
216
+ └── PRDs, architecture docs, code reviews
217
+ ```
218
+
219
+ ---
220
+
221
+ ## Integrations
222
+
223
+ ### OpenCode
224
+
225
+ Add to `~/.opencode/config.json`:
226
+
227
+ ```json
228
+ {
229
+ "mcp": {
230
+ "ai-library": {
231
+ "type": "local",
232
+ "command": [
233
+ "node",
234
+ "/path/to/mcp-prompt-library/mcp-server/dist/index.js"
235
+ ],
236
+ "enabled": true
237
+ }
238
+ }
239
+ }
240
+ ```
241
+
242
+ ### Claude Desktop
243
+
244
+ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
245
+
246
+ ```json
247
+ {
248
+ "mcpServers": {
249
+ "ai-library": {
250
+ "command": "node",
251
+ "args": ["/path/to/mcp-prompt-library/mcp-server/dist/index.js"]
252
+ }
253
+ }
254
+ }
255
+ ```
256
+
257
+ ### Cursor
258
+
259
+ Add to `.cursor/mcp.json` in your project:
260
+
261
+ ```json
262
+ {
263
+ "mcpServers": {
264
+ "ai-library": {
265
+ "command": "node",
266
+ "args": ["/path/to/mcp-prompt-library/mcp-server/dist/index.js"]
267
+ }
268
+ }
269
+ }
270
+ ```
271
+
272
+ ### VS Code + GitHub Copilot
273
+
274
+ Copy the prompt files to your workspace:
275
+
276
+ ```bash
277
+ cp -r .github/prompts /path/to/your-project/.github/prompts
278
+ ```
279
+
280
+ ---
281
+
282
+ ## CLI Usage
283
+
284
+ Use the library directly from your terminal:
285
+
286
+ ```bash
287
+ cd mcp-server
288
+
289
+ # Get a specific prompt
290
+ node dist/cli.js get prd-generator
291
+
292
+ # Search prompts
293
+ node dist/cli.js search "security"
294
+
295
+ # Get AI-powered suggestions
296
+ node dist/cli.js suggest "I need to refactor this messy code"
297
+
298
+ # Combine prompts
299
+ node dist/cli.js compose prd-generator ultrathink step-by-step
300
+
301
+ # View workflow chains
302
+ node dist/cli.js chains
303
+
304
+ # Library statistics
305
+ node dist/cli.js stats
306
+
307
+ # Random prompt for inspiration
308
+ node dist/cli.js random
309
+ ```
310
+
311
+ ---
312
+
313
+ ## Development
314
+
315
+ ```bash
316
+ cd mcp-server
317
+
318
+ npm install # Install dependencies
319
+ npm run build # Build TypeScript
320
+ npm run test # Run tests (99 tests)
321
+ npm run dev # Watch mode
322
+ npm run typecheck # Type checking only
323
+ ```
324
+
325
+ ### Architecture
326
+
327
+ - **TypeScript** - Full type safety
328
+ - **Vitest** - 99 tests with fast execution
329
+ - **Zod** - Runtime validation for configs
330
+ - **chokidar** - Hot-reload when library files change
331
+ - **MCP SDK** - Model Context Protocol integration
332
+
333
+ ---
334
+
335
+ ## Contributing
336
+
337
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
338
+
339
+ Ideas for contributions:
340
+ - Add prompts that worked well for you
341
+ - Add workflow chains for common tasks
342
+ - Add coding standards for new languages/frameworks
343
+ - Improve existing prompts with better examples
344
+
345
+ ---
346
+
347
+ ## License
348
+
349
+ MIT - see [LICENSE](LICENSE)
350
+
351
+ ---
352
+
353
+ ## Acknowledgments
354
+
355
+ Built with the [Model Context Protocol](https://modelcontextprotocol.io) by Anthropic.
356
+
357
+ ---
358
+
359
+ <p align="center">
360
+ <strong>Your AI is only as good as your prompts. Keep them polished.</strong>
361
+ </p>
@@ -0,0 +1,33 @@
1
+ # Chains Index
2
+
3
+ > Multi-step workflows for complex tasks
4
+
5
+ ## What Are Chains?
6
+
7
+ Chains are sequences of prompts designed to be used together for complex tasks that require multiple steps.
8
+
9
+ ## Available Chains
10
+
11
+ | Chain | Steps | Use Case |
12
+ |-------|-------|----------|
13
+ | [new-feature.md](new-feature.md) | 7 | Building a new feature from idea to deployment |
14
+ | [bug-fix.md](bug-fix.md) | 7 | Systematic debugging and fixing |
15
+ | [refactor.md](refactor.md) | 6 | Safe, incremental refactoring |
16
+ | [security-hardening.md](security-hardening.md) | 7 | Securing an application |
17
+ | [production-launch.md](production-launch.md) | 7 | Pre-launch preparation |
18
+
19
+ ## How to Use
20
+
21
+ 1. Open the chain file
22
+ 2. Execute each step in order
23
+ 3. Wait for completion before proceeding
24
+ 4. Document findings between steps
25
+
26
+ ## Chain Format
27
+
28
+ Each chain file contains:
29
+ - Overview of the workflow
30
+ - Prerequisites
31
+ - Step-by-step prompts
32
+ - Expected outputs per step
33
+ - Decision points
@@ -0,0 +1,222 @@
1
+ # Chain: Bug Fix
2
+
3
+ > Systematic workflow from bug report to verified fix
4
+
5
+ ## Overview
6
+
7
+ ```
8
+ Understand → Reproduce → Diagnose → Fix → Verify → Deploy
9
+ ```
10
+
11
+ ---
12
+
13
+ ## Step 1: Understand the Bug
14
+
15
+ **Prompt:**
16
+ ```
17
+ I have a bug report:
18
+
19
+ [Paste bug report or describe the issue]
20
+
21
+ Help me understand:
22
+ 1. What is the expected behavior?
23
+ 2. What is the actual behavior?
24
+ 3. Who is affected?
25
+ 4. How severe is this?
26
+ 5. When did it start (if known)?
27
+ 6. Any recent changes that might be related?
28
+
29
+ Don't start fixing yet. Just understand.
30
+ ```
31
+
32
+ **Expected Output:**
33
+ - Clear problem statement
34
+ - Severity assessment
35
+ - Initial hypotheses
36
+
37
+ ---
38
+
39
+ ## Step 2: Reproduce the Bug
40
+
41
+ **Prompt:**
42
+ ```
43
+ Based on the bug report, help me create reliable reproduction steps:
44
+
45
+ 1. What exact steps reproduce this?
46
+ 2. What environment is needed?
47
+ 3. Is it deterministic or intermittent?
48
+ 4. What's the minimal reproduction case?
49
+
50
+ Let's confirm we can reproduce before investigating.
51
+ ```
52
+
53
+ **Expected Output:**
54
+ - Step-by-step reproduction
55
+ - Environment requirements
56
+ - Reproduction rate
57
+
58
+ **Decision Point:** Can we reproduce? If not, gather more info.
59
+
60
+ ---
61
+
62
+ ## Step 3: Diagnose Root Cause
63
+
64
+ **Prompt:**
65
+ ```
66
+ The bug reproduces. Now diagnose:
67
+
68
+ I'm stuck in a debugging loop. The bug: [describe it]
69
+
70
+ Before suggesting fixes:
71
+
72
+ 1. List 5-7 different possible causes. Consider:
73
+ - Data issue, not code?
74
+ - Environment/config?
75
+ - Race condition/timing?
76
+ - Caching?
77
+ - Bug is somewhere else entirely?
78
+
79
+ 2. Rank by likelihood
80
+
81
+ 3. For top 2: what diagnostic code/logs would prove or disprove each?
82
+
83
+ Don't fix yet. Confirm the cause first.
84
+
85
+ Ultrathink.
86
+ ```
87
+
88
+ **Expected Output:**
89
+ - Ranked hypotheses
90
+ - Diagnostic approach
91
+ - Evidence needed
92
+
93
+ ---
94
+
95
+ ## Step 4: Confirm Root Cause
96
+
97
+ **Prompt:**
98
+ ```
99
+ Based on the diagnostics:
100
+
101
+ [Paste diagnostic output/findings]
102
+
103
+ 1. What do these findings tell us?
104
+ 2. Is the root cause confirmed?
105
+ 3. Are there any other factors?
106
+ 4. Now that we know the cause, what's the fix?
107
+ ```
108
+
109
+ **Expected Output:**
110
+ - Confirmed root cause
111
+ - Understanding of why it happens
112
+ - Fix approach
113
+
114
+ **Decision Point:** Root cause confirmed? If not, add more diagnostics.
115
+
116
+ ---
117
+
118
+ ## Step 5: Implement Fix
119
+
120
+ **Prompt:**
121
+ ```
122
+ The root cause is: [root cause]
123
+
124
+ Implement a fix that:
125
+ 1. Addresses the root cause (not just symptoms)
126
+ 2. Doesn't introduce regressions
127
+ 3. Includes a test that would have caught this
128
+ 4. Follows project coding standards
129
+
130
+ Show the fix and explain why it works.
131
+ ```
132
+
133
+ **Expected Output:**
134
+ - Code fix
135
+ - Explanation
136
+ - Test case
137
+
138
+ ---
139
+
140
+ ## Step 6: Verify Fix
141
+
142
+ **Prompt:**
143
+ ```
144
+ The fix is implemented. Verify:
145
+
146
+ 1. Does the original reproduction case pass?
147
+ 2. Do all existing tests still pass?
148
+ 3. Any edge cases we should test?
149
+ 4. Could this same bug exist elsewhere?
150
+ 5. Is there a risk of regression?
151
+
152
+ Be thorough. We don't want this bug back.
153
+ ```
154
+
155
+ **Expected Output:**
156
+ - Verification results
157
+ - Additional test cases
158
+ - Regression assessment
159
+
160
+ ---
161
+
162
+ ## Step 7: Document & Deploy
163
+
164
+ **Prompt:**
165
+ ```
166
+ Prepare this fix for deployment:
167
+
168
+ 1. PR description explaining:
169
+ - What was the bug
170
+ - What caused it
171
+ - How this fixes it
172
+
173
+ 2. Any monitoring we should add?
174
+ 3. Should we verify in staging first?
175
+ 4. Any users we should notify?
176
+ ```
177
+
178
+ **Expected Output:**
179
+ - PR description
180
+ - Deployment plan
181
+ - Communication if needed
182
+
183
+ ---
184
+
185
+ ## Chain Summary
186
+
187
+ | Step | Focus | Output |
188
+ |------|-------|--------|
189
+ | 1 | Understand | Clear problem statement |
190
+ | 2 | Reproduce | Reliable repro steps |
191
+ | 3 | Diagnose | Hypotheses + diagnostics |
192
+ | 4 | Confirm | Verified root cause |
193
+ | 5 | Fix | Code + tests |
194
+ | 6 | Verify | Confirmation + regression check |
195
+ | 7 | Deploy | PR + deployment |
196
+
197
+ ## Bug Report Template
198
+
199
+ ```markdown
200
+ **Summary**: [One line description]
201
+
202
+ **Expected Behavior**:
203
+ [What should happen]
204
+
205
+ **Actual Behavior**:
206
+ [What actually happens]
207
+
208
+ **Reproduction Steps**:
209
+ 1. [Step 1]
210
+ 2. [Step 2]
211
+ 3. [Step 3]
212
+
213
+ **Environment**:
214
+ - Browser/OS: [details]
215
+ - Version: [app version]
216
+ - User account: [if relevant]
217
+
218
+ **Additional Context**:
219
+ - Error messages: [any errors]
220
+ - Screenshots: [if helpful]
221
+ - When it started: [if known]
222
+ ```