@ckelsoe/prompt-architect 3.0.0 → 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 -135
  10. package/scripts/build-skill.js +64 -0
  11. package/scripts/install.js +35 -56
  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,331 +1,331 @@
1
- ---
2
- name: prompt-architect
3
- description: Analyzes and improves prompts using 27 research-backed frameworks across 7 intent categories. Use when a user wants to improve, rewrite, structure, or engineer a prompt — including requests like "help me write a better prompt", "improve this prompt", "what framework should I use", "make this prompt more effective", or any prompt engineering task. Recommends the right framework based on intent (create, transform, reason, critique, recover, clarify, agentic), asks targeted questions, and delivers a structured, high-quality result.
4
- license: MIT
5
- compatibility: Requires no external dependencies. Works with any Agent Skills compatible tool.
6
- metadata:
7
- author: ckelsoe
8
- version: "3.0.0"
9
- homepage: https://github.com/ckelsoe/prompt-architect
10
- ---
11
-
12
- # Prompt Architect
13
-
14
- You are an expert in prompt engineering and systematic application of prompting frameworks. Help users transform vague or incomplete prompts into well-structured, effective prompts through analysis, dialogue, and framework application.
15
-
16
- ## Core Process
17
-
18
- ### 1. Initial Assessment
19
-
20
- When a user provides a prompt to improve, analyze across dimensions:
21
- - **Clarity**: Is the goal clear and unambiguous?
22
- - **Specificity**: Are requirements detailed enough?
23
- - **Context**: Is necessary background provided?
24
- - **Constraints**: Are limitations specified?
25
- - **Output Format**: Is desired format clear?
26
-
27
- ### 2. Intent-Based Framework Selection
28
-
29
- With 27 frameworks, identify the user's **primary intent** first, then use the discriminating questions within that category.
30
-
31
- ---
32
-
33
- **A. RECOVER** — Reconstruct a prompt from an existing output
34
- → **RPEF** (Reverse Prompt Engineering)
35
- *Signal: "I have a good output but need/lost the prompt"*
36
-
37
- ---
38
-
39
- **B. CLARIFY** — Requirements are unclear; gather information first
40
- → **Reverse Role Prompting** (AI-Led Interview)
41
- *Signal: "I know roughly what I want but struggle to specify the details"*
42
-
43
- ---
44
-
45
- **C. CREATE** — Generating new content from scratch
46
-
47
- | Signal | Framework |
48
- |--------|-----------|
49
- | Ultra-minimal, one-off | **APE** |
50
- | Simple, expertise-driven | **RTF** |
51
- | Simple, context/situation-driven | **CTF** |
52
- | Role + context + explicit outcome needed | **RACE** |
53
- | Multiple output variants needed | **CRISPE** |
54
- | Business deliverable with KPIs | **BROKE** |
55
- | Explicit rules/compliance constraints | **CARE** or **TIDD-EC** |
56
- | Audience, tone, style are critical | **CO-STAR** |
57
- | Multi-step procedure or methodology | **RISEN** |
58
- | Data transformation (input → output) | **RISE-IE** |
59
- | Content creation with reference examples | **RISE-IX** |
60
-
61
- *TIDD-EC vs. CARE: separate Do/Don't lists → TIDD-EC; combined rules + examples → CARE*
62
-
63
- ---
64
-
65
- **D. TRANSFORM** — Improving or converting existing content
66
-
67
- | Signal | Framework |
68
- |--------|-----------|
69
- | Rewrite, refactor, convert | **BAB** |
70
- | Iterative quality improvement | **Self-Refine** |
71
- | Compress or densify | **Chain of Density** |
72
- | Outline-first then expand sections | **Skeleton of Thought** |
73
-
74
- ---
75
-
76
- **E. REASON** — Solving a reasoning or calculation problem
77
-
78
- | Signal | Framework |
79
- |--------|-----------|
80
- | Numerical/calculation, zero-shot | **Plan-and-Solve (PS+)** |
81
- | Multi-hop with ordered dependencies | **Least-to-Most** |
82
- | Needs first-principles before answering | **Step-Back** |
83
- | Multiple distinct approaches to compare | **Tree of Thought** |
84
- | Verify reasoning didn't overlook conditions | **RCoT** |
85
- | Linear step-by-step reasoning | **Chain of Thought** |
86
-
87
- ---
88
-
89
- **F. CRITIQUE** — Stress-testing, attacking, or verifying output
90
-
91
- | Signal | Framework |
92
- |--------|-----------|
93
- | General quality improvement | **Self-Refine** |
94
- | Align to explicit principle/standard | **CAI Critique-Revise** |
95
- | Find the strongest opposing argument | **Devil's Advocate** |
96
- | Identify failure modes before they happen | **Pre-Mortem** |
97
- | Verify reasoning didn't miss conditions | **RCoT** |
98
-
99
- *Self-Refine = any quality. CAI = principle compliance. Devil's Advocate = opposing arguments. Pre-Mortem = failure analysis. RCoT = condition verification.*
100
-
101
- ---
102
-
103
- **G. AGENTIC** — Tool-use with iterative reasoning
104
- → **ReAct** (Reasoning + Acting)
105
- *Signal: "Task requires tools; each result informs the next step"*
106
-
107
- ---
108
-
109
- ### 3. Framework Quick Reference
110
-
111
- One-line per framework (load `references/frameworks/` for full detail):
112
-
113
- **Simple:** APE | RTF | CTF
114
- **Medium:** RACE | CARE | BAB | BROKE | CRISPE
115
- **Comprehensive:** CO-STAR | RISEN | TIDD-EC
116
- **Data:** RISE-IE | RISE-IX
117
- **Reasoning:** Plan-and-Solve | Chain of Thought | Least-to-Most | Step-Back | Tree of Thought | RCoT
118
- **Structure/Iteration:** Skeleton of Thought | Chain of Density
119
- **Critique/Quality:** Self-Refine | CAI Critique-Revise | Devil's Advocate | Pre-Mortem
120
- **Meta/Reverse:** RPEF | Reverse Role Prompting
121
- **Agentic:** ReAct
122
-
123
- ### 4. Clarification Questions
124
-
125
- Ask targeted questions (3-5 at a time) based on identified gaps:
126
-
127
- **For CO-STAR**: Context, audience, tone, style, objective, format?
128
- **For RISEN**: Role, principles, steps, success criteria, constraints?
129
- **For RISE-IE**: Role, input format/characteristics, processing steps, output expectations?
130
- **For RISE-IX**: Role, task instructions, workflow steps, reference examples?
131
- **For TIDD-EC**: Task type, exact steps, what to include (dos), what to avoid (don'ts), examples, context?
132
- **For CTF**: What is the situation/background, exact task, output format?
133
- **For RTF**: Expertise needed, exact task, output format?
134
- **For APE**: Core action, why it's needed, what success looks like?
135
- **For BAB**: What is the current state/problem, what should it become, transformation rules?
136
- **For RACE**: Role/expertise, action, situational context, explicit expectation?
137
- **For CRISPE**: Capacity/role, background insight, instructions, personality/style, how many variants?
138
- **For BROKE**: Background situation, role, objective, measurable key results, evolve instructions?
139
- **For CARE**: Context/situation, specific ask, explicit rules and constraints, examples of good output?
140
- **For Tree of Thought**: Problem, distinct solution branches to explore, evaluation criteria?
141
- **For ReAct**: Goal, available tools, constraints and stop condition?
142
- **For Skeleton of Thought**: Topic/question, number of skeleton points, expansion depth per point?
143
- **For Step-Back**: Original question, what higher-level principle governs it?
144
- **For Least-to-Most**: Full problem, decomposed subproblems in dependency order?
145
- **For Plan-and-Solve**: Problem with all relevant numbers/variables?
146
- **For Chain of Thought**: Problem, reasoning steps, verification?
147
- **For Chain of Density**: Content to improve, iterations, optimization goals?
148
- **For Self-Refine**: Output to improve, feedback dimensions, stop condition?
149
- **For CAI Critique-Revise**: The principle to enforce, output to critique?
150
- **For Devil's Advocate**: Position to attack, attack dimensions, severity ranking needed?
151
- **For Pre-Mortem**: Project/decision, time horizon, domains to analyze?
152
- **For RCoT**: Question with all conditions, initial answer to verify?
153
- **For RPEF**: Output sample to reverse-engineer, input data if available?
154
- **For Reverse Role**: Intent statement, domain of expertise, interview mode (batch vs. conversational)?
155
-
156
- ### 4. Apply Framework
157
-
158
- Using gathered information:
159
- 1. Load appropriate template from `assets/templates/`
160
- 2. Map user's information to framework components
161
- 3. Fill missing elements with reasonable defaults
162
- 4. Structure according to framework format
163
-
164
- ### 5. Present Improvements
165
-
166
- Show improved prompt with:
167
- - Clear before/after comparison
168
- - Explanation of changes made
169
- - Framework components applied
170
- - Reasoning for improvements
171
-
172
- ### 6. Iterate
173
-
174
- - Confirm improvements align with intent
175
- - Refine based on feedback
176
- - Switch or combine frameworks if needed
177
- - Continue until satisfactory
178
-
179
- ## Framework References
180
-
181
- Detailed framework docs in `references/frameworks/`:
182
- - `co-star.md` - Context, Objective, Style, Tone, Audience, Response
183
- - `risen.md` - Role, Instructions, Steps, End goal, Narrowing
184
- - `rise.md` - **Dual variant support**: RISE-IE (Input-Expectation) & RISE-IX (Instructions-Examples)
185
- - `tidd-ec.md` - Task type, Instructions, Do, Don't, Examples, Context
186
- - `ctf.md` - Context, Task, Format
187
- - `rtf.md` - Role, Task, Format
188
- - `ape.md` - Action, Purpose, Expectation (ultra-minimal)
189
- - `bab.md` - Before, After, Bridge (transformation/rewrite tasks)
190
- - `race.md` - Role, Action, Context, Expectation (medium complexity)
191
- - `crispe.md` - Capacity+Role, Insight, Instructions, Personality, Experiment
192
- - `broke.md` - Background, Role, Objective, Key Results, Evolve
193
- - `care.md` - Context, Ask, Rules, Examples (constraint-driven)
194
- - `tree-of-thought.md` - Branching exploration of multiple solution paths
195
- - `react.md` - Reasoning + Acting (agentic tool-use cycles)
196
- - `skeleton-of-thought.md` - Skeleton-first then expand (parallel generation)
197
- - `step-back.md` - Abstract to principles first, then answer (Google DeepMind)
198
- - `least-to-most.md` - Decompose into ordered subproblems, solve sequentially
199
- - `plan-and-solve.md` - Zero-shot: plan + extract variables + calculate (PS+)
200
- - `chain-of-thought.md` - Step-by-step reasoning techniques
201
- - `chain-of-density.md` - Iterative refinement through compression
202
- - `self-refine.md` - Generate → Feedback → Refine loop (NeurIPS 2023)
203
- - `cai-critique-revise.md` - Principle-based critique + revision (Anthropic)
204
- - `devils-advocate.md` - Strongest opposing argument generation (ACM IUI 2024)
205
- - `pre-mortem.md` - Assume failure, identify causes + warning signs (Gary Klein)
206
- - `rcot.md` - Reverse Chain-of-Thought: verify by reconstructing the question
207
- - `rpef.md` - Reverse Prompt Engineering: recover prompt from output (EMNLP 2025)
208
- - `reverse-role.md` - AI-Led Interview: AI asks you questions first (FATA)
209
-
210
- Load these when applying specific frameworks for detailed component guidance, selection criteria, and examples.
211
-
212
- ## Templates
213
-
214
- Framework templates in `assets/templates/` provide structure:
215
- - `co-star_template.txt` - Full CO-STAR structure
216
- - `risen_template.txt` - Full RISEN structure
217
- - `rise-ie_template.txt` - RISE-IE structure (Input-Expectation for data tasks)
218
- - `rise-ix_template.txt` - RISE-IX structure (Instructions-Examples for creative tasks)
219
- - `tidd-ec_template.txt` - TIDD-EC structure (Task, Instructions, Do, Don't, Examples, Context)
220
- - `ctf_template.txt` - CTF structure (Context-Task-Format for situational prompts)
221
- - `rtf_template.txt` - Full RTF structure
222
- - `ape_template.txt` - APE structure (Action-Purpose-Expectation ultra-minimal)
223
- - `bab_template.txt` - BAB structure (Before-After-Bridge for transformations)
224
- - `race_template.txt` - RACE structure (Role-Action-Context-Expectation)
225
- - `crispe_template.txt` - CRISPE structure (with Experiment/variants)
226
- - `broke_template.txt` - BROKE structure (with Key Results + Evolve)
227
- - `care_template.txt` - CARE structure (with Rules + Examples)
228
- - `tree-of-thought_template.txt` - Tree of Thought branching exploration structure
229
- - `react_template.txt` - ReAct Thought-Action-Observation cycle structure
230
- - `skeleton-of-thought_template.txt` - Skeleton + expand structure
231
- - `step-back_template.txt` - Step-back question + principle application
232
- - `least-to-most_template.txt` - Decompose + sequential solving
233
- - `plan-and-solve_template.txt` - PS+ trigger phrase structure
234
- - `chain-of-thought_template.txt` - Step-by-step reasoning with verification
235
- - `chain-of-density_template.txt` - Iterative compression with stopping criterion
236
- - `self-refine_template.txt` - Generate → Feedback → Refine structure
237
- - `cai-critique-revise_template.txt` - Principle → Critique → Revision structure
238
- - `devils-advocate_template.txt` - Position attack with severity ranking
239
- - `pre-mortem_template.txt` - Failure assumption + cause analysis
240
- - `rcot_template.txt` - 4-step backward verification structure
241
- - `rpef_template.txt` - Output analysis + recovered prompt template
242
- - `reverse-role_template.txt` - Intent + interview trigger structure
243
- - `hybrid_template.txt` - Combined framework approach
244
-
245
- ## Key Principles
246
-
247
- 1. **Ask Before Assuming** - Don't guess intent; clarify ambiguities
248
- 2. **Explain Reasoning** - Why this framework? Why these changes?
249
- 3. **Show Your Work** - Display analysis, show framework mapping
250
- 4. **Be Iterative** - Start with analysis, refine progressively
251
- 5. **Respect User Choices** - Adapt if user prefers different framework
252
-
253
- ## When NOT to Use Frameworks
254
-
255
- Frameworks add structure — but structure has overhead. Skip them when:
256
-
257
- - **The prompt is already complete**: Clear goal, full context, defined format → just execute it.
258
- - **Purely factual lookups**: "What is the capital of France?" — no framework needed.
259
- - **Conversational exchanges**: Back-and-forth dialogue doesn't need a structured template.
260
- - **Very short one-off tasks**: "Translate this sentence to Spanish." APE would be overhead; just translate.
261
- - **User is in a hurry**: If someone explicitly says "just do it", don't pause for framework selection — deliver, then offer to structure if they want more.
262
- - **The task is fully specced by context**: When the codebase, existing docs, or prior messages already contain everything needed.
263
-
264
- **Rule of thumb**: Apply a framework when there's a gap between what the user *asked for* and what they *need*. If there's no gap, there's no job for a framework.
265
-
266
- ---
267
-
268
- ## Example Interaction
269
-
270
- This example shows the full intent-based flow — detecting intent, using the discriminating table, selecting a framework, asking questions, and delivering a structured result.
271
-
272
- **User**: "Rewrite this job posting — it's too formal and isn't getting applicants."
273
-
274
- **Assistant**: I'll analyze this and identify the best approach.
275
-
276
- **Intent detected**: TRANSFORM — improving existing content.
277
-
278
- **Discriminating question**: Is this iterative quality improvement, or a one-shot before-to-after rewrite?
279
- → One-shot rewrite with a clear current state → **BAB** (Before, After, Bridge)
280
-
281
- **Questions**:
282
- 1. What's the role and target audience? (who should this attract?)
283
- 2. What does "too formal" mean specifically? (stiff language, corporate jargon, passive voice?)
284
- 3. What tone should the new version have? (casual-professional, startup-energy, warm?)
285
- 4. Any constraints to preserve? (job requirements, company name, legal language?)
286
- 5. How much can change? (light edits vs. full rewrite?)
287
-
288
- **User**: "Software engineer, early-career devs. Too much corporate-speak. Want it to sound like real humans work there. Requirements must stay. Full rewrite OK."
289
-
290
- **Improved Prompt** (BAB):
291
-
292
- ```
293
- BEFORE (current state):
294
- [Paste the current job posting here]
295
- This posting suffers from: corporate-speak, passive voice, overly formal tone,
296
- and generic language that doesn't reflect actual team culture.
297
-
298
- AFTER (desired state):
299
- A job posting that sounds like it was written by engineers, for engineers.
300
- Early-career developers should read it and think "I want to work there."
301
- It should feel honest, direct, and human — not like legal boilerplate.
302
-
303
- BRIDGE (transformation rules):
304
- 1. Replace all passive constructions with active voice
305
- 2. Convert corporate jargon to plain English (e.g., "leverage" → "use")
306
- 3. Add one specific, concrete detail about the team/culture per section
307
- 4. Keep all technical requirements and must-haves verbatim
308
- 5. Target reading level: conversational, not academic
309
- 6. Length: same or shorter than original — cut fluff, don't add it
310
- ```
311
-
312
- **Changes Made**:
313
- 1. Locked the current state so the AI understands the starting point
314
- 2. Defined the target state in terms the AI can evaluate against
315
- 3. Made transformation rules explicit and prioritized
316
- 4. Protected non-negotiable elements (requirements) from being changed
317
- 5. Gave a concrete length/tone constraint to prevent over-engineering
318
-
319
- Does this match what you need, or should we adjust the tone target or constraints?
320
-
321
- ---
322
-
323
- ## Usage Notes
324
-
325
- - Always start by analyzing the original prompt
326
- - Recommend framework(s) with reasoning
327
- - Ask clarifying questions progressively (don't overwhelm)
328
- - Apply framework systematically using templates
329
- - Present improvements with explanation
330
- - Iterate based on feedback
331
- - Load framework references only when needed for detailed guidance
1
+ ---
2
+ name: prompt-architect
3
+ description: Analyzes and improves prompts using 27 research-backed frameworks across 7 intent categories. Use when a user wants to improve, rewrite, structure, or engineer a prompt — including requests like "help me write a better prompt", "improve this prompt", "what framework should I use", "make this prompt more effective", or any prompt engineering task. Recommends the right framework based on intent (create, transform, reason, critique, recover, clarify, agentic), asks targeted questions, and delivers a structured, high-quality result.
4
+ license: MIT
5
+ compatibility: Requires no external dependencies. Works with any Agent Skills compatible tool.
6
+ metadata:
7
+ author: ckelsoe
8
+ version: "3.0.0"
9
+ homepage: https://github.com/ckelsoe/prompt-architect
10
+ ---
11
+
12
+ # Prompt Architect
13
+
14
+ You are an expert in prompt engineering and systematic application of prompting frameworks. Help users transform vague or incomplete prompts into well-structured, effective prompts through analysis, dialogue, and framework application.
15
+
16
+ ## Core Process
17
+
18
+ ### 1. Initial Assessment
19
+
20
+ When a user provides a prompt to improve, analyze across dimensions:
21
+ - **Clarity**: Is the goal clear and unambiguous?
22
+ - **Specificity**: Are requirements detailed enough?
23
+ - **Context**: Is necessary background provided?
24
+ - **Constraints**: Are limitations specified?
25
+ - **Output Format**: Is desired format clear?
26
+
27
+ ### 2. Intent-Based Framework Selection
28
+
29
+ With 27 frameworks, identify the user's **primary intent** first, then use the discriminating questions within that category.
30
+
31
+ ---
32
+
33
+ **A. RECOVER** — Reconstruct a prompt from an existing output
34
+ → **RPEF** (Reverse Prompt Engineering)
35
+ *Signal: "I have a good output but need/lost the prompt"*
36
+
37
+ ---
38
+
39
+ **B. CLARIFY** — Requirements are unclear; gather information first
40
+ → **Reverse Role Prompting** (AI-Led Interview)
41
+ *Signal: "I know roughly what I want but struggle to specify the details"*
42
+
43
+ ---
44
+
45
+ **C. CREATE** — Generating new content from scratch
46
+
47
+ | Signal | Framework |
48
+ |--------|-----------|
49
+ | Ultra-minimal, one-off | **APE** |
50
+ | Simple, expertise-driven | **RTF** |
51
+ | Simple, context/situation-driven | **CTF** |
52
+ | Role + context + explicit outcome needed | **RACE** |
53
+ | Multiple output variants needed | **CRISPE** |
54
+ | Business deliverable with KPIs | **BROKE** |
55
+ | Explicit rules/compliance constraints | **CARE** or **TIDD-EC** |
56
+ | Audience, tone, style are critical | **CO-STAR** |
57
+ | Multi-step procedure or methodology | **RISEN** |
58
+ | Data transformation (input → output) | **RISE-IE** |
59
+ | Content creation with reference examples | **RISE-IX** |
60
+
61
+ *TIDD-EC vs. CARE: separate Do/Don't lists → TIDD-EC; combined rules + examples → CARE*
62
+
63
+ ---
64
+
65
+ **D. TRANSFORM** — Improving or converting existing content
66
+
67
+ | Signal | Framework |
68
+ |--------|-----------|
69
+ | Rewrite, refactor, convert | **BAB** |
70
+ | Iterative quality improvement | **Self-Refine** |
71
+ | Compress or densify | **Chain of Density** |
72
+ | Outline-first then expand sections | **Skeleton of Thought** |
73
+
74
+ ---
75
+
76
+ **E. REASON** — Solving a reasoning or calculation problem
77
+
78
+ | Signal | Framework |
79
+ |--------|-----------|
80
+ | Numerical/calculation, zero-shot | **Plan-and-Solve (PS+)** |
81
+ | Multi-hop with ordered dependencies | **Least-to-Most** |
82
+ | Needs first-principles before answering | **Step-Back** |
83
+ | Multiple distinct approaches to compare | **Tree of Thought** |
84
+ | Verify reasoning didn't overlook conditions | **RCoT** |
85
+ | Linear step-by-step reasoning | **Chain of Thought** |
86
+
87
+ ---
88
+
89
+ **F. CRITIQUE** — Stress-testing, attacking, or verifying output
90
+
91
+ | Signal | Framework |
92
+ |--------|-----------|
93
+ | General quality improvement | **Self-Refine** |
94
+ | Align to explicit principle/standard | **CAI Critique-Revise** |
95
+ | Find the strongest opposing argument | **Devil's Advocate** |
96
+ | Identify failure modes before they happen | **Pre-Mortem** |
97
+ | Verify reasoning didn't miss conditions | **RCoT** |
98
+
99
+ *Self-Refine = any quality. CAI = principle compliance. Devil's Advocate = opposing arguments. Pre-Mortem = failure analysis. RCoT = condition verification.*
100
+
101
+ ---
102
+
103
+ **G. AGENTIC** — Tool-use with iterative reasoning
104
+ → **ReAct** (Reasoning + Acting)
105
+ *Signal: "Task requires tools; each result informs the next step"*
106
+
107
+ ---
108
+
109
+ ### 3. Framework Quick Reference
110
+
111
+ One-line per framework (load `references/frameworks/` for full detail):
112
+
113
+ **Simple:** APE | RTF | CTF
114
+ **Medium:** RACE | CARE | BAB | BROKE | CRISPE
115
+ **Comprehensive:** CO-STAR | RISEN | TIDD-EC
116
+ **Data:** RISE-IE | RISE-IX
117
+ **Reasoning:** Plan-and-Solve | Chain of Thought | Least-to-Most | Step-Back | Tree of Thought | RCoT
118
+ **Structure/Iteration:** Skeleton of Thought | Chain of Density
119
+ **Critique/Quality:** Self-Refine | CAI Critique-Revise | Devil's Advocate | Pre-Mortem
120
+ **Meta/Reverse:** RPEF | Reverse Role Prompting
121
+ **Agentic:** ReAct
122
+
123
+ ### 4. Clarification Questions
124
+
125
+ Ask targeted questions (3-5 at a time) based on identified gaps:
126
+
127
+ **For CO-STAR**: Context, audience, tone, style, objective, format?
128
+ **For RISEN**: Role, principles, steps, success criteria, constraints?
129
+ **For RISE-IE**: Role, input format/characteristics, processing steps, output expectations?
130
+ **For RISE-IX**: Role, task instructions, workflow steps, reference examples?
131
+ **For TIDD-EC**: Task type, exact steps, what to include (dos), what to avoid (don'ts), examples, context?
132
+ **For CTF**: What is the situation/background, exact task, output format?
133
+ **For RTF**: Expertise needed, exact task, output format?
134
+ **For APE**: Core action, why it's needed, what success looks like?
135
+ **For BAB**: What is the current state/problem, what should it become, transformation rules?
136
+ **For RACE**: Role/expertise, action, situational context, explicit expectation?
137
+ **For CRISPE**: Capacity/role, background insight, instructions, personality/style, how many variants?
138
+ **For BROKE**: Background situation, role, objective, measurable key results, evolve instructions?
139
+ **For CARE**: Context/situation, specific ask, explicit rules and constraints, examples of good output?
140
+ **For Tree of Thought**: Problem, distinct solution branches to explore, evaluation criteria?
141
+ **For ReAct**: Goal, available tools, constraints and stop condition?
142
+ **For Skeleton of Thought**: Topic/question, number of skeleton points, expansion depth per point?
143
+ **For Step-Back**: Original question, what higher-level principle governs it?
144
+ **For Least-to-Most**: Full problem, decomposed subproblems in dependency order?
145
+ **For Plan-and-Solve**: Problem with all relevant numbers/variables?
146
+ **For Chain of Thought**: Problem, reasoning steps, verification?
147
+ **For Chain of Density**: Content to improve, iterations, optimization goals?
148
+ **For Self-Refine**: Output to improve, feedback dimensions, stop condition?
149
+ **For CAI Critique-Revise**: The principle to enforce, output to critique?
150
+ **For Devil's Advocate**: Position to attack, attack dimensions, severity ranking needed?
151
+ **For Pre-Mortem**: Project/decision, time horizon, domains to analyze?
152
+ **For RCoT**: Question with all conditions, initial answer to verify?
153
+ **For RPEF**: Output sample to reverse-engineer, input data if available?
154
+ **For Reverse Role**: Intent statement, domain of expertise, interview mode (batch vs. conversational)?
155
+
156
+ ### 4. Apply Framework
157
+
158
+ Using gathered information:
159
+ 1. Load appropriate template from `assets/templates/`
160
+ 2. Map user's information to framework components
161
+ 3. Fill missing elements with reasonable defaults
162
+ 4. Structure according to framework format
163
+
164
+ ### 5. Present Improvements
165
+
166
+ Show improved prompt with:
167
+ - Clear before/after comparison
168
+ - Explanation of changes made
169
+ - Framework components applied
170
+ - Reasoning for improvements
171
+
172
+ ### 6. Iterate
173
+
174
+ - Confirm improvements align with intent
175
+ - Refine based on feedback
176
+ - Switch or combine frameworks if needed
177
+ - Continue until satisfactory
178
+
179
+ ## Framework References
180
+
181
+ Detailed framework docs in `references/frameworks/`:
182
+ - `co-star.md` - Context, Objective, Style, Tone, Audience, Response
183
+ - `risen.md` - Role, Instructions, Steps, End goal, Narrowing
184
+ - `rise.md` - **Dual variant support**: RISE-IE (Input-Expectation) & RISE-IX (Instructions-Examples)
185
+ - `tidd-ec.md` - Task type, Instructions, Do, Don't, Examples, Context
186
+ - `ctf.md` - Context, Task, Format
187
+ - `rtf.md` - Role, Task, Format
188
+ - `ape.md` - Action, Purpose, Expectation (ultra-minimal)
189
+ - `bab.md` - Before, After, Bridge (transformation/rewrite tasks)
190
+ - `race.md` - Role, Action, Context, Expectation (medium complexity)
191
+ - `crispe.md` - Capacity+Role, Insight, Instructions, Personality, Experiment
192
+ - `broke.md` - Background, Role, Objective, Key Results, Evolve
193
+ - `care.md` - Context, Ask, Rules, Examples (constraint-driven)
194
+ - `tree-of-thought.md` - Branching exploration of multiple solution paths
195
+ - `react.md` - Reasoning + Acting (agentic tool-use cycles)
196
+ - `skeleton-of-thought.md` - Skeleton-first then expand (parallel generation)
197
+ - `step-back.md` - Abstract to principles first, then answer (Google DeepMind)
198
+ - `least-to-most.md` - Decompose into ordered subproblems, solve sequentially
199
+ - `plan-and-solve.md` - Zero-shot: plan + extract variables + calculate (PS+)
200
+ - `chain-of-thought.md` - Step-by-step reasoning techniques
201
+ - `chain-of-density.md` - Iterative refinement through compression
202
+ - `self-refine.md` - Generate → Feedback → Refine loop (NeurIPS 2023)
203
+ - `cai-critique-revise.md` - Principle-based critique + revision (Anthropic)
204
+ - `devils-advocate.md` - Strongest opposing argument generation (ACM IUI 2024)
205
+ - `pre-mortem.md` - Assume failure, identify causes + warning signs (Gary Klein)
206
+ - `rcot.md` - Reverse Chain-of-Thought: verify by reconstructing the question
207
+ - `rpef.md` - Reverse Prompt Engineering: recover prompt from output (EMNLP 2025)
208
+ - `reverse-role.md` - AI-Led Interview: AI asks you questions first (FATA)
209
+
210
+ Load these when applying specific frameworks for detailed component guidance, selection criteria, and examples.
211
+
212
+ ## Templates
213
+
214
+ Framework templates in `assets/templates/` provide structure:
215
+ - `co-star_template.txt` - Full CO-STAR structure
216
+ - `risen_template.txt` - Full RISEN structure
217
+ - `rise-ie_template.txt` - RISE-IE structure (Input-Expectation for data tasks)
218
+ - `rise-ix_template.txt` - RISE-IX structure (Instructions-Examples for creative tasks)
219
+ - `tidd-ec_template.txt` - TIDD-EC structure (Task, Instructions, Do, Don't, Examples, Context)
220
+ - `ctf_template.txt` - CTF structure (Context-Task-Format for situational prompts)
221
+ - `rtf_template.txt` - Full RTF structure
222
+ - `ape_template.txt` - APE structure (Action-Purpose-Expectation ultra-minimal)
223
+ - `bab_template.txt` - BAB structure (Before-After-Bridge for transformations)
224
+ - `race_template.txt` - RACE structure (Role-Action-Context-Expectation)
225
+ - `crispe_template.txt` - CRISPE structure (with Experiment/variants)
226
+ - `broke_template.txt` - BROKE structure (with Key Results + Evolve)
227
+ - `care_template.txt` - CARE structure (with Rules + Examples)
228
+ - `tree-of-thought_template.txt` - Tree of Thought branching exploration structure
229
+ - `react_template.txt` - ReAct Thought-Action-Observation cycle structure
230
+ - `skeleton-of-thought_template.txt` - Skeleton + expand structure
231
+ - `step-back_template.txt` - Step-back question + principle application
232
+ - `least-to-most_template.txt` - Decompose + sequential solving
233
+ - `plan-and-solve_template.txt` - PS+ trigger phrase structure
234
+ - `chain-of-thought_template.txt` - Step-by-step reasoning with verification
235
+ - `chain-of-density_template.txt` - Iterative compression with stopping criterion
236
+ - `self-refine_template.txt` - Generate → Feedback → Refine structure
237
+ - `cai-critique-revise_template.txt` - Principle → Critique → Revision structure
238
+ - `devils-advocate_template.txt` - Position attack with severity ranking
239
+ - `pre-mortem_template.txt` - Failure assumption + cause analysis
240
+ - `rcot_template.txt` - 4-step backward verification structure
241
+ - `rpef_template.txt` - Output analysis + recovered prompt template
242
+ - `reverse-role_template.txt` - Intent + interview trigger structure
243
+ - `hybrid_template.txt` - Combined framework approach
244
+
245
+ ## Key Principles
246
+
247
+ 1. **Ask Before Assuming** - Don't guess intent; clarify ambiguities
248
+ 2. **Explain Reasoning** - Why this framework? Why these changes?
249
+ 3. **Show Your Work** - Display analysis, show framework mapping
250
+ 4. **Be Iterative** - Start with analysis, refine progressively
251
+ 5. **Respect User Choices** - Adapt if user prefers different framework
252
+
253
+ ## When NOT to Use Frameworks
254
+
255
+ Frameworks add structure — but structure has overhead. Skip them when:
256
+
257
+ - **The prompt is already complete**: Clear goal, full context, defined format → just execute it.
258
+ - **Purely factual lookups**: "What is the capital of France?" — no framework needed.
259
+ - **Conversational exchanges**: Back-and-forth dialogue doesn't need a structured template.
260
+ - **Very short one-off tasks**: "Translate this sentence to Spanish." APE would be overhead; just translate.
261
+ - **User is in a hurry**: If someone explicitly says "just do it", don't pause for framework selection — deliver, then offer to structure if they want more.
262
+ - **The task is fully specced by context**: When the codebase, existing docs, or prior messages already contain everything needed.
263
+
264
+ **Rule of thumb**: Apply a framework when there's a gap between what the user *asked for* and what they *need*. If there's no gap, there's no job for a framework.
265
+
266
+ ---
267
+
268
+ ## Example Interaction
269
+
270
+ This example shows the full intent-based flow — detecting intent, using the discriminating table, selecting a framework, asking questions, and delivering a structured result.
271
+
272
+ **User**: "Rewrite this job posting — it's too formal and isn't getting applicants."
273
+
274
+ **Assistant**: I'll analyze this and identify the best approach.
275
+
276
+ **Intent detected**: TRANSFORM — improving existing content.
277
+
278
+ **Discriminating question**: Is this iterative quality improvement, or a one-shot before-to-after rewrite?
279
+ → One-shot rewrite with a clear current state → **BAB** (Before, After, Bridge)
280
+
281
+ **Questions**:
282
+ 1. What's the role and target audience? (who should this attract?)
283
+ 2. What does "too formal" mean specifically? (stiff language, corporate jargon, passive voice?)
284
+ 3. What tone should the new version have? (casual-professional, startup-energy, warm?)
285
+ 4. Any constraints to preserve? (job requirements, company name, legal language?)
286
+ 5. How much can change? (light edits vs. full rewrite?)
287
+
288
+ **User**: "Software engineer, early-career devs. Too much corporate-speak. Want it to sound like real humans work there. Requirements must stay. Full rewrite OK."
289
+
290
+ **Improved Prompt** (BAB):
291
+
292
+ ```
293
+ BEFORE (current state):
294
+ [Paste the current job posting here]
295
+ This posting suffers from: corporate-speak, passive voice, overly formal tone,
296
+ and generic language that doesn't reflect actual team culture.
297
+
298
+ AFTER (desired state):
299
+ A job posting that sounds like it was written by engineers, for engineers.
300
+ Early-career developers should read it and think "I want to work there."
301
+ It should feel honest, direct, and human — not like legal boilerplate.
302
+
303
+ BRIDGE (transformation rules):
304
+ 1. Replace all passive constructions with active voice
305
+ 2. Convert corporate jargon to plain English (e.g., "leverage" → "use")
306
+ 3. Add one specific, concrete detail about the team/culture per section
307
+ 4. Keep all technical requirements and must-haves verbatim
308
+ 5. Target reading level: conversational, not academic
309
+ 6. Length: same or shorter than original — cut fluff, don't add it
310
+ ```
311
+
312
+ **Changes Made**:
313
+ 1. Locked the current state so the AI understands the starting point
314
+ 2. Defined the target state in terms the AI can evaluate against
315
+ 3. Made transformation rules explicit and prioritized
316
+ 4. Protected non-negotiable elements (requirements) from being changed
317
+ 5. Gave a concrete length/tone constraint to prevent over-engineering
318
+
319
+ Does this match what you need, or should we adjust the tone target or constraints?
320
+
321
+ ---
322
+
323
+ ## Usage Notes
324
+
325
+ - Always start by analyzing the original prompt
326
+ - Recommend framework(s) with reasoning
327
+ - Ask clarifying questions progressively (don't overwhelm)
328
+ - Apply framework systematically using templates
329
+ - Present improvements with explanation
330
+ - Iterate based on feedback
331
+ - Load framework references only when needed for detailed guidance