Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Llm App Engineering?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ansh44233-llm-app-engineering)
---
description: Build features on LLM APIs: prompts as code, structured output, evals, cost and latency budgets, and prompt-injection defenses
profile: standard
tags: ai, llm, backend
---
# LLM application engineering
Use when code calls a model API (Anthropic, OpenAI, Gemini, local models).
## Prompts are code
- Keep prompts in versioned files or constants next to the code that uses them, with the variables clearly marked.
- Separate instructions from data. Put untrusted content (user input, web pages, documents, tool output) in clearly delimited sections and tell the model to treat it as data.
- Ask for structured output (JSON schema / tool calling) and validate it with a schema; retry or fail clearly on invalid output.
## Evals before shipping
- Build a small eval set of real inputs with expected properties (correct fields, refusal when appropriate, no leaked secrets).
- Run it on every prompt or model change and compare against the previous version. Track the pass rate, not vibes.
## Cost and latency
- Log tokens in and out per request. Set `max_tokens`. Use prompt caching for long stable prefixes where the provider supports it.
- Route easy tasks to smaller models and keep the big model for hard ones; measure quality on the eval set when you switch.
- Stream long responses, set timeouts, and retry only on retryable errors (429/5xx) with backoff.
## Safety
- The model's output is untrusted: never execute it, never render it as raw HTML, and validate any action it proposes against an allow-list.
- Tools the model can call must enforce the user's permissions server-side.
- Keep API keys on the server; never ship them to the browser or mobile apps.
## Verify
Unit tests with recorded responses or a stub client, the eval run, and a check that logs contain no prompts with personal data unless that is intended and disclosed.