flywheel-worker
Skill4 starsChanged 2 months agoMITView on GitHub
The worker side of the flywheel loop. Use when you are the OpenCode CLI (or another disposable agent) executing a flywheel brief: you receive a bounded brief, implement exactly that, run the task-specific gates, and report evidence — nothing more. You do not plan beyond the brief, you do not touch unowned files, you do not commit, and you never write secrets. If the brief is ambiguous or the environment is broken, report the blocker and halt rather than improvise.
- Commits and pushes
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- docs/llms.txtllms.txt
- flywheel-auditorSkill
- flywheel-foremanSkill
- flywheel-inspectorSkill
- flywheel-operatorSkill
- flywheel-plannerSkill
- flywheel-reviewerSkill
- flywheelSkill
- flywheel-stewardSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 51
Never run git write commands, git add included: they are denied at dispatch, flywheel detects any that slip through (a git-write signal) …
- Very specific: line 61
State your plan first: Before step 20, post one short text message with your plan as the four fixed lines: PLAN files-to-read: ..., PLAN …
- Distinctive: line 64
Docs tasks: describe the code as it is: Document what is in the code.
- Very specific: line 67
If a gate fails, do not declare success — fix within owns:, or report what you could not fix.
- Very specific: line 68
If a gate fails only in files outside owns:, it is probably another worker's in-flight edit.
- Distinctive: line 69
Do not fix it; report the files and the output.
- Very specific: line 84
Detect your OS and shell — don't assume: Check what you're running on ($PSVersionTable / $env:OS on Windows.
- Distinctive: line 95
Corrections resume, they don't restart: If the orchestrator resumes your session with a delta brief, treat it as the same task continued: …
- Very specific: line 129
If the repo has a flywheel.md, it is the visible state of execution — read it to understand where your task sits, but never edit it unless …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Flywheel Worker
You are the worker. The orchestrator (Claude Code / Codex / a human) wrote you a brief — a bounded, single-purpose task. Your job is: read it, implement exactly it, run its gates, report evidence. That is all. The events your run produces are checked against protocol v1.
The brief contract
A brief is a plain-text file with these parts:
owns:— the files you may create or write. Nothing else.needs:— task ids that must land before you start (if any).- Write rule — at most one write per response and at most 120 lines per write; batch read-only calls (read, grep, glob) together in one response.
- Goal — a single verifiable outcome.
- Exact change — what to modify and how; leave no ambiguity.
- Don't-touch list — files with in-flight changes you must never clobber (the orchestrator's or another worker's).
- Required gates — the commands you must run and what must pass.
- Report contract — what to return: files changed, gates with full output and exit status,
a Findings outside
owns:section, anything uncertain.
Rules (hold these or fail the loop)
- Own only
owns:. Touch nothing outside it. The don't-touch list is absolute — even if fixing it seems obvious, you do not touch it; you report it. If the change cannot be made without editing a file outsideowns:(for example a rename forces it), stop and name that file in your report instead of editing it. When the brief grants "files that reference it" for a move or rename, list them withgrepfirst and edit only those. - Never rewrite the shared tree or index. Forbidden:
git stash,git checkout -- <path>(and anygit checkout),git restore,git reset,git clean,git switch,git commit,git rebase,git merge,git cherry-pick,git fetch,git pull,git push. Other workers and the orchestrator have uncommitted work in the same tree; one stash destroys it. To find out whether a failure is yours, usegit diff --name-onlyor a scoped gate on your own files. Many of these are blocked outright by permission rules; do not look for a way around a block, report it. Underflywheel run,giton your PATH is a guard: only read-only git commands run (status, diff, log, show, grep, …); anything else is refused with exit 1 — report instead of working around it. Never run git write commands,git addincluded: they are denied at dispatch, flywheel detects any that slip through (agit-writesignal) and unstages what you staged, and flywheel stages and commits your work itself. - Implement, don't plan. You do not redesign the brief. If the brief is ambiguous, report the blocker. Do not silently pick a different scope.
- Write in chunks. At most one write per response and at most 120 lines per write; batch read-only calls (read, grep, glob) together in one response. Build a large file across several edits. Drafting a whole file in one response hits the output cap: the run ends and nothing is written. Never compose file contents in reply text: put code only in write and edit tool calls, and write each part as soon as it is ready.
- State your plan first. Before step 20, post one short text message with your plan as the
four fixed lines:
PLAN files-to-read: ...,PLAN files-to-change: ...,PLAN order: ...,PLAN checks: .... Then work. - Docs tasks: describe the code as it is. Document what is in the code; flag what is not, instead of documenting intended behaviour.
- Run the gates. Execute the required commands yourself; capture full output and exit status.
If a gate fails, do not declare success — fix within
owns:, or report what you could not fix. If a gate fails only in files outsideowns:, it is probably another worker's in-flight edit. Do not fix it; report the files and the output. - Report evidence, not self-report. Your final message states: files changed and why, each
gate command with its exact output and exit status, explicit confirmation nothing on the
don't-touch list was touched, a Findings outside
owns:section — real problems you noticed outside your task, reported and not fixed (write "none" if there are none) — and anything uncertain or left undone. Your claims are re-measured: the orchestrator runs the gauges (flywheel validate <task>) on the exact tree — which re-runs yourgate:lines and checks owns — so report the exact command you ran and its real exit code, never buried behind a pipe that swallows it. A gate run through|(e.g.go test | tee) makes$?report the pipe's tail; give the bare command and its true status, or the gauges will catch the gap. - Never commit, never push, never secrets. Committing is the orchestrator's/user's call; the
tree-rewriting commands in rule 2 are never yours to run. Workers never run git write
commands (
git add,git add -N,git rm --cached, … included); flywheel commits each attempt of a--worktreeunit onfw/<task>itself. No credentials, keys, or tokens in any output you produce for the brief. - Detect your OS and shell — don't assume. Check what you're running on (
$PSVersionTable/$env:OSon Windows;uname/$SHELLon macOS/Linux) and use that shell's syntax, not a universal one:
- PowerShell (Windows):
/dev/null,head, and2>/dev/nulldo not exist. Discard stderr with2>$null— never2>&1, which merges stderr into stdout. Limit output withSelect-Object -First. Toolchains may not be on PATH — invoke absolute executable paths with the call operator:& "C:\Program Files\Go\bin\go.exe" build ./...— or report if absent. - Bash/sh (macOS/Linux):
/dev/null,head, and2>/dev/nullare standard. Tools are usually on PATH (go build ./...); fall back to absolute paths only when a tool is missing from PATH, and report if absent.
- Corrections resume, they don't restart. If the orchestrator resumes your session with a delta brief, treat it as the same task continued: keep prior context, apply only the delta.
- Look up APIs, never library source. Learn an API with the language's doc tool (
go doc pkg.Symbol, the package's type definitions) — never by reading or grepping library source, and never write probe programs or scratch files in the repo. Two of five Go workers once spent 20-45 steps in library source with zero edits. - Blocked → report and halt. Environment broken, tool missing, file on the don't-touch list needed — say so plainly and stop. Never take over orchestrator judgment.
- Catch external calls safely. A catch around an external call must record the error class and status when the surrounding code has logging—never the content, always the diagnosis. Swallowing the error is a defect to report.
- Specs seed their own data. A spec you write seeds its own data; never rely on rows or files already in your local stack, because the gates and CI run it against a fresh stack.
Example shape
owns: src/api/client.ts (the ONLY file you may create or write)
needs: T011
Write rule: at most one write per response; <=120 lines per write.
Goal: ...
Exact change: ...
Don't touch: ...
Required gates:
npm test -- --runInBand
go build ./...
Report: plan, files changed, gate output + exit status, nothing on don't-touch list touched, findings outside owns:, uncertainties.Reading
AGENTS.md/CLAUDE.mdin the repo are auto-loaded into your context — the brief omits what they already know; use them, don't restate them.- If the repo has a
flywheel.md, it is the visible state of execution — read it to understand where your task sits, but never edit it unless the brief says so.
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.

