@thjodann/wk 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +197 -0
  3. package/dist/cli/commands/article.d.ts +2 -0
  4. package/dist/cli/commands/article.js +47 -0
  5. package/dist/cli/commands/article.js.map +1 -0
  6. package/dist/cli/commands/closeout.d.ts +2 -0
  7. package/dist/cli/commands/closeout.js +37 -0
  8. package/dist/cli/commands/closeout.js.map +1 -0
  9. package/dist/cli/commands/compile.d.ts +2 -0
  10. package/dist/cli/commands/compile.js +50 -0
  11. package/dist/cli/commands/compile.js.map +1 -0
  12. package/dist/cli/commands/concept.d.ts +2 -0
  13. package/dist/cli/commands/concept.js +36 -0
  14. package/dist/cli/commands/concept.js.map +1 -0
  15. package/dist/cli/commands/decision.d.ts +2 -0
  16. package/dist/cli/commands/decision.js +38 -0
  17. package/dist/cli/commands/decision.js.map +1 -0
  18. package/dist/cli/commands/event.d.ts +2 -0
  19. package/dist/cli/commands/event.js +32 -0
  20. package/dist/cli/commands/event.js.map +1 -0
  21. package/dist/cli/commands/init.d.ts +2 -0
  22. package/dist/cli/commands/init.js +52 -0
  23. package/dist/cli/commands/init.js.map +1 -0
  24. package/dist/cli/commands/installAgent.d.ts +2 -0
  25. package/dist/cli/commands/installAgent.js +130 -0
  26. package/dist/cli/commands/installAgent.js.map +1 -0
  27. package/dist/cli/commands/link.d.ts +2 -0
  28. package/dist/cli/commands/link.js +36 -0
  29. package/dist/cli/commands/link.js.map +1 -0
  30. package/dist/cli/commands/note.d.ts +2 -0
  31. package/dist/cli/commands/note.js +34 -0
  32. package/dist/cli/commands/note.js.map +1 -0
  33. package/dist/cli/commands/pages.d.ts +2 -0
  34. package/dist/cli/commands/pages.js +46 -0
  35. package/dist/cli/commands/pages.js.map +1 -0
  36. package/dist/cli/commands/record.d.ts +2 -0
  37. package/dist/cli/commands/record.js +101 -0
  38. package/dist/cli/commands/record.js.map +1 -0
  39. package/dist/cli/commands/render.d.ts +2 -0
  40. package/dist/cli/commands/render.js +33 -0
  41. package/dist/cli/commands/render.js.map +1 -0
  42. package/dist/cli/commands/search.d.ts +2 -0
  43. package/dist/cli/commands/search.js +125 -0
  44. package/dist/cli/commands/search.js.map +1 -0
  45. package/dist/cli/commands/setup.d.ts +2 -0
  46. package/dist/cli/commands/setup.js +53 -0
  47. package/dist/cli/commands/setup.js.map +1 -0
  48. package/dist/cli/commands/site.d.ts +2 -0
  49. package/dist/cli/commands/site.js +47 -0
  50. package/dist/cli/commands/site.js.map +1 -0
  51. package/dist/cli/commands/spin.d.ts +2 -0
  52. package/dist/cli/commands/spin.js +43 -0
  53. package/dist/cli/commands/spin.js.map +1 -0
  54. package/dist/cli/commands/status.d.ts +2 -0
  55. package/dist/cli/commands/status.js +63 -0
  56. package/dist/cli/commands/status.js.map +1 -0
  57. package/dist/cli/commands/symbol.d.ts +2 -0
  58. package/dist/cli/commands/symbol.js +37 -0
  59. package/dist/cli/commands/symbol.js.map +1 -0
  60. package/dist/cli/commands/theme.d.ts +2 -0
  61. package/dist/cli/commands/theme.js +52 -0
  62. package/dist/cli/commands/theme.js.map +1 -0
  63. package/dist/cli/commands/validate.d.ts +2 -0
  64. package/dist/cli/commands/validate.js +44 -0
  65. package/dist/cli/commands/validate.js.map +1 -0
  66. package/dist/cli/helpers.d.ts +30 -0
  67. package/dist/cli/helpers.js +131 -0
  68. package/dist/cli/helpers.js.map +1 -0
  69. package/dist/core/articles.d.ts +5 -0
  70. package/dist/core/articles.js +25 -0
  71. package/dist/core/articles.js.map +1 -0
  72. package/dist/core/automation.d.ts +96 -0
  73. package/dist/core/automation.js +384 -0
  74. package/dist/core/automation.js.map +1 -0
  75. package/dist/core/beads.d.ts +43 -0
  76. package/dist/core/beads.js +358 -0
  77. package/dist/core/beads.js.map +1 -0
  78. package/dist/core/compiler.d.ts +45 -0
  79. package/dist/core/compiler.js +399 -0
  80. package/dist/core/compiler.js.map +1 -0
  81. package/dist/core/config.d.ts +59 -0
  82. package/dist/core/config.js +187 -0
  83. package/dist/core/config.js.map +1 -0
  84. package/dist/core/git.d.ts +21 -0
  85. package/dist/core/git.js +109 -0
  86. package/dist/core/git.js.map +1 -0
  87. package/dist/core/ids.d.ts +2 -0
  88. package/dist/core/ids.js +8 -0
  89. package/dist/core/ids.js.map +1 -0
  90. package/dist/core/pages.d.ts +34 -0
  91. package/dist/core/pages.js +233 -0
  92. package/dist/core/pages.js.map +1 -0
  93. package/dist/core/paths.d.ts +15 -0
  94. package/dist/core/paths.js +67 -0
  95. package/dist/core/paths.js.map +1 -0
  96. package/dist/core/profiles.d.ts +30 -0
  97. package/dist/core/profiles.js +243 -0
  98. package/dist/core/profiles.js.map +1 -0
  99. package/dist/core/renderer.d.ts +8 -0
  100. package/dist/core/renderer.js +106 -0
  101. package/dist/core/renderer.js.map +1 -0
  102. package/dist/core/schemas.d.ts +1039 -0
  103. package/dist/core/schemas.js +108 -0
  104. package/dist/core/schemas.js.map +1 -0
  105. package/dist/core/site.d.ts +20 -0
  106. package/dist/core/site.js +2684 -0
  107. package/dist/core/site.js.map +1 -0
  108. package/dist/core/spin.d.ts +42 -0
  109. package/dist/core/spin.js +265 -0
  110. package/dist/core/spin.js.map +1 -0
  111. package/dist/core/store.d.ts +29 -0
  112. package/dist/core/store.js +146 -0
  113. package/dist/core/store.js.map +1 -0
  114. package/dist/core/theme.d.ts +35 -0
  115. package/dist/core/theme.js +1086 -0
  116. package/dist/core/theme.js.map +1 -0
  117. package/dist/core/validator.d.ts +8 -0
  118. package/dist/core/validator.js +154 -0
  119. package/dist/core/validator.js.map +1 -0
  120. package/dist/index.d.ts +3 -0
  121. package/dist/index.js +61 -0
  122. package/dist/index.js.map +1 -0
  123. package/dist/templates/articlesPage.d.ts +3 -0
  124. package/dist/templates/articlesPage.js +46 -0
  125. package/dist/templates/articlesPage.js.map +1 -0
  126. package/dist/templates/conceptsPage.d.ts +2 -0
  127. package/dist/templates/conceptsPage.js +24 -0
  128. package/dist/templates/conceptsPage.js.map +1 -0
  129. package/dist/templates/decisionsPage.d.ts +2 -0
  130. package/dist/templates/decisionsPage.js +27 -0
  131. package/dist/templates/decisionsPage.js.map +1 -0
  132. package/dist/templates/devlogPage.d.ts +2 -0
  133. package/dist/templates/devlogPage.js +22 -0
  134. package/dist/templates/devlogPage.js.map +1 -0
  135. package/dist/templates/indexPage.d.ts +6 -0
  136. package/dist/templates/indexPage.js +33 -0
  137. package/dist/templates/indexPage.js.map +1 -0
  138. package/dist/templates/linksPage.d.ts +2 -0
  139. package/dist/templates/linksPage.js +26 -0
  140. package/dist/templates/linksPage.js.map +1 -0
  141. package/dist/templates/notesPage.d.ts +2 -0
  142. package/dist/templates/notesPage.js +26 -0
  143. package/dist/templates/notesPage.js.map +1 -0
  144. package/dist/templates/symbolsPage.d.ts +2 -0
  145. package/dist/templates/symbolsPage.js +25 -0
  146. package/dist/templates/symbolsPage.js.map +1 -0
  147. package/docs/concepts.md +249 -0
  148. package/docs/reference.md +356 -0
  149. package/docs/setup.md +331 -0
  150. package/docs/workflows.md +154 -0
  151. package/package.json +61 -0
  152. package/skills/wk/SKILL.md +251 -0
  153. package/skills/wk/agents/openai.yaml +4 -0
@@ -0,0 +1,2 @@
1
+ import type { SymbolRecord } from "../core/schemas";
2
+ export declare function symbolsPage(records: SymbolRecord[]): string;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.symbolsPage = symbolsPage;
4
+ function symbolsPage(records) {
5
+ const sorted = [...records].sort((a, b) => a.name.localeCompare(b.name) || a.file.localeCompare(b.file) || a.id.localeCompare(b.id));
6
+ const body = sorted.length
7
+ ? sorted.map(renderSymbol).join("\n\n")
8
+ : "_No symbols captured yet._";
9
+ return `# Symbols
10
+
11
+ ${body}
12
+ `;
13
+ }
14
+ function renderSymbol(record) {
15
+ return `## ${record.name}
16
+
17
+ Kind: ${record.kind}
18
+
19
+ File: \`${record.file}\`
20
+
21
+ ${record.summary || "_No summary recorded._"}
22
+
23
+ Record: \`${record.id}\` | Authority: ${record.authority} | Confidence: ${record.confidence}`;
24
+ }
25
+ //# sourceMappingURL=symbolsPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"symbolsPage.js","sourceRoot":"","sources":["../../src/templates/symbolsPage.ts"],"names":[],"mappings":";;AAEA,kCAYC;AAZD,SAAgB,WAAW,CAAC,OAAuB;IACjD,MAAM,MAAM,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACxC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CACzF,CAAC;IACF,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM;QACxB,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;QACvC,CAAC,CAAC,4BAA4B,CAAC;IAEjC,OAAO;;EAEP,IAAI;CACL,CAAC;AACF,CAAC;AAED,SAAS,YAAY,CAAC,MAAoB;IACxC,OAAO,MAAM,MAAM,CAAC,IAAI;;QAElB,MAAM,CAAC,IAAI;;UAET,MAAM,CAAC,IAAI;;EAEnB,MAAM,CAAC,OAAO,IAAI,wBAAwB;;YAEhC,MAAM,CAAC,EAAE,mBAAmB,MAAM,CAAC,SAAS,kBAAkB,MAAM,CAAC,UAAU,EAAE,CAAC;AAC9F,CAAC"}
@@ -0,0 +1,249 @@
1
+ # Concepts
2
+
3
+ Wikiwiki helps a repo keep its own project knowledge close to the code. It
4
+ works as a deterministic CLI for humans and scripts, then gives agentic IDEs a
5
+ structured way to add judgment when that helps.
6
+
7
+ The goal is living docs that are local, reviewable, and reproducible. The
8
+ source of truth is not a hosted service, vector database, or hidden memory
9
+ layer. It is plain records committed beside the project.
10
+
11
+ ## Why Wikiwiki
12
+
13
+ Software teams lose context in the spaces between code:
14
+
15
+ - why a system exists
16
+ - what a module owns
17
+ - which decisions shaped the current design
18
+ - what changed during a messy implementation session
19
+ - which generated docs should never be edited by hand
20
+
21
+ Wikiwiki turns that context into repo-local knowledge. Scripts can validate and
22
+ render it with normal terminal commands. Agents can enrich it when they are
23
+ already part of the workflow. Humans browse a wiki that leads with the project,
24
+ not the generator.
25
+
26
+ ## The Loop
27
+
28
+ The daily loop is intentionally small:
29
+
30
+ ```sh
31
+ wk setup --profile mixed --audience all
32
+ wk status --json
33
+ wk spin --profile mixed --json
34
+ wk article add --title "Getting started" --summary "First successful user path." --body "TODO"
35
+ wk note add --title "Generated file workflow" "Renderer owns generated wiki files." --tags renderer,docs
36
+ wk validate
37
+ wk render
38
+ wk site --audience all
39
+ wk closeout --profile mixed --audience all
40
+ ```
41
+
42
+ That loop can run from a terminal, package script, Git hook, CI job, or
43
+ agentic IDE. It lets a project:
44
+
45
+ 1. Inspect the current knowledge store.
46
+ 2. Read working tree changes.
47
+ 3. Add or update article records for public wiki pages.
48
+ 4. Add concepts, decisions, notes, events, symbols, and links as evidence and maintainer context.
49
+ 5. Validate the records.
50
+ 6. Render Markdown into `wiki/`.
51
+ 7. Render a browseable static site into `wiki-site/`.
52
+ 8. Create a closeout draft packet when a meaningful objective is done.
53
+
54
+ The structured records are the source of truth. Article records are the public
55
+ wiki pages. Concepts, decisions, notes, events, symbols, and links are the
56
+ ledger that explains where those articles came from and what maintainers should
57
+ remember. Markdown stays simple and deterministic for agents. The static site
58
+ is the first-class human wiki.
59
+
60
+ ## Automation Model
61
+
62
+ Wikiwiki has two layers.
63
+
64
+ **Deterministic baseline:** install the CLI, keep `.wikiwiki/records/` in the
65
+ repo, and run scripts that validate, render Markdown, and build the static
66
+ site. This path works without AI tools and should stay useful for any project.
67
+
68
+ **Agent-enhanced layer:** install optional agent instructions so Codex, Cursor,
69
+ Claude Code, or another coding agent knows when to run `wk spin`, when to add
70
+ records, how to set honest `authority` and `confidence`, and how to refresh
71
+ the generated wiki before closeout.
72
+
73
+ Use scripts for repeatable work. Use agents for judgment: deciding what
74
+ changed, capturing why it mattered, curating homepage-worthy knowledge, writing
75
+ UX/DX draft prose, and adjusting the project theme. That keeps unnecessary LLM
76
+ calls out of the loop while preserving the upside of agentic development.
77
+
78
+ `wk closeout` is the portable "I finished Objective B" command:
79
+
80
+ ```sh
81
+ wk closeout --profile mixed --audience all --json
82
+ ```
83
+
84
+ It runs status, spin, validation, Markdown rendering, and site generation. It
85
+ also writes a review packet under `.wikiwiki/drafts/closeout/` containing
86
+ record draft JSON files, command hints, a summary, and a manifest. Closeout
87
+ drafts are deterministic prompts, not automatic truth: Wikiwiki never appends
88
+ records from closeout unless a user or agent deliberately applies them.
89
+
90
+ ## What It Stores
91
+
92
+ Wikiwiki stores records as append-friendly JSONL files under
93
+ `.wikiwiki/records/`.
94
+
95
+ | Record | Use it for |
96
+ | --- | --- |
97
+ | `article` | Public wiki pages with title, slug, summary, body, categories, aliases, sources, and files |
98
+ | `concept` | Domain terms, systems, patterns, and durable explanations |
99
+ | `decision` | Architecture, product, implementation, or workflow decisions |
100
+ | `event` | Development milestones and meaningful project changes |
101
+ | `note` | Lightweight titled or dated facts, reminders, and working context |
102
+ | `symbol` | Important code symbols and their purpose |
103
+ | `link` | Relationships between records, files, and generated pages |
104
+
105
+ Each record carries `source`, `authority`, and `confidence` so agents can be
106
+ honest about what they know.
107
+
108
+ ## What It Renders
109
+
110
+ Wikiwiki renders generated Markdown pages into `wiki/` for agents and
111
+ plain-text review:
112
+
113
+ ```text
114
+ wiki/
115
+ index.md
116
+ articles.md
117
+ articles/
118
+ getting-started.md
119
+ concepts.md
120
+ decisions.md
121
+ devlog.md
122
+ notes.md
123
+ symbols.md
124
+ links.md
125
+ ```
126
+
127
+ Generated wiki files are plainly marked:
128
+
129
+ ```html
130
+ <!-- Generated by Wikiwiki. Edit structured records instead. -->
131
+ ```
132
+
133
+ That boundary matters. Agents should update article records for public wiki
134
+ changes, use supporting records for evidence and agent context, then run
135
+ `wk render`.
136
+
137
+ Wikiwiki also renders a static human-facing site into `wiki-site/`:
138
+
139
+ ```text
140
+ wiki-site/
141
+ index.html
142
+ articles.html
143
+ articles/
144
+ getting-started.html
145
+ guides.html
146
+ concepts.html
147
+ decisions.html
148
+ devlog.html
149
+ notes.html
150
+ symbols.html
151
+ links.html
152
+ records/
153
+ concept/
154
+ concept_123.html
155
+ work.html # optional, developer-only when Beads site output is enabled
156
+ search.html
157
+ assets/
158
+ wikiwiki.css
159
+ project-theme.css
160
+ search-index.js
161
+ wikiwiki.js
162
+ ```
163
+
164
+ The site uses normal `.html` links, article-led home/guides/search pages,
165
+ secondary agent record indexes, responsive navigation, local browser search,
166
+ subtle agent metadata, and a small footer credit. Article records publish as
167
+ public article pages; they do not generate `records/article/*` detail pages.
168
+ The site does not rely on Jekyll routes or raw front matter, so you can open
169
+ `wiki-site/index.html` directly or serve the folder as static files.
170
+
171
+ There are four generated or structured project surfaces:
172
+
173
+ | Surface | Audience | Role |
174
+ | --- | --- | --- |
175
+ | `.wikiwiki/records/*.jsonl` | Agents and maintainers | Source of truth: public articles plus evidence records |
176
+ | `wiki/*.md` | Agents and code review | Deterministic Markdown |
177
+ | `wiki-site/*.html` | Humans | Browseable project wiki |
178
+ | `wiki/human/` | Humans and editors | Compiled UX/DX narrative drafts |
179
+
180
+ ## Working With Beads
181
+
182
+ Wikiwiki and Beads can live in the same repo without either tool absorbing the
183
+ other.
184
+
185
+ Beads owns the work graph: tasks, blockers, dependencies, ownership, ready
186
+ work, in-progress work, closed work, and agent work memory. Wikiwiki owns the
187
+ knowledge graph: public articles, durable concepts, decisions, notes, events,
188
+ symbols, links, generated Markdown, and the human wiki.
189
+
190
+ When `.beads/` exists, Wikiwiki automatically detects it. Detailed reads
191
+ through `bd --readonly --json` are opt-in because some Beads versions can touch
192
+ internal storage while serving read commands. With
193
+ `integrations.beads.enabled: true`, clean Beads context appears in JSON reports
194
+ and closeout drafts. Site publishing uses the same explicit opt-in: `work.html`
195
+ is only generated for developer/all audiences when `.wikiwiki/config.json`
196
+ sets `integrations.beads.enabled` to `true`. User-focused sites hide Beads
197
+ from pages, manifests, and search data so task state does not leak into
198
+ standard user documentation.
199
+
200
+ If Beads is absent, nothing changes. If `.beads/` exists but `bd` is not
201
+ available, Wikiwiki keeps running and shows an unavailable state instead of
202
+ failing the wiki build.
203
+
204
+ ## Audience Tags
205
+
206
+ Use audience tags on records so Wikiwiki can render the same knowledge base for
207
+ different readers:
208
+
209
+ - `audience:user`
210
+ - `audience:developer`
211
+ - `audience:all`
212
+
213
+ Use these conventional topic tags for user-facing material:
214
+
215
+ - `getting-started`
216
+ - `instructions`
217
+ - `faq`
218
+ - `troubleshooting`
219
+
220
+ Example:
221
+
222
+ ```sh
223
+ wk concept add \
224
+ --name "Getting started" \
225
+ --summary "How a new user gets from install to first useful session." \
226
+ --tags audience:user,getting-started,instructions
227
+ ```
228
+
229
+ For developer records, prefer tags such as `audience:developer`,
230
+ `architecture`, `data-model`, `generated-files`, `maintenance`, and `symbol`.
231
+
232
+ ## Human Wiki Compilation
233
+
234
+ Wikiwiki can compile role-oriented human wiki drafts from the same source
235
+ records:
236
+
237
+ ```sh
238
+ wk compile draft --role all --json
239
+ wk compile apply compile_123 --json
240
+ ```
241
+
242
+ `compile draft` creates an agent-mediated work packet under
243
+ `.wikiwiki/drafts/compile/`. Codex, Cursor, Claude Code, or another IDE agent
244
+ can use that packet to write polished UX and DX wiki prose. `compile apply`
245
+ then validates provenance and publishes the human-readable pages into
246
+ `wiki/human/`.
247
+
248
+ The UX wiki explains the product experience for users and stakeholders. The DX
249
+ wiki explains the developer experience for maintainers and coding agents.
@@ -0,0 +1,356 @@
1
+ # Reference
2
+
3
+ This page collects command, profile, theme, publishing, status, and roadmap
4
+ details that are useful after the first quick start.
5
+
6
+ ## Commands
7
+
8
+ | Command | Purpose |
9
+ | --- | --- |
10
+ | `wk init [--profile mixed\|user\|developer]` | Create the knowledge store and choose a first-pass wiki profile |
11
+ | `wk setup [--profile mixed\|user\|developer] [--audience all\|user\|developer]` | Create repo defaults and safe package scripts for portable wiki automation |
12
+ | `wk closeout [--profile mixed\|user\|developer] [--audience all\|user\|developer] --json` | Create a deterministic closeout draft packet, then validate and render docs |
13
+ | `wk status --json` | Report store status, record counts, generated pages, and Git changes |
14
+ | `wk install-agent codex [--yes] [--force]` | Install the bundled wk skill for Codex-compatible agents |
15
+ | `wk pages init [--audience all\|user\|developer] [--branch <branch>] [--source-base-url <url>]` | Scaffold GitHub Pages publishing for `wiki-site/` |
16
+ | `wk spin [--profile mixed\|user\|developer] --json` | Inspect repo changes and emit a deterministic first-pass wiki recipe |
17
+ | `wk search <query> --json` | Search active records and rendered Markdown |
18
+ | `wk site [--audience all\|user\|developer] [--source-base-url <url>]` | Render a browseable static HTML wiki into `wiki-site/` |
19
+ | `wk theme preview\|init [--mood calm\|vivid\|editorial\|utility\|playful\|dark]` | Preview or write light/dark `.wikiwiki/site-theme.json` palettes from project identity |
20
+ | `wk compile draft --role all --json` | Create UX/DX human wiki drafts for an IDE agent |
21
+ | `wk compile apply <draft-id> --json` | Validate and publish a human wiki draft |
22
+ | `wk article add` | Add a public wiki article |
23
+ | `wk concept add` | Add a durable project concept |
24
+ | `wk decision add` | Add an architecture, product, or workflow decision |
25
+ | `wk event add` | Add a development event |
26
+ | `wk note add` | Add a lightweight note |
27
+ | `wk symbol add` | Add an important code symbol |
28
+ | `wk link add` | Link records, files, or wiki pages |
29
+ | `wk record list/get/update/delete` | Read and revise active records append-only |
30
+ | `wk validate` | Validate records and references |
31
+ | `wk render` | Render Markdown pages into `wiki/` |
32
+
33
+ ## Article Records
34
+
35
+ Article records are the public wiki surface. Concepts, decisions, notes,
36
+ events, symbols, and links remain the ledger behind them: evidence, provenance,
37
+ maintainer context, and source anchors.
38
+
39
+ ```sh
40
+ wk article add \
41
+ --title "Skyrim:Alchemy" \
42
+ --summary "How alchemy works for players and maintainers." \
43
+ --body "Alchemy combines ingredients into potions and poisons." \
44
+ --categories gameplay,crafting \
45
+ --aliases alchemy,potions \
46
+ --source-records concept_123,decision_456 \
47
+ --files src/alchemy.ts \
48
+ --tags audience:all
49
+ ```
50
+
51
+ If `--slug` is omitted, Wikiwiki generates one from the title. Slugs may use
52
+ namespace-style names such as `Skyrim:Alchemy`; generated files still use safe
53
+ filenames such as `Skyrim-Alchemy.html`. Validation rejects active duplicate
54
+ slugs, duplicate generated filenames, and `source_record_ids` that do not point
55
+ to active records.
56
+
57
+ Articles render to `wiki/articles/` and `wiki-site/articles/`. Article records
58
+ do not generate `records/article/*` detail pages.
59
+
60
+ ## Agent Requests
61
+
62
+ When a user asks an agent to "Update wk", the agent should follow the
63
+ [agentic update pipeline](setup.md#agentic-update-pipeline). The short version:
64
+ use npm or the repo's JavaScript package manager to update the CLI when
65
+ available; if npm is not available, refresh only the installed `wk` agent skill
66
+ from GitHub raw files and report that the CLI itself still needs a package
67
+ manager or release artifact.
68
+
69
+ ## Wiki Profiles
70
+
71
+ First-pass wikis should be consistent across machines and agents. `wk spin`
72
+ therefore emits a deterministic seeding recipe with target counts, page
73
+ emphasis, audience tags, and copy-ready draft commands.
74
+
75
+ ```sh
76
+ wk init --profile mixed
77
+ wk spin --profile mixed --json
78
+ ```
79
+
80
+ Available profiles:
81
+
82
+ | Profile | Use it when | Default emphasis |
83
+ | --- | --- | --- |
84
+ | `mixed` | The wiki should serve users and maintainers | product promise, getting started, FAQ, troubleshooting, architecture, data model |
85
+ | `user` | The first wiki should read like product/user help | getting started, modes/features, privacy, FAQ, troubleshooting |
86
+ | `developer` | The first wiki is mainly for maintainers and agents | architecture, data model, workflow, decisions, symbols |
87
+
88
+ `mixed` is the default. You can store the default in `.wikiwiki/config.json`:
89
+
90
+ ```json
91
+ {
92
+ "wiki_profile": "mixed"
93
+ }
94
+ ```
95
+
96
+ The profile is guidance, not a generic content generator. It tells humans and
97
+ agents what shape to create so separate runs against the same repo converge on
98
+ similar record counts and page emphasis.
99
+
100
+ ## Site Options
101
+
102
+ By default, source file links point back to files beside `wiki-site/` in a
103
+ local checkout. For published sites, pass a source base URL so links point to
104
+ GitHub:
105
+
106
+ ```sh
107
+ wk site --audience all --source-base-url https://github.com/OWNER/REPO/blob/main/
108
+ ```
109
+
110
+ You can also save that default in `.wikiwiki/config.json`:
111
+
112
+ ```json
113
+ {
114
+ "source_base_url": "https://github.com/OWNER/REPO/blob/main/"
115
+ }
116
+ ```
117
+
118
+ CLI options win over config. Directory links use GitHub `/tree/` URLs when the
119
+ base URL uses `/blob/`.
120
+
121
+ Render a reader-specific site when needed:
122
+
123
+ ```sh
124
+ wk site --audience user
125
+ wk site --audience developer
126
+ wk site --audience all
127
+ ```
128
+
129
+ Each render replaces the same `wiki-site/` folder. Run the audience variant you
130
+ want to inspect or publish last, or copy `wiki-site/` elsewhere before rendering
131
+ another audience.
132
+
133
+ `--audience user` keeps shared records and user-facing records while hiding
134
+ developer-only symbols/links and records tagged `audience:developer`.
135
+ `--audience developer` keeps shared and developer records while hiding
136
+ user-only records. `all` is the default.
137
+
138
+ You can also save a default:
139
+
140
+ ```json
141
+ {
142
+ "site_audience": "user"
143
+ }
144
+ ```
145
+
146
+ ## Optional Beads Integration
147
+
148
+ If a repo contains `.beads/`, Wikiwiki automatically detects it. Detailed
149
+ Beads reads are opt-in because some `bd --readonly` commands can still touch
150
+ internal storage in `.beads/`. The integration is best-effort and never
151
+ creates, edits, claims, closes, or imports Beads issues.
152
+
153
+ The detection appears in JSON reports for `wk setup`, `wk status`, `wk spin`,
154
+ and `wk closeout`. When `.wikiwiki/config.json` explicitly sets
155
+ `integrations.beads.enabled: true`, those reports include detailed Beads
156
+ context if `bd` can read without changing `.beads/`. Closeout manifests include
157
+ the same Beads context so an agent can relate durable wiki updates to active
158
+ work without treating tasks as records.
159
+
160
+ Site publishing is explicit opt-in for task details. `wk site --audience all`
161
+ and `wk site --audience developer` generate `work.html` with ready work,
162
+ in-progress work, and recently closed work only when `.wikiwiki/config.json`
163
+ contains `integrations.beads.enabled: true`. Without that explicit opt-in, site
164
+ manifests keep at most safe Beads counts and omit issue IDs, titles, labels, and
165
+ assignees. `wk site --audience user` hides Beads entirely, including from
166
+ `site-manifest.json` and search data.
167
+
168
+ Enable Beads site output only for internal developer publishing:
169
+
170
+ ```json
171
+ {
172
+ "integrations": {
173
+ "beads": {
174
+ "enabled": true
175
+ }
176
+ }
177
+ }
178
+ ```
179
+
180
+ Disable the integration in `.wikiwiki/config.json` when needed:
181
+
182
+ ```json
183
+ {
184
+ "integrations": {
185
+ "beads": {
186
+ "enabled": false
187
+ }
188
+ }
189
+ }
190
+ ```
191
+
192
+ Fallback behavior is intentionally calm:
193
+
194
+ - no `.beads/`: no Beads output
195
+ - `.beads/` with auto config: detected, with detailed reads skipped
196
+ - `.beads/` plus explicit `enabled: true`: combined task/wiki context when
197
+ `bd` reads cleanly
198
+ - `.beads/` without `bd`: Wikiwiki reports that Beads context is unavailable
199
+ - `.beads/` that changes during a `bd` read: Wikiwiki reports Beads as
200
+ unavailable for that run instead of using potentially mutating context
201
+
202
+ ## Project Theme
203
+
204
+ Agents can make the generated site feel like the project without changing the
205
+ layout. Generated themes include light and dark palettes, and the static site
206
+ ships with Auto, Light, and Dark controls. Preview or create a theme from repo
207
+ identity:
208
+
209
+ ```sh
210
+ wk theme preview --json
211
+ wk theme init --mood editorial
212
+ ```
213
+
214
+ `wk theme preview` and `wk theme init` inspect likely visual sources before
215
+ falling back to README copy: app/global CSS, design tokens, theme files, landing
216
+ page styles, and app shell/layout styles. In styled repos, the generated theme
217
+ can infer a likely default color mode, accent spectrum, radius, font family,
218
+ gradients, glass/gloss, shadows, badges, and tag colors. In plain repos, the
219
+ named mood palettes remain the fallback.
220
+
221
+ `wk theme init` writes `.wikiwiki/site-theme.json` and refuses to overwrite an
222
+ existing theme unless `--force` is explicit. You can also edit
223
+ `.wikiwiki/site-theme.json` by hand, then run `wk site`:
224
+
225
+ ```json
226
+ {
227
+ "project_name": "PRISM",
228
+ "project_description": "A project wiki for PRISM.",
229
+ "default_color_scheme": "auto",
230
+ "accent": "#7c3aed",
231
+ "accent_strong": "#4c1d95",
232
+ "bg": "#faf9ff",
233
+ "panel": "#fffaff",
234
+ "panel_soft": "#f3f0ff",
235
+ "text": "#1f1b2e",
236
+ "muted": "#655f75",
237
+ "border": "#ded7f2",
238
+ "code_bg": "#f1edf8",
239
+ "radius": "8px",
240
+ "font_family": "Inter, ui-sans-serif, system-ui, sans-serif",
241
+ "modes": {
242
+ "light": {
243
+ "accent": "#7c3aed",
244
+ "accent_strong": "#4c1d95",
245
+ "bg": "#faf9ff",
246
+ "panel": "#fffaff"
247
+ },
248
+ "dark": {
249
+ "accent": "#c4b5fd",
250
+ "accent_strong": "#ede9fe",
251
+ "bg": "#171225",
252
+ "panel": "#211936",
253
+ "text": "#f7f2ff"
254
+ }
255
+ }
256
+ }
257
+ ```
258
+
259
+ Top-level color values are treated as the light/default palette for backwards
260
+ compatibility. `modes.light` and `modes.dark` can override them with richer
261
+ visual tokens such as `hero_gradient`, `card_gradient`, `sidebar_bg`, `shadow`,
262
+ `shadow_strong`, `brand_gradient`, `badge_bg`, `tag_bg`, `focus_ring`, and
263
+ `gloss`.
264
+
265
+ Wikiwiki writes those values into `wiki-site/assets/project-theme.css`, including
266
+ `prefers-color-scheme` rules and explicit `data-theme` overrides. Keep that file
267
+ generated; edit `.wikiwiki/site-theme.json` instead.
268
+
269
+ Wikiwiki applies basic contrast guardrails for common hex-color themes. For
270
+ example, if a dark `bg` or `panel` would leave text unreadable, generated theme
271
+ CSS adjusts dependent text/surface variables and comments why. For safest
272
+ results, set `bg`, `panel`, `panel_soft`, `text`, `muted`, `border`, and
273
+ `code_bg` together inside each mode.
274
+
275
+ ## GitHub Pages
276
+
277
+ `wk site` writes static files and a `.nojekyll` marker into `wiki-site/`, so
278
+ GitHub Pages can publish the folder without Jekyll-specific routing. Use
279
+ `wk pages init` to create the publishing workflow:
280
+
281
+ ```sh
282
+ wk pages init --audience all
283
+ ```
284
+
285
+ The command writes `.github/workflows/wikiwiki-pages.yml`, saves the resolved
286
+ `site_audience` and `source_base_url` in `.wikiwiki/config.json`, and reports
287
+ the repository Settings > Pages URL when it can infer one from `origin`.
288
+
289
+ Defaults are designed for low ceremony:
290
+
291
+ - audience comes from `--audience`, config, then `all`
292
+ - branch comes from `--branch`, `origin/HEAD`, then `main`
293
+ - source links come from `--source-base-url`, config, then a GitHub `origin`
294
+
295
+ If the repo is not hosted on GitHub, pass `--source-base-url` explicitly. The
296
+ workflow path defaults to `.github/workflows/wikiwiki-pages.yml`; existing
297
+ different workflows are preserved unless `--force` is explicit. Wikiwiki does
298
+ not call `gh`, change repository settings, create deployment branches, or
299
+ configure custom domains. On GitHub, set Pages Build and deployment Source to
300
+ GitHub Actions if it is not already selected.
301
+
302
+ The generated workflow uses Node 22, installs project dependencies when present,
303
+ falls back to the documented GitHub source install for `wk`, runs
304
+ `wk validate`, `wk render`, and `wk site`, then publishes `wiki-site/` through
305
+ the official Pages artifact and deploy actions.
306
+
307
+ ## Current Status
308
+
309
+ Wikiwiki is an article-first CLI foundation. It currently includes:
310
+
311
+ - TypeScript CLI
312
+ - JSONL record storage
313
+ - first-class article records
314
+ - append-only record revisions and deletion tombstones
315
+ - Zod validation
316
+ - Git-aware `spin` with deterministic `user`, `developer`, and `mixed` profile recipes
317
+ - audience tagging with `audience:user`, `audience:developer`, and `audience:all`
318
+ - Markdown rendering for article pages plus concepts, decisions, events, notes, symbols, and links
319
+ - article-led static HTML site generation into `wiki-site/`
320
+ - audience-focused site rendering with `wk site --audience user|developer|all`
321
+ - project-first generated site UX with curated `guides.html`
322
+ - project theme overrides through `.wikiwiki/site-theme.json`
323
+ - product-identity light/dark theme generation through `wk theme`
324
+ - basic contrast guardrails for common theme overrides
325
+ - agent-mediated UX/DX human wiki compilation
326
+ - local search across articles, active records, and rendered docs
327
+ - agent-readable JSON output
328
+ - scriptable non-AI setup through `wk setup` and repo scripts
329
+ - GitHub Pages workflow scaffolding through `wk pages init`
330
+ - deterministic closeout draft packets through `wk closeout`
331
+ - optional read-only Beads integration with developer-only `work.html`
332
+ - published npm package metadata for `@thjodann/wk`
333
+ - CI and tests
334
+
335
+ Some planned pieces are not built yet:
336
+
337
+ - richer symbol extraction
338
+ - draft review flows
339
+ - watch mode
340
+
341
+ Generated `wiki/` and `wiki-site/` are intentionally not shipped in the npm
342
+ package. Installed users generate their own copies from their own records.
343
+
344
+ ## Roadmap
345
+
346
+ The turntable metaphor is light, but useful:
347
+
348
+ - `spin` inspects repo changes and suggests knowledge updates.
349
+ - `scratch` could review recent knowledge, events, and contradictions.
350
+ - `press` could become a friendly alias for rendering docs.
351
+ - `crate` could rebuild indexes and local retrieval data.
352
+ - `ask` could query the repo knowledge base.
353
+ - `watch` could batch near-real-time updates while work is happening.
354
+
355
+ Wikiwiki should stay local-first, text-first, and agent-friendly even as those
356
+ capabilities grow.