Aller au contenu
Skillpedia
API et serveurs (backend)7.6k · #13177

reliable-mutations

Ce qu’il fait

Cette compétence explique comment un agent doit effectuer des modifications de base de données pour qu'elles soient réellement enregistrées, en utilisant un appel groupé puis en vérifiant le résultat. Elle s'adresse aux développeurs et à toute personne qui attend que de nombreux éléments soient enregistrés.

Quand l’utiliser

  • ✓Quand l'agent doit enregistrer ou mettre à jour de nombreux éléments en une seule fois.
  • ✓Quand une longue tâche modifie des données de l'application et doit se terminer avec tout enregistré.
  • ✓Quand un agent annonce une réussite et que vous avez besoin de preuves que les données ont bien été stockées.

Lien du skill

https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/reliable-mutations/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/reliable-mutations/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Mets à jour tous ces éléments en une seule fois, puis confirme qu'ils ont bien été enregistrés.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

Au lieu de nombreuses petites sauvegardes qui peuvent s'arrêter en cours de route, l'agent envoie l'ensemble en une seule action, puis vérifie les données stockées et annonce les nombres ou les identifiants comme preuves.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

Reliable Mutations

Rule

Make a change in one atomic call when the action supports it, then verify the persisted end state and report concrete proof (counts/ids). Never drive a multi-step change by looping many small writes, and never report success from a tool ✓ alone.

Why

Hosted foreground agent runs have a short soft budget so they can hand off cleanly under synchronous serverless walls. Durable background runs get a much longer budget, but they still should not rely on loops of many small writes: continuations can retry the same intent and leave partial state if each item is committed separately. One atomic call commits or fails as a unit; verification turns a hopeful ✓ into a fact.

How

  1. Prefer a single atomic call. If an action accepts the whole set (add many, set all, bulk update), pass the full batch in one call so it commits atomically. Check the action surface for a batch/plural form before reaching for a loop.
  2. Do not loop many small writes under any run budget. A sequence of N per-item writes can still leave partial or no state when a foreground run hands off, a background run continues, or an upstream provider fails. If no batch action exists, that is a gap in the action layer — add or extend an action that accepts the batch (see the actions skill) rather than papering over it with a loop.
  3. Verify the end state after writing. Re-read the data (a list/read action, a count query) and confirm the result matches intent — the right number of rows, the expected ids/fields. Do this before you tell the user it worked, and include the relevant verification expectation in the app's AGENTS.md.
  4. Report proof-of-done, not vibes. State concrete evidence: "saved 12 of 12 panels (ids …)" or "updated 5 rows". Do not infer success from the presence of a tool ✓ on an individual call.
  5. On a time-budget cutoff, fail loud. If the turn is cut before the change is fully committed and verified, say so explicitly and report what did persist (M of N) and what remains. Never round a partial or unverified write up to "done".

Don't

  • Don't loop for each item: write(item) for a large set in a single hosted turn.
  • Don't claim completion because every tool call returned ✓ — a ✓ on an aborted chunk does not mean the row was committed.
  • Don't silently shrink the scope ("I added a few of them") and present it as the finished task.
  • Don't try to "fix" this by asking for a longer run timeout — the budget is correct; restructure the write instead.

Related

  • actions — define or extend a batch/atomic action when only per-item writes exist.
  • storing-data — where app data lives and how reads/writes are scoped.
  • performance — avoid query waterfalls when verifying end state.
  • Design doc: packages/core/docs/design/durable-agent-runs.md — the real ceiling fix (checkpointed and durable runs); this skill is the agent-facing mitigation that reduces how often the ceiling is hit.
Questions fréquentes

Que faire si l'application n'a pas d'action groupée ?

La compétence indique d'en ajouter une plutôt que de faire une boucle de petites écritures.

Pourquoi ne pas se fier au message de réussite ?

Un message de réussite peut apparaître alors qu'une partie de l'écriture a échoué ; la compétence demande donc de vérifier les données stockées.

Cela vaut-il aussi pour les tâches de fond ?

Oui. Les exécutions de fond peuvent être relancées, on préfère donc un seul appel tout ou rien.

Détails

Description originale de l’auteur

How the agent must perform writes so they actually persist under the hosted foreground run budget and long-running background handoffs. Use whenever you create, update, delete, or batch-write app data — especially "do this for many items" loops, or any task where the user expects N things to end up saved.

repo: BuilderIO/agent-native

Popularité

Étoiles GitHub
7.6k
Position au classement
#13177
Licence
MIT
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires