# Wiki Capture

Ktx's knowledge base - wiki pages for durable, reusable business knowledge.

- Repository: https://github.com/Kaelio/ktx (1627 stars)
- Category: AI and agents
- License: Apache-2.0
- Last updated: 2026-10-22
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add Kaelio/ktx --skill wiki_capture -g -a claude-code -y`
Codex: `npx skills add Kaelio/ktx --skill wiki_capture -g -a codex -y`
Cursor: `npx skills add Kaelio/ktx --skill wiki_capture -g -a cursor -y`
Gemini CLI: `npx skills add Kaelio/ktx --skill wiki_capture -g -a gemini-cli -y`

## Description

ktx's knowledge base - wiki pages for durable, reusable business knowledge. Covers capture workflow for user preferences, metric definitions, organizational conventions, and cross-references between wiki pages and semantic-layer sources. Loaded by the post-turn memory-agent only. The research agent reads wiki via `wiki_read`/`wiki_search` but does not write it.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Wiki Capture

## Role

The knowledge base stores durable, reusable business knowledge for an analytics assistant. Each page is a self-contained rule, definition, or convention that answers "how should this concept be handled in this organization?" - written once and reused across chats.

Scope selection is handled by the runtime:
- When user-scoped knowledge is enabled AND the caller is a chat turn, writes go to the user's **personal** scope.
- When the caller is an admin-driven ingest (`sourceType: 'external_ingest'`), writes go to the **global** scope.
- When user-scoped knowledge is disabled, all writes go to the global scope.

The `wiki_write` tool picks the right scope based on the session. Capture logic does not need to choose - focus on whether the content is worth capturing at all.

## What to capture

Capture when the user or the ingested document expresses:
- A metric definition ("revenue means booked revenue after refunds").
- A filter or convention that should always apply ("exclude test accounts when reporting ARR").
- A mapping or alias ("mood_stress_sleep = Oxytocin protocol").
- A domain rule that is not visible from column names alone ("status = 'T' means terminated, not 'terminated'").
- A link or external system convention ("medplum_patient_id is the primary key in the EMR at https://emr.example/patients/{id}").

The rest: https://github.com/Kaelio/ktx/blob/HEAD/packages/cli/src/skills/wiki_capture/SKILL.md
