How build-iterated-agentic-loop and design-control-loop Skills Work Together

The design-control-loop skill creates the domain-specific logic and scripts for an agentic control loop, while build-iterated-agentic-loop transforms that design into a repeatable CI/CD workflow with persistent memory.

In the humanlayer/skills repository, two specialized Claude Code skills work sequentially to scaffold complete agentic control loops. These skills separate the design phase from the implementation phase, allowing you to first define the control logic and then automate it with GitHub Actions infrastructure.

Understanding the Two-Phase Architecture

The architecture follows a clear progression from design to deployment. The design-control-loop skill conducts an interactive interview to define the set-point, sensor, controller, and actuator components. Once these domain-specific elements are established, build-iterated-agentic-loop materializes them into a self-running system that executes within your CI pipeline.

This separation ensures that the conceptual design of what to control remains distinct from the operational infrastructure of how to run it repeatedly.

Phase 1: Designing the Control Loop with design-control-loop

Core Responsibilities and Interview Process

Located at plugins/design-control-loop/skills/design-control-loop/SKILL.md, this skill implements an interactive specification process. It interviews you about the target property to maintain, suggests options for measuring that property (sensors), deciding on corrections (controllers), and executing those corrections (actuators).

The skill applies the control loop taxonomy defined in references/control-loop-taxonomy.md, ensuring your design adheres to established patterns for autonomous systems.

Artifacts Generated by design-control-loop

The skill produces several concrete artifacts:

  • references/control-loop-taxonomy.md and references/example-control-loop.md – Documentation establishing the design patterns
  • Sensor script – Executable code that measures the current state
  • Controller script – Logic that compares measured state against the set-point and decides on actions
  • Actuator skill – A prototype Claude Code skill at .claude/skills/<slug>/SKILL.md that executes the corrective actions

Phase 2: Building the Iterated Loop with build-iterated-agentic-loop

Converting Design to CI-Driven Automation

Found at plugins/build-iterated-agentic-loop/skills/build-iterated-agentic-loop/SKILL.md, this skill takes the actuator skill generated in Phase 1 and constructs the infrastructure for repeated execution. It does not redesign the logic; instead, it packages the existing sensor, controller, and actuator into a GitHub Actions workflow that runs on a schedule or trigger.

The builder skill copies reference templates from plugins/build-iterated-agentic-loop/references/ to standardize the workflow structure across different implementations.

Generated Infrastructure Components

When you run build-iterated-agentic-loop and point it to your actuator skill slug, it creates:

  • .github/workflows/agent-<task-name>.yml – The GitHub Actions workflow that orchestrates sensor → controller → actuator execution
  • .github/agent-memory/<task-name>.md – A persistent memory file that retains feedback and state across workflow runs
  • .claude/skills/<skill-name>/SKILL.md – The finalized, iteration-ready skill definition (if not already fully formed)

How the Skills Interact in Practice

The interaction follows a strict handoff sequence. First, you establish what needs to be controlled; then you build the machinery to control it continuously.

  1. Run /design-control-loop – Answer the interview questions about your target property. The skill writes the sensor and controller scripts, plus a prototype actuator skill (e.g., .claude/skills/fix-eslint-issues/SKILL.md).

  2. Run /build-iterated-agentic-loop – Provide the slug of the actuator skill created in step 1. The skill generates the CI workflow at .github/workflows/agent-fix-eslint-issues.yml and the memory file at .github/agent-memory/fix-eslint-issues.md.

  3. Trigger the loop – Execute gh workflow run agent-fix-eslint-issues or wait for the scheduled run. The workflow executes the sensor, feeds results to the controller, invokes the actuator skill via the coding agent, and opens a pull request with the formatted response.

Complete Workflow Implementation

Here is the complete command sequence to implement both skills in your repository:


# 1️⃣ Install both skills in a target repo

npx skills add humanlayer/skills --skill design-control-loop
npx skills add humanlayer/skills --skill build-iterated-agentic-loop

# 2️⃣ Run the design‑control‑loop skill (interactive interview)

/design-control-loop

# → Answer the interview questions.

# → At the end you get a new actuator skill, e.g. .claude/skills/fix-eslint-issues/SKILL.md

# 3️⃣ Feed the generated actuator skill into the builder

/build-iterated-agentic-loop

# When prompted, give the slug of the newly created skill (e.g. "fix-eslint-issues")

# → The tool creates:

#   .github/workflows/agent-fix-eslint-issues.yml

#   .github/agent-memory/fix-eslint-issues.md

#   (copies reference templates)

# 4️⃣ Trigger the loop manually or let the schedule run

gh workflow run agent-fix-eslint-issues

# The workflow will:

#   • Run the sensor script

#   • Run the controller script

#   • Invoke the actuator skill via the coding agent

#   • Open a PR with the agent’s formatted response

Iteration and Feedback Mechanisms

Once operational, the system supports continuous refinement through the /iterate comment command. This command, installed by build-iterated-agentic-loop, updates the memory file at .github/agent-memory/<task-name>.md, allowing you to refine the controller logic or adjust sensor parameters without returning to the initial design interview.

You can modify the sensor or controller scripts generated by design-control-loop at any time; subsequent workflow runs automatically pick up these changes while retaining historical context in the memory file.

Summary

  • design-control-loop creates the domain-specific design and concrete scripts (sensor, controller, actuator) through an interactive interview process.
  • build-iterated-agentic-loop supplies the repeatable CI scaffolding that turns the design into a self-running agentic loop with GitHub Actions.
  • The skills operate sequentially: design first, then build, producing artifacts at .claude/skills/<slug>/SKILL.md, .github/workflows/agent-<slug>.yml, and .github/agent-memory/<slug>.md.
  • The /iterate command enables continuous improvement by updating the agent memory without rebuilding the entire loop structure.

Frequently Asked Questions

Do I need to run design-control-loop before build-iterated-agentic-loop?

Yes. While build-iterated-agentic-loop can technically execute independently, it expects an actuator skill generated by design-control-loop to function correctly. The design skill provides the domain-specific logic—the sensor, controller, and actuator definitions—that the builder skill packages into CI/CD infrastructure.

What files does build-iterated-agentic-loop create?

The skill generates three primary artifacts: .github/workflows/agent-<slug>.yml for workflow orchestration, .github/agent-memory/<slug>.md for persistent state across runs, and finalizes the skill definition at .claude/skills/<slug>/SKILL.md. It also copies reference templates from plugins/build-iterated-agentic-loop/references/ to support standardized execution.

How does the control loop maintain state between runs?

State persistence is handled through the agent-memory file at .github/agent-memory/<task-name>.md. This Markdown file retains feedback, previous decisions, and contextual information across GitHub Actions runs, enabling the controller to learn from previous iterations and avoid repeating the same corrections.

Can I modify the sensor or controller after the loop is built?

Yes. You can update the sensor and controller scripts generated by design-control-loop at any time. Use the /iterate command to refresh the memory file and workflow configuration without rebuilding from scratch. This allows you to tune the control logic while preserving the CI infrastructure and historical memory accumulated by build-iterated-agentic-loop.

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:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →