skills/automate-repair/SKILL.md
Iteratively review changes, run automated tests, and apply targeted fixes until issues are resolved (or a stop condition is reached).
npx skillsauth add nesnilnehc/ai-cortex automate-repairInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
通过运行 多次迭代循环 将代码库收敛或更改设置为“干净”:
首要目标:使用有界的、证据驱动的审查-测试-修复循环,将存储库收敛到“干净”状态——所有测试都通过并且没有“关键”/“主要”审查结果。
成功标准(必须满足所有要求):
验收测试:最终报告是否显示(a)测试通过且没有阻止审查结果,或(b)明确的停止条件,并为用户提供明确的剩余问题和选项?
本技能负责:
本技能不负责:
转交点:当环路收敛或达到停止条件时,向用户呈现修复环路报告。对于有风险的更改(架构迁移、身份验证更改、广泛重构),请在申请之前暂停并请求明确批准。
若存在 CLAUDE.md 或 .ai-cortex/config.yaml,优先读取其中的 test_command 等;否则按发现逻辑获取。参见 docs/guides/project-config.md。
确认或默认以下内容:
diff(默认):关注当前更改,优先考虑review-diff。codebase:审查指定的路径集,通过review-code优先考虑review-codebase/语言技能。max_iterations 默认值:5。time_budget 默认值:“尽力而为”;如果用户提供了时间限制,请严格遵守。对于“i = 1..max_iterations”:
收集当前信号(证据优先)
diff:对当前 diff/未跟踪的添加运行/执行 review-diff 传递。运行测试
fast(默认):仅进行单元测试,最少的设置。ci:尽可能接近地镜像 CI 步骤。full:包括集成/e2e(仅对依赖项/服务进行明确确认)。综合修复计划(最小正确补丁)
应用修复
重新运行最小验证
汇合时尽早停车
如果发生任何情况,请停止并向用户询问方向:
max_iterations 已耗尽,剩余失败。停止时,提供最短路径选项:
fast -> ci -> full)默认情况下不要编写独立的报告文件。如果用户明确要求保留,请写入从项目规范解析的路径,或默认为“docs/calibration/repair-loop.md”并覆盖规范文件,除非明确请求快照。
.)fast(默认)、ci、fullmax_iterations(默认为5)不要做这些(其他技能可以处理它们):
review-diff何时停止并交接:
最终报告是否显示(a)测试通过且没有阻止审查结果,或(b)明确的停止条件,并为用户提供明确的剩余问题和选项?
用户:“让测试通过。继续修复直到绿色。”
代理:
diff,测试模式=fast,max_iterations=5;确认允许安装(npm ci)并且允许网络。npm test,修复第一个失败的测试,重新运行 npm test。review-diff 以捕获修复引入的边缘情况;重新运行npm test。用户:“镜像 CI 并修复故障。”
代理:
ci,但检测 CI 使用 docker compose 和 env 密钥。每次技能执行必须以下列 Markdown 格式输出修复循环报告。
完成标准:测试通过 · 无关键/主要审查结果 范围:diff · 测试模式:fast · 最大迭代:5
审查(<使用的审查技能>):关键 0 / 主要 1 / 次要 2
阻塞项:<问题描述,无则省略本行>
测试:<command> → ✅ 通过 / ❌ 失败
首次失败:<摘录,通过时省略本行>
修复:<file1>, <file2> — <意图一句话>
重新验证:<command> → ✅ 通过 / ❌ 失败
<command>)/ ❌ 仍有失败<列表或"无"><列表或"无">development
Generate an LLM agent test suite (golden cases, mock-LLM unit tests, evaluator harness) from an agent implementation and its agent-test contract. Use when an agent has no tests, or a contract exists but the test code is missing.
development
After code changes, auto-detect the project's build system and local deployment method for a given directory, then build the project and restart its locally-deployed environment (Docker Compose / systemd / process manager). Never assumes — asks only when detection is ambiguous. Caches detected commands per project in .cortex/redeploy-local.yaml; re-invocations on the same project skip re-scanning until signal files change, the cache expires (30 days), or the skill version bumps.
tools
Publish a NATS message conforming to a cross-team contract, using NATS MCP tools. Authors the contract on first use if missing. Reads project-level cache (.cortex/nats.yaml) to avoid re-prompting basics across sessions.
tools
Drain pending NATS messages from a producer contract via NATS MCP tools (default batch / drain-style). Applies Tolerant Reader semantics and per-message ack/nak/term, returning aggregated stats. Reads project-level cache (.cortex/nats.yaml) to avoid re-prompting.