Skip to content
OKF Claude OKF repo kit

Claude Code · Open Knowledge Format

Keep goal-directed Claude Code work reviewable in Git.

The kit packages the setup you would otherwise assemble by hand to run goal-driven development with Claude Code: an owner-defined outcome becomes verified milestones, behavior specifications, proposed architecture decisions, and a progress log that change with the code.

Why it exists. Claude Code is the agentic coding tool — Claude directing its own tools in a loop. The kit isn’t another agent or tool; it’s the memory, skills, hooks, and knowledge that give that loop a goal, guardrails, and a reviewable record in the repository’s shared history.

The baseline

Claude Code can already pursue a goal — just not in a way the repo remembers.

Claude Code carries knowledge between sessions, but not as a versioned, reviewable part of the repository. The kit is what makes it that.

Built in

Ephemeral by design

The built-in /goal command keeps a session working toward a completion condition, and auto memory carries notes across sessions. But /goal is session-scoped and clears once met, and auto memory is machine-local and unversioned — neither becomes part of the repository a teammate reviews in a diff.

The kit

The versioned complement

It places the owner-approved goal, ordered milestones, behavior specifications, architecture decisions, progress log, and source mappings in version control — so the objective and the decisions that reached it outlive the session that created them, and a fresh session can pick them up while a reviewer reads them in an ordinary diff.

What the kit adds

A defined operating contract around the coding session.

The contract says who owns the outcome, how Claude chooses work, where behavior and decisions are recorded, and what must be reviewed.

Owner-controlled

A goal with boundaries

The owner confirms the problem, target state, success criteria, non-goals, fixed constraints, and milestone order.

Agentic

A verified agent loop

“Continue” runs Claude Code’s agent loop over the backlog: Claude takes the first unfinished milestone, reads its governing context, edits code, and runs the tests — using that environmental feedback as ground truth for whether the milestone is done. It runs a first-time-user acceptance pass before declaring the goal met, and resumes in-flight work after an interrupted session.

Kept with the code

Behavior specifications

Claude authors or updates the governing specification when behavior changes. The source map connects code areas to the contracts that describe them.

Returned for review

Proposed architecture decisions

Dependencies, persistence, APIs, security boundaries, deployment, and similar choices begin as ADRs Claude writes itself, marked proposed. The owner accepts, revises, or rejects them.

See how a session actually runs, step by step ↗

The loop

From goal to done — in order, on the record.

You define the goal. From it, Claude Code drafts an ordered milestone backlog for you to confirm, then works the milestones one at a time — reading the specs and ADRs that govern each area before it edits, proposing an ADR whenever a change is decision-shaped, and writing or updating the behavior spec whenever behavior moves. Every milestone is verified and logged before the next begins.

The kit's goal-to-done loop The owner defines the goal; Claude Code drafts ordered milestones, then loops per milestone — read the governing specs and ADRs, implement and verify, update specs and propose ADRs, log and check off — repeating until the backlog is empty, then runs an acceptance pass and reports the goal met with proposed ADRs listed for review. next milestone The goal you define it, and confirm it Ordered milestones Claude drafts them from the goal Read specs + ADRs the knowledge governing the change Implement + verify smallest change, then run the tests Specs + ADRs Claude writes them; you review Log + check off the milestone is done Acceptance pass when the backlog is empty Goal met ADRs await your review
Authorship

You own the goal; Claude authors the rest

Claude drafts the milestones, writes the specs, and writes the ADRs as proposals. You own the goal and confirm the milestones, and you accept, revise, or reject each proposed ADR.

Context window

Kept in the repo, not the context window

A Claude Code session opens with a fresh, limited context window. The kit keeps the goal, milestones, specs, ADRs, and log in git and preloads only the goal and the spec and ADR indexes at session start — the rest is read from disk on demand, so the record survives every context reset.

What the kit installs

The contract is a handful of files in the repository.

The knowledge bundle follows the Open Knowledge Format, an open spec for project knowledge that travels with the code. It rides Claude Code’s own extension points — project memory, skills, and hooks — so the kit is configuration, not a separate engine, and nothing here is hidden state: it is committed, diffable, and reviewed like source.

CLAUDE.md

Project instructions

Holds the goal, rules, workflow, and verification commands. Its imports preload the goal and the spec and ADR indexes at session start, so Claude begins already knowing the project.

docs/GOAL.md

The goal and backlog

States the problem, target state, success criteria, and an ordered milestone backlog that Claude iterates toward across sessions.

docs/specs · docs/adr

Specs and decisions

Behavior contracts to preserve and architecture decisions to follow, versioned beside the code they govern. These paths are the defaults — a repo that already keeps specs or ADRs elsewhere points the kit at them with a small layout block in the source map, and nothing gets moved.

docs/okf-map.yml

The source map

Maps source areas to the specs and ADRs that govern them, so Claude reads the right knowledge before editing and stale mappings can be caught.

.claude/hooks · scripts/okf

Guardrails and checks

A stop hook catches code changes with no matching docs update; a session-start hook reports version drift and pending decisions. Local helper commands find stale mappings, draft specs, and suggest ADRs.

.claude/skills/okf-*

Workflow skills

Six skills load on demand — goal interview, acceptance pass, ADR review, kit upgrade, a guided adoption pass for existing repositories, and a guided port for adding a second agent — with binding one-liners kept in CLAUDE.md for when a skill does not load.

What is verified

The mechanics are real. Judgment stays reviewable.

The kit has two layers, in Anthropic’s terms: deterministic hooks that run as fixed code paths, and the agentic work Claude does with judgment. The test suite covers the first; the content of a specification or decision is the second, and still needs technical review.

Yes

Goal-directed

The installed CLAUDE.md and on-demand skills preload the goal and tell Claude how to select, verify, and close milestones across sessions.

Qualified

Claude-authored specs

Claude is instructed to write and maintain specs. The kit supplies structure and checks for stale mappings; it does not prove that a contract is complete or correct.

Qualified

Claude-authored ADRs

Decision-shaped work starts with a proposed ADR. The kit can suggest and scaffold it; Claude fills the reasoning and the owner makes the decision.

Mechanical

Documentation sync

A stop-time hook can prevent a turn from ending when code changed without a documentation update. A mapped spec, ADR, or dated rationale satisfies the check.

Within those layers, the division of labor is deliberate. Hooks carry what must never be skipped: they run as fixed code paths at session start and stop, whether or not anyone remembers them. The scripts/okf helper carries what must never vary: numbering, index entries, and staleness are computed in code, so Claude runs one command instead of re-deriving the mechanics each session and spends its judgment — and its context window — on the content of the work. Preloaded indexes carry what every session must know. When a mechanism misfires in a real repository, the helper declines visibly rather than guessing, Claude works around it in the open, and the friction is carried back into the kit — that is the dogfood record, not a failure mode.

The enforcement boundary matters. The hooks verify that expected files changed and mappings remain current. They cannot judge the quality of the reasoning. Test discipline, security rules, and consent rules remain instructions unless the target repository enforces them through CI, permissions, or branch protection.

Adopting the kit

Start from the repository you have.

The kit has separate paths for a new repository and a repository with existing code, documentation, and agent settings.

New repository

Begin with the goal

The new-repository path creates the project instructions, goal template, knowledge bundle, source map, hooks, and local helper.

  1. Apply the kit to an empty repository. The starter structure and guardrails are created together.
  2. Open the repository in Claude Code. The project instructions and goal template load with the session.
  3. Answer the goal interview: who the software is for, what done means, realistic inputs, verification, non-goals, fixed choices, and the first useful slice.
  4. Review and confirm the drafted goal, milestones, and project instructions.
  5. Give Claude a specific task or ask it to continue. Claude takes the first unfinished milestone and works through its verification.
  6. Review proposed ADRs and the final acceptance report. Commit code, specifications, decisions, and progress together.
Existing repository

Add the contract carefully

The existing-repository path preserves current files, merges compatible settings, and writes review candidates when names or locally edited kit files conflict. After the updater, the installed adoption skill carries a guided pass: inventory the existing knowledge in place, map it to the source it governs, backfill missing specs, and validate before the loop starts.

  1. Apply the safe updater to the repository. Existing project files and documentation stay in place.
  2. Review the generated candidates. Merge the pieces that fit the repository and keep project-specific instructions intact.
  3. Open the repository in Claude Code. Claude proposes the goal, verification commands, and constraints from the codebase; correct and confirm them.
  4. Map important source areas to existing specs and ADRs. Add missing contracts gradually as work reaches those areas.
  5. Choose a current change or an agreed milestone. Claude reads the mapped knowledge before editing and records the result with the code.
  6. Review proposed ADRs and any update candidates. When the kit reports a newer version, repeat the safe update and review the differences.

Stack templates

The kit carries the process. A stack template carries the toolchain.

The kit stays deliberately stack-agnostic: it installs the operating contract and nothing about any language, and the goal loop builds a stack from an empty repository perfectly well on its own. A stack template is an optional accelerator, not a requirement — when you build the same kind of project often, it saves re-deriving a toolchain you already trust. Those repeating decisions — packaging, quality gates, CI — belong in a separate template repository that layers under the kit, so neither release cadence pollutes the other.

The layering

Template first, kit on top

A stack template is a minimal working project — a walking skeleton that passes its own quality gate in its own CI, so it cannot rot silently the way a bag of file stubs does. When you choose to use one, creating a project means starting from the template, renaming it, then running the kit's existing-repository installer over the result. The kit needs no changes to compose this way: layering onto whatever exists is what the brownfield path already does — the same path an ordinary existing repository takes.

Being built next

First template: Python CLI

The first stack template covers Python command-line tools, seeded from the proven chassis of the Spec Agent CLI dogfood repository: zero-runtime-dependency packaging with optional extras, ruff and strict mypy, pytest with a branch-coverage floor, repo-health tests that guard the repository itself, and a CI matrix across supported Pythons — decisions with their ADR reasoning attached, not just files. Spec Agent CLI itself stays what it is: the kit's dogfood exhibit and the template's one-time seed.

Where the approach helps

The value grows with the life of the repository.

The method earns its cost when work spans sessions, decisions carry consequences, or several people and agents need the same project record.

Longer work

Reliable restarts

Milestones, logs, and accepted decisions give a fresh session a reliable restart point.

Decision-heavy

Visible architecture

Architecture choices remain visible with their context, consequences, and revisit conditions.

Shared repos

One project record

People and agents can review the same goal, contracts, and pending decisions through ordinary version control.

Governed delivery

Fewer silent changes

Owner boundaries, verification rules, and explicit review points reduce silent changes to scope and architecture.

The evidence is still early. The source-kit tests validate the mechanisms, and the dogfood repositories provide concrete findings. They do not establish a measured improvement in delivery time, defects, or maintenance cost. A small one-session change may cost less to handle directly.

Evidence from use

The kit changes when real repositories find a weak spot.

Spec Agent CLI, Repo Pulse, Skywatch, and an AWS alerting service exercised different repository shapes — greenfield, scheduled multi-service, and two kinds of brownfield. Their findings changed the kit’s goal interview, acceptance pass, hooks, source mapping, upgrade policy, review loop, and brownfield adoption path.

01 · Dogfood record

What the repositories taught the kit

Each use case, the weakness it exposed, and the change carried back into the source kit.

02 · Source

Read the repository

The goal, specifications, decision records, templates, tests, and change log are public.