design-creative
Turn Repeat Agent Tasks into Self-Running Loops
Learn how build-iterated-agentic-loop turns a repeatable agent task into a repo-local skill with a scheduled GitHub Actions workflow.
Where this fits
You have a coding agent that keeps doing the same kind of work—narrowing prop types, updating dependency pins, or refreshing generated docs—but every run requires you to re-explain the rules and manually trigger it. You want that task to become a self-contained, repeatable loop: the agent knows exactly what to do, runs on a schedule or on demand, remembers feedback between runs, and opens a single PR per iteration. That's the workflow build-iterated-agentic-loop sets up for you.
Why agents benefit
- Repo-local skill definition: The SKILL.md file gives the agent a focused, versioned set of instructions that live right next to your code—no more hunting for context in chat history.
- Automated trigger via GitHub Actions: The workflow invokes the coding agent on a cron schedule, on manual dispatch, or both, so the loop keeps running without human babysitting.
- Persistent memory file: A dedicated agent-memory file carries standing feedback and scope constraints between runs, so the agent improves its output over time instead of starting from zero each time.
- Single-PR discipline: Each loop labels its PRs and ensures only one open PR exists per task, preventing merge conflicts and review fatigue.
- Reference templates: Optional references under
references/let you include long examples, style guides, or edge-case handling that keep the agent consistent.
Practical scenarios
Keeping a TypeScript codebase's prop types narrow
Your team uses a broad React.FC pattern that allows any props. You want an agent to scan each PR and narrow prop types to explicit interfaces. Set up a loop that runs on new commits, applies your naming conventions via the skill, and opens a single PR with fixes—while remembering which files you've already told it to skip.
Refreshing generated API documentation
You have an OpenAPI spec that changes frequently. Instead of manually regenerating Markdown docs, create a loop that runs nightly, updates the docs from the spec, and opens a PR. The memory file tracks which sections need manual review, and the skill enforces your formatting and linking rules.
Auditing dependency security patches
A weekly workflow scans your package.json for outdated dependencies, applies safe upgrades, and runs tests. The skill defines what counts as "safe" (semver-minor, no breaking changes), and the memory file remembers previous exceptions and approved versions.
Add it to your agent workflow
Install the skill and let it scaffold the files for you:
npx skills add humanlayer/skills --skill build-iterated-agentic-loop
Then, in your repo, invoke the skill to generate the loop for a task like narrow-react-prop-types. The skill will create .claude/skills/narrow-react-prop-types/SKILL.md, .github/workflows/agent-narrow-react-prop-types.yml, and .github/agent-memory/narrow-react-prop-types.md. Customize the workflow schedule and the skill's instructions, then commit. The agent will start running and iterating on its own.
Compare before adopting
Before you adopt this pattern, compare it with alternatives: check how well the skill's quality signals (clear outputs, explicit memory usage) match your task complexity; verify the maintenance freshness (last commit, open issues) on the source repo; and consider whether a simpler cron job with a plain prompt would suffice—this skill shines when you need persistent memory and single-PR discipline. Also evaluate how the workflow fits into your existing CI/CD setup and whether the agent's PRs will conflict with other automated processes.
Why it is worth tracking
With 3,120 stars and an active author (humanlayer), this skill represents a practical, opinionated pattern for turning one-off agent tasks into durable, self-improving loops. It's worth tracking because it demonstrates a clean separation between skill definition, automation, and memory—a blueprint you can adapt even if you don't use the exact files. Evaluate it when you find yourself re-explaining the same agent task more than twice, or when you want to give your agents a stable, repo-embedded operating procedure. For more agent-skill patterns, see this skill's page on OpenAgentSkill.
Featured Skill
build-iterated-agentic-loop
Skill by humanlayer