@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.
- package/LICENSE +21 -0
- package/README.md +197 -0
- package/dist/cli/commands/article.d.ts +2 -0
- package/dist/cli/commands/article.js +47 -0
- package/dist/cli/commands/article.js.map +1 -0
- package/dist/cli/commands/closeout.d.ts +2 -0
- package/dist/cli/commands/closeout.js +37 -0
- package/dist/cli/commands/closeout.js.map +1 -0
- package/dist/cli/commands/compile.d.ts +2 -0
- package/dist/cli/commands/compile.js +50 -0
- package/dist/cli/commands/compile.js.map +1 -0
- package/dist/cli/commands/concept.d.ts +2 -0
- package/dist/cli/commands/concept.js +36 -0
- package/dist/cli/commands/concept.js.map +1 -0
- package/dist/cli/commands/decision.d.ts +2 -0
- package/dist/cli/commands/decision.js +38 -0
- package/dist/cli/commands/decision.js.map +1 -0
- package/dist/cli/commands/event.d.ts +2 -0
- package/dist/cli/commands/event.js +32 -0
- package/dist/cli/commands/event.js.map +1 -0
- package/dist/cli/commands/init.d.ts +2 -0
- package/dist/cli/commands/init.js +52 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/installAgent.d.ts +2 -0
- package/dist/cli/commands/installAgent.js +130 -0
- package/dist/cli/commands/installAgent.js.map +1 -0
- package/dist/cli/commands/link.d.ts +2 -0
- package/dist/cli/commands/link.js +36 -0
- package/dist/cli/commands/link.js.map +1 -0
- package/dist/cli/commands/note.d.ts +2 -0
- package/dist/cli/commands/note.js +34 -0
- package/dist/cli/commands/note.js.map +1 -0
- package/dist/cli/commands/pages.d.ts +2 -0
- package/dist/cli/commands/pages.js +46 -0
- package/dist/cli/commands/pages.js.map +1 -0
- package/dist/cli/commands/record.d.ts +2 -0
- package/dist/cli/commands/record.js +101 -0
- package/dist/cli/commands/record.js.map +1 -0
- package/dist/cli/commands/render.d.ts +2 -0
- package/dist/cli/commands/render.js +33 -0
- package/dist/cli/commands/render.js.map +1 -0
- package/dist/cli/commands/search.d.ts +2 -0
- package/dist/cli/commands/search.js +125 -0
- package/dist/cli/commands/search.js.map +1 -0
- package/dist/cli/commands/setup.d.ts +2 -0
- package/dist/cli/commands/setup.js +53 -0
- package/dist/cli/commands/setup.js.map +1 -0
- package/dist/cli/commands/site.d.ts +2 -0
- package/dist/cli/commands/site.js +47 -0
- package/dist/cli/commands/site.js.map +1 -0
- package/dist/cli/commands/spin.d.ts +2 -0
- package/dist/cli/commands/spin.js +43 -0
- package/dist/cli/commands/spin.js.map +1 -0
- package/dist/cli/commands/status.d.ts +2 -0
- package/dist/cli/commands/status.js +63 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/symbol.d.ts +2 -0
- package/dist/cli/commands/symbol.js +37 -0
- package/dist/cli/commands/symbol.js.map +1 -0
- package/dist/cli/commands/theme.d.ts +2 -0
- package/dist/cli/commands/theme.js +52 -0
- package/dist/cli/commands/theme.js.map +1 -0
- package/dist/cli/commands/validate.d.ts +2 -0
- package/dist/cli/commands/validate.js +44 -0
- package/dist/cli/commands/validate.js.map +1 -0
- package/dist/cli/helpers.d.ts +30 -0
- package/dist/cli/helpers.js +131 -0
- package/dist/cli/helpers.js.map +1 -0
- package/dist/core/articles.d.ts +5 -0
- package/dist/core/articles.js +25 -0
- package/dist/core/articles.js.map +1 -0
- package/dist/core/automation.d.ts +96 -0
- package/dist/core/automation.js +384 -0
- package/dist/core/automation.js.map +1 -0
- package/dist/core/beads.d.ts +43 -0
- package/dist/core/beads.js +358 -0
- package/dist/core/beads.js.map +1 -0
- package/dist/core/compiler.d.ts +45 -0
- package/dist/core/compiler.js +399 -0
- package/dist/core/compiler.js.map +1 -0
- package/dist/core/config.d.ts +59 -0
- package/dist/core/config.js +187 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/git.d.ts +21 -0
- package/dist/core/git.js +109 -0
- package/dist/core/git.js.map +1 -0
- package/dist/core/ids.d.ts +2 -0
- package/dist/core/ids.js +8 -0
- package/dist/core/ids.js.map +1 -0
- package/dist/core/pages.d.ts +34 -0
- package/dist/core/pages.js +233 -0
- package/dist/core/pages.js.map +1 -0
- package/dist/core/paths.d.ts +15 -0
- package/dist/core/paths.js +67 -0
- package/dist/core/paths.js.map +1 -0
- package/dist/core/profiles.d.ts +30 -0
- package/dist/core/profiles.js +243 -0
- package/dist/core/profiles.js.map +1 -0
- package/dist/core/renderer.d.ts +8 -0
- package/dist/core/renderer.js +106 -0
- package/dist/core/renderer.js.map +1 -0
- package/dist/core/schemas.d.ts +1039 -0
- package/dist/core/schemas.js +108 -0
- package/dist/core/schemas.js.map +1 -0
- package/dist/core/site.d.ts +20 -0
- package/dist/core/site.js +2684 -0
- package/dist/core/site.js.map +1 -0
- package/dist/core/spin.d.ts +42 -0
- package/dist/core/spin.js +265 -0
- package/dist/core/spin.js.map +1 -0
- package/dist/core/store.d.ts +29 -0
- package/dist/core/store.js +146 -0
- package/dist/core/store.js.map +1 -0
- package/dist/core/theme.d.ts +35 -0
- package/dist/core/theme.js +1086 -0
- package/dist/core/theme.js.map +1 -0
- package/dist/core/validator.d.ts +8 -0
- package/dist/core/validator.js +154 -0
- package/dist/core/validator.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +61 -0
- package/dist/index.js.map +1 -0
- package/dist/templates/articlesPage.d.ts +3 -0
- package/dist/templates/articlesPage.js +46 -0
- package/dist/templates/articlesPage.js.map +1 -0
- package/dist/templates/conceptsPage.d.ts +2 -0
- package/dist/templates/conceptsPage.js +24 -0
- package/dist/templates/conceptsPage.js.map +1 -0
- package/dist/templates/decisionsPage.d.ts +2 -0
- package/dist/templates/decisionsPage.js +27 -0
- package/dist/templates/decisionsPage.js.map +1 -0
- package/dist/templates/devlogPage.d.ts +2 -0
- package/dist/templates/devlogPage.js +22 -0
- package/dist/templates/devlogPage.js.map +1 -0
- package/dist/templates/indexPage.d.ts +6 -0
- package/dist/templates/indexPage.js +33 -0
- package/dist/templates/indexPage.js.map +1 -0
- package/dist/templates/linksPage.d.ts +2 -0
- package/dist/templates/linksPage.js +26 -0
- package/dist/templates/linksPage.js.map +1 -0
- package/dist/templates/notesPage.d.ts +2 -0
- package/dist/templates/notesPage.js +26 -0
- package/dist/templates/notesPage.js.map +1 -0
- package/dist/templates/symbolsPage.d.ts +2 -0
- package/dist/templates/symbolsPage.js +25 -0
- package/dist/templates/symbolsPage.js.map +1 -0
- package/docs/concepts.md +249 -0
- package/docs/reference.md +356 -0
- package/docs/setup.md +331 -0
- package/docs/workflows.md +154 -0
- package/package.json +61 -0
- package/skills/wk/SKILL.md +251 -0
- package/skills/wk/agents/openai.yaml +4 -0
package/docs/setup.md
ADDED
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
# Setup
|
|
2
|
+
|
|
3
|
+
Wikiwiki works without AI tools. Agentic IDE setup is optional and uses the
|
|
4
|
+
same deterministic CLI commands as the non-AI path.
|
|
5
|
+
|
|
6
|
+
## Install From npm
|
|
7
|
+
|
|
8
|
+
Install Wikiwiki as `@thjodann/wk` in the repo that should use Wikiwiki:
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
test "$(npm prefix)" = "$PWD" || npm init -y
|
|
12
|
+
npm install --prefix "$PWD" --save-dev @thjodann/wk
|
|
13
|
+
./node_modules/.bin/wk --help
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The `npm prefix` check matters in Swift, Rust, Python, and other non-JavaScript
|
|
17
|
+
repos. If the repo has no local `package.json`, npm may otherwise climb to a
|
|
18
|
+
parent project and install Wikiwiki there. `npm init -y` creates the local
|
|
19
|
+
manifest first, and `--prefix "$PWD"` keeps the install rooted in the repo you
|
|
20
|
+
are setting up.
|
|
21
|
+
|
|
22
|
+
Expect npm to create or update `package.json` and `node_modules/`. In non-JS
|
|
23
|
+
repos, add `node_modules/` to `.gitignore` if it is not already ignored. Use
|
|
24
|
+
the repo's normal lockfile policy after the package is installed.
|
|
25
|
+
|
|
26
|
+
For local development on Wikiwiki itself, install from source:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
npm install
|
|
30
|
+
npm run build
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Run it without linking:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
npm run dev -- status --json
|
|
37
|
+
node dist/index.js status --json
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Link it locally as `wk`:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
npm link
|
|
44
|
+
wk status --json
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The package installs `wk`; `wikiwiki` remains as a compatibility alias.
|
|
48
|
+
|
|
49
|
+
## Non-AI Setup
|
|
50
|
+
|
|
51
|
+
The smallest useful setup is a CLI install plus scripts that keep generated
|
|
52
|
+
docs current:
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
wk setup --profile mixed --audience all
|
|
56
|
+
wk theme init
|
|
57
|
+
wk pages init --audience all
|
|
58
|
+
npm run wiki:check
|
|
59
|
+
npm run wiki:site
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`wk setup` creates `.wikiwiki/config.json` and adds package scripts when a
|
|
63
|
+
`package.json` exists:
|
|
64
|
+
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"scripts": {
|
|
68
|
+
"wiki:status": "wk status --json",
|
|
69
|
+
"wiki:spin": "wk spin --profile mixed --json",
|
|
70
|
+
"wiki:check": "wk validate",
|
|
71
|
+
"wiki:render": "wk validate && wk render",
|
|
72
|
+
"wiki:site": "wk validate && wk render && wk site --audience all",
|
|
73
|
+
"wiki:site:user": "wk validate && wk render && wk site --audience user",
|
|
74
|
+
"wiki:closeout": "wk closeout --profile mixed --audience all"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
`wk setup` will not create a `package.json`. In repos without one, it reports
|
|
80
|
+
copy-ready commands. Run the safe install sequence above first when you want
|
|
81
|
+
package scripts in a non-JS repo. Setup also refuses to overwrite existing
|
|
82
|
+
conflicting scripts unless `--force` is explicit.
|
|
83
|
+
|
|
84
|
+
You can also add only the scripts your team wants to run manually, in CI, or
|
|
85
|
+
before publishing docs:
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"scripts": {
|
|
90
|
+
"wiki:check": "wk validate",
|
|
91
|
+
"wiki:site": "wk validate && wk render && wk site --audience all"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
This gives users a browseable local wiki in `wiki-site/` and deterministic
|
|
97
|
+
Markdown in `wiki/` without asking a model to summarize anything. `wk theme init`
|
|
98
|
+
is optional; it creates `.wikiwiki/site-theme.json` so the generated site starts
|
|
99
|
+
with project-specific colors, typography, surface treatment, and paired
|
|
100
|
+
light/dark palettes. Generated sites default to Auto, so they follow the user's
|
|
101
|
+
system appearance until the reader chooses Light or Dark.
|
|
102
|
+
|
|
103
|
+
`wk pages init` is optional for local use, but it is the fastest path to
|
|
104
|
+
publishing the generated site. It writes a GitHub Actions workflow for
|
|
105
|
+
`wiki-site/`, saves the resolved site audience and source-link base URL, and
|
|
106
|
+
prints the manual GitHub Settings > Pages step when GitHub needs the repository
|
|
107
|
+
source set to GitHub Actions. If the repo is not hosted on GitHub, pass
|
|
108
|
+
`--source-base-url` explicitly.
|
|
109
|
+
|
|
110
|
+
The first public page should usually be an article record:
|
|
111
|
+
|
|
112
|
+
```sh
|
|
113
|
+
wk article add \
|
|
114
|
+
--title "Getting started" \
|
|
115
|
+
--summary "The first successful user path." \
|
|
116
|
+
--body "Install, run, and verify the project." \
|
|
117
|
+
--categories guides,onboarding \
|
|
118
|
+
--tags audience:user,getting-started
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Use concepts, decisions, notes, events, symbols, and links for the supporting
|
|
122
|
+
ledger behind those public pages.
|
|
123
|
+
|
|
124
|
+
## Awesome Initial Install
|
|
125
|
+
|
|
126
|
+
For an agent-assisted first install, aim for both style and substance instead
|
|
127
|
+
of a merely valid wiki:
|
|
128
|
+
|
|
129
|
+
```sh
|
|
130
|
+
wk setup --profile mixed --audience all
|
|
131
|
+
wk theme preview --json
|
|
132
|
+
wk theme init
|
|
133
|
+
wk pages init --audience all
|
|
134
|
+
wk spin --profile mixed --json
|
|
135
|
+
wk validate
|
|
136
|
+
wk render
|
|
137
|
+
wk site --audience all
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Before running `wk theme init`, the agent should inspect the host repo's actual
|
|
141
|
+
visual sources: app/global CSS, design tokens, theme files, landing page styles,
|
|
142
|
+
and app shell/layout styles. `wk theme preview` and `wk theme init` also inspect
|
|
143
|
+
those files automatically when they are present, then fall back to README and
|
|
144
|
+
package metadata for naming and copy. In styled web apps, this lets
|
|
145
|
+
`.wikiwiki/site-theme.json` start with the host product's likely color mode,
|
|
146
|
+
accent spectrum, radius, font family, gradients, glass/gloss, shadows, badges,
|
|
147
|
+
and tag colors.
|
|
148
|
+
|
|
149
|
+
After the theme is in place, seed a small set of high-signal records before
|
|
150
|
+
publishing the first site: product promise, privacy/data boundary, architecture
|
|
151
|
+
overview, distribution/support model, important symbols, and one development
|
|
152
|
+
event. Then verify the generated site like a real local artifact:
|
|
153
|
+
|
|
154
|
+
- open `wiki-site/index.html`
|
|
155
|
+
- check Auto, Light, and Dark controls
|
|
156
|
+
- check local links and source-file links
|
|
157
|
+
- check search
|
|
158
|
+
- check contrast for body text, muted text, accents, badges, and tags
|
|
159
|
+
- keep `wiki-site/` generated; edit `.wikiwiki/site-theme.json` and records
|
|
160
|
+
|
|
161
|
+
## Agentic IDE Setup
|
|
162
|
+
|
|
163
|
+
Agentic IDE setup is for teams that want their coding agent to maintain the
|
|
164
|
+
wiki while development is happening. Install the CLI first, run the repo setup,
|
|
165
|
+
then install the bundled `wk` skill into your agentic IDE.
|
|
166
|
+
|
|
167
|
+
```sh
|
|
168
|
+
wk setup --profile mixed --audience all
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
If the repo also uses Beads, keep Beads as the task graph and Wikiwiki as the
|
|
172
|
+
knowledge graph. Initialize or preserve Beads in its own flow:
|
|
173
|
+
|
|
174
|
+
```sh
|
|
175
|
+
bd init
|
|
176
|
+
bd setup codex
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Then install the Wikiwiki agent instructions:
|
|
180
|
+
|
|
181
|
+
For Codex-compatible skills, preview the destination:
|
|
182
|
+
|
|
183
|
+
```sh
|
|
184
|
+
wk install-agent codex
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Then install after confirming the path:
|
|
188
|
+
|
|
189
|
+
```sh
|
|
190
|
+
wk install-agent codex --yes
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
`wk install-agent codex --yes` creates a missing destination and safely
|
|
194
|
+
overwrites only bundled Wikiwiki skill files. If the destination contains
|
|
195
|
+
unknown files, the command refuses to install. Use `--force` only when you have
|
|
196
|
+
checked the destination and intentionally want to keep those unknown files
|
|
197
|
+
while overwriting the bundled `wk` skill files:
|
|
198
|
+
|
|
199
|
+
```sh
|
|
200
|
+
wk install-agent codex --yes --force
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
To install manually on macOS or Linux:
|
|
204
|
+
|
|
205
|
+
```sh
|
|
206
|
+
WK_SKILL_HOME="${CODEX_HOME:-$HOME/.codex}/skills/wk"
|
|
207
|
+
mkdir -p "$WK_SKILL_HOME/agents"
|
|
208
|
+
curl -fsSL https://raw.githubusercontent.com/Thjodann/Wikiwiki/main/skills/wk/SKILL.md \
|
|
209
|
+
-o "$WK_SKILL_HOME/SKILL.md"
|
|
210
|
+
curl -fsSL https://raw.githubusercontent.com/Thjodann/Wikiwiki/main/skills/wk/agents/openai.yaml \
|
|
211
|
+
-o "$WK_SKILL_HOME/agents/openai.yaml"
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
PowerShell equivalent:
|
|
215
|
+
|
|
216
|
+
```powershell
|
|
217
|
+
$CodexHome = if ($env:CODEX_HOME) { $env:CODEX_HOME } else { Join-Path $HOME ".codex" }
|
|
218
|
+
$WkSkillHome = Join-Path $CodexHome "skills/wk"
|
|
219
|
+
New-Item -ItemType Directory -Force (Join-Path $WkSkillHome "agents") | Out-Null
|
|
220
|
+
Invoke-WebRequest `
|
|
221
|
+
-Uri "https://raw.githubusercontent.com/Thjodann/Wikiwiki/main/skills/wk/SKILL.md" `
|
|
222
|
+
-OutFile (Join-Path $WkSkillHome "SKILL.md")
|
|
223
|
+
Invoke-WebRequest `
|
|
224
|
+
-Uri "https://raw.githubusercontent.com/Thjodann/Wikiwiki/main/skills/wk/agents/openai.yaml" `
|
|
225
|
+
-OutFile (Join-Path $WkSkillHome "agents/openai.yaml")
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
For other agentic IDEs, copy [skills/wk/SKILL.md](../skills/wk/SKILL.md) into
|
|
229
|
+
the IDE's persistent agent instructions or skill system. The important behavior
|
|
230
|
+
is the same everywhere: start with `wk status --json` and `wk spin --json`,
|
|
231
|
+
read relevant articles and source records, update article records when public
|
|
232
|
+
wiki knowledge changes, add evidence records when durable context is worth
|
|
233
|
+
keeping, then run `wk validate`, `wk render`, `wk site`, and `wk closeout`
|
|
234
|
+
after meaningful work. The closeout packet is reviewable; it does not silently
|
|
235
|
+
append records.
|
|
236
|
+
|
|
237
|
+
The npm package includes the skill folder at `skills/wk/` for local
|
|
238
|
+
copy/install flows. The skill is not a separate product surface; it teaches an
|
|
239
|
+
agent to use the same deterministic CLI that non-AI users can run themselves.
|
|
240
|
+
|
|
241
|
+
## Agentic Update Pipeline
|
|
242
|
+
|
|
243
|
+
When a user asks an agent to "Update wk", the agent should try to update both
|
|
244
|
+
the repo-local CLI and the installed agent instructions. Start by inspecting the
|
|
245
|
+
current state:
|
|
246
|
+
|
|
247
|
+
```sh
|
|
248
|
+
command -v wk || true
|
|
249
|
+
wk --version || true
|
|
250
|
+
git status --short
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
If npm is available, update from the published npm package:
|
|
254
|
+
|
|
255
|
+
```sh
|
|
256
|
+
test "$(npm prefix)" = "$PWD" || npm init -y
|
|
257
|
+
npm install --prefix "$PWD" --save-dev @thjodann/wk@latest
|
|
258
|
+
./node_modules/.bin/wk --version
|
|
259
|
+
./node_modules/.bin/wk install-agent codex --yes
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
If the repo uses `pnpm`, `yarn`, or another JavaScript package manager, use the
|
|
263
|
+
closest equivalent and keep the install rooted in the target repo.
|
|
264
|
+
|
|
265
|
+
If npm and equivalent package managers are not available, the agent cannot
|
|
266
|
+
rebuild or replace the CLI from source because the generated `dist/` files are
|
|
267
|
+
not the Git source of truth. In that case, refresh only the agent skill from
|
|
268
|
+
GitHub raw files and report the CLI update as blocked:
|
|
269
|
+
|
|
270
|
+
```sh
|
|
271
|
+
WK_SKILL_HOME="${CODEX_HOME:-$HOME/.codex}/skills/wk"
|
|
272
|
+
tmpdir="$(mktemp -d)"
|
|
273
|
+
mkdir -p "$tmpdir/agents" "$WK_SKILL_HOME/agents"
|
|
274
|
+
curl -fsSL https://raw.githubusercontent.com/Thjodann/Wikiwiki/main/skills/wk/SKILL.md \
|
|
275
|
+
-o "$tmpdir/SKILL.md"
|
|
276
|
+
curl -fsSL https://raw.githubusercontent.com/Thjodann/Wikiwiki/main/skills/wk/agents/openai.yaml \
|
|
277
|
+
-o "$tmpdir/agents/openai.yaml"
|
|
278
|
+
cp "$tmpdir/SKILL.md" "$WK_SKILL_HOME/SKILL.md"
|
|
279
|
+
cp "$tmpdir/agents/openai.yaml" "$WK_SKILL_HOME/agents/openai.yaml"
|
|
280
|
+
rm -rf "$tmpdir"
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
PowerShell users can use the same `Invoke-WebRequest` commands from the manual
|
|
284
|
+
skill install section above. After either path, verify only what was actually
|
|
285
|
+
updated:
|
|
286
|
+
|
|
287
|
+
```sh
|
|
288
|
+
wk --version || true
|
|
289
|
+
wk status --json || true
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
Agents should not delete lockfiles, overwrite unknown agent files, or claim the
|
|
293
|
+
CLI was updated when only the skill instructions changed.
|
|
294
|
+
|
|
295
|
+
## Optional Beads Coordination
|
|
296
|
+
|
|
297
|
+
Wikiwiki's Beads detection is automatic, but detailed `bd` reads are opt-in for
|
|
298
|
+
internal command output. This keeps `wk status`, `wk spin`, and `wk closeout`
|
|
299
|
+
from dirtying `.beads/` in environments where `bd --readonly` still touches
|
|
300
|
+
internal storage.
|
|
301
|
+
|
|
302
|
+
- No `.beads/`: Wikiwiki behaves normally.
|
|
303
|
+
- `.beads/` plus auto config: Wikiwiki reports that Beads was detected and
|
|
304
|
+
skips detailed reads.
|
|
305
|
+
- `.beads/` plus `integrations.beads.enabled: true`: `wk status`, `wk spin`,
|
|
306
|
+
`wk closeout`, and developer-facing JSON outputs include task context when
|
|
307
|
+
`bd` can read without changing `.beads/`.
|
|
308
|
+
- `.beads/` without `bd`: Wikiwiki still works and reports that Beads context
|
|
309
|
+
is unavailable.
|
|
310
|
+
|
|
311
|
+
Detailed Beads task data and `wiki-site/work.html` are explicit opt-in. Add
|
|
312
|
+
this only for internal developer sites or repos where the local `bd` read path
|
|
313
|
+
has been checked:
|
|
314
|
+
|
|
315
|
+
```json
|
|
316
|
+
{
|
|
317
|
+
"integrations": {
|
|
318
|
+
"beads": {
|
|
319
|
+
"enabled": true
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
User-audience sites omit Beads data from generated pages, `site-manifest.json`,
|
|
326
|
+
and search data.
|
|
327
|
+
|
|
328
|
+
Beads owns tasks, blockers, dependencies, ownership, and follow-ups. Wikiwiki
|
|
329
|
+
owns public articles, durable concepts, decisions, notes, events, symbols,
|
|
330
|
+
links, generated Markdown, and the static human wiki. Wikiwiki never creates,
|
|
331
|
+
edits, claims, or closes Beads issues.
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Workflows
|
|
2
|
+
|
|
3
|
+
Wikiwiki is built for small, repeatable maintenance loops. Humans and scripts
|
|
4
|
+
handle deterministic work; agents add judgment when they are already close to
|
|
5
|
+
the code change.
|
|
6
|
+
|
|
7
|
+
## Recommended Dogfood Workflow
|
|
8
|
+
|
|
9
|
+
For a first real repo pass, use the profile recipe instead of free-form
|
|
10
|
+
recording:
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
wk setup --profile mixed --audience all
|
|
14
|
+
wk status --json
|
|
15
|
+
wk spin --profile mixed --json
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Then add public articles first, backed by structured records from the recipe and
|
|
19
|
+
current repo evidence:
|
|
20
|
+
|
|
21
|
+
- articles: overview, getting started, features/workflows, FAQ/troubleshooting,
|
|
22
|
+
and developer guide
|
|
23
|
+
- concepts: product promise, architecture, data model, and generated-file workflow
|
|
24
|
+
- decisions: key product, architecture, publishing, and workflow decisions that
|
|
25
|
+
explain why article guidance is true
|
|
26
|
+
- devlog: only meaningful milestones, not every implementation detail
|
|
27
|
+
- notes: titled caveats, documentation drift, generated-file reminders
|
|
28
|
+
- symbols: developer-only source anchors
|
|
29
|
+
|
|
30
|
+
After adding deliberate records, close the pass:
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
wk closeout --profile mixed --audience all --json
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Review `.wikiwiki/drafts/closeout/<closeout-id>/record-drafts/` for suggested
|
|
37
|
+
records. Apply only the drafts that are true and useful, then rerun
|
|
38
|
+
`wk validate`, `wk render`, and `wk site` or run another closeout.
|
|
39
|
+
|
|
40
|
+
Inspect the generated home page, guides page, search, mobile layout, and a few
|
|
41
|
+
record detail pages before committing or publishing. If a theme is customized,
|
|
42
|
+
inspect contrast on cards, panels, code blocks, and mobile navigation.
|
|
43
|
+
|
|
44
|
+
## JSON-First Agent Workflows
|
|
45
|
+
|
|
46
|
+
Most add commands support JSON input and JSON output:
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
wk article add --json '{
|
|
50
|
+
"title": "Spin",
|
|
51
|
+
"summary": "How Spin orients a maintainer before wiki updates.",
|
|
52
|
+
"body": "Spin inspects repo changes and suggests knowledge updates.",
|
|
53
|
+
"categories": ["workflow"],
|
|
54
|
+
"aliases": ["first-pass recipe"],
|
|
55
|
+
"source_record_ids": ["concept_spin"],
|
|
56
|
+
"files": ["src/cli/commands/spin.ts"],
|
|
57
|
+
"tags": ["audience:developer", "cli"],
|
|
58
|
+
"source": "agent",
|
|
59
|
+
"authority": "agent",
|
|
60
|
+
"confidence": "high"
|
|
61
|
+
}'
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Recommended authority rules:
|
|
65
|
+
|
|
66
|
+
- Use `authority: "user"` only for explicit user intent.
|
|
67
|
+
- Use `authority: "agent"` for agent-authored or inferred records.
|
|
68
|
+
- Use lower confidence when a record is a guess, partial summary, or stale.
|
|
69
|
+
|
|
70
|
+
## Record Revisions
|
|
71
|
+
|
|
72
|
+
Wikiwiki keeps record changes append-only. Updates add a new JSONL line with
|
|
73
|
+
the same logical `id`; deletes add a tombstone revision with `deleted_at`.
|
|
74
|
+
Status, rendering, search, and record reads use the latest active revision.
|
|
75
|
+
|
|
76
|
+
```sh
|
|
77
|
+
wk record list concept --json
|
|
78
|
+
wk record get concept concept_123 --json
|
|
79
|
+
wk record update concept concept_123 --json '{"summary":"Updated summary."}'
|
|
80
|
+
wk record delete concept concept_123 --reason "Superseded by decision_456"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The same generic revision flow works for `article` records:
|
|
84
|
+
|
|
85
|
+
```sh
|
|
86
|
+
wk record update article article_123 --json '{"summary":"Updated public summary."}'
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Closeout
|
|
90
|
+
|
|
91
|
+
`wk closeout` is the end-of-objective review flow:
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
wk closeout --profile mixed --audience all --json
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
It runs status, spin, validation, Markdown rendering, and site generation. It
|
|
98
|
+
then writes a deterministic draft packet under `.wikiwiki/drafts/closeout/`.
|
|
99
|
+
|
|
100
|
+
Closeout drafts are review artifacts. They should be read before any records
|
|
101
|
+
are added, and they should only become records when they are true and useful.
|
|
102
|
+
|
|
103
|
+
## With Beads
|
|
104
|
+
|
|
105
|
+
When a repo has `.beads/`, Wikiwiki treats Beads as the developer work graph
|
|
106
|
+
and stays out of the task database. By default, `wk status`, `wk spin`, and
|
|
107
|
+
`wk closeout` report that Beads was detected but skip detailed `bd` reads so
|
|
108
|
+
read-only wiki commands do not dirty `.beads/`.
|
|
109
|
+
|
|
110
|
+
If a repo has verified that local `bd` reads are clean, opt in to detailed
|
|
111
|
+
context with `.wikiwiki/config.json`:
|
|
112
|
+
|
|
113
|
+
```json
|
|
114
|
+
{
|
|
115
|
+
"integrations": {
|
|
116
|
+
"beads": {
|
|
117
|
+
"enabled": true
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
With that opt-in, Wikiwiki includes ready work, in-progress work, recent closed
|
|
124
|
+
work, and related issue IDs when `bd` can read without changing `.beads/`.
|
|
125
|
+
|
|
126
|
+
Recommended agent flow in a Beads repo:
|
|
127
|
+
|
|
128
|
+
```sh
|
|
129
|
+
bd prime
|
|
130
|
+
wk status --json
|
|
131
|
+
wk spin --profile mixed --json
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Use Beads for task state, blockers, dependencies, ownership, and follow-ups.
|
|
135
|
+
Use Wikiwiki for public articles, durable concepts, decisions, notes, events,
|
|
136
|
+
symbols, links, generated Markdown, and the human wiki. During closeout, review
|
|
137
|
+
the Beads context in `.wikiwiki/drafts/closeout/<closeout-id>/summary.md`, but
|
|
138
|
+
only add Wikiwiki records for knowledge that should outlive the task.
|
|
139
|
+
|
|
140
|
+
Generated sites also do not publish Beads task details unless
|
|
141
|
+
`integrations.beads.enabled` is `true`. Use that only for internal developer
|
|
142
|
+
sites; user-audience sites omit Beads from pages, manifests, and search data.
|
|
143
|
+
|
|
144
|
+
## Search
|
|
145
|
+
|
|
146
|
+
Search articles, active records, and rendered docs:
|
|
147
|
+
|
|
148
|
+
```sh
|
|
149
|
+
wk search renderer --json
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Search is local and article-first. It indexes article titles, slugs, aliases,
|
|
153
|
+
categories, source text, active records, and generated Markdown. It is useful
|
|
154
|
+
for quick orientation before changing code or writing new records.
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@thjodann/wk",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Wikiwiki is an agent-native living documentation system for code repos.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "commonjs",
|
|
7
|
+
"homepage": "https://github.com/Thjodann/Wikiwiki#readme",
|
|
8
|
+
"bugs": {
|
|
9
|
+
"url": "https://github.com/Thjodann/Wikiwiki/issues"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/Thjodann/Wikiwiki.git"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"agents",
|
|
17
|
+
"documentation",
|
|
18
|
+
"knowledge-base",
|
|
19
|
+
"cli",
|
|
20
|
+
"wiki"
|
|
21
|
+
],
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"README.md",
|
|
25
|
+
"docs",
|
|
26
|
+
"LICENSE",
|
|
27
|
+
"skills/wk"
|
|
28
|
+
],
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=22"
|
|
31
|
+
},
|
|
32
|
+
"bin": {
|
|
33
|
+
"wk": "dist/index.js",
|
|
34
|
+
"wikiwiki": "dist/index.js"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsc",
|
|
38
|
+
"dev": "tsx src/index.ts",
|
|
39
|
+
"start": "node dist/index.js",
|
|
40
|
+
"test": "npm run build && node --test test/*.test.js",
|
|
41
|
+
"check": "npm run build && node dist/index.js validate --json",
|
|
42
|
+
"pack:dry-run": "npm pack --dry-run",
|
|
43
|
+
"prepare": "npm run build",
|
|
44
|
+
"prepack": "npm run build"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"commander": "^12.1.0",
|
|
48
|
+
"zod": "^3.23.8"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@types/node": "^20.14.10",
|
|
52
|
+
"tsx": "^4.16.2",
|
|
53
|
+
"typescript": "^5.5.3"
|
|
54
|
+
},
|
|
55
|
+
"main": "index.js",
|
|
56
|
+
"directories": {
|
|
57
|
+
"doc": "docs",
|
|
58
|
+
"test": "test"
|
|
59
|
+
},
|
|
60
|
+
"author": ""
|
|
61
|
+
}
|