Purpose
KNOWLEDGE.md files hold background knowledge — rationale, decision tables,
constraints — with a fixed frontmatter schema so they can be found without
being read. This skill covers finding them and writing them.
When to use: before designing or reviewing in an unfamiliar area (search
first) / when a decision or rationale worth keeping has been settled (author).
Search
python3 scripts/knowledge/search.py # list all documents
python3 scripts/knowledge/search.py lookup rbac # every term must match
Terms match name, type, keywords, description, and path (case-insensitive).
Judge by the printed description; open only the files you actually need.
Frontmatter schema
| Field |
Required |
Value |
name |
yes |
stable id, kebab-case, unique across the repo. Never rename |
type |
yes |
document kind: design-rationale / decision-table / constraints / reference (open vocabulary) |
description |
yes |
noun-phrase list of what the document covers — the primary search signal. Not a sentence about the document |
scope |
yes |
directory the knowledge applies to |
keywords |
no |
5-10 terms; include code identifiers (class/function names) |
sources |
no |
file/directory paths the content is grounded in — never PR or issue numbers |
generated |
yes |
{by, at} — actor and date of the last meaningful change |
verified |
no |
list of {by, at} — human review sign-off for the current content |
status |
no |
draft / stable (default) / deprecated |
Actor convention: <producer>/<version> for agents (e.g. claude-code/fable-5),
human:<id> for people (e.g. human:hyeokjin).
Lifecycle rules
- A meaningful change (content, judgment, table) updates
generated and
removes verified — the sign-off applied to the old content. Typo and
formatting fixes touch neither.
verified is added only for a human review of the current content.
- Set
status: deprecated before deleting a document, so inbound links get a
window to migrate.
- Knowledge follows the rules: when an
AGENTS.md change shifts a base
assumption, or a migration a document describes as in-progress completes,
update the affected document in the same change. Routine task-level edits
are not a trigger — the test is whether the document's assumptions still hold.
Body structure
- The document's job is the package's background knowledge — what a
newcomer must assume before touching the package. Local curiosities without
that frame do not stand alone.
- Open with why the package exists — the reason it is defined as its own
package and what role it plays for its consumers — before any specific
topic.
- The heading is the claim: each section heading states one claim; the
body backs it with 2-4 single-sentence bullets. Comparisons and
enumerations use tables or list syntax — never a long paragraph. Prose
paragraphs are allowed only in the opening section, two sentences at most.
- A parent document never restates knowledge a subpackage document owns —
link it from the header pointer or where the context needs it. Every
section must be knowledge about this package itself.
Size and splitting
- One
KNOWLEDGE.md per package. The document follows the package
structure — there are no per-topic knowledge files.
- Keep a document under ~200 lines and on one topic cluster. The
description is the test: when it reads as two unrelated lists, the package
is carrying two concerns.
- An oversized
KNOWLEDGE.md is a package-design signal, not a documentation
problem — split the package, or move the extra topic's knowledge into the
subpackage's own KNOWLEDGE.md.
References and links
- Code references go in
sources (paths only). Document-to-document
references go in the body as relative markdown links, where the
surrounding sentence says why the link matters. There is no frontmatter
link list.
- No dangling links: CI fails on links to missing files. Mention a planned
document in plain text, without a link.
Check before pushing
python3 scripts/knowledge/check.py
Validates the schema, scope/sources path existence, body links, name
uniqueness, and the verified-not-older-than-generated invariant.
knowledge-check.yml runs the same script on pull requests.
What goes where
| Content |
Home |
| Imperative rules |
AGENTS.md |
| Rationale, decision tables, constraints, canonical examples |
KNOWLEDGE.md |
| Human-facing component overview |
README.md |
| Issue-scoped working notes |
outside the repo |
1---2name: knowledge3description: Search and author KNOWLEDGE.md background-knowledge documents - frontmatter schema, search/check scripts, and the generated/verified lifecycle rules4---56## Purpose78`KNOWLEDGE.md` files hold background knowledge — rationale, decision tables,9constraints — with a fixed frontmatter schema so they can be **found without10being read**. This skill covers finding them and writing them.1112**When to use:** before designing or reviewing in an unfamiliar area (search13first) / when a decision or rationale worth keeping has been settled (author).1415## Search1617```bash18python3 scripts/knowledge/search.py # list all documents19python3 scripts/knowledge/search.py lookup rbac # every term must match20```2122Terms match name, type, keywords, description, and path (case-insensitive).23Judge by the printed description; open only the files you actually need.2425## Frontmatter schema2627| Field | Required | Value |28|---|---|---|29| `name` | yes | stable id, kebab-case, unique across the repo. Never rename |30| `type` | yes | document kind: `design-rationale` / `decision-table` / `constraints` / `reference` (open vocabulary) |31| `description` | yes | noun-phrase list of what the document covers — the primary search signal. Not a sentence about the document |32| `scope` | yes | directory the knowledge applies to |33| `keywords` | no | 5-10 terms; include code identifiers (class/function names) |34| `sources` | no | file/directory paths the content is grounded in — never PR or issue numbers |35| `generated` | yes | `{by, at}` — actor and date of the last meaningful change |36| `verified` | no | list of `{by, at}` — human review sign-off for the current content |37| `status` | no | `draft` / `stable` (default) / `deprecated` |3839Actor convention: `<producer>/<version>` for agents (e.g. `claude-code/fable-5`),40`human:<id>` for people (e.g. `human:hyeokjin`).4142## Lifecycle rules4344- A meaningful change (content, judgment, table) updates `generated` and45 **removes `verified`** — the sign-off applied to the old content. Typo and46 formatting fixes touch neither.47- `verified` is added only for a human review of the current content.48- Set `status: deprecated` before deleting a document, so inbound links get a49 window to migrate.50- Knowledge follows the rules: when an `AGENTS.md` change shifts a base51 assumption, or a migration a document describes as in-progress completes,52 update the affected document **in the same change**. Routine task-level edits53 are not a trigger — the test is whether the document's assumptions still hold.5455## Body structure5657- **The document's job is the package's background knowledge** — what a58 newcomer must assume before touching the package. Local curiosities without59 that frame do not stand alone.60- **Open with why the package exists** — the reason it is defined as its own61 package and what role it plays for its consumers — before any specific62 topic.63- **The heading is the claim**: each section heading states one claim; the64 body backs it with 2-4 single-sentence bullets. Comparisons and65 enumerations use tables or list syntax — never a long paragraph. Prose66 paragraphs are allowed only in the opening section, two sentences at most.67- A parent document never restates knowledge a subpackage document owns —68 link it from the header pointer or where the context needs it. Every69 section must be knowledge about this package itself.7071## Size and splitting7273- **One `KNOWLEDGE.md` per package.** The document follows the package74 structure — there are no per-topic knowledge files.75- Keep a document under **~200 lines** and on one topic cluster. The76 description is the test: when it reads as two unrelated lists, the package77 is carrying two concerns.78- An oversized `KNOWLEDGE.md` is a package-design signal, not a documentation79 problem — split the package, or move the extra topic's knowledge into the80 subpackage's own `KNOWLEDGE.md`.8182## References and links8384- Code references go in `sources` (paths only). Document-to-document85 references go **in the body** as relative markdown links, where the86 surrounding sentence says why the link matters. There is no frontmatter87 link list.88- No dangling links: CI fails on links to missing files. Mention a planned89 document in plain text, without a link.9091## Check before pushing9293```bash94python3 scripts/knowledge/check.py95```9697Validates the schema, scope/sources path existence, body links, name98uniqueness, and the verified-not-older-than-generated invariant.99`knowledge-check.yml` runs the same script on pull requests.100101## What goes where102103| Content | Home |104|---|---|105| Imperative rules | `AGENTS.md` |106| Rationale, decision tables, constraints, canonical examples | `KNOWLEDGE.md` |107| Human-facing component overview | `README.md` |108| Issue-scoped working notes | outside the repo |