Skip to complete skill
Free community skill@steipete

Design Loops Instead of Prompts — Peter Steinberger Workflow Skill

Independently compiled by XSkills from public material by Peter Steinberger.

Turn a repeatable coding task into a bounded agent loop that discovers work, acts in isolation, verifies the result, records state, and stops safely.

Skill brief

Is this the right skill?

Use it when

  • You repeat the same bounded coding task often enough to automate it.
  • You can define a machine-checkable result, budget, and stopping condition.
  • You want the system to choose and prompt the next agent task for you.

What you get

  • Runnable loop contract
  • Durable iteration and decision ledger
  • Accepted changes with verification evidence

Workflow

6 moves
  1. 01

    Choose loop-worthy work

  2. 02

    Define done and stop

  3. 03

    Create the loop state

  4. 04

    Discover and dispatch

  5. 05

    Verify before accepting

  6. 06

    Repeat, report, or escalate

Complete instruction set

Complete SKILL.md

Read every instruction below or copy the complete file directly into your agent.

steinberger-loop-engineering

Design the system that prompts the coding agent instead of manually supplying every next prompt.

Choose work that deserves a loop

Start with one task that is:

  • recurring rather than one-off;
  • narrow enough to isolate and revert;
  • driven by a discoverable queue, query, event, or schedule;
  • verifiable through tests, builds, linters, policies, or another deterministic signal;
  • inexpensive enough to survive failed attempts inside a fixed budget.

Do not begin with work whose acceptance depends mainly on taste, broad product judgment, or an agent grading its own prose. Run the first version in report-only mode when the failure surface is not yet understood.

Write the loop contract

Define these fields before the first iteration:

FieldRequired decision
GoalThe single recurring outcome the loop advances
DiscoveryHow one eligible work item is selected
Writable surfaceFiles, branch, worktree, or sandbox the agent may change
AcceptanceCommands and signals that prove the item is done
BudgetsMaximum iterations, elapsed time, tokens or spend, and retries
No-progress ruleThe repeated state or failure that must halt the loop
AuthorityActions that still require a person, such as merge or release
EscalationThe evidence the loop must return when it cannot proceed

Never allow the prompted agent to weaken the evaluator, broaden its own permissions, change its budgets, or redefine done.

Keep state outside the conversation

Persist enough state for a fresh agent to resume safely:

  • goal and loop version;
  • selected item and isolated workspace;
  • attempt number, prompt, and accepted base revision;
  • changed files and tool calls worth retaining;
  • verification output and decision;
  • total elapsed time and spend;
  • remaining items, stopping reason, and escalation status.

Use an append-safe ledger or state file. Conversation history may be helpful context, but it is not the source of truth.

Run one iteration

For each iteration:

  1. Read the contract and durable state.
  2. Stop immediately if a completion, budget, no-progress, or escalation condition already holds.
  3. Discover or select one eligible item that is not already accepted or exhausted.
  4. Create or restore its isolated writable workspace.
  5. Prompt the agent with the goal, item, constraints, prior evidence, and exact verification commands.
  6. Inspect the resulting diff and run every required check outside the agent's claims.
  7. Accept and record the revision only when all acceptance checks pass.
  8. Otherwise revert, record the failure, and retry only when the contract still permits it.
  9. Persist the new state before selecting another item.

Do not stack multiple unverified items into one iteration. A loop becomes harder to trust when it cannot attribute a result to one bounded attempt.

Stop or escalate safely

Stop when the queue is complete, the scheduled unit of work succeeds, any budget is exhausted, repeated attempts make no progress, infrastructure becomes unreliable, or the next action exceeds authority.

Return:

  • accepted items and revisions;
  • exact checks and results;
  • rejected attempts and useful failure evidence;
  • time, iteration, and spend totals;
  • the stopping reason;
  • the smallest human decision needed next.

Keep merge, release, production mutation, destructive rollback, credential changes, and material scope expansion behind explicit human authority unless the user has separately authorized them.

Source attribution

Independently compiled by XSkills from Peter Steinberger's public post about designing loops that prompt coding agents. Steinberger did not author or review this skill. The shift from manually prompting coding agents to designing loops that prompt them comes from the source. The work-screening criteria, contract, durable-state schema, iteration protocol, verification boundary, budgets, and stopping rules are XSkills adaptations. Attribution does not imply endorsement.

Keep exploring

Related agent skills

Browse software engineering skills

Turn an X workflow into your own skill.

Paste a public X post and get a free SKILL.md.

Build one free

Evidence and package

Source, changes, and version

Source

XSkills independently compiled this from public material by Peter Steinberger. Attribution does not imply endorsement.

Open source evidence ↗

What XSkills changed

XSkills additions are labeled in the complete SKILL.md.

Limitations

  • Do not loop work whose acceptance depends mainly on taste, ambiguity, or unreviewed model judgment.
  • Never let the agent weaken its evaluator, expand its own permissions, or move its stopping conditions.
  • Cap iterations, elapsed time, token or monetary spend, and repeated failures before the loop starts.

Version

Package version
Not assigned
Fingerprint
1bdf4d3ff668
Last reviewed
Not recorded
License
Not specified