agentleFS
kleosrkleosr/bridle/skills/production-readiness/SKILL.md

production-readiness

Skill1 starsChanged 2 months agoMITView on GitHub

Que el código aguante producción: timeouts, reintentos con backoff solo en operaciones idempotentes, health checks, apagado ordenado, logs estructurados sin secretos y una señal que pruebe que la feature funciona. Úsala cuando la tarea agregue o cambie una llamada de red (HTTP, SDK, DB, Redis, cola, LLM, webhook), agregue un worker, cron, job o servidor, toque Dockerfile, health checks, deploy o config de runtime, o cuando el usuario diga "producción", "se cae", "timeout", "lento", "logs", "monitoreo".

16 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use database-design, incident-response and 6 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • CloudAI-XSkill

    database-design

    Designs database schemas, indexing strategies, query optimization, and migration patterns for SQL and NoSQL databases. Use when designing tables, optimizing queries, fixing N+1 problems, planning migrations, or when asked about database performance, normalization, ORMs, or data modeling.

    Also in 3 projects that use this

  • AnthropicSkill

    incident-response

    Run an incident response workflow — triage, communicate, and write postmortem. Trigger with "we have an incident", "production is down", an alert that needs severity assessment, a status update mid-incident, or when writing a blameless postmortem after resolution.

    Also in 3 projects that use this

  • MicrosoftSkill

    api-design

    Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.

    Also in 3 projects that use this

  • OpenAISkill

    dispatching-parallel-agents

    Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies

    Also in 3 projects that use this

  • OpenAISkill

    using-git-worktrees

    Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback

    Also in 3 projects that use this

  • +3 more from openai

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 15 edited versions we read keep these.

  • 1

    Distinctive

    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:

    Test o prueba manual con la dependencia lenta o caída: respeta el timeout y devuelve el error decidido.

    line 69

“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “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
SKILL.md

Production readiness

El código que funciona en local falla en producción por lo que no se ve en el diff: una llamada sin timeout, un reintento que duplica un cobro, un deploy que corta requests a medias. Esta skill cierra esos huecos solo en las llamadas, jobs y servidores que el pedido agrega o cambia. No endurezcas el resto del repo ni agregues health checks, logger o métricas que el pedido no necesita.

Llamadas salientes (HTTP, SDK, DB, Redis, LLM)

  • Timeout explícito en toda llamada. El default de la librería suele ser infinito. Timeout < tiempo máximo del request que la contiene.
  • Reintenta solo lo idempotente (GET, PUT con la misma clave, o POST con Idempotency-Key), solo errores transitorios (timeout, 429, 502–504, reset de conexión), con backoff exponencial + jitter y tope de intentos. Nunca reintentes 4xx de validación ni cobros sin clave de idempotencia.
  • Respeta Retry-After en 429/503.
  • Un cliente compartido por proceso (pool de conexiones), no uno por request.
  • Falla controlada: decide qué ve el usuario si la dependencia cae (error claro, dato cacheado, feature degradada). Escríbelo; no dejes el stack trace como UX.

Workers, jobs y webhooks

  • Todo job es idempotente o deduplica por id: las colas entregan al menos una vez.
  • Estado del job persistido (pending → running → done|failed), con número de intentos y último error. Cola de muertos o estado failed visible tras N intentos.
  • Webhooks entrantes: verifica firma, responde 2xx rápido y procesa en cola; deduplica por el id del evento.
  • Crons: un solo ejecutor (lock) si correr dos veces a la vez hace daño.

Servidores y deploy

  • Health checks separados: liveness (el proceso responde, sin tocar dependencias) y readiness (puede atender: DB alcanzable, migraciones aplicadas). Un liveness que consulta la DB reinicia todo el fleet cuando la DB tiembla.
  • Apagado ordenado: en SIGTERM, deja de aceptar, termina requests/jobs en curso con un tope, cierra pools. Sin esto cada deploy corta requests.
  • Config por entorno validada al arrancar (schema); falta una variable → el proceso no arranca, en vez de fallar en la primera request.
  • Migraciones compatibles con la versión anterior del código durante el deploy (ver postgres.mdc).

Observabilidad

  • Logs estructurados (JSON o el logger del repo) con nivel, mensaje, id de request/job y el id del actor; nunca tokens, contraseñas, PII completa ni bodies enteros. Un error se loguea una vez, donde se maneja.
  • Propaga un id de correlación (header traceparent o x-request-id) a las llamadas salientes y a los jobs.
  • Una señal por feature: la métrica, log o evento que te diría en producción que funciona (conteo de éxitos/fallos, latencia). Si el repo ya tiene métricas/tracing, úsalo; no agregues un stack nuevo.

Verificación

  1. Test o prueba manual con la dependencia lenta o caída: respeta el timeout y devuelve el error decidido.
  2. El reintento no duplica efectos (mismo Idempotency-Key → un solo efecto).
  3. Si agregaste health checks o shutdown: curl a ambos endpoints y un SIGTERM con una request en curso que termina bien.
  4. Lo que no pudiste probar (carga real, failover del proveedor) va como riesgo no verificado.

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.