Skip to content
Back to skills

Work Loop

ASecurity

Take an INTENT.md and work, check, self-review and fix until every done item passes with real evidence, then hand back a branch plus a review handoff package. Use for big features or fundamental changes the user wants handed off and finished in full ("run the work loop", "loop on this intent", "take this to done"). Not for exploratory or taste-driven work such as UI style options.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 1, 2026
ai-agentsrustgotestinggitapisecurity

Works with

  • claude code
  • cli
  • api

Security analysis

A100/100

Pro scans all 8 files and shows the line behind each finding

Scanned December 4, 2026

npx -y skills add jerahsiegal-source/ai-implementation-skills --skill work-loop --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Work Loop?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Work Loop
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jerahsiegal-source-work-loop/badge)](https://www.skillsdirectory.com/skills/jerahsiegal-source-work-loop)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: work-loop
description: Take an INTENT.md and work, check, self-review and fix until every done item passes with real evidence, then hand back a branch plus a review handoff package. Use for big features or fundamental changes the user wants handed off and finished in full ("run the work loop", "loop on this intent", "take this to done"). Not for exploratory or taste-driven work such as UI style options.
---

# Work Loop

Finish the whole job described in `INTENT.md`, prove it the way the owner would check it by hand, review it independently, and stop: done, stuck, or at a gate. Never stop at slice 1 of 6, and never spiral.

Works the same in Claude Code and Codex. Best started under the tool's native `/goal` so it keeps going across turns (see this skill's README for the line to paste). Without `/goal`, run the same loop in-session.

## Ground rules

- **The brief is the contract.** Re-read `INTENT.md` at the start of every iteration. Work only toward its Done items. Respect Never and Stop-and-ask absolutely. Everything under "Yours to decide" is yours: decide, log the decision in one line, move on.
- **Evidence or it didn't happen.** An item passes only when its check ran in this session and the output is shown in the conversation (command output, screenshot, file path, numbers). The `/goal` evaluator and the reviewer see only what you show.
- **Check like the owner would.** User-facing items are proven by driving the real app or product: start the flow, finish it, open the result, inspect its content. Unit tests alone never pass a user-facing item.
- **Tests that bite.** Every new test must fail without the change and pass with it, and you show both: run it against the base version of the changed source files and paste the failure, then paste the pass on the branch. A test that passes without the change doesn't count. Never weaken, skip or delete an existing test or check to get green. Never edit item or check text in `done.json`.
- **Smallest change that meets the intent.** Build on existing patterns; no parallel paths, no drive-by refactors. Out-of-scope findings go to the found-not-fixed list. If an item's diff grows past twice the size you guessed at setup, write why in `progress.md` or cut it back before moving on.
- **One owner.** You own the brief, the integration and every Done item, even when helpers investigate for you (Setup step 2).
- **Visual items.** The look is decided before the loop (`DESIGN.md` or `/explore`); never choose between styles inside the loop. Build with the `design` skill's rules (or `visualize` for report pages). Every iteration that changes anything visual runs the design kit's [quality check](../design-kit/quality-check.md) as its check: the kit's automated scripts if present, desktop and phone screenshots, the list, and a critique. A visual item passes only when all of them pass with output shown in the conversation; otherwise fix and re-run (check, critique, fix), counting each round as an attempt. The regression check includes re-running these checks on pages already passed, so a later item can't break an earlier look.
- **User flows.** If `INTENT.md` has a **Who uses it** section, or a Done item is about people completing a task, its check is a `flow-ux` walk-through of that task (happy path, mistakes, keyboard, phone) when that skill is installed. Run it in fix mode: the item passes only when no severity 4 or 3 finding is left, with the screenshots shown. Fixes follow `design`'s rules. Without `flow-ux`, drive the flow by hand and show the screenshots.
- **Files are the memory, not the chat.** A long loop will be compacted. Anything you would need after that lives in `loop/`: where you are in `now.md`, item status in `done.json`, decisions and history in `progress.md`, and raw check output in `loop/evidence/`. If the conversation and the files disagree, trust the files.
- **Branch, small commits.** Work on a branch, never the default branch. One commit per passed item, so any layer can be rolled back alone. Pushing the branch is fine unless the brief says otherwise. Never deploy to production. Never delete data, branches or files others depend on.

## 1. Setup (once)

1. Read `INTENT.md` (path given by the user; default `./INTENT.md`). If there is none, or Outcome/Done/Never are missing, stop and suggest the `intent-brief` skill.
2. **Size up the work.** For each Done item, guess its size (files and lines) and log it. Then decide whether anything needs helpers (subagents):
   - Work alone by default. Routine building, small fixes and tightly linked changes stay with you.
   - Start read-only helpers only when separate investigation would clearly improve the result: mapping an unfamiliar codebase, testing several likely causes of a hard bug in parallel, or sketching a design choice two ways. Give each one narrow question. They report back and edit nothing.
   - Build in parallel only when parts share no files and you have written the interface between them first. You merge and check their work.
   - Log each helper and why in one line. Without subagents, do the same investigation yourself, one question at a time.
3. Create a state folder next to the brief, `<brief-folder>/loop/`, holding:
   - `done.json`: one entry per Done item, copied word for word:
     `{"id": "D1", "item": "...", "check": "...", "kind": "user-facing|code|judgment|regression", "status": "pending", "attempts": 0, "evidence": ""}`
     Only `status` (`pending|pass|blocked`), `attempts` and `evidence` may change after setup.
   - `progress.md`: an append-only log, plus three running sections: **Decisions** (choice + one-line why), **Found, not fixed**, and **Blocked**.
   - `now.md`: a short status card, rewritten in place (never appended), at most 25 lines: brief path, base and branch, phase (setup, build, review, finish), current item and attempt, the last thing done and its result, the exact next step, helpers still running, the regression check command, and the 1 to 3 facts you would hate to rediscover (a gotcha, a test account, a slow command to avoid).
   - `evidence/`: one file per check run worth keeping (`D3-check.txt`, `D3-base-fail.txt`, screenshots), so proof survives compaction. Point `done.json`'s `evidence` at these files and still show the key lines in the conversation.
4. Pick the base branch and create a working branch. Record both in `progress.md`.
5. **Baseline.** Run the project's existing test suite and checks, and record the results (what passes and what already fails). Define the regression check you will run after every item. If the full suite is too slow for every item, record which subset runs per item; the full suite runs at review and at finish.
6. If a check needs something gated (paid API calls, production, owner credentials), plan around it now: fixtures, recorded outputs or a local environment. If there is no way around it, that item will stop at the gate.
7. Print a short setup summary: the items and their size guesses, any helpers, base and branch, the baseline, and planned gates.

## 2. Build loop (repeat)

Each iteration:

1. Re-read `INTENT.md`, `done.json`, `now.md` and the tail of `progress.md`.
2. Pick the next `pending` item, respecting dependencies. Work on **one item** only.
3. Make the change. Run the item's check, then the regression check.
4. **Pass** (check met, nothing that was green turned red): set `status: pass`, record evidence, commit `D<n>: <item>`, log it.
   **Fail:** increment `attempts`, log what was tried and learned. After **2 failed attempts** on the same item, set `status: blocked` with the reason, and move on to the next independent item.
5. Rewrite `now.md` (also before any step that may run long, and before starting helpers), then print one status line: `D3 pass | 4/7 passing | 1 blocked`.

Stop rules, checked every iteration:

- **Stall:** two iterations in a row with no newly passing item → stop and report.
- **All remaining items blocked** → stop and report.
- **Never** about to be crossed → stop immediately and report; do not do it.
- **Stop-and-ask gate** reached → finish everything else you can, then print a stop report naming the gate and what is waiting on it. A stop report ends the `/goal` run, so the loop doesn't push past the gate.
- Running out of budget or time is not completion. Report it as a stop.

When every item passes, go to review.

## 3. Review (bounded)

1. Run the full test suite and compare it with the baseline.
2. Start a **fresh reviewer**: a new subagent given [the reviewer brief](references/reviewer-brief.md), `INTENT.md`, `done.json`, `progress.md` and the diff against base. The worker never reviews its own work. This review is part of the loop: its job is to send the work back until it is right, so the owner gets a working result without having to step in. Don't call the `review` skill from inside the loop; that is the owner's separate final check after handoff.
   - For any **Who uses it** task, the review walks that task fresh with `flow-ux` in review mode and reports findings by severity. For visual work, it also gets the final screenshots and scores "would a strong studio ship this", listing anything that reads as AI-made, in visuals or wording.
   - If the tool cannot start a subagent, say so, do a clearly labelled self-review, and in the final report ask the owner to run the final check before merging.
3. For each finding, record in `progress.md`: **fixed** (with evidence), **disagree** (with evidence), or **declined** (a nit, becomes a follow-up). Re-run the affected checks after any fix. Rewrite `now.md` after each round.
4. Run another round only while a blocker or should-fix is open. At most **3 rounds**; 5 only for security, auth, permissions or data loss. Stop early when only nits remain.
5. A finding still disputed after two exchanges goes to the owner in the handoff, with both sides in 2–3 lines. Do not agree just to end the loop.
6. If review grew the diff beyond the intent, cut it back.

## 4. Finish

1. Fetch the base branch and confirm the branch merges cleanly (rebase or merge, then re-run the full suite). Resolve conflicts by keeping both intents; if that isn't possible, stop and ask.
2. Push the branch. Open a PR only if the brief asks for one.
3. Write `<brief-folder>/loop/handoff.md` containing:
   - **Summary:** what was built, branch, commits.
   - **Done items:** each with its evidence.
   - **Not done:** blocked or gated items, with reasons.
   - **Decisions made:** each with a one-line why.
   - **Found, not fixed:** follow-ups and declined nits.
   - **Disputes for the owner** (if any).
   - **Final check:** how to run the owner's independent review before merging: `/review` (or `$review` in Codex) on the branch, and for a cross-model check, `/review report` in each tool followed by `/review compare` (see the `review` skill). Without the `review` skill, a prompt ready to paste into the other tool that points to the branch, the brief and this file and asks for review using the reviewer brief. Mark it **recommended before merging** when the work touched auth, payments, deleting data or personal data, or had any security finding.
   - **Staging test checklist:** the user-facing checks for the owner to repeat by hand.
4. If the `visualize` skill is installed, offer to turn `handoff.md` into a visual page.
5. Set `now.md`'s phase to `done`.
6. Print the final report in the conversation: items passing with evidence pointers, anything not done, and the path to `handoff.md`.

## Stop report (any early stop)

Print: why it stopped, items passed / blocked / pending, what is needed from the owner, and where state lives. Leave the branch and state files so a fresh session can resume from Setup step 1, reusing the existing `loop/` folder rather than rebuilding it.

## Resuming

If `<brief-folder>/loop/` already exists, do not recreate it. Read `now.md`, `done.json` and `progress.md`, re-run the baseline and regression checks on the current branch, and continue from the next pending item.

## After compaction

When the conversation has been compacted, summarised or cleared mid-loop (or you are unsure where you are), don't work from the summary. Before anything else: re-read this skill, then `INTENT.md`, `loop/now.md`, `done.json`, and the Decisions, Found-not-fixed and Blocked sections of `progress.md`. Check `git status` and the last commit against `now.md`; if they disagree, the repo wins, so fix `now.md`. Then do the next step `now.md` names. Uncommitted work from before compaction counts as unchecked: re-run its check before marking anything passed.

Files in this skill

  • README.md1.8 KB
  • SKILL.md9.1 KB
  • agents/openai.yaml147 B
  • evals/evals.json963 B
  • evals/fixtures/DESIGN.md369 B
  • evals/fixtures/INTENT.md660 B
  • evals/trigger-evals.json1.1 KB
  • references/reviewer-brief.md1.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.