BF — evidence-gated work loop CLI for LLM orchestrators.
BF turns a fuzzy user request into a locked contract (bf.md + per-task spec.md), then drives execution through a next → do → review → verify loop until every Acceptance Criterion is signed off by a reviewer subagent that is not the same subagent instance that did the work.
This package ships the BF core: the CLI (bf, bf-harness), the entry skill (SKILL.md), Core roles, the engineering pack, file templates, and phase references.
npm install -g @codetreker/bfRequires Node.js ≥ 20. Install globally (-g) so the bf and bf-harness CLIs land on $PATH — that is the only supported install mode. Local installs (--save-dev) put the CLIs in node_modules/.bin/ only and break shell invocations from subagent commands.
npm install also runs a postinstall step that copies a host discovery snapshot (SKILL.md, roles/, packs/, templates/, references/) for detected LLM hosts. Claude Code uses ~/.claude/skills/bf/; Codex uses ~/.agents/skills/bf/. Re-run manually anytime with bf install.
bf install auto-detects supported targets. Use --target to install one explicitly:
bf install --target claude
bf install --target codexnpm (≥ v7) does not run lifecycle scripts on npm uninstall, so removing the package does not clean up host discovery snapshots automatically. To remove them, run:
bf uninstall # before npm uninstall, while the CLI is still on $PATH
npm uninstall -g @codetreker/bfbf uninstall auto-detects supported targets. Use bf uninstall --target claude or bf uninstall --target codex for one target.
BF looks for additional roles and packs in host-neutral extensions/ directories. Drop .md files in role dirs or full pack directories, and BF will pick them up automatically.
| Location | When to use |
|---|---|
~/.bf/extensions/roles/<name>.md |
A custom role you want available across every project |
~/.bf/extensions/packs/<id>/pack.md |
A custom pack available globally |
<project-root>/.bf/extensions/roles/<name>.md |
A role only this project should see |
<project-root>/.bf/extensions/packs/<id>/pack.md |
A pack only this project should see |
Precedence (highest wins): project extension → global extension → selected pack-private role → Core role. So a project-local engineer.md overrides anything else with that id.
Host discovery snapshots are generated copies. Do not put extensions under ~/.claude/skills/bf/ or ~/.agents/skills/bf/; BF does not read those locations.
bf list-roles [--pack <id>] and bf list-packs show extension entries alongside Core ones, with a source: "extension" field so you can tell where each came from. bf list-pipelines [--pack <id>] lists pipeline ids, descriptions, and file paths for the effective pack registry.
After install, two CLIs are on $PATH:
bf— read-only metadata + install management:bf list-packs,bf list-pipelines [--pack <id>],bf list-roles [--pack <id>],bf install,bf uninstall,bf versionbf-harness— state-mutating loop driver:lint,start-review,accept,next,verify,discard,list
Run either with --help for full usage.
brainstorm → spec ──accept──▶ execute ──verify──▶ Completed
▲ │
└──── lint / verify FAIL ───┘
- Brainstorm — drive a discussion with the user, pick a pack, write
discussion.md. - Spec — author
bf.md+ per-taskspec.mdinDraft,lint, run a Spec Review round,verify, thenaccept. Contract is locked. - Execute —
nextclaims one ready task and returns its pipeline; subagents follow the pipeline instructions; a different reviewer subagent grades the final task AC; Task Verification flips its AC on SUCCESS. Repeat. Final Acceptance flips the bf.md AC and marks the work Completed.
BF stores all work-in-progress state at <cwd>/.bf/<bf-wo>/. Add .bf/ to your .gitignore. Override the location with the BF_HOME env var (mostly useful for tests).
<project-root>/
.bf/
<bf-wo>/
bf.md
discussion.md
runs/reviews/round_N/
result_<role>_<idx>.md
verify-result.md
<task-id>/
spec.md
runs/reviews/round_N/...
The harness cannot see subagent identity (review filenames are role-level). IV is enforced only by the orchestrator when spawning subagents:
- For any given task, the doer and any reviewer must be different subagent instances.
- Same
roleon both sides is fine (e.g.engineerdoer + a separateengineerreviewer). - Same subagent instance on both sides is a contract violation the harness will not catch.
SKILL.md— entry doc for the orchestrating LLM (high-level contract + IV red line).references/brainstorm.md— drive the discussion, pick a pack.references/spec-authoring.md— author specs, design any bf-wo local pipelines, lint, Spec Review, accept.references/execution.md—next → do → review → verifyloop.templates/— frozen file shapes; copy these when authoring.roles/,packs/— Core roles and installed packs.
MIT