improve-claude-md

humanlayer/skills

Переписать файл CLAUDE.md с использованием блоков <important if> для лучшего соблюдения инструкций

Звёзды5 816
Форки211
Авторhumanlayer
Маркетплейс@skills
В маркетплейсе4 плагинов
Компонентов4
Обновлённоя 1 2026

Установка

SKILL.md

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.ts for 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:

  1. Identify the project identity — extract a single sentence describing what this is. Leave it bare at the top.
  2. Extract the directory map — keep it bare (no <important if> wrapper). This is foundational context.
  3. Extract the tech stack — if present, keep it bare near the top. Condense to one or two lines.
  4. Extract commands — keep ALL commands from the original. Wrap in a single <important if> block.
  5. Break apart rules — split any list of rules into individual <important if> blocks with specific conditions. You can group rules, but never group unrelated rules under one broad condition.
  6. Wrap domain sections — testing, API patterns, state management, i18n, etc. each get their own block with a condition describing when that knowledge matters.
  7. Delete linter territory — remove style guidelines, formatting rules, and anything enforceable by tooling. Suggest replacing with pre-push or pre-commit hooks.
  8. Delete code snippets — replace with file path references.
  9. Delete vague instructions — remove anything like "leverage the X agent" or "follow best practices" that isn't concrete and actionable.

Example

Input:

# CLAUDE.md

This is an Express API with a React frontend in a Turborepo monorepo.

## Commands

| Command | Description |
|---|---|
| `turbo build` | Build all packages |
| `turbo test` | Run all tests |
| `turbo lint` | Lint all packages |
| `turbo dev` | Start dev server |
| `turbo storybook` | Start Storybook |
| `turbo db:generate` | Generate Prisma client |
| `turbo db:migrate` | Run database migrations |
| `turbo analyze` | Bundle analyzer |

## Project Structure

- `apps/api/` - Express REST API
- `apps/web/` - React SPA
- `packages/db/` - Prisma schema and client
- `packages/ui/` - Shared component library
- `packages/config/` - Shared configuration

## Coding Standards

- Use named exports
- Use functional components with TypeScript interfaces for props
- Use camelCase for variables, PascalCase for components
- Prefer `const` over `let`
- Always use strict equality (`===`)
- Use template literals instead of string concatenation
- Write JSDoc comments for all public functions
- Use barrel exports in index.ts files

## API Development

- All routes go in `apps/api/src/routes/`
- Use Zod for request validation
- Use Prisma for database access
- Error responses follow RFC 7807 format
- Authentication via JWT middleware

## Testing

- Jest + Supertest for API tests
- Vitest + Testing Library for frontend
- Test fixtures in `__fixtures__/` directories
- Use `createTestClient()` helper for API integration tests
- Mock database with `prismaMock` from `packages/db/test`

## State Management

- Zustand for global client state
- React Query for server state
- URL state via `nuqs`

Output:

# CLAUDE.md

Express API + React frontend in a Turborepo monorepo.

## Project map

- `apps/api/` - Express REST API
- `apps/web/` - React SPA
- `packages/db/` - Prisma schema and client
- `packages/ui/` - Shared component library
- `packages/config/` - Shared configuration

<important if="you need to run commands to build, test, lint, or generate code">

Run with `turbo` from the repo root.

| Command | What it does |
|---|---|
| `turbo build` | Build all packages |
| `turbo test` | Run all tests |
| `turbo lint` | Lint all packages |
| `turbo dev` | Start dev server |
| `turbo storybook` | Start Storybook |
| `turbo db:generate` | Regenerate Prisma client after schema changes |
| `turbo db:migrate` | Run database migrations |
| `turbo analyze` | Bundle analyzer |
</important>

<important if="you are adding or modifying imports or exports">
- Use named exports (no default exports)
</important>

<important if="you are creating new components">
- Use functional components with TypeScript interfaces for props
</important>

<important if="you are adding or modifying API routes">

- All routes go in `apps/api/src/routes/`
- Use Zod for request validation
- Use Prisma for database access
- Error responses follow RFC 7807 format
- Authentication via JWT middleware
</important>

<important if="you are writing or modifying tests">

- API: Jest + Supertest
- Frontend: Vitest + Testing Library
- Test fixtures in `__fixtures__/` directories
- Use `createTestClient()` helper for API integration tests
- Mock database with `prismaMock` from `packages/db/test`
</important>

<important if="you are working with state management, stores, or URL parameters">

- Zustand for global client state
- React Query for server state
- URL state via `nuqs`
</important>

What was removed and why:

  • camelCase/PascalCase, const vs let, strict equality, template literals, JSDoc, barrel exports — linter and formatter territory, or discoverable from existing code patterns
  • Coding Standards as a grouped section — split into targeted blocks by trigger condition

What was NOT removed:

  • All commands kept (including dev, storybook, analyze)
  • Project map left bare (foundational context, relevant to every task)

Вставить в README

Ссылка на карточку для вашего README — без картинок и счётчиков.

[DarkPlay: improve-claude-md](https://darkplay.ru/ai/plugins/humanlayer-skills-improve-claude-md)

Из того же репозитория

narrow-react-prop-types Сузить типы пропсов React-компонентов в соответствии с реальными путями выполнения кода ★5,8K build-iterated-agentic-loop Создать локальный для репозитория навык и итеративный workflow кодинг-агента с промптом и ★5,8K design-control-loop Провести интервью с пользователем для проектирования агентного контура управления (датчик, ★5,8K improve-claude-md Улучшить файл CLAUDE.md с использованием блоков <important if> для лучшего соблюдения инст ★5,8K improve-claude-md Улучшает файл CLAUDE.md с помощью блоков <important if> для лучшего соблюдения инструкций. ★5,8K design-control-loop Интервьюирует пользователя для проектирования агентного контура управления (датчик, контро ★5,8K build-iterated-agentic-loop Создаёт локальный для репозитория навык и устанавливает соответствующий итеративный GitHub ★5,8K narrow-react-prop-types Сузить типы пропсов React-компонентов в соответствии с реальными путями выполнения кода ★5,8K

Похожие плагины и другие разделы каталога

Похожие плагины в категории «Операции с агентами»

Та же категория — сравните, что ещё подойдёт под вашу задачу.

cavemanjuliusbrussee · Говорит как пещерный человек. Сокращает вывод на 65% токенов (измерено). Вся техническая…
15 комп.
claude-memthedotmack · Система постоянной памяти для Claude Code — сжатие контекста между сессиями.
20 комп.
ruflo-agentruvnet · Среды выполнения агентов: локальные агенты в песочнице WASM (rvagent) и Anthropic Claude…
240 комп.
ruflo-agentdbruvnet · Контроллеры памяти AgentDB с векторным поиском HNSW, эмбеддингами RuVector и причинными…
240 комп.
ruflo-autopilotruvnet · Автономное выполнение задач на основе /loop с обучением, прогнозированием и отслеживанием…
240 комп.
ruflo-coreruvnet · Основные MCP-инструменты, команды и паттерны оркестрации Claude Code в Ruflo.
240 комп.
ruflo-cost-trackerruvnet · Отслеживание расхода токенов, атрибуция затрат на модели по агентам, оповещения о бюджете…
240 комп.
ruflo-daaruvnet · Динамическая агентная архитектура с когнитивными паттернами, обменом знаниями и…
240 комп.
ruflo-goalsruvnet · Долгосрочное планирование целей, оркестрация глубокого исследования и адаптивное…
240 комп.
ruflo-metaharnessruvnet · Интеграция MetaHarness: доступ к score/genome/mint/mcp-scan/threat-model через навыки…
240 комп.
Популярное в разделе «Плагины»

Самые востребованные плагинов раздела по установкам и звёздам.

mattpocock-skillsmattpocock · Агентские навыки Matt Pocock для настоящей инженерии: разбор задач, потоки спецификаций и…
41 комп.
superpowersobra · Базовая библиотека навыков для Claude Code: TDD, отладка, паттерны совместной работы и…
16 комп.
eccaffaan-m · Нативный для harness операторский слой ECC: 67 агентов, 278 навыков, 94 шима устаревших…
441 комп.
andrej-karpathy-skillsmultica-ai · Правила поведения для снижения типичных ошибок LLM при программировании: думай перед…
1 комп.
claude-apianthropics · Навык по документации Claude API и SDK для создания приложений на базе LLM.
17 комп.
document-skillsanthropics · Набор инструментов для обработки документов: Excel, Word, PowerPoint и PDF.
17 комп.
example-skillsanthropics · Набор примеров навыков, демонстрирующих разные возможности: создание навыков, разработку…
17 комп.
ponytailDietrichGebert · Настаивает на самом простом работающем решении. YAGNI, сначала стандартная библиотека…
9 комп.
prompts.chatf · Доступ к тысячам AI-промптов и навыков прямо в AI-ассистенте для программирования. Поиск…
6 комп.
agent-sdk-devanthropics · Набор для разработки с Claude Agent SDK.
34 комп.
Похожее в других разделах каталога

Соседние разделы каталога: возможно, нужный инструмент живёт там.

improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
1 300 000 устан.
codebase-designmattpocock · Словарь для проектирования глубоких модулей: интерфейсы, швы, тестируемость.
966 900 устан.
git-guardrails-claude-codemattpocock · Хуки Claude Code для блокировки опасных git-команд (push, reset --hard и др.).
567 600 устан.
claude-handoffmattpocock · Передать текущий разговор новому фоновому агенту, который сразу продолжит работу.
489 400 устан.
caveman-compressjuliusbrussee · Сжимает файлы памяти на естественном языке (CLAUDE.md, задачи, предпочтения) в формат…
437 900 устан.
skill-creatoranthropics · Создание новых навыков, доработка существующих и оценка их эффективности: написание с…
434 600 устан.
impeccablepbakaus · Дизайн, ревью и улучшение фронтенд-интерфейсов: сайты, дашборды, формы, компоненты.
413 500 устан.
caveman-statsjuliusbrussee · Показывает реальный расход токенов и оценку экономии за текущую сессию, читая лог сессии…
382 800 устан.
orca-clistablyai · Работа через публичный CLI `orca` с worktree, контекстами папок, терминалами…
363 100 устан.
improve-animationsemilkowalski · Анализирует код анимации в проекте как старший консультант по движению, затем составляет…
278 800 устан.

Лучшие ИИ-инструменты для генерации текста и копирайтинга

Генерация текста и копирайтинг

Подборка нейросетей для генерации текстов и копирайтинга. Сервисы, которые помогают создавать статьи, посты и рекламные объявления с нуля или по черновику, экономя часы рутинной ра

NeuroscribeNeuroscribe
Есть бесплатный тариф
5.0
GoGPTGogpt
По запросу
5.0
ChatsonicChatsonic
По запросу
4.9
НейроТекстерNeuro-texter
По запросу
4.9
ChatGPTOpenAI
По подписке
4.9
Редактум
Есть бесплатный тариф
4.8
ChadGPTChadgpt
По запросу
4.8
Cosmo ScribeCosmoscribe
Есть бесплатный тариф
4.8
Memo HelperCopilot33
По запросу
4.8
LibraChatLibrachat
Есть бесплатный тариф
4.8

Лучшие ИИ-инструменты для автоматизации и ассистентов

Ассистенты и автоматизация

Подборка ИИ-ассистентов для автоматизации рутины и ускорения рабочих процессов. Сервисы, которые берут на себя переписку, анализ данных, ведение базы знаний и подготовку продаж, эк

Give Me Public
Есть бесплатный тариф
5.0
AITunnelAitunnel
По запросу
5.0
STIVAStiva
По запросу
5.0
Wikibot (Викибот)Wikibot
По запросу
4.9
mymeet.aiMymeet
По запросу
4.9
InsighterInsighter
По запросу
4.9
TGHuntTghunt
Есть бесплатный тариф
4.9
LegiscanLegiscan
По запросу
4.9
RouterAIRouterai
По запросу
4.9
Wikibot 1.0 (Викибот)Wikibot
По запросу
4.9

Лучшие ИИ-инструменты для генерации видео

Генерация видео

Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,

VEED.IOVeed
По запросу
5.0
MootionMootion
По запросу
5.0
FlyviFlyvi
Есть бесплатный тариф
4.9
Google Veo 3.1Google
Платно
4.9
Sora (OpenAI)OpenAI
Платно
4.9
PikaPika
Платно
4.9
captions space
Есть бесплатный тариф
4.8
Клайп
Есть бесплатный тариф
4.8
viralpulse.appViralpulse
По запросу
4.8
Viral Maker AIViral-maker
Есть бесплатный тариф
4.8