Prompt Templates & Checklists

Copy-paste scaffolds for the highest-leverage moves, plus checklists you can run before, during, and in production.

Cache-friendly system scaffold

Use when: Any repeated or multi-turn API workload.

[STABLE — cache this prefix, keep byte-identical]
Role: <assistant role>
Policies: <rules, tone, refusals>
Tools: <tool/function definitions>
Reference: <large doc / schema / examples>

[VOLATILE — changes per request, place last]
User request: {{input}}

Model-routing decision

Use when: Choosing the cheapest model that will still pass.

Classify this task's difficulty as SIMPLE | MODERATE | HARD.
SIMPLE = extraction/classification/format → cheapest tier.
MODERATE = standard coding/writing → mid tier.
HARD = multi-step reasoning/novel design → flagship.
Return only the label and the chosen model.
Task: {{task}}

Output control snippet

Use when: Chatty tasks where output tokens dominate.

Answer only. No preamble, no restating the question, no summary.
Format: {{format e.g. JSON matching schema X}}.
Max length: {{n}} tokens. Stop when complete.

Plan-before-build (draft in Claude/ChatGPT, paste to Lovable)

Use when: Before spending Lovable credits on a feature.

You are my app architect. Produce a single Lovable build prompt for:
<feature description>.
Include: data model, components, states/edge cases, acceptance criteria,
and explicit 'do NOT touch' areas. Keep it specific enough to build in one pass.

Compaction / handoff summary

Use when: A long session is approaching the context limit.

Summarize this session into a compact handoff:
- Goal & constraints
- Decisions made (with rationale)
- Current state (files/data touched)
- Open questions / next step
Drop raw logs and resolved detours. Be terse.

RAG context-trim instruction

Use when: Long retrieved chunks inflating the prompt.

From the context below, keep only sentences needed to answer the question.
Discard background, repetition, and unrelated detail. Then answer.
Question: {{q}}
Context: {{chunks}}

CLAUDE.md / AGENTS.md starter

Use when: Setting up a coding-agent project memory.

# Project conventions
Stack: <framework, language, key libs>
Structure: <where things live>
Naming: <conventions>
Do: <patterns to follow>
Don't: <anti-patterns, files to avoid>
Testing: <how to run/verify>
Keep this file lean — it rides in context on every call.

.cursor/rules starter

Use when: Standing guidance for Cursor.

- Framework: <X>. Prefer <patterns>.
- Naming: <conventions>.
- Always: <e.g. typed props, error handling>.
- Never: <e.g. inline styles, any-types>.
- Scope context with @file/@folder; avoid @codebase unless necessary.

Checklists

Before a session

  • Pick the smallest model that can plausibly do the job.
  • Draft and refine the prompt in a free chat before spending paid credits.
  • Load standing rules via instruction file (CLAUDE.md / .cursorrules), not the prompt.
  • Decide what context is actually needed — nothing more.

Every prompt

  • Stable content first, volatile content last (cache-friendly order).
  • Ask for terse output, a fixed format, and no preamble.
  • Cap output length / set max_tokens.
  • Reference or diff instead of re-pasting whole files.

Production / API

  • Enable prompt caching and structure prompts to maximize hit rate.
  • Route by task complexity; escalate only on low confidence.
  • Move non-urgent jobs to Batch.
  • Add a semantic cache for repetitive query shapes.
  • Set agent step/tool/token budgets and early-exit on success.

FinOps & governance

  • Tag every call by feature/team/use-case (target: high tagging coverage %).
  • Track cost per 1K calls and budget utilization %.
  • Set budgets and anomaly alerts.
  • Review token economics in a regular cadence; fold it into architecture decisions.