forge
Skill1 starsChanged 10 days agoMITView on GitHub
Task-driven Forge loop with KPI guardrails (coverage/speed/quality). Strategy rotation on stagnation, fresh-context evaluation. Triggers: 'forge it', 'forge this', 'forge loop', 'quality loop', 'kpi loop', 'improvement loop'.
- Deletes or force-pushes
83 other projects use a version of this.
Adopted by
Most recently taken up by
- teckedd-code2save/ai-build-toolstheir own version, first seen Nov 29, 2026
- hacagahasanli/agents-knowtheir own version, first seen Nov 29, 2026
- MohammedAtya/guardrail-forgetheir own version, first seen Nov 28, 2026
- pche-broken-artist/forge-of-thoughttheir own version, first seen Nov 24, 2026
- flopperj/dotfiles-coretheir own version, first seen Nov 23, 2026
- villekaresto/skillforgetheir own version, first seen Nov 22, 2026
Used with
Projects with it also use forge-review, forge-ship and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
tonmoy007Skillforge-review
Run a multi-dimensional parallel code review over the current change.
Also in 9 projects that use this
redteamlifeSkillforge-ship
Use when the user asks to merge, release, promote, reconcile, or close out work in a repo containing `docs/forge/` or governed by FORGE. Not for per-task commits; those complete inside forge-execute-task.
Also in 6 projects that use this
DailenGSkillforge-design
Design, UX, and polish discipline for the forge lifecycle. Covers the design tier, the design brief in docs/DESIGN.md, UX requirements and their verification methods, the per-slice design pass, the UX defect register, and the release polish pass. Load whenever work touches a user-facing surface (GUI, terminal, library API, or operated service), whenever a UX observation needs disposing of, and whenever a release is in reach.
Also in 3 projects that use this
weselbenSkillforge-docs
Load before code changes, before writing docs or an ADR, when a user question exposes a missing how-to, and when closing a chunk of work; also loaded by forge after each squash-merge and by deep-research after a report.
Also in 3 projects that use this
tonmoy007Skillforge-build
Run Stage 6 of the Forge pipeline — implementation. Use when the user says
Also in 4 projects that use this
DshamirSkillforge-plan
Takes analysis.json + budget cap → derives the full phase sequence, hyperparameters, instance type, cost estimate, and acceptance thresholds. Emits plan.md (the single human gate document) and plan.json (the machine-readable spec that dispatch-v2 consumes). Refuses to plan if estimated cost exceeds budget×1.2.
Also in 4 projects that use this
Other versions83 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 83
- cwinvestments/memstack★ 433same name
- ansari-project/codev★ 298same name
- cluesmith/codev★ 298same name
- swyxio/skills★ 203same name
- simota/agent-skills★ 106same name
- alp82/forge★ 36same name
- TT-Wang/forge★ 35same name
- emiliosheinz/agent-skills★ 20same name
- MetalLegBob/solana-vibes-kit★ 19same name
- antonailog/forge-skills★ 17same name
73 more not listed
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.
The file
Show its rules and text
We split this skill into the rules it gives an agent
56 rules. 0 are common, 31 are distinctive, and 25 are very specific to this project.
0
Common
Most of the 72 edited versions we read keep these.
31
Distinctive
This author's own choices. Worth a look.
25
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 27
When user wants structured, KPI-driven autonomous improvement
- Very specific: line 75
When Forge is triggered (e.g.
- Very specific: line 129
Do not assume — detect. On the first iteration, inventory what the current runtime exposes (available agent/subagent tools, an …
- Very specific: line 138
When model_tiering is available, match model strength/effort to each role.
- Very specific: line 151
Do not cheap out on the strong-tier roles — a gamed metric that a cheap judge waves through costs more than the tokens it saved.
- Very specific: line 167
Parallel round: when parallel_agents is available AND there are ≥2 independent, high-value gaps/strategies AND the scope decomposes into …
- Distinctive: line 171
Sequential: when one gap dominates, the change is tightly coupled, the capability is absent, or you are doing final polish near completion.
- Very specific: line 181
When the task is "find an unknown-size set" (bugs, coverage gaps, UX issues) and parallel_agents is available, run loop-until-dry finders …
- Distinctive: line 199
On first iteration: no state file exists yet. Generate the session ID, proceed to MEASURE, and create the state file during RECORD.
- Distinctive: line 201
On subsequent iterations: read the state file matching your session ID.
- Very specific: line 208
If completion_checks is empty, derive them before EXECUTE and persist them in forge-state
- Very specific: line 209
Check stagnation_count — if >= 3, MUST rotate strategy
- Very specific: line 215
If detected: set ui_task: true and ui_quality_score: null in forge-state
- Very specific: line 216
Check AGENT.md for a ## UI Quality Tools section and note which commands are registered
- Distinctive: line 220
When uncertain, treat a capability as absent and use its sequential fallback.
- Distinctive: line 224
Run your test suite with coverage enabled and parse output for:
- Distinctive: line 246
ONLY the scope files/modules
- Distinctive: line 248
NO forge state, NO iteration context, NO KPI targets — unbiased evaluation
- Very specific: line 262
If the user gives only open text scope, derive concrete completion_checks from that task and record them in forge-state.
- Very specific: line 265
If the user provides --done-when, treat that as the explicit override and derive any additional clarifying completion_checks from it.
- Distinctive: line 268
Do not mark Forge complete just because the KPIs improved.
- Distinctive: line 275
All else being equal, simpler is better.
- Distinctive: line 279
No metric change + simpler code → keep (that's a simplification win)
- Distinctive: line 328
Write a one-line rationale so the choice is auditable from state.
- Distinctive: line 337
Before applying changes, confirm they stay within the blast radius (§ Blast-Radius Guard): in scope, and no destructive/irreversible git, …
- Distinctive: line 355
Use fresh-context agents when they are available and helpful.
- Distinctive: line 359
Run tests — must be green before proceeding.
- Distinctive: line 360
If red: debug and fix within this iteration.
- Very specific: line 378
Update the Forge state file for the current driver (using your session ID {sid}):
- Distinctive: line 394
Add iteration to current strategy's history
- Distinctive: line 401
Git commit: if tests green AND any improvement:
- Very specific: line 403
Add one bullet under ## [Unreleased] (create the section if absent) describing the change in user-facing terms
- Distinctive: line 407
Clean revert: if tests red or KPIs regressed AND no commit:
- Distinctive: line 409
If you cannot identify that set safely, stop and leave unrelated local work untouched
- Very specific: line 413
Add to the ideas list in forge-state frontmatter
- Very specific: line 417
Check CLAUDE.md for memory conventions → check .claude/memory/ → check docs/
- Distinctive: line 419
Write only facts useful to any future agent, not forge-process observations (those stay in forge-state)
- Very specific: line 423
When the iteration log exceeds ~25 entries (or the file grows unwieldy), archive the oldest entries to forge-state.{sid}.archive.md and …
- Very specific: line 425
NEVER compact away: baseline, targets, success contract, capabilities, current strategies_tried deltas, open ideas, or lessons still in …
- Distinctive: line 431
Check ALL conditions simultaneously:
- Distinctive: line 440
Add a final changelog entry summarizing the full run: task completed, total iterations, key outcomes
- Very specific: line 441
Commit: forge(complete): [task summary] including the changelog update
- Distinctive: line 444
If not met, also stop (gracefully, not as success) when a convergence or budget condition trips (§ Convergence and Stopping) — no-progress …
- Distinctive: line 521
When stagnation triggers (or when you run out of ideas within a strategy):
- Distinctive: line 558
Keep the winner; discard the rest cleanly (drop their worktrees).
- Distinctive: line 560
Only the winner is merged to the working tree and committed.
- Very specific: line 605
add --no-verify, --no-strict, or any skip/bypass flag
- Distinctive: line 624
Sequential fallback: If no adversarial capability is available, run a structured self-audit of the diff against the checklist above before …
- Distinctive: line 679
When the iteration log grows past ~25 entries (or the file becomes unwieldy):
- Very specific: line 684
Keep verbatim in the live file: frontmatter (baseline, targets, success contract, capabilities, iteration_plan), current strategies_tried …
- Distinctive: line 689
If you cannot tell whether a fact still matters, keep it.
- Very specific: line 697
Add this section to the project's AGENT.md to register available design quality tools.
- Distinctive: line 710
When no tools are registered, forge runs this grep + inspection pass during VERIFY:
- Very specific: line 727
When ui-quality-audit is registered, run it and translate findings:
- Very specific: line 742
If ui-quality-audit registered: run it on files changed this iteration, identify top finding
- Very specific: line 743
If ui-quality-polish registered: run it on changed files
“Common” is measured: kept by at least 6 in 10 of the 72 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
The Forge — Core Protocol Plus Claude Code and Codex Drivers
A structured, task-driven improvement protocol with KPI guardrails. Forge tracks coverage/speed/quality with baselines and targets, derives or records success criteria for the task itself, evaluates with fresh-context audits, rotates strategies when stagnating, and records lessons across iterations. It is single-agent and sequential by default, but capability-aware: when the runtime offers parallel sub-agents, worktree isolation, or judge panels, Forge adaptively fans out and verifies harder — spending effort proportionate to opportunity and risk.
Built on the Ralph Wiggum loop pattern (Geoff Huntley), informed by Karpathy's autoregressive philosophy, pi-autoresearch's measurement discipline, and SICA's compounding iteration approach.
Activation Triggers
- "forge it", "forge this", "forge loop"
- "quality loop", "kpi loop", "improvement loop"
- "codebase improvement loop"
- "ralph it", "ralph loop": greenfield mode (see Greenfield Mode)
- When user wants structured, KPI-driven autonomous improvement
Architecture
Forge Core
├── Protocol phases (A through H)
├── State format and KPI model
├── Strategy selection + stagnation logic
├── Capability detection + adaptive orchestration
└── Fresh-context evaluation + verification depth
Claude Code driver
├── /forge command
├── /forge-cancel command
├── .claude/forge-state.SESSION.md
├── .claude/forge-loop.SESSION.local.md
└── Stop hook re-injects prompt on session exit
Each iteration (one OODA cycle):
├── A. ORIENT — Read forge-state, understand position + trends, detect capabilities
├── B. MEASURE — Run tests, capture KPIs
├── C. EVALUATE — Iteration 1 and every 3rd: fresh-context reality-check subagent
├── D. DECIDE — Pick strategy + plan the iteration (mode + verification depth)
├── E. EXECUTE — Apply ONE coherent improvement (sequential, or best of N parallel candidates — accept one)
├── F. VERIFY — Run tests, verify at the planned depth, re-measure KPIs
├── G. RECORD — Update forge-state with deltas + lessons (compact if long)
└── H. COMPLETE — Task success + KPI guardrails + convergence/budget → FORGE_COMPLETEDriver model
Forge has two layers:
- Forge Core — portable protocol, state model, KPI semantics, strategies, and completion rules
- Success contract — task objective plus explicit or derived completion checks
- Driver — runtime-specific integration that launches the loop, persists state, and handles pause/continue mechanics
Forge currently ships two first-class drivers:
- Claude Code — command, agent, and stop-hook integration are bundled here
- Codex —
forge-init,forge-continue,forge-cancel, andforge-statusmanage a manual loop with project-local state
Other environments can reuse Forge Core manually, but should not be described as officially supported unless they ship a real driver.
Activation
When Forge is triggered (e.g. "forge it" / "forge this", or the /forge command) and no
session is active yet, start the loop via the current driver:
- Claude Code — the
/forgecommand runs the launch sequence (parse scope + targets, measure baseline, create state, begin iteration 1); the stop hook re-injects the prompt each iteration. - Codex — for a hands-free run,
forge-run "<scope>" [--coverage N] [--quality …] …drives the loop autonomously (onecodex execper iteration, fresh context each time, until FORGE_COMPLETE or max-iterations). For step-by-step control,forge-init "<scope>" …scaffolds state and prints the iteration-1 prompt; paste it, thenforge-continueafter each iteration (forge-status/forge-cancelmanage the session). - Any agent, no driver tooling — follow phases A–H directly: generate a session ID, create the state file in the documented format (§ Forge State File Format), and iterate. The driver scripts are convenience, not a requirement.
Runtime Capabilities
Forge Core is single-agent and sequential by default — it always works that way. But when the runtime offers more, Forge uses more. The protocol describes capabilities abstractly; each driver maps them to whatever the host actually provides, and Forge detects what is available at runtime rather than assuming.
Abstract capabilities
| Capability | Meaning | Sequential fallback |
fresh_context_eval | Spawn an isolated reviewer/auditor with no loop state | Self-review against a checklist |
parallel_agents | Run multiple sub-agents concurrently | Run candidate strategies one at a time |
worktree_isolation | Give each parallel agent an isolated working copy | Serialize edits on the one tree |
workflow_orchestration | Deterministic fan-out/fan-in / pipeline primitive | Hand-rolled sequential loop |
model_tiering | Route different model tiers/effort to different agent roles | Single model for all roles |
ui_quality_tools | Registered design/UX evaluation tooling | Built-in UI checklist (§ UI Quality Gate) |
cost_telemetry | Runtime exposes per-iteration token/cost/time usage | Track wall-clock iteration count only |
Every capability has a fallback. The protocol NEVER requires parallelism, worktrees, or any specific tool. A capability that is absent degrades to its sequential equivalent — the loop still converges, just slower.
Driver capability map
| Capability | Claude Code | Codex | Protocol-only |
fresh_context_eval | ✅ subagents | ✅ subagents | ⚪ self-review |
parallel_agents | ✅ concurrent subagents / Workflow | 🔸 limited | ⚪ |
worktree_isolation | ✅ Workflow isolation: worktree / git worktree | 🔸 manual git worktree | ⚪ |
workflow_orchestration | ✅ Workflow tool (fan-out, pipeline, judge panels) | ⚪ | ⚪ |
model_tiering | ✅ Workflow model/effort opts (cheap/fast workers, strong judges) | 🔸 whatever model controls it exposes | ⚪ |
ui_quality_tools | ✅ if design skills installed | 🔸 if available | ⚪ checklist |
cost_telemetry | ✅ usage observable | 🔸 partial/manual | ⚪ wall-clock count |
✅ first-class · 🔸 partial/manual · ⚪ fallback only
Detection (ORIENT, first iteration)
Do not assume — detect. On the first iteration, inventory what the current
runtime exposes (available agent/subagent tools, an orchestration/workflow
primitive, worktree support, registered UI tools) and record a capabilities
block in forge-state. Re-use it on later iterations; re-detect only if the
environment changed. When in doubt about a capability, treat it as absent and
take the fallback — correctness over cleverness.
Model Tiering
When model_tiering is available, match model strength/effort to each role. High-volume
roles (parallel fan-out candidates, loop-until-dry finders) run on a cheap/fast tier;
correctness-deciding roles run on a strong tier. This is what makes parallel rounds
economically viable — spend the expensive tokens where correctness is decided, not on
the dozen workers exploring candidates.
| Role | Tier | Effort |
worker / finder / builder (high volume, fan-out candidates, loop-until-dry finders) | cheap/fast | lower |
reviewer (fresh-context eval over a diff) | mid | moderate |
judge / adversarial verifier / synthesis (where correctness is decided) | strong | higher |
| main loop / driver agent | as configured | as configured |
Do not cheap out on the strong-tier roles — a gamed metric that a cheap judge waves
through costs more than the tokens it saved. Drivers map these to their own controls
(Claude Code: Workflow model/effort; Codex: its model options). When model_tiering
is absent, everything runs on one model and that is fine — never block on tiering.
Adaptive Orchestration
This is the brain that makes Forge "smart enough to decide what to run when." Running every check on every change is wasteful; running none is reckless. Each iteration, after sizing the KPI gaps, Forge plans how to execute and how hard to verify, proportional to opportunity and risk.
The plan has three dimensions, decided in DECIDE and recorded as iteration_plan
in forge-state:
- Execution mode — sequential vs. parallel round
- Parallel round when
parallel_agentsis available AND there are ≥2 independent, high-value gaps/strategies AND the scope decomposes into non-conflicting areas. Fan out one agent per strategy/dimension, then fan in (§ Parallel Rounds) — aRound N · K agentsview. - Sequential when one gap dominates, the change is tightly coupled, the capability is absent, or you are doing final polish near completion.
- Parallel round when
- Verification depth — how skeptically to check the result
- Score the change's risk and pick a depth (
light/review/adversarial/panel) per § Verification Depth. - Spend verification where it is worth it. Don't gate a typo fix behind a judge panel; don't let a migration through on a self-review.
- Score the change's risk and pick a depth (
- Discovery mode — bounded vs. loop-until-dry
- When the task is "find an unknown-size set" (bugs, coverage gaps, UX
issues) and
parallel_agentsis available, run loop-until-dry finders (§ Convergence and Stopping) instead of guessing a fixed count.
- When the task is "find an unknown-size set" (bugs, coverage gaps, UX
issues) and
Record the chosen plan and a one-line rationale. The plan is a decision Forge must be able to defend from the recorded state, not a vibe.
The Forge Protocol
A. ORIENT — Read State
Session ID: Each forge loop gets a unique session ID: MMDD-HHMM-SUFFIX where MMDD-HHMM is the current timestamp and SUFFIX is a short unique token — a 2-3 word task slug (Claude driver, e.g. 0406-1530-djinnchat-primefix) or a random hex token (Codex forge-init, e.g. 0406-1530-9f3a). Generate this on the first iteration and reuse it every subsequent iteration.
State file path (substitute your session ID for {sid}):
- Claude Code:
.claude/forge-state.{sid}.md - Codex:
.forge/forge-state.{sid}.md
On first iteration: no state file exists yet. Generate the session ID, proceed to MEASURE, and create the state file during RECORD.
On subsequent iterations: read the state file matching your session ID. Never read or write a different session's state file — concurrent forge loops in the same repo are supported and must remain isolated.
- Parse baseline KPIs, targets, iteration history, current strategy
- Parse the success contract:
task: the primary requested workdone_when: explicit success override, if providedcompletion_checks: concrete checks derived from task + override
- If
completion_checksis empty, derive them before EXECUTE and persist them in forge-state - Check
stagnation_count— if >= 3, MUST rotate strategy - Review lessons from previous iterations (avoid repeating failures)
- Retrieve cross-session lessons (first iteration only): pull relevant prior lessons just-in-time from the project memory ledger that RECORD writes to (same fallback chain — § G. RECORD step "Persist project insights"). This is the read side of the loop RECORD writes: one ledger, written in RECORD, read here. Load ONLY lessons relevant to the current
scope/task(JIT — never dump the whole ledger into context), and fold them into the lessons Forge consults in DECIDE alongside this run's own. - UI detection (first iteration only): Scan
scopeandtaskfor UI signals:- File patterns:
*.tsx,*.jsx,*.vue,*.svelte,*.css,*.scss,*.html - Task keywords: component, page, interface, design, layout, style, UI, UX, responsive, animation, frontend, theme, color, typography
- If detected: set
ui_task: trueandui_quality_score: nullin forge-state - Check AGENT.md for a
## UI Quality Toolssection and note which commands are registered
- File patterns:
- Capability detection (first iteration only): inventory what this runtime exposes
(§ Runtime Capabilities) — subagents, a parallel/workflow orchestration primitive,
worktree isolation, registered UI tools. Record a
capabilitiesblock in forge-state. When uncertain, treat a capability as absent and use its sequential fallback.
B. MEASURE — Capture Current KPIs
Run your test suite with coverage enabled and parse output for:
- coverage: percentage from cover summary
- speed_seconds: total test time
- tests: total test count
- failures: failure count
- warnings: compiler warning count (optional, first run)
- ui_quality_score (UI tasks only): integer 0–100. See § UI Quality Gate.
nulluntil first gate runs.
Elixir: mix test --cover 2>&1
Python: pytest --cov --cov-report=term 2>&1
JavaScript: npm test -- --coverage 2>&1
Ruby: bundle exec rspec 2>&1 (with SimpleCov)
Go: go test -cover ./... 2>&1
First iteration: record as baseline in forge-state. Subsequent: compute deltas from previous iteration AND from baseline.
C. EVALUATE — Fresh-Context Reality Check
When: iteration 1 AND every 3rd iteration thereafter (1, 4, 7, 10...).
Spawn a fresh-context audit using an agent or persona available in your environment (for example a code reviewer, security auditor, or refactorer) with:
- ONLY the scope files/modules
- Prompt: "Audit [scope]. Report findings by severity (high/medium/low). No context about KPI targets or iteration state."
- NO forge state, NO iteration context, NO KPI targets — unbiased evaluation
UI task evaluation: When ui_task: true, prefer a design quality perspective for the fresh-context pass. If ui-quality-agent is registered in AGENT.md ## UI Quality Tools, use it as the evaluator. Otherwise append to the standard audit prompt: "Also evaluate: visual hierarchy and focal point, AI slop patterns (purple/blue gradients, glassmorphism, generic fonts like Inter/system-ui), accessibility violations, missing interaction states, empty/error/loading state gaps. Rate findings by severity."
Main agent reviews findings critically against its KPI targets. Record findings count by severity in forge-state.
Success model
Forge has two goal layers:
- Task success — what the requested work must make true
- KPI guardrails — tests, coverage, speed, quality, and no critical regressions
If the user gives only open text scope, derive concrete completion_checks from
that task and record them in forge-state.
If the user provides --done-when, treat that as the explicit override and
derive any additional clarifying completion_checks from it.
Do not mark Forge complete just because the KPIs improved. The task itself must be honestly done.
D. DECIDE — Pick Strategy
The Simplicity Criterion
All else being equal, simpler is better. When evaluating whether to keep a change:
- Improvement + ugly complexity → probably discard
- Improvement from DELETING code → definitely keep
- No metric change + simpler code → keep (that's a simplification win)
- Marginal gain from complexity → reject
This prevents complexity ratchet. Code removal for equivalent performance is always a win.
Available Strategies
| Strategy | When to use | Typical impact |
component-extraction | DRY violations, repeated patterns | Coverage + quality |
refactor-for-testability | Code hard to test (private, coupled) | Coverage |
coverage-push | Clear coverage gaps, uncovered modules | Coverage |
speed-optimization | async:false overuse, slow fixtures, redundant DB | Speed |
dead-code-removal | Unused code flagged by reality-check | Quality + coverage |
quality-polish | Naming, complexity, clarity issues | Quality |
design-system | Token violations, hardcoded values, duplicated UI patterns | Quality + ui_quality_score |
ui-quality | ui_quality_gap largest, UI task detected | ui_quality_score |
simplification | Complex code that can be made simpler | Quality (+ coverage if tests improve) |
Selection Logic
- Compute normalized KPI gap for each target:
- coverage_gap = (target - current) / target
- speed_gap = (current - target) / current (inverted — lower is better)
- quality_gap = min(high_findings, 5) / 5 (normalized 0..1; high findings dominate the gate — completion still requires high_findings == 0)
- ui_quality_gap = (threshold - ui_quality_score) / threshold (UI tasks only; 0 if not ui_task or score is null)
- Largest gap gets priority in strategy selection:
- coverage_gap largest →
coverage-pushorrefactor-for-testability - speed_gap largest →
speed-optimization - quality_gap largest →
component-extractionordead-code-removal - ui_quality_gap largest →
ui-qualityordesign-system
- coverage_gap largest →
- High findings from reality-check → immediate
component-extractionorrefactor-for-testability - Stagnation (stagnation_count >= 3) → rotate strategy per § Stagnation Protocol.
- Never repeat a strategy that yielded negative deltas without changing approach
Plan the iteration (adaptive)
Once the strategy (or candidate strategies) are chosen, decide how to run this
iteration per § Adaptive Orchestration, and persist it as iteration_plan:
- mode:
sequentialorparallel(and, if parallel, the K dimensions/strategies to fan out) - verify_depth:
light|review|adversarial|panel(from the change's risk) - discovery:
boundedorloop-until-dry(for unknown-size find tasks)
Choose each per § Adaptive Orchestration — sequential is always the safe default. Write a one-line rationale so the choice is auditable from state.
E. EXECUTE — ONE Coherent Improvement
Each iteration produces ONE coherent improvement. In sequential mode that is one
focused change. In parallel mode it is the best of N candidate changes from a
fan-out round (§ Parallel Rounds) — still one improvement accepted per iteration, just
explored in parallel first. Never batch unrelated changes into a single accepted result.
Before applying changes, confirm they stay within the blast radius (§ Blast-Radius Guard): in scope, and no destructive/irreversible git, FS, or external actions — pause instead.
Sequential change — do the one thing well:
- Structural refactoring → use an available refactoring agent, or do the focused change directly
- Clarity/polish → use an available simplification/review agent, or do the focused change directly
- Coverage gaps → write tests + refactor for testability
- Speed optimization → convert sync to async tests, consolidate fixtures, reduce DB hits
- Dead code removal → delete unused code flagged by evaluation
- Design system → extract shared components, replace hardcoded values with tokens
- UI quality → run registered quality commands on changed files, or fix the top-scoring checklist failure (see § UI Quality Gate)
- Simplification → delete dead code, reduce abstractions, flatten indirection
Parallel round — when iteration_plan.mode == parallel, fan out K agents (one per
dimension/strategy) in isolation, then fan in to a single accepted improvement
(§ Parallel Rounds). Each candidate is a complete, independently-verifiable change.
Use fresh-context agents when they are available and helpful; otherwise keep the change focused and do it directly.
F. VERIFY — Tests Must Be Green
Run tests — must be green before proceeding. If red: debug and fix within this iteration. Do NOT proceed to RECORD with failures. Re-measure with coverage to capture post-change KPIs.
Verify at the planned depth (iteration_plan.verify_depth, § Verification Depth):
green tests are the floor, not the ceiling. A risky or surprising change earns deeper
scrutiny — escalate to an adversarial pass that tries to refute the improvement and
its KPI claim before you accept it. If the refutation lands, treat it like a red test:
fix or revert before RECORD. Never let a fabricated or fragile "green" through.
No-cheat check (§ No-Cheat Invariant): when this iteration touched test files / CI config / thresholds / quality gates, or a KPI jumped implausibly, run the no-cheat invariant before accepting. A weakened test contract or a fake metric is rejected like a red test.
UI/UX quality gate (when ui_task: true): After tests pass, run the UI quality check per § UI Quality Gate. Record the resulting ui_quality_score. A score below 50 is a critical failure — fix before RECORD, same as red tests. For interaction/flow changes, also verify the UX path end-to-end (the change does what a user needs, not just that it renders).
G. RECORD — Update Forge State (THE Autoregressive Step)
Update the Forge state file for the current driver (using your session ID {sid}):
- Claude Code:
.claude/forge-state.{sid}.md - Codex:
.forge/forge-state.{sid}.md
- Append iteration entry with:
- Iteration number
- KPIs before and after (with deltas), including ui_quality_score if ui_task
- Strategy used
- Actions taken (brief)
- Success contract progress or refinement if it changed
- Findings count (if evaluation ran)
- Telemetry — when
cost_telemetryis available, record this iteration's tokens, cost (if known), and wall-clock duration (for a parallel round, the round's aggregate across fan-out agents); otherwise record at least the iteration index and elapsed wall-clock. Add it to thetelemetryrollup; consumed by § Convergence and Stopping (Budget ceiling). - Lesson learned
- Update strategy tracking:
- Add iteration to current strategy's history
- Record coverage_delta and speed_delta for the strategy
- Stagnation detection:
- Coverage delta < 0.1% for 2 consecutive iterations → increment stagnation_count
- Any improvement > 0.1% → reset stagnation_count to 0
- Git commit if tests green AND any improvement:
- Find the changelog:
CHANGELOG.md→HISTORY.md→docs/CHANGELOG.md→ createCHANGELOG.md - Add one bullet under
## [Unreleased](create the section if absent) describing the change in user-facing terms - Stage changed files (NOT forge-state, it's in .claude/), INCLUDING the changelog
- Commit with:
forge(N): [strategy] — [brief description]
- Find the changelog:
- Clean revert if tests red or KPIs regressed AND no commit:
- Revert only the files changed in the current iteration
- If you cannot identify that set safely, stop and leave unrelated local work untouched
- Record what was attempted in the iteration log (even failed attempts inform future decisions)
- Ideas backlog — if the iteration surfaced promising but deferred opportunities:
- Add to the
ideaslist in forge-state frontmatter - On future iterations, review backlog for combination opportunities
- Add to the
- Persist project insights — when the iteration reveals a non-obvious, project-level fact (environment quirk, architectural discovery, recurring anti-pattern), write it to the project's memory system:
- Check CLAUDE.md for memory conventions → check
.claude/memory/→ checkdocs/ - Fall back: append under
## LessonsinAGENT.md - Write only facts useful to any future agent, not forge-process observations (those stay in forge-state)
- These insights are the durable cross-run store: ORIENT retrieves them JIT on future runs (§ A. ORIENT step "Retrieve cross-session lessons")
- Check CLAUDE.md for memory conventions → check
- Compact state if long — keep the autoregressive memory lean for long runs (§ State Compaction):
- When the iteration log exceeds ~25 entries (or the file grows unwieldy), archive the
oldest entries to
forge-state.{sid}.archive.mdand replace them with a short rollup - NEVER compact away: baseline, targets, success contract,
capabilities, currentstrategies_trieddeltas, openideas, or lessons still in play. Compaction is lossless for decisions — it only sheds verbose per-iteration narration.
- When the iteration log exceeds ~25 entries (or the file grows unwieldy), archive the
oldest entries to
H. COMPLETE — All Targets Met?
Check ALL conditions simultaneously:
- the recorded task success contract is satisfied
- coverage >= min_coverage target
- speed_seconds <= max_speed_seconds target
- failures == 0
- high_findings == 0 (from last evaluation)
- ui_task: ui_quality_score >= ui_quality_threshold (default 80)
If ALL met:
- Add a final changelog entry summarizing the full run: task completed, total iterations, key outcomes
- Commit:
forge(complete): [task summary]including the changelog update - Output
FORGE_COMPLETEon its own line
If not met, also stop (gracefully, not as success) when a convergence or budget
condition trips (§ Convergence and Stopping) — no-progress across rounds, a token/cost
ceiling, or detected goal drift. On such a stop, record why and what remains, then
output FORGE_COMPLETE with an honest summary (do not claim targets were met if they
were not).
Otherwise → exit normally (stop hook re-injects prompt for next iteration)
Before any FORGE_COMPLETE — on success OR a graceful stop — write a loop
retrospective (§ Loop Retrospective) so the next run starts smarter.
Control markers (output on their own line, never quoted): FORGE_COMPLETE ends the
loop; FORGE_PAUSE suspends it for user input. If the driver was launched with an
explicit completion promise, the loop ends instead by emitting <promise>TEXT</promise>
(the exact promise text) — output it ONLY when that promise is literally true.
Greenfield Mode (formerly the Ralph skill)
For a new project with no code yet, Forge runs the plain Ralph pattern instead of KPI rounds:
specs/holds one specification per file, written after a long conversation about requirements. They are read every iteration and are the source of truth.fix_plan.mdis the living, prioritised TODO. Each iteration picks the single most important item, searches the code before assuming it is missing (through subagents, to keep the main context small), implements it fully (no placeholders), runs the tests, commits on green, and updatesfix_plan.mdwith what it found and what failed.AGENT.mdkeeps only build and test commands and learnings, never progress notes.- Planning prompt: study
specs/*andsrc/*, search for TODOs, placeholders and minimal implementations, writefix_plan.md. Building prompt: pick ONE item, implement, test, commit, updatefix_plan.md. - Good for greenfield work with clear specs and automatic verification; not for existing codebases, unclear success criteria or production debugging. Always set
--max-iterations. - The stop hook still honours legacy
.claude/ralph-loop.*.local.mdstate files and theRALPH_COMPLETE/RALPH_PAUSEmarkers.
Lessons Memory
Lessons live at two scopes. The forge-state lessons list is per-run and ephemeral — it
dies with the session. The project memory ledger (fallback chain in § G. RECORD,
"Persist project insights") is the durable cross-run store: RECORD writes durable,
project-level facts there, and ORIENT pulls the relevant ones forward JIT on the first
iteration of a future run (§ A. ORIENT). This closes the loop so lessons compound across
sessions instead of being trapped in one transcript.
Loop Retrospective
Forge improves the code every iteration; the retrospective is where it improves the loop
itself — the part most autonomous-loop tooling never measures. It runs once, at the end
of a run (before any FORGE_COMPLETE, success or graceful stop), entirely from data
already in forge-state — no extra test runs.
Score the run, not the code:
- Efficiency — iterations used vs.
max_iterations; iterations-to-first-improvement; count of reverted iterations and dry rounds (wasted motion). - Strategy effectiveness — from
strategies_trieddeltas: which strategy delivered the most KPI movement per iteration, and which underperformed or stagnated. - Verification calibration — did
adversarial/paneldepths catch real problems, or were they spent on changes that were fine? Were any fake-greens caught (§ No-Cheat Invariant)? Under- or over-verified? - Cost — total
telemetryspend and spend-per-accepted-improvement; whether a budget stop was hit (§ Convergence and Stopping).
Then distill 1–2 loop-level lessons — about how to run the loop better next time
(strategy ordering, when to go parallel, depth calibration, where tokens were wasted), as
distinct from code-level lessons. Persist them to the project ledger (§ Lessons Memory) so
the next run's ORIENT pulls them forward and DECIDE starts smarter. Record a short
loop_report rollup in forge-state for /forge-status to surface.
This is the autoregressive step applied to Forge's own behavior: the loop is a target of improvement, not just the code under it.
Stagnation Protocol
if stagnation_count >= 3:
1. Log: "Strategy '{current}' stagnating after {N} low-delta iterations"
2. Rank strategies by historical effectiveness (coverage_delta / iterations)
3. Pick: best historical strategy OR untried strategy
4. Reset stagnation_count to 0
5. Record lesson: "'{old}' exhausted after iterations [X,Y,Z], switching to '{new}'"Getting Unstuck
When stagnation triggers (or when you run out of ideas within a strategy):
- Re-read scope files — fresh eyes find new angles
- Review the ideas backlog — deferred opportunities may be ripe now
- Combine near-misses — two changes that individually didn't help may compound
- Try the inverse — if adding X didn't help, try removing it (or vice versa)
- Think harder — don't stop and ask. Read related code, look for patterns, try more radical changes
- Simplification pass — can you delete code and maintain the same KPIs? That's a win
Parallel Rounds
A parallel round explores several improvements at once, then accepts the single best —
a Round N · K agents view. It is an opt-in acceleration of a
sequential iteration, chosen adaptively in DECIDE, never a change to the keep-one
discipline. Requires parallel_agents; without it, fall back to trying candidates
sequentially.
Fan-out
- Pick K independent dimensions/strategies (e.g.
data-integrity,test-trust,strategy-security,coverage-push). Each must be able to succeed without conflicting with the others. - Spawn one agent per dimension, each in worktree isolation if
worktree_isolationis available (so concurrent edits never collide). Run these workers on the cheap/fast tier and reserve the strong tier for the fan-in judge panel (§ Model Tiering). Label themrN:dimensionfor legibility. - Each agent produces a complete, self-contained candidate change and runs tests on it. Agents that go red or empty-handed simply drop out of the round.
Fan-in (judge-panel keep/discard)
- Collect the surviving candidates. Apply binary keep/discard discipline (Karpathy):
- 0 survivors → nothing accepted this round; record the dry round and re-plan.
- 1 survivor → verify it at the planned depth, then accept.
- 2+ survivors → run a judge panel: score each candidate on the round's KPIs
plus the Simplicity Criterion (a smaller/simpler diff at equal gain wins). Use
fresh_context_evaljudges if available; prefer an odd number and majority verdict. Keep the winner; discard the rest cleanly (drop their worktrees).
- The accepted candidate then goes through F. VERIFY exactly like a sequential change. Only the winner is merged to the working tree and committed.
Graft, don't hoard: if a discarded candidate contained a clearly better sub-idea, note it
in ideas for a future iteration rather than merging two diffs at once.
Verification Depth
Green tests are necessary, not sufficient. Forge scales scrutiny to the change's risk so it spends verification effort where it pays off (chosen in DECIDE, applied in VERIFY).
Risk score (informal, per change): blast radius (files/LOC) · criticality (auth, data, money, migrations, public API, deletion) · KPI surprise (a delta too good to be true) · reversibility (hard-to-undo > easy).
| Depth | When | What runs |
light | Trivial, low blast radius, expected KPI move | Tests + a quick self-review checklist |
review | Moderate change or first touch of a module | One fresh_context_eval reviewer over the diff |
adversarial | High/critical change, or KPI delta that looks too good | 1–N independent skeptics prompted to refute the change and the KPI claim — "find how this is wrong, break it, prove the metric is fake." Majority-refute ⇒ reject like a red test |
panel | Competing candidates (parallel round fan-in) | Judge panel scores + keeps best (§ Parallel Rounds) |
Adversarial verification is the antidote to fake-green: a change that games coverage, weakens an assertion, or posts an implausible speedup should be attacked before it is trusted. Default skeptics to "refuted unless clearly sound." If the capability is absent, fall back to a structured self-refutation checklist — still ask "how is this wrong?" before accepting.
UI/UX changes verify on their own axis (§ UI Quality Gate) in addition to the above.
No-Cheat Invariant
The loop must never improve a KPI by weakening the test contract. Going green by deleting the assertion that was red is not progress — it is reward hacking, and it emerges structurally, not from bad intent (SWE-Marathon found ~10% of agent rollouts ship verifier bypasses; reward hacking resists soft "please don't" mitigations). Forge defends against it structurally, in VERIFY.
Trigger. Whenever an iteration improves green/coverage/quality AND it touched test files, CI config, coverage thresholds, or quality gates, VERIFY MUST inspect the diff and confirm the change did NOT:
- weaken or remove assertions (loosen matchers, widen tolerances, assert less)
- skip / xfail /
.only/ delete / comment-out tests - lower a coverage or quality threshold, or relax a CI gate
- mock or stub away the real behavior under test
- add
--no-verify,--no-strict, or any skip/bypass flag
Any of these is treated exactly like a red test: reject/revert before RECORD. A genuine fix adds or strengthens the contract; it never shrinks it to fit the result.
KPI provenance. KPI deltas must come from real, unmodified test runs. A delta that is
too good to be true — coverage leaping implausibly, speed collapsing with no structural
reason, failures vanishing without a corresponding fix — auto-escalates that iteration's
verify_depth to adversarial (§ Verification Depth). The skeptic's explicit job is then
to prove the metric is fake or gamed, not merely review the diff.
Test contract. The scope (or the user, via test_contract in forge-state) may
designate test files as the contract the loop may extend but not weaken — Ralph's
"read-only test files." This is optional and lightweight. When no contract is declared,
the default heuristic is: treat the existing test assertions as the contract. New
tests and stronger assertions are always welcome; removing or loosening existing ones is a
no-cheat violation unless the underlying behavior was itself intentionally removed (and
that intent is recorded).
Sequential fallback. If no adversarial capability is available, run a structured self-audit of the diff against the checklist above before accepting — the same questions, asked of yourself, with "rejected unless clearly clean" as the default verdict.
Convergence and Stopping
Forge stops on success (H. COMPLETE) — but a loop that cannot reach success must still end gracefully rather than burn forever. Track these alongside the success contract:
- No-progress / loop-until-dry — for bounded improvement, the existing stagnation counter rotates strategy at 3 low-delta iterations. For discovery tasks, run finders until K consecutive dry rounds (default 2) return nothing new, then stop — don't guess a fixed iteration count. A parallel round that yields 0 survivors counts as dry.
- Budget ceiling — respect any token/cost/time cap (
budgetblock in forge-state, or one the runtime sets). Consume the recordedtelemetryrollup (written each RECORD, § G. RECORD): track cumulative spend, estimate the next round's cost from the running average per iteration, and stop before a projected breach rather than after. When the remaining budget can't fund another useful round, stop and summarize what was achieved and what remains. Never blow a hard ceiling chasing the last KPI point. Whencost_telemetryis absent, fall back to the wall-clock iteration count against any time/iteration cap. - Goal drift — each iteration, re-check that the work still serves the success contract. If recent iterations have wandered into unrelated polish, stop and flag the drift rather than continuing to optimize the wrong thing.
On any of these, output FORGE_COMPLETE with an honest status — "converged short of
target X; remaining work: Y" — never a false claim of completion.
Blast-Radius Guard
Unattended overnight loops need guardrails against runaway, destructive, and scope-creeping actions. The guard is strictest in unattended runs (hook-driven, no human watching); when a human is in the loop, borderline actions may ask instead of hard-stop. Apply it before every EXECUTE.
- Stay within scope — edits should fall within the declared
scope(andscope_pathswhen set). Touching files clearly outside scope requires an explicit allowance in the success contract; otherwise pause (FORGE_PAUSE, attended) rather than silently expand the blast radius. Don't grow the footprint to chase a KPI. - No destructive/irreversible git or FS ops — never force-push, never rewrite
published history, never delete branches, and never
git reset --hard/checkout/ remove untracked files in a way that discards work outside this iteration's own changes. This complements the "Clean revert" step (§ G. RECORD): a revert touches only the files this iteration changed, and stops if that set can't be identified safely. - Irreversible external actions — anything outward-facing or hard to undo (deploys, publishing, destructive DB ops, deleting data) → stop/pause for confirmation rather than proceed, especially in unattended mode.
A guard breach is a graceful-stop condition (§ Convergence and Stopping): in attended runs
FORGE_PAUSE for confirmation; in unattended runs stop with an honest summary of what was
blocked and why. Never punch through the guard to finish the task.
State Compaction
forge-state is the autoregressive memory and must survive long runs without bloating. When the iteration log grows past ~25 entries (or the file becomes unwieldy):
- Move the oldest narrative entries to
forge-state.{sid}.archive.md. - Replace them in-place with a 2–3 line rollup: net KPI movement, strategies exhausted, and any still-relevant lesson.
- Keep verbatim in the live file: frontmatter (baseline, targets, success contract,
capabilities,iteration_plan), currentstrategies_trieddeltas, openideas, and lessons that still guide decisions.
Compaction is lossless for decisions — only verbose per-iteration narration is shed. If you cannot tell whether a fact still matters, keep it.
UI Quality Gate
This gate activates automatically when ui_task: true (detected in ORIENT). It adds ui_quality_score (0–100) as a fourth KPI dimension alongside coverage, speed, and code quality.
Configuration (AGENT.md)
Add this section to the project's AGENT.md to register available design quality tools. Omit entirely or leave commented to use the built-in fallback — forge never requires any specific tool:
## UI Quality Tools
# Uncomment to enable richer checks (e.g. with impeccable installed):
# ui-quality-agent: impeccable:critique ← used in EVALUATE fresh-context pass
# ui-quality-audit: impeccable:audit ← used in VERIFY gate
# ui-quality-polish: impeccable:polish ← used in ui-quality EXECUTE strategy
# ui-quality-threshold: 85 ← override completion threshold (default 80)Built-in Checklist (10 points, 10 pts each)
When no tools are registered, forge runs this grep + inspection pass during VERIFY:
- No hardcoded hex colors —
grep -r '#[0-9a-fA-F]\{3,6\}\b'on source files → zero matches outside token definition files - Touch targets ≥ 44px — interactive elements (
button,a,[role=button]) have min-height/min-width ≥ 44px or equivalent padding - All inputs labeled — every
<input>has an associated<label>oraria-label - Alt text present — all
<img>tags have non-emptyaltattribute - Focus states defined — no
outline: noneoroutline: 0without a replacement focus style - Loading states present — every async action (fetch, mutation) has a loading state in the UI
- Error states present — every fetch/mutation has an error state with a user-visible message
- Empty states useful — no blank-space fallbacks; empty states have context and a next-action CTA
- Reduced motion respected —
prefers-reduced-motionmedia query present for any animations - No console.log in source —
grep -r "console\.log"on source (not tests) → zero matches
Score: (passed_checks / 10) * 100
Scoring with Registered Tools
When ui-quality-audit is registered, run it and translate findings:
| Finding severity | Deduction |
| Critical (blocking) | 25 pts each |
| High | 10 pts each |
| Medium | 5 pts each |
| Low | 1 pt each |
Score: max(0, 100 - total_deductions)
Strategy execution (ui-quality)
ONE fix per iteration. Commit if score improves.
- If
ui-quality-auditregistered: run it on files changed this iteration, identify top finding - If
ui-quality-polishregistered: run it on changed files - Otherwise: take the lowest-passing item from the built-in checklist and fix it
Forge State File Format
Driver defaults (substitute your generated session ID for {sid}):
- Claude Code:
.claude/forge-state.{sid}.md - Codex:
.forge/forge-state.{sid}.md
---
session_id: "0406-1530-djinnchat-primefix" # MMDD-HHMM-SLUG, generated once on first iteration
scope: "description of scope"
success:
mode: "task-derived"
task: "build password reset flow"
done_when: null
completion_checks:
- "users can request a reset and use the token successfully"
- "failure paths are covered and tested"
baseline:
coverage: 92.99
speed_seconds: 81
tests: 21563
failures: 0
ui_quality_score: null # null if not ui_task
measured_at: "2026-03-20T14:30:00Z"
targets:
min_coverage: 95.0
max_speed_seconds: 40
quality: "moderate"
max_iterations: 20
ui_quality_threshold: 80 # applies when ui_task: true (configurable in AGENT.md)
budget: # optional hard caps (§ Convergence and Stopping); any/all may be null
max_tokens: null
max_cost: null
max_wall_seconds: null
ui_task: false # set true in ORIENT if UI signals detected
test_contract: null # paths the loop may extend but not weaken (§ No-Cheat Invariant); null = infer from existing tests
scope_paths: null # paths the loop may edit (§ Blast-Radius Guard); null = infer from scope
unattended: true # hook-driven runs default true → stricter guard (§ Blast-Radius Guard)
capabilities: # detected in ORIENT (§ Runtime Capabilities)
fresh_context_eval: true
parallel_agents: true
worktree_isolation: true
workflow_orchestration: true
model_tiering: true
ui_quality_tools: false
model_tiers: # optional (§ Model Tiering); values are driver-specific; omit when model_tiering absent
worker: "cheap/fast tier, lower effort"
reviewer: "mid tier"
judge: "strong tier, higher effort"
iteration_plan: # set in DECIDE each iteration (§ Adaptive Orchestration)
mode: "sequential" # sequential | parallel
parallel_dimensions: [] # e.g. ["data-integrity", "test-trust"] when mode: parallel
verify_depth: "review" # light | review | adversarial | panel
discovery: "bounded" # bounded | loop-until-dry
rationale: "single dominant coverage gap; review depth (moderate blast radius)"
dry_rounds: 0 # consecutive rounds that yielded nothing (loop-until-dry)
telemetry: # cumulative rollup, updated each RECORD (§ G. RECORD); consumed by § Convergence and Stopping
tokens_spent: 0
cost_spent: 0
wall_seconds: 0
loop_report: null # written once at the end (§ Loop Retrospective); e.g. {iterations: 7, reverts: 1, best_strategy: "coverage-push", spend_per_win: "12k tok", lessons: ["..."]}
current_strategy: "coverage-push"
stagnation_count: 0
strategies_tried:
- name: "coverage-push"
iterations: [1, 2]
coverage_delta: 0.8
speed_delta: -5
lessons: # session-scoped; durable ones are mirrored to the project ledger and pulled forward JIT by ORIENT (§ A. ORIENT, § G. RECORD)
- "async:true on LiveView tests saves ~3s per file"
ideas:
- "consolidate 3 similar fixture helpers into one parameterized function"
- "auth module has dead code paths from v1 migration"
---
## Iteration 1 — coverage-push
- Coverage: 92.99 -> 93.15 (+0.16%)
- Speed: 81s -> 79s (-2s)
- Tests: 21563 -> 21578 (+15)
- UI Quality: n/a (not ui_task)
- Actions: Added 15 tests for data_loaders.ex edge cases
- Reality-check: 2 high, 3 medium findings
- Telemetry: 48k tokens, $0.21, 96s wall (cumulative: 48k / $0.21 / 96s)
- Lesson: "data_loaders has 7 identical try-rescue - extract, don't test each"Quality Levels
| Level | High findings | Medium findings |
strict | 0 | 0 |
moderate | 0 | <= 3 |
lax | 0 | <= 5 |
Critical Rules
- ONE coherent improvement per iteration — resist the urge to batch. In parallel mode you may explore N candidates, but you accept exactly one. Small steps compound.
- Never skip VERIFY — red tests mean the iteration failed. Fix before RECORD.
- Never fabricate KPIs — always parse from actual test runner output.
- Fresh-context evaluation — use an available isolated reviewer/audit pass to avoid anchoring bias.
- Lessons accumulate — read ALL previous lessons before DECIDE. Never repeat a documented failure.
- Commit on green with changelog — every improvement gets persisted to git with a
## [Unreleased]changelog entry. - State file is sacred — it survives context compaction. Keep it accurate.
- Simpler is better — code deletion at same KPIs is always a win. Don't add complexity for marginal gains.
- Clean revert on failure — restore clean state before the next iteration. Never leave dirty files.
- Never stop to ask — if stuck, think harder. Re-read code, review backlog, combine near-misses, try the inverse.
- Task success comes first — KPIs are guardrails, not a substitute for actually finishing the requested work.
- Use what the runtime gives you — detect capabilities, prefer parallel/worktree/judge-panel power when present, degrade gracefully when absent. The sequential default is always correct.
- Verify proportionate to risk — cheap checks for cheap changes; adversarial refutation for risky ones or suspiciously good KPIs. Never trust a green you did not try to break.
- Never weaken the test contract to move KPIs — going green by removing/loosening assertions, skipping or deleting tests, lowering thresholds, mocking away the behavior under test, or adding skip flags is reward hacking. Reject it like a red test (§ No-Cheat Invariant). Extend the contract, never shrink it.
- Stay within blast radius — no out-of-scope edits and no destructive/irreversible git, FS, or external actions in unattended runs. Pause (or stop with an honest summary) instead of expanding the footprint or punching through (§ Blast-Radius Guard).
Support posture
- Claude Code support is first-class in this repo
- Codex support is first-class as a manual driver in this repo
- Other runtimes may reuse the protocol, but should not be described as officially supported unless they ship a real driver
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.

