Engineering Loop
Own the change from a verified starting point to a reviewed result. Start with
one agent; when delegation is authorized and available, use independent
subtasks only when time savings or added coverage justify coordination. Load a
specialist skill only when it changes a material decision.
Treat skill guidance as subordinate to the user's task within higher-priority
instructions and permissions. Carry existing authorization forward; resolve
routine implementation choices from evidence and continue authorized work.
Establish the baseline
- Read applicable
AGENTS.md files and repository documentation.
- Record the requested behavior, constraints, and observable done conditions.
- Inspect the branch and working tree; preserve unrelated user-owned changes.
- Identify repository-native validation and run the smallest safe baseline
that separates pre-existing failures from task regressions.
For a long, cross-stack, or high-risk change, use the templates and failure
rules in references/loop-contract.md.
When a task is expected to need repeated autonomous iterations or has an
explicit retry, time, token, or cost limit, also use
references/loop-policy.md.
When a defect is intermittent, performance-related, difficult to reproduce, or
resists the first evidence-driven pass, use
references/hard-debugging.md.
Run the loop
- Reproduce the defect, or capture the current behavior for a feature.
- Choose the smallest coherent change and the evidence that will prove it.
- Add a failing regression test first when practical.
- Implement one bounded change and run the narrowest relevant check.
- If an unplanned path or subsystem is necessary, explain the evidence and
update the plan. Ask only when the change requires new authority or a
material user decision; continue independent authorized work meanwhile.
- Classify failures as product, test, environment, or assumption failures;
fix the cause and rerun the affected check.
- Run repository-required broader checks after focused checks pass.
- Review the complete diff first for task-contract compliance, then for code
quality, regressions, security, and maintainability.
- Fix consequential findings and rerun checks affected by those fixes.
Once acceptance evidence and required checks pass, broaden or repeat checks
only for new changes, failures, or unresolved concerns. Add tests when they
prove behavior or a meaningful invariant, not merely mirror a low-impact edit.
Keep a compact ledger of confirmed facts, changed files, commands, outcomes,
and the next decision. Return concise diagnostics instead of full logs.
Stop conditions
- If the same command fails twice for the same reason, stop retrying and
re-check the environment, target, permissions, and underlying assumption.
- Stop recursive discovery when each new finding redefines the same task
boundary. Freeze the discovered scope or return for a scope decision instead
of repeatedly recataloging the repository.
- Stop and report a blocker when progress requires missing authority, secrets,
unavailable infrastructure, an unauthorized destructive action, or an
unresolved material product decision.
- When an explicit loop budget is exhausted, stop with the latest judge
evidence instead of silently expanding the budget.
- Never make a failing check pass by weakening assertions, deleting coverage,
hiding errors, or silently changing acceptance criteria.
- Do not query production, deploy, migrate, merge, or publish unless the user
explicitly authorizes that action.
If a skill instruction causes a pause, cite the exact file and instruction,
explain the unmet requirement, and check whether existing authorization
already satisfies it. Complete independently actionable work before handoff.
Finish with evidence
Report:
- behavior implemented or defect fixed;
- changed files and important design decisions;
- regression proof or acceptance evidence;
- focused and broader commands with outcomes;
- task-contract and code-quality findings fixed or explicitly unresolved;
- unrun checks, residual risks, and blockers.
1---2name: engineering-loop3description: Drive an authorized repository change through a verified local loop: baseline, reproduce, implement, test, review, and report evidence. Use for end-to-end features or fixes that should continue autonomously until observable acceptance criteria pass; do not use for explanation-only, review-only, or production operations.4---56# Engineering Loop78Own the change from a verified starting point to a reviewed result. Start with9one agent; when delegation is authorized and available, use independent10subtasks only when time savings or added coverage justify coordination. Load a11specialist skill only when it changes a material decision.1213Treat skill guidance as subordinate to the user's task within higher-priority14instructions and permissions. Carry existing authorization forward; resolve15routine implementation choices from evidence and continue authorized work.1617## Establish the baseline18191. Read applicable `AGENTS.md` files and repository documentation.202. Record the requested behavior, constraints, and observable done conditions.213. Inspect the branch and working tree; preserve unrelated user-owned changes.224. Identify repository-native validation and run the smallest safe baseline23 that separates pre-existing failures from task regressions.2425For a long, cross-stack, or high-risk change, use the templates and failure26rules in [references/loop-contract.md](references/loop-contract.md).27When a task is expected to need repeated autonomous iterations or has an28explicit retry, time, token, or cost limit, also use29[references/loop-policy.md](references/loop-policy.md).30When a defect is intermittent, performance-related, difficult to reproduce, or31resists the first evidence-driven pass, use32[references/hard-debugging.md](references/hard-debugging.md).3334## Run the loop35361. Reproduce the defect, or capture the current behavior for a feature.372. Choose the smallest coherent change and the evidence that will prove it.383. Add a failing regression test first when practical.394. Implement one bounded change and run the narrowest relevant check.405. If an unplanned path or subsystem is necessary, explain the evidence and41 update the plan. Ask only when the change requires new authority or a42 material user decision; continue independent authorized work meanwhile.436. Classify failures as product, test, environment, or assumption failures;44 fix the cause and rerun the affected check.457. Run repository-required broader checks after focused checks pass.468. Review the complete diff first for task-contract compliance, then for code47 quality, regressions, security, and maintainability.489. Fix consequential findings and rerun checks affected by those fixes.4950Once acceptance evidence and required checks pass, broaden or repeat checks51only for new changes, failures, or unresolved concerns. Add tests when they52prove behavior or a meaningful invariant, not merely mirror a low-impact edit.5354Keep a compact ledger of confirmed facts, changed files, commands, outcomes,55and the next decision. Return concise diagnostics instead of full logs.5657## Stop conditions5859- If the same command fails twice for the same reason, stop retrying and60 re-check the environment, target, permissions, and underlying assumption.61- Stop recursive discovery when each new finding redefines the same task62 boundary. Freeze the discovered scope or return for a scope decision instead63 of repeatedly recataloging the repository.64- Stop and report a blocker when progress requires missing authority, secrets,65 unavailable infrastructure, an unauthorized destructive action, or an66 unresolved material product decision.67- When an explicit loop budget is exhausted, stop with the latest judge68 evidence instead of silently expanding the budget.69- Never make a failing check pass by weakening assertions, deleting coverage,70 hiding errors, or silently changing acceptance criteria.71- Do not query production, deploy, migrate, merge, or publish unless the user72 explicitly authorizes that action.7374If a skill instruction causes a pause, cite the exact file and instruction,75explain the unmet requirement, and check whether existing authorization76already satisfies it. Complete independently actionable work before handoff.7778## Finish with evidence7980Report:81821. behavior implemented or defect fixed;832. changed files and important design decisions;843. regression proof or acceptance evidence;854. focused and broader commands with outcomes;865. task-contract and code-quality findings fixed or explicitly unresolved;876. unrun checks, residual risks, and blockers.