Design closed-loop prompts with Request-Validate-Resolve structure for reliable agentic workflows. Use when creating self-validating agents, adding feedback loops, or improving agent reliability through verification.
Design self-validating agents with Request-Validate-Resolve feedback loops. Use when building reliable agentic workflows that automatically detect failures and retry with fixes.
/plugin marketplace add melodic-software/claude-code-plugins/plugin install google-ecosystem@melodic-softwareThis skill is limited to using the following tools:
Guide for designing closed-loop prompts that ensure agent reliability through feedback loops.
Every agentic operation should follow the Request-Validate-Resolve pattern:
REQUEST → VALIDATE → RESOLVE
↑ ↓
└────────────────────┘
What task needs to be validated?
How do we know if it succeeded?
| Operation Type | Validation Mechanism |
|---|---|
| Code changes | Run tests, type check, lint |
| File operations | Verify file exists, check content |
| API interactions | Check response status, validate data |
| Build operations | Build succeeds, no errors |
What happens on failure?
Template:
## Closed Loop: [Operation Name]
### Request
[Clear task description with success criteria]
### Validate
- Command: `[validation command]`
- Success: [what success looks like]
- Failure: [what failure looks like]
### Resolve (if validation fails)
1. Analyze the failure output
2. Identify root cause
3. Apply minimal fix
4. Return to Validate step
5. Maximum 3 retry attempts
## Closed Loop: Implement Feature
### Request
Implement the user login feature according to spec.
### Validate
- Command: `pytest tests/test_auth.py -v`
- Success: All tests pass (exit code 0)
- Failure: One or more tests fail
### Resolve
1. Read failing test output
2. Identify which test failed and why
3. Fix the implementation (not the test)
4. Re-run pytest
5. Maximum 3 retry attempts
REQUEST: Write/modify code
VALIDATE: Lint + Type check + Tests
RESOLVE: Fix errors iteratively
REQUEST: Make changes
VALIDATE: Full build succeeds
RESOLVE: Fix build errors
REQUEST: Implement user flow
VALIDATE: E2E test passes
RESOLVE: Fix failing steps
Date: 2025-12-26 Model: claude-opus-4-5-20251101
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.