@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.
Files changed (76) hide show
  1. package/.claude-plugin/marketplace.json +20 -0
  2. package/.claude-plugin/plugin.json +18 -0
  3. package/CHANGELOG.md +264 -0
  4. package/LICENSE +21 -0
  5. package/MIGRATION.md +66 -0
  6. package/README.md +1184 -0
  7. package/adapters/README.md +267 -0
  8. package/adapters/for-cursor.mdc +138 -0
  9. package/adapters/for-gemini-cli.md +70 -0
  10. package/adapters/for-github-copilot.md +141 -0
  11. package/adapters/for-openai-codex-cli.md +158 -0
  12. package/adapters/for-windsurf.md +136 -0
  13. package/adapters/system-prompt.md +243 -0
  14. package/package.json +135 -0
  15. package/scripts/install.js +490 -0
  16. package/scripts/test.js +213 -0
  17. package/scripts/validate-skill.js +350 -0
  18. package/skills/prompt-architect/SKILL.md +331 -0
  19. package/skills/prompt-architect/assets/templates/ape_template.txt +5 -0
  20. package/skills/prompt-architect/assets/templates/bab_template.txt +15 -0
  21. package/skills/prompt-architect/assets/templates/broke_template.txt +15 -0
  22. package/skills/prompt-architect/assets/templates/cai-critique-revise_template.txt +18 -0
  23. package/skills/prompt-architect/assets/templates/care_template.txt +16 -0
  24. package/skills/prompt-architect/assets/templates/chain-of-density_template.txt +46 -0
  25. package/skills/prompt-architect/assets/templates/chain-of-thought_template.txt +49 -0
  26. package/skills/prompt-architect/assets/templates/co-star_template.txt +17 -0
  27. package/skills/prompt-architect/assets/templates/crispe_template.txt +14 -0
  28. package/skills/prompt-architect/assets/templates/ctf_template.txt +15 -0
  29. package/skills/prompt-architect/assets/templates/devils-advocate_template.txt +25 -0
  30. package/skills/prompt-architect/assets/templates/hybrid_template.txt +101 -0
  31. package/skills/prompt-architect/assets/templates/least-to-most_template.txt +16 -0
  32. package/skills/prompt-architect/assets/templates/plan-and-solve_template.txt +7 -0
  33. package/skills/prompt-architect/assets/templates/pre-mortem_template.txt +27 -0
  34. package/skills/prompt-architect/assets/templates/race_template.txt +19 -0
  35. package/skills/prompt-architect/assets/templates/rcot_template.txt +31 -0
  36. package/skills/prompt-architect/assets/templates/react_template.txt +27 -0
  37. package/skills/prompt-architect/assets/templates/reverse-role_template.txt +11 -0
  38. package/skills/prompt-architect/assets/templates/rise-ie_template.txt +23 -0
  39. package/skills/prompt-architect/assets/templates/rise-ix_template.txt +28 -0
  40. package/skills/prompt-architect/assets/templates/risen_template.txt +21 -0
  41. package/skills/prompt-architect/assets/templates/rpef_template.txt +26 -0
  42. package/skills/prompt-architect/assets/templates/rtf_template.txt +13 -0
  43. package/skills/prompt-architect/assets/templates/self-refine_template.txt +16 -0
  44. package/skills/prompt-architect/assets/templates/skeleton-of-thought_template.txt +15 -0
  45. package/skills/prompt-architect/assets/templates/step-back_template.txt +10 -0
  46. package/skills/prompt-architect/assets/templates/tidd-ec_template.txt +45 -0
  47. package/skills/prompt-architect/assets/templates/tree-of-thought_template.txt +30 -0
  48. package/skills/prompt-architect/references/frameworks/ape.md +200 -0
  49. package/skills/prompt-architect/references/frameworks/bab.md +242 -0
  50. package/skills/prompt-architect/references/frameworks/broke.md +242 -0
  51. package/skills/prompt-architect/references/frameworks/cai-critique-revise.md +230 -0
  52. package/skills/prompt-architect/references/frameworks/care.md +235 -0
  53. package/skills/prompt-architect/references/frameworks/chain-of-density.md +479 -0
  54. package/skills/prompt-architect/references/frameworks/chain-of-thought.md +424 -0
  55. package/skills/prompt-architect/references/frameworks/co-star.md +256 -0
  56. package/skills/prompt-architect/references/frameworks/crispe.md +253 -0
  57. package/skills/prompt-architect/references/frameworks/ctf.md +207 -0
  58. package/skills/prompt-architect/references/frameworks/devils-advocate.md +206 -0
  59. package/skills/prompt-architect/references/frameworks/least-to-most.md +226 -0
  60. package/skills/prompt-architect/references/frameworks/plan-and-solve.md +210 -0
  61. package/skills/prompt-architect/references/frameworks/pre-mortem.md +197 -0
  62. package/skills/prompt-architect/references/frameworks/race.md +243 -0
  63. package/skills/prompt-architect/references/frameworks/rcot.md +203 -0
  64. package/skills/prompt-architect/references/frameworks/react.md +304 -0
  65. package/skills/prompt-architect/references/frameworks/reverse-role.md +189 -0
  66. package/skills/prompt-architect/references/frameworks/rise.md +555 -0
  67. package/skills/prompt-architect/references/frameworks/risen.md +297 -0
  68. package/skills/prompt-architect/references/frameworks/rpef.md +195 -0
  69. package/skills/prompt-architect/references/frameworks/rtf.md +358 -0
  70. package/skills/prompt-architect/references/frameworks/self-refine.md +205 -0
  71. package/skills/prompt-architect/references/frameworks/skeleton-of-thought.md +186 -0
  72. package/skills/prompt-architect/references/frameworks/step-back.md +206 -0
  73. package/skills/prompt-architect/references/frameworks/tidd-ec.md +470 -0
  74. package/skills/prompt-architect/references/frameworks/tree-of-thought.md +260 -0
  75. package/skills/prompt-architect/scripts/framework_analyzer.py +807 -0
  76. package/skills/prompt-architect/scripts/prompt_evaluator.py +336 -0
@@ -0,0 +1,350 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Skill Structure Validator
5
+ *
6
+ * Validates the Claude Code skill structure before publishing to npm.
7
+ * Checks:
8
+ * - SKILL.md exists and has valid frontmatter
9
+ * - Required directories are present
10
+ * - Framework files exist
11
+ * - Templates exist
12
+ * - File sizes are reasonable
13
+ */
14
+
15
+ const fs = require('fs');
16
+ const path = require('path');
17
+
18
+ // Colors for console output
19
+ const colors = {
20
+ reset: '\x1b[0m',
21
+ red: '\x1b[31m',
22
+ green: '\x1b[32m',
23
+ yellow: '\x1b[33m',
24
+ blue: '\x1b[34m',
25
+ };
26
+
27
+ function log(message, color = 'reset') {
28
+ console.log(`${colors[color]}${message}${colors.reset}`);
29
+ }
30
+
31
+ function error(message) {
32
+ log(`❌ ${message}`, 'red');
33
+ }
34
+
35
+ function success(message) {
36
+ log(`✅ ${message}`, 'green');
37
+ }
38
+
39
+ function warning(message) {
40
+ log(`⚠️ ${message}`, 'yellow');
41
+ }
42
+
43
+ function info(message) {
44
+ log(`ℹ️ ${message}`, 'blue');
45
+ }
46
+
47
+ // Configuration
48
+ const SKILL_DIR = path.join(__dirname, '..', 'skills', 'prompt-architect');
49
+ const SKILL_FILE = path.join(SKILL_DIR, 'SKILL.md');
50
+
51
+ const REQUIRED_DIRS = [
52
+ 'scripts',
53
+ 'references/frameworks',
54
+ 'assets/templates',
55
+ ];
56
+
57
+ const REQUIRED_FRAMEWORKS = [
58
+ 'co-star.md',
59
+ 'risen.md',
60
+ 'rise.md',
61
+ 'tidd-ec.md',
62
+ 'rtf.md',
63
+ 'chain-of-thought.md',
64
+ 'chain-of-density.md',
65
+ ];
66
+
67
+ const REQUIRED_TEMPLATES = [
68
+ 'co-star_template.txt',
69
+ 'risen_template.txt',
70
+ 'rise-ie_template.txt',
71
+ 'rise-ix_template.txt',
72
+ 'tidd-ec_template.txt',
73
+ 'rtf_template.txt',
74
+ 'hybrid_template.txt',
75
+ ];
76
+
77
+ const REQUIRED_SCRIPTS = [
78
+ 'framework_analyzer.py',
79
+ 'prompt_evaluator.py',
80
+ ];
81
+
82
+ let errorCount = 0;
83
+ let warningCount = 0;
84
+
85
+ // Main validation
86
+ function validateSkill() {
87
+ log('\n🔍 Validating Prompt Architect Skill Structure...\n', 'blue');
88
+
89
+ // Check skill directory exists
90
+ if (!fs.existsSync(SKILL_DIR)) {
91
+ error(`Skill directory not found: ${SKILL_DIR}`);
92
+ process.exit(1);
93
+ }
94
+ success('Skill directory found');
95
+
96
+ // Check SKILL.md exists
97
+ if (!fs.existsSync(SKILL_FILE)) {
98
+ error('SKILL.md not found');
99
+ errorCount++;
100
+ } else {
101
+ success('SKILL.md found');
102
+ validateSkillFile();
103
+ }
104
+
105
+ // Check required directories
106
+ REQUIRED_DIRS.forEach(dir => {
107
+ const fullPath = path.join(SKILL_DIR, dir);
108
+ if (!fs.existsSync(fullPath)) {
109
+ error(`Required directory missing: ${dir}`);
110
+ errorCount++;
111
+ } else {
112
+ success(`Directory found: ${dir}`);
113
+ }
114
+ });
115
+
116
+ // Check framework files
117
+ info('\nValidating framework files...');
118
+ REQUIRED_FRAMEWORKS.forEach(framework => {
119
+ const frameworkPath = path.join(SKILL_DIR, 'references', 'frameworks', framework);
120
+ if (!fs.existsSync(frameworkPath)) {
121
+ error(`Framework file missing: ${framework}`);
122
+ errorCount++;
123
+ } else {
124
+ const stats = fs.statSync(frameworkPath);
125
+ const sizeKB = (stats.size / 1024).toFixed(2);
126
+ success(`Framework found: ${framework} (${sizeKB} KB)`);
127
+
128
+ // Warn if framework file is too small
129
+ if (stats.size < 5000) {
130
+ warning(`Framework ${framework} seems small (< 5 KB)`);
131
+ warningCount++;
132
+ }
133
+ }
134
+ });
135
+
136
+ // Check template files
137
+ info('\nValidating template files...');
138
+ REQUIRED_TEMPLATES.forEach(template => {
139
+ const templatePath = path.join(SKILL_DIR, 'assets', 'templates', template);
140
+ if (!fs.existsSync(templatePath)) {
141
+ error(`Template file missing: ${template}`);
142
+ errorCount++;
143
+ } else {
144
+ success(`Template found: ${template}`);
145
+ }
146
+ });
147
+
148
+ // Check script files
149
+ info('\nValidating script files...');
150
+ REQUIRED_SCRIPTS.forEach(script => {
151
+ const scriptPath = path.join(SKILL_DIR, 'scripts', script);
152
+ if (!fs.existsSync(scriptPath)) {
153
+ error(`Script file missing: ${script}`);
154
+ errorCount++;
155
+ } else {
156
+ success(`Script found: ${script}`);
157
+ }
158
+ });
159
+
160
+ // Check package structure
161
+ info('\nValidating package structure...');
162
+ const packageJson = path.join(__dirname, '..', 'package.json');
163
+ if (!fs.existsSync(packageJson)) {
164
+ error('package.json not found');
165
+ errorCount++;
166
+ } else {
167
+ success('package.json found');
168
+ validatePackageJson();
169
+ }
170
+
171
+ }
172
+
173
+ function validateSkillFile() {
174
+ const content = fs.readFileSync(SKILL_FILE, 'utf8');
175
+
176
+ // Check for YAML frontmatter (handle both LF and CRLF line endings)
177
+ const frontmatterMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
178
+ if (!frontmatterMatch) {
179
+ error('SKILL.md missing YAML frontmatter (---\\n...\\n---)');
180
+ errorCount++;
181
+ return;
182
+ }
183
+ success('YAML frontmatter found');
184
+
185
+ const frontmatter = frontmatterMatch[1];
186
+
187
+ // Check required fields
188
+ const requiredFields = ['name', 'description'];
189
+ requiredFields.forEach(field => {
190
+ if (!frontmatter.includes(`${field}:`)) {
191
+ error(`SKILL.md missing required field: ${field}`);
192
+ errorCount++;
193
+ } else {
194
+ success(`Required field found: ${field}`);
195
+ }
196
+ });
197
+
198
+ // Validate name format
199
+ const nameMatch = frontmatter.match(/name:\s*([^\n]+)/);
200
+ if (nameMatch) {
201
+ const name = nameMatch[1].trim();
202
+ if (!/^[a-z0-9-]+$/.test(name)) {
203
+ error(`Invalid skill name format: "${name}" (use lowercase, numbers, hyphens only)`);
204
+ errorCount++;
205
+ } else if (name.length > 64) {
206
+ error(`Skill name too long: ${name.length} characters (max 64)`);
207
+ errorCount++;
208
+ } else {
209
+ success(`Valid skill name: ${name}`);
210
+ }
211
+ }
212
+
213
+ // Validate description length
214
+ const descMatch = frontmatter.match(/description:\s*([^\n]+)/);
215
+ if (descMatch && descMatch[1].length > 1024) {
216
+ error(`Description too long: ${descMatch[1].length} characters (max 1024)`);
217
+ errorCount++;
218
+ } else if (descMatch) {
219
+ success(`Valid description length: ${descMatch[1].length} characters`);
220
+ }
221
+
222
+ // Check content size
223
+ const sizeKB = (Buffer.byteLength(content, 'utf8') / 1024).toFixed(2);
224
+ info(`SKILL.md size: ${sizeKB} KB`);
225
+ if (sizeKB > 100) {
226
+ warning('SKILL.md is quite large (> 100 KB). Consider splitting content.');
227
+ warningCount++;
228
+ }
229
+ }
230
+
231
+ function validatePackageJson() {
232
+ const packageJsonPath = path.join(__dirname, '..', 'package.json');
233
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
234
+
235
+ // Check required fields
236
+ const requiredFields = ['name', 'version', 'description', 'main', 'keywords', 'license'];
237
+ requiredFields.forEach(field => {
238
+ if (!packageJson[field]) {
239
+ error(`package.json missing required field: ${field}`);
240
+ errorCount++;
241
+ } else {
242
+ success(`package.json has ${field}`);
243
+ }
244
+ });
245
+
246
+ // Check keywords include claude-code
247
+ if (packageJson.keywords && !packageJson.keywords.includes('claude-code')) {
248
+ warning('package.json keywords should include "claude-code"');
249
+ warningCount++;
250
+ }
251
+
252
+ // Check files array
253
+ if (!packageJson.files || packageJson.files.length === 0) {
254
+ warning('package.json should specify "files" array for npm publish');
255
+ warningCount++;
256
+ } else {
257
+ success(`package.json specifies ${packageJson.files.length} file patterns`);
258
+ }
259
+
260
+ // Validate version format
261
+ const versionRegex = /^\d+\.\d+\.\d+(-[a-z0-9.]+)?$/;
262
+ if (!versionRegex.test(packageJson.version)) {
263
+ error(`Invalid version format: ${packageJson.version} (use semver: X.Y.Z)`);
264
+ errorCount++;
265
+ } else {
266
+ success(`Valid version: ${packageJson.version}`);
267
+ }
268
+ }
269
+
270
+ function validatePluginManifest() {
271
+ info('\nValidating Claude plugin manifest...');
272
+ const pluginJsonPath = path.join(__dirname, '..', '.claude-plugin', 'plugin.json');
273
+ const marketplacePath = path.join(__dirname, '..', '.claude-plugin', 'marketplace.json');
274
+
275
+ if (!fs.existsSync(pluginJsonPath)) {
276
+ error('.claude-plugin/plugin.json not found');
277
+ errorCount++;
278
+ return;
279
+ }
280
+ success('.claude-plugin/plugin.json found');
281
+
282
+ try {
283
+ const plugin = JSON.parse(fs.readFileSync(pluginJsonPath, 'utf8'));
284
+ const requiredFields = ['name', 'description', 'version'];
285
+ requiredFields.forEach(field => {
286
+ if (!plugin[field]) {
287
+ error(`plugin.json missing required field: ${field}`);
288
+ errorCount++;
289
+ } else {
290
+ success(`plugin.json has ${field}`);
291
+ }
292
+ });
293
+
294
+ // Cross-check version with package.json
295
+ const packageJsonPath = path.join(__dirname, '..', 'package.json');
296
+ if (fs.existsSync(packageJsonPath)) {
297
+ const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
298
+ if (plugin.version !== pkg.version) {
299
+ error(`Version mismatch: plugin.json=${plugin.version}, package.json=${pkg.version}`);
300
+ errorCount++;
301
+ } else {
302
+ success('plugin.json version matches package.json');
303
+ }
304
+ }
305
+ } catch (err) {
306
+ error(`plugin.json parse error: ${err.message}`);
307
+ errorCount++;
308
+ }
309
+
310
+ if (!fs.existsSync(marketplacePath)) {
311
+ warning('.claude-plugin/marketplace.json not found (optional for plugins)');
312
+ warningCount++;
313
+ } else {
314
+ try {
315
+ const mkt = JSON.parse(fs.readFileSync(marketplacePath, 'utf8'));
316
+ if (!mkt.name || !mkt.owner || !mkt.plugins) {
317
+ error('marketplace.json missing required fields (name, owner, plugins)');
318
+ errorCount++;
319
+ } else {
320
+ success(`marketplace.json valid: ${mkt.plugins.length} plugin(s) defined`);
321
+ }
322
+ } catch (err) {
323
+ error(`marketplace.json parse error: ${err.message}`);
324
+ errorCount++;
325
+ }
326
+ }
327
+ }
328
+
329
+ // Run validation
330
+ try {
331
+ validateSkill();
332
+ validatePluginManifest();
333
+
334
+ // Final summary
335
+ log('\n' + '='.repeat(50), 'blue');
336
+ if (errorCount === 0 && warningCount === 0) {
337
+ success('\n✨ All validation checks passed! Ready to publish. ✨\n');
338
+ process.exit(0);
339
+ } else if (errorCount === 0) {
340
+ warning(`\n⚠️ Validation passed with ${warningCount} warning(s)\n`);
341
+ process.exit(0);
342
+ } else {
343
+ error(`\n❌ Validation failed with ${errorCount} error(s) and ${warningCount} warning(s)\n`);
344
+ process.exit(1);
345
+ }
346
+ } catch (err) {
347
+ error(`Validation error: ${err.message}`);
348
+ console.error(err);
349
+ process.exit(1);
350
+ }
@@ -0,0 +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
@@ -0,0 +1,5 @@
1
+ ACTION: [What to do — one clear verb-driven instruction]
2
+
3
+ PURPOSE: [Why it's needed — one sentence on how it will be used or who needs it]
4
+
5
+ EXPECTATION: [What a good result looks like — format, length, quality bar, or tone]