技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
wiki【数据与研究】Knowledge base builder and maintainer for persistent markdown wikis. Use when ingesting sources into structured wiki pages, querying existing knowledge bases, creating new wikis, maintaining wiki quality, or navigating wiki content. Covers 6 domain templates (research, project, personal, business, reading, general), anti-hallucination citations, inde…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Parent skill for building and maintaining file-based markdown knowledge bases. Routes operational work to reference files.
This is a slim parent — detailed protocols live in reference files. Read this file to understand WHAT wikis are and WHICH reference file handles WHICH operation. Read the reference files for HOW.
The protocol files describe the contract; these perform the parts of it that are pure mechanism, so they are not re-derived by a model on every run:
W=~/.claude/skills/wiki/scripts/wiki_lint.py
python3 $W create --path ~/wikis/trading --name "Trading Research" --domain "systematic equity"
python3 $W lint --wiki ~/wikis/trading # exit 2 if anything fails or warns
create writes the skeleton and a WIKI.md carrying all 11 required sections, leaving
sections 1 and 10 as deliberate placeholders — a wiki whose purpose and domain behaviour are
unstated drifts into a folder of notes.
lint enforces the §3 frontmatter contract: required fields, closed enums, kebab-case slugs
matching filenames, dates in order, and every source entry citable (a path plus one of
pages/lines/anchor). A wikilink that resolves to nothing is an ERROR, because a wiki
asserting connections it does not have is worse than no wiki. Staleness and a deprecated page
with no successor are warnings, not errors — conflating the two teaches people to ignore the
output.
ingest.py is deliberately absent. Reading a source and deciding what a page should SAY
is comprehension, not mechanism, and a script pretending otherwise would produce confident,
shallow pages. ingest.md remains the protocol the model follows.
sha256sum, wc -l, stat -c '%Y %s' of the target file. Record the hash explicitly in the conversation/log.cp -p <file> <file>.bak.YYYYMMDDTHHMMSSZ with a UTC-style timestamp suffix. Backups stay in-place under the wiki root — they survive cp -r and are git-trackable.sha256sum again and compare against the snapshot. If different → abort the write, alert the caller with the divergent hashes, do NOT silently overwrite. The backup remains for forensics; the new state may contain useful work that must not be lost.cat > file. For larger rewrites, write to a sibling <file>.new, fsync, then mv to the final name.sha256sum + line count and log it. This creates an audit trail.The protocol survives the "other session edited it without acquiring our lock" failure mode. The price is one extra sha256sum per write — negligible vs the cost of a silently-overwritten index.
A wiki is a self-contained directory with three layers:
<wiki-root>/
WIKI.md # Schema/conventions for THIS wiki
index.md # Master content catalog
log.md # Chronological operations log
raw/ # IMMUTABLE source files (date-prefixed)
wiki/ # LLM-owned content layer (categorized pages)
_templates/ # Per-wiki instance templates (customizable copy)
_maintenance/ # Agent operational state (link-index, lint-history, tags)
.wiki-meta.yaml # Local registry backup
.wiki.lock # Single-writer lock (when present)
Layer ownership:
raw/ — IMMUTABLE. Once deposited, never modified.wiki/ — LLM-owned. Agent writes; humans read. Human edits flagged on lint.WIKI.md + schema — CO-EVOLVED. Agent proposes, user approves.Registry: ~/.wiki-registry.yaml (user home, not in ~/.claude/ — wikis are cross-tool).
| User Intent | Reference File |
|---|---|
| "Create a new wiki" / "set up wiki for X" | ~/.claude/skills/wiki/schema.md (bootstrap section) |
| "Ingest this source" / "add X to my wiki" | ~/.claude/skills/wiki/ingest.md |
| "What does my wiki say about X" / "find Y in wiki" | ~/.claude/skills/wiki/query.md |
| "Lint wiki" / "check wiki health" / "find broken links" | ~/.claude/skills/wiki/lint.md |
| "Update schema" / "add new page type" / "evolve WIKI.md" | ~/.claude/skills/wiki/schema.md (evolution section) |
| Pick a domain template | ~/.claude/skills/wiki/templates/{research,project,personal,business,reading,general}.md |
Delegating to a reference file means: read that file into context, then follow its protocol. Do not re-derive logic here.
| Template | For | Master File |
|---|---|---|
| research | Papers, concepts, experiments, comparisons | ~/.claude/skills/wiki/templates/research.md |
| project | Architecture, ADRs, API contracts, runbooks | ~/.claude/skills/wiki/templates/project.md |
| personal | Goals, habits, journal, self-model | ~/.claude/skills/wiki/templates/personal.md |
| business | Companies, markets, products, customer segments | ~/.claude/skills/wiki/templates/business.md |
| reading | Books, characters, themes, quotes | ~/.claude/skills/wiki/templates/reading.md |
| general | Minimal fallback when no domain fits | ~/.claude/skills/wiki/templates/general.md |
Two template locations — do not conflate:
~/.claude/skills/wiki/templates/<name>.md — canonical, updated by alf<wiki-root>/_templates/<type>.md — copied at wiki creation, customizable per wikiproject-documentation (PROJECT.md, COMPONENT.md)history.md (recent) + history/INDEX.md (archived) in the project rootThe wiki is for persistent domain knowledge that compounds across sources. Everything else has a better home.
| Anti-Pattern | Why It Fails | Correct Approach |
|---|---|---|
| Writing content inline here instead of reference files | SKILL.md exceeds 120-line slim-parent cap, ecosystem conventions broken | Keep routing + hard rules here; detail in ingest.md/query.md/lint.md/schema.md |
| Reading the full wiki to answer a query | Context explodes, costs unbounded, answers degrade | Index-first: read index.md, grep, targeted page reads |
| Claiming facts without source citations | Wiki becomes unreliable, undetectable hallucination contamination | Every claim cites [Source: raw/<file>, p.<page>] — lint check #3 enforces |
Treating raw/ as mutable | Breaks provenance, citations stop resolving | Immutable raw layer — new versions get numeric suffixes |
| Skipping lint after batch ingest | Broken links and contradictions accumulate silently | Mandatory lint after batch ops (see lint.md mandatory triggers) |
Bypassing the .wiki.lock | Concurrent writes corrupt index.md and link graph | Check → acquire → write → release pattern |