porcupine-md/jonggrang/iterating-to-completion
Claude Code and agent skill by porcupine-md/jonggrang
- community
Checking that the SKILL.md file is still in the repository.
Prevents premature exit and infinite loops. Three mechanisms: Completion Promises, Scratchpads, Loop Detection.
Install
npx vskill@latest install porcupine-md/jonggrang/iterating-to-completionSKILL.md
Purpose
This skill prevents two failure modes:
- Premature exit — agent stops before success criteria are met
- Infinite loop — agent spins endlessly with no progress
Mechanism 1: Completion Promises
Every agent task has an explicit completion signal. The agent outputs this string ONLY when success criteria are truly met:
| Role | Signal | Meaning | |
|---|---|---|---|
| Lead | ARCHITECTURE_PLAN_COMPLETE | Architecture JSON is complete and valid | |
| Developer | IMPLEMENTATION_COMPLETE | Code compiles, lints pass, basic sanity checked | |
| Reviewer | REVIEW_COMPLETE | Review report generated (approved or rejected) | |
| Test Lead | TEST_PLAN_COMPLETE | Test plan JSON is complete | |
| Tester | ALL_TESTS_PASSING | All tests pass, coverage met |
Rule: Never output the completion signal unless the criteria are truly met. The orchestrator blocks on this signal.
Mechanism 2: Scratchpad Protocol
Maintain a scratchpad file at .jonggrang/.ephemeral/scratchpad-{task_id}.md:
Update this EVERY iteration. If you're stuck, the scratchpad shows why.
Mechanism 3: Loop Detection
The orchestrator reads your last 3 outputs. If similarity > 90%, you're stuck.
Signs you're stuck:
- Repeating the same command outputs
- The same error message appearing 3+ times
- Trying the same approach with minor variation
When stuck:
- Write to scratchpad: "STUCK: [reason]"
- Try a fundamentally different approach (not a variation)
- If still stuck after 2 more tries, output
BLOCKED: [reason]and stop
Iteration Limit
Max 10 iterations per agent spawn. After 10:
- Write current state to scratchpad
- Output
ITERATION_LIMIT_REACHED: [what's left] - Orchestrator will re-spawn you with fresh context and the scratchpad
Integration with Hooks
The feedback-loop.sh / OpenCode session.idle hook enforces this:
- If dirty bit is set and you output a completion signal without going through reviewer/tester, the hook blocks your exit.
- You must demonstrate the full cycle: implement → review → test → signal.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/core/iterating-to-completion/SKILL.md
Popularity
- Repository stars
- 3
- 7-day trend score
- 7
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 27 Apr 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/porcupine-md/jonggrang/iterating-to-completion)