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
Convert markdown plans into beads with dependencies using br CLI. Use when creating task graphs, polishing beads before implementation, or bridging planning to agent swarm execution.
development
Orchestrate Codex skill optimization during active sessions through $cas goal control, $shadow single-session evidence, $tune diagnosis/refinement briefs, and the skill-optimizer custom subagent. Trigger for $opt, skill optimization loops, session-driven skill tuning, meta-skill audits, or explicit validated skill edits. Do not use for general code optimization, product optimization, or performance tuning.
development
Run a targeted fresh-eyes blunder pass over code, specs, plans, adjudications, closure gates, skill edits, or negative-evidence ledgers. Trigger when asked to reread with fresh eyes, find obvious bugs, catch mistakes/oversights/omissions, check for embarrassing misses, or perform a second independent blunder pass before closure. Do not use as a substitute for implementation, adjudication, or verification; use it as the final falsification/check pass for those workflows.
development
Explicitly shadow, tail, watch, follow, monitor, supervise, or companion exactly one Codex session id/path through `$seq`, then apply a named target skill as an interpretation/reporting/proposal/action lens until the watched session stops.