Wiki Capsules And Agent Doc Packs
Operating model for turning kevin-wiki into both a readable second brain and a reusable agent framework: coherent wiki articles own meaning, generated registries own inventory, and packs compile the right context for each workflow.
Full design spec: docs/superpowers/specs/2026-06-26-wiki-capsules-agent-doc-framework.md.
Core Idea
The wiki should keep coherent pages, not a page per stray thought. The durable unit is a mental object: a concept, tool ecosystem, person with real signal, workflow, decision, or skill family. Small mirror pages and one-line registries belong in generated data or ledgers.
The governing rewrite standard is Wiki Brain Operating Model. This page focuses on capsules and generated packs; the operating model defines how the wiki should be flattened, merged, categorized, and kept readable.
The missing layer is now explicit: a brain capsule is the public interface to one coherent slice of Kevin's compiled wiki. A capsule says which source pages, skills, tools, concepts, artifacts, generated registries, proof rules, and maintenance loops belong together.
The agent-facing product starts with the capsule. Generated packs are downstream execution bundles attached to one or more capsules. Agents should be able to say "I am using the Frontend And Design System capsule" before they say "I loaded frontend.md." That makes the brain boundary visible instead of burying it inside a pack table.
Canonical source/projection contract: Generated Surface Contract.
AGENT DOCS directory map: Agent Docs System Map.
Canonical pack index: wiki/agent-docs/README.md.
Canonical capsule index: wiki/meta/brain-capsules.md.
Portable capsule manifest: agent-docs/capsules.json.
Portable generated output: agent-docs/packs/.
Generator/check: npm run agent-packs:refresh and npm run agent-packs:check.
agent-packs:refresh runs the page-by-page corpus and consolidation audits before regenerating
packs, capsules, and readable indexes.
Each generated pack now carries more than a static checklist. The generator scans current wiki
markdown/frontmatter and writes a ranked Wiki Knowledge Surface, Tools And Skill Routes,
SOTA / Frontier Watchlist, bundle-neighbor hints, and self-update triggers into every pack. The
intended loop is: ingest/update the atomic wiki page first, then regenerate packs so new frontier
knowledge flows into design.md, frontend.md, backend.md, code.md, ai-agents.md, and the
other portable docs automatically.
Capsule maintenance is fed by bookmark artifact review. npm run audit:x-bookmark-artifacts
builds wiki/meta/x-bookmark-artifact-audit.json, a per-bookmark queue that flags unresolved
source review, visual review, local media repair, thought types, and capsule candidates. A bookmark
is not fully absorbed until durable thoughts from its links, threads, replies, images, and demos have
been promoted into source pages or explicitly deferred in that ledger.
For agent-facing capsules, evaluator state is part of the public brain interface. If a capsule teaches agents how to act, it must also expose how that action is checked. Agent Self-Improvement Eval Library owns the receipt-based proof surface, Red Queen Gödel Machine owns evaluator hardening, and Loopy owns the repeatable loop shape before a procedure becomes a skill or automation.
Brain Capsule Contract
Each capsule exposes:
| Field | Meaning |
|---|---|
id |
Stable capsule identifier used by generated packs and audits. |
publicPurpose |
The plain-language slice of Kevin's brain this capsule exposes. |
loadWhen |
The task boundary that activates the capsule. |
sourcePages |
Read-first wiki pages that own durable truth. |
skillRoutes |
Executable skills agents should consider before inventing a process. |
toolRoutes |
CLIs, MCPs, scripts, products, or services attached to the capsule. |
maintenance |
Checks and write-back rules that keep the capsule current. |
packs |
Generated execution bundles attached to the capsule. |
Generated packs must include a ## Brain Capsule Interface section. The manifest must include
capsule routes per pack so enrolled repos and other agents can load the same brain slice without
reverse-engineering wiki structure.
The stronger loop runs Agent Pack Corpus Audit first. That audit reads every non-generated wiki
page, assigns a candidate capsule, scores pack candidates, flags explicit-pack-block opportunities,
and writes wiki/meta/agent-pack-corpus-audit.json. Generated packs consume the compact per-pack
review queues from that JSON under ## Corpus Review Queue.
The companion loop runs Page Consolidation Audit. That audit reads the same wiki corpus and
finds likely duplicate pages, foldable stubs, over-split ideas, and valid skill/tool/concept layer
mirrors that need clearer routing instead of blind deletion. Generated packs consume those compact
per-pack queues under ## Consolidation Review Queue.
The ecosystem coverage loop runs Ecosystem Capability Coverage before consolidation. That audit checks whether service ecosystems are merely discovered, actually routed, represented by readable wiki pages, included in packs, and backed by a verification path. This prevents Google Workspace, Firebase, and Azure from becoming the only well-promoted ecosystems just because they had earlier skill families.
Page Layers
| Layer | Owns | Example |
|---|---|---|
| Canonical synthesis page | Readable generalized article with thesis, when to use it, decision matrix, core model, tool/skill routing, failure modes, evidence, and related pages | Browser Automation and QA, Agent Search and Retrieval, Local Web Verification |
| Tool page | Product facts, tradeoffs, interfaces, auth/setup surfaces, alternatives, and freshness notes | browser-use, agent-browser, playwright, qmd, sentry, clickhouse, tanstack |
| Skill registry row | Executable procedure inventory: slug, namespace, source path, family route, and short description | Skill Registry generated from skills/**/SKILL.md |
| Skill family page | Readable synthesis for a skill cluster: when to route there, owners, failure modes, cleanup rules, and notable procedures | Agent Engineering Skills, Frontend and Design Skills, Browser Testing Skills |
| Source/ingest page | Evidence logs, raw captures, timeline material, and registry snapshots | Raw registry harvests, tweets, docs captures |
| Generated pack | Downstream portable agent context bundle | agent-docs/packs/*.md |
Packs should prefer canonical synthesis pages first, then relevant tool pages, skill-family pages, generated registry rows, live review queues, and source refresh notes. Packs should not pull every small related page with equal weight.
Current canonical cluster pages: Identity, Session, and Routing, Browser Automation and QA, Local Web Verification, Agent Search and Retrieval, Skills, Tools, and Capability Discovery, Google Workspace Skills, Firebase Skills, Azure Skills, Frontend, Design, Motion, and Accessibility, Agent Harness, Runtime, Memory, and Evals, Agent Self-Improvement Eval Library, Loopy, and the generated Skill Registry.
| Pack Family | Examples |
|---|---|
| Startup / routing | identity.md, session.md, routing.md, workflow-index.md |
| Engineering | code.md, architecture.md, typescript.md, testing.md, debugging.md, doctors.md, review-qa.md, security.md, git-process.md, process-hygiene.md |
| Frontend / design | frontend.md, react.md, nextjs.md, design.md, design-systems.md, motion.md, accessibility.md, performance.md, browser-qa.md, web3d.md, mobile.md |
| Backend / infra | backend.md, databases.md, auth.md, infra.md, cloud.md, observability.md, payments.md, data.md, ops.md, service-cli.md, google-workspace.md |
| AI / agents | ai-agents.md, agent-harnesses.md, skills.md, mcp-tools.md, memory.md, evals.md, sandboxes.md, model-routing.md, automations.md |
| Wiki / research / docs | wiki-ops.md, capture-ingest.md, research.md, learning.md, docs-writing.md, diagrams.md |
| Product / career / communication | product.md, content.md, writing.md, seo.md, career.md, portfolio.md, people.md, principles.md, narrative.md |
| Specialty | media-generation.md, documents-presentations.md, game-dev.md, hardware-graphics.md, events-travel.md |
Why This Beats A Giant Manual
A single giant hand-written design.md would be convenient for one agent session and stale a week later. Capsules keep the source modular. Generated packs give agents one file to read.
This matches three existing principles:
- Agent-Docs Mesh: root reference plus scoped procedure docs.
- Browser Testing Skills / Matt Pocock's Skills (Skills for Real Engineers): progressive disclosure and no-op pruning.
- Capability Routing Map: skill, tool, concept, and resolver pages own different layers.
Page Identity Rule
Stable page identity must be separate from file path before any bulk move.
| Field | Purpose |
|---|---|
id |
Immutable concept slug used by wikilinks and backlinks. |
path_slug |
Physical route/URL derived from file path. |
capsule |
Domain cluster. |
redirect_from |
Old flat slugs or old paths that should resolve after moves. |
Agents should keep writing [[next-js]], [[gws-drive]], and [[opencode]]. The wiki resolver should map those ids to current nested file paths.
First Capsules
| Capsule | Why |
|---|---|
agent-harnesses |
OpenCode, OpenClaw, Hermes, Claude Code, Codex, Cursor, AI SDK Harness, and portability rules belong together. |
google-workspace |
gws-* skills and Google Workspace CLI are one operational service family. |
gstack |
GStack review/QA/design review should be grouped while preserving Kevin's no-sus/autoreview priority. |
firebase |
Firebase service skills are one backend/mobile platform family. |
taste |
Taste skills, design style pages, imagegen, Stitch, and anti-slop rules are one design decision layer. |
nextjs |
Next.js tool facts, best-practices skill, Cache Components, upgrade, and instant navigation workflow belong together. |
Implementation Order
- Add identity registry support: stable
id, recursive paths, redirects, and duplicate checks. - Add capsule manifests and routers without moving files.
- Run
npm run ecosystem-coverage:auditand promote tier-1 service ecosystems before merging pages. - Replace one-page-per-skill validation with generated skill registry validation.
- Compact low-signal skill/person/entity mirrors into family pages, ledgers, or real concept/tool pages.
- Generate the default coding bundle and web-app bundle from canonical pages and registries.
- Expand lane by lane until every pack in
wiki/agent-docs/README.mdexists. - Extend
agent-docsso enrolled repos can import pack presets.
Guardrails
- Do not move executable skill directories until all harnesses support nested skill discovery.
- Do not break
[[slug]]wikilinks. - Do not bulk move pages until redirects, backlinks, qmd, UI, and
skills:checkare path-aware. - Do not recreate hand-written root
wiki/skills/<slug>.mdmirrors; use Skill Registry, family pages, and generated namespace source pages underwiki/skills/{engineering,productivity,personal,misc,in-progress,deprecated}/. - Do not delete ideas during compaction; move them into a section, table row, alias, timeline, ledger, or redirect.
- Known retired slugs resolve through
npm run wiki:resolve -- <slug-or-title>; qmd search remains the discovery path, not the exact identity resolver. - Do not let generated packs summarize arbitrary markdown. Use explicit
agent-pack:<pack>source blocks or capsule summaries. - Do not replace routers with packs. Routers choose; packs instruct.
- Do not hand-edit
wiki/agent-docs/README.md; it is the generated readable pack index. - Do not edit generated pack files by hand; edit
scripts/generate-agent-packs.tsand runnpm run agent-packs:refresh. - Do not edit
wiki/meta/brain-capsules.mdoragent-docs/capsules.jsonby hand; editscripts/generate-agent-packs.tsand rerun the generator. - Do not treat bookmark coverage as artifact review. Run
npm run audit:x-bookmark-artifactsand drain the relevant per-bookmark queue. - Do not treat
## Corpus Review Queueitems as already-promoted truth. They are inspection queues; promote by updating the source page, pack definition, or explicit source block. - Do not treat
## Consolidation Review Queueitems as delete instructions. Read both pages, preserve timelines and citations, and keep valid layer mirrors separate with better routing.
Timeline
- 2026-07-01 | Linked the capsule/pack model to Agent Docs System Map so hand-written quickrefs, generated indexes, packs, and capsule manifests have one directory-level map. Source: User request, 2026-07-01
- 2026-07-01 | Added Generated Surface Contract as the explicit source/projection rule for capsules, manifests, and generated agent-doc packs. Source: User request, 2026-07-01
- 2026-06-26 | Created from Kevin's request to group related tools/skills/concepts into subdirectories and generate portable development-framework docs for agents. Source: User request, 2026-06-26
- 2026-06-26 | Upgraded pack generation so every pack is enriched from the current wiki corpus with ranked knowledge surfaces, tool/skill routes, frontier watchlists, bundle neighbors, and self-update triggers instead of remaining a static skeleton. Source: User request, 2026-06-26;
scripts/generate-agent-packs.ts - 2026-06-26 | Added corpus-audit-fed pack review queues: every non-generated wiki page now receives pack/capsule/action decisions, and generated packs expose the highest-priority inclusion, explicit-guidance, and research-refresh queues. Source: User request, 2026-06-26;
scripts/audit-agent-pack-corpus.ts - 2026-06-26 | Added consolidation-audit-fed pack review queues: every generated pack now exposes likely page merges, foldable stubs, over-split idea boundaries, and valid layered mirrors relevant to that workflow. Source: User request, 2026-06-26;
scripts/audit-page-consolidation.ts;scripts/generate-agent-packs.ts - 2026-06-27 | Added page-layer rules and made ecosystem coverage a required pre-consolidation pass so pack quality starts from promoted capability coverage rather than pairwise page merges. Source: User request, 2026-06-27;
scripts/audit-ecosystem-coverage.ts - 2026-06-27 | Replaced the pilot capsule direction with whole-wiki brain compaction: coherent articles, generated skill registry, family synthesis pages, redirect preservation, and ledgers for low-signal entities. Source: User request, 2026-06-27;
scripts/compact-wiki-brain.ts;scripts/generate-skill-registry.ts - 2026-06-27 | Linked capsules/packs to Wiki Brain Operating Model so generated packs stay downstream of coherent brain articles instead of becoming the primary wiki shape. Source: User request, 2026-06-27
- 2026-06-29 | Inverted the model so brain capsules are the public agent/user interface and packs are downstream execution bundles; added generated capsule manifest/index requirements and tied X bookmark artifact review into capsule maintenance. Source: User request, 2026-06-29;
scripts/generate-agent-packs.ts;scripts/audit-x-bookmark-artifacts.ts - 2026-06-29 | Added agent self-improvement evals, evaluator hardening, and loop-crafting as first-class capsule concerns. Source: User request, 2026-06-29; Agent Self-Improvement Eval Library; Red Queen Gödel Machine; Loopy