improve-claude-md
Was er macht
Dieser skill zeigt einem Agenten, wie er eine CLAUDE.md-Anweisungsdatei für einen Coding-Assistenten verbessert. Aufgabenspezifische Hinweise packt er in Blöcke mit einer Bedingung, damit der Assistent für jede Aufgabe die passenden Teile beachtet.
Wann du ihn nutzt
- ✓Wenn ein Nutzer eine CLAUDE.md-Datei hat, die der Assistent offenbar ignoriert.
- ✓Wenn die Anweisungsdatei eines Projekts lang geworden ist und allgemeine mit aufgabenspezifischen Hinweisen vermischt.
- ✓Wenn ein Nutzer seine Assistenten-Anweisungen für eine bessere Befolgung umschreiben lassen möchte.
Link zum Skill
https://github.com/humanlayer/skills/blob/main/plugins/improve-claude-md/skills/improve-claude-md/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Verbessere bitte meine CLAUDE.md, damit Claude die Testregeln befolgt, wenn ich Tests schreibe.”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Der Agent behält den grundlegenden Projektkontext als normalen Text und verschiebt aufgabenspezifische Hinweise in Blöcke mit einer Bedingung. So erkennt der Assistent, wann jeder Block gilt.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von 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
Häufige Fragen
Was ist ein important-if-Block?
Es ist ein Tag im XML-Stil mit einer Bedingung, die dem Assistenten sagt, wann die Anweisung gilt.
Muss die ganze Datei umschlossen werden?
Nein. Der skill sagt, dass grundlegender Kontext wie Projektidentität und Tech-Stack normales Markdown bleibt.
Warum braucht die Datei das?
Der skill erklärt, dass ein Assistent Kontext ignorieren kann, den er für unwichtig hält. Langer, unpassender Text kann deshalb das Wichtige verdecken.
Details
Originalbeschreibung des Autors
improve a CLAUDE.md file using <important if> blocks to improve instruction adherence
repo: humanlayer/skills
Beliebtheit
- GitHub-Sterne
- 5.5k
- Platz im Ranking
- #14776
- Lizenz
- MIT
- Aktualisiert
- 1.11.2026
Kommentare
- …
Weitere Skills aus diesem Repository
build-iterated-agentic-loop
5.5kHilft deinem Agenten, eine wiederkehrende Coding-Aufgabe als Repo-skill und geplanten GitHub-Actions-Workflow einzurichten, mit Memory-Datei und einem offenen PR.
design-control-loop
5.5kHilft deinem Agenten, eine Kontrollschleife zu entwerfen, die deine Codebasis in kleinen, prüfbaren Schritten zu einem Ziel führt, und sie als Workflow zu bauen.
rpi
5.5kHilft deinem Agenten, eine Änderung zu untersuchen, ihren Entwurf durchzuarbeiten und sie in klaren Phasen umzusetzen, mit einem prüfbaren Dokument für jeden Schritt.
visual-pr
5.5kHilft deinem Agenten, eine Pull-Request-Beschreibung zu schreiben, die erklärt, warum sich etwas ändert und wie es umgesetzt ist, mit Vorlage und kurzer Übersicht.
Ähnliche Skills
writing-skills
311kBringt deinem Agenten bei, neue Skills zu schreiben und jeden zuerst zu testen, und zu prüfen, ob der Skill das Verhalten des Agenten tatsächlich verändert.
writing-for-agents
310kErklärt, wie du klare Anweisungen für KI-Agenten schreibst, einschließlich Skills, AGENTS.md- und CLAUDE.md-Dateien, damit sich der Agent berechenbar verhält.
bengali-nlp
280kLässt deinen Agenten bengalischen Text verarbeiten. Er hilft, die Sprache zu verstehen, normalisiert Texte und berücksichtigt ihre Besonderheiten.