writing-agent-instructions
Ce qu’il fait
Ce guide explique comment rédiger les instructions qui orientent le comportement d'un agent IA dans une application : le fichier principal, les compétences détaillées et les descriptions d'outils. Il s'adresse aux personnes qui créent des applications ou des modèles pour agents IA.
Quand l’utiliser
- ✓Quand vous rédigez ou relisez le fichier AGENTS.md d'une application.
- ✓Quand vous écrivez une nouvelle compétence ou décrivez une action que l'agent peut utiliser.
- ✓Quand vous devez décider si un contenu doit aller dans les instructions, une compétence ou la mémoire.
Lien du skill
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/writing-agent-instructions/SKILL.mdCopiez-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
Pour Claude Code, Codex ou Cursor : lancez-la dans le dossier du projet et le skill est installé.
Téléchargez le SKILL.md et placez-le dans le dossier de skills de votre agent.
Exemple de demande à votre IA
“Aide-moi à réécrire les instructions de mon application pour que l'IA sache quand utiliser chaque outil.”
5 nouveaux skills par semaine. 1 minute de lecture.
Comment ça marche
Le guide recommande de garder le fichier principal court et facile à parcourir, de placer les détails dans les compétences, et de rédiger les descriptions d'outils pour que l'agent choisisse vite le bon.
Contenu technique (SKILL.md original)
Texte original de l’auteur, en anglais, directement depuis GitHub.
Writing Agent Instructions & Skills
This is a creator-facing guide. When you build an agent-native app or template,
the agent's behavior is only as good as the instructions you give it. Three
surfaces carry that guidance: AGENTS.md (the map), skills (the deep dives),
and action/tool descriptions (how the agent picks the right tool). Write each
one for fast retrieval, not for prose.
Keep AGENTS.md small and skimmable
AGENTS.md is loaded as orientation. It should be the smallest thing that lets
the agent act correctly, with everything deep pushed into skills. Aim for these
sections and little else:
- Purpose line — one sentence on what the app is and the primary workflow.
- Core rules — the handful of invariants that must always hold (data in SQL, operations go through actions, AI goes through the agent chat, schema changes are additive). Short, imperative bullets.
- Application-state keys — the
navigation/selection/focus keys the agent reads to know what the user is looking at, with their shape. - Action table — a compact table of action name -> purpose (see below).
- Skills index — a list of the skills that exist and when to read each one.
If a section is growing past a screen, it belongs in a skill. AGENTS.md
answers "what is this app and what can I do," not "how exactly do I do the hard
thing."
The 6,000-character cap is real and silent
A template AGENTS.md is injected into the runtime agent's system prompt and
hard-sliced at COMPACT_PROMPT_RESOURCE_MAX_CHARS (6,000). Past that, the agent
sees a truncation marker instead of your text, so the tail stops being
always-on guidance and becomes something it has to go fetch. pnpm guard:agent-chat-context — the repository's own check — fails the build when a
first-party file overflows; generated apps do not ship that repository-only
guard. Keep files under ~5,500 so ordinary edits don't tip them over.
Two consequences worth designing around:
- Put the skills list second, right after the purpose line. It is the pointer to every deferred skill. If it lands in the truncated tail, the agent cannot discover any of the depth you carefully moved out.
- Markdown tables cost more than they look. Prettier pads table cells to
align columns, and that invisible whitespace counts against the cap — enough
padding in a wide action table to push a file back over it on its own. Both
**/AGENTS.mdand**/SKILL.mdare in.prettierignorefor this reason; keep them there and write table rows unpadded.
# Projects App
One workspace for projects, tasks, and notes. Agent and UI share the same SQL
data and the same actions.
## Core Rules
- Data lives in SQL via Drizzle. Use actions for all writes.
- All AI work goes through the agent chat; never call an LLM inline.
- Schema changes are additive only.
## Application State
- `navigation.view`: `home` | `project`
- `navigation.projectId`: selected project on a project page
## Actions
| Action | Purpose |
| --- | --- |
| `list-projects` | List accessible projects |
| `create-project` | Create a project |
| `update-project` | Rename or archive a project |
## Skills
- `project-imports` — read before importing legacy CSV exports.
- `sharing` — read before exposing a project to other users.
Single-source AGENTS.md (CLAUDE.md is a symlink)
Keep one canonical instructions file: AGENTS.md. If a client expects
CLAUDE.md, make it a symlink to AGENTS.md rather than a second copy. Two
hand-maintained files drift, and the agent ends up with contradictory rules.
One source of truth, linked where needed.
Keep generated guidance in sync
Framework guidance is authored once in this repo and copied outward. Treat
.agents/skills/ as the canonical source for shared skills. Generated
workspace skills in packages/core/src/templates/workspace-core/.agents/skills/
and first-party template copies of shared skills must stay byte-for-byte in
sync; run pnpm sync:workspace-skills after editing a shared skill, and
pnpm guard:workspace-skills before calling the guidance done.
Generated app and workspace instructions must teach the same action-first data contract:
- Normal app data goes through
defineActionfiles inactions/. - React calls actions with
useActionQuery,useActionMutation, orcallAction; route paths are a transport detail hidden behind helpers. - Custom
/api/*routes are only for route-shaped protocols such as uploads, str
Questions fréquentes
Quelle doit être la longueur du fichier principal ?
Le guide conseille de le garder petit et signale une limite de caractères pour ce fichier.
Où mettre les explications détaillées ?
Dans les compétences, pour que le fichier principal indique seulement ce que fait l'application et ce qu'elle peut faire.
Sur quoi doit porter la description d'une action ?
Sur l'aide à l'agent pour choisir rapidement le bon outil. Elle est donc écrite pour une lecture rapide plutôt que sous forme de prose.
Détails
Description originale de l’auteur
How to write great agent instructions for an agent-native app or template: AGENTS.md, skills, and tool/action descriptions. Use when authoring or reviewing AGENTS.md, writing a SKILL.md, wording action descriptions, or deciding what belongs in instructions vs skills vs memory.
repo: BuilderIO/agent-native
Popularité
- Étoiles GitHub
- 7.6k
- Position au classement
- #13192
- Licence
- MIT
- Mis à jour
- 02/11/2026
Commentaires
- …
Autres skills de ce dépôt
design-exploration
7.6kAide votre agent à explorer plusieurs directions de conception d'interface côte à côte, à vous laisser en choisir une, puis à affiner la version retenue.
visual-edit
7.6kAide votre agent à ouvrir une application locale en cours d'exécution dans un éditeur visuel, pour que vous en examiniez et modifiiez ensemble les écrans réels.
turn-into-app
7.6kTransforme un flux de travail, un tableur ou un projet en application visuelle soignée, avec des écrans remplis et un agent qui travaille derrière les commandes.
visual-plan
7.6kTransforme un plan écrit en plan visuel interactif, avec diagrammes, cartes de fichiers, extraits de code commentés et questions ouvertes.
Skills similaires
writing-skills
311kApprend à votre agent à rédiger de nouvelles skills et à tester chacune d'elles en premier, en vérifiant que la skill change réellement son comportement.
writing-for-agents
310kExplique comment rédiger des instructions claires pour les agents IA, y compris les skills et les fichiers AGENTS.md et CLAUDE.md, afin que l'agent se comporte de façon prévisible.
bengali-nlp
280kPermet à votre agent de traiter des textes en bengali. Il aide à comprendre cette langue, à normaliser les textes et à gérer ses particularités.