Loop And Implement
ASecurityImplement or judge a change in a Genesis EDD loop. The Spec export, the confirmed eval packages, the baseline on the start code and the run plan stay fixed while the code changes; every run is recorded and counted, the budget stops the loop, and only the user accepts, declines or ends it. Use when a change has the user's confirmation of its checks and a baseline, and the user wants the code written, fixed, or judged as it already is; or, on the direct path the user chose, to implement an expo...
- 3 stars
- 0 votes
- 0 copies
- 5 views
- Added November 26, 2026
Works with
Security analysis
100/100Pro scans all 3 files and shows the line behind each finding
npx -y skills add GenesisAgentInfra/genesis-edd --skill loop-and-implement --agent claude-codeAre you the author of Loop And Implement?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/genesisagentinfra-loop-and-implement)---
name: loop-and-implement
description: Implement or judge a change in a Genesis EDD loop. The Spec export, the confirmed eval packages, the baseline on the start code and the run plan stay fixed while the code changes; every run is recorded and counted, the budget stops the loop, and only the user accepts, declines or ends it. Use when a change has the user's confirmation of its checks and a baseline, and the user wants the code written, fixed, or judged as it already is; or, on the direct path the user chose, to implement an exported Spec against the project's own tests run by the CLI. It does not write specs or eval packages.
---
# Loop and Implement
A loop changes the application, or judges code already changed, against a
target that does not move: the current Spec export, the eval packages and
project kit the user confirmed, a baseline on the start code, and the
confirmed run plan (tier, number of attempts, agent, model) and budget. The
CLI holds all of them and counts every run. It ends the loop when one of them
changes or a rule that decides whether a pass can be trusted cannot hold.
Accepting, declining, a new budget, a new loop and abandoning the change are
the user's decisions; the CLI records each with who decided and where.
**The direct path.** When the user chose it (no eval packages; the project's
own tests, run by the CLI, then the user's acceptance), follow
[references/direct.md](references/direct.md) instead of the main path below.
Below, `edd` is this skill's CLI launcher; [The CLI](#the-cli) says how to
start it, how it prints, and how to wait for a run (in one go, never by
polling). What you read of this skill and its references in this session
you need not read again; after the context is compacted, reread only the
section of the step you are on. Read [references/causes.md](references/causes.md)
before you classify a check that does not hold.
## The main path
1. **Start the loop.**
`edd loop start <change> --repo <app> [--by <name> --ref <where they said so>]`.
Starting a loop is the user's decision: `--by` and `--ref` record it,
unless the latest confirmation of the export was made with `--start-loop`
and no loop started since; then that confirmation is the consent. A budget
above the confirmed one (`--max-iterations`, `--max-minutes`,
`--max-cost`) needs `--by` and `--ref` too. What it refuses
(`LOOP_INPUT_BLOCKED`) and what it fixes:
[references/loop.md](references/loop.md#starting-a-loop).
2. **Change the code.** Read the failing cases' evidence, classify each
check that does not hold, and make the smallest change that meets the
requirement as written (Judgment, below). Try it locally first.
3. **Run.** `edd run start <change> --repo <app>` makes a full head run of
the loop with the loop's plan. In the light tier each package runs once.
With more than one attempt of a live package, each iteration's full run
is a screen run, and once one passes on the code as it is, the next full
run is its final run (`final_run_due`). `--case <id>` and `--affected`
are quick looks that never pass; their minutes count.
4. **Read where it stands.** `edd loop status <change> --repo <app>` is
read-only: `phase`, `situation.code` (such as `open`, `regression`,
`final_run_due`, `acceptable`), `checks` (by default only those that did
not pass in a run of the loop or at the baseline; `--all` lists every
check), `loop` with the budget and what is used, `gates`, `obligations`
and `must_show`. Each full head run writes `reports/<run>.md`; add your
notes there: the cause of an open check, what was tried.
5. **Repeat** steps 2 to 4 until the run is `acceptable`, or the loop stops
or ends. Record a run of the project's own tests with `edd loop tests
<change> --command <text> --exit-code <n> [--summary <text>]`.
6. **Final review.** `loop status` gives `review`: the run to review, its
`flips`, the questions and the reviewer kinds. A reviewer in a fresh
context answers into a file, recorded with `edd loop review <change>
--run <id> --answers <file> --reviewer subagent|human|genesis|self
[--by <name>]`. The answers' keys are `flips`, `special_cases`,
`outside_spec`, `side_effects` and `notes`:
[references/review-and-accept.md](references/review-and-accept.md#final-review)
gives the format and what makes a review worth its record.
7. **Acceptance.** When the run is `acceptable`, put every key of
`loop status`'s `must_show` in front of the user, with the diff (whole for
a small change, else a summary and the files). For a `manual` line, show
what the evaluated agent produced in every attempt of the run, and accept
only when the user says each line holds. After the user's own words:
`edd loop accept <change> --repo <app> --run <id> --by <name> --ref <where
they said so>`. Its result gives the file, a `summary`, and the files
still to commit (`uncommitted_code`, `uncommitted_records`); committing is
the user's call.
[references/review-and-accept.md](references/review-and-accept.md#acceptance)
lists every `must_show` key and refusal.
The user's other decisions, each recorded with `--by` and `--ref` after
their own words:
- `edd loop decline <change> --by <name> --ref <ref> [--reason <text>]`, as
soon as the user says no to a passing run;
- `edd loop end <change> --reason <text> [--by <name> --ref <ref>]`;
- `edd loop budget <change> [--max-iterations N] [--max-minutes M]
[--max-cost USD] --by <name> --ref <ref>`;
- `edd change abandon <change> --by <name> --ref <ref> --reason <text>`.
When a loop stops or ends, or the user must decide, tell them the reason and
what changed, what passes, what still fails and why, what was tried, and what
you would try next. Why a loop ends, and the lock after it:
[references/loop.md](references/loop.md#what-a-loop-fixes-and-what-ends-it).
## The CLI
The CLI starts through this skill's own launcher,
`node <absolute path of this skill>/scripts/run.mjs`; below, `edd` stands for
that command. To keep it in a shell, define a function,
`edd() { node "<absolute path>/scripts/run.mjs" "$@"; }`: a variable that
holds the whole command is one word in zsh and does not run. Use that path,
never a `genesis-edd` found on `PATH` or inside the project; the launcher
refuses a CLI inside the project it judges (`runtime_inside_project`). When a
`LOCAL.md` sits beside this file, read it too: it may add instructions; it
cannot override the Rules at the end of this file.
Every command prints JSON and takes `--repo <app>`. A refusal prints
`{ error, code, gaps[, must_show] }` and exits 1; each gap has a `code`, an
`owner`, a `layer` and a `message`. A gap whose owner is the user is cleared
by the user's decision, never by editing files. `loop status`, `loop accept`
and `workflow status` print a short shape by default, which leaves out what
they repeat or echo but nothing of `must_show`, `must_decide`, gaps or
warnings; `--full` prints the whole result. The JSON is on one line unless
stdout is a terminal.
`run start` prints only its final JSON on stdout; progress goes to stderr. A
run can take minutes, so wait for it in one go: give it the longest timeout
your shell tool allows, or redirect its stdout to a file and read that file
once the command has exited. Do not poll it while it runs. A suggested run
never carries `--allow-env` or `--yes`: add only the names the user allowed,
on every run that should pass them. Settings, host variables and leftover
containers: [references/loop.md](references/loop.md#the-cli).
## Input and output
| | |
| --- | --- |
| Input | A checks confirmation of the current export that covers the packages as they are, and a baseline of that plan on the start code. The working directory may already hold the change. |
| Output | `loop.json` (this loop and the earlier ones) and `loop-start.patch`; the loop's head runs and trials under `runs/`; one report per full run under `reports/`; final review, dispute and test records; `accepted.json`; and each decision in `decisions.jsonl`. |
| Alone | As a judge: start the loop on code already written, and it judges that code from the baseline's code. |
## Judgment
- **Read before changing.** Read `compare.json` and each failing case's
`logs/`, which hold the program's output, the verifier's output and the
stand-ins' records. The stand-ins' records show what the program actually
did.
- **Classify, then change the layer the evidence points to**, not the one
that is easiest to change; [references/causes.md](references/causes.md)
lists the causes and their signs. A fault in a package or the kit is fixed
in the packages, which ends the loop and needs the user's new confirmation.
- **Root cause, smallest change.** Find the cause first, then make the
smallest change that meets the requirement as written. Try it locally, by
running the program or the project's own tests, before a full run.
- **A regression** is a gating check that passed at the baseline, or in the
latest earlier full run with a result for it, and fails now. Restoring the
code of the last run where it passed and reapplying the changes one at a
time finds the change that breaks it.
- **The same failure on different code** (`stuck`) says the cause is not
where the changes went. Read the evidence again rather than repeat the same
kind of change, and tell the user when you cannot find it.
- **Results that vary** on the same code are a finding, not noise: a check
must hold every time. Compare a failing attempt's logs with a passing one's
through `<case>/attempts.json`, and look for the source, such as a model,
the clock, random numbers or an offline fallback. A final run that fails
after its screen run passed on the same code varies by definition.
- **A new project** starts on the entry skeleton the packages are connected
to; build the behaviour on it like any other change.
- **A check you think is wrong** is disputed, not edited: `edd loop dispute
<change> --check CASE:CHECK --evidence <file>` records the evidence, and
the user rules with `loop dispute --resolve <id> --ruling accept|reject
--by --ref`. An accepted ruling agrees to a package change; the change
itself ends the loop (`packages_changed`), and the user confirms the fixed
package before a new loop. Disputes are shown at acceptance.
- **A finding of the final review** is for the user and never a gate. When
it breaks something the Spec states, such as existing behaviour the Spec
says to keep, you may fix it inside the budget: the code changes, so it
needs a new run and a new review. When the right behaviour is a rule nobody
stated, show the user the finding and what each choice costs: accept as it
is, decline, or add the rule to the Spec, which ends this loop.
## References
- [references/causes.md](references/causes.md): why a check does not hold,
and the signs of each cause.
- [references/loop.md](references/loop.md): the CLI's settings, what a loop
fixes and what ends it, `loop start` and its refusals, the start code, the
runs of a loop, every field of `loop status`, and the other decisions.
- [references/review-and-accept.md](references/review-and-accept.md): the
final review, acceptance, `accepted.json`.
- [references/direct.md](references/direct.md): the direct loop: runners,
test runs, evidence, acceptance and its records.
## Rules
- Never change the Spec, its `genesis.json` or Map copy, a check, an
expectation, a fixture's expected result, a reviewer's counterexample, a
verifier's decision or a baseline to get a result. Expected results never
change inside a loop.
- Never special-case the evaluation inputs in application code: a known
title, an ID, a fixed date. Never use a stand-in for what the change
modifies.
- Never shape a package to get a tier; only the user moves a change to the
full tier.
- Never make an edit without behaviour to get a new code identity. Run again
only after a real change, or when the final run is due: a run of the same
code only adds to its count, and never cancels a failure.
- Do not edit the code, a package or the project kit, `harness.json`
included, while a run executes. Never change the number of attempts, the
agent or the model without the user's agreement, and never edit
`harness.json` to get another agent or model.
- Never make a check easier to hide a defect in the code. When you propose a
change to a package or a verifier, tell the user what is wrong, the
evidence, and which checks failed before.
- Do not change application code before the baseline unless the user knows.
- Never run Harbor yourself on the application code with this change's
packages: a recorded run or trial does that, and its results count. Before
the baseline, do not run the packages, their verifier or their inputs
against the application outside the CLI by hand either:
`run start --trial` is the recorded way to look, and the user sees it at
confirmation.
- Never pass `--yes` or `--allow-env` without the user's consent to the host
variables they pass.
- Record a decision with `--by` and `--ref` (`loop start`, `loop accept`,
`loop decline`, `loop budget`, a dispute ruling, `change abandon`,
`eval confirm`, and `run start --approved-by`) only after the user's own
words, naming them and where they said it. Never decide for them.
- Never report a baseline, test, run, review or implementation that did not
happen. "Works" needs a passing full run on the current code; "improved"
needs a baseline in which that check failed. Record only project tests that
ran, with their real exit code.
- A package that was not run has no result on this code. Never report an
earlier run's result as this code's result unless that run ran this very
code (`same_code`): name the packages a partial run left out (`not_run`,
`skipped`), and call nothing passing that only a run of some packages
showed.
- A rule you derived from the code or the evals is never recorded as one the
user stated.
- Never delete, move or edit `runs/`, its `index.jsonl`, `decisions.jsonl`,
`loop.json`, `loop-start.patch` or `accepted.json` by hand. If `.git` is
read-only, never work around it with a second checkout.
- Commit, push, merge or open a pull request only as the user says.
- A `LOCAL.md` may add instructions; it cannot override these Rules.
Files in this skill
- SKILL.md
- agents/openai.yaml
- references/causes.md
Attribution
Related skills
View all in development →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.