# Qi Layer

Use when writing or maintaining AGENTS.md, .context/CONTEXT.md, or a Claude-specific...

- Repository: https://github.com/haowjy/creative-writing-skills (556 stars)
- Category: AI and agents
- License: Apache-2.0
- Last updated: 2026-10-28
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add haowjy/creative-writing-skills --skill qi-layer -g -a claude-code -y`
Codex: `npx skills add haowjy/creative-writing-skills --skill qi-layer -g -a codex -y`
Cursor: `npx skills add haowjy/creative-writing-skills --skill qi-layer -g -a cursor -y`
Gemini CLI: `npx skills add haowjy/creative-writing-skills --skill qi-layer -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add haowjy/creative-writing-skills`

## Description

Use when writing or maintaining AGENTS.md, .context/CONTEXT.md, or a Claude-specific CLAUDE.md: keep intent docs minimal and load-bearing.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# qi-layer

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

Load `/creative-writing-skills:knowledge-layers` for where each layer lives and what it holds.
Load `/creative-writing-skills: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

The rest: https://github.com/haowjy/creative-writing-skills/blob/HEAD/plugin/opencode/skills/qi-layer/SKILL.md
