aif-loop

Run multi-iteration reflex loops with PLAN, PRODUCE, EVALUATE, CRITIQUE, and REFINE phases.

Updated Mar 22, 2026
One-click install
npx skills add https://github.com/afterwork/arra-aif --skill aif-loop-afterwork
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aif-loop
Source: https://github.com/afterwork/arra-aif/tree/main/.cursor/skills/aif-loop
Command: npx skills add https://github.com/afterwork/arra-aif --skill aif-loop-afterwork

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Reflex loops enable structured, repeatable refinement of artifacts (prompts, docs, code) with strict phase contracts and persistent state, reducing manual drift and iteration overhead.

Core Features & Use Cases

  • Six-phase workflow (PLAN, PRODUCE, PREPARE, EVALUATE, CRITIQUE, REFINE) with parallel task execution where possible.
  • Persistent per-loop state across sessions: run.json, history.jsonl, and artifact.md are the single sources of truth.
  • Supports resume, stop, list, history, and clean operations for robust lifecycle management.

Quick Start

Start a new reflex loop by issuing /aif-loop new <your task prompt>.

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 generated artifacts?

Automate iterative refinement by running a strict multi-iteration Reflex Loop with PLAN, PRODUCE, EVALUATE, CRITIQUE, and REFINE phases to improve artifacts until quality gates pass or iteration limits are reached.

What is a generate critique refine workflow with persistent state?

A generate critique refine workflow with persistent state uses run.json, history.jsonl, and artifact.md as single sources of truth to enable structured, repeatable artifact refinement across multiple sessions.

How do I resume an iteration loop after stopping it?

Resume an iteration loop by issuing lifecycle operations like resume, stop, list, history, and clean, which manage persistent per-loop state to handle drift and iteration overhead.

Can I run parallel tasks during an artifact refinement loop?

You can run parallel task execution during the PRODUCE or PREPARE phases of an artifact refinement loop, optimizing the strict six-phase workflow for faster quality-gated generation.

When should I use quality-gated generation instead of manual iteration?

Use quality-gated generation when you need to reduce manual drift and iteration overhead, enforcing strict phase contracts to systematically improve documents, prompts, or code artifacts.