Instructions de repo pour agents IA
Ecris des instructions de repo qui aident les agents IA a respecter architecture, tests, securite et workflows locaux.
Reponse rapide
De bonnes instructions repo disent a l'agent comment le projet est structure, quels fichiers sont sensibles, quelles commandes prouvent un changement et quels comportements sont interdits.
Quoi inclure
Inclus frontieres d'architecture, nommage, contraintes auth et data, commandes de test, formatage, risques de deploiement et gestion d'un worktree deja modifie.
Ce qu'il faut eviter
Evite les regles qualite vagues et impossibles a verifier. Remplace fais attention par des contraintes concretes, chemins de fichiers et commandes.
FAQ
Les instructions repo doivent-elles parler securite ?
Oui. Les agents ont besoin de frontieres explicites pour secrets, donnees user-scoped, auth, entrees externes et commandes destructives.
Ecrire de meilleures instructions repo
Guides associés
CLAUDE.md : le guide de tout développeur
Un fichier markdown pour donner à Claude Code les conventions réelles de ton codebase et obtenir du code cohérent dès la première session.
Claude Code peut écrire du code propre dans un projet, puis sortir du code générique dans le suivant. Dans mon expérience, la différence vient souvent de CLAUDE.md . C'est le fichier qui évite de répéter les mêmes conventions à chaque session, et c'est une grosse partie de mon gain avec Claude Code. Ce que c'est CLAUDE.md est un fichier markdown que Claude Code lit au début de chaque session. Pense y comme le doc d'onboarding que tu donnerais à un prestataire senior le premier jour : stack, conventions, règles, contexte. Sans ça, Claude infère les patterns depuis ce qu'il voit dans le codebase. Parfois il tombe juste. Souvent non, surtout pour les conventions implicites que ton équipe connaît sans les avoir écrites. Avec un bon CLAUDE.md , Claude produit du code qui suit tes règles sans avoir besoin de le répéter à chaque fois. Quoi y mettre 1. Stack et…
Lire le guideClaude Code Agents: When to Use Them
Claude Code Agents (subagents) let you spawn isolated work threads from the main session. Full guide: what they are, when to use them, how to write a custom one, and the patterns that actually ship.
Claude Code is great when you're driving one thread of work. When you need to run three threads in parallel, or want a fresh pair of eyes on a decision, or need to scope out a large refactor without polluting your main session that's what Agents are for. This is what Claude Code Agents actually are, when to use them, and how to write your own. What Claude Code Agents actually are An Agent (sometimes called a subagent) is an isolated work thread you spawn from the main Claude Code session via the Agent tool. It has its own context fresh, with no visibility into your conversation. You hand it a self contained prompt; it does the work; it returns a single message at the end. Three things make this different from just asking Claude another question: 1. Isolated context. The agent doesn't see what you've been doing. It can't…
Lire le guideClaude Code Subagents: Parallel Agents
Learn when Claude Code subagents help, how to split parallel work, and how to configure a focused custom subagent without creating conflicts.
Subagents are useful when a task can be split cleanly: one agent searches the authentication code, another traces the database path, and the main conversation compares what they found. They add little to “read this file” or to work where every step depends on the same context. Short version: delegate independent research or a separate review when the results are worth the extra context and usage. Give each agent a narrow scope, the files or area to inspect, and a specific report format. Keep dependent work in the main conversation. If you want a step by step walkthrough of launching one, see the subagent spawning guide. Subagents can have their own instructions, tool access, and permissions. They start with a separate context, but by default work from the main conversation’s current directory. That means “separate context” does not necessarily mean “separate files.” If you want a repeatable checklist in the…
Lire le guide