pks brain wiki

stable

Render one wiki page per synthesized cluster — overview, user stories, what is built, open threads, and hot files — plus an index linking them all.

Author: Poul Kjeldager
Usage: pks brain wiki [options]
Category: infrastructure

Examples

$ pks brain wiki --dry-run

List the pages that would be rendered

$ pks brain wiki --max-clusters 5

Render only the five largest clusters

$ pks brain wiki --no-ai

Write the index from existing clusters only

Wiki is phase 4. It reads ./.pks/brain/synthesis/clusters.json and renders one markdown page per qualifying cluster into ./.pks/brain/wiki/ — overview, user stories, what has been built, open threads, and hot files — together with wiki/index.md linking every page.

The default --min-cluster-size is 3. A theme backed by fewer than three sessions is usually too thin to read as a page.

1. Prerequisites

  • A git repository. Output goes to ./.pks/brain/wiki/, so the command exits with code 1 outside a repo.
  • pks brain synth must have produced clusters.json. Without it, wiki tells you to run synth and exits 0.

2. Plan the render

pks brain wiki --dry-run

Eligible pages and the estimated cost are printed with no model calls.

3. Render

pks brain wiki

Pages are rendered ten at a time by default. The confirmation gate fires at 10 or more pages and $1.00 or more estimated, unless --no-ai or -y is passed.

4. Render a subset

pks brain wiki --max-clusters 5 --min-cluster-size 4

--max-clusters bounds how many pages get an AI rendering; the remaining clusters stay in the index only. --min-cluster-size controls which clusters qualify as a page at all.

5. Rebuild the index without spending

pks brain wiki --no-ai

Writes wiki/index.md from the existing clusters.json and skips every model call.

6. Verify

cat ./.pks/brain/wiki/index.md

Every entry links to a rendered page in the same directory.

Options

FlagDefaultDescription
--model <name>haikuModel name passed to the backend.
--parallel <n>10Maximum parallel model invocations.
--max-clusters <n>Cap how many cluster pages receive an AI rendering. Others stay in the index.
--min-cluster-size <n>3Minimum sessions per cluster before it becomes a page.
--no-aifalseSkip model calls. Writes wiki/index.md from the existing clusters.json only.
--max-budget-usd <amount>Hard dollar cap per invocation.
--dry-runfalsePlan only — print eligible pages and the estimate.
-y, --yesfalseSkip the cost-confirmation prompt.

Troubleshooting

"Run pks brain synth first" and exit 0. clusters.json does not exist. pks brain synth --no-ai produces it without cost.

Fewer pages than clusters. Clusters below --min-cluster-size are indexed but not rendered. Lower the threshold to widen the set.

Exit code 1 immediately. The working directory is not inside a git repository.

See also