aif-loop

Orchestrate iterative artifact refinement through PLAN, PRODUCE, PREPARE, EVALUATE, CRITIQUE, and REFINE phases.

56|3|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/lee-to/ai-workspace --skill aif-loop-lee-to
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aif-loop
Source: https://github.com/lee-to/ai-workspace/tree/main/.claude/skills/aif-loop
Command: npx skills add https://github.com/lee-to/ai-workspace --skill aif-loop-lee-to

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Reflex loops automate iterative refinement of artifacts by enforcing structured phase work and persistent state across iterations.

Core Features & Use Cases

  • Enforces a strict PLAN → PRODUCE → PREPARE → EVALUATE → CRITIQUE → REFINE cycle to improve artifacts.
  • Supports phase transitions (A to B) and configurable stop conditions, with audit trails stored on disk.
  • Ideal for multi-iteration quality gates in API design, code generation, and documentation tasks.

Quick Start

Start a strict reflex loop to iteratively plan, produce, evaluate, critique, and refine an artifact.

Frequently Asked Questions about aif-loop

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

FAQPage Schema
How do I automate iterative refinement for AI-generated artifacts?

Automate iterative refinement using a strict PLAN to REFINE cycle. This enforces phase contracts across iterations, maintaining artifact integrity and storing a verifiable audit trail on disk.

What is a reflex loop in AI artifact generation?

A reflex loop is a structured phase sequence enforcing PLAN, PRODUCE, PREPARE, EVALUATE, CRITIQUE, and REFINE. It automates quality gates for artifacts and maintains persistent state across multiple iterations.

How do I enforce strict quality gates during code generation iterations?

Enforce strict quality gates by applying configurable stop conditions and evaluation rules during the EVALUATE and CRITIQUE phases. The loop transitions artifacts through phases until quality criteria are met.

Can I use phase contracts to maintain artifact integrity across iterations?

Phase contracts maintain artifact integrity by enforcing strict transitions from PLAN to REFINE. The loop persists state and history on disk, ensuring verifiable iteration tracking for API design and documentation.

Does the reflex loop load context from existing project references?

The reflex loop loads context from project references when available. This contextual data informs the PRODUCE and EVALUATE phases, ensuring generated artifacts align with existing project constraints and requirements.

When should I use an iterative AI loop with strict gates for documentation tasks?

Use an iterative AI loop with strict gates when documentation requires multi-iteration quality checks. The structured EVALUATE and CRITIQUE phases ensure artifacts meet verifiable standards before phase transitions complete.