Engineering

Coding agent loops

Coding agents work best when the repo gives them evidence: tests, logs, docs, diffs, browser checks, and a clean stop condition.

Abstract coding agent worktrees with CI signals and maker-checker split

Engineering loop library

LoopCategoryDifficultyCadenceVerification
API Contract DriftEngineeringIntermediateAfter API changes or SDK releasesServer behavior, client types, examples, and docs agree on request/response contracts.
Acceptance Scenario LockstepEngineeringIntermediateBefore and during ambiguous feature workThe same scenarios written before implementation pass after the change, and any scope expansion is explicitly approved.
Agent Instructions After-ActionEngineeringBeginnerAfter a successful or painful agent coding sessionRepo instructions contain only reusable, source-grounded lessons and the next similar task can start without rediscovering the same trap.
Architecture Rubric RefactorEngineeringAdvancedWhen architecture work has a defined scopeScoped module meets the written rubric, tests pass, and unresolved objections are explicit.
Behavior Ladder TDDEngineeringIntermediateWhen implementing logic-heavy featuresEach behavior test fails before implementation, passes after the smallest change, and remains green through final refactor.
Bug Report to Repro KitEngineeringIntermediateWhenever a customer, teammate, or monitor surfaces a bug that is too vague to fix safelyThe kit contains a minimal repro path, environment notes, expected versus actual behavior, captured evidence, and either a failing test/script or a clearly marked blocker; no customer reply, public issue, or production change is sent without approval.
CI OptimizationEngineeringAdvancedMonthly or when CI is painfulCI p50/p95 improves against the same workflow without weakening tests or hiding failures.
Claude Code Repo ReadinessEngineeringBeginnerBefore major agent workRepo has agent instructions, documented commands, architecture notes, risk areas, and a docs/loops scaffold.
Cold Load TrimEngineeringAdvancedWhen first visit feels heavyInitial screen downloads fewer bytes while screenshots and behavior remain unchanged.
Completion Promise LoopEngineeringIntermediateFor scoped implementation tasks where half-finished output is the main riskEvery acceptance criterion is checked with tests, browser evidence, logs, screenshots, or a clear blocker report before the agent stops.
Feature Flag Retirement SweepEngineeringIntermediateMonthly or after a rollout stabilizesEach reviewed flag has an owner, purpose, current state, and retirement decision; removed flags pass tests and require approval before production config changes.
Fresh Clone OnboardingEngineeringIntermediateBefore onboardingA clean machine reaches the documented ready state using only the README.
Parallel Agent Worktree SweepEngineeringAdvancedWhen several independent repo improvements can run at onceEach agent branch has isolated scope, passing checks, a summary, and no conflicting files before integration review.
Project Docs FreshnessEngineeringBeginnerNightly or after meaningful code changesChanged behavior, APIs, CLI commands, config, and workflows are reflected in docs. Docs checks pass.
Reference Oracle ImplementationEngineeringAdvancedBefore implementing tricky behavior with an external source of truthGenerated outputs match the reference oracle across the agreed fixture set, with tolerances documented for legitimate differences.
Schema Migration Dry RunEngineeringAdvancedBefore production database migrations or bulk data changesMigration runs cleanly on a recent snapshot or staging clone, row counts and sample records match expectations, rollback is documented, and production execution remains approval-gated.
Spec to Task ShardsEngineeringIntermediateBefore multi-file feature work or migrationsA written spec, non-goals, acceptance checks, and ordered task shards exist before implementation begins.
Test Flake StabilizerEngineeringIntermediateWhen tests are inconsistentThe repaired test and full suite pass for the required consecutive-run streak.
Test and Logging CoverageEngineeringIntermediateWeekly or before releaseCritical flows have useful tests and structured logs for representative success and failure paths.
Trace-First DebuggingEngineeringIntermediateWhen an agent is tempted to patch a bug from a hunchThe bug is reproduced, the root cause is evidenced by traces or tests, and the fix includes a regression check.
Webhook Replay HarnessEngineeringIntermediateWhen webhook integrations fail, drift, or need safer changesA captured or synthetic payload replays through a non-production handler, expected state changes match assertions, idempotency is proven, and live provider/customer side effects remain approval-gated.

When to use a coding loop