How build-iterated-agentic-loop Combines Actuator Skills, GitHub Actions, Prompts, and Memory into a Drop-In Solution
build-iterated-agentic-loop is a meta-skill that automates the creation of a full iterated agentic loop by generating self-consistent actuator skills, GitHub Actions workflows, prompt templates, and persistent memory files that work together as a ready-to-use drop-in solution.
The build-iterated-agentic-loop skill in the humanlayer/skills repository eliminates manual configuration by stitching together five distinct components into a cohesive CI agent. By reading its own SKILL.md and processing reference templates, this meta-skill generates three core files—an actuator skill, a workflow definition, and a memory file—that enable a repository to run autonomous coding agents on a schedule or via manual triggers.
The Five Core Components of the Iterated Agentic Loop
The drop-in solution relies on five integrated parts that share a single source of truth through reference templates.
Actuator Skill
The actuator skill is the repo-local .claude/skills/<skill-name>/SKILL.md that defines what the coding agent should accomplish. During generation, build-iterated-agentic-loop reads its own implementation at plugins/build-iterated-agentic-loop/skills/build-iterated-agentic-loop/SKILL.md and uses the references/skill-template.md file to produce a concrete skill file under .claude/skills/<task-slug>/. This generated skill contains task-specific instructions derived from the user's input during the setup phase.
GitHub Actions Workflow
The GitHub Actions workflow is a YAML file that launches the coding agent in a CI runner, enforces PR bounding, and handles /iterate comments. Based on references/workflow-template.yml, the meta-skill replaces placeholders such as <task-title>, <task-slug>, and <branch-prefix> with user-provided values. The final file lands at .github/workflows/agent-<task-name>.yml and includes logic to check for existing work-in-progress before spawning new agent runs.
Prompt Template
The prompt template provides the system prompt that guides the coding agent's behavior. Stored in references/prompt-template.md, this skeleton receives injected values including the <task summary>, <skill-name>, target paths, and the current memory file content. During workflow execution, the "Run coding agent" step loads this template, substitutes variables, and passes the complete prompt to the chosen agent runner.
Agent Memory
Agent memory persists standing feedback between runs via a markdown file stored at .github/agent-memory/<task-name>.md. The meta-skill seeds this file from references/memory-template.md during initial setup. On each execution, the workflow loads this content into the MEMORY_CONTENT environment variable (MEMORY_CONTENT="$(cat .github/agent-memory/<task-slug>.md)") and injects it into the prompt. After /iterate comments trigger subsequent runs, the memory file updates to reflect new learnings.
Reference Templates
The reference templates directory contains reusable snippets that ensure consistency across generated assets:
references/response-template.mddefines the markdown structure that agents must output in PR bodiesreferences/agent-iteration.tsimplements the/iteratefooter logic and prompt-building helpersreferences/agent-runner-templates.mdholds concretebunx @humanlayer/cliinvocations for Claude Code, Codex, OpenCode, and CodeLayer
How build-iterated-agentic-loop Generates a Drop-In Solution
The meta-skill follows a deterministic eight-step process to create self-consistent assets:
- Repository Exploration – Scans existing workflows, package managers, and
.claude/skillsto infer sensible defaults - Interactive Setup – Prompts the user for coding agent choice, schedule cadence, task description, scope boundaries, validation commands, and PR-bounding policy (see section 2 of the skill definition)
- Skill Generation – Writes a concrete
SKILL.mdto.claude/skills/<slug>/using the skill template - Memory Initialization – Creates
.github/agent-memory/<slug>.mdfrom the memory template - Workflow Construction – Copies
workflow-template.yml, replaces all placeholders, and saves to.github/workflows/agent-<slug>.yml - Prompt Assembly – Configures the workflow's agent step to read the memory file and inject the filled prompt template
- Response Handling Setup – Adds post-processing steps to extract PR bodies (stripping ANSI codes) and append iteration markers via
agent-iteration.ts - Bounding Configuration – Implements the early "Check iterate marker to bound work-in-progress" gate to ensure only one open PR per loop exists, while enabling
/iteratecomments to update existing PRs and memory
Generated Files in Action
GitHub Actions Workflow Structure
The generated workflow combines scheduling, manual dispatch, and comment triggers with gating logic:
name: "Agent: Update React Prop Types"
on:
schedule:
- cron: "0 13 * * *"
workflow_dispatch:
issue_comment:
types: [created]
jobs:
agent-task:
runs-on: ubuntu-latest
steps:
- name: Check iterate marker to bound work-in-progress
id: agent_gate
# Gate logic prevents duplicate runs
- uses: actions/checkout@v5
if: steps.agent_gate.outputs.run_agent == 'true'
with: {fetch-depth: 0}
- name: Install bun
if: steps.agent_gate.outputs.run_agent == 'true'
uses: oven-sh/setup-bun@v2
with: {bun-version: 1.3.14}
# Agent execution steps follow...
Dynamic Prompt Construction
The workflow constructs prompts by combining the template with live memory:
You are <task summary> in this repository. Begin by using the `<skill-name>` skill.
## Scope
Focus only on `<primary path or package>`.
You may inspect `<secondary path>` only when necessary.
## Instructions
1. Find high-confidence targets.
...
## Agent Memory
# Agent Memory: Update React Prop Types
Standing feedback for future runs.
- Do not touch generated files in `src/generated/`.
Persistent Memory Evolution
After several iterations, the memory file accumulates specific guidance:
# Agent Memory: Update React Prop Types
Standing feedback for future `Agent: Update React Prop Types` runs.
## Guidance
- Exclude components that use the legacy `withStyles` HOC (false-positive area).
- Prefer adding generic type arguments rather than full type rewrites.
Summary
- Single source of truth: All generated files derive from reference templates in
plugins/build-iterated-agentic-loop/skills/build-iterated-agentic-loop/references/, ensuring consistency between prompts, skills, and workflows. - Three-file drop-in: Copying the generated
SKILL.md, workflow YAML, and memory markdown into a repository provides a fully functional iterated agentic loop without additional configuration. - State persistence: The
.github/agent-memory/<task-slug>.mdfile maintains context across runs, while the workflow's gating logic prevents duplicate work-in-progress PRs. - Flexible triggers: Supports cron schedules, manual dispatch, and
/iteratecomment commands for interactive refinement. - Multi-agent support: Reference templates include runner configurations for Claude Code, Codex, OpenCode, and CodeLayer via
bunx @humanlayer/cliinvocations.
Frequently Asked Questions
What files does build-iterated-agentic-loop actually generate?
The meta-skill generates three primary assets: a SKILL.md file placed in .claude/skills/<task-slug>/, a GitHub Actions workflow saved to .github/workflows/agent-<task-slug>.yml, and a memory file created at .github/agent-memory/<task-slug>.md. These files are produced by processing the reference templates located in plugins/build-iterated-agentic-loop/skills/build-iterated-agentic-loop/references/ and substituting user-provided values for placeholders like <task-slug> and <task-title>.
How does the agent memory persist between workflow runs?
Agent memory persists through a markdown file stored in the repository itself at .github/agent-memory/<task-slug>.md. During workflow execution, the contents are loaded into an environment variable (MEMORY_CONTENT="$(cat .github/agent-memory/<task-slug>.md)") and injected into the system prompt. When users trigger iterations via /iterate comments, the references/agent-iteration.ts script can update this file with new feedback, ensuring subsequent runs incorporate previous learnings.
What prevents the agent from creating duplicate pull requests?
The generated workflow includes a gating step called "Check iterate marker to bound work-in-progress" that runs before the agent executes. This step checks for existing open PRs created by previous agent runs and sets an output flag (run_agent) to false if work is already in progress. Users can disable this bounding behavior during setup, or trigger updates to existing PRs using /iterate comments, which bypass the gate for continuation scenarios.
Which coding agents are supported by the generated workflows?
The meta-skill supports Claude Code, Codex, OpenCode, and CodeLayer through template configurations stored in references/agent-runner-templates.md. During the setup phase, users select their preferred agent, and the meta-skill inserts the corresponding bunx @humanlayer/cli invocation into the generated workflow file, handling authentication secrets and runtime flags specific to each agent.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →