lore
Author, retrieve, and maintain OKF documentation with the lore CLI, including explicit multi-repository workspaces. Use whenever reading, writing, linking, moving, querying, or checking docs, so Story/Task coupling, managed blocks, provenance, and cross-links stay coherent. Run `lore instructions` for the canonical agent loop and `lore instructions <topic>` for just-in-time detail.
- License 许可
- MIT
- 最近更新
- 2026-09-26
- Stars
- ★ 27
- Forks
- 7
01 前言 Front Matter
- name
- lore
- description
- Author, retrieve, and maintain OKF documentation with the lore CLI, including explicit multi-repository workspaces. Use whenever reading, writing, linking, moving, querying, or checking docs, so Story/Task coupling, managed blocks, provenance, and cross-links stay coherent. Run `lore instructions` for the canonical agent loop and `lore instructions <topic>` for just-in-time detail.
03 SKILL.md 正文
lore — OKF documentation CLI
lore is this repo's documentation engine: a deterministic, CLI-first tool (no LLM dependency)
for authoring and maintaining the OKF bundle under docs/. This skill is a thin pointer —
lore instructions is the source of truth for how to drive lore.
When to use it
Reach for lore — not a plain editor — whenever you read, write, link, move, retrieve, or verify
docs in this repo or an explicitly selected workspace, so Story <-> Task coupling, managed blocks,
provenance, and cross-links stay coherent.
Commit-side-effect preflight
Before the canonical workflow below, treat lore link, lore unlink, lore rename, and
lore sync as self-committing commands: they can create commits under backlog/. Read the
applicable repository instructions and verify explicit commit authority before invoking them. When
the repository supplies
.codex/skills/backlog-handover/scripts/lore-authority-preflight.mjs, dispatch those commands only
through that gate with the exact Git worktree and in-repository scope. Without applicable authority,
stop before Lore runs and request permission or record a deferred stage. This preserves the
repository's Lore sole-committer contract.
Start here
Run lore instructions for the canonical agent loop and the topic index, then pull just-in-time
detail with lore instructions <topic>:
linkingStory <-> Task coupling (lore link/lore unlink)syncreconcile status + managed blocks (lore sync)checkthe CI gate: drift, links, anchors, portability (lore check)validationper-file OKF/schema conformance (lore validate)workspacemulti-repository projection and bounded retrieval (--workspace)
Commands
backlogAdopt Backlog knowledge records through a digest-guarded migration lifecycleinitScaffold an OKF bundle; a bare TTY run also wizards the agent bridge/scaffolds/backlog checknewScaffold a typed concept from a template (rejects an unknown type under strict_types)validateCheck concept files against OKF + the lore profile (per-file); strict_types escalates an unknown typecheckValidate links/anchors + reconciliation/committed-schema drift across the bundle (CI gate); strict_types escalates an unknown typereplaceFind-and-replace across the bundle, skipping managed regionsrenameMove a concept and repoint every inbound link + refsupersedeMark a concept superseded by another, wiring both wayslinkAdd task ids to a concept's tasks: + the doc: back-refunlinkRemove task ids from a concept's tasks: + the doc: back-refsyncReconcile status + managed task blocks, regen index/log, commit backlog/tasksShow the live status rollup for a concept's linked tasksorphansReport tasks with no owning doc + docs whose linked task vanishedschemaExport the profile's editor JSON Schemas to .lore/schemas/ (the fix forlore check's schema-drift)typesPrint the active profile's declared type vocabulary — fields, requiredness, sectionsscaffoldGenerate a downstream docs consumer's config additively, rewriting nothinggraphEmit the bundle's cross-link graph as json or dotpathFind bounded paths across exact authored concept and task edgesimpactExpand bounded impact across exact authored concept and task edgessnapshotExplicitly retain, list, or delete bounded projection snapshotschangedCompare two retained snapshots with bounded authored-fact deltasprovenanceTrace one retained concept, task, or edge to exact source evidenceexplorerBuild a deterministic self-contained local graph explorerexportEmit a deterministic, consumer-neutral OKF projection as JSONLqueryFull-text search the bundle with frontmatter filterscontextAssemble a concept + neighbor summaries within a token budgetreadRead one concept exactly as authored, with no budget and no assemblyagentList context profiles or compile bounded task-scoped evidenceinstructionsPrint task-scoped agent guidance on demandagentsRegenerate the agent bridges (SKILL.md + the CLAUDE.md/AGENTS.md nudge)helpShow help, or the machine-readable command manifest under --json
Machine contract
Every command supports --json (the {schemaVersion, kind, data} envelope) and --plain
(ANSI-free, auto-selected off a TTY). Branch on the semantic exit code, never on prose:
0 ok · 2 usage · 3 not_found · 4 denied · 5 conflict · 6 validation/drift.
Optional task-scoped context
When native Claude Code instructions name a committed Lore profile, use this stable opt-in line:
Lore profile:
<name>. Before working, runlore agent context <name> --task "<assigned task>"and ground decisions in the returned source IDs.
Lore supplies evidence only. It does not create or patch native agents, prompts, tools, models, permissions, or execution settings.
<!-- Generated by lore agents; do not hand-edit. Re-run lore agents --force to refresh. -->
04 同仓库更多 Skills
tlaplus-model
TLA+/TLC model-checking skill. Use it whenever TLA+, PlusCal, Quint, Apalache, TLC, a .tla/.cfg file, or model-checker output appears. That includes a pasted TLC error, "Invariant X is violated", or a State 1/State 2… counterexample trace the user wants explained or triaged (real bug, model artifact, or too-strong property), even if it looks answerable by reading alone. Also use it to write, run, scale, or fix specs; debug slow or exploding TLC runs; check invariants, liveness, and fairness; replay production logs against a spec; or "model"/"exhaustively check" concurrent code, protocols, queues, caches, schedulers, leases, retries, and state machines for races, lost updates, double-spends, deadlocks, and ordering bugs, even for a design with no code yet. Not for runtime race detectors, Jepsen, Alloy, Lean/Coq proofs, or UI state-machine libraries. Pair with formal-verify for the full bug-hunt loop.
proof-simplify
Use verified TLA+ specs and Lean proofs to simplify real code safely — delete defensive checks the invariants make dead, remove locks/transactions/retries that do no work, collapse redundant states and flags, replace complex implementations with simpler ones proven equivalent, and encode invariants in types — re-verifying every change (re-check, refinement, reachable-state equivalence) before touching code. Use this skill whenever the user asks to simplify, clean up, de-risk a refactor, or reduce complexity in code that has (or could get) a formal model; asks "do we still need this lock / check / retry / state"; wants to turn proofs into code improvements; or finishes a formal-verify bug hunt and wants the payoff. If no verified model exists yet, it starts one via formal-verify first.
lean-model
Use this skill to prove or refute properties of real software in Lean 4. The target is the user's own code, not textbook math. It covers state machines, concurrency and interleavings, async handlers, retries and idempotency, queues, batching pipelines, and graph algorithms such as topological order, acyclicity and DAG scheduling. Trigger it when the user wants a guarantee for every input or size ("holds for all N"), beyond what TLC, tests or a model checker showed. Also trigger it for invariant proofs by induction, a concrete counterexample trace, an executable reference model for differential testing, or setting up a Lean/lake project to model code. Also use it to audit a Lean development's trust base: sorry, axioms, native_decide. Do NOT use it for pure mathematics such as analysis, algebra or Mathlib coursework and homework. Do NOT use it to translate code into Lean syntax, or for other provers like Dafny, Coq or Isabelle. Pairs with formal-verify for bug hunts and tlaplus-model for protocol exploration.
formal-verify
End-to-end formal-methods bug hunting for real codebases in any language — scope a risky concern, model it in TLA+ and/or Lean 4, check it, turn every counterexample into a failing test, fix the code, re-verify, and publish the results as an Artifact report. Use this skill whenever the user wants to find race conditions, lost updates, deadlocks, stale caches, double-applied retries, broken idempotency, message reordering or loss bugs, state-machine violations, dataflow/pipeline loss or duplication, or graph/DAG/scheduler bugs; whenever they say "formally verify", "model check", "prove", "TLA+", "Lean", "invariant", "spec this out", "is this thread-safe", "can this race", or ask for a concurrency/async/distributed review of a module or PR — even if they never name a formal-methods tool. Also the entry point for keeping specs in CI and detecting spec/code drift. Routes to tlaplus-model, lean-model, and proof-simplify for the tool-specific work.
quest
Drive this repo's task tracker with the quest CLI instead of editing backlog/tracker state directly. Use whenever creating, listing, viewing, editing, completing, or archiving tasks, drafts, milestones, or decisions in a Quest-initialized workspace. Run `quest instructions --list` for the workflow guides and `quest help [command]` for full usage.