Implement an approved INTENT.md end to end, verify every acceptance item, resolve material review findings, and deliver the branch and evidence. Use when asked to run Work Loop or take a substantial approved intent to completion, with or without a Codex Goal.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Work Loop?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/jerahsiegal-source-work-loop-ai-implementation-skills)
---
name: work-loop
description: Implement an approved INTENT.md end to end, verify every acceptance item, resolve material review findings, and deliver the branch and evidence. Use when asked to run Work Loop or take a substantial approved intent to completion, with or without a Codex Goal.
---
# Work Loop — Codex
Own the entire approved outcome, not the next slice. Choose the implementation yourself. Keep doing useful authorized work until every acceptance item and the final review are satisfied, or a genuine stop condition applies. Do not hand back a plan, partial implementation, or a list of next steps as a completed run. Do not make the owner manage the loop.
The completion condition is the verified handoff in §4. Use an active Codex Goal for this same brief when available. For a new persistent run, the user can start it in one message: `/goal Use $work-loop to execute the approved INTENT.md through the verified loop/handoff.md. Keep working while an authorized path can make progress.` Create a Goal only with an explicit user request and a supported control. Without a Goal, continue the work in the current turn. Keep the same durable state in either mode.
## Contract and authority
- `INTENT.md` controls the outcome, scope, proof and boundaries. Follow higher-priority instructions and actual tool permissions. Do not alter the brief, acceptance items or expected checks to make them easier to pass.
- Everything under Yours to decide is delegated. Resolve routine ambiguity, choose reasonable reversible defaults, log material decisions, and execute. Ask the owner only for a real Stop-and-ask gate or essential input that cannot be inferred or safely obtained.
- Preserve unrelated changes. Use the existing project patterns and the smallest coherent change that meets the full outcome. Record unrelated opportunities; do not implement them.
- Never deploy to production, modify production data, merge, force-push, delete others' work or exceed authorized spending. Respect any stricter brief limits. Tool approval requirements remain binding; use permitted alternatives, not bypasses.
- A claim passes only with observed evidence. For user-facing items, drive the actual flow, inspect the resulting content/data and capture the important proof. For a targeted regression test, demonstrate fail on base and pass on the change when feasible; characterization tests may pass on both when their stated purpose is to protect existing behavior. Never weaken existing checks.
## 1. Initialize or resume
Read the approved `INTENT.md` (default `./INTENT.md`) and applicable `AGENTS.md`, repo instructions and test documentation. If no valid brief exists or its material outcome is ambiguous, use `$intent-brief` or ask for the missing contract; do not invent one. If a valid brief was provided with execution authorization, do not stop for another planning approval.
Resolve an existing loop before choosing a branch or worktree. For a new loop, choose a working branch or worktree consistent with the user’s instructions and preserve pre-existing changes. If the brief lives in another checkout, identify its authoritative path and the execution checkout. Record the base SHA and both paths before the first edit. Run checks in the execution checkout.
Use `<brief-folder>/loop/` as durable state. If it exists, recover rather than replace it. Otherwise create:
- `done.json`: a JSON array with one entry per Done item, preserving the item and evidence requirement verbatim. Use the existing fields: `{"id":"D1","item":"...","check":"...","kind":"user-facing|code|judgment|regression","status":"pending","attempts":0,"evidence":""}`. Update status (`pending|pass|blocked`), attempts and evidence as work progresses. If the owner changes the contract, reconcile the ledger against the revised brief and log the change and any invalidated evidence.
- `progress.md`: append-only progress log plus Decisions, Found, not fixed, and Blocked sections. Log meaningful advances, hypotheses eliminated, evidence, and the reason an item is blocked.
- `now.md`: at most 25 lines. Include `Phase: <phase>`, brief path, base, working branch/worktree, current item/attempt, last observed result, exact next action, helpers, regression command and critical facts. Rewrite after every material step and before long tool calls.
- `evidence/`: raw command output, test results, screenshots and other proof. Use stable paths and record the relevant commit/state and check result. Never store secrets or real customer data in evidence.
Run and record the relevant baseline tests. Distinguish existing failures from regressions. Define the fast regression check for iterations and the broader suite for final verification. If something is slow or requires paid services, use authorized fixtures/local resources where sufficient; clearly label any evidence gap. Identify independent acceptance items that can proceed even when another is gated.
Keep the working plan in the state files. Use `/plan` or a planning-only mode only if the user requested planning. Run implementation directly in a mode that permits edits. Delegate narrow independent work when authorized and supported. The main agent owns integration and proof.
Send a short starting status, then execute immediately.
## 2. Build, check, fix and continue
Repeat while authorized actionable work remains:
1. Read the brief, ledger, current state and relevant recent log. Select an actionable pending item, including its prerequisites. Keep implementation focused, but do not artificially split a tightly coupled fix.
2. Investigate only enough to choose the next defensible action. Implement it. Use real tools to advance the task; do not substitute narrative for execution.
3. Run the item's acceptance check and relevant regression checks. For visual work, find the installed `design-kit` quality checklist and apply the project's design rules. For user journeys, use `$flow-ux` when available or drive the journey yourself using the project's browser harness or Codex browser tools. Inspect the actual resulting state and capture desktop and mobile evidence where relevant.
4. On pass, save proof, mark `pass`, and commit the logical change when Git authority permits. On failure, record observed output, increment attempts and decide the next evidence-supported approach. Preserve prior passing outcomes; if invalidated by later changes, return the item to pending and re-prove it.
5. Update `now.md`, the ledger and progress log. Report a short status when useful, then continue without waiting for the owner.
### Persistence and meaningful progress
A new passing item is one kind of progress, not the only kind. Meaningful progress includes a reproduced failure, a ruled-out hypothesis backed by a check, a verified prerequisite, a material implementation advance, a narrower failure, or a newly verified behavior. Re-reading files or repeating the same failing command without a new hypothesis is not progress.
After two unsuccessful approaches on an item, perform a short diagnosis checkpoint: what changed, what was learned, which concrete approach is still available, and what would disprove it? If a materially different, evidence-supported path remains within scope and authorized limits, take it. Otherwise mark the item blocked with evidence. Treat attempt counts, elapsed time, and usage as diagnostic signals. They do not end the run while meaningful work can continue, unless an explicit limit applies.
If the current item cannot proceed, do the next independent item. Do not stop the entire loop while another authorized acceptance item can be advanced. After two consecutive cycles with no meaningful progress, do one focused recovery pass (inspect the actual failure, choose a distinct feasible approach or identify a real missing prerequisite). If it yields no defensible path, mark the affected work blocked. Do not repeat recovery indefinitely.
No speculative enhancements, repeated plans, open-ended audits or perfection passes. Respect explicit budgets, time limits, user interruption and permission denials. If a required check cannot run, label it unverified rather than manufacturing proof.
## 3. Integration and independent review
When every actionable build item is passing, run the broad integration and regression checks against the baseline. If a regression or failed gate is discovered, reopen the relevant item and fix it rather than hand back a known incomplete result.
Review the resulting diff using [the reviewer brief](references/reviewer-brief.md). When a fresh context is supported and authorized, give a read-only reviewer only the brief, acceptance ledger, evidence paths, exact diff and reviewer instructions. In Codex, use a clean fork or minimal-context subagent when available. Keep the full `$review` workflow for a separate audit after handoff.
Reviewer contract: independently verify intent fit, complete acceptance coverage, evidence integrity, regression results, actual user journeys, security and data boundaries, integration, unnecessary duplication and scope. Report `APPROVE` or `CHANGES` with concrete file/line or reproducible evidence, severity (`blocker`, `should`, `nit`), and the smallest justified fix. A blocker or should-fix is a material issue, not a preference. Never edit or push as the reviewer.
If no fresh context is available, perform a clearly labeled same-context self-review and record the limitation. If an independent review is a mandatory gate in the brief, do not claim that gate passed without one.
Resolve supported material findings; re-run affected acceptance checks and regression tests. Record fixed findings with proof, rejected findings with counterevidence, and nits as follow-ups. Review only unresolved findings and new changes on subsequent passes. Apply the no-progress diagnosis and recovery process to stalled review findings. Keep fixing and rechecking while a defensible path exists. Do not silently convert a disputed finding into a nit.
## 4. Final completion audit and handoff
Before finalizing, independently inspect the actual state, not just the model's previous summary:
- Every original acceptance item is present and passed with evidence that matches the check.
- Required user-facing and integration checks were executed against the final relevant state; screenshots/results were inspected. Required tests pass and baseline regressions are resolved.
- No material review finding remains open. Required review independence was satisfied; limitations are explicit.
- No hard limit was crossed, no unrelated edits were overwritten, and the branch/diff contains the intended result.
- Required branch deliverables and commits exist. Fetch/update the base and check integration if permitted and required. If rebasing changes the relevant state, re-run checks. Push or open a PR only with user authorization. Record local delivery and the status of any required remote handoff.
If any requirement is unmet and actionable, perform its next action before sending a final reply. Passing tests, a passing ledger, and a review approval are intermediate results. Write `<brief-folder>/loop/handoff.md` with the summary, base/branch/commits, each Done item and decisive proof, review outcome, test results, material decisions, out-of-scope findings, owner gates, and any relevant manual checks. Include `$review report` for a separate owner-initiated audit where useful.
Read the handoff and ledger back from disk after writing them. Confirm that the handoff covers every original Done item, that the ledger gives passing evidence for each, and that the proof points to the final relevant state. Repair any missing or stale proof. Only then write `Phase: done` to `now.md` and complete a matching native Goal. Report the completed scope and evidence paths succinctly. A missing handoff means the next action is to finish it in this run, even if all application work is already complete.
## 5. Legitimate incomplete termination
Stop incomplete only for an explicit owner gate, an enforced user or runtime limit, a verified unavailable prerequisite, exhausted meaningful approaches after focused recovery, or user interruption. Where safe, first complete all independent actionable work. Name the exhausted approaches and the observations that ruled them out before concluding that another attempt would only repeat work.
Record phase `blocked` or `stopped`, the exact reason and evidence, passed/blocked/pending counts, remaining work, smallest action that would unlock it and the resume path. The loop phase is local state. Update a native Goal's blocked or paused status only when the runtime's requirements for that transition are met. Leave the objective intact for a resume.
## 6. Resume and compaction
On an automatic Goal or hook continuation, compaction, user resumption, or uncertainty about state: re-read this skill, `INTENT.md`, `loop/now.md`, `done.json` and relevant progress/evidence. Reconcile with `git status` and the last commit; if they differ, the actual repository and observed evidence win. Verify previously uncommitted or invalidated work, then perform the next actionable step. If only final audit and handoff remain, start there. Do not reset the ledger, rerun irrelevant discovery or repeat all tests solely because context changed.
If trusted Codex lifecycle hooks are configured, follow their recovery or completion requirements within the user's authorization. The files above support resumption with or without hooks.