AiImported version
Prompting Loops
/Users/fabien/Desktop/AI/PROMPTS/-ai/-fable5/-prompting-loops.odt
Folder-ai/-fable5
Versions0
Imported2026-07-10
StatusActive
## Prompt Templates ### Task Framing "I'm working on [the larger task] for [who it's for]. They need [what the output enables]. With that in mind: [your actual request]." ### Mid-Task Check-Ins "Pause the work every [time interval] - give me a mini update so I can ensure we are on the right track. If you need anything from me, let me know so I can steer us in the right direction." ## Token Efficiency: The 10-80-10 System ### Planning (10%) Use your top-tier model to define the structure, approach, success criteria, and constraints of your project upfront. ### Execution (80%) Hand the actual grunt work to a cheaper model. This is where most tokens get burned, and it's overkill to pay top-tier prices for it. ### Review (10%) Bring your top-tier model back to check the finished output against the original plan. ## Loops ### /goal Perfect for tackling single tasks (think: research, simple tasks with a single outcome). ``` /goal get the homepage Lighthouse score to 90 or above, stop after 5 tries. ``` ### /loop How to run on a schedule or for deep, complex tasks. ``` /loop [your prompt] --interval 30m --expires 8h ``` Combine loop engineering with the 10-80-10 system: the top-tier model architects the loop, a cheaper model executes it, and the top-tier model steps back in only when the loop closes or when something needs review. ``` /loop 5m check my PR, address review comments, and fix failing CI ``` ### /schedule `/loop` runs on your computer, so if you turn it off, it stops. You can move the loop to the cloud by creating a routine with `/schedule`. ``` /schedule every hour: check the project-feedback channel for bug reports. /goal: don't stop until every report found this run is triaged, actioned, and responded to. When fixing a bug, use a workflow to explore three solutions in parallel worktrees and have a judge adversarially review them. ``` ## The Six Parts of Every Loop 1. **Trigger:** What starts the loop. Usually `/schedule` or `/loop`. 2. **Execution Layer:** Where the actual work happens (no manual intervention needed here). 3. **The Verifier:** A checkpoint that confirms the agent is on track. 4. **Stop Rules:** Every loop needs a success condition and a failure condition. > "Max 20 attempts. If all tests pass, report TASK_COMPLETE and stop. If unresolved after 3 retries, report TASK_FAILED and stop." 5. **Memory:** A markdown progress file logging what's been done. 6. **Skills (CLAUDE.md):** Saved instructions that freeze project context so the agent doesn't relearn it every run. ## Putting It All Together ``` /loop [verifiable end state], only touching [scope], stop after [X] iterations, use [skill] for verification, and keep a memory file of all your work. ``` ## Verification Make stop rules explicit in your instructions, not implicit: > You have a maximum of 20 attempts. If all tests pass, report "TASK_COMPLETE" and stop. If you encounter an error you cannot resolve after 3 retries, report "TASK_FAILED: [reason]" and stop. Example: ``` /loop all tests in the auth module pass and coverage is above 80% ``` ## Final: Optimal Loop Structure ``` TRIGGER → every 15min / on PR comment / on CI failure DOER → the agent works the task CHECKER → separate model grades the output STOP → all tests green, or 10 iterations, or $5 spent MEMORY → progress.md updated each run SKILLS → CLAUDE.md read on every session start ``` Example: ``` /loop [verifiable end state/time], only touching [scope], stop after [X] constraints, use [X] Skills, use verifier agents for [x] checkpoint, and keep a memory file of all your work. ``` ### Full Example **CLAUDE.md (set once):** - Research style: comprehensive, cited, no fluff - Output format: markdown with clear headers - Never create files outside `/research` - Preferred sources: primary sources, reputable publications, official data - Max budget per session: $3 **Skill (set once):** ``` /skill verify-research: before marking any section complete, confirm every major claim has a source, every section has at least 3 supporting data points, and there are no obvious gaps. Never hand back thin research. ``` **The loop:** ``` /loop every 30 minutes, only touching /research/brief.md, stop after 10 iterations or if the same search query appears 3 times in a row without new information surfacing, use the verify-research skill after each section is drafted, use a verifier agent to check source quality and coverage completeness at the halfway point and before final submission, and keep a memory file at /research/progress.md that logs what sections are done, what sources have been used, and what angles still need coverage — read it at the start of every run and update it at the end. Topic: [your topic here] ``` Every principle in one place: the loop runs on a timer, stays scoped to one file, stops itself on stall or budget, uses a saved skill as the quality gate, spins up a separate verifier at two checkpoints, and keeps a persistent memory file so each run picks up exactly where the last one stopped.