improve-claude-md
Ce qu’il fait
Cette compétence apprend à un agent à améliorer un fichier d'instructions CLAUDE.md pour un assistant de codage. Elle place les consignes propres à une tâche dans des blocs conditionnels, pour que l'assistant prête attention aux parties utiles à chaque tâche.
Quand l’utiliser
- ✓Quand un utilisateur a un fichier CLAUDE.md que l'assistant semble ignorer.
- ✓Quand le fichier d'instructions d'un projet est devenu long et mélange des consignes générales et spécifiques à une tâche.
- ✓Quand un utilisateur demande que les instructions de son assistant soient réécrites pour un meilleur suivi.
Lien du skill
https://github.com/humanlayer/skills/blob/main/plugins/improve-claude-md/skills/improve-claude-md/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
“Améliore mon CLAUDE.md pour que Claude respecte les règles de test quand j'écris des tests.”
5 nouveaux skills par semaine. 1 minute de lecture.
Comment ça marche
L'agent conserve le contexte central du projet en texte simple et place les consignes propres à une tâche dans des blocs marqués d'une condition. Cela donne à l'assistant un signal clair sur le moment où chaque bloc s'applique.
Contenu technique (SKILL.md original)
Texte original de l’auteur, en anglais, directement depuis GitHub.
When the user provides a CLAUDE.md file (or asks you to improve one), rewrite it following the principles and structure below.
Core Problem
Claude Code injects a system reminder with every CLAUDE.md that says:
"this context may or may not be relevant to your tasks. You should not respond to this context unless it is highly relevant to your task."
This means Claude will ignore parts of your CLAUDE.md it deems irrelevant. The more content that isn't applicable to the current task, the more likely Claude is to ignore everything — including the parts that matter.
Solution: <important if="condition"> Blocks
Wrap conditionally-relevant sections of the CLAUDE.md in <important if="condition"> XML tags. This exploits the same XML tag pattern used in Claude Code's own system prompt, giving the model an explicit relevance signal that cuts through the "may or may not be relevant" framing.
Principles
1. Foundational context stays bare, domain guidance gets wrapped
Not everything should be in an <important if> block. Context that is relevant to virtually every task — project identity, project map, tech stack — should be left as plain markdown at the top of the file. This is onboarding context the agent always needs.
Domain-specific guidance that only matters for certain tasks — testing patterns, API conventions, state management, i18n — gets wrapped in <important if> blocks with targeted conditions.
The rule of thumb: if it's relevant to 90%+ of tasks, leave it bare. If it's relevant to a specific kind of work, wrap it.
2. Conditions must be specific and targeted
Bad — overly broad conditions that match everything:
<important if="you are writing or modifying any code">
- Use absolute imports
- Use functional components
- Use camelCase filenames
</important>
Good — each rule has its own narrow trigger:
<important if="you are adding or modifying imports">
- Use `@/` absolute imports (see tsconfig.json for path aliases)
- Avoid default exports except in route files
</important>
<important if="you are creating new components">
- Use functional components with explicit prop interfaces
</important>
<important if="you are creating new files or directories">
- Use camelCase for file and directory names
</important>
3. Keep it short, use progressive disclosure sparingly
Do not shard into separate files that require the agent to make tool calls to discover, unless the extra context is incredibly verbose or complex.
The whole point of <important if> blocks is that everything is inline but conditionally weighted — the agent sees it all but only attends to what matches.
Prefer to keep the file concise.
4. Less is more
- Frontier models can reliably follow a few hundred. Claude Code's system prompt and tools already use ~50 of those. Your CLAUDE.md should be as lean as possible.
- Cut any instruction that a linter, formatter, or pre-commit hook can enforce
- Cut any instruction the agent can discover from existing code patterns. LLMs are in-context learners — if your codebase consistently uses a pattern, the agent will follow it after a few searches.
- Cut code snippets. They go stale and bloat the file. Use file path references instead (e.g., "see
src/utils/example.tsfor the pattern").
5. Keep all commands
Do not drop commands from the original file. The commands table is foundational reference — the agent needs to know what's available even if some commands are used less frequently.
Output Structure
When rewriting a CLAUDE.md, produce this structure:
# CLAUDE.md
[one-line project identity — what it is, what it's built with]
## Project map
[directory listing with brief descriptions]
<important if="you need to run commands to build, test, lint, or generate code">
[commands table — all commands from the original]
</important>
<important if="<specific trigger for rule 1>">
[rule 1]
</important>
<important if="<specific trigger for rule 2>">
[rule 2]
</important>
... more rules, each with their own block ...
<important if="<specific trigger for domain area 1>">
[guidance]
</important>
... more domain sections ...
How to Apply
When given an existing CLAUDE.md to improve:
- Identify the project identity — extract a single sentence describing what this is. Leave it bare at the top.
- Extract the directory map — keep it bare (no
<important if>wrapper). This is foundational context. - Extract the tech stack — if present, k
Questions fréquentes
Qu'est-ce qu'un bloc important-if ?
C'est une balise de style XML avec une condition, qui indique à l'assistant quand la consigne s'applique.
Faut-il tout encapsuler ?
Non. La compétence indique que le contexte fondamental, comme l'identité du projet et la pile technique, reste en markdown simple.
Pourquoi le fichier a-t-il besoin de cela ?
La compétence explique qu'un assistant peut ignorer un contexte qu'il juge non pertinent, donc un long texte sans rapport peut masquer l'essentiel.
Détails
Description originale de l’auteur
improve a CLAUDE.md file using <important if> blocks to improve instruction adherence
repo: humanlayer/skills
Popularité
- Étoiles GitHub
- 5.5k
- Position au classement
- #14776
- Licence
- MIT
- Mis à jour
- 01/11/2026
Commentaires
- …
Autres skills de ce dépôt
build-iterated-agentic-loop
5.5kAide votre agent à transformer une tâche de codage répétée en une compétence de dépôt, plus un flux de travail GitHub Actions planifié qui exécute un agent de codage, avec un fichier de mémoire et une seule demande de fusion ouverte par…
design-control-loop
5.5kAide votre agent à vous interroger puis à concevoir une boucle de contrôle qui fait évoluer votre base de code vers un objectif par de petites modifications faciles à relire, puis à la construire comme un flux de travail planifié.
rpi
5.5kAide votre agent à étudier une modification, à travailler sa conception et à la mettre en œuvre en phases claires, avec un document pour chaque étape que vous pouvez relire.
visual-pr
5.5kAide votre agent à rédiger ou mettre à jour une description de demande de fusion qui explique pourquoi une modification existe et comment elle est construite, à l'aide d'un modèle clair et d'un court plan visuel.
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.