Skip to main content
skill CX Codex

qi-layer · haowjy, claude — Claude Code skill: what it does, how to install

The qi-layer skill provides a structure for maintaining agent instructions in AGENTS.md and .context/CONTEXT.md. It activates when writing or updating project-level context.

Apache-2.0 441 installs ★ 601 updated 2026-10-25

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add haowjy/creative-writing-skills --skill qi-layer -a claude-code
Open on GitHub

What qi-layer does

This skill guides the creation of AGENTS.md and .context/CONTEXT.md files to ensure agents receive essential instructions without session bloat. It defines how to manage knowledge across directory trees.

AGENTS.md focuses on critical information such as domain purpose, validation commands, and code pitfalls. It prevents session bleed by keeping temporary notes, history, and automated overviews out of the instructions. The skill enforces a clean hierarchy where child directories only add local context not found in the parent.

Depth-first information like architecture and contracts belongs in .context/CONTEXT.md instead. Note that agents ignore AGENTS.md if a CLAUDE.md file exists in the directory or above it.

What it helps with

  • streamline system prompts in repositories
  • link agent instructions with project context
  • remove redundant info from AGENTS.md
  • organize architectural docs in .context/

Example prompts for the agent

  • Check AGENTS.md in the current folder with qi-layer
  • Update CONTEXT.md following qi-layer guidelines
  • Structure a new module based on qi-layer rules

How to install qi-layer

1Skills CLI (Vercel)

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

2Manually: put the files in place

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

Copy the whole skill folder; for one project use .claude/skills/qi-layer/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about qi-layer

How to install qi-layer in Claude Code?

Run the command npx skills add haowjy/creative-writing-skills --skill qi-layer -a claude-code.

What does qi-layer do?

It manages the content of AGENTS.md and .context/CONTEXT.md to ensure agents stay focused on important tasks without reading unnecessary documentation.

What is required for qi-layer to work?

Ensure no CLAUDE.md files are present in the directory hierarchy, as they take precedence and prevent AGENTS.md from loading.

Source text

SKILL.md · Apache-2.0
---
name: qi-layer
description: 'Use when writing or maintaining AGENTS.md or .context/CONTEXT.md: AGENTS.md loads automatically, so it keeps only what matters most.'
metadata:
  type: reference
---

# qi-layer

How to write the colocated pair, `AGENTS.md` and `.context/CONTEXT.md`, in
any tree agents work in: code, a KB, docs, a work directory.

## Writing AGENTS.md

`AGENTS.md` is loaded automatically: the root one into every session, a
nested one when an agent works in its directory, on harnesses that load
nested files. Codex loads only the files from the root down to where it
started, so the root tells agents to read an area's `AGENTS.md` before
changing that area. Write instructions there, not in a `CLAUDE.md`: Claude reads
`AGENTS.md` only when no `CLAUDE.md` sits in the directory or above it. Every line costs every
agent that works there, every time, so it holds only the most important
information: what must an agent understand before working here? Write it
like a prompt, as short as the directory allows, rarely past 200 lines.
Write a nested file as the local additions an agent needs on entry.

Put in only what an agent can't work out by reading the code: what the area
is for and, at the root, who its users are and what they rely on; the
commands that check work here; places where the code misleads (a live
directory that looks dead, a pattern new code must not copy); choices that
aren't visible in the code; mistakes agents have made here more than once;
and links to `.context/` and related areas. An agent that reads only
`AGENTS.md` should work correctly here; one that also reads `.context/`
should change things safely.

The tree compresses as it climbs. A leaf summarizes its directory, a parent
its children, and shared knowledge appears once, at the shallowest directory
covering every place it applies. Agents accumulate the tree as they descend,
so a child never repeats its parent.

## Writing .context/

`.context/CONTEXT.md` holds the depth an agent looks up before editing:
contracts and what breaks if they're violated, architecture and dependency
direction, rationale, concrete pitfalls. Add files beside it for specialized
concerns.

## What Doesn't Belong in AGENTS.md

Test each line: would removing it cause a wrong decision here? Text an agent
would only have to look up goes in `.context/`; text that changes nothing
gets deleted. Detail that matters in one domain goes in that domain's
directory, not the root.

- **Session bleed:** working notes that calcified into instructions: status
  words ("shipped", "deferred"), history, decision IDs, implementation terms
  with no framing.
- **Overviews:** architecture, file layout, tables of modules or fields,
  full vocabularies. The agent reads the repo itself; depth it has to look
  up goes in `.context/` or the code's own docs.
- **Procedures some runs need:** releasing, migrations, a review checklist.
  They go in a doc or skill the file links to.
- **Rules that can't have exceptions:** make them a hook, deny rule or CI
  check. A prose rule is followed almost always, not always, and emphasis
  (ALL CAPS, IMPORTANT) makes the model over-apply it.
- **Guards a check already enforces:** the test, type or lint is the guard;
  prose beside it rots.
- **Copies** of what a skill, another `.context/`, or a KB page says. Link
  to it.

## Structure

- Relative links, to files rather than headings.
- `AGENTS.md` and `.context/` sit side by side in the same directory.
- Link across `.context/` directories that share a contract.

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

Similar skills

All skills for Agent setup: memory, context, orchestration →

qi-layer by other authors comes first.

qi-layer haowjy qi-layer — a skill that sets the rules for writing and maintaining AGENTS.md and .context/CONTEXT.md so intent docs stay short and load-bearing. CX Codex +1 441installs intent-layer crafter-station intent-layer builds a folder-by-folder context tree — one root AGENTS.md plus child nodes — so agents read your codebase the way a senior engineer would. CX Codex +1 639installs context-layer-health-check PostHog The context-layer-health-check Claude Code skill checks a context wiki after changes are consolidated. It triages missed entries, conflicting claims, and outdated priorities. CX Codex +1 150installs developer-relations-kickoff Samuel Berthe The developer-relations-kickoff Claude Code skill routes developer relations work to a matching skill in the collection, or says when none applies. It also starts or refreshes a shared project context file. CX Codex +1 13,900installs audit jsmastery-pro audit scans codebases to generate and gap fill AGENTS.md context files. Helps bootstrap shared rules for AI assistants on greenfield or legacy repos. CX Codex +1 5,100installs sync jsmastery-pro sync — a skill that brings AGENTS.md, the scope and spec status lines back in line with what the repo shows after a change. Runs in Claude Code, Codex, Cursor, Copilot, Gemini CLI and OpenCode. CX Codex +1 5,000installs deepinit Yeachan-Heo deepinit walks a repository and writes an AGENTS.md per directory: what sits there, how the parts connect, what an agent should know before editing. CX Codex +1 1,100installs

From the same set32

The whole set →
information-hierarchy information-hierarchy — a skill for large human-facing output: reports, docs, multi-section explanations. The answer comes first, depth sits behind it. CX Codex +1 456installs zoom-out zoom-out spawns parallel explorers across structure, knowledge, and decision history, then merges their reports into a single orientation map of the area. CX Codex +1 443installs zoom-out zoom-out is a Claude Code skill that maps an unfamiliar part of a project. It starts when someone asks to get oriented or takes over work in an unfamiliar subsystem. CX Codex +1 443installs structured-artifact structured-artifact — a skill for building structured HTML artifacts: the agent decides how to present the content first, then picks the tools. CX Codex +1 443installs knowledge-layers The knowledge-layers Claude Code skill sorts project knowledge across nearby docs, a knowledge base, and work directories. It activates when choosing where information belongs or editing durable documentation. CX Codex +1 441installs md-validation The md-validation Claude Code skill checks Markdown links and Mermaid syntax. Run it after documentation edits and before committing. CX Codex +1 441installs md-validation md-validation is a Claude Code skill that checks Markdown links and Mermaid diagrams. It activates on requests to validate links or diagrams before delivery. CX Codex +1 441installs knowledge-layers knowledge-layers — a skill that decides which layer holds a piece of knowledge: AGENTS.md, .context/, KB, docs/ or a work directory. Useful when the agent keeps looking in the wrong place. CX Codex +1 441installs

Project sponsors

Companies that keep this analytics open