agentleFS
anandartinanandartin/celestial-skills/skills/llm-features-and-evals-engineering/AGENTS.md

celestial-skills / llm-features-and-evals-engineering

AGENTS.md1 starsChanged 18 days agoApache-2.0View on GitHub

Build features on large language models with versioned prompts, an evaluation set that gates every change, guardrails and cost and latency budgets, so quality is measured instead of hoped for. Generated from the Celestial engineering practice “LLM features and evals”.

The file

We split this AGENTS.md into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Treat everything the model returns, and everything it reads from users or documents, as untrusted.

    line 25
  2. Distinctive:

    Remove or mask personal data before logging prompts and outputs.

    line 27
  3. Distinctive:

    Never change a prompt, model or temperature without re-running the evaluation set.

    line 30

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md — LLM features and evals

Build features on large language models with versioned prompts, an evaluation set that gates every change, guardrails and cost and latency budgets, so quality is measured instead of hoped for.

How to do it

  1. Define the task and success — Write what the feature must produce, for which inputs, and how a good answer differs from a bad one. Turn that into measurable criteria: exact match, schema validity, rubric score or human rating.
  2. Build an evaluation set first — Collect 30 to 100 realistic inputs, including edge cases, adversarial inputs and known past failures, each with an expected output or grading rubric. Store it in the repository.
  3. Keep prompts as versioned code — Store prompts in files next to the code with variables for inputs, review them in pull requests, and log the prompt version with every request.
  4. Constrain the output — Ask for structured output against a schema, validate it in code, and handle invalid responses with one retry and then a defined fallback.
  5. Add guardrails — Treat model output as untrusted input: validate, escape and authorise before acting on it. Separate system instructions from user content, limit which tools the model may call, and filter for unsafe content where the domain requires.
  6. Set cost and latency budgets — Set a maximum tokens per request, cost per request and p95 latency. Choose the smallest model that passes the evals, cache repeated context, and stream responses where users wait.
  7. Gate changes on evals — Run the evaluation set in CI on every prompt, model or parameter change and compare against the last accepted baseline. Block merges that drop the score beyond the agreed tolerance.
  8. Monitor in production — Log inputs, outputs, prompt version, tokens, cost and latency with personal data removed. Sample outputs for review and add real failures to the evaluation set.

Checklist (before a pull request)

  • An evaluation set with edge and adversarial cases lives in the repository
  • The eval score meets the baseline for the current prompt and model
  • Prompts are versioned files and the version is logged per request
  • Model output is schema-validated and never executed or rendered unescaped
  • Cost per request and p95 latency are within the stated budgets
  • A fallback exists for model errors, timeouts and invalid output
  • API keys come from environment variables or a secret store

Rules

  • Treat everything the model returns, and everything it reads from users or documents, as untrusted. (Prompt injection turns any text the model sees into a possible instruction.)
  • Give model-driven tools the narrowest permissions and require confirmation for irreversible actions. (A misled model can only do damage its tools allow.)
  • Remove or mask personal data before logging prompts and outputs. (Logs are retained and widely accessible.)
  • Enforce a timeout and maximum output tokens on every model call. (Unbounded calls create unbounded cost and hung requests.)
  • Show a clear, honest state when the model fails or is unsure, and let the user retry or continue without it. (Users need a way forward when generation fails.)
  • Never change a prompt, model or temperature without re-running the evaluation set. (Small wording changes can shift behaviour across many inputs.)

Checks

GateToolThresholdWhen
Eval regressionEvaluation harness in CIScore at or above baseline minus 2 points; 0 schema failures; 0 safety failuresEvery pull request changing a prompt, model or parameter
Cost and latency budgetEval run metricsMean cost and p95 latency per request within the feature's stated budgetEvery pull request changing a prompt, model or parameter

Generated from the Celestial engineering practice “LLM features and evals”.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.