ci-iteration by dagster-io/erk
npx skills add https://github.com/dagster-io/erk --skill ci-iteration运行指定的 CI 目标并自动修复所有失败。持续迭代,直到所有检查通过或遇到需要人工干预的问题而卡住。
重要提示:所有 make 命令必须在仓库根目录下运行。Makefile 位于仓库根目录,而不是子目录中。
关键要求:当生成子代理来运行 make、pytest、ty、ruff、prettier 或 gt 命令时,必须使用 devrun:
Task tool with:
- subagent_type: devrun <- 必须是 devrun,绝不能是 general-purpose
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
原因:devrun 具有严格的工具限制(无 Edit/Write),可防止破坏性更改。父代理(您)处理报告并应用修复——子代理仅负责报告。
禁止事项:
必需事项:
使用 devrun 代理从仓库根目录运行指定的 make 目标:
Task tool with:
- subagent_type: devrun
- description: "从仓库根目录运行 [make target]"
- prompt: "切换到仓库根目录并执行: [make target]"
分析输出以确定哪些检查失败:
根据失败类型,应用适当的修复:
| 失败类型 | 修复命令 |
|---|---|
| Ruff 代码检查 | 通过 devrun 运行 make fix |
| Ruff 格式检查 | 通过 devrun 运行 make format |
| Prettier | 通过 devrun 运行 make prettier |
| Sync-Kit | 直接运行 erk sync |
| MD-check | 编辑 CLAUDE.md 使其仅包含 @AGENTS.md |
| ty | 编辑文件以修复类型注解 |
| 测试 | 读取并编辑源文件/测试文件 |
应用修复后,再次通过 devrun 运行 make 目标。继续循环:运行 -> 识别失败 -> 修复 -> 验证。
安全限制:
使用 TodoWrite 跟踪进度:
迭代 1: 修复代码检查错误
迭代 2: 修复格式错误
迭代 3: 修复 src/erk/cli/commands/switch.py 中的类型错误
迭代 4: 所有检查通过
成功:当 make 目标以代码 0 退出时停止(所有检查通过)
卡住:在以下情况下停止并向用户报告:
## 最终状态: 成功
经过 N 次迭代后,所有 CI 检查均已通过:
(检查) **代码检查 (ruff check)**: 通过
(检查) **格式检查 (ruff format --check)**: 通过
(检查) **Prettier**: 通过
(检查) **AGENTS.md 标准 (md-check)**: 通过
(检查) **ty**: 通过
(检查) **测试**: 通过
(检查) **Sync-Kit (erk check)**: 通过
代码已准备好提交/PR。
重要提示:在 markdown 输出中,每个检查行之间必须用空行分隔,以便在 CLI 中正确渲染。
## 最终状态: 卡住
经过 N 次尝试后,我无法解决以下问题:
**检查**: [代码检查/格式检查/prettier/md-check/ty/测试]
**错误**:
[确切的错误信息]
**文件**: [文件路径,如果适用]
**尝试过的修复**:
1. [您首先尝试的内容]
2. [您其次尝试的内容]
3. [您第三次尝试的内容]
**后续步骤**:
[建议需要手动完成的操作]
迭代 1:
- 使用带有 devrun 代理的 Task 工具从仓库根目录运行 make 目标
- 发现: 5 个代码检查错误,2 个文件需要格式化
- 修复: 使用带有 devrun 代理的 Task 工具从仓库根目录运行 make fix,然后运行 make format
- 结果: 剩余 3 个代码检查错误
迭代 2:
- 使用带有 devrun 代理的 Task 工具从仓库根目录运行 make 目标
- 发现: 3 个代码检查错误(导入问题)
- 修复: 编辑文件以修复导入问题
- 结果: 所有代码检查/格式检查通过,2 个类型错误
迭代 3:
- 使用带有 devrun 代理的 Task 工具从仓库根目录运行 make 目标
- 发现: switch.py:45 和 switch.py:67 处有 2 个 ty 错误
- 修复: 添加类型注解
- 结果: 所有检查通过
成功
每周安装量
53
仓库
GitHub 星标数
74
首次出现
2026年1月29日
安全审计
安装于
codex53
opencode52
claude-code52
github-copilot52
kimi-cli51
gemini-cli51
Run the specified CI target and automatically fix any failures. Keep iterating until all checks pass or you get stuck on an issue that requires human intervention.
IMPORTANT : All make commands must be run from the repository root directory. The Makefile is located at the root of the repository, not in subdirectories.
CRITICAL : When spawning sub-agents to run make, pytest, ty, ruff, prettier, or gt commands, you MUST use devrun:
Task tool with:
- subagent_type: devrun <- MUST be devrun, NEVER general-purpose
Why : devrun has hard tool constraints (no Edit/Write) preventing destructive changes. The parent agent (you) processes reports and applies fixes - sub-agents only report.
FORBIDDEN :
REQUIRED :
Use the devrun agent to run the specified make target from the repository root:
Task tool with:
- subagent_type: devrun
- description: "Run [make target] from repo root"
- prompt: "Change to repository root and execute: [make target]"
Analyze the output to identify which check(s) failed:
Based on failure type, apply appropriate fixes:
| Failure Type | Fix Command |
|---|---|
| Ruff lint | make fix via devrun |
| Ruff format | make format via devrun |
| Prettier | make prettier via devrun |
| Sync-Kit | erk sync directly |
| MD-check | Edit CLAUDE.md to contain only @AGENTS.md |
| ty | Edit files to fix type annotations |
| Tests | Read and edit source/test files |
After applying fixes, run the make target again via devrun. Continue the cycle: run -> identify failures -> fix -> verify.
Safety Limits:
Use TodoWrite to track progress:
Iteration 1: Fixing lint errors
Iteration 2: Fixing format errors
Iteration 3: Fixing type errors in src/erk/cli/commands/switch.py
Iteration 4: All checks passed
SUCCESS : Stop when the make target exits with code 0 (all checks passed)
STUCK : Stop and report to user if:
## Finalization Status: SUCCESS
All CI checks passed after N iteration(s):
(check) **Lint (ruff check)**: PASSED
(check) **Format (ruff format --check)**: PASSED
(check) **Prettier**: PASSED
(check) **AGENTS.md Standard (md-check)**: PASSED
(check) **ty**: PASSED
(check) **Tests**: PASSED
(check) **Sync-Kit (erk check)**: PASSED
The code is ready for commit/PR.
IMPORTANT : Each check line MUST be separated by a blank line in the markdown output to render properly in the CLI.
## Finalization Status: STUCK
I was unable to resolve the following issue after N attempts:
**Check**: [lint/format/prettier/md-check/ty/test]
**Error**:
[Exact error message]
**File**: [file path if applicable]
**Attempted Fixes**:
1. [What you tried first]
2. [What you tried second]
3. [What you tried third]
**Next Steps**:
[Suggest what needs to be done manually]
Iteration 1:
- Use Task tool with devrun agent to run make target from repo root
- Found: 5 lint errors, 2 files need formatting
- Fix: Use Task tool with devrun agent to run make fix, then make format from repo root
- Result: 3 lint errors remain
Iteration 2:
- Use Task tool with devrun agent to run make target from repo root
- Found: 3 lint errors (imports)
- Fix: Edit files to fix import issues
- Result: All lint/format pass, 2 type errors
Iteration 3:
- Use Task tool with devrun agent to run make target from repo root
- Found: 2 ty errors in switch.py:45 and switch.py:67
- Fix: Add type annotations
- Result: All checks pass
SUCCESS
Weekly Installs
53
Repository
GitHub Stars
74
First Seen
Jan 29, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex53
opencode52
claude-code52
github-copilot52
kimi-cli51
gemini-cli51
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
145,500 周安装
ScrapeNinja:高性能网络爬虫API,绕过反爬虫,支持JS渲染与代理轮换
101 周安装
UI/UX Pro Max - 智能设计助手 | UI样式、配色方案、字体配对、UX最佳实践
102 周安装
Supabase存储桶文件访问权限测试 - 安全审计与数据暴露检测工具
102 周安装
C#开发专家:.NET 8、ASP.NET Core Web API与Entity Framework Core企业级应用开发
103 周安装
zapper技能 - Bankrbot开源AI技能库中的自动化工具,支持多平台安装
101 周安装
Vitest 测试框架:Vite 驱动的下一代 JavaScript/TypeScript 测试工具
102 周安装