Utilities
Prompt Book

Structured Literature Review

Task: Produce a concise literature review on {TOPIC}.
Constraints:
- 5–7 key papers (last 5 years preferred)
- For each: 1–2 line finding, method, limitation
- End with gaps + future work directions
Formatting: Bulleted sections: Findings, Methods, Limitations, Gaps, Next Steps.

Turn Spec into Implementation Plan

You are a senior engineer. Convert this product spec into a step-by-step implementation plan.
Include: architecture diagram (text), data models, endpoints, component list, risks, roll-out steps.
Spec:
{SPEC}

Refactor Roadmap (Safety First)

Given this codebase summary, propose a 2–4 week refactor roadmap.
Rules: preserve behavior, add tests first, small PRs, feature flags, performance baselines.
Input:
{CODEBASE_SUMMARY}

Root Cause Debugger

Act as a senior debugger. For this bug report, propose hypotheses ranked by likelihood.
For each hypothesis: reproduction, logs to add, metrics to check, quick fix vs real fix.
Bug:
{BUG_REPORT}

Pragmatic API Design

Design a minimal, versioned REST API for {DOMAIN}.
Include: resources, endpoints, auth, pagination, errors, rate limits, idempotency, sample requests.

SQL to Insights

You are a data analyst. Given this schema, propose 10 practical SQL queries that drive decisions.
Each query: purpose, SQL, expected output columns, business action.
Schema:
{SCHEMA}

UX Wireframe Explainer

Given a feature, write a UX wireframe outline: primary tasks, user flows, states (empty/loading/error), accessibility, mobile breakpoints, success criteria.
Feature:
{FEATURE}

Project Risk Register

Create a risk register for {PROJECT}. Include: risk, probability (L/M/H), impact (L/M/H), mitigation, owner, trigger.

Production Launch Checklist

Checklist for launching {SERVICE}: observability, alerts, rollback plan, SLOs, capacity, security review, backups, runbooks, on-call, comms.

Sharpen Research Question

Refine this research question into a testable hypothesis, list variables, method, sample size estimate, potential biases.
Question:
{QUESTION}

Actionable Code Review

Review this diff. Focus on correctness, complexity, consistency, naming, tests, and security. Suggest specific, small edits.
Diff:
{DIFF}

Query Fields from File

You have been given a file (Excel or CSV) as input.
Step 1: Inspect the file and extract the exact list of column names in the order they appear.
Step 2: For each column, generate a short description of what that field likely represents based on its name and the data within it (for example, if a column is called txn_date and contains dates, describe it as “Transaction date in YYYY-MM-DD format”).
Step 3: Construct a new prompt that explicitly lists all fields with their descriptions and asks a chatbot to use them.

Your output should be in this format:

===== FIELD LIST =====
1. field_1 – short description
2. field_2 – short description
...
===== FINAL PROMPT =====
"Please analyze the uploaded file using these fields:
field_1 (short description),
field_2 (short description),
...
Use these exact fields and descriptions when answering questions or generating insights."
===== END =====

Do not summarize the data itself — just extract field names and infer concise descriptions so that a chatbot can correctly interpret them.