20+ Engineering Frameworks

Prompt Engineering Reference Library

Production-grade prompts require structure, not improvisation. Our system analyzes your inputs and automatically selects from 20+ proven frameworks to generate deterministic, high-fidelity outputs.

01

Structured Context Frameworks

Constrain LLM outputs by injecting structured context across multiple dimensions. These frameworks eliminate ambiguity by requiring explicit specification of role, audience, format, and tone.

CO-STAR

The most comprehensive context injection framework. Six orthogonal dimensions ensure the model receives complete specifications for any task — from creative writing to data analysis.

Best For

Content creation, analysis, professional communication

Select When

Tasks requiring balanced control over multiple output dimensions

C

Context

Background information and domain knowledge the model needs to understand the task scope.

O

Objective

The specific, measurable outcome expected from the model's response.

S

Style

Writing register and approach — academic, conversational, journalistic, technical.

T

Tone

Emotional register — authoritative, empathetic, neutral, urgent.

A

Audience

Target reader profile that determines vocabulary, depth, and assumptions.

R

Response

Exact output structure — JSON schema, markdown template, bullet list, table.

co-star-output.md

User Input

"Write a blog post about microservices for our engineering blog"

Engineered Output — CO-STAR Framework

### CONTEXT You are writing for an enterprise engineering blog read by senior software architects and platform engineers. The organization is migrating from a monolithic Java application to a distributed microservices architecture on Kubernetes. ### OBJECTIVE Produce a 1,200-word technical blog post that explains the key architectural trade-offs between monolithic and microservices patterns, with emphasis on data consistency, service boundaries, and operational complexity. ### STYLE Technical writing with concrete code examples and architecture diagrams described in text. Reference established patterns from Domain-Driven Design (DDD) and the Twelve-Factor App methodology. ### TONE Authoritative yet pragmatic. Acknowledge trade-offs honestly rather than advocating unconditionally. ### AUDIENCE Senior engineers (5+ years experience) who understand distributed systems fundamentals but need guidance on migration strategy. ### RESPONSE FORMAT Markdown with H2/H3 headers, inline code blocks for API examples, and a "Key Takeaways" summary section at the end.

CREATE

Designed for original content production where brand voice and creative direction are paramount. Adds explicit execution instructions that CO-STAR lacks.

Best For

Marketing copy, storytelling, brand voice development

Select When

Creative output requiring stylistic control and audience targeting

C — Context
R — Role
E — Explicit Instructions
A — Audience
T — Tone
E — Execution
create-output.md

User Input

"Write launch copy for our new AI productivity app"

Engineered Output — CREATE Framework

### CONTEXT A B2B SaaS startup is launching an AI-powered productivity suite targeting remote engineering teams. The product integrates with Slack, Jira, and GitHub to automate standup reports, PR summaries, and sprint retrospectives. ### ROLE You are a Senior Product Copywriter specializing in developer tools. Your writing balances technical credibility with emotional resonance. You have shipped launch campaigns for tools like Linear, Raycast, and Warp. ### EXPLICIT INSTRUCTIONS 1. Write a hero headline (max 8 words) and subheadline (max 25 words) 2. Write 3 feature blocks, each with a bold title and 2-sentence description 3. Write a closing CTA paragraph that creates urgency without artificial scarcity 4. NEVER use buzzwords: "revolutionary", "game-changing", "synergy" 5. ALWAYS ground benefits in specific time savings (e.g., "saves 4 hours/week") ### AUDIENCE Engineering managers and tech leads at Series A-C startups (50-500 employees) who are frustrated with meeting overhead consuming their team's deep work time. ### TONE Confident and direct. The voice of a sharp engineer who also understands business impact. Think Stripe's documentation meets Linear's marketing. ### EXECUTION Deliver as structured Markdown. Use line breaks between sections. Include placeholder text marked [SCREENSHOT] where visual assets should be inserted.
P

PROMPT

Persona, Request, Output, Modifier, Purpose, Tone

Fine-grained control over voice, format, and intent. Best for brand-specific content where persona consistency is critical across multiple outputs.

Best For

Brand content, persona consistency, stylistic precision

prompt-output.md

User Input

"Generate social media captions for our coffee brand"

Engineered Output — PROMPT Framework

### PERSONA You are the social media voice of a premium specialty coffee roaster based in Portland. Your personality is warm, knowledgeable, and slightly irreverent. You reference origin stories, roast profiles, and brewing science naturally — never pedantically. ### REQUEST Write 5 Instagram captions for single-origin coffee releases, each paired with a suggested posting time and hashtag set. ### OUTPUT Structured list with fields: [Caption (max 150 chars)], [Posting Time], [Hashtags (5 max)], [CTA Type: link-in-bio | comment | share] ### MODIFIER Captions must vary in structure — mix questions, statements, and micro-stories. No two captions should open with the same word. ### PURPOSE Drive engagement (comments + saves) on product launch posts and build brand affinity with specialty coffee enthusiasts aged 25-40. ### TONE Warm, curious, slightly playful. Like a knowledgeable barista who genuinely loves their craft — not a corporate account.
02

Reasoning & Logic Frameworks

Force LLMs to decompose problems systematically. These techniques improve accuracy by 40%+ on tasks requiring logical inference, multi-step computation, or sequential processing.

Chain of Thought

LLMs are probabilistic token generators, not reasoning engines. Chain of Thought forces explicit intermediate reasoning steps, converting implicit pattern matching into auditable logical chains.

Best For

Mathematical reasoning, code debugging, logical analysis

Select When

Any task where the model must derive an answer rather than recall one

chain-of-thought-comparison.md

Zero-Shot (No Reasoning Chain)

User:

A server processes 150 requests/sec. After optimization, throughput increases by 40%. Under peak load (3x normal), what is the max request rate?

Model: 450 requests/sec (Incorrect — skipped the optimization step)

CoT Prompt (Explicit Reasoning)

User:

A server processes 150 requests/sec. After optimization, throughput increases by 40%. Under peak load (3x normal), what is the max request rate? Solve step-by-step. Show your work.

Step 1: Base throughput = 150 req/sec

Step 2: After 40% optimization = 150 × 1.4 = 210 req/sec

Step 3: Peak load at 3x = 210 × 3 = 630 req/sec

Answer: 630 requests/sec

Self-Consistency

Generates multiple independent Chain-of-Thought reasoning paths for the same problem, then selects the answer with the highest frequency. This ensemble approach reduces variance and catches reasoning errors that any single path might introduce.

Best For

High-stakes calculations, ambiguous problems

Select When

When a single reasoning path may be unreliable

Parallel Reasoning Paths

Path A630150→210→630
Path B630150×1.4×3
Path C450150×3 (error)
Consensus: 630 req/sec (2/3 agreement)
R

RISE

Role, Input, Steps, Expectation

Engineered for complex multi-step processes that demand procedural precision. Each step becomes a checkpoint, enabling validation at every stage of execution.

Best For

Data pipelines, computational workflows, CI/CD processes

rise-output.md

User Input

"Process and validate uploaded CSV data for our analytics pipeline"

Engineered Output — RISE Framework

### ROLE You are a Senior Data Engineer responsible for an ETL pipeline that ingests customer transaction data into a PostgreSQL data warehouse. You enforce strict schema validation and data quality standards. ### INPUT A CSV file containing transaction records with columns: [transaction_id, customer_id, amount, currency, timestamp, status]. Expected volume: 10K-500K rows. Possible issues: null values, duplicate IDs, malformed timestamps, negative amounts. ### STEPS 1. **Schema Validation** — Verify all 6 required columns exist. Reject the file if any column is missing. Log column names found vs. expected. 2. **Type Casting** — Parse timestamp as ISO 8601, amount as decimal(10,2), status as enum [completed, pending, failed, refunded]. 3. **Deduplication** — Identify duplicate transaction_ids. Keep the record with the latest timestamp. Log duplicates removed. 4. **Anomaly Detection** — Flag transactions where amount > 3 standard deviations from the mean for that customer_id. Do not remove — tag for review. 5. **Output Generation** — Write cleaned data to a new CSV. Generate a validation report summarizing: rows processed, rows rejected, duplicates removed, anomalies flagged. ### EXPECTATION Two output files: (1) cleaned CSV ready for warehouse ingestion, (2) JSON validation report with fields: {total_rows, valid_rows, rejected_rows, duplicates, anomalies, processing_time_ms}.
03

Business & Strategy Frameworks

Structured approaches for strategic analysis, decision support, and professional documentation. These frameworks mirror established consulting methodologies adapted for LLM-driven output.

S

SCOPE

Situation, Complication, Objective, Plan, Evaluation

Mirrors McKinsey's Situation-Complication-Resolution framework. Forces rigorous problem decomposition before solution generation — preventing the model from jumping to conclusions.

Best For

Market research, strategic planning, consulting deliverables

scope-output.md

User Input

"Analyze whether we should expand into the European market"

Engineered Output — SCOPE Framework

### SITUATION A Series B SaaS company ($12M ARR) with 85% of revenue from North American enterprise clients is evaluating European market expansion. Current product supports English only. The engineering team is 45 people, primarily based in San Francisco. ### COMPLICATION - GDPR compliance requires significant infrastructure changes (data residency, consent management, right to erasure) - Competitors (3 established EU-based alternatives) have localized products in 4+ languages - Current sales motion (outbound SDR-driven) has not been tested in European buying cycles - EUR/USD volatility introduces pricing complexity ### OBJECTIVE Produce a go/no-go recommendation with supporting evidence, risk quantification, and a phased execution plan if the recommendation is "go." ### PLAN 1. Quantify the Total Addressable Market for EU enterprise segment 2. Map regulatory requirements to engineering effort (story points and timeline) 3. Analyze competitive positioning: feature parity, pricing, brand recognition 4. Model unit economics under 3 scenarios: conservative, moderate, aggressive 5. Define Phase 1 market (single country) selection criteria ### EVALUATION Success criteria: (1) TAM justifies >$5M incremental ARR within 18 months, (2) engineering investment <$2M, (3) regulatory risk is manageable without dedicated legal entity in Year 1.
S

STAR

Situation, Task, Action, Result

The behavioral interview standard, adapted for AI-generated professional documentation. Structures achievements as evidence-based narratives with quantified outcomes.

SITUATIONEstablish the professional context and challenge
TASKDefine the specific responsibility or objective
ACTIONDetail the concrete steps and decisions made
RESULTQuantify the outcome with metrics and impact
Best for: Performance reviews, resume bullets, impact reports, case studies
R

ROSES

Role, Objective, Scenario, Expected Solution, Steps

Scenario planning and hypothesis testing framework. Forces the model to simulate conditions, evaluate outcomes, and produce contingency-aware recommendations.

ROLEExpert persona for the simulation domain
OBJECTIVEWhat the scenario analysis should determine
SCENARIOHypothetical conditions and variables
SOLUTIONExpected outcome or recommendation
STEPSExecution sequence with decision points
Best for: Risk assessment, contingency planning, war-gaming exercises
04

Technical & Documentation Frameworks

Purpose-built for engineering artifacts — API specifications, integration guides, debugging workflows, and research documentation that demands precision and completeness.

T

TRACE

Task, Request, Action, Context, Example

Maximum-specification framework for technical documentation. Every section reduces one axis of ambiguity, culminating in concrete examples that serve as executable test cases.

Best For

API documentation, integration guides, technical specifications

trace-output.md

User Input

"Document our REST API endpoint for creating user accounts"

Engineered Output — TRACE Framework

### TASK Write comprehensive API documentation for the POST /api/v2/users endpoint, suitable for inclusion in our public developer documentation portal. ### REQUEST Document the endpoint's authentication requirements, request schema (with all field validations), response codes, rate limiting behavior, and idempotency guarantees. Include curl examples and SDK snippets for Python and TypeScript. ### ACTION 1. Define the endpoint signature: method, path, content-type, required headers 2. Specify request body schema with JSON Schema notation (types, required fields, constraints) 3. Enumerate all response codes (201, 400, 401, 409, 422, 429, 500) with example response bodies 4. Document rate limits: 100 requests/minute per API key, with X-RateLimit headers 5. Explain idempotency: requests with matching Idempotency-Key return cached responses for 24 hours ### CONTEXT The API serves a developer platform with 2,000+ active integrators. Authentication uses Bearer tokens (JWT). The audience ranges from junior frontend developers to senior backend engineers. All examples must use the v2 API base URL: https://api.example.com/v2. ### EXAMPLE ```bash curl -X POST https://api.example.com/v2/users \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: unique-request-id" \ -d '{"email": "dev@example.com", "name": "Jane Doe", "role": "admin"}' ``` Response (201 Created): ```json {"id": "usr_abc123", "email": "dev@example.com", "created_at": "2025-01-15T10:30:00Z"} ```

5W1H

Who, What, Where, When, Why, How

Journalistic completeness framework. Ensures no critical information axis is omitted — particularly effective for research briefs, incident reports, and factual documentation.

WHO → Actors, stakeholders, affected parties
WHAT → The event, finding, or deliverable
WHERE → Geographic, systemic, or codebase location
WHEN → Timeline, deadlines, temporal context
WHY → Root cause, motivation, strategic rationale
HOW → Methodology, process, implementation details
Example use: Post-mortem for a production outage — ensures every investigation dimension is covered.

CARE

Context, Action, Result, Example

Debugging and troubleshooting framework. Demonstrates expected behavior through concrete exemplars — teaching the model what "correct" looks like before it attempts to solve.

CONTEXT → System state and conditions
ACTION → What to do or investigate
RESULT → Expected outcome or resolution
EXAMPLE → Concrete demonstration of correct behavior
Example use: Code review feedback that explains the bug, the fix, and shows the corrected implementation.
G

GRADE

Goal, Request, Action, Details, Examples

Pedagogical framework optimized for knowledge transfer. Scaffolds learning progression from objectives through detailed instruction to concrete demonstrations.

Best For

Tutorials, explainers, learning materials, onboarding docs

grade-output.md

User Input

"Create a tutorial on implementing JWT authentication in Node.js"

Engineered Output — GRADE Framework

### GOAL Teach intermediate Node.js developers how to implement stateless JWT authentication with refresh token rotation, covering security best practices and common pitfalls. ### REQUEST Write a step-by-step tutorial (2,000 words) that a developer can follow to build a complete auth system from scratch. Include code that can be copy-pasted into a working Express.js application. ### ACTION 1. Explain the JWT authentication flow (access token + refresh token) with a sequence diagram in text 2. Set up the Express.js project with required dependencies (jsonwebtoken, bcrypt, cookie-parser) 3. Implement user registration with password hashing (bcrypt, 12 salt rounds) 4. Implement login endpoint that returns access token (15min) and refresh token (7d) 5. Build authentication middleware that validates and decodes tokens 6. Implement refresh token rotation with token family tracking 7. Add common security hardening: HTTP-only cookies, CSRF protection, rate limiting ### DETAILS - Access tokens: HS256 algorithm, 15-minute expiry, stored in memory (never localStorage) - Refresh tokens: stored in HTTP-only secure cookies with SameSite=Strict - Token rotation: each refresh invalidates the previous token family to detect theft - Error handling: distinguish between expired, malformed, and revoked tokens ### EXAMPLES Include 3 complete code blocks: (1) auth middleware, (2) login endpoint, (3) refresh endpoint. Each block must include inline comments explaining security-critical decisions.
05

Rapid Execution Frameworks

Lightweight structures for tasks that need speed over depth. Minimal overhead, maximum clarity — when a 3-field specification is all you need.

R

RTF

Role, Task, Format

The fastest path from intent to structured output. Assign a role, define the task, specify the format. No overhead.

ROLEAct as a Senior Database Administrator
TASKWrite a query to find customers with >$10K lifetime value
FORMATPostgreSQL query with inline comments explaining each JOIN
Best for: Quick queries, structured outputs, rapid iteration
A

APE

Action, Purpose, Expectation

Optimized for delegation to autonomous agents. Defines what to do, why, and what success looks like — the minimum viable specification for automated workflows.

ACTIONScan the codebase for deprecated API calls
PURPOSEPrepare for v3 migration by identifying breaking changes
EXPECTJSON array: [{file, line, deprecated_call, replacement}]
Best for: Workflow automation, CI/CD tasks, agent delegation
E

ERA

Expectation, Role, Action

Leads with the expected outcome, then assigns the expert and task. Best for quick consultations where you know what you want but need expert execution.

EXPECTA concise risk assessment with severity ratings (P0-P3)
ROLEAct as a Cloud Security Engineer (AWS-certified)
ACTIONReview these IAM policies for privilege escalation vectors
Best for: Expert consultations, quick audits, opinion requests
T

TAG

Task, Action, Goal

Purpose-driven execution where the 'why' matters as much as the 'what'. Aligns the model's reasoning with your strategic objective, producing goal-aware outputs.

TASKRewrite our error messages across the application
ACTIONReplace technical jargon with user-friendly language
GOALReduce support ticket volume by 30% through self-service clarity
Best for: Strategic alignment, objective-driven tasks, OKR-linked work
06

Persuasion & Narrative Frameworks

Structures rooted in classical rhetoric and storytelling theory. These frameworks engineer emotional arcs, logical arguments, and transformation narratives.

B

BAB

Before, After, Bridge

The conversion copywriter's workhorse. Paint the painful current state, reveal the desired future, then position your solution as the bridge between them.

BEFORE:Your team spends 6+ hours/week in status meetings that could be async
AFTER:Automated standup summaries. Zero meetings. 30% more deep work time.
BRIDGE:Our AI reads your Slack and Jira, generates summaries, posts to #standups at 9am.
Best for: Sales pages, email campaigns, product launch copy
S

SOAR

Situation, Obstacle, Action, Result

Hero's journey structure for professional narratives. The obstacle creates tension, the action demonstrates competence, and the result delivers the payoff.

SITUATION:E-commerce platform handling $2M/day in transactions
OBSTACLE:Checkout latency spiked to 8s during Black Friday — 23% cart abandonment
ACTION:Implemented Redis caching + database connection pooling in 48 hours
RESULT:Latency dropped to 400ms. Cart abandonment fell to 8%. $340K recovered.
Best for: Case studies, testimonials, portfolio narratives
P

PREP

Point, Reason, Example, Point

Classical rhetoric adapted for AI. State the thesis, provide evidence, demonstrate with a concrete example, then reinforce the thesis. Builds irrefutable logical arguments.

POINTState the core argument or position clearly
REASONProvide logical evidence and data supporting the point
EXAMPLEConcrete demonstration that makes the argument tangible
POINTReinforce the thesis with the added weight of evidence
Best for: Opinion pieces, debate preparation, technical proposals

PAIN

Problem, Action, Information, Next Steps

Structured problem-resolution framework designed for support workflows and incident management. Progresses linearly from diagnosis to resolution to follow-up.

PROBLEMDefine the issue with symptoms, scope, and impact
ACTIONImmediate remediation steps to resolve or mitigate
INFORoot cause analysis and contributing factors
NEXTPreventive measures and follow-up tasks
Best for: Customer support, incident response, troubleshooting guides
07

Advanced Optimization Techniques

Cross-cutting techniques applied automatically by our engine on top of any framework selection. These optimizations are what separate amateur prompts from production-grade engineering.

Few-Shot Prompting

Rather than describing the desired behavior, demonstrate it. Providing 2-5 input-output exemplars conditions the model to replicate the exact pattern, tone, and format — bypassing instruction ambiguity entirely.

Best For

Consistent formatting, classification, style mimicry

Select When

When examples communicate the pattern better than instructions

few-shot-classification.md

System Instruction

Classify customer feedback into categories. Follow the exact format shown in the examples.

Exemplars

Input: "The checkout page loads extremely slowly on mobile"

Output: {category: "performance", severity: "high", component: "checkout", platform: "mobile"}

Input: "Would be great if you supported dark mode"

Output: {category: "feature_request", severity: "low", component: "ui", platform: "all"}

Input: "Payment failed but I was still charged twice"

Output: {category: "bug", severity: "critical", component: "payments", platform: "all"}

Input: "The search results don't match what I typed"

Output: {category: "bug", severity: "high", component: "search", platform: "all"}

Persona Engineering

Deep role specification with expertise credentials, decision-making frameworks, and behavioral constraints. Transforms generic responses into domain-expert outputs.

Weak

Act as a marketing expert

Engineered

You are a Senior Growth Marketer with 12 years of B2B SaaS experience. Your analytical framework combines attribution modeling with cohort analysis. You prioritize CAC:LTV ratios over vanity metrics.

Constraint Specification

Explicit boundary enforcement using positive (MUST/ALWAYS) and negative (NEVER/AVOID) directives. Critical constraints are placed at both the start and end of the prompt for reinforcement.

Weak

Keep it short and professional

Engineered

MUST: Under 200 words. ALWAYS: Include one data point per claim. NEVER: Use passive voice or hedge words (might, perhaps, could). Format: 3 bullet points max.

Output Determinism

Exact structural specifications that eliminate format ambiguity. Define schemas, field names, data types, and validation rules so the output is machine-parseable.

Weak

Return the results as JSON

Engineered

Return JSON matching this schema: {results: [{id: string, score: float(0-1), label: enum["positive","negative","neutral"], confidence: float}], metadata: {model: string, processed_at: ISO8601}}

Structural Delimiters

Semantic markup using ###, ===, ---, and XML-style tags to create clear boundaries between instructions, context, and data. Prevents instruction-data confusion.

Weak

Here is some context and here is what I want you to do

Engineered

### INSTRUCTIONS Analyze the text below. ### INPUT DATA <<< {user_provided_text} >>> ### OUTPUT FORMAT Return analysis as specified above.

Context Hierarchies

Information density optimization — front-load critical parameters, layer supporting details, and place reinforcement constraints at the end. Mimics the inverted pyramid from journalism.

Weak

I want you to write something about our product for social media considering our brand voice and target audience

Engineered

PRIMARY: Write 3 LinkedIn posts for product launch. CONTEXT: B2B analytics platform for CFOs. VOICE: Data-driven, authoritative. CONSTRAINT: Each post under 150 words.

Ambiguity Elimination

Replace subjective qualifiers with quantified specifications. Every vague term is resolved to a measurable criterion that the model can deterministically satisfy.

Weak

Write a good, detailed summary

Engineered

Write a 150-200 word summary. Include: 3 key findings (each with one supporting statistic), 1 recommendation, and 1 limitation. Reading level: Grade 10 (Flesch-Kincaid).

Automatic Framework Selection

You don't need to memorize these frameworks. Our system analyzes your inputs — goal, role, audience, format, tone, complexity, and domain — then automatically selects and applies the optimal framework with advanced optimizations layered on top.

20+

Engineering Frameworks

7

Optimization Layers

11

Input Dimensions

<2s

Generation Latency

Ready to engineer production-grade prompts?

Stop guessing. Start engineering. Our system selects the right framework and applies advanced optimizations automatically.

Start Engineering