aif-loop

Execute a six-phase reflex-loop workflow to iteratively refine artifacts.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Automates a formal reflex-loop workflow that iteratively refines an artifact through well-defined phases (PLAN, PRODUCE, PREPARE, EVALUATE, CRITIQUE, REFINE), enabling quality-gated generation and persistent state across sessions.

Core Features & Use Cases

  • Six-phase loop with parallel PRODUCE and PREPARE, and parallel evaluation of independent checks.
  • Strict persistence model (artifact.md, run.json, history.jsonl) with deterministic history.
  • Flexible stop criteria (thresholds, iteration limit, stagnation) and post-loop artifact handling.

Quick Start

Start a new loop with /aif-loop new <task> to begin iterative refinement, or /aif-loop resume to pick up a paused loop.

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 API specs and code artifacts?

A reflex-loop workflow automates iterative refinement for API specs and code by cycling through PLAN, PRODUCE, PREPARE, EVALUATE, CRITIQUE, and REFINE phases. It applies quality-gated generation to ensure artifacts meet defined thresholds before finalizing.

What is a reflex-loop workflow for quality-gated generation?

A reflex-loop workflow is an iterative process that refines artifacts across PLAN, PRODUCE, PREPARE, EVALUATE, CRITIQUE, and REFINE phases. It materializes checks from task prompts during PREPARE and applies parallel evaluation to ensure quality gates are met.

How do I start and resume an iterative artifact refinement loop?

To start an iterative artifact refinement loop, initiate a new task to begin the phases, or resume a paused loop. The workflow maintains persistent state across sessions using artifact, run, and history files, allowing deterministic recovery and continuation.

Can I configure stop criteria and evaluation thresholds for artifact generation?

Yes, you can configure stop criteria and evaluation thresholds for artifact generation through inline configuration. The workflow supports flexible stopping based on quality thresholds, iteration limits, or stagnation detection, alongside parallel evaluation of independent checks.

Does iterative artifact critique work with persistent state across sessions?

Yes, iterative artifact critique works with persistent state across sessions using a strict model of artifact, run, and history files. This ensures deterministic history and allows you to resume paused loops without losing prior evaluation or refinement progress.

When should I not use a reflex-loop for artifact generation?

You should avoid using a reflex-loop for artifact generation when tasks do not require iterative critique or formal quality gates. The workflow adds overhead through its six-phase cycle, making it less suitable for simple generation tasks that do not need persistent state or threshold-based stopping.