$npx -y skills add DNYoussef/context-cascade --skill when-optimizing-prompts-use-prompt-architect/*============================================================================*/ /* WHEN-OPTIMIZING-PROMPTS-USE-PROMPT-ARCHITECT SKILL :: VERILINGUA x VERIX EDITION */ /*============================================================================*/
| 1 | /*============================================================================*/ |
| 2 | /* WHEN-OPTIMIZING-PROMPTS-USE-PROMPT-ARCHITECT SKILL :: VERILINGUA x VERIX EDITION */ |
| 3 | /*============================================================================*/ |
| 4 | |
| 5 | --- |
| 6 | name: when-optimizing-prompts-use-prompt-architect |
| 7 | version: 1.0.0 |
| 8 | description: | |
| 9 | [assert|neutral] Comprehensive framework for analyzing, creating, and refining prompts for AI systems using evidence-based techniques [ground:given] [conf:0.95] [state:confirmed] |
| 10 | category: utilities |
| 11 | tags: |
| 12 | - prompt-engineering |
| 13 | - optimization |
| 14 | - ai-systems |
| 15 | - llm |
| 16 | author: ruv |
| 17 | cognitive_frame: |
| 18 | primary: compositional |
| 19 | goal_analysis: |
| 20 | first_order: "Execute when-optimizing-prompts-use-prompt-architect workflow" |
| 21 | second_order: "Ensure quality and consistency" |
| 22 | third_order: "Enable systematic utilities processes" |
| 23 | --- |
| 24 | |
| 25 | /*----------------------------------------------------------------------------*/ |
| 26 | /* S0 META-IDENTITY */ |
| 27 | /*----------------------------------------------------------------------------*/ |
| 28 | |
| 29 | [define|neutral] SKILL := { |
| 30 | name: "when-optimizing-prompts-use-prompt-architect", |
| 31 | category: "utilities", |
| 32 | version: "1.0.0", |
| 33 | layer: L1 |
| 34 | } [ground:given] [conf:1.0] [state:confirmed] |
| 35 | |
| 36 | /*----------------------------------------------------------------------------*/ |
| 37 | /* S1 COGNITIVE FRAME */ |
| 38 | /*----------------------------------------------------------------------------*/ |
| 39 | |
| 40 | [define|neutral] COGNITIVE_FRAME := { |
| 41 | frame: "Compositional", |
| 42 | source: "German", |
| 43 | force: "Build from primitives?" |
| 44 | } [ground:cognitive-science] [conf:0.92] [state:confirmed] |
| 45 | |
| 46 | ## Kanitsal Cerceve (Evidential Frame Activation) |
| 47 | Kaynak dogrulama modu etkin. |
| 48 | |
| 49 | /*----------------------------------------------------------------------------*/ |
| 50 | /* S2 TRIGGER CONDITIONS */ |
| 51 | /*----------------------------------------------------------------------------*/ |
| 52 | |
| 53 | [define|neutral] TRIGGER_POSITIVE := { |
| 54 | keywords: ["when-optimizing-prompts-use-prompt-architect", "utilities", "workflow"], |
| 55 | context: "user needs when-optimizing-prompts-use-prompt-architect capability" |
| 56 | } [ground:given] [conf:1.0] [state:confirmed] |
| 57 | |
| 58 | /*----------------------------------------------------------------------------*/ |
| 59 | /* S3 CORE CONTENT */ |
| 60 | /*----------------------------------------------------------------------------*/ |
| 61 | |
| 62 | # Prompt Architect - Evidence-Based Prompt Engineering |
| 63 | |
| 64 | ## Kanitsal Cerceve (Evidential Frame Activation) |
| 65 | Kaynak dogrulama modu etkin. |
| 66 | |
| 67 | |
| 68 | |
| 69 | ## Overview |
| 70 | |
| 71 | Comprehensive framework for analyzing, creating, and refining prompts for AI systems (Claude, GPT, etc.). Applies structural optimization, self-consistency patterns, and anti-pattern detection to transform prompts into highly effective versions. |
| 72 | |
| 73 | ## When to Use This Skill |
| 74 | |
| 75 | - Creating new prompts for AI systems |
| 76 | - Existing prompts produce poor results |
| 77 | - Inconsistent AI outputs |
| 78 | - Need to improve prompt clarity |
| 79 | - Applying evidence-based prompt engineering |
| 80 | - Optimizing agent instructions |
| 81 | - Building prompt libraries |
| 82 | |
| 83 | ## Theoretical Foundation |
| 84 | |
| 85 | ### Evidence-Based Techniques |
| 86 | |
| 87 | 1. **Chain-of-Thought (CoT)**: Explicit reasoning steps |
| 88 | 2. **Self-Consistency**: Multiple reasoning paths |
| 89 | 3. **ReAct**: Reasoning + Acting pattern |
| 90 | 4. **Program-of-Thought**: Structured logic |
| 91 | 5. **Plan-and-Solve**: Decomposition strategy |
| 92 | 6. **Role-Playing**: Persona assignment |
| 93 | 7. **Few-Shot Learning**: Example-based instruction |
| 94 | |
| 95 | ### Prompt Structure Principles |
| 96 | |
| 97 | ``` |
| 98 | [System Context] → [Role Definition] → [Task Description] → |
| 99 | [Constraints] → [Format Specification] → [Examples] → [Quality Criteria] |
| 100 | ``` |
| 101 | |
| 102 | ## Phase 1: Analyze Current Prompt |
| 103 | |
| 104 | ### Objective |
| 105 | Identify weaknesses and improvement opportunities |
| 106 | |
| 107 | ### Agent: Researcher |
| 108 | |
| 109 | **Step 1.1: Structural Analysis** |
| 110 | ```javascript |
| 111 | const promptAnalysis = { |
| 112 | components: { |
| 113 | hasSystemContext: checkForContext(prompt), |
| 114 | hasRoleDefinition: checkForRole(prompt), |
| 115 | hasTaskDescription: checkForTask(prompt), |
| 116 | hasConstraints: checkForConstraints(prompt), |
| 117 | hasFormatSpec: checkForFormat(prompt), |
| 118 | hasExamples: checkForExamples(prompt), |
| 119 | hasQualityCriteria: checkForCriteria(prompt) |
| 120 | }, |
| 121 | metrics: { |
| 122 | length: prompt.length, |
| 123 | clarity: calculateClarity(prompt), |
| 124 | specificity: calculateSpecificity(prompt), |
| 125 | completeness: calculateCompleteness(prompt) |
| 126 | }, |
| 127 | antiPatterns: detectAntiPatterns(prompt) |
| 128 | }; |
| 129 | |
| 130 | await memory.store('prompt-architect/analysis', promptAnalysis); |
| 131 | ``` |
| 132 | |
| 133 | **Step 1.2: Detect Anti-Patterns** |
| 134 | ```javascript |
| 135 | const antiPatterns = [ |
| 136 | { |
| 137 | name: 'Vague Instructions', |
| 138 | pattern: /please|try to|maybe|possibly/gi, |
| 139 | severity: 'HIGH', |
| 140 | fix: 'Use imperative commands: "Analyze...", "Generate...", "Create..."' |
| 141 | }, |
| 142 | { |
| 143 | name: 'Missing Context', |
| 144 | pattern: absence of background info, |
| 145 | severity: 'HIGH', |
| 146 | fix: 'Add sy |