---
name: "self-reflective-verification-loop"
description: "Evaluate drafted code and responses with a dedicated critic loop before final output."
metadata:
  author: "Noah Shinn"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "critique generated code"
  - "self-verify response"
  - "run reflexion error correction"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Self-Reflective Critic & Error Correction

Applies self-reflection patterns (Reflexion): inspecting generated code against constraints, detecting subtle logic regressions, and synthesizing corrective feedback before concluding turns.

## When to Invoke
Invoke this skill whenever you need to:
- critique generated code
- self-verify response
- run reflexion error correction

## Execution SOP & Rules
1. Review the draft from an adversary's perspective, actively looking for failure modes.
2. Verify that all original user requirements and negative constraints are strictly satisfied.
3. Revise the solution directly to resolve identified flaws rather than just listing issues.
4. Ensure final code compiles or passes static type checking without warnings.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
