Kb management skill

Maintaining the story knowledge base: creating, updating, and organizing wiki-style reference pages in kb/.

by haowjy·Apache-2.0 license·★ 506 Stars on the repo·GitHub ↗

Use now

Files of Kb management

haowjy/main1 file shown
SKILL.md
Show the full text125 lines

KB Management

The knowledge base (kb/) is the project's durable memory. Every agent reads from it for context. This skill covers how to maintain it well.

Layers

Canon: established facts the story has committed to. Once a chapter is published/finalized, the facts it establishes are canon. Contradicting canon breaks reader trust.

Wiki: synthesized reference pages. How the magic system works, character relationships, faction politics. Living documents that evolve as the story develops.

Styles: voice reference files derived from prose samples. The writer and critic agents depend on these for voice consistency.

Vocab: canonical story terms, aliases, and exclusions. Project-wide terms live in kb/vocab.md; domain terms live beside the domain they govern, such as kb/world/vocab.md.

Issues: tracked writing problems that span multiple chapters (recurring tics, pacing patterns, continuity errors). See the story-memory skill.

Page Conventions

One Concept Per Document

Each doc covers one coherent topic: one character, one location, one system. When a doc covers two unrelated topics, split it. When two docs explain the same thing from different angles, merge or cross-reference.

Name files by what they describe (fire-magic.md, protagonist.md), not when they were written (session-3-notes.md).

Organization
kb/
  characters/
    <name>.md              # one file per character
  vocab.md                 # project-wide canonical terms
  world/
    vocab.md               # worldbuilding terms when needed
    <topic>.md             # locations, factions, systems
    <domain>/
      vocab.md             # subdomain terms when needed
      <topic>.md           # nest when a domain has many pages
  timeline/
    <arc-or-period>.md     # chronological entries
  canon/
    <chapter-or-arc>.md    # hard facts per chapter/arc
  styles/
    <style-name>.md        # voice reference files
  issues/
    <issue-name>.md        # tracked writing problems

The project's CLAUDE.md may customize this. Read it first.

Linking

Link to related pages with relative paths. Cross-reference instead of duplicating: one source of truth per concept. A character page links to the location page for their home, the timeline entry for their arc, etc.

Readability

Write pages that work in isolation:

  • Self-contained: enough context that a reader doesn't need three other pages first
  • Scannable: headers, bullets, tables. Bold key terms on first use.
  • Concrete: specific quotes, chapter references, scene citations
  • Current: update when the story invalidates or extends what's here

Vocab Pages

Use vocab pages when terms matter across agents: magic names, faction labels, place names, titles, relationship labels, invented words, recurring in-world phrases, and genre terms with project-specific meanings.

Each entry should include:

  • Canonical name: the form agents should use
  • Definition: one to three sentences, including what the term is not when ambiguity is likely
  • Aliases: names the author, characters, drafts, or older kb pages actually use
  • Source: where the usage was established or decided

Resolve conflicts early. If two terms seem to name the same thing, pick the canonical form with the author or flag it in the report instead of carrying both forward silently.

When to Create vs Update

Create a new page when a concept is finalized enough to be referenced by other agents. Don't create pages for things still in story-planning.

Update an existing page when new chapters establish facts about it, when the author makes decisions that change it, or when a page has become stale.

Split when a page grows past ~200 lines or covers multiple unrelated concepts.

What Belongs in KB vs Work

  • Finalized knowledge → kb/
  • Draft iterations, brainstorm captures, critique reports → work/
  • Promoted facts after a draft completes → kb/canon/ or relevant wiki page

Use /story-memory for routine fact extraction from completed chapters. Direct kb edits are for the author or muse when capturing decisions interactively.

1---
2name: kb-management
3description: >
4 Maintaining the story knowledge base: creating, updating, and organizing
5 wiki-style reference pages in kb/. Use when capturing finalized story
6 knowledge, updating character profiles, documenting world mechanics, or
7 restructuring the kb.
8---
9 
10# KB Management
11 
12The knowledge base (`kb/`) is the project's durable memory. Every agent reads
13from it for context. This skill covers how to maintain it well.
14 
15## Layers
16 
17**Canon**: established facts the story has committed to. Once a chapter is
18published/finalized, the facts it establishes are canon. Contradicting canon
19breaks reader trust.
20 
21**Wiki**: synthesized reference pages. How the magic system works, character
22relationships, faction politics. Living documents that evolve as the story
23develops.
24 
25**Styles**: voice reference files derived from prose samples. The writer
26and critic agents depend on these for voice consistency.
27 
28**Vocab**: canonical story terms, aliases, and exclusions. Project-wide terms
29live in `kb/vocab.md`; domain terms live beside the domain they govern, such as
30`kb/world/vocab.md`.
31 
32**Issues**: tracked writing problems that span multiple chapters (recurring
33tics, pacing patterns, continuity errors). See the story-memory skill.
34 
35## Page Conventions
36 
37### One Concept Per Document
38 
39Each doc covers one coherent topic: one character, one location, one system.
40When a doc covers two unrelated topics, split it. When two docs explain the
41same thing from different angles, merge or cross-reference.
42 
43Name files by what they describe (`fire-magic.md`, `protagonist.md`), not
44when they were written (`session-3-notes.md`).
45 
46### Organization
47 
48```text
49kb/
50 characters/
51 <name>.md # one file per character
52 vocab.md # project-wide canonical terms
53 world/
54 vocab.md # worldbuilding terms when needed
55 <topic>.md # locations, factions, systems
56 <domain>/
57 vocab.md # subdomain terms when needed
58 <topic>.md # nest when a domain has many pages
59 timeline/
60 <arc-or-period>.md # chronological entries
61 canon/
62 <chapter-or-arc>.md # hard facts per chapter/arc
63 styles/
64 <style-name>.md # voice reference files
65 issues/
66 <issue-name>.md # tracked writing problems
67```
68 
69The project's `CLAUDE.md` may customize this. Read it first.
70 
71### Linking
72 
73Link to related pages with relative paths. Cross-reference instead of
74duplicating: one source of truth per concept. A character page links to
75the location page for their home, the timeline entry for their arc, etc.
76 
77### Readability
78 
79Write pages that work in isolation:
80 
81- **Self-contained**: enough context that a reader doesn't need three
82 other pages first
83- **Scannable**: headers, bullets, tables. Bold key terms on first use.
84- **Concrete**: specific quotes, chapter references, scene citations
85- **Current**: update when the story invalidates or extends what's here
86 
87## Vocab Pages
88 
89Use vocab pages when terms matter across agents: magic names, faction labels,
90place names, titles, relationship labels, invented words, recurring in-world
91phrases, and genre terms with project-specific meanings.
92 
93Each entry should include:
94 
95- **Canonical name**: the form agents should use
96- **Definition**: one to three sentences, including what the term is not when ambiguity is likely
97- **Aliases**: names the author, characters, drafts, or older kb pages actually use
98- **Source**: where the usage was established or decided
99 
100Resolve conflicts early. If two terms seem to name the same thing, pick the
101canonical form with the author or flag it in the report instead of carrying
102both forward silently.
103 
104## When to Create vs Update
105 
106**Create** a new page when a concept is finalized enough to be referenced
107by other agents. Don't create pages for things still in story-planning.
108 
109**Update** an existing page when new chapters establish facts about it,
110when the author makes decisions that change it, or when a page has become
111stale.
112 
113**Split** when a page grows past ~200 lines or covers multiple unrelated
114concepts.
115 
116## What Belongs in KB vs Work
117 
118- Finalized knowledge → `kb/`
119- Draft iterations, brainstorm captures, critique reports → `work/`
120- Promoted facts after a draft completes → `kb/canon/` or relevant wiki page
121 
122Use `/story-memory` for routine fact extraction from completed chapters.
123Direct kb edits are for the author or muse when capturing decisions
124interactively.
125 

Discussion