Feature Planner
serendipity1004/cc-feature-implementer
Creates phase-based feature plans with quality gates and incremental delivery structure.
Run a strict multi-iteration Reflex Loop with phases (PLAN, PRODUCE||PREPARE, EVALUATE, CRITIQUE, REFINE) to improve an artifact until quality gates pass or iteration limits are reached.
$ npx skills add unxed/f4 --skill aif-loop -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install unxed/f4 aif-loop --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/unxed/f4.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/aif-loop .claude/skills/aif-loop && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "aif-loop" agent skill from https://github.com/unxed/f4/tree/main/.agents/skills/aif-loop into .claude/skills/aif-loop/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "aif-loop", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/unxed/f4/tree/main/.agents/skills/aif-loopType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add unxed/f4 --skill aif-loop -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install unxed/f4 aif-loop --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/unxed/f4.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/aif-loop .agents/skills/aif-loop && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "aif-loop" agent skill from https://github.com/unxed/f4/tree/main/.agents/skills/aif-loop into .agents/skills/aif-loop/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "aif-loop", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add unxed/f4 --skill aif-loop -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install unxed/f4 aif-loop --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/unxed/f4.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/aif-loop .cursor/skills/aif-loop && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "aif-loop" agent skill from https://github.com/unxed/f4/tree/main/.agents/skills/aif-loop into .cursor/skills/aif-loop/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "aif-loop", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/unxed/f4.git --path .agents/skills/aif-loop--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add unxed/f4 --skill aif-loop -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install unxed/f4 aif-loop --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/unxed/f4.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/aif-loop .gemini/skills/aif-loop && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "aif-loop" agent skill from https://github.com/unxed/f4/tree/main/.agents/skills/aif-loop into .gemini/skills/aif-loop/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "aif-loop", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install unxed/f4 aif-loopInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add unxed/f4 --skill aif-loop -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/unxed/f4.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/aif-loop .github/skills/aif-loop && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "aif-loop" agent skill from https://github.com/unxed/f4/tree/main/.agents/skills/aif-loop into .github/skills/aif-loop/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "aif-loop", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add unxed/f4 --skill aif-loop -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install unxed/f4 aif-loop --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/unxed/f4.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/aif-loop .opencode/skills/aif-loop && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "aif-loop" agent skill from https://github.com/unxed/f4/tree/main/.agents/skills/aif-loop into .opencode/skills/aif-loop/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "aif-loop", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
aif-loopRun a strict multi-iteration Reflex Loop with phases (PLAN, PRODUCE||PREPARE, EVALUATE, CRITIQUE, REFINE) to improve an artifact until quality gates pass or iteration limits are reached.
Aif Loop is an agent skill from unxed/f4. Run a strict multi-iteration Reflex Loop with phases (PLAN, PRODUCE||PREPARE, EVALUATE, CRITIQUE, REFINE) to improve an artifact until quality gates pass or iteration limits are reached. Use when user asks for iterative refinement, quality-gated generation, or "generate - critique - refine" loops.
Its SKILL.md is about 6.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including reference files (for example `references/ACTIVE-TIME-BUDGET.md`, `references/CONTEXT-MANAGEMENT.md` and `references/CRITERIA-TEMPLATES.md`).
It sits in Testing & QA, covering Quality gates. The repository describes itself as: dual pane like a charm. The licence is BSD-3-Clause.
12 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit ede2640. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
ReadWriteEditGlobGrepBashTaskAskUserQuestionQuestionsFrom allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are json and bash).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Aif Loop loads about 6.5k tokens when it runs, and up to ~13k if it reads all its reference files. Until then it costs about 77 tokens; SKILL.md has 3,009 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check noted patterns worth knowing about, such as sudo or a known installer.
allowed-tools: Read, Write, Edit, Glob, Grep, Bash, Task, AskUserQuestion, QuestionsAutomated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from unxed/f4 at commit ede2640, republished under its BSD-3-Clause licence (© unxed). 3,009 words, ~6,533 tokens.
.claude/skills/aif-loop/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.Run a result-focused iterative loop with strict phase contracts, evaluation rules, and persistent state between sessions.
FIRST: Read .ai-factory/config.yaml if it exists to resolve:
paths.description, paths.architecture, paths.rules_file, paths.roadmap, paths.plan, paths.plans, and paths.evolutionlanguage.ui for prompts, language.artifacts for generated contentIf config.yaml doesn't exist, use defaults:
.ai-factory/ for all artifactsen (English)Terminology:
run.json, identified by run_id)Each iteration executes 6 phases with parallel execution where possible:
PLAN - short plan for current iterationPRODUCE - produce one artifact.md ← runs in parallel with PREPAREPREPARE - generate check scripts and test definitions from rules ← runs in parallel with PRODUCEEVALUATE - run prepared checks + content rules against artifact, score result. Uses parallel Task agents for independent check groupsCRITIQUE - precise issues + fixes (only if fail)REFINE - rewrite artifact using critique (only if fail) PLAN
│
┌──────┴──────┐
↓ ↓ ← parallel (Task tool)
PRODUCE PREPARE
(artifact) (checks)
↓ ↓
└──────┬──────┘
↓
EVALUATE ← parallel check execution (Task tool)
┌───┼───┐
↓ ↓ ↓
exec content aggregate
└───┼───┘
↓
CRITIQUE (if fail)
↓
REFINE (if fail)Stop when quality is good enough, no major issues remain, the user stops the run, progress stagnates, or a resource guard trips (optional time budget, iteration limit). The full precedence order is in Step 5.
Use exactly 3+1 files for state inside the resolved evolution directory (where current.json exists only while a loop is active):
<resolved evolution dir>/current.json
<resolved evolution dir>/<task-alias>/run.json
<resolved evolution dir>/<task-alias>/history.jsonl
<resolved evolution dir>/<task-alias>/artifact.mdDo not create extra index files or per-iteration folder trees unless user explicitly asks.
current.json: pointer to active loop only; delete it when loop becomes completed/stopped/failedrun.json: single source of truth for current loop statehistory.jsonl: append-only event log (one JSON object per line)artifact.md: single source of truth for artifact content (written after PRODUCE and REFINE phases, never duplicated in run.json)Parse $ARGUMENTS:
status - show active loop status from current.json and stopresume [alias] - continue active loop or loop by aliasstop [reason] - stop active loop with reason (user_stop if omitted)new <task> or no mode + task text - start new looplist - list all task aliases with status (running/stopped/completed/failed)history [alias] - show event history for a loop (default: active loop)clean [alias|--all] - remove loop files for a stopped/completed/failed loop (requires user confirmation, always confirm before deleting)If no task and no active loop exists, ask user for task prompt.
Read these files if present:
Use them to keep outputs aligned with project conventions.
Read .ai-factory/skill-context/aif-loop/SKILL.md — MANDATORY if the file exists.
This file contains project-specific rules accumulated by /aif-evolve from patches,
codebase conventions, and tech-stack analysis. These rules are tailored to the current project.
How to apply skill-context rules:
Enforcement: After generating any output artifact, verify it against all skill-context rules. If any rule is violated — fix the output before presenting it to the user.
If command is status, stop, list, history, or clean, execute and stop:
status: read current.json; if file exists, read pointed run.json and display alias | status | iteration | phase | current_step | last_score | updated_at, plus completed_phase_seconds / max_completed_phase_seconds when a budget is set; if file is missing, report that no loop is activestop [reason]: stop active running loop only; set run.json.status = "stopped" and run.json.stop.reason = <reason or "user_stop">, append stopped event to history.jsonl, then delete current.json (active pointer cleared) and exitlist: scan the resolved evolution directory, read each run.json, display table of alias | status | iteration | last_score | updated_athistory [alias]: read history.jsonl for the alias (or active loop), display formatted event timelineclean [alias|--all]: show what will be deleted, ask for explicit user confirmation via AskUserQuestion, then delete loop directory. Only clean stopped/completed/failed loops — refuse to clean running loops. Update current.json if needed.mkdir -p <resolved evolution dir>Generate:
task_alias: lowercase hyphen slug (3-64 chars)run_id: <task_alias>-<yyyyMMdd-HHmmss>current.json{
"active_run_id": "courses-api-ddd-20260218-120000",
"task_alias": "courses-api-ddd",
"status": "running",
"updated_at": "2026-02-18T12:00:00Z"
}run.json{
"run_id": "courses-api-ddd-20260218-120000",
"task_alias": "courses-api-ddd",
"status": "running",
"iteration": 1,
"max_iterations": 4,
"max_completed_phase_seconds": null,
"completed_phase_seconds": 0,
"phase_started_epoch_seconds": null,
"phase": "A",
"current_step": "PLAN",
"task": {
"prompt": "OpenAPI 3.1 spec + DDD notes + JSON examples",
"ideal_result": "..."
},
"criteria": {
"name": "loop_default_v1",
"version": 1,
"phase": {
"A": { "threshold": 0.8, "active_levels": ["A"] },
"B": { "threshold": 0.9, "active_levels": ["A", "B"] }
},
"rules": []
},
"plan": [],
"prepared_checks": null,
"evaluation": null,
"critique": null,
"stop": { "passed": false, "reason": "" },
"last_score": 0,
"stagnation_count": 0,
"created_at": "2026-02-18T12:00:00Z",
"updated_at": "2026-02-18T12:00:00Z"
}When resuming a loop:
run.json to get current_step and iterationhistory.jsonl to confirm consistencyrun.json.current_step indicates a phase was interrupted:PRODUCE_PREPARE: always re-run both PRODUCE and PREPARE (idempotent — artifact overwrites, checks regenerate)run.json.status is stopped, completed, or failed, inform user and suggest new (for failed runs, also show the last phase_error event from history.jsonl so user understands what went wrong)phase_started_epoch_seconds: set it to the current date +%s when the interrupted phase actually re-starts. The interrupted attempt contributes nothing to the budget — only completed_phase_seconds already accumulated from finished segments carries over (see references/ACTIVE-TIME-BUDGET.md).If the task prompt contains enough context to infer task type and ideal result:
references/CRITERIA-TEMPLATES.md4), and a completed-phase time budget (default: none; infer one only per the setup rules in references/ACTIVE-TIME-BUDGET.md)AskUserQuestion, even if criteria were already present in the task textAskUserQuestion, even if iteration count was already present in the task textAskUserQuestion whenever the drafted value is not null, always offering none as an optionCritical guardrail:
Ask concise setup questions before first iteration:
references/CRITERIA-TEMPLATES.md4)none) — offer none explicitly; a domain-level timeout is not a loop budgetnone: "Confirm time budget = N seconds?"Generate evaluation rules from answers:
references/CRITERIA-TEMPLATES.md as starting pointPersist answers and generated rules inside run.json.criteria (snapshot for reproducibility).
Never treat criteria, iteration limits, or a time budget parsed from task text as final until the user explicitly confirms them.
Normalization rules before persisting:
run.json.max_iterations is the single source of truth for iteration limitrun.json.max_completed_phase_seconds is the single source of truth for the time budget; it is optional — persist null (no limit) unless the user asked for one and confirmed it. Run files without the field behave as null. Accepted values are null or a positive integer of seconds; a string, 0, a negative number, or a decimal is a validation failure (phase_error), never coerced — see references/ACTIVE-TIME-BUDGET.mdid, description, severity, weight, phase, check)weight, derive from severity (fail=2, warn=1, info=0)Before running phases, load:
references/PHASE-CONTRACTS.md - strict I/O contracts for each phasereferences/RULE-SCHEMA.md - rule format and score calculationPLAN - generates iteration plan (sequential)PRODUCE - generates artifact (parallel with PREPARE)PREPARE - generates check scripts/definitions from rules + task prompt (parallel with PRODUCE)EVALUATE - runs prepared checks + content rules, aggregates score (parallel check groups via Task)CRITIQUE - identifies issues with fix instructions (sequential, only on fail)REFINE - applies fixes to artifact (sequential, only on fail)Two levels of parallelism via Task tool:
Task agents after PLAN completes. Both depend only on PLAN output.Task agents for independent check groups (executable checks via Bash, content rules via Read/Grep). Aggregates results into final score.Each phase produces its defined output (see PHASE-CONTRACTS.md). No envelope wrapping. No router output.
For each iteration:
run.json.current_step = "PLAN", run PLAN phaserun.json.current_step = "PRODUCE_PREPARE", launch both as parallel Task agents:artifact.mdrun.json.current_step = "EVALUATE", run EVALUATE phase:Task agents for independent check groups:Task with BashTask with Read/Greppassed=false:run.json.current_step = "CRITIQUE", run CRITIQUE phaserun.json.current_step = "REFINE", run REFINE phaseartifact.mdphase=A and passed=true:phase=B, activate B-level rulesrun.json.current_step = "PREPARE", re-run PREPARE with phase=B to materialize B-level checks (no PLAN/PRODUCE — artifact already passed A)run.json.current_step = "EVALUATE", run EVALUATE against the same artifact with B-level prepared checksthreshold_reached)phase=B and passed=true:threshold_reached)If Task tool is unavailable or returns errors, fall back to sequential execution: PLAN → PRODUCE → PREPARE → EVALUATE → CRITIQUE → REFINE. The loop must work without parallelism.
PRODUCE_PREPARE stays one logical step across this fallback: current_step is not split, there is no budget stop between PRODUCE and PREPARE, and a failed parallel attempt plus the sequential retry count as the same timed segment.
Several conditions can hold at the same phase boundary. This numbered order is the tie-break, not a list of independent checks: evaluate top-down and report the first match as stop.reason. Completion guards come before resource guards, so a run that finished successfully is never relabelled as stopped by a resource that ran out in the same breath.
threshold_reached — phase=B and passed=trueno_major_issues — phase=B and no fail-severity rules failed in current evaluation: only warn/info remain and no stricter phase is left. Never fires in phase=A — a clean A-evaluation moves into phase=B (Step 4.5) or keeps refining, so B-level rules are never skippeduser_stop — explicit user stopstagnation — stagnation_count >= 2 (see "Stagnation rule" below)budget_exceeded — max_completed_phase_seconds is set and completed_phase_seconds >= max_completed_phase_secondsiteration_limit — iteration >= run.max_iterationsbudget_exceeded outranks iteration_limit deliberately: time is an irreversibly spent external resource, so when both trip it is more useful to name the budget. What matters is that the order is identical everywhere — this list is repeated verbatim in docs/loop.md and subagents/claude/agents/loop-orchestrator.md, and all three must stay in sync.
run.json.max_completed_phase_seconds is an optional cap on time spent inside completed phase segments; null or absent = no limit. The limit is soft — checked only at phase boundaries, never interrupting a phase (or its retry) mid-flight, so a run may overshoot by up to the in-flight phase duration. Only completed segments count: an interrupted phase contributes nothing, by definition rather than by accident. Full contract — types and invariants, boundary measurement, PRODUCE_PREPARE and retries as single segments, clock rollback, diagnostics, setup rules: references/ACTIVE-TIME-BUDGET.md.
Track score progress:
delta = score - last_scoredelta < 0.02 and there are no severity fail blockers, increment stagnation_countstagnation_count >= 2, stop with stagnationAfter each phase output:
run.json (including current_step)history.jsonlcurrent.json.updated_atartifact.md to disk after PRODUCE and REFINE phasesartifact.md, save a SHA-256 hash of the previous artifact in the refinement_done event payload as "previous_artifact_hash" (enables integrity verification without bloating history)max_completed_phase_seconds is set: update completed_phase_seconds / phase_started_epoch_seconds at every phase boundary per references/ACTIVE-TIME-BUDGET.md, in the same run.json write — never as a separate timerEvent names:
run_startedplan_createdartifact_createdchecks_preparedevaluation_donecritique_donerefinement_donephase_switchediteration_advancedphase_errorstoppedfailedhistory.jsonl example line:
{"ts":"2026-02-18T12:01:10Z","run_id":"courses-api-ddd-20260218-120000","iteration":1,"phase":"A","step":"EVALUATE","event":"evaluation_done","status":"ok","payload":{"score":0.72,"passed":false}}A stop can land at any phase boundary, so the artifact may be missing (not_created), never evaluated (unevaluated), newer than the stored evaluation (stale, detected via evaluation.artifact_hash), or evaluated. Only evaluated may report a numeric final_score or a distance-to-success block; the other three print final_score: unavailable with the reason and, when one existed, last_evaluated_score. Full contract, output shapes, per-status rules: references/TERMINAL-REPORT.md.
After the loop stops (any reason):
iteration, max_iterations, phase, artifact_status, final score per the rules above, stop reason)stop reason is iteration_limit or budget_exceeded, artifact_status is evaluated, and that evaluation has passed=false, include mandatory distance-to-success details:threshold - score, floor at 0)fail-severity rule count + blocking rule IDspassed_rules / total_rules)stop reason is budget_exceeded, also include budget diagnostics — completed_phase_seconds, max_completed_phase_seconds, overshoot_seconds, last_completed_step — and repeat them in the stopped event payload (references/ACTIVE-TIME-BUDGET.md)<resolved evolution dir>/<alias>/artifact.md) — skip steps 4-5 entirely when artifact_status is not_created, and say so instead of offering a file that does not exist/aif-plan to implement it/aif-verify to check it/aif-docs to integrate itrun.json.status based on stop reason, and if current.json points to this loop, delete current.json (no active loop remains):| Stop reason | Status |
|---|---|
threshold_reached | completed |
no_major_issues | completed |
user_stop | stopped |
iteration_limit | stopped |
stagnation | stopped |
budget_exceeded | stopped |
phase_error | failed |
The mapping applies to the reason selected by the Step 5 precedence contract, so a resource guard tripping in the same boundary as a completion guard never downgrades a completed run to stopped.
Show a compact summary after each iteration — do NOT dump full run.json or artifact.md content into the conversation. The artifact is already on disk; duplicating it wastes context.
── Iteration {N}/{max} | Phase {A|B} | Score: {score} | {PASS|FAIL} ──
Plan: {1-line summary of plan focus}
Hash: {first 8 chars of artifact SHA-256}
Changed: {list of added/modified sections, or "initial generation"}
Failed: {comma-separated rule IDs, or "none"}
Warnings: {comma-separated rule IDs, or "none"}
Artifact: <resolved evolution dir>/<alias>/artifact.mdHash — lets the user verify which version they're looking at without reading the full artifactChanged — shows what actually moved between iterations so regressions are visible from the summary aloneIf passed=false, append a compact critique summary (rule ID + 1-line fix instruction per issue). Do not repeat the full artifact or full evaluation object.
When the loop terminates with reason=iteration_limit or reason=budget_exceeded, artifact_status is evaluated, and passed=false, append a compact distance_to_success block to the final response. For any other artifact_status, print the final_score: unavailable block from Step 7 instead — never a computed gap against an evaluation that does not belong to the current artifact.
Show the full artifact content (not just summary) in these cases only:
artifact_status is not_created; then report that no artifact was produced and why the loop stoppedThe loop generates significant context per iteration (subagent results, evaluation data, critique). All loop state is persisted to disk — clearing context loses nothing, and resume fully reconstructs state from files.
Recommend a context clear after iteration 2, on the Phase A → B transition, and after any iteration where iteration >= 3. Never force or auto-clear — the user decides.
Exact wording and rationale: references/CONTEXT-MANAGEMENT.md.
If a phase produces output that does not match its contract:
history.jsonl with event phase_errorreason=phase_error and display the errorrun.jsonIf run.json is missing or unparseable:
history.jsonl to reconstruct the last known staterun.json from the most recent events (last iteration, phase, score, etc.)history.jsonl is also missing/empty, inform user and suggest starting a new looprun.json is the only source of current state truth (does NOT store artifact content)artifact.md on disk is the single source of truth for artifact content — never duplicate it in run.jsonhistory.jsonl is append-only; do not edit old eventsrun.json into conversation./aif-loop new OpenAPI 3.1 spec + DDD notes + JSON examples
/aif-loop resume
/aif-loop resume courses-api-ddd
/aif-loop status
/aif-loop stop
/aif-loop list
/aif-loop history
/aif-loop history courses-api-ddd
/aif-loop clean courses-api-ddd
/aif-loop clean --all© unxed, BSD-3-Clause. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 6 other files (references) in .agents/skills/aif-loop of unxed/f4.
Open the folder on GitHubat commit ede2640
Aif Loop next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Aif Loop this skillunxed/f4 | 240 | — | ~6.5k | Automated safety check: Notes | BSD-3-Clause | |
| Feature Plannerserendipity1004/cc-feature-implementer | 176 | — | ~2.4k | Automated safety check: Pass | None | |
| Ccg Workflowfengshao1227/ccg-workflow | 5.9k | — | ~2.3k | Automated safety check: Pass | MIT | |
| Conducty Checkpointrobertbarclayy/conducty | 176 | — | ~1.5k | Automated safety check: Pass | MIT | |
| Mission Plannerjdforsythe/forge | 151 | — | ~3.5k | Automated safety check: Pass | MIT | |
| Quality Gate0xNyk/lacp | 305 | — | ~382 | Automated safety check: Pass | MIT |
serendipity1004/cc-feature-implementer
Creates phase-based feature plans with quality gates and incremental delivery structure.
fengshao1227/ccg-workflow
How to run a non-trivial change end to end with the CCG role tools (ccganalyze / ccgdesign / ccgbuild / ccgdebug / ccgoptimize / ccgreview / ccgtest) and the verify- quality gates.
robertbarclayy/conducty
Quality gate between parallelization groups. An agent skill from robertbarclayy/conducty.
jdforsythe/forge
Decomposes goals into team blueprints using evidence-based scaling laws, topology selection, and role design.
0xNyk/lacp
Production quality gate for agent sessions. An agent skill from 0xNyk/lacp.
nwiizo/ccswarm
Release deployment process for ccswarm. An agent skill from nwiizo/ccswarm.
unxed/f4
Comprehensive documentation guide for Golang projects, covering godoc comments, README, CONTRIBUTING, CHANGELOG, Go Playground, Example tests, API docs, and llms.txt.
unxed/f4
Golang code style conventions — line length and breaking, variable declarations, control flow clarity, when comments help vs hurt.
unxed/f4
Comprehensive guide for Go database access — parameterized queries, struct scanning, NULLable columns, transactions, isolation levels, SELECT FOR UPDATE, connection pool, batch processing, context…
unxed/f4
Security audit checklist based on OWASP Top 10 and best practices.
unxed/f4
Go (Golang) naming conventions — covers packages, constructors, structs, interfaces, constants, enums, errors, booleans, receivers, getters/setters, functional options, acronyms, test functions, and…
unxed/f4
Golang concurrency design — goroutine lifecycle and leak prevention, channels and select, channel ownership and direction, sync.Mutex/RWMutex/sync.Map/sync.Once/atomics, errgroup, singleflight…
Categories
Run a strict multi-iteration Reflex Loop with phases (PLAN, PRODUCE||PREPARE, EVALUATE, CRITIQUE, REFINE) to improve an artifact until quality gates pass or iteration limits are reached. Aif Loop is an agent skill from unxed/f4. Run a strict multi-iteration Reflex Loop with phases (PLAN, PRODUCE||PREPARE, EVALUATE, CRITIQUE, REFINE) to improve an artifact until quality gates pass or iteration limits are reached.
Aif Loop fits situations like: user asks for iterative refinement; quality-gated generation; generate - critique - refine loops.
Run `npx skills add unxed/f4 --skill aif-loop -a claude-code`. Or copy the skill folder (.agents/skills/aif-loop in unxed/f4) into .claude/skills/aif-loop in your project. Claude Code loads it when a task matches its description.
Run `npx skills add unxed/f4 --skill aif-loop -a codex`. Or copy the skill folder (.agents/skills/aif-loop in unxed/f4) into .agents/skills/aif-loop in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add unxed/f4 --skill aif-loop -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/aif-loop, .gemini/skills/aif-loop, .github/skills/aif-loop and .opencode/skills/aif-loop in your project.
SKILL.md names no scripts, command-line tools or credentials: Aif Loop is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Write, Edit, Glob, Grep, Bash, Task, AskUserQuestion, Questions.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.
Aif Loop is published under the BSD-3-Clause licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 6.5k tokens (SKILL.md is roughly 26k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 6.6k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Aif Loop: Feature Planner (serendipity1004/cc-feature-implementer, 176 stars), Ccg Workflow (fengshao1227/ccg-workflow, 5.9k stars), Conducty Checkpoint (robertbarclayy/conducty, 176 stars) and Mission Planner (jdforsythe/forge, 151 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
unxed (a GitHub user) maintains it in unxed/f4, which has 240 GitHub stars. The repository holds 36 skills in this directory. The repository was last updated on October 7, 2026.
Source: unxed/f4 on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.