aif-loop

Runs iterative generate-evaluate-critique-refine loops with quality gates and persistent state.

Updated Jun 5, 2026
One-click install
npx skills add https://github.com/1t1sCooL/zazyvala-bot --skill aif-loop-1t1scool
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aif-loop
Source: https://github.com/1t1sCooL/zazyvala-bot/tree/main/.cursor/skills/aif-loop
Command: npx skills add https://github.com/1t1sCooL/zazyvala-bot --skill aif-loop-1t1scool

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

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.

Frequently Asked Questions about aif-loop

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run an iterative refinement loop on a generated artifact?

Start a loop with /aif-loop new followed by your task description. The skill confirms success criteria and max iterations, then cycles through PLAN, PRODUCE, EVALUATE, CRITIQUE, and REFINE phases until thresholds pass or limits are reached.

How do I resume a stopped refinement loop after clearing context?

Use /aif-loop resume or /aif-loop resume <alias>. All state lives in run.json, history.jsonl, and artifact.md on disk, so the loop reconstructs its exact phase and iteration from files without losing progress.

What task types does the evaluation criteria template support?

CRITERIA-TEMPLATES.md ships rule sets for API specifications, code generation, documentation, and configuration files. Each template defines fail/warn severity rules with recommended Phase A and Phase B thresholds that are normalized before iteration one.

How is the quality score calculated in each iteration?

Score equals the sum of weights of passed rules divided by the sum of all active rule weights. Fail-severity rules weigh 2, warn rules weigh 1, and a pass requires both meeting the phase threshold and having zero failing fail-severity rules.

What happens when the loop hits the iteration limit without passing?

The loop stops with reason iteration_limit and status stopped. The final summary includes a distance-to-success block showing the numeric gap to threshold, remaining blocking rule IDs, and rules passed versus total.

When does the loop stop early instead of using all iterations?

The loop stops when Phase B passes, when no fail-severity rules remain failing, on explicit user stop, or when stagnation is detected (score delta under 0.02 for two consecutive iterations without blockers).