# Closed Loop Prompt

> Self-correcting prompts with embedded verification.

- Skill: `cleanexpo/closed-loop-prompt` (Agent Skill)
- Install (CLI): `npx skillmds@latest add cleanexpo/closed-loop-prompt`
- Raw SKILL.md: https://api.skillmd.com/api/skills/cleanexpo/closed-loop-prompt/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: cleanexpo (https://skillmd.com/u/cleanexpo)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/cleanexpo/closed-loop-prompt

---


# Closed-Loop Prompting

Embed verification INTO the prompt:
1. Build X
2. Run Y to check
3. If Y fails, fix and retry
4. Max 3 attempts

## Patterns
- Test-Fix Loop: implement -> test -> fix -> retest
- Build-Verify-Iterate: build -> verify output -> fix discrepancy
- Multi-Step Cascade: phase 1 verify -> phase 2 verify -> integration verify

