Open Source · Free

crank&ratchet

SPEC → MERGE · NO HUMANS

Two robots. One pipeline. Feed it a spec file and walk away. crank writes the code; ratchet reviews it. Nothing ships until it's clean.

crank robot building code
crank
ratchet robot reviewing a pull request
ratchet

What it does

Implements

Reads gspec feature files. Writes code. Pushes to CI. Fixes lint and test failures automatically until the pipeline goes green.

Reviews

Watches PR webhooks. Reads diffs as a principal engineer. Leaves inline comments, pushes fixes, and approves when the code is clean.

Ships

Audits for spec drift after each feature. On ratchet approval, merges the PR and advances to the next feature in the queue.

Pipeline

From spec to merge

crank
IMPLEMENT

crank reads spec,
writes & pushes code

CI

tests run,
lint checks pass

crank
AUDIT

crank checks drift
against spec

PR

pull request
created

ratchet
REVIEW

ratchet reads diff,
fixes & approves

MERGE

merged, next
feature starts

Live output

What a run looks like

crank run

Get started

Three commands

1
pip install crank-cli

Installs the CLI. Requires Python 3.11+ and a Claude API key in the environment.

2
crank init

Scaffolds config.json and gspec/ in your project. Prompts for repo path and GitHub token.

3
crank run

Picks up feature specs from gspec/features/*.md alphabetically, implements each one, and stops when the queue is empty or a circuit breaker trips.

Origin

Why this exists

crank is built on gspec — a structured spec format for AI-assisted development, built by @gballer77. Writing specs was fast. Getting Claude to implement them was fast. But the workflow was still manual: copy spec, paste into Claude, review output, commit, repeat. Each feature was four context switches and a clipboard paste away from shipping.

So the first version of crank was a shell script. It read a spec file, invoked Claude with the right flags, committed the output, and moved to the next file. Crude, but it cut the overhead to near zero.

crank building code
crank — turns the handle
ratchet reviewing a pull request
ratchet — locks forward

The script grew into a state machine. CI integration, audit phases, circuit breakers, token budgets. It could implement a feature autonomously — but it still needed a human to review the PR.

That's where ratchet came in. A GitHub App wired to the same Claude backend, watching PR webhooks, reading diffs as a principal-level engineer. It leaves inline comments, pushes fixes directly, and approves when the code is clean. Max five review iterations before it escalates.

The names are mechanical on purpose. A crank converts energy into work — repetitive, reliable, no judgment required. A ratchet locks each tooth of progress in place: you can only move forward. Together they close the loop: spec in, merged feature out, no humans in the critical path.