/kibi-claude:kibi-provable-codefrom Kibi
Guides writing code that is easy to review, test, and replace while also enabling Kibi to statically prove claims about policies, limits, roles, state machines, routes, validators, and error types. Covers handling dynamic access patterns (computed keys, dynamic imports, eval, reflection) and generated/vendored code boundaries.
Ships in Kibi. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Write code a reviewer can check by reading it. Code that states its decisions once, names what it depends on, and keeps decisions apart from effects is easier to review, test, change and replace. The same properties let Kibi read the code exactly and prove claims about it. Provability is a side effect of good design here, never a reason to make the design worse.
This skill is about the code. How to write the proof itself (proof kinds,
value_source, domains, the source readers) is in
kibi-usage/resources/proof.md; links between requirements, symbols and tests
are in kibi-traceability.
Use the visible approved MCP tools or the trusted project-local CLI as equal
peer interfaces (CLI JSON: printf '%s\n' '{"query":"..."}' | npx --no-install kibi search --input -). Exact routes are in
kibi-usage/resources/operation-access.md. If neither is available, write the
code by the practices below and say that Kibi could not be consulted. Never
read or edit .kb/ files directly.
kb_search the area (or its sourceLocations) and kb_query({id}) the
requirements the code implements, with includeBody: true when you need
their prose. A claim names the decision the code has to state: a limit, a
set of allowed values, a transition, a forbidden dependency.kb_check and kb_status show whether links and
proof receipts went stale. Re-prove what the change touched.Before changing code so that Kibi can read it, ask: would a reviewer who has never heard of Kibi accept this change on its own merits? Keep the change only if the answer is yes, because it removes duplication, names a hidden dependency, narrows a module, or makes a decision testable.
Never do any of these to satisfy Kibi:
POLICY.limit) reads a field.files, rename it, or mark hand-written code as
generated, so that a refused read goes away.When good design and a readable proof disagree, keep the good design and
change the evidence instead: model a claim the code can show, or keep the
requirement at tested with ordinary tests. tested is a sound evidence
level. proved is worth reaching only where the code is already shaped well.
Each practice below is a general one. Kibi's benefit is listed second.
value_source, exhaustive,
state_machine, regex, a domains export).references reader lists them exactly
(imports, env, calls, string_args, property).canInvite(role, target), nextState(state, event), priceFor(plan))
takes its inputs as arguments and returns a value; the code around it does
the I/O. Pure deciders are unit-testable over every input. Kibi's rule
and state_machine kinds call them on every combination of a finite
domain and prove the claim for all of them.next(state, event) function) over several
booleans that together imply a state. Impossible combinations disappear,
and Kibi can prove reachability and "can never become" claims.ForbiddenError,
ErrQuotaExceeded) instead of bare strings or a generic error with a
computed message. Callers can handle them precisely, and Kibi's thrown
read lists them.routes, schema and validator readers read them.resources/provable-patterns.md has before-and-after examples per language.
Runtime lookups and code built from text hide what a program does from
every static reader, people included: eval, new Function, exec,
globals()[name], getattr(obj, name) with a computed name, PHP $$var and
$obj->$method(), a dynamic import() or require(path) with a computed
path, reflection (Class.forName, Method.invoke, reflect.Value.Call,
Type.GetMethod), C# dynamic, process.env[key] with a computed key, and
C# #if around the code a claim is about. Kibi refuses a read that meets
one of these and names the line. Rust #[cfg] items are read as if every
build compiled them, so a "never" claim holds in each build; a cfg_attr
Kibi cannot split is still refused.
Replace a dynamic lookup when an explicit form is clearer, which is the usual
case: a computed getattr dispatch becomes a dict from name to function, a
computed env key becomes a named setting in the config module, $$var
becomes an array, a computed require becomes a static map of loaders.
Keep the dynamic form where it is the design:
For these, keep the dynamic part small and in one place: one loader or
registry module, with the code around it written statically. List the known
entries in a literal table where one exists (a registry of built-in handlers),
so the rest stays readable. Then model claims that do not depend on the open
part, or keep them at tested. Never write a proof that pretends an open set
is closed.
Treat generated code as a boundary: it is the generator's output, not code the project writes, so it does not have to follow these practices and is not refactored to make Kibi read it.
// Code generated ... DO NOT EDIT., @generated, auto-generated) and list generated paths as
linguist-generated (vendored code as linguist-vendored) in
.gitattributes. kibi doctor and kibi init then leave those files out
of language pack suggestions unless the KB names them.json/yaml/openapi/schema/validator
readers, or over the generator's configuration.implements and prove claims over it.tested.
Prefer the input over the generated files for a source proof: generated
code often uses constructs the readers refuse, and a proof over generated
text stales on every regeneration and follows the generator's version
rather than the requirement.tested. Keep every file the claim is about in files.tested and why.Parse kibiProtocol, status, diagnostics and typed nextActions on every
Kibi result. A refused proof read names the file, line and construct; it is
never an empty member list, so never read it as "nothing found". On
committed_with_repairs a write stands: run the repair actions and never
resend the original. Kibi authors tracked files but never Git-stages or
commits them.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
kibi, provable-code, static-analysis, code-review, design-patterns
npx claudepluginhub looted/kibi --plugin kibi-claude7 skills in this plugin
/kibi-bootstrapUse for any Kibi bootstrap or onboarding task: seeding a new or thin knowledge base; reviewing a bootstrap or onboarding plan, preview, or evidence; judging approval readiness or coverage; diagnosing a blocked, partial, or failed bootstrap or its repair; applying an approved bootstrap plan; or asking the human which knowledge sources hold intent. Covers kb_status first, source interview, cited intent claims, read-only kb_plan_bootstrap preview, explicit approval, exact-plan kb_apply_plan, and repair-safe close-out./kibi-commit-reviewUse when kibi check --staged or the Kibi pre-commit hook blocks a commit (kibi_impact_evidence_missing, symbols_manifest_stale, symbol_granularity_violation, symbol-coverage, kibi check-generated drift, Staged impact review failed), or when preparing a commit or pull-request impact review. Covers reading the per-file Detail lines, authoring .kb/symbols.yaml symbol entries through kb_upsert, staging the tracked Kibi evidence with git add (symbol coordinates are derived and never staged), kb_prepare_impact_review for a staged or diff scope and kb_author_impact_review to write the record, the kibi signoff requirements summary to show before a commit, how merge commits and migration renames are judged, and which requirement a newly listed symbol belongs to without making that requirement too broad./kibi-decisionsUse when the person states a rule or decision (must, never, always, from now on, we decided), when a Kibi hook asks to confirm or warns about an edit to code that implements a firm requirement, when the Stop hook says source files changed but nothing was recorded, when kb_check quotes requirement_statement_unverified, or when a request conflicts with a recorded requirement or ADR. Covers reading firmness and origin, recording a person's rule as firm with origin.ref, superseding with a Why this changed section, the kb_compile_intent unresolved/reviewCandidates/conflictReviews loop, asking before overriding a firm rule, putting decisions to the person as one numbered kibi signoff --questions view, and getting a batch of statement changes, splits, reasons or retirements approved during a knowledge base cleanup./kibi-freshnessCheck exact Git attachment, branch migration/quarantine, compiled-store freshness, source linkage, and repair state before decisions or writes./kibi-traceabilityMaintain source-first requirement, scenario, test, symbol, and proof traceability through Kibi's peer interfaces. Use when linking a code symbol to a requirement (implements, covered_by, executable_for), choosing which function owns a behavior, moving or removing links, or when kb_check reports broad_requirement_review, multi_requirement_symbol_review, coarse_anchor_only_review, symbol-coverage or missing_production_symbol_coverage./kibi-usageLoad before changing code in a repository that has a `.kb/` folder or `kb_*` tools, and whenever a Kibi hook, check or write result leaves you unsure what to do next. Covers the change arc over MCP or the trusted local CLI: find the requirement that governs the code, edit, record a stated rule with kb_record, run the linked tests and the changed-files check, finish without asking, commit with the `.kb` files and Git-stages them yourself, plus partial-completion repair. Also use for knowledge base quality work: cleaning up or auditing a KB, clearing kibi check review findings (broad_requirement_review, multi_requirement_symbol_review, coarse_anchor_only_review, entity-context-missing), splitting a requirement that covers several behaviors, choosing which function owns a behavior, writing why a requirement exists, and retiring knowledge whose behavior is gone.2 plugins in one repository ship this exact skill · first indexed Nov 7, 2026
Other plugins' skills for the same job