MCPInstall

knowledge-layers

Use when deciding where knowledge goes or reading/writing durable docs: AGENTS.md, .context/, KB, docs/, and work directories.

Installs
385
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/haowjy/creative-writing-skills --skill knowledge-layers
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads knowledge-layers automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Knowledge Layers

Load /creative-writing-skills:qi-layer when writing or editing AGENTS.md or .context/ files: it owns the craft (four principles, contents guidelines, what doesn't belong). Load /creative-writing-skills:information-hierarchy if not already loaded for disclosure tiers. Load /creative-writing-skills:llm-writing if not already loaded.

The Five Layers

LayerWhat it holdsWhen to use it
AGENTS.mdIntent and mental model for a directoryFirst thing agents read on entry; what to understand before working here
.context/Contracts, architecture, rationale (CONTEXT.md); deferred work (TODO, FUTURE)Reference depth and tracked deferrals, co-located with the material they describe
KBCross-cutting decisions, domain concepts, patternsSpans directories; outlives sessions; no single directory owns it
docs/User-facing documentationDifferent audience, different update cadence
Work directoryTemporary design decisions and scratchNot colocated with durable content; scoped to an active work item

Placement Rules

If it's intent/mental-model for a directory → AGENTS.md. If it's directory-scoped depth an agent looks up → .context/. If it's deferred work scoped to this directory → .context/TODO (must-do) or .context/FUTURE (nice-to-have). Flat markdown lists — each entry names the affected path and concrete follow-up. Cross-cutting items or items needing external visibility get filed in the project's issue tracker instead. If it's big picture — cross-cutting decisions, domain concepts, higher-level system architecture → KB. If it's for end users → docs/. If it's the human correcting an agent → the KB corrections register (resources/corrections/register.md; code.md beside it for code projects). /creative-writing-skills:correct fixes the classes that repeat. If it's a temporary work artifact → work directory.

When in doubt, colocate. Knowledge that depends on one subsystem belongs in that subsystem's AGENTS.md or .context/ even when it reads like a concept; the KB stays independent of any one implementation, holding what survives a change to it. Knowledge that lives far from what it describes rots faster: changes to the thing don't trigger awareness that a distant doc needs updating.

The KB links to the work's own docs. Before writing to the KB about some work, read the docs, AGENTS.md, .context/, and comments the work updated. Link to what they describe, and write only what they don't say: the settled intent, the reason, the rejected alternatives, how it relates to the rest of the project. When they say all of it, the KB gets a link or nothing. Cut a KB section that restates them down to the link and the parts they don't say; the copy drifts the next time they change.

Current Truth Over History

Every durable layer — AGENTS.md, .context/, KB, docs/ — holds the best current understanding; work directories may keep intermediate reasoning while their work item is active. When durable content is superseded, delete it or (for KB pages) move it to archive/ (.kgignore'd, excluded from the knowledge graph). Live content never references archived content. Pages read as current truth, never narrate their own evolution.

Deletion needs no replacement. A page whose subject is gone, or that describes behavior the system no longer has, gets deleted on sight — even with nothing new to write in its place. Stale knowledge is worse than a gap: agents load it and reason from it. Deletion is the content-truth owner's call; structural roles flag instead.

History is the archive. In a version-controlled tree, commit untracked files before deleting them so the removal lands in history, and say what was removed and why in the commit message. Elsewhere, preserve what still matters in the project's archive before deleting. Deletion is cheap because nothing preserved is truly lost.

Truth is anchored per layer. AGENTS.md and .context/ describe the tree that contains them: update them in the same change as what they describe. The KB records the current settled intent — what the project should be — and an invariant is KB truth the moment the human settles it, done or not. Unsettled intent isn't KB material; it stays in the work directory. docs/ describes what has shipped to its readers. In a code project, load resources/code.md for how this maps to branches, merges, and shipped code.

Decision records are the exception: preserve superseded decisions in place when they explain why the system changed. Mark the old decision as superseded and link to the replacement.

Invariants and Current Choices

Record each settled point as one of two kinds. An invariant must hold however the work is done. A current choice is what the project is doing or trying for now. The test: if an agent found a better way that broke it, should it stop and ask the human who owns the project first? If yes, it's an invariant; if no, the agent changes it and updates the doc.

Default to current choice. The human's hedges ("for now", "let's try", "i think", "whatever is less work") mark a trial, and so does the human agreeing to something an agent proposed. An agent's own call stays a current choice until the human makes it an invariant. Quote the human with their hedges kept, and never record a trial as their ruling.

Write invariants as rules, in decision records or AGENTS.md. Write current choices as how things stand now, beside the work they describe. Measurements and the story of what went wrong go beside what they measure or explain, not inside a rule. A status line says only whether the thing is done, partly done, not done, or superseded; how it got there belongs in version control or the archive.

KB Conventions

Structure

The KB is a directory tree like any other: it carries its own AGENTS.md and .context/ pair, written per /creative-writing-skills:qi-layer — intent in AGENTS.md, governance depth (writing conventions, structure, validation) in .context/. Read the KB's own AGENTS.md before writing. Treat this skill as the cross-project default; the local KB guide wins for that KB. See resources/bootstrap.md for a suggested starting layout.

Wiki Page Conventions

Follow /creative-writing-skills:information-hierarchy. One concept per document; name files by what they describe (token-validation.md), not when (auth-redesign-notes.md). Cross-reference instead of re-explaining. Load /creative-writing-skills:shared-dao for vocabulary methodology. Use mermaid for anything spatial; capture what the files themselves can't easily tell you.

Operations

Ingest: new information enters the KB. Read the source, extract key knowledge, write or update wiki pages, and update indexes/cross-links touched by the change.

Maintain: keep the wiki current per Current Truth Over History above.

Lint: health-check the wiki. Look for contradictions, stale claims, orphan pages, missing cross-references. Use /creative-writing-skills:md-validation for link checking and diagram validation.

Flag content needing human attention with > [!FLAG] **Needs human review**.

FAQ

What does the knowledge-layers skill do?

Use when deciding where knowledge goes or reading/writing durable docs: AGENTS.md, .context/, KB, docs/, and work directories.

How do I install knowledge-layers?

Run npx skills add https://github.com/haowjy/creative-writing-skills --skill knowledge-layers in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/knowledge-layers/ (personal) or .claude/skills/knowledge-layers/ (project).

Which AI agents can use knowledge-layers?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is knowledge-layers safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains knowledge-layers?

It is published by haowjy in haowjy/creative-writing-skills. It has 385 recorded installs.

More from haowjy/creative-writing-skills

View all →

writing-principles

haowjy/creative-writing-skills

What fiction readers want (reader reward channels) and the specific ways LLM training damages them. Load when drafting prose, critiquing, or diagnosing why a passage feels flat.

Docs & Writing1K installs

creative-writing-craft

haowjy/creative-writing-skills

Craft references for writing fiction well: prose, scenes, style, voice, and genre/page-level technique. Load when a writer, critic, or muse needs how-to-write guidance rather than a production mode.

Docs & Writing788 installs

llm-writing

haowjy/creative-writing-skills

Load before writing or revising human-facing text. Choose words deliberately, ground the piece in the reader's context, and remove default LLM phrasing before the final draft.

Docs & Writing751 installs

writing-staffing

haowjy/creative-writing-skills

Dispatch reference for composing writing teams. Teaches which extra skills to attach, which files to pass, which resources to reference, and when to fan out versus run parallel lanes. Load when staffing a workflow.

Docs & Writing724 installs

story-review

haowjy/creative-writing-skills

Review work after prose exists: editorial review, craft critique, continuity/voice review, copyediting, proofreading, and synthesis of reader-sim signal. Load when diagnosing a draft rather than rewriting it.

story-planning

haowjy/creative-writing-skills

Planning work before prose: creative direction, story-planning, outlining, and story architecture. Load when deciding what should happen or how a story should be structured.

Popular docs & writing skills

View category →

grill-with-docs

mattpocock/skills

A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.

Docs & Writing1.2M installs

lark-markdown

open.feishu.cn

飞书 Markdown:查看、创建、上传、编辑和比较飞书中的原生 Markdown 文件。当用户要操作飞书 Markdown 文件,或比较其远端版本及本地草稿时使用。纯本地 Markdown 文件操作不触发本 skill。不负责将 Markdown 导入为飞书在线文档,也不负责文件搜索、权限、评论、移动、删除等云空间管理操作。

Docs & Writing778.7K installs

writing-beats

mattpocock/skills

Writing, exploit; assemble raw material into a journey of beats, grounding each term before a beat leans on it.

Docs & Writing490.7K installs

writing-shape

mattpocock/skills

Writing, exploit: shape raw material into an article, paragraph by paragraph.

Docs & Writing490.2K installs

writing-fragments

mattpocock/skills

Writing, explore: mine raw fragments, no structure yet.

Docs & Writing489.6K installs

writing-for-agents

mattpocock/skills

Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.

Docs & Writing479.3K installs