# How the build-iterated-agentic-loop Skill Automates Creation of New Skills and GitHub Actions Workflows

> Discover how the build-iterated-agentic-loop skill automates the creation of new skills and GitHub Actions workflows. Learn about its nine-step pipeline for repeatable agent tasks.

- Repository: [HumanLayer/skills](https://github.com/humanlayer/skills)
- Tags: how-to-guide
- Published: 2026-09-12

---

**The build-iterated-agentic-loop skill is a meta-skill that transforms repeatable coding-agent tasks into fully-featured, repository-local skills paired with automated GitHub Actions workflows through a nine-step template-driven pipeline.**

The build-iterated-agentic-loop skill, located in the `humanlayer/skills` repository, serves as a code-generation engine that operationalizes AI coding agents without manual boilerplate. By analyzing repository context and prompting for task-specific parameters, it synthesizes self-contained skill definitions, persistent memory files, and production-ready CI/CD workflows that execute on configurable schedules.

## The Nine-Step Generation Pipeline

The meta-skill orchestrates a **discover → query → synthesize → validate → deploy** pipeline defined in [`plugins/build-iterated-agentic-loop/skills/build-iterated-agentic-loop/SKILL.md`](https://github.com/humanlayer/skills/blob/main/plugins/build-iterated-agentic-loop/skills/build-iterated-agentic-loop/SKILL.md).

### Repository Discovery and Interactive Setup

The process begins with **repository exploration**. The skill scans the target codebase for existing GitHub Actions, package manager manifests ([`package.json`](https://github.com/humanlayer/skills/blob/main/package.json), [`pyproject.toml`](https://github.com/humanlayer/skills/blob/main/pyproject.toml)), and existing `.claude/skills` directories to infer installation commands, test conventions, and naming standards.

Following discovery, the skill initiates **interactive setup questions**. It queries the user for the coding-agent choice, execution cadence, task description, validation commands, and pull request bounding logic. Default values are suggested based on the repository audit, minimizing configuration friction.

### Defining the Agent Job

In the third step, the user formalizes the **find → change → validate** loop into a concise job description. For example: *"Find ESLint violations, fix them, and verify `npm test` passes."* This sentence becomes the functional specification for the generated artifacts.

### Template-Driven Artifact Generation

Steps four through seven involve synthesizing four interconnected artifacts from specialized templates located in the `references/` directory:

1. **Repo-local skill**: Using [`references/skill-template.md`](https://github.com/humanlayer/skills/blob/main/references/skill-template.md), the skill creates `.claude/skills/<slug>/SKILL.md`. It injects the job description, references long-form templates, and ensures front-matter `name` fields match the directory slug.

2. **Workflow prompt**: From [`references/prompt-template.md`](https://github.com/humanlayer/skills/blob/main/references/prompt-template.md), the skill generates a custom prompt embedding the skill name, scope, validation commands, and memory file references. This prompt is embedded directly into the workflow definition.

3. **Agent memory file**: Based on [`references/memory-template.md`](https://github.com/humanlayer/skills/blob/main/references/memory-template.md), the skill installs `.github/agent-memory/<task>.md`. This markdown file stores persistent constraints—such as excluded paths or known false-positives—that survive across workflow executions.

4. **GitHub Actions workflow**: Using [`references/workflow-template.yml`](https://github.com/humanlayer/skills/blob/main/references/workflow-template.yml), the skill produces `.github/workflows/agent-<task>.yml`. The template substitutes placeholders with values gathered during setup, including cron schedules, agent commands, memory paths, and PR-bounding logic.

### Optional Iteration Support and Validation

If the user enables `/iterate` functionality, the skill installs [`references/agent-iteration.ts`](https://github.com/humanlayer/skills/blob/main/references/agent-iteration.ts) (typically to `.github/scripts/`) and patches the workflow to trigger on `issue_comment` events. This allows subsequent agent refinement via GitHub comments.

Finally, the **validation phase** verifies workflow YAML parsing using `js-yaml`, `pythonyaml`, or `yq`. The skill instructs users to push the new files and confirms workflow registration in the GitHub Actions tab.

## Core Template Files in the Meta-Skill

The `build-iterated-agentic-loop` skill relies on a structured template library located in `plugins/build-iterated-agentic-loop/skills/build-iterated-agentic-loop/references/`:

- **[`skill-template.md`](https://github.com/humanlayer/skills/blob/main/skill-template.md)**: Defines the base structure for generated repo-local skills, including front-matter schema and step-by-step instruction formatting.
- **[`workflow-template.yml`](https://github.com/humanlayer/skills/blob/main/workflow-template.yml)**: Provides the skeleton GitHub Actions workflow with placeholders for `CLAUDE_API_KEY` secrets, scheduling cron expressions, and agent execution commands.
- **[`prompt-template.md`](https://github.com/humanlayer/skills/blob/main/prompt-template.md)**: Formats the embedded system prompt that governs agent behavior during workflow execution.
- **[`memory-template.md`](https://github.com/humanlayer/skills/blob/main/memory-template.md)**: Blueprint for persistent constraint storage in `.github/agent-memory/` directories.
- **[`agent-iteration.ts`](https://github.com/humanlayer/skills/blob/main/agent-iteration.ts)**: TypeScript script enabling comment-driven iteration via GitHub issue events.

## Generated Artifacts and Directory Structure

When executed, the skill populates the repository with three primary artifact types.

### Generated Skill Definition

Located at [`.claude/skills/fix-eslint-issues/SKILL.md`](https://github.com/humanlayer/skills/blob/main/.claude/skills/fix-eslint-issues/SKILL.md):

```markdown
---
name: fix-eslint-issues
description: Find eslint violations, fix them, and verify `npm test` passes.
---

# Fix ESLint Issues

1. Run `npm run lint --format json` to collect ESLint errors.
2. For each reported file, apply the suggested autofix (`eslint --fix <file>`).
3. Run `npm test`.  
   - If tests fail, abort and report the failing test file.
4. Produce a PR body using the response template at `references/response-template.md`.

```

### Generated GitHub Actions Workflow

Located at [`.github/workflows/agent-fix-eslint-issues.yml`](https://github.com/humanlayer/skills/blob/main/.github/workflows/agent-fix-eslint-issues.yml):

```yaml
name: Agent – Fix ESLint Issues
on:
  schedule:
    - cron: "0 13 * * 1-5"   # weekdays

  workflow_dispatch:

jobs:
  run-agent:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install dependencies
        run: npm ci
      - name: Run coding agent
        env:
          CLAUDE_API_KEY: ${{ secrets.CLAUDE_API_KEY }}
        run: |
          npx code-layer run --skill fix-eslint-issues \
            --prompt "$(cat .github/agent-memory/fix-eslint-issues.md)" \
            --output /tmp/pr-body.md
      - name: Create PR
        uses: peter-evans/create-pull-request@v5
        with:
          title: "[Agent: Fix ESLint] Auto‑fix lint errors"
          body: "$(cat /tmp/pr-body.md)"
          labels: agent-fix-eslint-issues
          branch: agent/fix-eslint-issues

```

### Agent Memory File

Located at [`.github/agent-memory/fix-eslint-issues.md`](https://github.com/humanlayer/skills/blob/main/.github/agent-memory/fix-eslint-issues.md):

```markdown

# Agent Memory – Fix ESLint Issues

- Exclude generated files: `dist/**`
- Known false‑positive rule: `no-console` (ignore)
- Prefer `eslint --fix` over manual edits.

```

## Iteration Support and Persistent Memory

The **agent memory file** ([`references/memory-template.md`](https://github.com/humanlayer/skills/blob/main/references/memory-template.md)) serves as persistent context storage that survives across workflow runs. Unlike ephemeral workflow variables, this markdown file retains exclusion patterns, style preferences, and known exceptions that refine agent behavior over time.

When **iteration support** is enabled, the skill configures the workflow to respond to `issue_comment` events containing the `/iterate` command. The [`agent-iteration.ts`](https://github.com/humanlayer/skills/blob/main/agent-iteration.ts) script processes these comments, extracts feedback, and triggers re-execution of the agent loop against the same pull request scope.

## Summary

- The **build-iterated-agentic-loop** skill acts as a meta-automation engine within the `humanlayer/skills` repository, converting task descriptions into operational CI/CD pipelines.
- It follows a **nine-step pipeline** encompassing repository discovery, interactive configuration, template-driven generation, and YAML validation.
- Generated artifacts include a **repo-local skill** (`.claude/skills/<slug>/SKILL.md`), a **GitHub Actions workflow** (`.github/workflows/agent-<task>.yml`), and a **persistent memory file** (`.github/agent-memory/<task>.md`).
- The system supports **comment-driven iteration** via `issue_comment` triggers and the [`agent-iteration.ts`](https://github.com/humanlayer/skills/blob/main/agent-iteration.ts) script.
- All artifacts derive from standardized templates in the `references/` directory, ensuring consistency across different agent tasks.

## Frequently Asked Questions

### What distinguishes the meta-skill from the skills it generates?

The **meta-skill** (`build-iterated-agentic-loop`) is a setup automation tool that runs once to create infrastructure, while **generated skills** are task-specific agent instructions that execute repeatedly within CI/CD workflows. The meta-skill resides in the `humanlayer/skills` repository; generated skills live in the target repository's `.claude/skills/` directory.

### How does agent memory persist across multiple workflow executions?

The skill creates a markdown file in `.github/agent-memory/` based on [`references/memory-template.md`](https://github.com/humanlayer/skills/blob/main/references/memory-template.md). This file is committed to the repository and loaded into the agent's context during each workflow run via the `--prompt` flag, allowing constraints and exceptions to accumulate permanently in version control.

### What enables the `/iterate` comment functionality on pull requests?

When configured, the skill installs [`references/agent-iteration.ts`](https://github.com/humanlayer/skills/blob/main/references/agent-iteration.ts) to `.github/scripts/` and modifies the workflow YAML to listen for `issue_comment` events. When a user comments `/iterate` on a PR, GitHub Actions triggers the workflow, and the script parses the comment to refine the agent's approach without manual branch updates.

### How does the skill determine appropriate validation commands for my repository?

During the **repository exploration** phase, the skill analyzes package manager manifests ([`package.json`](https://github.com/humanlayer/skills/blob/main/package.json), [`pyproject.toml`](https://github.com/humanlayer/skills/blob/main/pyproject.toml), [`requirements.txt`](https://github.com/humanlayer/skills/blob/main/requirements.txt)) and existing workflow files to infer test runners, lint commands, and build scripts. It suggests these as defaults during the interactive setup phase, which you can override before generation.