@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.
- package/LICENSE +21 -0
- package/README.md +361 -0
- package/chains/_index.md +33 -0
- package/chains/bug-fix.md +222 -0
- package/chains/new-feature.md +216 -0
- package/chains/production-launch.md +291 -0
- package/chains/refactor.md +210 -0
- package/chains/security-hardening.md +242 -0
- package/contexts/guides/api-design.md +229 -0
- package/contexts/guides/error-handling.md +219 -0
- package/contexts/patterns/agentic-coding.md +368 -0
- package/contexts/patterns/mcp-server-patterns.md +267 -0
- package/contexts/patterns/repository-pattern.md +163 -0
- package/contexts/patterns/service-layer.md +185 -0
- package/contexts/stacks/fastapi.md +187 -0
- package/contexts/stacks/nextjs-14.md +149 -0
- package/contexts/stacks/prisma.md +228 -0
- package/dist/index.d.ts +129 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +284 -0
- package/dist/index.js.map +1 -0
- package/examples/architecture-docs/sample-architecture.md +270 -0
- package/examples/code-reviews/sample-review.md +232 -0
- package/examples/prds/sample-prd.md +179 -0
- package/instructions/_index.md +57 -0
- package/instructions/personas/code-reviewer.md +83 -0
- package/instructions/personas/devops-engineer.md +90 -0
- package/instructions/personas/security-expert.md +69 -0
- package/instructions/personas/senior-engineer.md +243 -0
- package/instructions/personas/ux-engineer.md +88 -0
- package/instructions/standards/fastapi.md +241 -0
- package/instructions/standards/go.md +427 -0
- package/instructions/standards/nextjs.md +350 -0
- package/instructions/standards/nodejs.md +284 -0
- package/instructions/standards/python.md +245 -0
- package/instructions/standards/react.md +227 -0
- package/instructions/standards/rust.md +318 -0
- package/instructions/standards/typescript-react.md +822 -0
- package/instructions/standards/typescript.md +294 -0
- package/instructions/workflows/feature-development.md +222 -0
- package/instructions/workflows/incident-response.md +192 -0
- package/instructions/workflows/pr-review.md +149 -0
- package/instructions/workflows/tdd.md +160 -0
- package/package.json +84 -0
- package/prompts/_index.md +70 -0
- package/prompts/agentic/agentic-loop.md +83 -0
- package/prompts/agentic/context-manager.md +37 -0
- package/prompts/agentic/test-driven-fix.md +41 -0
- package/prompts/analysis/deep-debugger.md +488 -0
- package/prompts/design/design-system-extractor.md +147 -0
- package/prompts/development/code-cleaner.md +119 -0
- package/prompts/development/debugger.md +64 -0
- package/prompts/development/tech-debt-audit.md +88 -0
- package/prompts/planning/architecture-analyzer.md +72 -0
- package/prompts/planning/implementation-plan.md +98 -0
- package/prompts/planning/prd-generator.md +66 -0
- package/prompts/planning/scope-killer.md +74 -0
- package/prompts/quality/critical-path-tester.md +133 -0
- package/prompts/quality/pre-launch-checklist.md +137 -0
- package/prompts/quality/security-audit.md +115 -0
- package/prompts/quality/security-fixer.md +117 -0
- package/prompts/quality/security-hardening.md +157 -0
- package/prompts/system/master-system-prompt.md +252 -0
- package/skills/_index.md +60 -0
- package/skills/code-review-advanced.md +435 -0
- package/skills/code-review.md +86 -0
- package/skills/debugging.md +86 -0
- package/skills/documentation.md +97 -0
- package/skills/pr-description.md +116 -0
- package/skills/project-setup.md +123 -0
- package/skills/refactoring.md +93 -0
- package/skills/testing.md +134 -0
- package/snippets/_index.md +57 -0
- package/snippets/constraints/mvp-only.md +50 -0
- package/snippets/constraints/no-external-deps.md +45 -0
- package/snippets/constraints/read-only.md +45 -0
- package/snippets/constraints/security-first.md +50 -0
- package/snippets/modifiers/be-ruthless.md +52 -0
- package/snippets/modifiers/be-thorough.md +50 -0
- package/snippets/modifiers/effort-high.md +56 -0
- package/snippets/modifiers/explain-reasoning.md +50 -0
- package/snippets/modifiers/megathink.md +314 -0
- package/snippets/modifiers/meta-cot.md +101 -0
- package/snippets/modifiers/no-code-yet.md +55 -0
- package/snippets/modifiers/step-by-step.md +50 -0
- package/snippets/modifiers/ultrathink.md +359 -0
- package/snippets/output-formats/checklist.md +61 -0
- package/snippets/output-formats/json.md +53 -0
- package/snippets/output-formats/markdown-table.md +44 -0
- package/snippets/output-formats/numbered-list.md +44 -0
- package/templates/_index.md +101 -0
- package/templates/claude-md/auto-enhance.md +258 -0
- package/templates/claude-md/cli-tool.md +243 -0
- package/templates/claude-md/full.md +449 -0
- package/templates/claude-md/minimal.md +52 -0
- package/templates/claude-md/nextjs-app.md +207 -0
- package/templates/claude-md/nodejs-service.md +251 -0
- package/templates/claude-md/python-api.md +236 -0
- package/templates/copilot/instructions.md +33 -0
- package/templates/cursor-rules/fullstack.txt +98 -0
- package/templates/cursor-rules/minimal.txt +20 -0
- package/templates/cursor-rules/nextjs.txt +61 -0
- package/templates/cursor-rules/python.txt +79 -0
- package/templates/docs/adr-template.md +119 -0
- package/templates/docs/api-spec-template.md +277 -0
- package/templates/docs/prd-template.md +140 -0
- package/templates/docs/runbook-template.md +238 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Be Ruthless
|
|
2
|
+
|
|
3
|
+
> Request aggressive prioritization and cutting
|
|
4
|
+
|
|
5
|
+
## Snippet
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Be ruthless. Cut aggressively. Question every assumption. Less is more.
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
Use when:
|
|
14
|
+
- Scope is creeping
|
|
15
|
+
- Need to ship faster
|
|
16
|
+
- Prioritizing ruthlessly
|
|
17
|
+
- Cutting unnecessary complexity
|
|
18
|
+
|
|
19
|
+
## Examples
|
|
20
|
+
|
|
21
|
+
### With Scope
|
|
22
|
+
```
|
|
23
|
+
Review this feature list.
|
|
24
|
+
|
|
25
|
+
Be ruthless. Cut aggressively. Question every assumption. Less is more.
|
|
26
|
+
|
|
27
|
+
What's the absolute minimum we need to ship?
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### With Code Review
|
|
31
|
+
```
|
|
32
|
+
Review this code for unnecessary complexity.
|
|
33
|
+
|
|
34
|
+
Be ruthless. Cut aggressively. Question every assumption. Less is more.
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Variations
|
|
38
|
+
|
|
39
|
+
### MVP Focus
|
|
40
|
+
```
|
|
41
|
+
We need to ship in [X days]. Be ruthless about scope. What do we cut?
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Simplification
|
|
45
|
+
```
|
|
46
|
+
This is too complex. Be ruthless. What can we remove entirely?
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Prioritization
|
|
50
|
+
```
|
|
51
|
+
Rank these by value/effort. Be ruthless. What's not worth doing?
|
|
52
|
+
```
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Be Thorough
|
|
2
|
+
|
|
3
|
+
> Request comprehensive, exhaustive analysis
|
|
4
|
+
|
|
5
|
+
## Snippet
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Be thorough. Don't miss edge cases. Check everything.
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
Use when:
|
|
14
|
+
- Reviewing security-critical code
|
|
15
|
+
- Auditing for bugs
|
|
16
|
+
- Complete documentation is needed
|
|
17
|
+
- You can't afford to miss anything
|
|
18
|
+
|
|
19
|
+
## Examples
|
|
20
|
+
|
|
21
|
+
### With Code Review
|
|
22
|
+
```
|
|
23
|
+
Review this pull request.
|
|
24
|
+
|
|
25
|
+
Be thorough. Don't miss edge cases. Check everything.
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### With Security Audit
|
|
29
|
+
```
|
|
30
|
+
Security audit this codebase.
|
|
31
|
+
|
|
32
|
+
Be thorough. Don't miss edge cases. Check everything.
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Variations
|
|
36
|
+
|
|
37
|
+
### Exhaustive
|
|
38
|
+
```
|
|
39
|
+
Be exhaustive. List every issue, no matter how small.
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Paranoid Mode
|
|
43
|
+
```
|
|
44
|
+
Assume everything can break. Check every assumption.
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### With Checklist
|
|
48
|
+
```
|
|
49
|
+
Be thorough. For each area, explicitly state what you checked and what you found.
|
|
50
|
+
```
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Effort High Modifier
|
|
2
|
+
|
|
3
|
+
> Trigger maximum reasoning effort for complex analysis. Works with Claude 4.5 Opus `effort` parameter and GPT-5/o3 `reasoning_effort`.
|
|
4
|
+
|
|
5
|
+
## The Snippet
|
|
6
|
+
|
|
7
|
+
### Universal (Works with all models)
|
|
8
|
+
```
|
|
9
|
+
EFFORT: HIGH
|
|
10
|
+
|
|
11
|
+
This task requires maximum reasoning depth. Before responding:
|
|
12
|
+
1. Consider this problem from multiple angles
|
|
13
|
+
2. Explore edge cases and failure modes
|
|
14
|
+
3. Challenge your initial assumptions
|
|
15
|
+
4. Only then provide your answer with full reasoning
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Claude 4.5 Opus Specific
|
|
19
|
+
```
|
|
20
|
+
Use effort: "high" for this response.
|
|
21
|
+
|
|
22
|
+
This is a complex problem that benefits from extended thinking.
|
|
23
|
+
Take your time to explore the solution space thoroughly.
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### GPT-5 / o3 Specific
|
|
27
|
+
```
|
|
28
|
+
Apply maximum reasoning effort to this problem.
|
|
29
|
+
|
|
30
|
+
Think step-by-step, consider alternatives, and verify your reasoning
|
|
31
|
+
before committing to an answer.
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## When to Use
|
|
35
|
+
|
|
36
|
+
| Scenario | Use Effort High? |
|
|
37
|
+
|----------|------------------|
|
|
38
|
+
| Architecture decisions | ✅ Yes |
|
|
39
|
+
| Security reviews | ✅ Yes |
|
|
40
|
+
| Complex debugging | ✅ Yes |
|
|
41
|
+
| Algorithm design | ✅ Yes |
|
|
42
|
+
| Simple CRUD code | ❌ No (overkill) |
|
|
43
|
+
| Quick questions | ❌ No (wastes tokens) |
|
|
44
|
+
|
|
45
|
+
## Model Support
|
|
46
|
+
|
|
47
|
+
| Model | Parameter | Values |
|
|
48
|
+
|-------|-----------|--------|
|
|
49
|
+
| Claude 4.5 Opus | `effort` | "low", "medium", "high" |
|
|
50
|
+
| GPT-5 / o3 | `reasoning_effort` | "low", "medium", "high" |
|
|
51
|
+
| Gemini 3 Pro | System instruction | N/A (always high) |
|
|
52
|
+
|
|
53
|
+
## Pairs Well With
|
|
54
|
+
- `ultrathink` - For deep analysis
|
|
55
|
+
- `megathink` - For critical decisions
|
|
56
|
+
- `security-audit` - For thorough security review
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Explain Reasoning
|
|
2
|
+
|
|
3
|
+
> Request visible reasoning process
|
|
4
|
+
|
|
5
|
+
## Snippet
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Explain your reasoning. Show how you arrived at each conclusion.
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
Use when:
|
|
14
|
+
- Learning from the process
|
|
15
|
+
- Need to verify logic
|
|
16
|
+
- Debugging AI decisions
|
|
17
|
+
- Teaching others
|
|
18
|
+
|
|
19
|
+
## Examples
|
|
20
|
+
|
|
21
|
+
### With Technical Decision
|
|
22
|
+
```
|
|
23
|
+
Which database should I use for this use case?
|
|
24
|
+
|
|
25
|
+
Explain your reasoning. Show how you arrived at each conclusion.
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### With Code Review
|
|
29
|
+
```
|
|
30
|
+
Is this the right approach?
|
|
31
|
+
|
|
32
|
+
Explain your reasoning. Show how you arrived at each conclusion.
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Variations
|
|
36
|
+
|
|
37
|
+
### Pros/Cons
|
|
38
|
+
```
|
|
39
|
+
Show pros and cons for each option. Explain your final recommendation.
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Tradeoffs
|
|
43
|
+
```
|
|
44
|
+
What are the tradeoffs? Why did you choose this over alternatives?
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Teaching Mode
|
|
48
|
+
```
|
|
49
|
+
Explain like you're teaching a junior developer. Show the reasoning.
|
|
50
|
+
```
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Megathink
|
|
3
|
+
description: Maximum thinking budget for architecture decisions, incident response, and critical code
|
|
4
|
+
tags: [modifier, extended-thinking, architecture, critical, deep-analysis]
|
|
5
|
+
aliases: [max-think, extended-thinking, deep-dive]
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Megathink
|
|
10
|
+
|
|
11
|
+
> When ultrathink isn't enough. Use for decisions that will cost weeks to undo.
|
|
12
|
+
|
|
13
|
+
## The Core Insight
|
|
14
|
+
|
|
15
|
+
**Megathink** is for situations where:
|
|
16
|
+
- The decision affects the entire system architecture
|
|
17
|
+
- Reverting would take weeks of engineering time
|
|
18
|
+
- Security or data integrity is at stake
|
|
19
|
+
- You're responding to a production incident
|
|
20
|
+
- The cost of being wrong is very high
|
|
21
|
+
|
|
22
|
+
This triggers Claude's maximum thinking budget and most systematic analysis mode.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## The Snippet
|
|
27
|
+
|
|
28
|
+
### Standard
|
|
29
|
+
```
|
|
30
|
+
MEGATHINK. This is a critical decision that will be expensive to reverse.
|
|
31
|
+
|
|
32
|
+
Before responding, I need you to:
|
|
33
|
+
1. List every assumption I'm making (stated and unstated)
|
|
34
|
+
2. Consider at least 5 different approaches
|
|
35
|
+
3. For each approach, identify 3 ways it could fail
|
|
36
|
+
4. Consider the 6-month maintenance implications
|
|
37
|
+
5. Think about team skill levels and learning curves
|
|
38
|
+
6. Consider cost, security, and scalability together
|
|
39
|
+
7. Only then make a recommendation with full reasoning
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Architecture Variant
|
|
43
|
+
```
|
|
44
|
+
MEGATHINK: ARCHITECTURE MODE
|
|
45
|
+
|
|
46
|
+
This is an architecture decision. Consider:
|
|
47
|
+
- How will this scale to 10x, 100x current load?
|
|
48
|
+
- What's the team's familiarity with this technology?
|
|
49
|
+
- What's the operational burden? (Monitoring, debugging, on-call)
|
|
50
|
+
- How does this interact with existing systems?
|
|
51
|
+
- What's the migration path from current state?
|
|
52
|
+
- What are we locking ourselves into?
|
|
53
|
+
- What's the cost to reverse this decision?
|
|
54
|
+
|
|
55
|
+
Provide a decision matrix with weighted criteria.
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Incident Response Variant
|
|
59
|
+
```
|
|
60
|
+
MEGATHINK: INCIDENT MODE
|
|
61
|
+
|
|
62
|
+
We have a production incident. Before any fix:
|
|
63
|
+
1. What do we know FOR CERTAIN? (not suspected)
|
|
64
|
+
2. What are the possible root causes?
|
|
65
|
+
3. What's the blast radius of each potential fix?
|
|
66
|
+
4. What could make this worse?
|
|
67
|
+
5. What's the minimal safe intervention?
|
|
68
|
+
6. What rollback plan do we have?
|
|
69
|
+
7. Who else needs to be informed?
|
|
70
|
+
|
|
71
|
+
Provide a step-by-step action plan with checkpoints.
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Security Variant
|
|
75
|
+
```
|
|
76
|
+
MEGATHINK: SECURITY MODE
|
|
77
|
+
|
|
78
|
+
Assume an attacker is looking at this code. Think like a red team:
|
|
79
|
+
1. What data does this touch? (PII, credentials, financial)
|
|
80
|
+
2. Who can access this? Who SHOULD be able to?
|
|
81
|
+
3. What are ALL the input paths?
|
|
82
|
+
4. What happens with malicious input?
|
|
83
|
+
5. What are the privilege escalation paths?
|
|
84
|
+
6. What does the audit log capture?
|
|
85
|
+
7. What's the blast radius if compromised?
|
|
86
|
+
|
|
87
|
+
Provide a threat model and mitigation plan.
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## When to Use
|
|
93
|
+
|
|
94
|
+
| Scenario | Ultrathink | Megathink |
|
|
95
|
+
|----------|------------|-----------|
|
|
96
|
+
| Complex bug | ✅ | ❌ |
|
|
97
|
+
| API design | ✅ | ✅ |
|
|
98
|
+
| Database schema | ❌ | ✅ |
|
|
99
|
+
| Auth system changes | ❌ | ✅ |
|
|
100
|
+
| Framework choice | ❌ | ✅ |
|
|
101
|
+
| Production incident | ❌ | ✅ |
|
|
102
|
+
| Performance optimization | ✅ | ❌ |
|
|
103
|
+
| Code review | ✅ | ❌ |
|
|
104
|
+
| Architecture migration | ❌ | ✅ |
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Example: Database Schema Decision
|
|
109
|
+
|
|
110
|
+
**User Prompt:**
|
|
111
|
+
> We need to add multi-tenancy to our SaaS app. Currently all customers share one database. How should we approach this?
|
|
112
|
+
|
|
113
|
+
**With MEGATHINK - Full Analysis:**
|
|
114
|
+
|
|
115
|
+
```markdown
|
|
116
|
+
## Multi-Tenancy Architecture Decision
|
|
117
|
+
|
|
118
|
+
### Assumptions I'm Identifying
|
|
119
|
+
|
|
120
|
+
**Stated:**
|
|
121
|
+
- Single shared database currently
|
|
122
|
+
- Need tenant isolation
|
|
123
|
+
|
|
124
|
+
**Unstated (need to verify):**
|
|
125
|
+
- Number of tenants expected? (10? 1000? 100,000?)
|
|
126
|
+
- Data volume per tenant?
|
|
127
|
+
- Performance isolation requirements?
|
|
128
|
+
- Compliance requirements? (SOC2, HIPAA, GDPR)
|
|
129
|
+
- Cross-tenant reporting needed?
|
|
130
|
+
- Budget for infrastructure changes?
|
|
131
|
+
- Team's database expertise?
|
|
132
|
+
|
|
133
|
+
### Five Approaches
|
|
134
|
+
|
|
135
|
+
#### 1. Row-Level Security (Tenant ID Column)
|
|
136
|
+
Add `tenant_id` to every table, enforce via application or RLS.
|
|
137
|
+
|
|
138
|
+
**Pros:**
|
|
139
|
+
- Minimal infrastructure change
|
|
140
|
+
- Easiest to implement
|
|
141
|
+
- Cross-tenant queries possible
|
|
142
|
+
|
|
143
|
+
**Cons:**
|
|
144
|
+
- Developer discipline required
|
|
145
|
+
- One bug = data leak
|
|
146
|
+
- Noisy neighbor problems
|
|
147
|
+
- Hard to delete tenant data
|
|
148
|
+
|
|
149
|
+
**Failure Modes:**
|
|
150
|
+
1. Developer forgets WHERE clause → cross-tenant data leak
|
|
151
|
+
2. Index bloat as tenants grow
|
|
152
|
+
3. One tenant's heavy query affects all
|
|
153
|
+
|
|
154
|
+
#### 2. Schema-Per-Tenant (PostgreSQL Schemas)
|
|
155
|
+
Each tenant gets own schema: `tenant_123.users`
|
|
156
|
+
|
|
157
|
+
**Pros:**
|
|
158
|
+
- Better isolation
|
|
159
|
+
- Easier to backup/restore per tenant
|
|
160
|
+
- Can use search_path for security
|
|
161
|
+
|
|
162
|
+
**Cons:**
|
|
163
|
+
- Schema migrations across 1000+ schemas
|
|
164
|
+
- Connection management complexity
|
|
165
|
+
- Harder cross-tenant analytics
|
|
166
|
+
|
|
167
|
+
**Failure Modes:**
|
|
168
|
+
1. Migration fails on one schema → inconsistent state
|
|
169
|
+
2. Connection pool exhaustion
|
|
170
|
+
3. Schema count limits in some DBs
|
|
171
|
+
|
|
172
|
+
#### 3. Database-Per-Tenant
|
|
173
|
+
Separate database instance per tenant.
|
|
174
|
+
|
|
175
|
+
**Pros:**
|
|
176
|
+
- Maximum isolation
|
|
177
|
+
- Independent scaling
|
|
178
|
+
- Easiest compliance story
|
|
179
|
+
|
|
180
|
+
**Cons:**
|
|
181
|
+
- Expensive at scale
|
|
182
|
+
- Complex provisioning
|
|
183
|
+
- Operational burden (patching, backups)
|
|
184
|
+
|
|
185
|
+
**Failure Modes:**
|
|
186
|
+
1. Operational complexity → missed patches
|
|
187
|
+
2. Cost explosion with tenant growth
|
|
188
|
+
3. Slow tenant provisioning
|
|
189
|
+
|
|
190
|
+
#### 4. Hybrid: Shared + Premium Isolated
|
|
191
|
+
Small tenants share; enterprise gets dedicated.
|
|
192
|
+
|
|
193
|
+
**Pros:**
|
|
194
|
+
- Cost-efficient for small tenants
|
|
195
|
+
- Premium option for enterprise
|
|
196
|
+
- Scalable business model
|
|
197
|
+
|
|
198
|
+
**Cons:**
|
|
199
|
+
- Two systems to maintain
|
|
200
|
+
- Data migration between tiers
|
|
201
|
+
- Complex routing logic
|
|
202
|
+
|
|
203
|
+
**Failure Modes:**
|
|
204
|
+
1. Routing bug → wrong database
|
|
205
|
+
2. Feature parity drift between tiers
|
|
206
|
+
3. Migration failures
|
|
207
|
+
|
|
208
|
+
#### 5. Citus/Vitess Distributed Database
|
|
209
|
+
Shard by tenant_id using distributed PostgreSQL.
|
|
210
|
+
|
|
211
|
+
**Pros:**
|
|
212
|
+
- Horizontal scaling
|
|
213
|
+
- Query routing handled by Citus
|
|
214
|
+
- Looks like single database
|
|
215
|
+
|
|
216
|
+
**Cons:**
|
|
217
|
+
- Operational complexity
|
|
218
|
+
- Cross-shard query limitations
|
|
219
|
+
- Team needs to learn new patterns
|
|
220
|
+
|
|
221
|
+
**Failure Modes:**
|
|
222
|
+
1. Shard rebalancing during peak
|
|
223
|
+
2. Cross-shard transaction issues
|
|
224
|
+
3. Query planner surprises
|
|
225
|
+
|
|
226
|
+
### Decision Matrix
|
|
227
|
+
|
|
228
|
+
| Criteria (Weight) | Row-Level | Schema | Database | Hybrid | Distributed |
|
|
229
|
+
|-------------------|-----------|--------|----------|--------|-------------|
|
|
230
|
+
| Security (30%) | 2 | 3 | 5 | 4 | 3 |
|
|
231
|
+
| Cost (20%) | 5 | 4 | 1 | 3 | 3 |
|
|
232
|
+
| Operational (20%) | 5 | 3 | 2 | 2 | 2 |
|
|
233
|
+
| Scale (15%) | 2 | 3 | 5 | 4 | 5 |
|
|
234
|
+
| Team Skill (15%) | 5 | 4 | 3 | 3 | 2 |
|
|
235
|
+
| **Weighted Total** | 3.6 | 3.4 | 3.2 | 3.3 | 3.0 |
|
|
236
|
+
|
|
237
|
+
### My Recommendation
|
|
238
|
+
|
|
239
|
+
**Start with Row-Level Security, plan migration path to Hybrid.**
|
|
240
|
+
|
|
241
|
+
**Reasoning:**
|
|
242
|
+
1. Fastest time to market (weeks, not months)
|
|
243
|
+
2. Learn tenant usage patterns before over-engineering
|
|
244
|
+
3. Clear migration path when you need it
|
|
245
|
+
4. Matches team's current PostgreSQL expertise
|
|
246
|
+
|
|
247
|
+
**Implementation safeguards:**
|
|
248
|
+
1. Use PostgreSQL RLS policies at database level
|
|
249
|
+
2. Abstract tenant_id injection into ORM middleware
|
|
250
|
+
3. Add integration tests that verify isolation
|
|
251
|
+
4. Regular security audits of tenant boundaries
|
|
252
|
+
|
|
253
|
+
**Trigger for migration:**
|
|
254
|
+
- Enterprise customer requires dedicated
|
|
255
|
+
- Performance isolation becomes critical
|
|
256
|
+
- Compliance requirement mandates it
|
|
257
|
+
|
|
258
|
+
### 6-Month Maintenance View
|
|
259
|
+
|
|
260
|
+
**What we'll be doing:**
|
|
261
|
+
- Ensuring every new table has tenant_id + RLS policy
|
|
262
|
+
- Running tenant isolation tests in CI
|
|
263
|
+
- Monitoring for cross-tenant query mistakes
|
|
264
|
+
- Building tooling for tenant data export
|
|
265
|
+
|
|
266
|
+
**What could go wrong:**
|
|
267
|
+
- New developer skips RLS on new table
|
|
268
|
+
- Performance degradation from large tenants
|
|
269
|
+
- Audit log showing we need stronger isolation
|
|
270
|
+
|
|
271
|
+
**Mitigation:**
|
|
272
|
+
- PR template checklist for multi-tenancy
|
|
273
|
+
- Automated tests checking for missing RLS
|
|
274
|
+
- Alerting on single-tenant query dominance
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## Combinations
|
|
280
|
+
|
|
281
|
+
### Megathink + Critique
|
|
282
|
+
```
|
|
283
|
+
MEGATHINK this decision. After your recommendation, put on your critic hat
|
|
284
|
+
and find every way your own recommendation could be wrong.
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### Megathink + Simplify
|
|
288
|
+
```
|
|
289
|
+
MEGATHINK this first. Then explain your recommendation so simply that a
|
|
290
|
+
product manager could make the call.
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Megathink + Timeline
|
|
294
|
+
```
|
|
295
|
+
MEGATHINK this. Include a realistic implementation timeline with milestones
|
|
296
|
+
and decision checkpoints.
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## When NOT to Use
|
|
302
|
+
|
|
303
|
+
1. **Regular coding tasks** - Overkill, wastes time
|
|
304
|
+
2. **Well-understood patterns** - No need to re-analyze solved problems
|
|
305
|
+
3. **Reversible decisions** - Save megathink for costly reversals
|
|
306
|
+
4. **When you need to move fast** - Sometimes good enough is good enough
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
## See Also
|
|
311
|
+
|
|
312
|
+
- [[ultrathink]] - For complex but less critical decisions
|
|
313
|
+
- [[deep-debugger]] - For systematic incident analysis
|
|
314
|
+
- [[security-audit]] - For security-focused deep analysis
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Meta-CoT (Meta Chain of Thought)
|
|
2
|
+
|
|
3
|
+
> The 2025-2026 evolution of Chain of Thought. The model plans its reasoning strategy before executing it.
|
|
4
|
+
|
|
5
|
+
## The Core Insight
|
|
6
|
+
|
|
7
|
+
Traditional CoT: "Think step by step" → Model reasons linearly.
|
|
8
|
+
|
|
9
|
+
**Meta-CoT**: "Plan how you'll think, then think, then review" → Model reasons about its reasoning.
|
|
10
|
+
|
|
11
|
+
Research shows this catches more errors and produces more thorough analysis.
|
|
12
|
+
|
|
13
|
+
## The Snippet
|
|
14
|
+
|
|
15
|
+
### Standard Meta-CoT
|
|
16
|
+
```xml
|
|
17
|
+
When solving this problem, use the Meta-CoT framework:
|
|
18
|
+
|
|
19
|
+
<plan>
|
|
20
|
+
First, outline your reasoning strategy. What approach will you take?
|
|
21
|
+
What are the key considerations?
|
|
22
|
+
</plan>
|
|
23
|
+
|
|
24
|
+
<reasoning>
|
|
25
|
+
Execute your plan step by step. Show your work.
|
|
26
|
+
Think freely here—don't force rigid structure.
|
|
27
|
+
</reasoning>
|
|
28
|
+
|
|
29
|
+
<review>
|
|
30
|
+
Critique your own reasoning:
|
|
31
|
+
- What assumptions did you make?
|
|
32
|
+
- What could be wrong?
|
|
33
|
+
- What did you miss?
|
|
34
|
+
</review>
|
|
35
|
+
|
|
36
|
+
<answer>
|
|
37
|
+
Provide your final answer, incorporating insights from the review.
|
|
38
|
+
</answer>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Compact Version
|
|
42
|
+
```
|
|
43
|
+
Use Meta-CoT:
|
|
44
|
+
1. PLAN: How will you approach this?
|
|
45
|
+
2. REASON: Execute the plan
|
|
46
|
+
3. REVIEW: Critique yourself
|
|
47
|
+
4. ANSWER: Final response
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Example
|
|
51
|
+
|
|
52
|
+
**Problem**: "Design a rate limiter for an API"
|
|
53
|
+
|
|
54
|
+
**Meta-CoT Response**:
|
|
55
|
+
|
|
56
|
+
```xml
|
|
57
|
+
<plan>
|
|
58
|
+
I'll approach this by:
|
|
59
|
+
1. Clarifying requirements (requests per time window)
|
|
60
|
+
2. Evaluating algorithms (Token Bucket vs Sliding Window)
|
|
61
|
+
3. Considering distributed scenarios
|
|
62
|
+
4. Providing implementation with trade-offs
|
|
63
|
+
</plan>
|
|
64
|
+
|
|
65
|
+
<reasoning>
|
|
66
|
+
Token Bucket: Allows bursts, simple to implement, O(1) per request.
|
|
67
|
+
Sliding Window Log: More accurate, but O(n) memory per user.
|
|
68
|
+
Sliding Window Counter: Good balance, approximate but efficient.
|
|
69
|
+
|
|
70
|
+
For a distributed system, I need to consider:
|
|
71
|
+
- Redis for shared state
|
|
72
|
+
- Race conditions with MULTI/EXEC
|
|
73
|
+
- Fallback if Redis is unavailable
|
|
74
|
+
</reasoning>
|
|
75
|
+
|
|
76
|
+
<review>
|
|
77
|
+
I assumed Redis availability. Should add:
|
|
78
|
+
- Local fallback rate limiter
|
|
79
|
+
- Circuit breaker for Redis
|
|
80
|
+
- What if clocks drift between nodes? → Use Redis time, not local time.
|
|
81
|
+
</review>
|
|
82
|
+
|
|
83
|
+
<answer>
|
|
84
|
+
[Final implementation with Redis + local fallback]
|
|
85
|
+
</answer>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## When to Use
|
|
89
|
+
|
|
90
|
+
| Scenario | Meta-CoT? | Why |
|
|
91
|
+
|----------|-----------|-----|
|
|
92
|
+
| Architecture design | ✅ | Catches design flaws early |
|
|
93
|
+
| Complex debugging | ✅ | Self-review catches missed causes |
|
|
94
|
+
| Security analysis | ✅ | Review phase finds vulnerabilities |
|
|
95
|
+
| Simple code | ❌ | Overkill, just answer directly |
|
|
96
|
+
| Explanations | Maybe | Helps structure complex explanations |
|
|
97
|
+
|
|
98
|
+
## Pairs Well With
|
|
99
|
+
- `effort-high` - Maximum reasoning depth
|
|
100
|
+
- `megathink` - For critical decisions
|
|
101
|
+
- `security-audit` - Self-review is crucial for security
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# No Code Yet
|
|
2
|
+
|
|
3
|
+
> Prevent AI from writing code prematurely
|
|
4
|
+
|
|
5
|
+
## Snippet
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
DO NOT write code yet. I need to review and approve the plan first.
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
Use when you want:
|
|
14
|
+
- Planning before implementation
|
|
15
|
+
- To review approach before committing
|
|
16
|
+
- To catch issues before code exists
|
|
17
|
+
- Alignment before investment
|
|
18
|
+
|
|
19
|
+
## Examples
|
|
20
|
+
|
|
21
|
+
### With Implementation Plan
|
|
22
|
+
```
|
|
23
|
+
I need to implement this feature.
|
|
24
|
+
|
|
25
|
+
Create a detailed implementation plan.
|
|
26
|
+
|
|
27
|
+
DO NOT write code yet. I need to review and approve the plan first.
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### With Architecture
|
|
31
|
+
```
|
|
32
|
+
Design the architecture for this system.
|
|
33
|
+
|
|
34
|
+
DO NOT write code yet. I need to review and approve the plan first.
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Variations
|
|
38
|
+
|
|
39
|
+
### Analysis Only
|
|
40
|
+
```
|
|
41
|
+
Analyze only. Do not make changes.
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Proposal Mode
|
|
45
|
+
```
|
|
46
|
+
Propose a solution but wait for my approval before implementing.
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Explicit Separation
|
|
50
|
+
```
|
|
51
|
+
Phase 1: Plan (no code)
|
|
52
|
+
Phase 2: Implementation (after approval)
|
|
53
|
+
|
|
54
|
+
We are in Phase 1. Present the plan only.
|
|
55
|
+
```
|