codex/skills/repeatedly-apply-skill/SKILL.md
Iteratively apply a named skill or slash command N times with progressive deepening. Use when "apply 10 times", "keep improving", "run again", iterative polish, improvement loop, or multi-pass refinement.
npx skillsauth add tkersey/dotfiles repeatedly-apply-skillInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Orchestrate N passes of any skill against a target. Each pass is delegated to a fresh subagent with a unique mission derived from the skill itself.
You are the ORCHESTRATOR. You do NOT apply the skill yourself.
You delegate each pass to a subagent via the Agent tool. This solves:
Before pass 1, read the target skill's SKILL.md (or understand the slash command's purpose). Then generate N missions that are specific to THAT skill. Do not use generic missions.
Example for /ui-polish:
Example for /ubs (bug scanner):
Example for building-glamorous-tuis:
The missions MUST come from the skill's domain, not from a generic template. Read the skill, understand its concerns, then subdivide those concerns into N passes.
Write .skill-loop-progress.md in the project root (NOT /tmp/):
# Skill Loop Progress
# Skill: [name]
# Target: [path]
# Total Passes: [N]
# Started: [ISO timestamp]
## Status: IN PROGRESS — Pass 1 of N
## Missions
1. [Mission 1 name]: [one-line description]
2. [Mission 2 name]: [one-line description]
...
N. [Mission N name]: [one-line description]
## Completed Passes
(none yet)
This file is the SINGLE SOURCE OF TRUTH. After compaction, read it first. It contains everything needed to resume.
CRITICAL: Passes are STRICTLY SERIAL. Each pass MUST complete and be verified before the next one starts. NEVER launch multiple passes in parallel — each pass builds on the previous one's changes. If you launch pass 3 before pass 2's changes are committed, pass 3 will operate on stale code and produce wrong or conflicting results. One subagent at a time. Wait for it to return. Verify. Commit. Then launch the next.
For each pass K from 1 to N:
Use the Agent tool. The prompt MUST include:
Agent prompt template:
Apply the skill [SKILL_NAME] to [TARGET].
MISSION for this pass: [Mission K name] — [description].
Focus EXCLUSIVELY on [mission focus]. Do not fix issues outside
this mission's scope — other passes will handle those.
Prior passes already addressed:
[list of completed mission names and key changes]
After making changes, report:
1. What files you changed and why
2. What issues you found in this mission's scope
3. What you checked but found already correct
After the subagent returns, YOU (the orchestrator) verify:
git diff --stat
Check that:
If the subagent claims "nothing found" but you suspect laziness: Re-launch with a more specific prompt targeting 2-3 concrete things within the mission's scope. One retry is allowed per pass.
git add [target-files] && git commit -m "skill-loop pass K/N: [mission name]"
Committing after each pass enables easy rollback and provides proof.
Append to .skill-loop-progress.md:
### Pass K — [Mission Name] — [timestamp]
- Files changed: [list]
- Changes: [brief summary from subagent report]
- Commit: [short hash]
- Verdict: PRODUCTIVE / ZERO-CHANGE / RETRY-NEEDED
Update the status line: ## Status: IN PROGRESS — Pass K+1 of N
| Condition | Required Evidence | Action | |-----------|------------------|--------| | Two consecutive ZERO-CHANGE passes | Two git diffs with no changes | Stop — convergence | | Thrashing | Same lines flipping back and forth | Stop — conflicting criteria | | Pass cap reached | K == N | Stop — complete | | User-specified quality target met | Tests pass, lint clean, etc. | Stop — goal reached |
No other stop conditions are valid. Proceed to pass K+1.
If context compacts mid-loop:
.skill-loop-progress.md from the project rootThe orchestrator does NOT apply the skill. Delegate to subagents. This prevents laziness accumulation across passes.
Each subagent gets ONE mission. Do not batch multiple missions into one subagent — each gets a focused, achievable task.
STRICTLY SERIAL execution. NEVER launch multiple subagents in parallel. Each pass changes the code; the next pass must see those changes. Launch one → wait → verify → commit → then launch the next.
No hollow passes. If a subagent reports "nothing found," its report must name 3+ specific things it checked and why they were correct. Otherwise, retry with a more targeted prompt.
Later passes are MORE valuable. The user already knows pass 1 finds obvious things. They're requesting 10 passes because passes 5-10 find what passes 1-4 miss. Treat later missions with MORE scrutiny, not less.
The progress file is authoritative. If it says you're on pass 6, you're on pass 6. Don't re-derive state from memory.
## Improvement Loop: [skill] × [K passes]
| Pass | Mission | Files | Key Changes | Commit |
|------|---------|-------|-------------|--------|
| 1 | [name] | 4 | [summary] | abc123 |
| 2 | [name] | 3 | [summary] | def456 |
| ... | ... | ... | ... | ... |
Stopped at pass K/N: [reason + evidence]
Total files modified: N | Total commits: N
If Agent tool is unavailable, apply the skill yourself but:
git diff --stat after every pass/ui-polish, /simplify, /ubs, building-glamorous-tuis,
react-best-practices, /ux-audit, interactive-visualization-creator,
de-slopify, /multi-pass-bug-hunting, /codebase-audit
tools
Invokes Apple's macOS 27 fm command-line tool from a local Mac to use the on-device system model or Private Cloud Compute, including instructions, image prompts, schema-constrained JSON, and noninteractive automation. Use when the user asks to run Apple Foundation Models through fm, compare system versus pcc, generate structured output, or automate fm without Swift or an app.
development
Compile historical Codex sessions into governed counterfactual evidence, evaluate an existing owner-applied candidate through blinded paired HCTP trials, and fold observable evidence into RUN, OBSERVE, or STOP. Use for `$hylo`, CRF extraction, counterfactual replay, source-governed direct or historical trials, sealed evidence, paired baseline/candidate evaluation, causal frontiers, or evidence-governed improvement.
testing
Ensure a `ledger` command is available on PATH; materialize, validate, record, replay, and project requested Actuating artifacts without taking semantic or execution authority; coordinate the shared Learnings/Synesthesia/Negative Ledger lifecycle checkpoint and repo-local source-memory reconciliation; address Universalist plans and receipts; and perform pure artifact validation.
testing
Classify and quotient review findings, failing tests, incidents, bug reports, migration failures, and other witnessed falsifiers against accepted intent and the current Construction. Author counterexample-set/v1 without selecting repairs, counting review credit, or granting mutation.