qi-layer
Skill2 starsChanged 25 days agoApache-2.0View on GitHub
Use when writing or maintaining AGENTS.md, .context/CONTEXT.md, or CLAUDE.md mirrors: keep intent docs minimal and load-bearing.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Abdullokh-N/proza-rutheir own version, first seen Aug 27, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Abdullokh-N/proza-ru★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository33 other files it gives its agents.
- character-simSkill
- cold-readSkill
- creative-researchSkill
- creative-writing-craftSkill
- creative-writing-modesSkill
- creative-writing-museSkill
- demolitionSkill
- exportSkill
- gatesSkill
- grill-with-docsSkill
- information-hierarchySkill
- intent-modelingSkill
- kb-integritySkill
- kb-managementSkill
- knowledge-layersSkill
- llm-writingSkill
- md-validationSkill
- project-setupSkill
- reader-simSkill
- reflectSkill
- series-bibleSkill
- seriesSkill
- shared-daoSkill
- story-ledgersSkill
- story-memorySkill
- story-planningSkill
- story-reviewSkill
- structured-artifactSkill
- style-guardrailsSkill
- voiceSkill
- writing-principlesSkill
- writing-staffingSkill
- zoom-outSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 39
Keep AGENTS.md as short as the directory allows, rarely past 200 lines.
- Very specific: line 69
If knowledge is only relevant when working in a specific domain, it belongs in that domain's AGENTS.md or .context/, not root.
- Very specific: line 109
Never write shared instructions into CLAUDE.md.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
qi-layer
/qi-maintenance owns when colocated knowledge must move with source changes.
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
- 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.
- Hierarchical Summarization: root provides broad architectural frame. Leaves provide local working knowledge. Agents accumulate understanding as they descend.
- LCA Deduplication: shared knowledge appears once at the shallowest node covering all relevant paths. Never duplicate between siblings.
- Progressive Disclosure: give just enough to work correctly at this
level. Link to
.context/CONTEXT.mdfor 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 the code 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 how to code and follow 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 tests or types. The code is the real guard; prose rots faster.
- Duplicated knowledge: restating what lives in a skill, a domain .context/, or a KB page. Point, don't duplicate.
- 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 Mirrors
Claude harnesses read CLAUDE.md, not AGENTS.md. Give every AGENTS.md a
sibling CLAUDE.md whose first line is @AGENTS.md — normally the whole
file. After creating or moving AGENTS.md files, create the mirror yourself:
a sibling CLAUDE.md that is exactly the one-line import @AGENTS.md. Skip
mirrors that are already exact; treat any other divergence as a conflict and
surface it rather than silently overwriting.
Never write shared instructions into CLAUDE.md. Claude-only knowledge is
rare; when it exists, put it below the @AGENTS.md import and expect
claude-md-fix to keep flagging the file, so the divergence stays visible.
Loading differs by level. At the root, each harness auto-loads its own file every session: Claude reads CLAUDE.md, others read AGENTS.md. In subdirectories, Claude auto-injects CLAUDE.md when it touches files there; other agents see nested AGENTS.md only by reading it on entry. Don't lean on Claude's auto-injection: a nested AGENTS.md carries the local additions an agent needs on entry, with everything else inherited from ancestors.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

