Unlearn Prompt Engineering

A transformative short course by AI Harsha that rewires how you think about AI prompting. Stop throwing words at modelsโ€”start engineering reliable, testable outputs.

3-4
Hours Runtime
5
Core Modules
20+
Templates
30
Before/After Examples

Course Overview

Executive Summary

๐ŸŽฏ Course Goal

Learners will UNLEARN bad prompting habits, then RELEARN robust, testable, and reusable techniques that produce reliable, evaluable outputs across tasks (analysis, coding, research, structured JSON, images/diagrams, and agent/tool use).

๐Ÿ‘ค About the Instructor

AI Harsha โ€” An AI evangelist focused on AI + Data Analytics, financial modeling best practices, and AI+IoT (ESP32/Arduino), with a signature "unlearn โ†’ relearn" approach. Voice: clear, concise, technical yet approachable. No fluff.

๐ŸŽ“ Target Audience

Analysts, engineers, product managers, and power users with beginner-to-intermediate prompting experience who want to level up their AI interaction skills.

๐Ÿ“š What You'll Get

  • Instructor Guide with scripts
  • Participant Workbook
  • 40-60 Slide Deck
  • Cheatsheets (1-page each)
  • 20 Reusable Templates
  • 30 Before/After Examples
  • Knowledge Check Quiz
  • Capstone Assignment

๐Ÿšซ Bad Practices to Unlearn

  • Vague asks & multi-goal prompts
  • Missing constraints & success criteria
  • No evaluation loop or tests
  • Overlong context dumps
  • Hidden assumptions & biases
  • Unstructured outputs
  • No hallucination mitigation
  • No safety guardrails

Core Frameworks

Foundation

UNLEARN Framework โ€” Diagnose Bad Prompts

U โ€” Uncover assumptions (what's implicit/ambiguous?)
N โ€” Narrow the goal (single outcome per prompt)
L โ€” Lay out context/constraints (domain, data, limits)
E โ€” End-state definition (success criteria and tests)
A โ€” Arrange structure (roles, steps, headings)
R โ€” Reference examples (few-shot, before/after)
N โ€” Nudge format (explicit output schema)

RELEARN Framework โ€” Build Strong Prompts

R โ€” Role & Rules (who is the model? boundaries)
E โ€” Evidence (grounding data, citations)
L โ€” Limits (token, scope, time, cost)
E โ€” Evaluation plan (tests, A/B, rubrics)
A โ€” Actionable steps (algorithms, checklists)
R โ€” Response schema (machine-readable)
N โ€” Next iteration (refinement loop)

Course Modules

5 Modules โ€ข 3-4 Hours

Module 1 โ€” Why Unlearn Prompting (30-40 min)

Learning Outcomes

  • Identify 10 common "bad prompt" anti-patterns
  • Understand the cost of poor prompting (time, money, quality)
  • Apply quick fixes to weak prompts
  • Complete pretest assessment (5 questions)

Key Activities

  • ๐Ÿงช Pretest: Assess current prompting skills
  • ๐Ÿ” Myth-busting: Common misconceptions
  • โœ๏ธ Exercise: Rewrite 5 weak prompts (finance & IoT focus)

Module 2 โ€” Diagnose with UNLEARN (45-50 min)

Real-World Case Studies

  • ๐Ÿ“Š Financial modeling: Excel formula audits & scenario prompts
  • ๐Ÿ“ˆ Data analytics: SQL generation + Looker Studio commentary
  • ๐Ÿ”Œ IoT/ESP32: Firmware help, pin maps, safety constraints
  • ๐Ÿค– RC/robotics: PWM/PPM decoding, step-by-step debug

"Prompt Surgery" Lab

Hands-on workshop where you'll:

  • Identify hidden assumptions in real prompts
  • Define measurable success criteria
  • Transform 12+ before/after prompt pairs

Module 3 โ€” Rebuild with RELEARN (45-50 min)

Core Skills

  • ๐ŸŽญ Role crafting & context window optimization
  • ๐Ÿ“ Constraint specification & output schemas
  • ๐Ÿ“š Few-shot exemplar design
  • โœ… JSON Schema validation
  • ๐Ÿ›ก๏ธ Hallucination mitigation strategies

Templates Covered

  • Research briefs with citations
  • Code generation with tests
  • Data cleaning pipelines
  • Agent system specifications

Module 4 โ€” Automate & Evaluate (40-45 min)

Evaluation Framework

Metric Weight Score (1-5)
Clarity 20% Unambiguous goals
Specificity 20% Detailed constraints
Structure 15% Logical organization
Grounding 15% Evidence-based
Safety 10% Risk mitigation
Reusability 10% Template-ready
Testability 10% Measurable outputs

Module 5 โ€” Capstone Project (30-40 min)

๐Ÿ“Š Track A: Finance

"Unlearn" a forecasting prompt; produce a model brief + JSON outputs

๐Ÿ”Œ Track B: IoT/ESP32

"Unlearn" a firmware-help prompt; produce pin plan + risk checklist

๐Ÿ“ˆ Track C: Analytics

"Unlearn" a dataset analysis prompt; produce SQL + narrative + chart spec

๐Ÿค– Track D: Agent/RAG

"Unlearn" a research agent brief; produce spec + guardrails + tests

Prompt Templates

20+ Templates
๐Ÿ“ General Purpose Template โ–ผ
# Role Definition
You are a {role} with expertise in {domain}.

# Task
{specific_task_description}

# Context & Constraints
- Domain: {domain_specifics}
- Scope: {scope_boundaries}
- Token limit: {max_tokens}
- Time constraint: {deadline}

# Success Criteria
1. {measurable_criterion_1}
2. {measurable_criterion_2}
3. {measurable_criterion_3}

# Output Format
```json
{
  "analysis": "{structured_analysis}",
  "recommendations": [{recommendation_objects}],
  "confidence": {0-1_score},
  "citations": [{source_references}]
}
```

# Examples
Input: {example_input}
Output: {example_output}

# Evaluation Checklist
- [ ] Meets all success criteria
- [ ] Follows output schema exactly
- [ ] Includes evidence/citations
- [ ] No hallucinations detected
๐Ÿ’ฐ Financial Modeling Brief โ–ผ
# Role
You are a Senior Financial Analyst specializing in {industry} financial modeling.

# Objective
Create a {model_type} financial model for {company/project}.

# Assumptions to Validate
- Revenue growth: {growth_assumptions}
- Cost structure: {cost_assumptions}
- Market conditions: {market_assumptions}
- Risk factors: {risk_list}

# Required Scenarios
1. Base case: {base_parameters}
2. Best case: {best_parameters}
3. Worst case: {worst_parameters}

# Deliverables
```json
{
  "model_structure": {
    "revenue_streams": [],
    "cost_categories": [],
    "capex_schedule": []
  },
  "scenarios": {
    "base": {financial_metrics},
    "best": {financial_metrics},
    "worst": {financial_metrics}
  },
  "key_metrics": {
    "NPV": number,
    "IRR": percentage,
    "payback_period": months,
    "break_even": date
  },
  "sensitivity_analysis": {
    "critical_variables": [],
    "impact_ranges": {}
  }
}
```

# Validation Tests
- Sum of parts = Total
- Balance sheet balances
- Cash flow reconciles
- Returns are realistic for industry
๐Ÿ”Œ ESP32/IoT Template โ–ผ
# Role
You are an embedded systems engineer specializing in ESP32/Arduino development.

# Hardware Configuration
- Board: {board_model}
- Peripherals: {connected_devices}
- Power: {power_specs}
- Communication: {protocols_used}

# Task
{specific_implementation_need}

# Safety Constraints
- Max current per pin: 12mA
- Total current limit: 200mA
- Operating voltage: 3.3V
- Protected pins: {reserved_pins}

# Pin Mapping Required
```json
{
  "gpio_assignments": {
    "pin_number": "function",
    "constraints": "notes"
  },
  "i2c": {"sda": pin, "scl": pin},
  "spi": {"mosi": pin, "miso": pin, "sck": pin, "cs": pin},
  "uart": {"tx": pin, "rx": pin}
}
```

# Code Template
```cpp
#include 

// Pin definitions
const int {PIN_NAME} = {PIN_NUMBER};

// Safety checks
void validatePinConfiguration() {
  // Current draw validation
  // Voltage level checks
  // Conflict detection
}

void setup() {
  validatePinConfiguration();
  // Initialization code
}

void loop() {
  // Main logic with safety guards
}
```

# Testing Checklist
- [ ] Pin conflicts resolved
- [ ] Current within limits
- [ ] Voltage levels compatible
- [ ] Error handling implemented
๐Ÿ—ƒ๏ธ SQL Generation & Review โ–ผ
# Dual Role
Primary: SQL Query Author
Secondary: Query Performance Reviewer

# Database Context
- DBMS: {database_type}
- Schema: {relevant_tables_and_columns}
- Indexes: {available_indexes}
- Data volume: {approximate_rows}

# Query Requirements
{detailed_data_need}

# Performance Constraints
- Max execution time: {seconds}
- Result set limit: {max_rows}
- Resource usage: {cpu_memory_limits}

# Output Format
```json
{
  "query": "SELECT ...",
  "explanation": "Step-by-step logic",
  "performance_analysis": {
    "estimated_cost": number,
    "index_usage": [],
    "potential_bottlenecks": []
  },
  "test_cases": [
    {
      "description": "Test scenario",
      "expected_rows": number,
      "validation_query": "SELECT COUNT(*) ..."
    }
  ],
  "optimization_suggestions": []
}
```

# Query Quality Checks
- [ ] Uses appropriate indexes
- [ ] Avoids N+1 queries
- [ ] Handles NULL values
- [ ] Includes error handling
- [ ] Has EXPLAIN plan review
๐Ÿ“Š Data Analysis CSV โ†’ Insights โ–ผ
# Role
You are a Senior Data Analyst specializing in {domain} analytics.

# Input Data
- File: {csv_file_path}
- Rows: {estimated_rows}
- Columns: {column_list}
- Date range: {start_date} to {end_date}

# Analysis Requirements
1. Data quality assessment
2. Statistical summary
3. Trend identification
4. Anomaly detection
5. Actionable insights

# Output Format
```json
{
  "data_quality": {
    "completeness": percentage,
    "null_counts": {},
    "outliers": []
  },
  "key_metrics": {
    "metric_name": {
      "value": number,
      "trend": "up|down|stable",
      "significance": "high|medium|low"
    }
  },
  "insights": [
    {
      "finding": "description",
      "impact": "business impact",
      "recommendation": "action item",
      "confidence": 0.0-1.0
    }
  ],
  "visualizations_needed": [
    {
      "type": "chart_type",
      "data": "columns_to_plot",
      "purpose": "why_needed"
    }
  ]
}
```

# Validation
- Statistical tests performed
- Assumptions checked
- Edge cases handled
๐Ÿ› Code Debugging Assistant โ–ผ
# Role
You are a Senior Software Engineer debugging {language} code.

# Bug Context
- Error message: {error_text}
- Environment: {os, version, dependencies}
- When occurs: {reproduction_steps}
- Expected behavior: {what_should_happen}
- Actual behavior: {what_happens}

# Code Context
```{language}
{problematic_code}
```

# Debug Process
1. Reproduce issue
2. Form hypothesis
3. Isolate problem
4. Propose fix
5. Write tests

# Output Format
```json
{
  "diagnosis": {
    "root_cause": "explanation",
    "affected_components": [],
    "severity": "critical|high|medium|low"
  },
  "solution": {
    "fix_code": "corrected code",
    "explanation": "why this fixes it",
    "side_effects": []
  },
  "tests": [
    {
      "test_name": "description",
      "test_code": "unit test",
      "expected_result": "outcome"
    }
  ],
  "prevention": {
    "recommendations": [],
    "monitoring": []
  }
}
```

# Verification
- Fix tested in isolation
- Regression tests pass
- Performance impact assessed
๐Ÿ“ˆ Dashboard Commentary Generator โ–ผ
# Role
You are a Business Intelligence Analyst creating executive dashboard narratives.

# Dashboard Context
- Platform: {Looker|Tableau|PowerBI|Klipfolio}
- Audience: {executives|managers|analysts}
- Metrics shown: {metric_list}
- Time period: {date_range}

# Data Points
```json
{
  "current_period": {
    "metric_1": value,
    "metric_2": value
  },
  "prior_period": {
    "metric_1": value,
    "metric_2": value
  },
  "targets": {
    "metric_1": value,
    "metric_2": value
  }
}
```

# Commentary Requirements
1. Executive summary (2-3 sentences)
2. Key wins and concerns
3. Trend analysis
4. Forward-looking insights
5. Recommended actions

# Output Format
```json
{
  "executive_summary": "High-level takeaway",
  "performance_highlights": [
    {
      "metric": "name",
      "change": "ยฑX%",
      "narrative": "contextual explanation",
      "sentiment": "positive|neutral|negative"
    }
  ],
  "trends": [
    {
      "pattern": "description",
      "duration": "timeframe",
      "implication": "business impact"
    }
  ],
  "alerts": [
    {
      "issue": "what needs attention",
      "urgency": "high|medium|low",
      "action": "recommended response"
    }
  ],
  "forecast": {
    "next_period_outlook": "prediction",
    "confidence": 0.0-1.0,
    "assumptions": []
  }
}
```
๐Ÿ”ฌ RAG Research Brief โ–ผ
# Role
You are a Research Analyst with access to a document corpus via RAG.

# Research Question
{specific_research_question}

# Corpus Context
- Documents: {document_count}
- Types: {pdf|web|internal_docs}
- Date range: {corpus_date_range}
- Retrieval method: {embedding_model}

# Search Parameters
- Top-k results: {number}
- Similarity threshold: {0.0-1.0}
- Reranking: {true|false}

# Output Requirements
```json
{
  "research_summary": {
    "key_findings": [],
    "confidence_level": 0.0-1.0,
    "gaps_identified": []
  },
  "evidence": [
    {
      "claim": "specific assertion",
      "sources": [
        {
          "document": "title/id",
          "page": number,
          "quote": "exact text",
          "relevance_score": 0.0-1.0
        }
      ],
      "strength": "strong|moderate|weak"
    }
  ],
  "synthesis": {
    "consensus_points": [],
    "conflicting_views": [],
    "emerging_themes": []
  },
  "recommendations": {
    "conclusions": [],
    "further_research": [],
    "action_items": []
  },
  "metadata": {
    "documents_reviewed": number,
    "retrieval_time_ms": number,
    "coverage_assessment": "comprehensive|adequate|limited"
  }
}
```

# Quality Checks
- [ ] All claims cited
- [ ] No hallucinations
- [ ] Sources verified
- [ ] Conflicting evidence noted
๐ŸŽจ Image/Diagram Generation โ–ผ
# Role
You are a Visual Communication Designer creating technical diagrams.

# Visual Requirements
- Type: {flowchart|architecture|infographic|schematic}
- Purpose: {explain|document|present}
- Audience: {technical|business|general}
- Style: {minimal|detailed|branded}

# Content to Visualize
{description_of_concepts_and_relationships}

# Constraints
- Colors: {palette_or_restrictions}
- Size: {dimensions_or_aspect_ratio}
- Format: {SVG|PNG|mermaid|plantuml}
- Accessibility: {alt_text_required}

# Output Format
```json
{
  "diagram_spec": {
    "type": "diagram_type",
    "elements": [
      {
        "id": "unique_id",
        "type": "box|circle|arrow",
        "label": "text",
        "position": {"x": 0, "y": 0},
        "style": {}
      }
    ],
    "connections": [
      {
        "from": "element_id",
        "to": "element_id",
        "label": "relationship",
        "style": "solid|dashed"
      }
    ],
    "layout": "hierarchical|circular|force"
  },
  "code": "mermaid or other diagram code",
  "alt_text": "accessibility description",
  "annotations": [
    {
      "element": "id",
      "note": "explanation"
    }
  ]
}
```

# Quality Criteria
- [ ] Visually balanced
- [ ] Logically organized
- [ ] Labels clear
- [ ] Color meaningful
- [ ] Accessible
๐Ÿ“ Executive Summary Generator โ–ผ
# Role
You are an Executive Communications Specialist creating C-suite briefings.

# Document Context
- Source: {report|analysis|proposal}
- Length: {page_count}
- Technical level: {high|medium|low}
- Urgency: {immediate|standard|FYI}

# Executive Audience
- Reader: {CEO|CFO|CTO|Board}
- Time available: {30_seconds|2_minutes}
- Decision needed: {yes|no}
- Prior context: {what_they_know}

# Summary Requirements
ONE PAGE MAXIMUM containing:
1. Bottom line upfront (BLUF)
2. Key points (3-5 bullets)
3. Financial/operational impact
4. Recommended action
5. Risk assessment

# Output Format
```json
{
  "headline": "8-10 word maximum impact statement",
  "bluf": "One sentence bottom line",
  "key_points": [
    {
      "point": "concise statement",
      "impact": "quantified where possible",
      "confidence": "high|medium|low"
    }
  ],
  "financial_impact": {
    "cost": "amount or range",
    "benefit": "amount or range",
    "roi": "percentage or timeframe",
    "assumptions": []
  },
  "recommendation": {
    "action": "specific next step",
    "timeline": "when",
    "owner": "who",
    "alternatives": []
  },
  "risks": [
    {
      "risk": "what could go wrong",
      "probability": "high|medium|low",
      "mitigation": "how to prevent"
    }
  ],
  "appendix_available": true
}
```
๐Ÿค– RC/Robotics Control Logic โ–ผ
# Role
You are a Robotics Control Engineer specializing in RC systems.

# System Specifications
- Platform: {drone|rover|boat|plane}
- Controller: {Arduino|ESP32|Pixhawk}
- Protocol: {PWM|PPM|SBUS|MAVLink}
- Channels: {number_of_channels}

# Control Requirements
- Input: {transmitter_type}
- Output: {servo|ESC|motor_driver}
- Frequency: {50Hz|400Hz|custom}
- Resolution: {bits}

# Safety Requirements
- Failsafe: {RTH|land|stop}
- Limits: {min_max_values}
- Deadband: {center_tolerance}
- Expo: {curve_parameters}

# Implementation
```cpp
// Signal timing constraints
const int PWM_MIN = {1000};  // ฮผs
const int PWM_MID = {1500};  // ฮผs
const int PWM_MAX = {2000};  // ฮผs
const int FRAME_RATE = {50}; // Hz

// Channel mapping
enum Channels {
  THROTTLE = 0,
  ROLL = 1,
  PITCH = 2,
  YAW = 3,
  AUX1 = 4,
  AUX2 = 5
};

// Decode function
int decodePWM(int pulse_width) {
  // Constrain input
  pulse_width = constrain(pulse_width, PWM_MIN, PWM_MAX);
  
  // Apply deadband
  if (abs(pulse_width - PWM_MID) < DEADBAND) {
    return 0;
  }
  
  // Map to control range
  return map(pulse_width, PWM_MIN, PWM_MAX, -100, 100);
}

// Failsafe handler
void checkFailsafe() {
  if (millis() - lastSignal > FAILSAFE_TIMEOUT) {
    enterFailsafeMode();
  }
}
```

# Output JSON
```json
{
  "control_mappings": {},
  "timing_parameters": {},
  "safety_checks": [],
  "test_sequences": []
}
```
๐Ÿ”„ Code Refactoring Assistant โ–ผ
# Role
You are a Senior Software Architect focused on clean code and design patterns.

# Refactoring Context
- Language: {programming_language}
- Framework: {if_applicable}
- Current issues: {code_smells_identified}
- Target: {performance|readability|maintainability}

# Code to Refactor
```{language}
{existing_code}
```

# Refactoring Goals
1. Apply SOLID principles
2. Reduce complexity
3. Improve testability
4. Enhance performance
5. Increase readability

# Output Format
```json
{
  "analysis": {
    "code_smells": [
      {
        "type": "smell_name",
        "location": "line_or_function",
        "severity": "high|medium|low"
      }
    ],
    "complexity_metrics": {
      "cyclomatic": number,
      "cognitive": number,
      "loc": number
    }
  },
  "refactored_code": "improved version",
  "patterns_applied": [
    {
      "pattern": "name",
      "reason": "why applied",
      "benefit": "what it improves"
    }
  ],
  "tests": {
    "unit_tests": [],
    "integration_tests": []
  },
  "migration_steps": [
    "Step-by-step refactoring process"
  ],
  "breaking_changes": []
}
```

# Quality Metrics
- [ ] Cyclomatic complexity < 10
- [ ] Test coverage > 80%
- [ ] No duplicated code
- [ ] Clear naming
- [ ] Single responsibility
๐Ÿ“‹ Test Case Generator โ–ผ
# Role
You are a QA Engineer creating comprehensive test suites.

# System Under Test
- Component: {module_or_feature}
- Type: {unit|integration|e2e}
- Language: {implementation_language}
- Framework: {testing_framework}

# Requirements to Test
```
{functional_requirements}
{non_functional_requirements}
```

# Test Strategy
- Coverage target: {percentage}
- Test types: {smoke|regression|performance}
- Data approach: {mock|stub|real}
- Environment: {local|staging|production}

# Output Format
```json
{
  "test_suite": {
    "name": "suite_name",
    "setup": "initialization_code",
    "teardown": "cleanup_code"
  },
  "test_cases": [
    {
      "id": "TC001",
      "name": "descriptive_name",
      "category": "functional|edge|negative",
      "priority": "P0|P1|P2",
      "preconditions": [],
      "input": {},
      "expected_output": {},
      "test_code": "actual test implementation",
      "assertions": []
    }
  ],
  "test_data": {
    "valid_inputs": [],
    "edge_cases": [],
    "invalid_inputs": []
  },
  "coverage_matrix": {
    "requirements": [],
    "test_mapping": {}
  },
  "performance_benchmarks": {
    "response_time": "ms",
    "throughput": "requests/sec"
  }
}
```

# Edge Cases to Include
- Boundary values
- Null/empty inputs
- Concurrent access
- Resource exhaustion
- Network failures
๐Ÿ—๏ธ API Documentation Generator โ–ผ
# Role
You are an API Documentation Specialist creating developer-friendly docs.

# API Context
- Name: {api_name}
- Version: {version}
- Protocol: {REST|GraphQL|gRPC}
- Auth: {OAuth2|API_Key|JWT}

# Endpoints to Document
```yaml
endpoints:
  - path: /endpoint
    method: GET|POST|PUT|DELETE
    description: what it does
    parameters: []
    response: {}
```

# Documentation Requirements
1. Clear descriptions
2. Request/response examples
3. Error codes
4. Rate limits
5. SDKs/code samples

# Output Format
```json
{
  "api_overview": {
    "description": "what the API does",
    "base_url": "https://api.example.com/v1",
    "authentication": {
      "type": "method",
      "details": "how to authenticate"
    },
    "rate_limits": {
      "requests_per_minute": number,
      "burst_limit": number
    }
  },
  "endpoints": [
    {
      "path": "/resource",
      "method": "HTTP_METHOD",
      "summary": "one-line description",
      "description": "detailed explanation",
      "parameters": [
        {
          "name": "param_name",
          "in": "query|path|header|body",
          "required": boolean,
          "type": "string|number|boolean",
          "description": "what it's for",
          "example": "value"
        }
      ],
      "request_body": {
        "content_type": "application/json",
        "schema": {},
        "example": {}
      },
      "responses": {
        "200": {
          "description": "Success",
          "schema": {},
          "example": {}
        },
        "400": {
          "description": "Bad Request",
          "example": {}
        }
      },
      "code_samples": {
        "curl": "example",
        "python": "example",
        "javascript": "example"
      }
    }
  ],
  "errors": {
    "error_codes": [],
    "common_issues": []
  }
}
```
๐Ÿ” Security Audit Checklist โ–ผ
# Role
You are a Security Engineer performing application security assessment.

# Application Context
- Type: {web|mobile|API|desktop}
- Stack: {technologies_used}
- Environment: {cloud|on-prem|hybrid}
- Compliance: {PCI|HIPAA|GDPR|SOC2}

# Audit Scope
- Code review: {yes|no}
- Penetration testing: {yes|no}
- Configuration review: {yes|no}
- Dependency scanning: {yes|no}

# Security Checklist
```json
{
  "authentication": {
    "multi_factor": boolean,
    "password_policy": {},
    "session_management": {},
    "findings": []
  },
  "authorization": {
    "rbac_implemented": boolean,
    "privilege_escalation_tested": boolean,
    "findings": []
  },
  "data_protection": {
    "encryption_at_rest": boolean,
    "encryption_in_transit": boolean,
    "pii_handling": {},
    "findings": []
  },
  "input_validation": {
    "sql_injection": "tested|vulnerable|secure",
    "xss": "tested|vulnerable|secure",
    "xxe": "tested|vulnerable|secure",
    "findings": []
  },
  "dependencies": {
    "vulnerable_packages": [],
    "outdated_count": number,
    "critical_updates": []
  },
  "infrastructure": {
    "firewall_rules": {},
    "exposed_services": [],
    "ssl_configuration": {},
    "findings": []
  },
  "recommendations": {
    "critical": [],
    "high": [],
    "medium": [],
    "low": []
  },
  "compliance_gaps": [],
  "remediation_plan": {
    "immediate_actions": [],
    "short_term": [],
    "long_term": []
  }
}
```

# Risk Assessment
- Overall risk: Critical|High|Medium|Low
- Exploitability: score
- Business impact: score
๐Ÿ“Š Digital Twin Configuration โ–ผ
# Role
You are a Digital Twin Architect designing virtual representations of physical systems.

# Physical System
- Type: {manufacturing|building|vehicle|infrastructure}
- Components: {list_of_major_components}
- Sensors: {sensor_types_and_count}
- Update frequency: {real-time|near-real-time|batch}

# Twin Requirements
- Fidelity level: {high|medium|low}
- Use cases: {monitoring|prediction|optimization}
- Integration: {IoT_platform|ERP|SCADA}
- Visualization: {3D|dashboard|AR_VR}

# Data Model
```json
{
  "entity_model": {
    "physical_asset": {
      "id": "unique_identifier",
      "type": "asset_type",
      "location": {},
      "specifications": {}
    },
    "sensors": [
      {
        "id": "sensor_id",
        "type": "temperature|pressure|vibration",
        "unit": "measurement_unit",
        "sampling_rate": "Hz",
        "accuracy": "ยฑvalue"
      }
    ],
    "relationships": [
      {
        "parent": "entity_id",
        "child": "entity_id",
        "type": "contains|connects|depends"
      }
    ]
  },
  "telemetry_schema": {
    "timestamp": "ISO8601",
    "sensor_id": "string",
    "value": "number",
    "quality": "good|bad|uncertain"
  },
  "state_model": {
    "operational_states": [],
    "transitions": [],
    "current_state": {}
  },
  "simulation_parameters": {
    "physics_engine": "settings",
    "time_step": "seconds",
    "convergence_criteria": {}
  },
  "ml_models": [
    {
      "type": "predictive|anomaly|optimization",
      "inputs": [],
      "outputs": [],
      "update_frequency": "schedule"
    }
  ],
  "alerts": {
    "thresholds": {},
    "predictive_maintenance": {},
    "anomaly_detection": {}
  }
}
```

# Validation
- Accuracy vs physical: {percentage}
- Latency requirement: {ms}
- Scalability: {number_of_twins}
๐Ÿ“‘ Compliance Report Generator โ–ผ
# Role
You are a Compliance Officer preparing regulatory compliance documentation.

# Compliance Context
- Regulation: {GDPR|CCPA|HIPAA|SOX|PCI-DSS}
- Organization: {company_type}
- Audit period: {date_range}
- Auditor: {internal|external}

# Scope
- Data types: {PII|PHI|financial}
- Systems: {systems_in_scope}
- Processes: {business_processes}
- Locations: {geographical_scope}

# Requirements Checklist
{specific_regulatory_requirements}

# Output Format
```json
{
  "executive_summary": {
    "compliance_status": "compliant|partial|non-compliant",
    "score": "percentage",
    "critical_findings": number,
    "report_date": "date"
  },
  "compliance_areas": [
    {
      "area": "category_name",
      "requirements": [
        {
          "id": "REQ-001",
          "description": "requirement_text",
          "status": "met|partial|not_met",
          "evidence": [],
          "gaps": [],
          "remediation": {}
        }
      ],
      "overall_status": "percentage_complete"
    }
  ],
  "findings": {
    "critical": [
      {
        "finding": "description",
        "impact": "business_impact",
        "regulation_violated": "specific_clause",
        "remediation_required": "action",
        "deadline": "date"
      }
    ],
    "major": [],
    "minor": []
  },
  "evidence_collected": {
    "documents_reviewed": [],
    "interviews_conducted": [],
    "systems_tested": [],
    "samples_examined": []
  },
  "remediation_plan": {
    "immediate": [],
    "30_days": [],
    "90_days": [],
    "long_term": []
  },
  "attestation": {
    "prepared_by": "name",
    "reviewed_by": "name",
    "approved_by": "name",
    "date": "date"
  }
}
```

# Risk Matrix
- Compliance risk: High|Medium|Low
- Financial exposure: amount
- Reputation impact: assessment
๐ŸŽฏ KPI Dashboard Specification โ–ผ
# Role
You are a Business Intelligence Architect designing KPI dashboards.

# Dashboard Context
- Purpose: {executive|operational|analytical}
- Users: {user_roles}
- Refresh rate: {real-time|hourly|daily}
- Platform: {PowerBI|Tableau|Looker|custom}

# Business Context
- Department: {sales|marketing|operations|finance}
- Goals: {business_objectives}
- Critical metrics: {must_have_kpis}
- Benchmarks: {industry_or_internal}

# KPI Definitions
```json
{
  "dashboard_layout": {
    "header": {
      "title": "dashboard_name",
      "filters": ["date_range", "region", "product"],
      "refresh_indicator": true
    },
    "kpi_cards": [
      {
        "metric": "Revenue",
        "current_value": "formula",
        "comparison": {
          "type": "period_over_period",
          "baseline": "previous_period",
          "change": "percentage"
        },
        "sparkline": true,
        "drill_down": "detailed_view",
        "thresholds": {
          "good": ">100000",
          "warning": "80000-100000",
          "critical": "<80000"
        }
      }
    ],
    "visualizations": [
      {
        "type": "line|bar|pie|heatmap",
        "title": "chart_title",
        "metrics": [],
        "dimensions": [],
        "filters": [],
        "interactions": "click|hover|zoom"
      }
    ],
    "tables": [
      {
        "title": "Detail Table",
        "columns": [],
        "sorting": "default_column",
        "pagination": true,
        "export": true
      }
    ]
  },
  "data_sources": {
    "primary": {
      "type": "database|api|file",
      "connection": {},
      "refresh_schedule": "cron"
    },
    "calculations": [
      {
        "name": "calculated_field",
        "formula": "expression",
        "description": "what_it_measures"
      }
    ]
  },
  "alerts": [
    {
      "condition": "threshold_expression",
      "recipients": [],
      "frequency": "check_interval",
      "message_template": "alert_text"
    }
  ],
  "performance": {
    "load_time_target": "seconds",
    "caching_strategy": "approach",
    "optimization_notes": []
  }
}
```

# Success Metrics
- User adoption: target
- Decision impact: measurement
- Time to insight: goal
๐Ÿ”ง Infrastructure as Code Template โ–ผ
# Role
You are a DevOps Engineer implementing infrastructure as code.

# Infrastructure Requirements
- Cloud provider: {AWS|Azure|GCP}
- Environment: {dev|staging|prod}
- Region: {cloud_region}
- Compliance: {requirements}

# Architecture
- Compute: {EC2|Lambda|Containers}
- Storage: {S3|EBS|Database}
- Network: {VPC|Subnets|Security_Groups}
- Services: {additional_services}

# IaC Tool
- Tool: {Terraform|CloudFormation|Pulumi}
- Version: {version_number}
- State management: {local|remote}

# Template Structure
```json
{
  "infrastructure": {
    "network": {
      "vpc": {
        "cidr": "10.0.0.0/16",
        "enable_dns": true,
        "tags": {}
      },
      "subnets": {
        "public": ["10.0.1.0/24", "10.0.2.0/24"],
        "private": ["10.0.10.0/24", "10.0.11.0/24"]
      },
      "security_groups": [
        {
          "name": "web_sg",
          "ingress_rules": [],
          "egress_rules": []
        }
      ]
    },
    "compute": {
      "instances": [
        {
          "name": "web_server",
          "type": "t3.medium",
          "ami": "ami-id",
          "count": 2,
          "user_data": "script"
        }
      ],
      "auto_scaling": {
        "min": 2,
        "max": 10,
        "target_cpu": 70
      }
    },
    "storage": {
      "s3_buckets": [],
      "databases": {
        "rds": {
          "engine": "postgres",
          "version": "13.7",
          "instance_class": "db.t3.medium",
          "allocated_storage": 100,
          "backup_retention": 7
        }
      }
    },
    "monitoring": {
      "cloudwatch_alarms": [],
      "log_groups": [],
      "metrics": []
    }
  },
  "deployment": {
    "pipeline": "stages",
    "rollback_plan": "procedure",
    "validation_tests": []
  },
  "cost_estimation": {
    "monthly_cost": "USD",
    "cost_optimization": []
  },
  "security": {
    "encryption": "at_rest_and_transit",
    "iam_roles": [],
    "secrets_management": "method"
  }
}
```

# Validation
- [ ] Security scan passed
- [ ] Cost within budget
- [ ] Compliance checked
- [ ] DR plan tested
๐Ÿค Stakeholder Communication Plan โ–ผ
# Role
You are a Project Manager creating stakeholder communication strategies.

# Project Context
- Name: {project_name}
- Phase: {initiation|planning|execution|closing}
- Duration: {timeline}
- Budget: {amount}
- Impact: {business_impact}

# Stakeholder Analysis
```json
{
  "stakeholder_matrix": [
    {
      "name": "stakeholder_name",
      "role": "title",
      "influence": "high|medium|low",
      "interest": "high|medium|low",
      "category": "sponsor|customer|team|vendor",
      "concerns": [],
      "expectations": []
    }
  ]
}
```

# Communication Requirements
- Frequency: {daily|weekly|monthly}
- Channels: {email|slack|meetings|reports}
- Escalation: {process}
- Documentation: {storage_location}

# Output Format
```json
{
  "communication_plan": {
    "objectives": [
      "Clear project goals",
      "Stakeholder alignment",
      "Risk transparency"
    ],
    "schedule": [
      {
        "audience": "executives",
        "message_type": "status_update",
        "frequency": "weekly",
        "format": "dashboard",
        "owner": "PM",
        "template": "exec_template"
      },
      {
        "audience": "team",
        "message_type": "daily_standup",
        "frequency": "daily",
        "format": "meeting",
        "owner": "scrum_master",
        "duration": "15_min"
      }
    ],
    "templates": {
      "status_report": {
        "sections": ["summary", "progress", "risks", "next_steps"],
        "tone": "professional",
        "length": "1_page"
      },
      "escalation": {
        "trigger": "conditions",
        "process": "steps",
        "sla": "response_time"
      }
    },
    "feedback_loops": {
      "collection_method": "surveys|meetings",
      "frequency": "sprint_end",
      "action_items": "tracking_method"
    },
    "crisis_communication": {
      "scenarios": [],
      "response_team": [],
      "templates": []
    },
    "success_metrics": {
      "stakeholder_satisfaction": "measurement",
      "message_effectiveness": "tracking",
      "engagement_rate": "calculation"
    }
  }
}
```

# Key Messages
- Project value proposition
- Success criteria
- Risk mitigation
- Timeline milestones
๐Ÿงฎ Monte Carlo Simulation Setup โ–ผ
# Role
You are a Quantitative Analyst setting up Monte Carlo simulations.

# Simulation Context
- Purpose: {risk_analysis|pricing|forecast}
- Domain: {finance|project|operations}
- Time horizon: {period}
- Confidence level: {95%|99%}

# Model Parameters
```json
{
  "variables": [
    {
      "name": "revenue",
      "distribution": "normal|lognormal|uniform|triangular",
      "parameters": {
        "mean": number,
        "std_dev": number,
        "min": number,
        "max": number
      },
      "correlation": {
        "with": "other_variable",
        "coefficient": -1_to_1
      }
    }
  ],
  "constants": {
    "fixed_costs": number,
    "tax_rate": percentage
  }
}
```

# Simulation Configuration
- Iterations: {10000|100000}
- Seed: {random_seed}
- Convergence criteria: {metric}
- Parallel processing: {yes|no}

# Output Requirements
```json
{
  "simulation_setup": {
    "model": "mathematical_formula",
    "assumptions": [],
    "limitations": []
  },
  "results": {
    "statistics": {
      "mean": number,
      "median": number,
      "std_deviation": number,
      "skewness": number,
      "kurtosis": number
    },
    "percentiles": {
      "p5": number,
      "p25": number,
      "p50": number,
      "p75": number,
      "p95": number
    },
    "probability_distributions": {
      "histogram_bins": 50,
      "density_estimation": "kernel"
    },
    "scenarios": {
      "best_case": "p95_value",
      "base_case": "mean_value",
      "worst_case": "p5_value"
    }
  },
  "sensitivity_analysis": {
    "tornado_diagram": {
      "variables": [],
      "impact_ranges": []
    },
    "correlation_matrix": []
  },
  "validation": {
    "convergence_test": "result",
    "stability_check": "passed|failed",
    "historical_backtest": "accuracy"
  },
  "recommendations": {
    "key_insights": [],
    "risk_factors": [],
    "confidence_intervals": [],
    "decision_support": []
  }
}
```

# Code Template
```python
import numpy as np
from scipy import stats

def monte_carlo_simulation(n_iterations={iterations}):
    results = []
    
    for i in range(n_iterations):
        # Generate random variables
        revenue = np.random.normal({mean}, {std})
        costs = np.random.triangular({min}, {mode}, {max})
        
        # Apply model
        outcome = revenue - costs
        results.append(outcome)
    
    return np.array(results)

# Run simulation
outcomes = monte_carlo_simulation()

# Calculate statistics
print(f"Mean: {np.mean(outcomes):.2f}")
print(f"VaR 95%: {np.percentile(outcomes, 5):.2f}")
print(f"CVaR 95%: {np.mean(outcomes[outcomes <= np.percentile(outcomes, 5)]):.2f}")
```

Before vs After Transformations

30 Examples

Example 1: Investment Analysis

โŒ Before: "Analyze this company's financials and tell me if it's a good investment."

โœ… After:

Role: You are a CFA analyzing {Company X}'s 10-K filing for investment decision.

Task: Evaluate investment potential using fundamental analysis.

Data Context:
- Fiscal years: 2021-2023
- Industry: SaaS B2B
- Market cap: $2.5B

Required Analysis:
1. Revenue growth rate (3-year CAGR)
2. Gross margin trends
3. Rule of 40 score
4. LTV/CAC ratio
5. Cash burn rate

Output Format:
```json
{
  "metrics": {
    "revenue_cagr": percentage,
    "gross_margin": percentage,
    "rule_of_40": number,
    "ltv_cac": ratio
  },
  "investment_recommendation": "buy|hold|sell",
  "confidence": 0.0-1.0,
  "key_risks": [list],
  "catalysts": [list]
}
```

Example 2: DCF Model Request

โŒ Before: "Build a DCF model for this company."

โœ… After:

Role: Financial Analyst building a 5-year DCF for {Company} valuation.

Assumptions:
- Revenue growth: Y1: 25%, Y2: 20%, Y3-5: 15%
- EBITDA margin: Current 15%, expanding 2% annually to 25%
- CapEx: 5% of revenue
- Working capital: 10% of revenue change
- Tax rate: 21%
- Terminal growth: 3%
- WACC: 12%

Output:
```json
{
  "dcf_model": {
    "revenue_projections": [year1-5],
    "fcf_projections": [year1-5],
    "terminal_value": amount,
    "enterprise_value": amount,
    "equity_value": amount,
    "price_per_share": amount
  },
  "sensitivity": {
    "wacc_range": [10%, 12%, 14%],
    "terminal_growth": [2%, 3%, 4%],
    "valuation_matrix": []
  }
}
```

Example 3: Portfolio Optimization

โŒ Before: "Optimize my portfolio."

โœ… After:

Role: Portfolio Manager optimizing asset allocation using Markowitz framework.

Current Portfolio:
- Stocks: 60% (US: 40%, International: 20%)
- Bonds: 30%
- Alternatives: 10%

Constraints:
- Risk tolerance: Moderate (Sharpe > 0.8)
- Time horizon: 10 years
- Max single position: 5%
- ESG requirement: Exclude fossil fuels
- Rebalancing: Quarterly

Historical Data: 5 years monthly returns provided

Output:
Efficient frontier with optimal weights minimizing variance for 8% target return.
Include correlation matrix, risk metrics, and backtest results.

Example 4: Risk Assessment

โŒ Before: "What's the risk of this trade?"

โœ… After:

Role: Risk Manager evaluating FX options position.

Position Details:
- Instrument: EUR/USD Call Option
- Strike: 1.15
- Expiry: 90 days
- Notional: $10M
- Current spot: 1.12
- Volatility: 12% implied

Calculate:
1. Greeks (Delta, Gamma, Vega, Theta, Rho)
2. VaR (95% confidence, 1-day)
3. Stress scenarios (ยฑ10% spot, ยฑ5% vol)
4. Maximum loss potential
5. Margin requirements

Output as JSON with all metrics, scenarios, and hedge recommendations.

Example 5: Financial Statement Analysis

โŒ Before: "Review these financial statements."

โœ… After:

Role: Forensic Accountant analyzing for red flags.

Documents: Q3 2024 10-Q filing
Focus Areas:
- Revenue recognition changes
- Accounts receivable aging
- Off-balance sheet items
- Related party transactions
- Audit opinion changes

Quality Checks:
- Benford's Law on reported numbers
- Accruals ratio trends
- Days sales outstanding
- Altman Z-score

Flag any anomalies with severity (High/Medium/Low) and specific SEC regulation references.

Example 6: M&A Valuation

โŒ Before: "Value this acquisition target."

โœ… After:

Role: Investment Banker preparing CIM valuation section.

Target: {Company B}
Industry: FinTech
Revenue: $50M (2023)
EBITDA: $8M
Growth: 40% YoY

Valuation Methods Required:
1. Comparable companies (provide 5 comps)
2. Precedent transactions (last 2 years)
3. DCF (base, bull, bear cases)
4. LBO analysis (25% IRR target)

Synergies:
- Cost: $3M annually (IT consolidation)
- Revenue: $5M by year 3 (cross-sell)

Output: Football field chart ranges + detailed assumptions

Example 7: Budget Variance Analysis

โŒ Before: "Explain budget variances."

โœ… After:

Role: FP&A Manager explaining Q3 variances to CFO.

Variances to Analyze:
- Revenue: -$2.3M (-8%) vs budget
- COGS: +$1.1M (+12%) vs budget
- OpEx: -$0.5M (-3%) vs budget
- EBITDA: -$2.9M (-35%) vs budget

For each variance provide:
1. Root cause (volume/price/mix analysis)
2. Controllable vs uncontrollable factors
3. Trending (improving/worsening)
4. Corrective actions
5. Updated Q4 forecast impact

Format: Executive one-pager with waterfall chart data

Example 8: Options Pricing Model

โŒ Before: "Price this option."

โœ… After:

Role: Quant Analyst pricing exotic option.

Option Specifications:
- Type: Asian Call (arithmetic average)
- Underlying: AAPL
- Strike: $180
- Expiry: 6 months
- Averaging: Daily over last month
- Current price: $175
- Volatility: 25%
- Risk-free rate: 4.5%
- Dividend yield: 0.5%

Required:
1. Black-Scholes baseline
2. Monte Carlo price (10,000 paths)
3. Greeks via finite difference
4. Implied volatility surface
5. P&L scenarios

Include confidence intervals and model limitations.

โŒ Before: Unclear Data Request

"Get me sales data and make a dashboard."

โœ… After: Precise Analytics Brief

Role: Data Analyst creating executive sales dashboard in Looker Studio.

Data Sources:
- sales_transactions (2023-2024)
- customer_segments
- product_catalog

Dashboard Requirements:
1. Time period: Rolling 12 months
2. Granularity: Daily/Weekly/Monthly toggle
3. Segments: Region, Product Category, Customer Tier

Key Metrics:
```json
{
  "primary_kpis": [
    {"metric": "Total Revenue", "format": "currency"},
    {"metric": "Units Sold", "format": "number"},
    {"metric": "AOV", "format": "currency"},
    {"metric": "Conversion Rate", "format": "percentage"}
  ],
  "trend_charts": [
    "Revenue over time",
    "Category mix evolution"
  ],
  "filters": ["date_range", "region", "category"]
}
```

SQL for Revenue Metric:
```sql
WITH daily_sales AS (
  SELECT 
    DATE(transaction_date) as date,
    SUM(amount) as revenue,
    COUNT(DISTINCT customer_id) as customers
  FROM sales_transactions
  WHERE transaction_date >= DATE_SUB(CURRENT_DATE(), INTERVAL 365 DAY)
  GROUP BY 1
)
SELECT * FROM daily_sales ORDER BY date DESC;
```

โŒ Before: Dangerous IoT Request

"Help me connect a motor to my ESP32."

โœ… After: Safe IoT Implementation

Role: Embedded systems engineer ensuring safe motor control with ESP32.

Hardware Specs:
- ESP32: DevKitC v4
- Motor: 12V DC, 2A stall current
- Driver: L298N H-bridge
- Power: Separate 12V 3A supply

Safety Requirements:
- ESP32 pins: 3.3V logic only
- Motor isolation required (no direct connection)
- Current limiting needed
- Emergency stop function

Pin Assignment:
```json
{
  "motor_control": {
    "enable": "GPIO 25 (PWM)",
    "dir1": "GPIO 26",
    "dir2": "GPIO 27",
    "emergency_stop": "GPIO 34 (input only)"
  },
  "safety_features": {
    "optocoupler": "recommended",
    "flyback_diodes": "required",
    "current_sense": "GPIO 35 (ADC)"
  }
}
```

Implementation:
```cpp
const int MOTOR_EN = 25;
const int MOTOR_DIR1 = 26;
const int MOTOR_DIR2 = 27;
const int E_STOP = 34;
const int CURRENT_SENSE = 35;

const float MAX_CURRENT = 1.8; // Safety margin

void setup() {
  pinMode(E_STOP, INPUT_PULLUP);
  if(digitalRead(E_STOP) == LOW) {
    // Don't start if e-stop engaged
    while(1) { delay(1000); }
  }
  
  ledcSetup(0, 5000, 8); // 5kHz PWM
  ledcAttachPin(MOTOR_EN, 0);
}

void motorSafeRun(int speed) {
  if(readCurrent() > MAX_CURRENT) {
    motorStop();
    Serial.println("OVERCURRENT PROTECTION");
  }
}
```

โŒ Before: Ambiguous Writing Request

"Write something about AI trends."

โœ… After: Targeted Content Brief

Role: Technology analyst writing for Fortune 500 executives.

Content Type: Executive briefing (one-pager)

Topic: AI adoption trends affecting enterprise operations in 2024

Target Audience:
- C-suite executives
- Non-technical background
- Decision-making focus

Structure:
```json
{
  "sections": [
    {"title": "Executive Summary", "words": 100},
    {"title": "Top 3 Trends", "words": 300},
    {"title": "Industry Impact", "words": 200},
    {"title": "Action Items", "words": 100}
  ],
  "tone": "authoritative yet accessible",
  "evidence": "cite 3+ recent studies",
  "visuals": "suggest 2 charts/graphs"
}
```

Key Messages:
1. GenAI adoption rate: 73% of enterprises (cite: McKinsey 2024)
2. ROI timeline: 6-12 months for customer service use cases
3. Primary barrier: Data governance, not technology

Success Metrics:
- Reading time: <3 minutes
- Actionable insights: 3+
- Evidence-based claims: 100%

Knowledge Check Quiz

Test Your Skills

Question 1: What's the primary problem with this prompt: "Analyze the data and give insights"?

Question 2: In the RELEARN framework, what does the 'E' in the first position represent?

Question 3: Which output format is best for downstream automation?

Quick Reference Cheatsheets

Print-Ready

๐Ÿš€ UNLEARN in 60 Seconds

  1. Uncover: What assumptions are hidden?
  2. Narrow: One clear goal only
  3. Lay out: Context + constraints
  4. End-state: How do we measure success?
  5. Arrange: Structure the prompt logically
  6. Reference: Include examples
  7. Nudge: Specify exact output format

๐Ÿ”ง RELEARN in 60 Seconds

  1. Role: Define who the AI is
  2. Evidence: Ground in data/facts
  3. Limits: Set boundaries clearly
  4. Evaluation: Plan how to test
  5. Actionable: Step-by-step process
  6. Response: Machine-readable format
  7. Next: Plan iterations

๐Ÿšจ Top 15 Prompt Smells

  1. No role defined
  2. Multiple goals mixed
  3. No constraints given
  4. Vague success criteria
  5. No examples provided
  6. Unstructured output
  7. Hidden assumptions
  8. No evaluation plan
  9. Context dump without summary
  10. No token budget
  11. Missing domain context
  12. No safety checks
  13. No citation requirement
  14. Confirmation bias built-in
  15. No iteration plan

๐Ÿ›ก๏ธ Hallucination Guards

  • โœ… Require citations for all claims
  • โœ… Ask for confidence scores
  • โœ… Include "say 'I don't know' if uncertain"
  • โœ… Request evidence chain
  • โœ… Define authoritative sources
  • โœ… Add fact-checking step
  • โœ… Include validation tests