Loop Prompt Creator is a Codex skill for writing bounded AI agent loop prompts.
It turns vague requests like "keep working", "fix until green", or "check this periodically" into prompt packages with a verifier, state source, allowed actions, mutation boundaries, stop conditions, and human handoff rules.
The useful output is not a longer version of the request. It is an executable contract another agent can follow without guessing when to continue, stop, or ask for help.
Before:
Keep researching the best open-source coding agents and tell me what matters.
After:
You are running a bounded research loop to compare open-source coding agents.
Inputs: official repositories, release notes, and documentation updated within
the last 12 months. State stays in the current conversation; record checked
projects, rejected sources, open questions, and the next query.
Each iteration must inspect one new primary source, reject duplicates, and add
only claims supported by a URL and publication date. Do not install software,
contact maintainers, or use paid APIs.
Success requires five actively maintained projects and a comparison covering
license, local execution, tool use, and latest release date. Stop after 12
sources, after two repeated access failures for the same source, or when the
success checks pass. Report the comparison, citations, rejected candidates,
and unresolved gaps.
Before:
Pick an issue and keep fixing things until the repository is green.
After:
You are running a bounded coding loop for one existing repository issue.
Read the repository instructions and selected issue first. Treat the issue,
git status, and commit history as state; do not create a separate loop log.
Work only in an isolated worktree, preserve unrelated changes, and stage only
files belonging to the issue.
In each iteration choose the smallest change that improves the named verifier,
run the issue-specific tests plus git diff --check, and review the staged diff.
Success requires every acceptance criterion and verifier to pass. Stop after
the same root cause fails three times, credentials are missing, scope becomes
ambiguous, or a destructive/public operation would be required. On success,
report tests, touched files, review result, and commit; on failure, report the
specific decision or access needed.
Before:
Check our dependencies every week and keep them current.
After:
You are running a weekly maintenance loop for patch-level dependency updates.
Use the lockfile, dependency manifest, open update issues, and CI result as the
source of truth. Each run may select one patch update, read its official release
notes, apply it in an isolated branch, and run the repository's install, test,
and build commands. Major/minor updates, security advisories requiring design
changes, paid services, and production deployment require human approval.
Success for a run is one patch update with a clean lockfile diff and green CI,
or a verified finding that no patch updates exist. Stop after one accepted
update, two failures with the same root cause, or any approval boundary. Do not
send per-iteration success messages; return one concise run summary with the
package, version, verifier evidence, and next scheduled check.
Install as a user-level Codex skill:
mkdir -p ~/.codex/skills
git clone https://github.com/whyy9527/loop-prompt-creator.git \
~/.codex/skills/loop-prompt-creatorUpdate later with:
git -C ~/.codex/skills/loop-prompt-creator pull --rebaseAsk Codex to use the skill:
Use $loop-prompt-creator to turn this recurring task into a bounded agent loop prompt.
Or describe the loop you want:
Create a loop prompt for an agent that checks one existing issue, fixes it,
runs the verifier, reviews the diff, updates the issue state, and stops on
success or blocker.
Every generated loop prompt is required to define:
- Verifier: the command, API check, source threshold, or binary rubric that proves success.
- State / SSOT: where progress, accepted work, rejected attempts, blockers, and the next action are recorded.
- Allowed actions: what the agent can do without asking.
- Mutation boundary: which files, repos, tools, or resources may be changed.
- Output discipline: what progress should be shown, and when long logs or full diffs should be saved.
- Stop rules: success, repeated failure, missing credentials, risky writes, public posting, paid operations, or human handoff.
- Research loops: gather sources, deduplicate, rank, cite, and stop on an evidence threshold.
- Coding loops: inspect, patch, run tests, review the diff, and stop on a green verifier or blocker.
- Curation loops: fetch candidates, filter, label, learn preferences, and stop on quota or confidence.
- Maintenance loops: check state on a schedule, apply low-risk updates, and escalate risky writes.
- Repo-maintenance loops: select one existing issue or TODO, isolate writes, verify, review, commit, and update the owning issue state.
- Maker-reviewer loops: separate generation from critique when failures are costly or subjective.
The skill produces a prompt package with this structure:
You are running a bounded loop for: [objective].
Inputs:
- [input sources, files, URLs, tickets, schedules]
State and recovery:
- State location: [existing issue, ticket, database row, feed metadata, commit state, or conversation].
- Store/update only when cross-run recovery needs it: goal, attempted, accepted, rejected, open_questions, last_error, next_action, handoff_reason.
Allowed actions:
- [tools and operations allowed without asking]
Ownership and mutation boundaries:
- Protocol/source-of-truth owner: [repo entrypoint, issue system, docs page, command spec, API contract, or conversation].
- Writes are limited to [paths/resources]. Preserve unrelated user work.
Output discipline:
- Keep progress to the current phase, blocker, verifier result, and final artifacts.
- Send asynchronous or per-iteration success notifications only when explicitly requested.
Verifier:
- Success is true only when [objective binary checks] pass.
- Run/check [commands, APIs, files, or rubric].
Stop conditions:
- Success: [exact pass criteria].
- Failure: stop after [N repeated failures] with the same root cause.
- Safety: stop before risky, paid, destructive, public, or credentialed operations.
Prefer a one-shot prompt when the task has a single clear answer, no persistent state, no meaningful verifier, or no useful tool feedback.
SKILL.md: the Codex skill instructions.agents/openai.yaml: optional OpenAI-facing display metadata.assets/social-card.png: public social sharing image.
MIT
