okf-gem · for Claudepara Claude
claude.okfgem.com
+

Claude, with knowledge
curation built in

Claude, com curadoria de
conhecimento embutida

A plugin that ships the OKF skill, the /okf:gem front door, and a hook that runs okf validate + lint after every edit to your knowledge bundle. Deterministic, no LLM in the loop. It is the Claude-native door into the okf-gem pack: Agent Skill + CLI/Lib + Graph, 100% local.

Um plugin que traz a skill OKF, a porta de entrada /okf:gem e um hook que roda okf validate + lint após cada edição no seu bundle de conhecimento. Determinístico, sem LLM no loop. É a porta Claude-nativa para o pacote okf-gem: Agent Skill + CLI/Lib + Graph, 100% local.

install in Claude Codeinstale no Claude Code
> /plugin marketplace add serradura/okf-gem
> /plugin install okf@okfgem

The problem

O problema

Agents are great at changing knowledge and terrible at keeping it curated. Every session that edits your OKF bundle can leave broken cross-links, orphaned concepts, missing types, stale timestamps. The graph rots quietly, and nobody reruns the linter by hand. The fix is the same one that works for code: put the checks in the loop.

Agentes são ótimos em mudar conhecimento e péssimos em mantê-lo curado. Cada sessão que edita seu bundle OKF pode deixar cross-links quebrados, conceitos órfãos, types faltando, timestamps velhos. O grafo apodrece em silêncio, e ninguém roda o linter na mão. A solução é a mesma que funciona para código: colocar as checagens no loop.

Claude already reads your CLAUDE.md for standing instructions. An OKF bundle is the other half: curated project knowledge, versioned in git, that Claude reads on demand instead of loading whole. The plugin is what keeps that bundle conformant while Claude edits it, so it stays trustworthy session after session.

O Claude já lê o seu CLAUDE.md para instruções permanentes. Um bundle OKF é a outra metade: conhecimento de projeto curado, versionado no git, que o Claude lê sob demanda em vez de carregar inteiro. O plugin é o que mantém esse bundle conformante enquanto o Claude o edita, para que ele siga confiável sessão após sessão.

The curation hook, live

O hook de curadoria, ao vivo

what a session looks likecomo fica uma sessão

Claude edits a concept; the hook runs okf validate + okf lint on the bundle and hands the findings straight back to Claude, which fixes them before moving on.

O Claude edita um conceito; o hook roda okf validate + okf lint no bundle e devolve os achados direto para o Claude, que os corrige antes de seguir.

claude · my-app
> document the new invoicing flow in the bundledocumente o novo fluxo de faturamento no bundle

⏺ I'll capture it as a concept linked from billing/index.md.⏺ Vou capturar como um conceito linkado do billing/index.md.
⏺ Write(.okf/billing/invoicing-flow.md)
⚙ okf curation · 1 error, 2 warnings
  ✗ §9.2 billing/invoicing-flow.md: missing non-empty `type``type` ausente ou vazio
  ! backlog  `billing/refunds.md` referenced but does not exist`billing/refunds.md` referenciado mas não existe
  ! hygiene  reference link `[stripe-docs]` has no matching definitionlink de referência `[stripe-docs]` sem definição
⏺ Fixing the conformance error and the invisible broken link…⏺ Corrigindo o erro de conformidade e o link invisível quebrado…
⏺ Edit(.okf/billing/invoicing-flow.md) · type: Process, [stripe-docs] defined
⚙ okf curation · clean
  ✓ conformant · 1 curation note: `refunds.md` is demand-ranked backlog (2 links)1 nota de curadoria: `refunds.md` é backlog rankeado por demanda (2 links)
⏺ Done. The bundle stays conformant; refunds.md is now tracked
  as backlog. Want me to draft it too?⏺ Pronto. O bundle segue conformante; refunds.md agora está
  rastreado como backlog. Quer que eu o rascunhe também?

What's in the plugin

O que vem no plugin

okf@okfgem

The OKF skill

A skill OKF

The same canonical skill that ships inside the gem: spec §-by-§ reference, authoring guide, and templates. It carries the judgment; the CLI does the mechanics.

A mesma skill canônica que embarca na gem: referência da spec §-a-§, guia de autoria e templates. Ela carrega o julgamento; a CLI faz a mecânica.

auto-invoked on OKF workauto-invocada em trabalho OKF

/okf:gem · the front door

/okf:gem · a porta de entrada

One command, and a thin one: it hands what you type to the skill, which owns the routing. Bare, it orients on the bundle and recommends the next move without running one. search answers from the bundle token-lean; migrate turns docs you already have into a bundle; doctor installs and verifies the CLI.

Um comando, e fino: ele entrega o que você digita para a skill, que é dona do roteamento. Sem argumentos, orienta sobre o bundle e recomenda o próximo passo sem executar nada. search responde a partir do bundle gastando poucos tokens; migrate transforma os docs que você já tem num bundle; doctor instala e verifica a CLI.

/okf:gem [verb]

The curation hook

O hook de curadoria

PostToolUse on Write/Edit: if the file belongs to a bundle, validate + lint run and the findings return as context. Conformance errors demand a fix; lint reads as curation debt.

PostToolUse em Write/Edit: se o arquivo pertence a um bundle, validate + lint rodam e os achados voltam como contexto. Erros de conformidade exigem correção; lint entra como débito de curadoria.

automatic, per editautomático, por edição

/okf:gem curate · on demand

/okf:gem curate · sob demanda

The full loop, pulled by you: validate + lint + loose over the whole bundle, findings interpreted with the skill's judgment, fixes proposed or applied.

O ciclo completo, puxado por você: validate + lint + loose no bundle inteiro, achados interpretados com o julgamento da skill, correções propostas ou aplicadas.

/okf:gem curate

Command reference

Referência de comandos

okf@okfgem

The slash command

O slash command

/okf:gemThe front door, and deliberately thin: it hands its arguments to the skill unchanged, so the skill's own routing is the whole story. Bare, it orients on the bundle and recommends the highest-value next move (never auto-runs). search <query> retrieves an answer by reading the fewest files possible, and a free-form question is treated as a search too. Any verb below, or a free-form task, does what it says.A porta de entrada, e fina de propósito: ela entrega os argumentos para a skill sem mudar nada, então o roteamento da própria skill é a história inteira. Sem argumentos, orienta sobre o bundle e recomenda o próximo passo de maior valor (nunca executa sozinho). search <consulta> recupera uma resposta lendo o mínimo de arquivos possível, e uma pergunta livre também é tratada como busca. Qualquer verbo abaixo, ou uma tarefa livre, faz o que promete.

Skill verbs

Verbos da skill

The skill routes these; in Claude Code they run as /okf:gem <verb>. Every verb takes a registry ref where a path goes: @slug for a bundle registered with okf registry set, a bare @ for the default, and search takes several at once (@a @b, or @all).

A skill roteia estes; no Claude Code rodam como /okf:gem <verbo>. Todo verbo aceita uma referência do registry onde vai um caminho: @slug para um bundle registrado com okf registry set, um @ sozinho para o padrão, e o search aceita vários de uma vez (@a @b, ou @all).

(none)Orient on the bundle and recommend the highest-value next move, without running one.Orientar sobre o bundle e recomendar o próximo passo de maior valor, sem executar nada.
searchAnswer a question from the bundle, token-lean: ingest the map, run okf search, read only the winning files.Responder uma pergunta a partir do bundle gastando poucos tokens: ler o mapa, rodar okf search, abrir só os arquivos vencedores.
produceCreate or extend a bundle from code, docs, or knowledge that only lives in people's heads.Criar ou estender um bundle a partir de código, docs ou conhecimento que só vive na cabeça das pessoas.
migrateAdopt Markdown docs you already have, in place: frontmatter and reserved files added, every body kept verbatim.Adotar os docs em Markdown que você já tem, no lugar: frontmatter e arquivos reservados entram, cada corpo fica verbatim.
maintainSync the bundle's content with reality after the code or docs change.Sincronizar o conteúdo do bundle com a realidade depois que o código ou as docs mudam.
consumeUse the bundle as context for a task, writing back what you learn.Usar o bundle como contexto de uma tarefa, escrevendo de volta o que você aprende.
curateStructural upkeep as it stands: validate + lint + loose.Manutenção estrutural como está: validate + lint + loose.
doctorInstall and verify the CLI, then doctor the bundle.Instalar e verificar a CLI, depois diagnosticar o bundle.
<okf-cli-verb>Run any CLI verb (validate, lint, search, index, server, the read views) and interpret its output.Rodar qualquer verbo da CLI (validate, lint, search, index, server, as visões de leitura) e interpretar a saída.

How the hook works

Como o hook funciona

1PostToolUsefires on Write|Edit, after the change landsdispara em Write|Edit, depois que a mudança acontece
2Cheap gateGate baratois the file a .md inside a bundle? no → silent exit in mso arquivo é um .md dentro de um bundle? não → sai em ms, silencioso
3okf CLIvalidate --json + lint --json
scoped to the bundle rootescopados na raiz do bundle
4Back to ClaudeDe volta ao Claudefindings arrive as additionalContext: errors to fix, lint as debtachados chegam como additionalContext: erros a corrigir, lint como débito
deterministic: the CLI is the detector, no LLM in the loopdeterminístico: a CLI é o detector, sem LLM no loop zero cost on non-bundle editscusto zero em edições fora do bundle graceful without the gem: suggests /okf:gem once, never errorsgracioso sem a gem: sugere /okf:gem uma vez, nunca dá erro 20 s timeout, silent on overruntimeout de 20 s, silêncio se estourar

Install

Instalação

With the plugin (recommended)Com o plugin (recomendado)
> /plugin marketplace add serradura/okf-gem
> /plugin install okf@okfgem
> /okf:gem        # install the gem + doctor

# from here on, every bundle edit
# passes through okf validate + lint# daqui em diante, toda edição no bundle
# passa por okf validate + lint
Without a plugin (any agent)Sem plugin (qualquer agente)
$ gem install okf
$ okf skill .claude    # Claude Code
$ okf skill .agents    # agent-agnostic# agnóstico

# same canonical skill, no hook,
# curation runs when the skill says so# mesma skill canônica, sem hook,
# curadoria roda quando a skill mandar

The plugin lives inside the okf-gem repository, which is also its marketplace. Plugin skill and gem skill are generated from the same canonical source, so they can never drift. O plugin vive dentro do repositório okf-gem, que é também o seu marketplace. A skill do plugin e a da gem são geradas da mesma fonte canônica, então nunca divergem.