build-iterated-agentic-loop
What it does
This skill teaches an agent how to set up a recurring coding-agent job inside a GitHub repository. It creates a focused skill, a workflow file that runs on a schedule or by hand, and a memory file that keeps standing feedback.
When to use it
- ✓When a team wants a repeatable code task, such as cleanup, to run automatically on a schedule.
- ✓When a user wants a GitHub Actions workflow that runs a coding agent and opens pull requests.
- ✓When a repo needs a memory file so feedback carries over between agent runs.
Skill link
https://github.com/humanlayer/skills/blob/main/plugins/build-iterated-agentic-loop/skills/build-iterated-agentic-loop/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Set up a weekly GitHub Actions job where a coding agent removes unused imports and opens one pull request.”
5 new skills a week. 1 minute to read.
How it works
The agent first reads the repo's existing workflows and package setup, then writes a repo skill, a workflow, and a memory file. Each workflow labels its pull requests so only one stays open per loop.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Build Iterated Agentic Loop
Use this skill when the user wants to turn a repeatable agent task into a repo-local skill plus a GitHub Actions workflow that runs a coding agent on a schedule, manually, or both.
The target shape is an iterated agentic loop: a focused skill defines the agent's judgement, a workflow invokes a coding agent with a repo-specific prompt, an agent-memory file carries standing feedback between runs, and each workflow labels its PRs so only one open PR exists per loop. The narrow-react-prop-types skill is the concrete reference pattern.
Outputs
Create or update these files in the target repo:
.claude/skills/<skill-name>/SKILL.mdfor the repo-local agent behavior..github/workflows/agent-<task-name>.ymlfor the recurring coding-agent automation..github/agent-memory/<task-name>.mdfor stable feedback and scope constraints.- Optional references under
.claude/skills/<skill-name>/references/when the skill needs templates, examples, or long supporting material.
Workflow
1. Explore the target repo
Read before asking setup questions:
- Existing
.github/workflows/*.ymland.github/actions/**to understand runner, checkout, dependency install, cache, and PR patterns. - Package manager files such as
package.json,bun.lock,pnpm-lock.yaml,yarn.lock,package-lock.json,pyproject.toml,go.mod, orCargo.toml, or other package management-related files - Existing validation scripts, especially typecheck, lint, test, quality, format, and package-scoped commands.
- Existing
.claude/skillsand.agents/skillsto avoid duplicating conventions.
Completion criterion: you can name the repo's package manager, install command, likely validation commands, and existing workflow conventions.
2. Ask setup questions
Walk the user through these decisions. Recommend defaults from repo evidence instead of presenting a blank form.
- Coding Agent: Claude Code, Codex, OpenCode, or CodeLayer. Explain the required secret and headless command for the recommended choice. Use
references/agent-runner-templates.md. CodeLayer is Humanlayer's ultra-lightweight agent harness. - Cadence: daily, weekly, weekdays, monthly, manual-only, or custom cron. Recommend a cadence based on task risk and review burden - most likely weekdays, daily, or weekly.
- Task: What task should the agent loop accomplish?
- Are there existing skills for doing this? (you can do research before asking the user this)
- Ask the user if you should look at recent PRs, git history, or other particular parts of the codebase for reference.
- Scope: which directories/packages the loop may change and which it may only inspect
- Validation: which commands must pass before the agent commits (You should propose this to the user based on your earlier research and ask them to confirm)
- PR bounding: Ask if scheduled runs should no-op when open PRs from this agent already exist, and if so, how many open PRs to allow before blocking new runs.
- Recommended: Yes, bound to 1 open PR per agent loop. This prevents the agent from creating unbounded work that piles up faster than humans can review. Without bounding, a daily agent could generate 5+ unreviewed PRs in a week, creating review fatigue and merge conflicts.
- The workflow uses a label (e.g.,
agent-<task-slug>) to identify PRs from each agent loop. Scheduled runs checkgh pr list --label <label> --state openand skip if the count meets or exceeds the bound. - Manual
workflow_dispatchruns bypass the bound check, allowing forced runs when needed.
- PR metadata: label name, PR title prefix, and branch prefix.
- Suggest
[MM/DD][Agent: <Agent Name>]: <Concise Description>as a template, e.g.[6/23][Agent: Effect Migrator]: Migrate XYZ module
- Response format: How should the CI agent format its final response (which becomes the PR body)?
- Show the user
references/response-template.mdfor examples (fix/migration, generation, refactor). - Ask what information reviewers need: summary stats, risk levels, verification steps, file lists, etc.
- Create a customized response template that the generated skill will reference in its
references/directory
- Iteration behavior: whether
/iteratecomments should update the existing PR.
- If enabled, install
references/agent-iteration.tsto the repo. Ask the user's preferred location:.github/scripts/,ci-scripts/, orscripts/. - The
FAQ
Will it open many pull requests?
No. The skill says each workflow labels its pull requests so only one stays open per loop.
What does the memory file hold?
Stable feedback and scope limits that carry over between runs.
Is there an example to follow?
Yes. The skill names narrow-react-prop-types as a concrete reference pattern.
Details
Original description by the author
build a repo-local skill and install a matching iterated coding-agent GitHub Actions workflow, prompt, memory file, and reference templates
repo: humanlayer/skills
Popularity
- GitHub stars
- 5.5k
- Ranking position
- #14774
- License
- MIT
- Updated
- 11/1/2026
Comments
- …
More skills from this repository
design-control-loop
5.5kHelps your agent interview you and design a control loop that moves your codebase toward a goal through small, reviewable changes, then builds it as a scheduled workflow.
improve-claude-md
5.5kHelps your agent rewrite a CLAUDE.md file with conditional blocks, so important instructions are followed when they apply and the rest stays out of the way.
rpi
5.5kHelps your agent research a change, work through its design, and implement it in clear phases, with a document for each step you can review.
visual-pr
5.5kHelps your agent write or update a pull request description that explains why a change exists and how it is built, using a clear template and a short visual outline.
Similar skills
openclaw-update
394kHelps your agent update an existing OpenClaw Gateway, choosing the update method that fits how it was installed and keeping your session working.
diagnose-gateway
394kHelps your agent find out why your OpenClaw Gateway is failing by checking settings, channels, and ports without changing anything.
crabbox-apps
394kHelps your agent open and run an app on a temporary cloud machine, then show its view in your chat side panel.