Getting Started#
Start by saving and reading back one local note through the Knowledge Kit's store
API. This uses the published 9.1.1 package, Node.js 22 or newer, npm, and a
writable directory. It needs no model credentials or provider calls. A coding
agent is needed later to use the installed Claude Code hooks; this first task
runs directly in Node and does not qualify live host enforcement.
Save your first note#
Create a new disposable directory and install the Claude Code workspace bundle with the Knowledge Kit selected:
mkdir flow-agents-first-note
cd flow-agents-first-note
flow_agents() (
tool_root=$(mktemp -d) || exit 1
trap 'rm -rf "$tool_root"' EXIT HUP INT TERM
npm exec --yes --prefix "$tool_root" \
--package=@kontourai/flow-agents@9.1.1 -- flow-agents "$@"
)
flow_agents init --runtime claude-code --dest . \
--activate-kit knowledge --telemetry-sink local-files --yes
The isolated npm prefix keeps a repository-local package from intercepting this
versioned command. The installer prints the selected runtime, destination and
local-files telemetry pin. Explicit --telemetry-sink local-files ignores
operator Console configs; TELEMETRY_CONFIG_FILE can still override it, and a
separately enabled OTLP bridge is outside this pin. See the full
telemetry resolution rules. This is not a
network-isolation setting. Source changes newer than 9.1.1 validate telemetry
configuration for every install; that additional validation is not claimed for
this pinned release.
Save a note using the installed store API:
node --input-type=module <<'JS'
import DefaultKnowledgeStore from './kits/knowledge/adapters/default-store/index.js';
const store = new DefaultKnowledgeStore({ storeRoot: './knowledge-demo' });
const id = await store.create({
type: 'raw',
title: 'Upgrade reminder',
body: 'Read the release notes before upgrading.',
category: 'quickstart',
provenance: { agent: 'quickstart-cli', note: 'Local text entered in this example.' }
});
const saved = await store.get(id);
console.log(JSON.stringify({ id, type: saved.type, body: saved.body,
agent: saved.provenance.agent }, null, 2));
JS
Expect a generated id, type: "raw", the same body, and
agent: "quickstart-cli". The record is saved at
knowledge-demo/records/<id>.md; its graph index is in
knowledge-demo/graph-index.json. The agent label identifies this example's
calling process; it is supplied by the caller and is not authenticated identity
or independent review. Saving the note records text and provenance, not its truth.
Each execution creates a new record. Keep the returned id to read it again with
get(id) rather than creating a duplicate.
Recovery: if create refuses with MISSING_EVIDENCE for a missing
provenance.agent, it has not created that record. Supply the actual calling
process label and retry the rejected input. Do not remove provenance enforcement
or edit a stored record to bypass it. For a missing adapter file, confirm the
install above completed in this directory before running Node.
This completes a local capture and read-back, not a gated software delivery.
For a small code change, use your repository's normal implementation, meaningful
checks and separate review; report unresolved gaps. To add a stateful delivery
workflow, select the optional Builder Kit below. builder.build-lean is an
ablation experiment, not a small-task shortcut.
Other installs, provider setup, host layouts and completion checks
1. Install#
For a different workspace or runtime, use the version-pinned flow_agents
helper above with init --runtime <your-agent> --dest /path/to/workspace.
Supported runtime names are claude-code, codex, kiro, opencode, and pi;
completion behavior differs as described below. Use --activate-kit builder
to declare a Builder selection, or --activate-kits for every catalog kit.
Defaults differ by runtime: without an explicit selection, Claude Code installs
built-in kit skills and records every catalog kit as active; other runtimes
record no active catalog kits by default. An explicit selection does not make
Claude Code's unconditional built-in skill copying selective.
To configure provider-backed Builder work at the same time, add
--configure-providers --online. This detects the repository, verifies GitHub
CLI access, and writes coherent backlog, assignment, and change-provider
settings. For non-interactive offline setup, provide
--provider-project NUMBER; remote state remains explicitly unverified until
you run the printed gh checks.
The installer copies agents, skills, context contracts, hook scripts, Kit assets, and the Flow Agents telemetry descriptor into the workspace. Kit activation follows the runtime defaults and explicit selection described above. Start a new host session and complete its trust setup; copying files does not establish that the host loaded them.
For a normal Codex global install, target the Codex home instead of a project workspace:
flow_agents init --runtime codex --global --activate-kit builder --yes
That splits installation by ownership: Codex-only runtime assets go into CODEX_HOME when set (otherwise ~/.codex), while portable skills go into Codex's documented user catalog at $HOME/.agents/skills. A repository bundle install similarly exposes skills at <repo>/.agents/skills.
For OpenCode, a global install targets ${XDG_CONFIG_HOME:-$HOME/.config}/opencode and keeps the candidate workspace clean:
flow_agents init --runtime opencode --global --activate-kit builder --yes
The installer additively merges opencode.json, syncs the Flow Agents plugin and agents, and exposes core skills plus the selected kits and their transitive dependencies. Runtime support and a SHA-256 managed-file manifest live under .flow-agents/; unrelated user plugins, agents, skills, and config entries remain user-owned. The manifest includes a secret-free Conduit receipt (asset IDs, kinds, and digests only) for the plugin, agents, and skills.
GNU Stow layouts are supported when opencode.json is a symlink to its canonical regular-file target and an immediately nested managed asset directory (plugins, agents, or skills) is a symlink contained by that config target's backing directory. The backing directory must be owned by the current user and must not be group- or world-writable. The installer atomically updates the config target without replacing either link, preserves an existing config file's mode, and creates a new config with mode 0600. It rejects nested links, file links, unbound directories, and targets outside that backing directory. These path-based checks protect owner-controlled Stow state and fail closed on the state observed before each mutation; they are not an openat-style security boundary against a concurrent process that can rewrite the same directories. To migrate from an older incomplete global OpenCode install, upgrade Flow Agents and re-run this command. There is no compatibility path for stamp-only experimental installs.
Pass a positional runtime destination and --skills-dir PATH when both roots must be isolated, or set FLOW_AGENTS_SKILLS_DIR for headless environments:
bash scripts/install-codex-home.sh /tmp/codex-home --skills-dir /tmp/agents/skills
Installer output reports both destinations. Reinstall preserves unknown user skills and migrates only unchanged Flow Agents-owned files from the former CODEX_HOME/skills layout; modified legacy content is retained. Flow Agents intentionally does not create a compatibility symlink because the Codex runtime home must not own or mask a universal user catalog, and the installer refuses to write through symlinked destinations.
Keep generated Codex base config lean. Put profile-specific model, provider, and approval settings in separate <profile>.config.toml files and select them with codex --profile <name>.
What lands in the workspace:
context/— shared contracts the agent follows, at the workspace root regardless of runtime- Agent and skill definitions, in a runtime-specific location:
.claude/agents/+.claude/skills/for Claude Code,.codex/agents/+.agents/skills/for Codex, top-levelagents/+skills/for Kiro,.opencode/agents/+.opencode/skills/for opencode, and.pi/skills/for pi scripts/hooks/— four canonical policy scripts (steering, quality gate, stop-goal-fit, config protection) wired to the host's native hook surfacekits/— catalog assets; activation defaults and installed skills differ by runtime as described aboveconsole.telemetry.json— telemetry descriptor (writes locally by default)
Completion checks by runtime#
Installing hook files does not prove that a running agent loaded or executed them. Start a new session with the installed configuration and complete any host-required hook trust setup. Conformance levels describe supported policy behavior; they do not determine the installed enforcement mode.
| Runtime | Shipped completion check | Configuration and limits |
|---|---|---|
| Claude Code | Stop hook with FLOW_AGENTS_GOAL_FIT_MODE=block as its default |
Can block completion on qualifying evidence gaps once the host loads the hooks. |
| Codex | Stop hook with the same block default |
Requires the host to load and trust the installed hooks; files in a destination alone do not establish live enforcement. |
| Kiro | stop hook on the shipped dev agent, enabled in the standard and strict hook profiles |
Does not inject a blocking mode default. With no committed policy or environment override, the engine uses warn. Set FLOW_AGENTS_GOAL_FIT_MODE=block in the agent's environment to request blocking; selecting strict alone does not set that mode. |
| opencode | Calls stop-goal-fit at session.idle |
Advisory for completion: the generated plugin does not act on the returned stop decision. Setting block does not make this callback prevent completion. |
| pi | No native Stop trigger; calls stop-goal-fit at session_shutdown |
The shutdown callback does not act on the returned decision and cannot serve as a blocking completion check. |
FLOW_AGENTS_GOAL_FIT_MODE accepts block, warn, or off. In development, an explicit value overrides the Claude Code/Codex default. With NODE_ENV=production or prod, environment overrides cannot weaken committed goal-fit policy in .flow-agents/config/core.config.json. Hook profile and disable settings also affect whether a check runs.
Even in blocking mode, stop-goal-fit checks recorded workflow state and evidence; it is not a guarantee that every incomplete task is caught. Bounded retry and escalation behavior can end a turn with unresolved gaps. See the Runtime Hook Surface spec for policy resolution and limits. Repository-required CI checks remain a separate boundary.
2. What the Builder Kit gives you#
Builder is optional. Activate it in an existing workspace with
flow_agents init --runtime claude-code --dest . --activate-kit builder --telemetry-sink local-files --yes.
The current manifest declares the following catalog;
builder.shape and builder.build are the starter pair, not the complete list:
| Flow | ID | What it does |
|---|---|---|
| Shape | builder.shape |
Turns a raw idea into slices and executable work items |
| Build | builder.build |
Takes a ready work item through design probe → plan → execute → verify → PR → merge readiness → learn |
| Review existing | builder.review-existing |
Review and verify an existing exact commit; no implementation or merge step. A changed head needs a new run. |
| Deliver existing | builder.deliver-existing |
Review, verify and deliver an existing open same-repository PR at its pinned head; no retroactive implementation claim. |
| Publish and learn | builder.publish-learn |
Reusable publication, CI readiness and learning extension. |
| Publish existing | builder.publish-existing |
Closeout extension that adopts an existing PR at the pinned head. |
| Gate-value ablation | builder.build-lean |
Experiment only. Removes gates together with demanded design-probe and planning work; enforces less than builder.build. Never a delivery substitute. |
These are not freeform chat sessions. Each flow has evidence gates — named checkpoints that expect specific claims before the next step starts. Flow evaluates those expectations when a transition is requested. Whether the host can also prevent the agent from ending its turn depends on the completion-check wiring and configuration above.
Shape flow gates (builder.shape):
shape-gate— problem, outcome, constraints, non-goals, success criteria, and risk are statedbreakdown-gate— work is split into independently useful slicesfile-issues-gate— each slice becomes a filed work item with enough context to pull later
Build flow gates (builder.build):
pull-work-gate— a ready work item is selected with scope and acceptance contextdesign-probe-gate— goal fit, blockers, dependencies, and planning readiness are recorded before a plan is writtenplan-gate— the plan names files, changes, acceptance evidence, and sequencingexecute-gate— changed files are recorded and unrelated work is excludedverify-gate— tests or checks have evidence tied to the implementation (up to 3 route-back attempts before blocking)merge-ready-gate— scope, evidence, and residual risks support a merge-ready decisionpr-open-gate— a pull request exists with linked work and verification evidencemerge-ready-ci-gate— CI and review status support mergelearn-gate— decisions and delivery learnings are recorded for future work
The gate semantics live in Kontour Flow; Flow Agents compiles them to whatever hook surface your agent exposes.
3. Optional Builder walkthrough#
Step 1 — Shape an idea#
In your coding agent, paste this:
Use Builder Kit shape. I want to add a progress indicator to the CLI output so
users can see what step the installer is on. Keep it simple — just a step count
like "[2/5] Copying agents". Shape this into an executable work item and stop
at the backlog gate.
The prompt asks the agent to run the builder-shape / idea-to-backlog skill, which:
- inventories the idea and classifies it
- proposes the thinnest meaningful slice (the step counter) and names what is out of scope
- drafts a shaped work item with a stated outcome, non-goals, acceptance criteria, and a verification expectation
- presents the breakdown for confirmation before creating provider-backed work items
You will see the agent write a local artifact at .kontourai/flow-agents/<slug>/<slug>--idea-to-backlog.md. That artifact is the machine-readable input to the next stage — not a summary in the chat window.
To continue and file the GitHub issue:
That looks right. File the GitHub issue and stop.
The agent runs the file-issues step, checks the file-issues-gate, and stops. You now have a shaped, filed work item that the build flow can pull.
Step 2 — Build that work item#
Use deliver for the issue you just filed. Pull it, probe the design, plan it,
implement it, review it, verify it, and stop if any evidence is missing.
The deliver skill orchestrates the full builder.build flow:
- pull-work — selects the issue, confirms scope and acceptance criteria (
pull-work-gate) - design-probe — checks goal fit, identifies blockers and dependencies, and records planning readiness before touching a file (
design-probe-gate) - plan-work — delegates to
tool-planner, which writes a structured plan artifact naming files, changes, sequencing, and acceptance evidence (plan-gate) - execute-plan — delegates plan-scoped work to
tool-workersubagents, running independent tasks concurrently when file ownership and dependencies permit; there is no fixed worker count (execute-gate) - review-work — code and optional security review recorded in the
trust.bundlecritique slice - verify-work — tests and checks with evidence tied to the change; if evidence is missing the verify-gate triggers a route-back (
verify-gate) - evidence-gate — scope, evidence, and risk assessment (
merge-ready-gate) - publish-change operation — create or update the provider change record with
linked work and verification evidence (
pr-open-gate); this step uses an operation, not apull-requestskill - release-readiness — assess provider/CI merge readiness for that change
(
merge-ready-ci-gate) - learning and workspace closeout — route durable follow-up, retain open changes for review, and reclaim only clean linked worktrees whose exact head is freshly confirmed merged
You can also invoke each skill individually if you want explicit control:
Use pull-work to select issue #42.
Use plan-work on the session artifact from the pull-work step.
Use verify-work on the current branch and report what evidence is present.
What you observe#
- Inspect the session records under
.kontourai/flow-agents/<slug>/:state.jsontracks workflow control,acceptance.jsonholds the acceptance definition, andhandoff.jsoncarries continuation context. Review and verification records belong intrust.bundleslices, includingcritique,acceptance-criteria,tests-evidence, andpolicy-compliance. The active step's public operations update the relevant records; every file is not rewritten at every step. Retained records support later resumption. Legacycritique.jsonandevidence.jsonare retired sidecars, not the current evidence outputs. - At each requested transition, Flow evaluates the recorded evidence expectations and reports missing evidence or a route-back. This does not establish the truth of the supplied evidence.
- The stop-goal-fit hook, when loaded and configured to block on a host that supports it, can refuse completion for qualifying evidence gaps. Check the runtime table above; warning-only and shutdown callbacks do not provide the same completion control.
- If verify fails,
verify-gateroutes missing evidence and the default failure class back toverify, implementation defects toexecute, plan gaps toplan, and decision gaps todesign-probe. The route-back budget is three attempts; exceeding it blocks the run.
This is guided, not fully automated. The agent handles the mechanics; you make product decisions. Gates are explicit handoff points, not invisible checkboxes.
4. Inspect what you installed#
After installing, you can inspect the Builder Kit's declared contents:
flow_agents kit inspect kits/builder --json
This prints a JSON object with the kit id, name, conformance levels (k0/k1/k2), declared targets, and any third-party extensions — for example:
{
"kit_id": "builder",
"kit_name": "Builder Kit",
"conformance": { "k0": true, "k1": true, "k2": false },
"targets": ["flow", "flow-agents"],
"third_party_extensions": [],
"trust": "unverified"
}
It does not require a running agent or active session.
To see the raw flow definitions with their gate expectations:
cat kits/builder/flows/shape.flow.json
cat kits/builder/flows/build.flow.json
5. Verify your setup#
The note read-back above checks that the installed store API works locally. For the kit's own adapter contract checks, run its existing suite from the installed workspace (no build or project dependency installation is needed):
node --test kits/knowledge/evals/contract-suite/suite.test.js
For contributors in the Flow Agents source checkout, npm run validate:source
and npm run eval:static validate source and generated bundles. They are not
consumer-workspace setup commands and do not prove a host loaded its hooks.
What to read next#
- Workflow Usage Guide — example prompts and expected behavior for every skill and stage
- Agent System Guidebook — how the pieces fit together conceptually
- Kit Authoring Guide — author your own Flow Kit from scratch
- Runtime Hook Surface spec — hook events, conformance levels, and host gaps
- Workflow Artifact Lifecycle — when to promote local artifacts to durable docs