run-ledger
Skill1 starsChanged 18 days agoApache-2.0View on GitHub
Durable pipeline state on LiteLLM workflow runs (scripts/feature-pipeline.py): record stages, run repo gates, apply the auto-approve policy. Loaded by pipeline skills; use directly for \"pipeline status\", \"show run <id>\".
4 other projects use a version of this.
Adopted by
Most recently taken up by
- anhnguyen0905/codex-mcptheir own version, first seen Nov 22, 2026
- elfovo/agent-chain-doctortheir own version, first seen Oct 13, 2026
- aditya-deokar/software-factorytheir own version, first seen Sep 29, 2026
- kvantatech/RedLinetheir own version, first seen Aug 6, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- anhnguyen0905/codex-mcp★ 4same name
- kvantatech/RedLine★ 1same name
- aditya-deokar/software-factory★ 0same name
- elfovo/agent-chain-doctor★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository20 other files it gives its agents.
- deep-code-reviewSkill
- feature-pipelineSkill
- github-updatesSkill
- idea-side-sessionSkill
- mergeSkill
- model-benchSkill
- prSkill
- repo-reviewSkill
- re-reviewSkill
- rust-best-practicesSkill
- rust-reviewSkill
- stage-approveSkill
- stage-buildSkill
- stage-intakeSkill
- stage-reviewSkill
- stage-scopeSkill
- stage-spikeSkill
- startSkill
- submit-reviewSkill
- work-evaluationSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 47
Add a kind only when its end state, its gate or its readers differ.
- Distinctive: line 113
When a stage finishes, merge one record under the stage's id:
- Very specific: line 177
Review: no critical or high findings, and every medium finding is either fixed or deferred with a reason, all within max_rounds.
- Distinctive: line 179
Gates: every gate passes.
- Distinctive: line 180
Diff: no human path hit, no matching removed line, no binary files, within the size caps, and the worktree is clean.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
run-ledger
scripts/feature-pipeline.py, next to this file, is the only way to read or write a run. It uses
Python's standard library only.
FP=<this skill's directory>/scripts/feature-pipeline.py
$FP new <repo-dir> "<title>" "<request>" [--from RUN_ID] [--stop-after <stage>] [--route direct|backlogged|dropped]
# → RUN_ID; --from links a task or investigation;
# --stop-after makes step.started refuse later stages;
# --escalate (needs --from) marks direct work moving onto the pipeline
$FP route RUN_ID <state> "<reason>" # pipelined|direct|backlogged|dropped; logs route.changed
$FP list [paused|running|completed|...] # RUN_ID status repo stage title
$FP show RUN_ID # run, metadata, events, messages
$FP step RUN_ID <stage> <event> '<json>' # append an event; merge the JSON into metadata
$FP note RUN_ID <role> "<text>" # a message: question, answer, review finding
$FP gates RUN_ID # run the repo's gates in the run's worktree
$FP approve RUN_ID # repo policy → exit 0 auto, exit 3 human
$FP done RUN_ID '<json output>' # mark completed
$FP config <repo-dir> # effective repo config (defaults when no file)
$FP selftest [repo-dir...] # policy self-check plus repo config check, no networkRun kinds
FP_WORKFLOW_TYPE picks the kind; the default is feature-delivery.
| Kind | Opened by | Ends with |
feature-delivery | a pipeline conductor | a PR, through fp approve. The only kind that can merge. |
investigation | a scoper, for an open-ended question or proof of concept | fp done with the finding and a recommendation. Its code never lands. |
task | the owner's assistant, handing work off | the company lead closes it with a report. It holds no code. |
fp approverefuses every kind exceptfeature-delivery.- Investigations follow
stage-spike's classes: anything with side effects waits for a person. - A good investigation result is carried forward by a new
feature-deliveryrun opened with--fromthat links back to it. The investigation run itself never becomes one. - Add a kind only when its end state, its gate or its readers differ. Put the topic, repo or agent in metadata instead.
Merge guard
fp guard is a Claude Code PreToolUse hook for Bash. It blocks gh pr merge
unless the PR's feature-delivery run allows it:
metadata.operator_decision.decisionisapprove; orfp approvesaidautoand the repo'spolicy.auto_mergeis true.
It finds the run by the PR URL or number in the command. Without one, it uses the run whose worktree is the current directory. It also blocks when it can't reach the ledger.
{"hooks": {"PreToolUse": [{"matcher": "Bash",
"hooks": [{"type": "command", "command": "<this skill's directory>/scripts/feature-pipeline.py guard"}]}]}}It stops mistakes and a conductor that drifts from the rules. It can't stop an agent that writes a fake decision with the same key, so keep branch protection on the base branch.
Prerequisites
Nothing by default: with no LiteLLM key configured, runs are JSON files under
~/.local/state/feature-pipeline/runs (FP_STORE_DIR). To share runs with a UI,
use LiteLLM instead (FP_STORE=litellm forces it):
- A LiteLLM proxy (v1.81 or later) with workflow runs. Set
FP_LITELLM_URL; the default ishttp://127.0.0.1:4000. - A virtual key in
FP_LITELLM_KEYor~/.config/feature-pipeline/key. The key only needs the workflow-run routes. LiteLLM shows a run only to the key that created it, unless the key belongs to an admin user, so a UI that should see every client's runs needs such a key. - Optionally,
.feature-pipeline.jsonin the target repo (see "Repo config").
Events
Event names drive the run's status. Any other name is logged without changing it.
| Event | Run status | Use it when |
step.started | running | a stage begins |
step.completed | (unchanged) | a stage finishes; carries its record |
hook.waiting | paused | the run waits for a human: a question, an approval |
hook.received | running | the human answered; carries the answer |
step.failed | failed | a stage could not run |
A paused run is the human inbox. A UI that mirrors runs can show it as a decision,
for example the Paperclip bridge. Writing the answer back is two steps: append
hook.received, and set metadata.operator_decision to
{decision, note, via, at}. A conductor resuming a paused run reads that field
first.
Routing state lives in metadata and events, so it can be queried:
metadata.route:pipelined(set bynew),direct,backloggedordropped.fp listshows it.metadata.stop_after: a stage id;step.startedrefuses any later stage (scopealso allowsspike).route.changedevent, data{from, to, reason}, written byfp routeand bynew(fromtriaged). Withnew --escalateit also carriessource, the--fromreference.fp routerefuses moves the state machine infeature-pipelinedoes not allow.
Stage records
When a stage finishes, merge one record under the stage's id:
$FP step RUN_ID scope step.completed '{"scope": {
"status": "ok", "verdict": "proceed",
"summary": "One or two plain sentences: what this stage decided.",
"reasoning": "Why, with the evidence it rests on.",
"agent": {"name": "scoper", "model": "opus"},
...stage-specific fields...,
"next": "build"}}'statusisokorfailed. Afailedrecord needs areasoningthat says what broke.verdictis one of the stage's verdicts.nextis the stage to route to, orstop.- Stage-specific fields sit next to these, and each stage skill defines its own.
- A stage that reruns overwrites its record; the event history keeps every round.
fp approve reads these metadata keys, so stages must write them exactly:
scope.{risk, sensitive_areas, verdict, spikes}review.{rounds, critical, high, open_medium}gates, whichfp gateswrites for youworktree
Repo config
Optional. Without it, feature-pipeline.py uses defaults: base = the remote's default branch (origin/HEAD), lanes_dir
../<repo>-lanes, branch_prefix fp/, no gates, and every approval goes to a
person. $FP config <repo-dir> prints the effective values; stages read them there.
.feature-pipeline.json lives at the root of the repo's main checkout. feature-pipeline.py
always reads it from there, never from the branch being approved, so a change
cannot loosen its own rules. A diff that touches it always goes to a human.
{
"github": "owner/name",
"base": "origin/main",
"lanes_dir": "../name-lanes",
"branch_prefix": "fp/",
"gates": {"test": "cargo test --workspace", "lint": "cargo clippy -- -D warnings"},
"scope_sources": ["docs/plans/*.md"],
"notes": "Repo rules a builder must follow.",
"policy": {
"max_lines": 300, "max_files": 10, "max_rounds": 3,
"auto_merge": false,
"human_paths": {"ci": [".github/"], "deps": ["Cargo.toml", "package.json"]},
"human_removed_lines": {"public api": "^-\\s*pub fn"}
}
}- A file must set
base,lanes_dir,branch_prefixandgates.lanes_diris relative to the main checkout. - Policy defaults: 300 lines, 10 files, 3 review rounds,
auto_merge: false, and no path rules.
Auto-approve needs all of the following. Anything else goes to a human, and
fp approve lists the reasons.
- Scope:
riskis low, there are no sensitive areas, the verdict was notrescoped, and no spike had side effects. - Review: no critical or high findings, and every medium finding is either
fixed or deferred with a reason, all within
max_rounds. - Gates: every gate passes.
- Diff: no human path hit, no matching removed line, no binary files, within the size caps, and the worktree is clean.
Even when fp approve says auto, the change only merges without a person if
auto_merge is true. Otherwise auto means "ready for review".
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

