The Warship CTOFrom Prompt to Loop

35 loops that keep a product alive after it ships. A loop finds its own work, hands it to an agent, checks the result, and writes down what it learned. You build it once. It runs without you after that.

See all four chapters find real work. Node 18 and bash, no API key, no AWS account. git clone https://github.com/fakiolinho/From-Prompt-to-Loop.git && cd From-Prompt-to-Loop && ./run-all-demos.sh
Then put one in your own repo. It writes a loops.env with the settings that loop needs. ./install.sh ~/code/my-app 02

A check has three answers, not two

Every loop starts with one question, and how it answers decides what you pay. The third answer is the one most people leave out, and it is the expensive one: a check with only two will say “there is work” when it means “I cannot tell”.

exit 0no workThe run ends. You spend nothing.
exit 1there is workThe agent wakes, fenced and capped.
exit 2not wired hereFails loudly and says what it needs. No agent.

WIRING.md lists every setting all thirty five loops read. Anything you leave unset simply exits 2 and tells you what it wanted, so you can install everything and wire it up over weeks.

What it costs, and what it needs

Most of this costs nothing. The part that spends money is one step, and it is fenced on four sides.

NeedsCosts
./run-all-demos.sh and every checkNode 18 and bashnothing, ever
./run-loop.sh 02 on your machineyour existing Claude Code or Codex loginwhatever that run costs you
The GitHub Actions runneran API key in repo secretsper token, metered

Locally you do not need an API key. If you are already signed in to Claude Code, a subscription included, the runner uses that. There is nothing to buy to try this. A runner in CI has no login, so that one does need a key, and it is metered per token whatever your interactive plan says.

Every agent run is capped at --max-budget-usd 2 and --max-turns 30, with a 20 minute timeout. And the check runs first, so a loop with nothing to do never wakes an agent. A quiet night costs nothing.

The guide

Eight short pages. None longer than a screen or two. Read them in order the first time, then come back to whichever one you need.

This is what that one command prints

Real checks, on a real project, finding real problems. Nothing mocked for the screenshot. A demo that exits non zero has not failed: that is the check saying there is work.

=================  ENGINEERING (loops 2, 4, 5, 6, 7)  =================
Loop 2. Dependency upgrades   (pack check: `npm outdated`)
Package  Current  Wanted  Latest  Location             Depended by
is-odd     1.0.0   1.0.0   3.0.1  node_modules/is-odd  demo-app
ms         2.0.0   2.1.3   2.1.3  node_modules/ms      demo-app
  ^ ms can move inside its range (Wanted 2.1.3), so the loop bumps it, runs the
    verify command, and opens a PR. is-odd can only go to a major, so the loop
    leaves it alone and opens an issue. Latest is not always safe, or even newer.

Loop 4. Test backfill on changed code   (pack check: git diff for untested changes)
  NO TEST  src/discount.js  (live code, imported, but no src/discount.test.js)
  The loop would write a focused test that passes against current behaviour.

Loop 5. Dead code and unused dependencies   (pack check: `knip`)
  DEAD FILE   src/unused.js  (exported but nothing imports it)
  UNUSED DEP  is-odd  (in package.json, never imported)
  The loop lists these for a human and opens an issue. It never deletes.
  A green build does not prove a cut was safe, and deleting a test makes the
  suite pass more easily. That is why loop 5 flags rather than ships.

Loop 6. Lint, format, and type fixes   (pack check: eslint + prettier + tsc)
  src/messy.js: uses == (should be ===); uses var (should be const/let); unused variable "unusedTax"
  The loop would auto-fix the mechanical issues; a type error it cannot fix safely it flags.

Loop 7. Release notes and changelog   (pack check: git log since last tag)
  BEHIND  package.json is 1.1.0 but the changelog tops out at 1.0.0.
  The loop would write the entries for the new version from the commit log.

The 35 loops

Ships on green opens a PR and merges once the check passes, and a bad one is one click back. Flags, you decide stops and hands you the call. Nothing irreversible happens without a person. ★ marks the three easiest first builds.

1Docs and examples syncdocs driftShips on green 2Dependency upgradesoutdated deps (npm outdated)Ships on green 3Codemod and framework migrations(you point it at a migration)Ships on green 4Test backfill on changed codechanged code with no testShips on green 5Dead code and unused dependency removaldead code (knip), once knip is configuredFlags, you decide 6Lint, format, and type fixesthe project's own lint, format and typecheck scriptsShips on green 7Release notes and changelogcommits since the last release tagShips on green 8First pass code reviewa PR to reviewFlags, you decide 9Issue triage and routingan issue to triageFlags, you decide 10Container and base image bumpsplain CLIShips on green 11Backup restore drillsplain CLIShips on green 12Orphaned resource cleanupplain CLIFlags, you decide 13Certificate and secret rotationplain CLIFlags, you decide 14Infrastructure drift reconciliationplain CLIFlags, you decide 15Cost and spend anomaly watchFinOps AgentFlags, you decide 16Alert and on-call noise tuningDevOps AgentFlags, you decide 17Known alert auto-remediationDevOps AgentFlags, you decide 18IAM and permission auditSecurity Agent / ContinuumFlags, you decide 19Eval suite on every prompt or model changean accuracy regressionShips on green 20RAG knowledge base synca source newer than its indexShips on green 21Structured output conformanceoutputs that break the schemaShips on green 22Model version upgrade testing(you point it at a version)Flags, you decide 23Golden set growth from production failuresfailures not yet in the golden setFlags, you decide 24Prompt cost and routing optimisationcost above baselineFlags, you decide 25Safety and red team regressiona red team regressionFlags, you decide 26Data quality and drift monitoringdrift over thresholdFlags, you decide 27Bug report to failing testreports with no reproducing testShips on green 28Flaky test detection and quarantinea flaky or broken testShips on green 29Self healing UI testsselector-only failuresShips on green 30Test data and fixturesfixtures that no longer fit the schemaShips on green 31Smoke tests on every deploya failing critical path post deployShips on green 32Cross browser and device matrixfailures by configShips on green 33Visual regression triagescreenshot diffsFlags, you decide 34E2E coverage from real user flowstop journeys with no e2e testFlags, you decide 35Synthetic uptime and journey monitoringa failing or slow prod journeyFlags, you decide