К основному содержанию
скилл CX Codex

qi-layer — скилл для Claude Code: как писать AGENTS.md и CONTEXT.md

Скилл задаёт правила, по которым агент пишет и поддерживает AGENTS.md и .context/CONTEXT.md, чтобы инструкции оставались короткими и рабочими.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add haowjy/creative-writing-skills --skill qi-layer -a claude-code
Открыть на GitHub

Что делает qi-layer

AGENTS.md агент читает раньше всего остального в дереве, поэтому каждая строка там должна нести нагрузку. Скилл предлагает четыре принципа: фрактальное сжатие (листовой файл описывает свою папку, родительский — детей), иерархическое суммирование, дедупликацию по ближайшему общему узлу и постепенное раскрытие через ссылки на .context/CONTEXT.md.

Для AGENTS.md скилл советует держать объём редко выше 200 строк и включать только то, что имеет содержание: назначение области, ментальную модель, ключевые правила, антипаттерны и ссылки вниз. В .context/CONTEXT.md уходят контракты, архитектура, обоснования решений и паттерны работы. Отдельный раздел разбирает, чего в AGENTS.md быть не должно: заметок о ходе работы, справочных таблиц, предупреждений о том, что и так проверяют тесты или типы, и повторов того, что уже лежит в другом месте.

Про CLAUDE.md правило простое: Claude читает AGENTS.md, если рядом нет CLAUDE.md, поэтому отдельный файл нужен только под специфичные для Claude инструкции, и первой строкой в нём идёт @AGENTS.md. Общие указания в CLAUDE.md писать не стоит. Скилл ссылается на /qi-maintenance и /knowledge-layers, так что для полной картины их придётся поставить отдельно.

Какие задачи решает

  • написать AGENTS.md, который агент прочитает и не утонет в деталях
  • разложить знание по уровням дерева без повторов
  • отделить инструкции от справочного материала
  • решить, нужен ли в проекте CLAUDE.md поверх AGENTS.md
  • убрать из файла инструкций заметки о ходе работы

Примеры запросов агенту

  • напиши AGENTS.md для папки src/api по принципам qi-layer
  • проверь корневой AGENTS.md: что здесь лишнее и что перенести в .context/CONTEXT.md
  • нужен ли в этом проекте CLAUDE.md, если уже есть AGENTS.md

Как установить qi-layer

1Через Skills CLI (Vercel)

npx skills add haowjy/creative-writing-skills --skill qi-layer -a claude-code

2Вручную: положить файлы

~/.claude/skills/qi-layer/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/qi-layer/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о qi-layer

Как установить qi-layer в Claude?

Выполните npx skills add haowjy/creative-writing-skills --skill qi-layer -a claude-code. Скилл окажется в ~/.claude/skills/qi-layer/SKILL.md.

Что делает qi-layer?

Описывает, как писать и поддерживать пару AGENTS.md и .context/CONTEXT.md: структуру, четыре принципа организации знания и типичные ошибки вроде заметок о ходе работы или справочных таблиц в файле инструкций.

Чем CLAUDE.md отличается от AGENTS.md по этому скиллу?

Claude Code читает AGENTS.md, когда рядом нет CLAUDE.md. Отдельный CLAUDE.md нужен только под инструкции для Claude, и первой строкой в нём должен идти @AGENTS.md.

Исходный текст

SKILL.md · Apache-2.0
---
name: qi-layer
description: 'Use when writing or maintaining AGENTS.md, .context/CONTEXT.md, or a Claude-specific CLAUDE.md: keep intent docs minimal and load-bearing.'
---

# qi-layer

`/qi-maintenance` owns when colocated knowledge must move with the changes it describes.
This skill owns how to write and structure that knowledge.

Load `/knowledge-layers` for where each layer lives and what it holds.
Load `/llm-writing` if it isn't already loaded.

This skill is about **how to write and maintain** the directory-local pair:
AGENTS.md and `.context/CONTEXT.md`. The pair governs any tree agents work
in — code, the KB, docs, work directories. AGENTS.md loads into an agent's
bounded context as standing instructions: write it like a prompt, minimal,
every line load-bearing.

## The Four Principles

1. **Fractal Compression**: leaf AGENTS.md summarizes its directory's
   content; parent AGENTS.md summarizes its children. Each level is a
   compression of the level below.
2. **Hierarchical Summarization**: root provides broad architectural
   frame. Leaves provide local working knowledge. Agents accumulate
   understanding as they descend.
3. **LCA Deduplication**: shared knowledge appears once at the shallowest
   node covering all relevant paths.
4. **Progressive Disclosure**: give just enough to work correctly at this
   level. Link to `.context/CONTEXT.md` for depth.

## Writing AGENTS.md

Agents read AGENTS.md before opening anything else in the tree — write for
that moment. Ask: **what must someone understand before working here?**
That's what AGENTS.md captures.

Keep AGENTS.md as short as the directory allows, rarely past 200 lines.
Include only what has substance:

- **Purpose**: what this area IS and what it ISN'T (1–3 sentences)
- **Mental model**: how to think about this area, key abstractions
- **Key rules**: constraints, what breaks if you get it wrong
- **Anti-patterns**: what NOT to do here
- **Downlinks**: to `.context/` for depth, to related areas

An agent that only reads AGENTS.md should be able to work correctly here.
An agent that also reads .context/ should be able to change things safely.

## Writing .context/CONTEXT.md

Reference depth, co-located with what it describes. Where an agent
goes when it needs contracts, architecture, or rationale in detail.

Sections (use only those with substance):

- **Contracts**: interfaces, invariants, what breaks if violated
- **Architecture**: component relationships, data flow, dependency direction
- **Rationale**: why X over Y, rejected alternatives
- **Patterns**: how to work here, concrete pitfalls

The `.context/` directory is extensible: additional files alongside
CONTEXT.md for specialized concerns.

## What Does NOT Belong in AGENTS.md

Apply the **every-session test**: root AGENTS.md loads on every session.
If knowledge is only relevant when working in a specific domain, it belongs
in that domain's AGENTS.md or .context/, not root.

Apply the **think-vs-lookup test**: text whose removal would cause a
*wrong decision* belongs in AGENTS.md. Text an agent would merely have to
*look up* belongs in .context/. Text that changes no behavior gets
deleted — agents already know their craft and common conventions.

Specific failure modes:

- **Session bleed**: LLM working notes that calcified into the instruction
  file. Tells: status-update language ("**deleted**", "shipped", "deferred"),
  implementation terms packed without framing, history narration.
- **Reference material posing as intent**: tables, command blocks, full
  scheme vocabularies, implementation specifics.
- **Redundant guards**: prose warnings for invariants already enforced by
  a check (tests, types, validators). The check is the real guard; prose
  rots faster.
- **Duplicated knowledge**: restating what lives in a skill, a domain
  .context/, or a KB page. Link to where it lives.
- **Domain-specific detail at root**: URI scheme tables, gateway pricing
  internals, auth implementation details. These belong in their domain's
  AGENTS.md, not root.

## Structural Rules

- Relative paths for all links
- AGENTS.md and .context/ at the same directory level (siblings)
- Link to files, not headings (headings change more often)
- Lateral links between `.context/` directories with contracts between them
- LCA deduplication: if two siblings share context, put it in the parent

## CLAUDE.md

Claude Code reads AGENTS.md when a directory has no CLAUDE.md, so most
directories need only AGENTS.md. Add a CLAUDE.md only for Claude-specific
instructions, and make `@AGENTS.md` its first line: when CLAUDE.md exists,
Claude reads it instead of AGENTS.md. Never write shared instructions into
CLAUDE.md.

Loading differs by level. At the root, every harness loads AGENTS.md each
session. In subdirectories, Claude loads a nested AGENTS.md when it touches
files there; other agents see nested AGENTS.md only by reading it on entry. Write each nested
AGENTS.md for that reader: the local additions an agent needs on entry, with
everything else inherited from ancestors.

© haowjy · Apache-2.0 · haowjy/creative-writing-skills

Похожие скиллы

Все скиллы по теме «Настройка агента: память, контекст, субагенты» →
intent-layer crafter-station Раскладывает контекст по папкам: корневой AGENTS.md плюс дочерние узлы, чтобы агент понимал код как старший инженер. CX Codex +1 627установок sync jsmastery-pro Скилл доводит AGENTS.md, scope и статусы спек до состояния репозитория после готового изменения. Работает в Claude Code, Codex, Cursor, Copilot, Gemini CLI и OpenCode. CX Codex +1 4 300установок audit jsmastery-pro Сканирует проект и создаёт файлы AGENTS.md для контекста ИИ-агентов. Помогает описать правила кодовой базы с нуля или дополнить пропущенные зоны. CX Codex +1 4 300установок deepinit Yeachan-Heo Проходит по дереву репозитория и кладёт в каждую папку AGENTS.md: что там лежит, как связаны части и что агенту знать перед правками. CX Codex +1 1 000установок agents-md-generator Stanislav [MADTeacher] Chernyshev Создаёт и чистит AGENTS.md в корне репозитория и во вложенных модулях. Пригодится, когда инструкции для агента разрослись или противоречат друг другу. CX Codex +1 377установок claude-md luongnv89 Создаёт, обновляет или проверяет CLAUDE.md по практикам онбординга ИИ-агента. Полезен, когда файл инструкций разросся и агент перестал его слушать. CX Codex +1 ★ 45 153звёзд репо

Из того же набора22

creative-writing-muse Скилл для одного агента, который сам переключает роли: планирует, пишет, критикует и запоминает. Пригодится, когда субагентов нет. CX Codex +1 494установок creative-research Скилл собирает проверенный материал под ваш вопрос: историю, культуру, быт, детали ремесла. Возвращает отчёт со ссылками, из которого можно писать. CX Codex +1 487установок information-hierarchy Скилл для больших человекочитаемых материалов: отчётов, документации, многосекционных объяснений. Ответ идёт первым, глубина — за ним. CX Codex +1 399установок structured-artifact Скилл для сборки структурированных HTML-артефактов: помогает агенту решить, как подать материал, и только потом выбрать инструменты. CX Codex +1 387установок zoom-out Разбирает незнакомый участок кода с четырёх сторон и собирает из находок одну карту ориентирования. CX Codex +1 386установок knowledge-layers Скилл решает, в какой слой проекта писать знание: AGENTS.md, .context/, KB, docs/ или рабочий каталог. Пригодится, когда агент путается, где искать контекст. CX Codex +1 384установок md-validation Проверяет относительные ссылки между страницами и диаграммы Mermaid до коммита. Пригодится тем, кто собирает многостраничные документы и базы знаний. CX Codex +1 383установок reflect Проверяет результат работы перед финальным отчётом и направляет сохранённые знания в файлы проекта. Пригодится, чтобы сверить ожидания и зафиксировать важные детали сессии. CX Codex +1 378установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой