build-iterated-agentic-loop
它能做什么
这项技能教智能体如何在 GitHub 仓库中设置定期运行的编码智能体任务。它会创建一个专注的技能、一个可按计划或手动运行的工作流文件,以及一个保存长期反馈的记忆文件。
适用场景
- ✓当团队希望让清理等可重复的代码任务按计划自动运行的时候。
- ✓当用户希望有一个运行编码智能体并自动提交拉取请求的 GitHub Actions 工作流的时候。
- ✓当仓库需要记忆文件,使反馈能在智能体多次运行之间延续的时候。
技能链接
https://github.com/humanlayer/skills/blob/main/plugins/build-iterated-agentic-loop/skills/build-iterated-agentic-loop/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请设置一个每周运行的 GitHub Actions 任务:由编码智能体删除未使用的导入,并提交一个拉取请求。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会先阅读仓库已有的工作流和包配置,然后编写仓库技能、工作流和记忆文件。每个工作流都会为其拉取请求加上标签,使每个循环只保留一个打开的拉取请求。
技术内容(原始 SKILL.md)
作者在 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
常见问题
它会打开很多拉取请求吗?
不会。这项技能说明,每个工作流都会为其拉取请求加标签,因此每个循环只保留一个打开的拉取请求。
记忆文件保存什么?
稳定的反馈意见和范围限制,它们会在多次运行之间延续。
有可以参考的示例吗?
有。这项技能把 narrow-react-prop-types 列为具体的参考模式。
详情
作者的原始描述
build a repo-local skill and install a matching iterated coding-agent GitHub Actions workflow, prompt, memory file, and reference templates
repo: humanlayer/skills
热度
- GitHub 星标
- 5.5k
- 排名
- #14774
- 许可证
- MIT
- 更新时间
- 2026/11/1
评论
- …
同一仓库的更多技能
design-control-loop
5.5k帮你的智能体通过访谈了解你的需求,设计一个控制循环,借助小而可审阅的改动让代码库逐步趋近目标,然后将其构建为定时工作流。
improve-claude-md
5.5k帮你的智能体用条件代码块重写 CLAUDE.md 文件,使重要的指示在适用时被遵循,其余内容不会造成干扰。
rpi
5.5k帮你的智能体研究一项改动,梳理其设计,并分阶段清晰地实施,每一步都会生成一份可供你审阅的文档。
visual-pr
5.5k帮你的智能体撰写或更新拉取请求说明,使用清晰的模板和简短的视觉大纲,解释改动为什么存在以及如何实现。