@ckelsoe/prompt-architect 3.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/.claude-plugin/marketplace.json +20 -0
- package/.claude-plugin/plugin.json +18 -0
- package/CHANGELOG.md +264 -0
- package/LICENSE +21 -0
- package/MIGRATION.md +66 -0
- package/README.md +1184 -0
- package/adapters/README.md +267 -0
- package/adapters/for-cursor.mdc +138 -0
- package/adapters/for-gemini-cli.md +70 -0
- package/adapters/for-github-copilot.md +141 -0
- package/adapters/for-openai-codex-cli.md +158 -0
- package/adapters/for-windsurf.md +136 -0
- package/adapters/system-prompt.md +243 -0
- package/package.json +135 -0
- package/scripts/install.js +490 -0
- package/scripts/test.js +213 -0
- package/scripts/validate-skill.js +350 -0
- package/skills/prompt-architect/SKILL.md +331 -0
- package/skills/prompt-architect/assets/templates/ape_template.txt +5 -0
- package/skills/prompt-architect/assets/templates/bab_template.txt +15 -0
- package/skills/prompt-architect/assets/templates/broke_template.txt +15 -0
- package/skills/prompt-architect/assets/templates/cai-critique-revise_template.txt +18 -0
- package/skills/prompt-architect/assets/templates/care_template.txt +16 -0
- package/skills/prompt-architect/assets/templates/chain-of-density_template.txt +46 -0
- package/skills/prompt-architect/assets/templates/chain-of-thought_template.txt +49 -0
- package/skills/prompt-architect/assets/templates/co-star_template.txt +17 -0
- package/skills/prompt-architect/assets/templates/crispe_template.txt +14 -0
- package/skills/prompt-architect/assets/templates/ctf_template.txt +15 -0
- package/skills/prompt-architect/assets/templates/devils-advocate_template.txt +25 -0
- package/skills/prompt-architect/assets/templates/hybrid_template.txt +101 -0
- package/skills/prompt-architect/assets/templates/least-to-most_template.txt +16 -0
- package/skills/prompt-architect/assets/templates/plan-and-solve_template.txt +7 -0
- package/skills/prompt-architect/assets/templates/pre-mortem_template.txt +27 -0
- package/skills/prompt-architect/assets/templates/race_template.txt +19 -0
- package/skills/prompt-architect/assets/templates/rcot_template.txt +31 -0
- package/skills/prompt-architect/assets/templates/react_template.txt +27 -0
- package/skills/prompt-architect/assets/templates/reverse-role_template.txt +11 -0
- package/skills/prompt-architect/assets/templates/rise-ie_template.txt +23 -0
- package/skills/prompt-architect/assets/templates/rise-ix_template.txt +28 -0
- package/skills/prompt-architect/assets/templates/risen_template.txt +21 -0
- package/skills/prompt-architect/assets/templates/rpef_template.txt +26 -0
- package/skills/prompt-architect/assets/templates/rtf_template.txt +13 -0
- package/skills/prompt-architect/assets/templates/self-refine_template.txt +16 -0
- package/skills/prompt-architect/assets/templates/skeleton-of-thought_template.txt +15 -0
- package/skills/prompt-architect/assets/templates/step-back_template.txt +10 -0
- package/skills/prompt-architect/assets/templates/tidd-ec_template.txt +45 -0
- package/skills/prompt-architect/assets/templates/tree-of-thought_template.txt +30 -0
- package/skills/prompt-architect/references/frameworks/ape.md +200 -0
- package/skills/prompt-architect/references/frameworks/bab.md +242 -0
- package/skills/prompt-architect/references/frameworks/broke.md +242 -0
- package/skills/prompt-architect/references/frameworks/cai-critique-revise.md +230 -0
- package/skills/prompt-architect/references/frameworks/care.md +235 -0
- package/skills/prompt-architect/references/frameworks/chain-of-density.md +479 -0
- package/skills/prompt-architect/references/frameworks/chain-of-thought.md +424 -0
- package/skills/prompt-architect/references/frameworks/co-star.md +256 -0
- package/skills/prompt-architect/references/frameworks/crispe.md +253 -0
- package/skills/prompt-architect/references/frameworks/ctf.md +207 -0
- package/skills/prompt-architect/references/frameworks/devils-advocate.md +206 -0
- package/skills/prompt-architect/references/frameworks/least-to-most.md +226 -0
- package/skills/prompt-architect/references/frameworks/plan-and-solve.md +210 -0
- package/skills/prompt-architect/references/frameworks/pre-mortem.md +197 -0
- package/skills/prompt-architect/references/frameworks/race.md +243 -0
- package/skills/prompt-architect/references/frameworks/rcot.md +203 -0
- package/skills/prompt-architect/references/frameworks/react.md +304 -0
- package/skills/prompt-architect/references/frameworks/reverse-role.md +189 -0
- package/skills/prompt-architect/references/frameworks/rise.md +555 -0
- package/skills/prompt-architect/references/frameworks/risen.md +297 -0
- package/skills/prompt-architect/references/frameworks/rpef.md +195 -0
- package/skills/prompt-architect/references/frameworks/rtf.md +358 -0
- package/skills/prompt-architect/references/frameworks/self-refine.md +205 -0
- package/skills/prompt-architect/references/frameworks/skeleton-of-thought.md +186 -0
- package/skills/prompt-architect/references/frameworks/step-back.md +206 -0
- package/skills/prompt-architect/references/frameworks/tidd-ec.md +470 -0
- package/skills/prompt-architect/references/frameworks/tree-of-thought.md +260 -0
- package/skills/prompt-architect/scripts/framework_analyzer.py +807 -0
- package/skills/prompt-architect/scripts/prompt_evaluator.py +336 -0
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
# Chain of Thought (CoT) Framework
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Chain of Thought is a prompting technique that encourages step-by-step reasoning and makes the thinking process explicit. Instead of jumping to answers, it guides Claude to break down complex problems, show intermediate steps, and verify logic along the way.
|
|
6
|
+
|
|
7
|
+
## Core Concept
|
|
8
|
+
|
|
9
|
+
CoT works by:
|
|
10
|
+
1. Breaking complex problems into smaller steps
|
|
11
|
+
2. Making reasoning explicit at each step
|
|
12
|
+
3. Showing work rather than just final answers
|
|
13
|
+
4. Verifying logic progressively
|
|
14
|
+
5. Enabling error detection and correction
|
|
15
|
+
|
|
16
|
+
## When to Use Chain of Thought
|
|
17
|
+
|
|
18
|
+
**Ideal for:**
|
|
19
|
+
- Mathematical problem-solving
|
|
20
|
+
- Logical reasoning tasks
|
|
21
|
+
- Complex multi-step analysis
|
|
22
|
+
- Debugging and troubleshooting
|
|
23
|
+
- Decision-making with trade-offs
|
|
24
|
+
- Tasks where "showing your work" matters
|
|
25
|
+
|
|
26
|
+
**Not needed for:**
|
|
27
|
+
- Simple lookups or facts
|
|
28
|
+
- Straightforward transformations
|
|
29
|
+
- Tasks with obvious single steps
|
|
30
|
+
- Creative writing without logic requirements
|
|
31
|
+
|
|
32
|
+
## Implementation Approaches
|
|
33
|
+
|
|
34
|
+
### Approach 1: Explicit Instruction
|
|
35
|
+
Directly instruct Claude to think step-by-step.
|
|
36
|
+
|
|
37
|
+
**Example:**
|
|
38
|
+
```
|
|
39
|
+
Solve this problem step-by-step, showing your reasoning at each stage:
|
|
40
|
+
|
|
41
|
+
A company's revenue grew 15% in Q1, decreased 8% in Q2, grew 20% in Q3, and grew 5% in Q4. If they started the year with $1M in quarterly revenue, what was their Q4 revenue?
|
|
42
|
+
|
|
43
|
+
Think through this carefully:
|
|
44
|
+
1. Calculate Q1 revenue
|
|
45
|
+
2. Calculate Q2 revenue
|
|
46
|
+
3. Calculate Q3 revenue
|
|
47
|
+
4. Calculate Q4 revenue
|
|
48
|
+
5. Verify your calculation
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Approach 2: Zero-Shot CoT
|
|
52
|
+
Use trigger phrases that activate reasoning.
|
|
53
|
+
|
|
54
|
+
**Magic phrases:**
|
|
55
|
+
- "Let's think step by step."
|
|
56
|
+
- "Let's work through this systematically."
|
|
57
|
+
- "Let's break this down."
|
|
58
|
+
- "Think carefully about this."
|
|
59
|
+
|
|
60
|
+
**Example:**
|
|
61
|
+
```
|
|
62
|
+
What's the best database choice for a real-time analytics platform handling 1M events/second with complex aggregations? Let's think step by step.
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Approach 3: Few-Shot CoT
|
|
66
|
+
Provide examples showing step-by-step reasoning.
|
|
67
|
+
|
|
68
|
+
**Example:**
|
|
69
|
+
```
|
|
70
|
+
Example 1:
|
|
71
|
+
Q: If a train travels 120 miles in 2 hours, what's its speed?
|
|
72
|
+
A: Let's break this down:
|
|
73
|
+
1. Speed = Distance / Time
|
|
74
|
+
2. Distance = 120 miles
|
|
75
|
+
3. Time = 2 hours
|
|
76
|
+
4. Speed = 120 / 2 = 60 mph
|
|
77
|
+
Therefore: 60 mph
|
|
78
|
+
|
|
79
|
+
Example 2:
|
|
80
|
+
Q: A store offers 20% off, then an additional 10% off. What's the total discount on a $100 item?
|
|
81
|
+
A: Let's work through this:
|
|
82
|
+
1. First discount: 20% of $100 = $20
|
|
83
|
+
2. Price after first discount: $100 - $20 = $80
|
|
84
|
+
3. Second discount: 10% of $80 = $8
|
|
85
|
+
4. Final price: $80 - $8 = $72
|
|
86
|
+
5. Total discount: $100 - $72 = $28
|
|
87
|
+
6. Total discount percentage: 28/100 = 28%
|
|
88
|
+
Therefore: 28% total discount (not 30%)
|
|
89
|
+
|
|
90
|
+
Now solve:
|
|
91
|
+
Q: [Your problem]
|
|
92
|
+
A: Let's break this down:
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Approach 4: Structured CoT
|
|
96
|
+
Provide a template for reasoning.
|
|
97
|
+
|
|
98
|
+
**Example:**
|
|
99
|
+
```
|
|
100
|
+
Analyze whether we should migrate to microservices using this reasoning structure:
|
|
101
|
+
|
|
102
|
+
STEP 1 - CURRENT STATE:
|
|
103
|
+
[Describe current architecture]
|
|
104
|
+
|
|
105
|
+
STEP 2 - PROBLEMS:
|
|
106
|
+
[What problems exist?]
|
|
107
|
+
|
|
108
|
+
STEP 3 - MICROSERVICES BENEFITS:
|
|
109
|
+
[How would microservices help?]
|
|
110
|
+
|
|
111
|
+
STEP 4 - MICROSERVICES COSTS:
|
|
112
|
+
[What are the downsides?]
|
|
113
|
+
|
|
114
|
+
STEP 5 - ALTERNATIVES:
|
|
115
|
+
[What else could we do?]
|
|
116
|
+
|
|
117
|
+
STEP 6 - COMPARISON:
|
|
118
|
+
[Compare options systematically]
|
|
119
|
+
|
|
120
|
+
STEP 7 - RECOMMENDATION:
|
|
121
|
+
[Final decision with reasoning]
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Best Practices
|
|
125
|
+
|
|
126
|
+
### 1. Be Explicit About Steps
|
|
127
|
+
```
|
|
128
|
+
Good:
|
|
129
|
+
"Calculate the ROI step by step:
|
|
130
|
+
1. Calculate total costs
|
|
131
|
+
2. Calculate total revenue
|
|
132
|
+
3. Calculate profit (revenue - costs)
|
|
133
|
+
4. Calculate ROI (profit / costs * 100)
|
|
134
|
+
5. Interpret the result"
|
|
135
|
+
|
|
136
|
+
Poor:
|
|
137
|
+
"Calculate the ROI"
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### 2. Request Verification
|
|
141
|
+
```
|
|
142
|
+
Good:
|
|
143
|
+
"After solving, verify your answer makes sense and check your math."
|
|
144
|
+
|
|
145
|
+
Poor:
|
|
146
|
+
[No verification step]
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### 3. Encourage Self-Correction
|
|
150
|
+
```
|
|
151
|
+
Good:
|
|
152
|
+
"If you find an error in your reasoning, acknowledge it and correct your approach."
|
|
153
|
+
|
|
154
|
+
Poor:
|
|
155
|
+
[No mention of error handling]
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### 4. Ask for Uncertainty Acknowledgment
|
|
159
|
+
```
|
|
160
|
+
Good:
|
|
161
|
+
"If you're uncertain at any step, state your assumptions and why you made them."
|
|
162
|
+
|
|
163
|
+
Poor:
|
|
164
|
+
[Assumes certainty at all steps]
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Complete Examples
|
|
168
|
+
|
|
169
|
+
### Example 1: Debugging
|
|
170
|
+
|
|
171
|
+
**Without CoT:**
|
|
172
|
+
```
|
|
173
|
+
Why isn't this code working?
|
|
174
|
+
[code snippet]
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**With CoT:**
|
|
178
|
+
```
|
|
179
|
+
Debug this code by thinking through it step-by-step:
|
|
180
|
+
|
|
181
|
+
[code snippet]
|
|
182
|
+
|
|
183
|
+
Use this process:
|
|
184
|
+
1. Read the code and state what it's supposed to do
|
|
185
|
+
2. Identify the input and expected output
|
|
186
|
+
3. Trace through execution line by line
|
|
187
|
+
4. Note any suspicious patterns or red flags
|
|
188
|
+
5. Form hypotheses about the bug
|
|
189
|
+
6. Test each hypothesis against the code
|
|
190
|
+
7. Identify the root cause
|
|
191
|
+
8. Propose a fix
|
|
192
|
+
9. Verify the fix addresses the issue
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Example 2: System Design
|
|
196
|
+
|
|
197
|
+
**Without CoT:**
|
|
198
|
+
```
|
|
199
|
+
Design a URL shortener.
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
**With CoT:**
|
|
203
|
+
```
|
|
204
|
+
Design a URL shortener by working through these steps:
|
|
205
|
+
|
|
206
|
+
STEP 1 - REQUIREMENTS:
|
|
207
|
+
Think through what the system needs to do.
|
|
208
|
+
- Functional requirements?
|
|
209
|
+
- Non-functional requirements?
|
|
210
|
+
- Scale expectations?
|
|
211
|
+
|
|
212
|
+
STEP 2 - API DESIGN:
|
|
213
|
+
What endpoints do we need?
|
|
214
|
+
- Consider: creation, retrieval, analytics
|
|
215
|
+
|
|
216
|
+
STEP 3 - DATA MODEL:
|
|
217
|
+
How should we store URLs?
|
|
218
|
+
- What fields are needed?
|
|
219
|
+
- What indexes?
|
|
220
|
+
|
|
221
|
+
STEP 4 - URL GENERATION:
|
|
222
|
+
How do we create short codes?
|
|
223
|
+
- Base62 encoding? Hash? Counter?
|
|
224
|
+
- Collision handling?
|
|
225
|
+
|
|
226
|
+
STEP 5 - SCALABILITY:
|
|
227
|
+
How does this scale?
|
|
228
|
+
- Bottlenecks?
|
|
229
|
+
- Caching strategy?
|
|
230
|
+
- Database sharding?
|
|
231
|
+
|
|
232
|
+
STEP 6 - TRADE-OFFS:
|
|
233
|
+
What are we optimizing for vs. sacrificing?
|
|
234
|
+
|
|
235
|
+
For each step, explain your reasoning.
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Example 3: Decision Making
|
|
239
|
+
|
|
240
|
+
**Without CoT:**
|
|
241
|
+
```
|
|
242
|
+
Should we use MongoDB or PostgreSQL?
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
**With CoT:**
|
|
246
|
+
```
|
|
247
|
+
Decide between MongoDB and PostgreSQL by reasoning through:
|
|
248
|
+
|
|
249
|
+
STEP 1 - USE CASE ANALYSIS:
|
|
250
|
+
What are we building and what data patterns will we have?
|
|
251
|
+
- Data structure (structured/unstructured?)
|
|
252
|
+
- Relationships (complex/simple?)
|
|
253
|
+
- Query patterns (known/unknown?)
|
|
254
|
+
|
|
255
|
+
STEP 2 - MONGODB EVALUATION:
|
|
256
|
+
Pros for our use case:
|
|
257
|
+
[List and explain]
|
|
258
|
+
Cons for our use case:
|
|
259
|
+
[List and explain]
|
|
260
|
+
|
|
261
|
+
STEP 3 - POSTGRESQL EVALUATION:
|
|
262
|
+
Pros for our use case:
|
|
263
|
+
[List and explain]
|
|
264
|
+
Cons for our use case:
|
|
265
|
+
[List and explain]
|
|
266
|
+
|
|
267
|
+
STEP 4 - CRITICAL REQUIREMENTS:
|
|
268
|
+
What are our non-negotiables?
|
|
269
|
+
- [Requirement 1 and why it matters]
|
|
270
|
+
- [Requirement 2 and why it matters]
|
|
271
|
+
|
|
272
|
+
STEP 5 - SCORING:
|
|
273
|
+
Rate each database against our requirements.
|
|
274
|
+
|
|
275
|
+
STEP 6 - DECISION:
|
|
276
|
+
Based on the analysis above, choose one and explain why.
|
|
277
|
+
|
|
278
|
+
STEP 7 - VALIDATE:
|
|
279
|
+
Does this decision make sense? Any red flags?
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
## Combining CoT with Other Frameworks
|
|
283
|
+
|
|
284
|
+
### CoT + CO-STAR
|
|
285
|
+
```
|
|
286
|
+
CONTEXT: [Situation]
|
|
287
|
+
OBJECTIVE: [Goal]
|
|
288
|
+
...
|
|
289
|
+
|
|
290
|
+
PROCESS (Chain of Thought):
|
|
291
|
+
Work through this step-by-step:
|
|
292
|
+
1. [Step 1]
|
|
293
|
+
2. [Step 2]
|
|
294
|
+
...
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### CoT + RISEN
|
|
298
|
+
```
|
|
299
|
+
ROLE: [Expertise]
|
|
300
|
+
INSTRUCTIONS: Use step-by-step reasoning for each stage
|
|
301
|
+
STEPS:
|
|
302
|
+
1. [Step 1] - Think through: [reasoning points]
|
|
303
|
+
2. [Step 2] - Consider: [reasoning points]
|
|
304
|
+
...
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
### CoT + RISE
|
|
308
|
+
```
|
|
309
|
+
ROLE: [Analyst]
|
|
310
|
+
INPUT: [Data]
|
|
311
|
+
STEPS:
|
|
312
|
+
1. [Action] - Reasoning: [Why this step?]
|
|
313
|
+
2. [Action] - Reasoning: [What are we looking for?]
|
|
314
|
+
...
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
## Advanced Techniques
|
|
318
|
+
|
|
319
|
+
### Self-Consistency
|
|
320
|
+
Generate multiple reasoning paths and choose the most common answer:
|
|
321
|
+
|
|
322
|
+
```
|
|
323
|
+
Solve this problem using three different approaches:
|
|
324
|
+
|
|
325
|
+
APPROACH 1:
|
|
326
|
+
[Method 1 with step-by-step reasoning]
|
|
327
|
+
|
|
328
|
+
APPROACH 2:
|
|
329
|
+
[Method 2 with step-by-step reasoning]
|
|
330
|
+
|
|
331
|
+
APPROACH 3:
|
|
332
|
+
[Method 3 with step-by-step reasoning]
|
|
333
|
+
|
|
334
|
+
COMPARISON:
|
|
335
|
+
Which approach is most reliable and why?
|
|
336
|
+
|
|
337
|
+
FINAL ANSWER:
|
|
338
|
+
Based on the most consistent result.
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
### Uncertainty Quantification
|
|
342
|
+
```
|
|
343
|
+
For each step, rate your confidence:
|
|
344
|
+
1. [Step 1] - Confidence: High/Medium/Low - Because: [reason]
|
|
345
|
+
2. [Step 2] - Confidence: High/Medium/Low - Because: [reason]
|
|
346
|
+
|
|
347
|
+
If any step has low confidence, explore alternatives.
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### Backward Chaining
|
|
351
|
+
```
|
|
352
|
+
Start with the desired outcome and work backwards:
|
|
353
|
+
|
|
354
|
+
GOAL: [What we want to achieve]
|
|
355
|
+
|
|
356
|
+
STEP -1: To achieve this, what must be true immediately before?
|
|
357
|
+
STEP -2: To achieve that, what must be true before it?
|
|
358
|
+
STEP -3: Keep working backwards...
|
|
359
|
+
STEP -N: What's our starting point?
|
|
360
|
+
|
|
361
|
+
Now verify the forward path makes sense.
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
## Common Patterns
|
|
365
|
+
|
|
366
|
+
### Mathematical Problem Solving
|
|
367
|
+
```
|
|
368
|
+
1. Understand: Restate the problem in your own words
|
|
369
|
+
2. Identify: What do we know? What do we need to find?
|
|
370
|
+
3. Plan: What formula or approach applies?
|
|
371
|
+
4. Execute: Work through the math step-by-step
|
|
372
|
+
5. Verify: Does the answer make sense? Check units, magnitude
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
### Logical Reasoning
|
|
376
|
+
```
|
|
377
|
+
1. Premises: State what we know to be true
|
|
378
|
+
2. Inference: What can we deduce from premises?
|
|
379
|
+
3. Test: Do our deductions hold up?
|
|
380
|
+
4. Conclusion: What can we conclude?
|
|
381
|
+
5. Verify: Are there any logical fallacies?
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
### Troubleshooting
|
|
385
|
+
```
|
|
386
|
+
1. Observe: What's the symptom?
|
|
387
|
+
2. Hypothesize: What could cause this?
|
|
388
|
+
3. Test: How can we test each hypothesis?
|
|
389
|
+
4. Eliminate: Rule out what doesn't fit
|
|
390
|
+
5. Identify: What's the root cause?
|
|
391
|
+
6. Solve: How do we fix it?
|
|
392
|
+
7. Verify: Did it work?
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
## Quality Indicators
|
|
396
|
+
|
|
397
|
+
**Good CoT reasoning shows:**
|
|
398
|
+
- ✅ Each step builds on previous ones
|
|
399
|
+
- ✅ Assumptions are stated explicitly
|
|
400
|
+
- ✅ Calculations/logic are shown
|
|
401
|
+
- ✅ Intermediate results are verified
|
|
402
|
+
- ✅ Uncertainties are acknowledged
|
|
403
|
+
- ✅ Final answer follows logically
|
|
404
|
+
|
|
405
|
+
**Poor CoT reasoning shows:**
|
|
406
|
+
- ❌ Jumping to conclusions
|
|
407
|
+
- ❌ Skipping intermediate steps
|
|
408
|
+
- ❌ Hiding assumptions
|
|
409
|
+
- ❌ No verification
|
|
410
|
+
- ❌ Unjustified leaps in logic
|
|
411
|
+
|
|
412
|
+
## Assessment Checklist
|
|
413
|
+
|
|
414
|
+
When using Chain of Thought:
|
|
415
|
+
- [ ] Problem is complex enough to warrant CoT
|
|
416
|
+
- [ ] Steps are explicitly requested
|
|
417
|
+
- [ ] Reasoning structure is provided or suggested
|
|
418
|
+
- [ ] Verification is included
|
|
419
|
+
- [ ] Self-correction is encouraged
|
|
420
|
+
- [ ] Each step is actionable
|
|
421
|
+
- [ ] Logic flow is clear
|
|
422
|
+
- [ ] Assumptions are acknowledged
|
|
423
|
+
- [ ] Final answer connects to reasoning
|
|
424
|
+
- [ ] Work shown, not just answer
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
# CO-STAR Framework
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
CO-STAR is a comprehensive prompting framework that emphasizes context, audience, and communication style. It's particularly effective for content creation, writing tasks, and scenarios where tone and audience considerations significantly impact output quality.
|
|
6
|
+
|
|
7
|
+
## Components
|
|
8
|
+
|
|
9
|
+
### C - Context
|
|
10
|
+
**Purpose:** Provide background information, situational details, and constraints.
|
|
11
|
+
|
|
12
|
+
**Questions to Ask:**
|
|
13
|
+
- What's the background situation?
|
|
14
|
+
- What constraints exist?
|
|
15
|
+
- What's happened previously?
|
|
16
|
+
- What environment/platform is this for?
|
|
17
|
+
- Are there any limitations or restrictions?
|
|
18
|
+
|
|
19
|
+
**Examples:**
|
|
20
|
+
- "You're working with a startup that has limited resources..."
|
|
21
|
+
- "This is for a formal government report..."
|
|
22
|
+
- "The user base is primarily non-technical..."
|
|
23
|
+
|
|
24
|
+
### O - Objective
|
|
25
|
+
**Purpose:** Define the clear, specific goal to be achieved.
|
|
26
|
+
|
|
27
|
+
**Questions to Ask:**
|
|
28
|
+
- What exactly do you want accomplished?
|
|
29
|
+
- What does success look like?
|
|
30
|
+
- What's the primary outcome?
|
|
31
|
+
- Are there secondary goals?
|
|
32
|
+
|
|
33
|
+
**Examples:**
|
|
34
|
+
- "Create a comprehensive product comparison..."
|
|
35
|
+
- "Generate ideas for reducing customer churn..."
|
|
36
|
+
- "Explain the concept in simple terms..."
|
|
37
|
+
|
|
38
|
+
### S - Style
|
|
39
|
+
**Purpose:** Specify the writing style, format, and structural preferences.
|
|
40
|
+
|
|
41
|
+
**Questions to Ask:**
|
|
42
|
+
- What writing style is appropriate?
|
|
43
|
+
- Should it be formal or casual?
|
|
44
|
+
- Are there format requirements?
|
|
45
|
+
- Should it follow a specific structure?
|
|
46
|
+
- Any style guides to follow?
|
|
47
|
+
|
|
48
|
+
**Examples:**
|
|
49
|
+
- "Use a journalistic style with short paragraphs..."
|
|
50
|
+
- "Follow AP style guidelines..."
|
|
51
|
+
- "Write in a conversational, blog-post style..."
|
|
52
|
+
|
|
53
|
+
### T - Tone
|
|
54
|
+
**Purpose:** Set the emotional quality and attitude of the response.
|
|
55
|
+
|
|
56
|
+
**Questions to Ask:**
|
|
57
|
+
- What emotional quality should it have?
|
|
58
|
+
- Should it be serious or light-hearted?
|
|
59
|
+
- Authoritative or humble?
|
|
60
|
+
- Urgent or measured?
|
|
61
|
+
|
|
62
|
+
**Examples:**
|
|
63
|
+
- "Professional yet friendly..."
|
|
64
|
+
- "Urgent and action-oriented..."
|
|
65
|
+
- "Empathetic and supportive..."
|
|
66
|
+
- "Confident and authoritative..."
|
|
67
|
+
|
|
68
|
+
### A - Audience
|
|
69
|
+
**Purpose:** Identify who will consume the output and their characteristics.
|
|
70
|
+
|
|
71
|
+
**Questions to Ask:**
|
|
72
|
+
- Who is the target audience?
|
|
73
|
+
- What's their expertise level?
|
|
74
|
+
- What do they care about?
|
|
75
|
+
- What are their pain points?
|
|
76
|
+
- What's their context?
|
|
77
|
+
|
|
78
|
+
**Examples:**
|
|
79
|
+
- "Senior executives with limited technical knowledge..."
|
|
80
|
+
- "Junior developers learning the framework..."
|
|
81
|
+
- "Parents of elementary school children..."
|
|
82
|
+
|
|
83
|
+
### R - Response
|
|
84
|
+
**Purpose:** Define the expected output format and structure.
|
|
85
|
+
|
|
86
|
+
**Questions to Ask:**
|
|
87
|
+
- What format should the output take?
|
|
88
|
+
- How long should it be?
|
|
89
|
+
- Should it include specific sections?
|
|
90
|
+
- Are there structural requirements?
|
|
91
|
+
- What level of detail is needed?
|
|
92
|
+
|
|
93
|
+
**Examples:**
|
|
94
|
+
- "Provide a 500-word article with 3 main sections..."
|
|
95
|
+
- "Create a bulleted list of 10 items..."
|
|
96
|
+
- "Generate a table comparing features..."
|
|
97
|
+
|
|
98
|
+
## Template Structure
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
CONTEXT:
|
|
102
|
+
[Background information, situation, constraints]
|
|
103
|
+
|
|
104
|
+
OBJECTIVE:
|
|
105
|
+
[Clear, specific goal to achieve]
|
|
106
|
+
|
|
107
|
+
STYLE:
|
|
108
|
+
[Writing style, format preferences]
|
|
109
|
+
|
|
110
|
+
TONE:
|
|
111
|
+
[Emotional quality, formality level]
|
|
112
|
+
|
|
113
|
+
AUDIENCE:
|
|
114
|
+
[Target audience characteristics]
|
|
115
|
+
|
|
116
|
+
RESPONSE FORMAT:
|
|
117
|
+
[Expected output structure and format]
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Complete Example
|
|
121
|
+
|
|
122
|
+
### Before CO-STAR:
|
|
123
|
+
"Write about the benefits of exercise."
|
|
124
|
+
|
|
125
|
+
### After CO-STAR:
|
|
126
|
+
```
|
|
127
|
+
CONTEXT:
|
|
128
|
+
I'm creating content for a health blog aimed at busy professionals who struggle to find time for fitness. Previous articles have focused on nutrition, and this is part of a series on lifestyle improvements.
|
|
129
|
+
|
|
130
|
+
OBJECTIVE:
|
|
131
|
+
Create an engaging article that convinces time-pressed professionals that exercise is worth prioritizing, focusing on benefits beyond just physical health.
|
|
132
|
+
|
|
133
|
+
STYLE:
|
|
134
|
+
Use a conversational blog style with short paragraphs (2-3 sentences), subheadings every 150-200 words, and occasional bullet points for key takeaways. Include specific examples and avoid medical jargon.
|
|
135
|
+
|
|
136
|
+
TONE:
|
|
137
|
+
Encouraging and motivating without being preachy. Acknowledge their time constraints and show empathy for their challenges. Be practical and realistic rather than idealistic.
|
|
138
|
+
|
|
139
|
+
AUDIENCE:
|
|
140
|
+
Professionals aged 30-50 who work 50+ hour weeks, have limited free time, may have families, and currently don't exercise regularly. They're skeptical of fitness advice that seems unrealistic for their lifestyle.
|
|
141
|
+
|
|
142
|
+
RESPONSE FORMAT:
|
|
143
|
+
800-word article with:
|
|
144
|
+
- Engaging headline
|
|
145
|
+
- Brief introduction (2-3 sentences)
|
|
146
|
+
- 4-5 main sections with subheadings
|
|
147
|
+
- Bullet points highlighting key benefits
|
|
148
|
+
- Practical conclusion with next steps
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Best Use Cases
|
|
152
|
+
|
|
153
|
+
1. **Content Creation**
|
|
154
|
+
- Blog posts, articles, marketing copy
|
|
155
|
+
- When multiple stakeholders will review
|
|
156
|
+
- When brand voice matters
|
|
157
|
+
|
|
158
|
+
2. **Communication Tasks**
|
|
159
|
+
- Emails to specific audiences
|
|
160
|
+
- Presentations
|
|
161
|
+
- Reports with specific readers
|
|
162
|
+
|
|
163
|
+
3. **Creative Writing**
|
|
164
|
+
- When tone significantly impacts effectiveness
|
|
165
|
+
- When audience understanding is critical
|
|
166
|
+
- When style consistency matters
|
|
167
|
+
|
|
168
|
+
4. **Educational Content**
|
|
169
|
+
- Teaching materials
|
|
170
|
+
- Explanations for specific skill levels
|
|
171
|
+
- Documentation for user groups
|
|
172
|
+
|
|
173
|
+
## Selection Criteria
|
|
174
|
+
|
|
175
|
+
**Choose CO-STAR when:**
|
|
176
|
+
- ✅ Task involves writing or content creation
|
|
177
|
+
- ✅ Multiple stakeholders or diverse audience
|
|
178
|
+
- ✅ Tone and style significantly impact success
|
|
179
|
+
- ✅ Rich contextual requirements exist
|
|
180
|
+
- ✅ Brand or voice consistency matters
|
|
181
|
+
- ✅ Audience characteristics are well-defined
|
|
182
|
+
|
|
183
|
+
**Avoid CO-STAR when:**
|
|
184
|
+
- ❌ Task is purely analytical/technical
|
|
185
|
+
- ❌ Audience doesn't matter
|
|
186
|
+
- ❌ Tone is irrelevant
|
|
187
|
+
- ❌ Simple, quick task without context needs
|
|
188
|
+
- ❌ Format is the only concern
|
|
189
|
+
|
|
190
|
+
## Common Mistakes
|
|
191
|
+
|
|
192
|
+
1. **Too Much Context**
|
|
193
|
+
- Include only relevant background
|
|
194
|
+
- Avoid tangential information
|
|
195
|
+
- Focus on what impacts the task
|
|
196
|
+
|
|
197
|
+
2. **Vague Objective**
|
|
198
|
+
- Be specific about desired outcome
|
|
199
|
+
- Quantify when possible
|
|
200
|
+
- Clarify success criteria
|
|
201
|
+
|
|
202
|
+
3. **Confusing Style and Tone**
|
|
203
|
+
- Style = structural/format choices
|
|
204
|
+
- Tone = emotional quality
|
|
205
|
+
- Keep them separate
|
|
206
|
+
|
|
207
|
+
4. **Generic Audience Description**
|
|
208
|
+
- Be specific about audience characteristics
|
|
209
|
+
- Include their knowledge level
|
|
210
|
+
- Mention their goals/pain points
|
|
211
|
+
|
|
212
|
+
## Variations and Combinations
|
|
213
|
+
|
|
214
|
+
### CO-STAR + Chain of Thought
|
|
215
|
+
Use for complex content that requires reasoning:
|
|
216
|
+
```
|
|
217
|
+
[Standard CO-STAR components]
|
|
218
|
+
|
|
219
|
+
PROCESS:
|
|
220
|
+
Think through this step-by-step:
|
|
221
|
+
1. Identify key themes
|
|
222
|
+
2. Organize supporting evidence
|
|
223
|
+
3. Structure argument flow
|
|
224
|
+
4. Draft with examples
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### CO-STAR + RISEN
|
|
228
|
+
For content creation with specific methodology:
|
|
229
|
+
```
|
|
230
|
+
[Use CO-STAR for context/audience/tone]
|
|
231
|
+
[Use RISEN's Steps for the creation process]
|
|
232
|
+
[Use CO-STAR's Response for output format]
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## Quick Reference
|
|
236
|
+
|
|
237
|
+
| Component | Focus | Key Question |
|
|
238
|
+
|-----------|-------|--------------|
|
|
239
|
+
| Context | Background | "What's the situation?" |
|
|
240
|
+
| Objective | Goal | "What do you want achieved?" |
|
|
241
|
+
| Style | Format/Structure | "How should it be written?" |
|
|
242
|
+
| Tone | Emotional Quality | "What feeling should it convey?" |
|
|
243
|
+
| Audience | Reader | "Who is this for?" |
|
|
244
|
+
| Response | Output | "What should the output look like?" |
|
|
245
|
+
|
|
246
|
+
## Assessment Checklist
|
|
247
|
+
|
|
248
|
+
When applying CO-STAR, verify:
|
|
249
|
+
- [ ] Context provides necessary background without excess
|
|
250
|
+
- [ ] Objective is specific and measurable
|
|
251
|
+
- [ ] Style guidance is clear and actionable
|
|
252
|
+
- [ ] Tone matches audience and objective
|
|
253
|
+
- [ ] Audience is well-defined with characteristics
|
|
254
|
+
- [ ] Response format is detailed and specific
|
|
255
|
+
- [ ] All components work together cohesively
|
|
256
|
+
- [ ] Nothing contradicts other components
|