loop
Use only when user explicitly invokes $loop.
What this skill does
# CodexPotter Loop
This is a control protocol for running subagents in a loop pattern to "reconcile" repo to fulfill the user request, which may be a complex task or target state.
When working in this pattern, subagents own all task execution, you are the orchestrator, you must:
- Do only the control actions this skill explicitly requires.
- Do NOT implement, review, fix issues, run checks, inspect repository.
## 1. Prepare handoff
Build a concise `initial_prompt` for the next LLM. Include user's request and context from previous conversation; do not inspect the repository to enrich it.
Structure `initial_prompt` with these sections:
```markdown
## Original User Request
<The user's original request, unchanged.>
## Important Context, Constraints, and User Preferences
<Supplied from previous conversation, if user's request is not self-contained.>
## Critical Data, Examples, and References
<Supplied from previous conversation, if user's request is not self-contained.>
```
Keep it concise, structured, and focused on helping the next LLM seamlessly continue the work.
`$loop` control flow instructions MUST BE EXCLUDED in `initial_prompt`, otherwise subagent will loop again.
Other skills like $xxx should be kept as is if they are part of the user request.
## 2. Create handoff file
2.1. Resolve the current git commit with `git rev-parse HEAD`, skip if not in a git repository.
2.2. Create handoff file:
```text
.codexpotter/projects_v2/{yyyy}_{mm}_{dd}_{slug}.md
```
where:
- `{yyyy} {mm} {dd}` is current local date
- `{slug}` is a short descriptive name generated from the user request (e.g., "add_login_feature", "fix_bug_123").
Do not overwrite an existing project directory.
2.3. Write handoff file in this shape:
```markdown
---
status: initial
finite_incantatem: false
git_commit: <current_git_commit> <-- leave empty if not in a git repository
---
# Overall Goal
<initial_prompt>
## In Progress
## Todo
## Done
```
## 3. Run the Rounds
Run at most 6 rounds by default (user can change via --rounds N). In each round, do the following:
1. Start one subagent using the `potter_worker` agent.
2. Prompt the subagent with handoff file path only:
```text
Work according to this handoff file: <path to handoff md file>
```
3. Wait for the subagent to finish.
4. Report last subagent message, keep it unchanged.
5. Read handoff file, stop if the frontmatter contains the literal value `finite_incantatem: true`
If potter_worker agent is not available:
This is a critical issue. Fail fast, do not use other alternative agents.
Ask user to follow https://github.com/breezewish/CodexPotter to setup.
If handoff file cannot be read:
Stop immediately and report the control-state problem.
Do not repair it in the parent agent.
If `finite_incantatem` is not true after a round and there are more rounds left:
Start the next round (even if subagent reports all tasks done).
## 4. Final Report
After the loop stops, report these to user (using bullet points):
- Total rounds run.
- State (one of):
- round limit reached
- finished (when finite_incantatem==true)
- git hash change (if available) (xxxxxx -> xxxxxx).
- Last subagent messages of each round, which is the work summary. Keep it unchanged.
- Overall summary (according to last subagent messages in all rounds).
Do not add implementation analysis, code review, extra verification, or recommendations beyond the loop outcome.
## How to resume
If what user passed in is an existing handoff file to resume (iterate more rounds), you should:
1. Reset handoff file status to `open`, finite_incantatem to `false`.
2. Follow the same steps in "3. Run the Rounds" section.
## How to continue
If current loop was paused / interrupted and user wants to continue, you could simply send `continue` prompt to the subagent.
## Feedback Principles
- Keep concise and structured way.
- Before start the loop, tell user: how many rounds to run, handoff file path (using bullet points).
- Do not mention this control flow details like "finite_incantatem", etc. User only know "rounds", "handoff file".
- Feedback using the same language as user request.
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.