A Claude Code plugin for reading, writing, validating, and maintaining Open
Knowledge Format (OKF) knowledge bundles: git-friendly directories of markdown
concept files with YAML frontmatter, a generated index.md, an append-only
log.md, [[wiki-style]] cross-links, and source citations.
The plugin is dormant by default. It only nudges Claude toward OKF conventions in projects you explicitly activate, via a per-project sentinel and a SessionStart gate — so installing it globally costs nothing in projects that don't use OKF.
| Component | Path | Purpose |
|---|---|---|
Skill okf |
skills/okf/ |
Pure knowledge: how to read/write OKF, the spec, conformance rules, examples. Loads on demand. |
Command /cc-okf:activate |
commands/activate.md |
Opt a project into OKF (writes .okf/active). |
Command /cc-okf:validate |
commands/validate.md |
Check a bundle against conformance rules. |
Command /cc-okf:reindex |
commands/reindex.md |
Rebuild index.md from concept frontmatter; strip any legacy links: field. Supports --dry-run. |
Command /cc-okf:log |
commands/log.md |
Append a timestamped entry to log.md. |
Command /cc-okf:rename |
commands/rename.md |
Rename a concept, rewriting its filename, id:, and every cross-link [[old]] → [[new]] across the bundle. |
Command /cc-okf:query |
commands/query.md |
Find concepts by --tag, --type, --status, or --text (AND-combined). |
| Hook | hooks/hooks.json |
SessionStart gate — emits a short OKF pointer only when .okf/active exists. |
| Scripts | scripts/ |
okf-gate.sh, okf_common.py, validate.py, reindex.py, rename.py, query.py, append-log.py. |
Architecture: the skill is knowledge (no side effects); the commands are
actions that run the shared scripts. A skill cannot invoke a slash command,
so knowledge and lifecycle actions are kept separate but share scripts/ via
${CLAUDE_PLUGIN_ROOT}.
OKF sits between two things you may already use:
- vs. a personal vault (Obsidian/Foam/Dendron): OKF lives in the project's
own git repo and is maintained through explicit commands (
/cc-okf:reindex,/cc-okf:rename, …) that Claude runs as it works — it's team-visible project knowledge, not a personal note store. (The plugin stays dormant until you/cc-okf:activatea project.) - vs. Claude Code's built-in memory: memory is cross-session assistant memory scoped to you; an OKF bundle is durable, reviewable knowledge committed alongside the code it describes, shared by everyone who clones the repo.
Reach for OKF when the knowledge belongs to the project and should live in its history. Use a vault or memory when it belongs to you.
This repo is the plugin itself. It's distributed through a separate marketplace
catalog repo that points here via a GitHub source
({ "source": "github", "repo": "betmoar/cc-okf-plugin" }):
/plugin marketplace add betmoar/ccp-market
/plugin install cc-okf@betmoar(betmoar is the marketplace's name, not this repo.) For local development
without a marketplace, load the plugin straight from disk:
claude --plugin-dir /path/to/cc-okf-pluginThen /cc-okf:activate in a project to opt it into OKF (writes .okf/active).
/cc-okf:activate # writes .okf/active for this project
# start a new session (or /clear) so the SessionStart gate fires
/cc-okf:reindex # create/refresh index.md
/cc-okf:log "Initial bundle" # create/append log.md
/cc-okf:validate # expect: 0 error(s)
Then create concepts under concepts/<id>.md. The okf skill documents the
frontmatter schema, cross-link and citation conventions, and conformance rules;
see skills/okf/references/ for the full spec, rules, and examples.
Claude Code has no native per-project enable for a globally-installed plugin, and plugin skills can't be gated on a sentinel file natively. This plugin uses the established workaround:
/cc-okf:activatewrites.okf/activeat the project root.- On session start,
scripts/okf-gate.shchecks for that sentinel. If present, it emits a short factual pointer asSessionStartadditionalContexttelling Claude OKF is active here; if absent, it emits nothing. - The full OKF spec stays in the skill body /
references/and loads only when relevant (progressive disclosure), so token cost is minimal even when active.
Hook and hooks.json changes require /reload-plugins or a restart to take
effect. If a brand-new conversation doesn't pick up the pointer, start a fresh
session or /clear (a known SessionStart timing quirk on some versions).
Each command declares a tightly scoped allowed-tools (e.g. validate only
needs Bash(python3:*), Read). On first run, choose
"Yes, and don't ask again" to persist the grant into .claude/settings.local.json
for that project. Prefer letting Claude Code write these permissions rather than
hand-editing the file.
- The Python scripts need only the Python 3 standard library (PyYAML is used if present, but is not required — there is a built-in frontmatter parser).
okf-gate.shis a POSIXbashscript.
v0.2.1 — permissive & interoperable: type/status are now free-form
(any value accepted), title/created/updated are recommended not required,
dangling links are tolerated as WARNs, markdown [text](target.md) links are
recognized alongside [[wiki]] links, and the generated links: field is
removed (body links are the single source of truth).
version in .claude-plugin/plugin.json drives updates: bump it (and the
CHANGELOG) for users to receive changes. During active iteration you may instead
leave version unset so each commit is treated as a new version (instant
propagation after /plugin marketplace update + claude plugin update).
Validate before publishing (from the repo root):
claude plugin validate . --strict
MIT — see LICENSE.