@ckelsoe/prompt-architect 3.0.2 → 3.1.1

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 (76) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +264 -264
  4. package/LICENSE +21 -21
  5. package/README.md +1064 -1184
  6. package/adapters/README.md +75 -267
  7. package/adapters/for-windsurf.md +136 -136
  8. package/adapters/system-prompt.md +243 -243
  9. package/package.json +139 -138
  10. package/scripts/build-skill.js +64 -0
  11. package/scripts/install.js +4 -54
  12. package/scripts/test.js +205 -213
  13. package/scripts/validate-skill.js +350 -350
  14. package/skills/prompt-architect/SKILL.md +331 -331
  15. package/skills/prompt-architect/assets/templates/ape_template.txt +5 -5
  16. package/skills/prompt-architect/assets/templates/bab_template.txt +15 -15
  17. package/skills/prompt-architect/assets/templates/broke_template.txt +15 -15
  18. package/skills/prompt-architect/assets/templates/cai-critique-revise_template.txt +18 -18
  19. package/skills/prompt-architect/assets/templates/care_template.txt +16 -16
  20. package/skills/prompt-architect/assets/templates/chain-of-density_template.txt +46 -46
  21. package/skills/prompt-architect/assets/templates/chain-of-thought_template.txt +49 -49
  22. package/skills/prompt-architect/assets/templates/co-star_template.txt +17 -17
  23. package/skills/prompt-architect/assets/templates/crispe_template.txt +14 -14
  24. package/skills/prompt-architect/assets/templates/ctf_template.txt +15 -15
  25. package/skills/prompt-architect/assets/templates/devils-advocate_template.txt +25 -25
  26. package/skills/prompt-architect/assets/templates/hybrid_template.txt +101 -101
  27. package/skills/prompt-architect/assets/templates/least-to-most_template.txt +16 -16
  28. package/skills/prompt-architect/assets/templates/plan-and-solve_template.txt +7 -7
  29. package/skills/prompt-architect/assets/templates/pre-mortem_template.txt +27 -27
  30. package/skills/prompt-architect/assets/templates/race_template.txt +19 -19
  31. package/skills/prompt-architect/assets/templates/rcot_template.txt +31 -31
  32. package/skills/prompt-architect/assets/templates/react_template.txt +27 -27
  33. package/skills/prompt-architect/assets/templates/reverse-role_template.txt +11 -11
  34. package/skills/prompt-architect/assets/templates/rise-ie_template.txt +23 -23
  35. package/skills/prompt-architect/assets/templates/rise-ix_template.txt +28 -28
  36. package/skills/prompt-architect/assets/templates/risen_template.txt +21 -21
  37. package/skills/prompt-architect/assets/templates/rpef_template.txt +26 -26
  38. package/skills/prompt-architect/assets/templates/rtf_template.txt +13 -13
  39. package/skills/prompt-architect/assets/templates/self-refine_template.txt +16 -16
  40. package/skills/prompt-architect/assets/templates/skeleton-of-thought_template.txt +15 -15
  41. package/skills/prompt-architect/assets/templates/step-back_template.txt +10 -10
  42. package/skills/prompt-architect/assets/templates/tidd-ec_template.txt +45 -45
  43. package/skills/prompt-architect/assets/templates/tree-of-thought_template.txt +30 -30
  44. package/skills/prompt-architect/references/frameworks/ape.md +200 -200
  45. package/skills/prompt-architect/references/frameworks/bab.md +242 -242
  46. package/skills/prompt-architect/references/frameworks/broke.md +242 -242
  47. package/skills/prompt-architect/references/frameworks/cai-critique-revise.md +230 -230
  48. package/skills/prompt-architect/references/frameworks/care.md +235 -235
  49. package/skills/prompt-architect/references/frameworks/chain-of-density.md +479 -479
  50. package/skills/prompt-architect/references/frameworks/chain-of-thought.md +424 -424
  51. package/skills/prompt-architect/references/frameworks/co-star.md +256 -256
  52. package/skills/prompt-architect/references/frameworks/crispe.md +253 -253
  53. package/skills/prompt-architect/references/frameworks/ctf.md +207 -207
  54. package/skills/prompt-architect/references/frameworks/devils-advocate.md +206 -206
  55. package/skills/prompt-architect/references/frameworks/least-to-most.md +226 -226
  56. package/skills/prompt-architect/references/frameworks/plan-and-solve.md +210 -210
  57. package/skills/prompt-architect/references/frameworks/pre-mortem.md +197 -197
  58. package/skills/prompt-architect/references/frameworks/race.md +243 -243
  59. package/skills/prompt-architect/references/frameworks/rcot.md +203 -203
  60. package/skills/prompt-architect/references/frameworks/react.md +304 -304
  61. package/skills/prompt-architect/references/frameworks/reverse-role.md +189 -189
  62. package/skills/prompt-architect/references/frameworks/rise.md +555 -555
  63. package/skills/prompt-architect/references/frameworks/risen.md +297 -297
  64. package/skills/prompt-architect/references/frameworks/rpef.md +195 -195
  65. package/skills/prompt-architect/references/frameworks/rtf.md +358 -358
  66. package/skills/prompt-architect/references/frameworks/self-refine.md +205 -205
  67. package/skills/prompt-architect/references/frameworks/skeleton-of-thought.md +186 -186
  68. package/skills/prompt-architect/references/frameworks/step-back.md +206 -206
  69. package/skills/prompt-architect/references/frameworks/tidd-ec.md +470 -470
  70. package/skills/prompt-architect/references/frameworks/tree-of-thought.md +260 -260
  71. package/skills/prompt-architect/scripts/framework_analyzer.py +807 -807
  72. package/skills/prompt-architect/scripts/prompt_evaluator.py +336 -336
  73. package/adapters/for-cursor.mdc +0 -138
  74. package/adapters/for-gemini-cli.md +0 -70
  75. package/adapters/for-github-copilot.md +0 -141
  76. package/adapters/for-openai-codex-cli.md +0 -158
@@ -1,210 +1,210 @@
1
- # Plan-and-Solve (PS+) Prompting
2
-
3
- ## Overview
4
-
5
- Plan-and-Solve (PS+) is a zero-shot prompting technique that improves upon standard Chain of Thought by instructing the model to explicitly plan the solution approach before executing it — and to be careful about extracting variables and calculating intermediate results. It requires no examples or demonstrations and consistently outperforms Zero-Shot CoT ("Let's think step by step") on reasoning tasks.
6
-
7
- **Research basis:** "Plan-and-Solve Prompting: Improving Zero-Shot Chain-of-Thought Reasoning by Large Language Models" (Wang et al., ACL 2023, arXiv:2305.04091). Tested across 10 reasoning datasets — consistently outperforms Zero-Shot-CoT and is competitive with few-shot CoT.
8
-
9
- ## The Core Trigger Phrases
10
-
11
- ### PS (Basic):
12
- ```
13
- Let's first understand the problem and devise a plan to solve it.
14
- Then, let's carry out the plan and solve the problem step by step.
15
- ```
16
-
17
- ### PS+ (Enhanced — recommended):
18
- ```
19
- Let's first understand the problem, extract relevant variables and their
20
- corresponding numerals, and devise a complete plan. Then, let's carry out
21
- the plan, calculate intermediate values, pay attention to computation,
22
- and solve the problem step by step.
23
- ```
24
-
25
- The PS+ additions over PS:
26
- 1. **"Extract relevant variables"** — forces the model to identify all given information before starting
27
- 2. **"Calculate intermediate values"** — prevents skipping computational steps
28
- 3. **"Pay attention to computation"** — explicit reminder to be accurate with numbers
29
-
30
- ## Template Structure
31
-
32
- ```
33
- PROBLEM:
34
- [Your problem or question]
35
-
36
- INSTRUCTION:
37
- Let's first understand the problem, extract relevant variables and their
38
- corresponding numerals, and devise a complete plan. Then, let's carry out
39
- the plan, calculate intermediate values, pay attention to computation,
40
- and solve the problem step by step.
41
- ```
42
-
43
- ### Inline Version (append to any question):
44
- ```
45
- [Your question]. Let's first understand the problem, extract relevant
46
- variables and their corresponding numerals, and devise a complete plan.
47
- Then let's carry out the plan, calculate intermediate values, and solve
48
- step by step.
49
- ```
50
-
51
- ## Complete Examples
52
-
53
- ### Example 1: Math / Calculation
54
-
55
- **Before PS+:**
56
- "If a SaaS company has 500 customers at $200/month each, 5% monthly churn, and adds 30 new customers per month, what is the MRR in 6 months?"
57
-
58
- **After PS+:**
59
- ```
60
- PROBLEM:
61
- A SaaS company has 500 customers paying $200/month each. Monthly churn
62
- is 5%. The company acquires 30 new customers per month. What is the MRR
63
- in 6 months?
64
-
65
- Let's first understand the problem, extract relevant variables and their
66
- corresponding numerals, and devise a complete plan. Then, let's carry out
67
- the plan, calculate intermediate values, pay attention to computation,
68
- and solve the problem step by step.
69
- ```
70
-
71
- **Expected model behavior:**
72
- ```
73
- Variables:
74
- - Starting customers: 500
75
- - Monthly price: $200/month
76
- - Monthly churn rate: 5% = 0.05
77
- - Monthly new customers: 30
78
- - Target period: 6 months
79
-
80
- Plan:
81
- 1. Calculate customers lost per month (churn)
82
- 2. Calculate net new customers per month (acquired - churned)
83
- 3. Calculate customer count at end of each month (months 1-6)
84
- 4. Calculate MRR for month 6
85
-
86
- Execution:
87
- Month 0: 500 customers, MRR = $100,000
88
- Month 1: 500 × (1 - 0.05) + 30 = 475 + 30 = 505 customers, MRR = $101,000
89
- Month 2: 505 × 0.95 + 30 = 479.75 + 30 = 509.75 ≈ 510 customers, MRR = $102,000
90
- ...
91
- [continues through month 6]
92
-
93
- Final answer: Month 6 MRR = $X
94
- ```
95
-
96
- ### Example 2: Multi-Step Technical Problem
97
-
98
- **Before PS+:**
99
- "Our API is returning responses in 800ms average. We want to get it under 200ms. What should we do?"
100
-
101
- **After PS+:**
102
- ```
103
- PROBLEM:
104
- Our REST API averages 800ms response time. Target is under 200ms.
105
- The API serves product catalog queries (read-heavy), is Node.js with
106
- PostgreSQL, and currently has no caching layer. Database queries are
107
- the main bottleneck (600ms average per request).
108
-
109
- Let's first understand the problem, extract relevant variables and their
110
- corresponding numerals, and devise a complete plan. Then, let's carry out
111
- the plan and solve step by step.
112
- ```
113
-
114
- ### Example 3: Business Calculation
115
-
116
- **Before PS+:**
117
- "What's our payback period if CAC is $1,200 and average MRR per customer is $150 with 70% gross margin?"
118
-
119
- **After PS+:**
120
- ```
121
- PROBLEM:
122
- Customer Acquisition Cost (CAC): $1,200
123
- Average MRR per customer: $150
124
- Gross margin: 70%
125
-
126
- What is our payback period?
127
-
128
- Let's first understand the problem, extract relevant variables and their
129
- corresponding numerals, and devise a complete plan. Then, let's carry out
130
- the plan, calculate intermediate values, pay attention to computation,
131
- and solve the problem step by step.
132
- ```
133
-
134
- ### Example 4: Logic / Reasoning
135
-
136
- **Before PS+:**
137
- "Given these constraints [complex scheduling problem], is there a valid schedule?"
138
-
139
- **After PS+:**
140
- ```
141
- PROBLEM:
142
- [Complex scheduling problem with constraints]
143
-
144
- Let's first understand the problem, extract all constraints and their
145
- relationships, and devise a complete plan for finding a valid schedule
146
- or proving none exists. Then, let's carry out the plan step by step.
147
- ```
148
-
149
- ## Best Use Cases
150
-
151
- 1. **Numerical Reasoning**
152
- - Financial calculations (MRR, CAC, payback, LTV)
153
- - Math word problems
154
- - Rate/proportion problems
155
- - Statistical computations
156
-
157
- 2. **Multi-Step Technical Problems**
158
- - Performance optimization (where numbers matter)
159
- - Resource estimation
160
- - Capacity planning
161
-
162
- 3. **Logic Problems**
163
- - Constraint satisfaction
164
- - Scheduling
165
- - Eligibility determination
166
-
167
- 4. **Zero-Shot Reasoning Improvement**
168
- - When you don't have few-shot examples
169
- - When vanilla CoT ("think step by step") isn't accurate enough
170
- - Drop-in improvement for any reasoning prompt
171
-
172
- 5. **Any Prompt Where Prior CoT Answers Were Wrong**
173
- - PS+ reduces calculation errors
174
- - Forces variable extraction before calculation
175
- - Reduces "skipped step" errors
176
-
177
- ## Selection Criteria
178
-
179
- **Choose PS+ when:**
180
- - ✅ Numerical calculation involved
181
- - ✅ Multi-step reasoning with intermediate values
182
- - ✅ No few-shot examples available (zero-shot context)
183
- - ✅ Prior CoT attempts gave calculation errors
184
- - ✅ Variables need explicit extraction before solving
185
-
186
- **Avoid PS+ when:**
187
- - ❌ Task is not a reasoning/calculation problem → use other frameworks
188
- - ❌ Few-shot examples are available → consider manual CoT instead
189
- - ❌ Problem requires branching (multiple approaches) → use Tree of Thought
190
- - ❌ Compositional multi-hop → use Least-to-Most
191
-
192
- ## PS+ vs. Chain of Thought vs. Least-to-Most
193
-
194
- | | Zero-Shot CoT | PS+ | Least-to-Most |
195
- |---|---|---|---|
196
- | Trigger | "Think step by step" | "Plan first, then execute" | Decompose → solve sequentially |
197
- | Variable extraction | No | Yes (explicit) | Partial |
198
- | Planning step | No | Yes (explicit) | Decomposition step |
199
- | Best for | General reasoning | Numerical/variable problems | Compositional multi-hop |
200
- | Few-shot needed | No | No | Optional |
201
-
202
- ## Quick Reference
203
-
204
- | Component | Purpose |
205
- |-----------|---------|
206
- | Understand problem | Ensure full comprehension before starting |
207
- | Extract variables | Identify all given values explicitly |
208
- | Devise plan | State the approach before executing |
209
- | Calculate intermediates | Show all calculation steps |
210
- | Solve step by step | Execute the plan with attention to detail |
1
+ # Plan-and-Solve (PS+) Prompting
2
+
3
+ ## Overview
4
+
5
+ Plan-and-Solve (PS+) is a zero-shot prompting technique that improves upon standard Chain of Thought by instructing the model to explicitly plan the solution approach before executing it — and to be careful about extracting variables and calculating intermediate results. It requires no examples or demonstrations and consistently outperforms Zero-Shot CoT ("Let's think step by step") on reasoning tasks.
6
+
7
+ **Research basis:** "Plan-and-Solve Prompting: Improving Zero-Shot Chain-of-Thought Reasoning by Large Language Models" (Wang et al., ACL 2023, arXiv:2305.04091). Tested across 10 reasoning datasets — consistently outperforms Zero-Shot-CoT and is competitive with few-shot CoT.
8
+
9
+ ## The Core Trigger Phrases
10
+
11
+ ### PS (Basic):
12
+ ```
13
+ Let's first understand the problem and devise a plan to solve it.
14
+ Then, let's carry out the plan and solve the problem step by step.
15
+ ```
16
+
17
+ ### PS+ (Enhanced — recommended):
18
+ ```
19
+ Let's first understand the problem, extract relevant variables and their
20
+ corresponding numerals, and devise a complete plan. Then, let's carry out
21
+ the plan, calculate intermediate values, pay attention to computation,
22
+ and solve the problem step by step.
23
+ ```
24
+
25
+ The PS+ additions over PS:
26
+ 1. **"Extract relevant variables"** — forces the model to identify all given information before starting
27
+ 2. **"Calculate intermediate values"** — prevents skipping computational steps
28
+ 3. **"Pay attention to computation"** — explicit reminder to be accurate with numbers
29
+
30
+ ## Template Structure
31
+
32
+ ```
33
+ PROBLEM:
34
+ [Your problem or question]
35
+
36
+ INSTRUCTION:
37
+ Let's first understand the problem, extract relevant variables and their
38
+ corresponding numerals, and devise a complete plan. Then, let's carry out
39
+ the plan, calculate intermediate values, pay attention to computation,
40
+ and solve the problem step by step.
41
+ ```
42
+
43
+ ### Inline Version (append to any question):
44
+ ```
45
+ [Your question]. Let's first understand the problem, extract relevant
46
+ variables and their corresponding numerals, and devise a complete plan.
47
+ Then let's carry out the plan, calculate intermediate values, and solve
48
+ step by step.
49
+ ```
50
+
51
+ ## Complete Examples
52
+
53
+ ### Example 1: Math / Calculation
54
+
55
+ **Before PS+:**
56
+ "If a SaaS company has 500 customers at $200/month each, 5% monthly churn, and adds 30 new customers per month, what is the MRR in 6 months?"
57
+
58
+ **After PS+:**
59
+ ```
60
+ PROBLEM:
61
+ A SaaS company has 500 customers paying $200/month each. Monthly churn
62
+ is 5%. The company acquires 30 new customers per month. What is the MRR
63
+ in 6 months?
64
+
65
+ Let's first understand the problem, extract relevant variables and their
66
+ corresponding numerals, and devise a complete plan. Then, let's carry out
67
+ the plan, calculate intermediate values, pay attention to computation,
68
+ and solve the problem step by step.
69
+ ```
70
+
71
+ **Expected model behavior:**
72
+ ```
73
+ Variables:
74
+ - Starting customers: 500
75
+ - Monthly price: $200/month
76
+ - Monthly churn rate: 5% = 0.05
77
+ - Monthly new customers: 30
78
+ - Target period: 6 months
79
+
80
+ Plan:
81
+ 1. Calculate customers lost per month (churn)
82
+ 2. Calculate net new customers per month (acquired - churned)
83
+ 3. Calculate customer count at end of each month (months 1-6)
84
+ 4. Calculate MRR for month 6
85
+
86
+ Execution:
87
+ Month 0: 500 customers, MRR = $100,000
88
+ Month 1: 500 × (1 - 0.05) + 30 = 475 + 30 = 505 customers, MRR = $101,000
89
+ Month 2: 505 × 0.95 + 30 = 479.75 + 30 = 509.75 ≈ 510 customers, MRR = $102,000
90
+ ...
91
+ [continues through month 6]
92
+
93
+ Final answer: Month 6 MRR = $X
94
+ ```
95
+
96
+ ### Example 2: Multi-Step Technical Problem
97
+
98
+ **Before PS+:**
99
+ "Our API is returning responses in 800ms average. We want to get it under 200ms. What should we do?"
100
+
101
+ **After PS+:**
102
+ ```
103
+ PROBLEM:
104
+ Our REST API averages 800ms response time. Target is under 200ms.
105
+ The API serves product catalog queries (read-heavy), is Node.js with
106
+ PostgreSQL, and currently has no caching layer. Database queries are
107
+ the main bottleneck (600ms average per request).
108
+
109
+ Let's first understand the problem, extract relevant variables and their
110
+ corresponding numerals, and devise a complete plan. Then, let's carry out
111
+ the plan and solve step by step.
112
+ ```
113
+
114
+ ### Example 3: Business Calculation
115
+
116
+ **Before PS+:**
117
+ "What's our payback period if CAC is $1,200 and average MRR per customer is $150 with 70% gross margin?"
118
+
119
+ **After PS+:**
120
+ ```
121
+ PROBLEM:
122
+ Customer Acquisition Cost (CAC): $1,200
123
+ Average MRR per customer: $150
124
+ Gross margin: 70%
125
+
126
+ What is our payback period?
127
+
128
+ Let's first understand the problem, extract relevant variables and their
129
+ corresponding numerals, and devise a complete plan. Then, let's carry out
130
+ the plan, calculate intermediate values, pay attention to computation,
131
+ and solve the problem step by step.
132
+ ```
133
+
134
+ ### Example 4: Logic / Reasoning
135
+
136
+ **Before PS+:**
137
+ "Given these constraints [complex scheduling problem], is there a valid schedule?"
138
+
139
+ **After PS+:**
140
+ ```
141
+ PROBLEM:
142
+ [Complex scheduling problem with constraints]
143
+
144
+ Let's first understand the problem, extract all constraints and their
145
+ relationships, and devise a complete plan for finding a valid schedule
146
+ or proving none exists. Then, let's carry out the plan step by step.
147
+ ```
148
+
149
+ ## Best Use Cases
150
+
151
+ 1. **Numerical Reasoning**
152
+ - Financial calculations (MRR, CAC, payback, LTV)
153
+ - Math word problems
154
+ - Rate/proportion problems
155
+ - Statistical computations
156
+
157
+ 2. **Multi-Step Technical Problems**
158
+ - Performance optimization (where numbers matter)
159
+ - Resource estimation
160
+ - Capacity planning
161
+
162
+ 3. **Logic Problems**
163
+ - Constraint satisfaction
164
+ - Scheduling
165
+ - Eligibility determination
166
+
167
+ 4. **Zero-Shot Reasoning Improvement**
168
+ - When you don't have few-shot examples
169
+ - When vanilla CoT ("think step by step") isn't accurate enough
170
+ - Drop-in improvement for any reasoning prompt
171
+
172
+ 5. **Any Prompt Where Prior CoT Answers Were Wrong**
173
+ - PS+ reduces calculation errors
174
+ - Forces variable extraction before calculation
175
+ - Reduces "skipped step" errors
176
+
177
+ ## Selection Criteria
178
+
179
+ **Choose PS+ when:**
180
+ - ✅ Numerical calculation involved
181
+ - ✅ Multi-step reasoning with intermediate values
182
+ - ✅ No few-shot examples available (zero-shot context)
183
+ - ✅ Prior CoT attempts gave calculation errors
184
+ - ✅ Variables need explicit extraction before solving
185
+
186
+ **Avoid PS+ when:**
187
+ - ❌ Task is not a reasoning/calculation problem → use other frameworks
188
+ - ❌ Few-shot examples are available → consider manual CoT instead
189
+ - ❌ Problem requires branching (multiple approaches) → use Tree of Thought
190
+ - ❌ Compositional multi-hop → use Least-to-Most
191
+
192
+ ## PS+ vs. Chain of Thought vs. Least-to-Most
193
+
194
+ | | Zero-Shot CoT | PS+ | Least-to-Most |
195
+ |---|---|---|---|
196
+ | Trigger | "Think step by step" | "Plan first, then execute" | Decompose → solve sequentially |
197
+ | Variable extraction | No | Yes (explicit) | Partial |
198
+ | Planning step | No | Yes (explicit) | Decomposition step |
199
+ | Best for | General reasoning | Numerical/variable problems | Compositional multi-hop |
200
+ | Few-shot needed | No | No | Optional |
201
+
202
+ ## Quick Reference
203
+
204
+ | Component | Purpose |
205
+ |-----------|---------|
206
+ | Understand problem | Ensure full comprehension before starting |
207
+ | Extract variables | Identify all given values explicitly |
208
+ | Devise plan | State the approach before executing |
209
+ | Calculate intermediates | Show all calculation steps |
210
+ | Solve step by step | Execute the plan with attention to detail |