OctoEvidence.Cli
0.0.6
See the version list below for details.
dotnet tool install --global OctoEvidence.Cli --version 0.0.6
dotnet new tool-manifest
dotnet tool install --local OctoEvidence.Cli --version 0.0.6
#tool dotnet:?package=OctoEvidence.Cli&version=0.0.6
nuke :add-package OctoEvidence.Cli --version 0.0.6
OctoEvidence
Give coding agents a reliable, validated map of your project — in three roles.
You mark which folders are components and connect your agent once. The agent (Claude Code,
Codex, or any MCP client) writes and maintains the knowledge — OKF v0.2 Markdown inside each
component's okf/ folder — on its own during normal coding sessions. A human reviews it in
the pull request like any other code. OctoEvidence is the referee in between: it validates,
verifies citations against real source lines, routes future tasks, and keeps everything in
step with Git.
It works with any programming language because it never parses source code and never calls a model. The format is the Open Knowledge Format v0.2.
You declare and review. The agent authors. OctoEvidence enforces. Git stays the source of truth.
Requirements: .NET 10 SDK or runtime, and Git on PATH.
Role 1 — You: set it up (four commands, once per repo)
1. Install the CLI (once per machine; only the executable is global — all state stays in each project):
dotnet tool install --global OctoEvidence.Cli --version 0.0.6
2. Declare your components. Pick the folders that mean something on their own — a
service, a job, an infra module. init creates an empty okf/ folder in each, records the
shared sync branch in octoevidence.json, and writes the agent operating rules into
AGENTS.md (or CLAUDE.md if you already have one) — both Codex and Claude Code read that
file automatically, so you write no prompt rules yourself:
octoevidence init --declare services/identity --declare services/payments --sync-branch origin/main
init also detects your agent. If Claude Code or Codex is present (a .claude/, CLAUDE.md,
or .codex/ marker in the project or your home directory), it generates the octoevidence
workflow skill for each — the SKILL.md standard both read — so the authoring choreography
loads exactly when a fill, reconcile, or repair task starts instead of sitting in every
session's context. For Claude Code it additionally wires a Stop hook into
.claude/settings.json: a session that leaves OKF validation errors is blocked from handing
off, with the errors fed back to the agent. Everything is regenerated by re-running init
and merged without touching your own settings; hooks stay Claude-only while Codex's hook
engine remains experimental.
Only an exact lowercase okf/ folder counts as a declaration; Okf/ and OKF/ are ordinary
directories. After declaration the agent owns every file inside okf/, including
index.md — OctoEvidence never generates, merges, or deletes bundle documents.
3. Connect your agent:
# Claude Code
claude mcp add --transport stdio --scope project octoevidence -- octoevidence mcp
# Codex
codex mcp add octoevidence -- octoevidence mcp
4. Tell the agent to fill it — one plain prompt in your next session:
Fill every reserved okf folder in this project.
When it finishes, commit okf/ and octoevidence.json like any other code and open a PR.
That's the whole developer job: declare folders, connect the agent, prompt once, review PRs.
One rule to remember: nothing sensitive or executable ever goes inside okf/ — no source
code, SQL, DDL, credentials, data rows, or raw logs. Validation fails the bundle if it
happens.
Role 2 — The agent: uses it automatically
The instruction block init installed drives all of this; you don't trigger these steps.
- At session start the agent calls
check_component_updates. If the sync branch changed the knowledge, the user decides — pull the branch's version or continue locally. When the MCP client supports elicitation the question is put to the user directly (and a "pull" answer is applied at once); otherwise the agent is instructed to ask. One answer is remembered per branch revision. - On a normal coding task it calls
find_componentswith the request, gets the relevant components ranked with the files to open first, thenread_componentto load just the few documents that matter — index and card first, exact paths on demand. - When writing knowledge it calls
prepare_okf_fill, readsokf_authoring_guide, authors the Markdown, backs each factual claim with a source-line digest fromcite_lines(it cannot invent one), and runsvalidate_okfuntil clean. - After changing your code it updates the affected concepts, claims, and
log.md, re-resolves moved citations, and validates again — so knowledge never lags the code.
MCP tools
| Tool | Purpose |
|---|---|
check_component_updates |
Three-way sync state against the branch; asks the user pull-or-continue when the branch has updates. |
pull_okf_updates |
Materialize immutable branch bundles for remote-only/remote-ahead components. Never merges. |
find_components |
Deterministic ranked routing for ordinary coding work. |
read_component |
Progressive, bounded reads from local or immutable branch state. |
list_okf_components |
Complete uncapped inventory for fill-all work. |
prepare_okf_fill |
Targets, gaps, sync state, and the exact authoring procedure. |
okf_authoring_guide |
The self-contained OKF v0.2 authoring contract. |
cite_lines |
Strict line-range digests; invalid ranges are rejected, never clamped. |
validate_okf |
OKF v0.2 conformance plus the stricter no-code profile; scope accepts components and _brd/<slug>. |
prepare_brd_ingest |
Extract a Word BRD's outline and digest, return the existing BRD inventory and the ingest choreography. |
read_brd_source |
Bounded extracted text from a .docx, section by section. |
list_brds |
Uncapped BRD inventory with cards and derived reverse relations. |
read_brd |
Progressive, bounded reads of one BRD bundle. |
analyze_brd |
Source coverage, blocked flows, undeclared assumptions and risks, readiness, and backlog gaps — derived, never guessed. |
read_brd_history |
A bundle's revisions, element-level changes between two of them, and any document's text as a revision held it. |
The server speaks current MCP: every tool declares an output schema and returns structured content, tools carry accurate read-only/destructive/idempotent annotations, and the pull-or-continue decision uses MCP elicitation when the client supports it.
Role 3 — The human: reviews it
OKF is plain Markdown committed to Git, so it shows up in the pull request next to the code it describes. Review it there — no separate tool.
OctoEvidence already machine-checks the mechanical parts (format, frontmatter, citation digests against actual source lines, the no-code rule). Your job is the part a machine can't judge:
- Is the prose true? Does the card describe what the component actually does and owns?
- Are claims interpreted correctly? The cited lines are guaranteed to exist and match —
you confirm they mean what the claim says:
octoevidence component cite services/identity src/routes.ts --lines 18-18 - Did anything business-sensitive slip through?
When a document is correct, approve it by adding a verification event to its frontmatter:
verified:
- by: human:ahmed
at: 2026-08-02T10:00:00Z
Trust is derived, never authored: absent verified is unverified, non-human verifiers
are machine-confirmed, and a valid human:<id> event is human-reviewed. Claims
marked pending were written by a model and nobody has confirmed them — useful, not settled.
Documents past their stale_after date stay readable but are flagged stale until
regenerated or re-verified.
BRDs — a Word document you can actually work from
Business Requirement Documents get the same treatment as component knowledge, and then
some. The registry is one reserved folder at the repository root — okf/_brd/, one
subfolder per BRD:
okf/_brd/payments-refund-v2/
index.md # card (summary + keywords), approval, typed relations, overview
requirements.md # every requirement: id, kind, priority, readiness, and its full detail
flows.md # business flows, user journeys, system behaviour — with mermaid diagrams
dependencies.md # what each requirement leans on, including what nobody wrote down
assumptions.md # assumptions and constraints, marked declared or inferred
risks.md # the delivery risk register, with severity derived from the matrix
backlog.md # epics and user stories, from approved and ready requirements only
relations.md # the comparison analysis, section by section
log.md # session history
Drop a new Word document anywhere (committing it is optional) and prompt your agent:
Ingest docs/brds/NewFeature.docx as a BRD and tell me what already exists.
The tool extracts the document's text deterministically (agents can't read binary Word
files), digests it, and serves the existing BRD cards. Every judgment is the agent's, not
the tool's — what the text means, what duplicates or supersedes an earlier BRD, what
is already implemented-by a component, which dependency a requirement implies, whether a
requirement is ready. The agent writes those judgments down as registered elements with
stable ids; then analyze_brd does the arithmetic nobody should do by hand:
- Coverage. Every section of the source document that no element references, with its size — so a chapter nobody read cannot pass as a chapter with nothing in it.
- Blocking. A missing dependency is walked to the requirements that need it and on to the flows that run through them: FLW-002 cannot complete end to end — DEP-003, the card payment gateway the document never mentions, does not exist.
- Undeclared assumptions, constraints, and risks. The ones the agent inferred from the flows and the document's own sections never state — the list that goes back to the author, and the risks a project manager needs that the matrix missed.
- Readiness. Which requirements are too vague to become user stories, with the specific
gaps on each. A requirement marked
readywith no acceptance criteria, or one leaning on a dependency that does not exist, is a validation error rather than a plan. - Backlog gaps. Ready requirements with no story, epics with no stories, and stories written from requirements that are still under analysis.
octoevidence brd history <slug> turns Git into a traceable change log in the analyst's
vocabulary — REQ-014 dropped from must to should, REQ-021 was removed, DEP-003 flipped
from planned to missing — and hands back any document's exact earlier text so a change can
be reverted deliberately.
Back-references are derived at read time from forward links, so ingesting a new BRD never
edits an old one; a superseded BRD still reports its successor. If the source .docx
changes after distillation, the digest mismatch flags the bundle stale until re-ingested.
On repos where init detects Claude Code it also generates three subagents — one per pass:
octoevidence-brd-analyst records the document in full, octoevidence-brd-gap-analyst
finds what it never says, and octoevidence-brd-backlog plans from what it settled — so a
whole Word document never has to fit in your main session's context.
Staying in sync with your team
check_component_updates compares complete bundle contents across the working tree, the
merge base, and the configured branch:
| State | Meaning | Blocks citation authoring? |
|---|---|---|
in-sync |
Local and branch bundles match. | No |
local-only |
The branch has no bundle; local is authoritative. | No |
local-ahead |
Only the working tree changed. | No |
remote-only |
The branch introduced a component not present locally. | Yes |
remote-ahead |
Only the branch changed. | Yes |
diverged |
Both sides changed; the agent must merge deliberately. | Yes |
A missing branch or failed fetch fails closed. Pulling is deterministic transport of agent-authored content, never a merge: diverged components are refused, and local-only or local-ahead bundles are never touched.
CI and hooks
Both commands exit non-zero on failure, so they drop into any pipeline or pre-commit hook without JSON parsing:
octoevidence component check --fail-on-drift
octoevidence component validate --fail-on-error
Configuration — octoevidence.json
Committed at the repository root so the whole team shares one answer:
| Field | Meaning |
|---|---|
syncBranch |
Branch every agent compares against — remote-tracking (origin/main) or local (main, release/2.0). Repositories without a remote work out of the box. |
fetchEverySeconds |
Seconds between fetches. 0 fetches every check; -1 never fetches. Default 300. |
includeDirectories |
Directory names discovery would normally skip (packages, build, …) that this project keeps components in. |
CLI reference
Every command answers in JSON and accepts --directory <repository>.
| Command | Purpose |
|---|---|
octoevidence init [--declare <dir>]... [--sync-branch <branch>] |
Declare components, record the sync branch, install the agent instruction block. |
octoevidence doctor |
Status report: declarations, claims, validation warnings, sync state. |
octoevidence component list |
Declared components and what each one knows. |
octoevidence component find "<query>" [--limit N] |
Rank components for a request. |
octoevidence component check [--fail-on-drift] |
Three-way sync state; non-zero exit for hooks and CI. |
octoevidence component pull [component] |
Materialize branch bundles after the user chose to pull. |
octoevidence component prepare [all\|<component>] [--prompt "<goal>"] |
Everything an agent needs to fill bundles. |
octoevidence component validate [--fail-on-error] |
OKF v0.2 plus no-code profile validation. |
octoevidence component cite <component> <file> [--lines 42-60] |
Digest for a line range, plus the covered lines for review. |
octoevidence okf guide [section] |
The complete authoring contract, or one section (brd and brd-analysis cover BRD bundles). |
octoevidence brd ingest <document> |
Extract a Word BRD's outline and digest plus the existing inventory — the start of an ingest. |
octoevidence brd extract <document> [--section <id>]... |
Bounded extracted text from a .docx. |
octoevidence brd list |
BRD inventory with cards and derived reverse relations. |
octoevidence brd analyze [<brd>] |
Coverage, blocking dependencies, undeclared assumptions and risks, readiness, and backlog gaps. Exit 1 when a bundle has validation errors. |
octoevidence brd history <brd> [--from <rev>] [--to <rev>] [--restore <doc>]... |
Revisions, element-level changes, and a document's exact text at a revision. |
octoevidence hook stop |
Session-close referee for agent Stop hooks: exit 2 with feedback while validation fails, 1 on unreconciled drift. |
octoevidence mcp |
Run the stdio MCP server. |
What's new in 0.0.6
- BRD knowledge domain: the reserved
okf/_brd/registry turns Word BRDs into agent-authored, validated, Git-synchronized knowledge — see the BRDs section above. Deterministic BCL-only.docxextraction (brd ingest,brd extract,brd list), typed relations with derived reverse links, and source-digest drift detection. Design record:docs/adr/0002-add-brd-knowledge-domain.md. - BRD analysis registers: a bundle now carries
requirements.md,flows.md,dependencies.md,assumptions.md,risks.md, andbacklog.md— typed elements with stable ids, the source sections each was distilled from, and the full detail behind each in the body.analyze_brd/brd analyzederives source coverage, the blocking closure over missing dependencies, undeclared assumptions, constraints and risks, readiness, and backlog gaps.read_brd_history/brd historyreports element-level changes between revisions and restores a document's earlier text. Mermaid diagrams are the one carve-out in the no-code profile, permitted inside BRD bundles only.initnow generates three Claude Code subagents, one per pass. Design record:docs/adr/0003-brd-analysis-registers.md.
What's new in 0.0.4
- Derived-data cache: routing cards, claim verification, and validation reports are cached process-wide, keyed by fingerprints of every file each computation consulted — bundle documents, cited sources, and link targets. Repeated MCP calls re-stat instead of re-reading and re-hashing, and one verification pass reads each cited source file once however many claims cite it. Git stays the only source of truth: the cache holds nothing that cannot be recomputed, and one-shot CLI runs always compute fresh.
- Leaner reads:
read_componentreturns document bodies by default — claims arrive structurally, now including broken citations flaggedcitationBrokeninstead of hidden. Averbatimread returns exact file text for editing and merges. The response budget is 64 KiB, and a single oversized document is truncated and flagged instead of failing. - Less duplication:
prepare_okf_fillpoints atokf_authoring_guideinstead of inlining three of its sections into every fill session. - Agent integration:
initgenerates theoctoevidenceworkflow skill (the SKILL.md standard) for detected Claude Code and Codex installs, and wires a Claude Code Stop hook — the newoctoevidence hook stopblocks session handoff with actionable feedback while OKF validation fails, and warns without blocking on unreconciled drift.
Development
dotnet restore OctoEvidence.slnx
dotnet test OctoEvidence.slnx
dotnet pack src/OctoEvidence.Cli/OctoEvidence.Cli.csproj --configuration Release
The tests exercise real temporary Git repositories and run on Windows and Linux in CI.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.18 | 171 | 8/27/2026 |
| 0.0.17 | 120 | 8/27/2026 |
| 0.0.16 | 131 | 8/26/2026 |
| 0.0.15 | 135 | 8/26/2026 |
| 0.0.14 | 130 | 8/25/2026 |
| 0.0.13 | 139 | 8/23/2026 |
| 0.0.12 | 124 | 8/21/2026 |
| 0.0.11 | 135 | 8/21/2026 |
| 0.0.10 | 137 | 8/21/2026 |
| 0.0.9 | 137 | 8/20/2026 |
| 0.0.8 | 133 | 8/19/2026 |
| 0.0.7 | 139 | 8/18/2026 |
| 0.0.6 | 148 | 8/17/2026 |
| 0.0.5 | 156 | 8/16/2026 |
| 0.0.4 | 125 | 8/7/2026 |
| 0.0.3 | 151 | 8/2/2026 |
| 0.0.2 | 155 | 8/2/2026 |
| 0.0.1 | 158 | 7/23/2026 |
- BRD knowledge domain: the reserved `okf/_brd/` registry at the repository root holds one agent-authored bundle per Business Requirement Document. A registry-only root okf/ declares no component; a `_brd` inside any other bundle is a validation error.
- Deterministic Word extraction: `brd ingest` and `brd extract` read a .docx with the BCL zip/XML readers only — headings, paragraphs, lists, and tables become an ordered section model with a whole-file digest; headers, footers, comments, and media are ignored. No new dependencies.
- Comparison stays agent work: the tool never ranks or scores BRD similarity. Ingestion returns the outline, digest, and the existing BRD cards; the host agent judges duplicates, overlaps, extensions, and supersession, and authors index.md (typed relations) plus relations.md (the analysis).
- Derived reverse relations: forward links in frontmatter are the only stored truth; supersededBy and friends are computed at read time, so ingesting a new BRD never edits a historical one.
- Source drift: a BRD records its document's path and digest; changed bytes flag the bundle stale, an absent file only warns.
- New MCP tools prepare_brd_ingest, read_brd_source, list_brds, and read_brd; validate_okf, check/pull, doctor, and `hook stop` cover BRD bundles; each `_brd/<slug>` is its own three-way sync unit.
- BRD registers: a bundle now carries requirements.md, flows.md, dependencies.md, assumptions.md, risks.md, and backlog.md — typed elements with stable ids (REQ/FLW/DEP/ASM/CON/RSK/EPC/STY), the source section ids each was distilled from, and the full detail behind each under a heading named for its id. Validation covers the schema, referential integrity across registers, and the consequences of the agent's own judgments: a ready requirement needs acceptance criteria and an unblocked dependency, and a user story may only be written from a ready requirement.
- New `analyze_brd` / `brd analyze`: source coverage with every section nobody recorded, the blocking closure that walks a missing dependency to the flows it stops end to end, the assumptions, constraints, and risks the document never declares, everything too vague for a user story with its gaps, and backlog coverage — all derived, never inferred.
- New `read_brd_history` / `brd history`: a bundle's revisions, the element-level difference between two of them with each field's old and new value, and any document's exact text at a revision so a change can be reverted by an authored write.
- Mermaid diagrams are the one carve-out in the no-code profile, permitted inside BRD bundles only and checked to be real diagrams, so business flows and user journeys can carry their flowcharts.
- Agent integration: init generates three Claude Code subagents, one per pass — octoevidence-brd-analyst records the document in full, octoevidence-brd-gap-analyst finds what it never says, octoevidence-brd-backlog plans from what it settled — and the authoring guide gains a `brd-analysis` section carrying the method.