What problem does it solve? Producing high-quality artifacts (API specs, code, docs, configs) in a single pass often yields incomplete or inconsistent results. This Skill automates a strict multi-iteration refinement loop that plans, produces, evaluates against explicit rules, critiques failures, and refines until quality thresholds are met or iteration limits are reached. ## Core Features & Use Cases - Phased Reflex Loop: Executes PLAN, PRODUCE, PREPARE, EVALUATE, CRITIQUE, and REFINE phases with parallel Task agents and two-tier quality gates (Phase A and Phase B thresholds). - Persistent Resumable State: Stores loop state in run.json, history.jsonl, and artifact.md so loops can be stopped, resumed, listed, and cleaned across sessions. - Rule-Based Evaluation: Ships criteria templates for API specs, code, documentation, and configuration with severity-weighted scoring and stagnation detection. - Use Case: Ask for an OpenAPI 3.1 specification; the loop generates a draft, runs executable and content checks, critiques failures, and refines the spec until it passes the 0.8/0.9 thresholds. ## Quick Start Ask the AI to run /aif-loop new followed by your task, for example to iteratively generate an OpenAPI 3.1 spec with DDD notes and JSON examples.