aif-loop

Execute multi-iteration Reflex Loops with PLAN, PRODUCE, EVALUATE, CRITIQUE, and REFINE phases.

Updated Feb 23, 2026
One-click install
npx skills add https://github.com/batFormat/sancrm-docs --skill aif-loop-batformat
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aif-loop
Source: https://github.com/batFormat/sancrm-docs/tree/main/.claude/skills/aif-loop
Command: npx skills add https://github.com/batFormat/sancrm-docs --skill aif-loop-batformat

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates complex iterative refinement processes, ensuring artifacts meet strict quality standards through multiple cycles of generation, evaluation, and improvement.

Core Features & Use Cases

  • Iterative Refinement: Improve any artifact (code, docs, specs) through a structured loop.
  • Quality Gating: Automatically checks against defined criteria, stopping only when quality gates pass or iteration limits are reached.
  • Use Case: You need to generate an OpenAPI 3.1 specification for a new API. Use this Skill to generate an initial spec, have it evaluated against correctness and completeness rules, critique any failures, and refine the spec until it meets your defined quality threshold.

Quick Start

Start a new iterative refinement loop for generating 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 iteratively refine an artifact until it passes quality gates?

Iterative refinement of an artifact is achieved by executing a strict multi-iteration Reflex Loop with PLAN, PRODUCE, EVALUATE, CRITIQUE, and REFINE phases to automatically check quality gates. This process repeats until your defined quality criteria are met or iteration limits are reached.

Does iterative refinement work for generating OpenAPI specifications?

Iterative refinement works for generating OpenAPI specifications by producing an initial spec, evaluating it against correctness and completeness rules, critiquing failures, and refining the artifact. This quality-gated generation cycle ensures the final specification meets your defined quality threshold.

How does state persistence work across multiple refinement sessions?

State persistence across multiple refinement sessions is managed using specific file contracts within the Reflex Loop. This mechanism ensures artifact state, evaluation criteria, and critique history are retained between iterations, allowing you to resume generate-critique-refine workflows seamlessly.

Can I apply quality gates to automatically critique and improve code and documentation?

You can apply quality gates to automatically critique and improve any artifact including code, documentation, and specifications. The structured loop evaluates the generated output against your defined criteria, automatically critiquing failures and refining the artifact until the quality gates are satisfied.

What happens when an artifact fails evaluation during the generate critique refine workflow?

When an artifact fails evaluation during the generate critique refine workflow, the process enters the CRITIQUE phase to identify failures, followed by the REFINE phase to improve the output. This cycle repeats automatically until the artifact passes the defined quality gates or reaches the maximum iteration limit.