一键导入
orchestrate-repair-loop
Iteratively review changes, run automated tests, and apply targeted fixes until issues are resolved (or a stop condition is reached).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Iteratively review changes, run automated tests, and apply targeted fixes until issues are resolved (or a stop condition is reached).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Store, look up, or delete a personal credential (server SSH password, database password, website login, API key/token, certificate passphrase) in the macOS Keychain using a consistent <project>-<env>-<kind> naming scheme, and optionally record a pointer (never the secret itself) in the current project's Claude Code memory. Always use this skill whenever the user asks to save, store, remember, look up, rotate, or delete a password, API key, token, SSH credential, or database credential on this machine — even if they don't say "Keychain" or "security" explicitly, e.g. "save this database password so I don't lose it", "把这个数据库密码存一下", "记一条密钥", "这台服务器的密码帮我记下来", "what's the postgres password for staging again", "delete the old GitHub token from keychain". Do not use this for team-shared secret vaults, CI/CD secret injection, or anything that needs to sync across machines — those need a real secrets manager, not this skill.
Drain pending NATS messages from a producer contract via NATS MCP tools. Discovers the available NATS tool capabilities, selects exact-subject or wildcard mode from .cortex/nats.yaml, applies Tolerant Reader semantics, executes ack/nak/term decisions, and returns aggregated stats.
Audit and refactor existing SKILLs to meet spec compliance, repository asset boundaries, tool adaptation requirements, and LLM best practices.
From inside a linked worktree, deliver the current feature branch into main — merge with --no-ff, push, and optionally clean up the worktree, all without leaving CWD.
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.
From the main repo on the main branch, scan all linked worktrees and local branches, let the user multi-select, then merge --no-ff + push them sequentially and clean up succeeded worktrees together.
| name | orchestrate-repair-loop |
| description | Iteratively review changes, run automated tests, and apply targeted fixes until issues are resolved (or a stop condition is reached). |
| description_zh | 迭代审查变更、运行自动化测试并实施定向修复,直至问题解决或满足停止条件。 |
| tags | ["automation","devops","optimization"] |
| version | 1.1.1 |
| license | MIT |
| recommended_scope | both |
| metadata | {"author":"ai-cortex"} |
| triggers | ["repair","fix tests","delivery","stabilize","auto repair","auto fix","auto fix changes"] |
| aliases | ["run-repair-loop"] |
| compatibility | Requires a shell and the repo's toolchains to run tests (language-dependent). May require git for diff-based review. |
| input_schema | {"type":"code-scope","description":"Repository path and scope (diff or codebase) to converge to clean state","defaults":{"scope":"diff"}} |
| output_schema | {"type":"diagnostic-report","description":"Repair loop report with iterations, commands, patches, and final state (persist only if explicitly requested)"} |
通过运行 多次迭代循环 将代码库收敛或更改设置为“干净”:
首要目标:使用有界的、证据驱动的审查-测试-修复循环,将存储库收敛到“干净”状态——所有测试都通过并且没有“关键”/“主要”审查结果。
成功标准(必须满足所有要求):
验收测试:最终报告是否显示(a)测试通过且没有阻止审查结果,或(b)明确的停止条件,并为用户提供明确的剩余问题和选项?
本技能负责:
本技能不负责:
转交点:当环路收敛或达到停止条件时,向用户呈现修复环路报告。对于有风险的更改(架构迁移、身份验证更改、广泛重构),请在申请之前暂停并请求明确批准。
若存在 CLAUDE.md 或 .ai-cortex/config.yaml,优先读取其中的 test_command 等;否则按发现逻辑获取。参见 docs/guides/project-config.md。
确认或默认以下内容:
diff(默认):关注当前更改,优先考虑review-diff。codebase:审查指定的路径集,通过orchestrate-code-review优先考虑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 密钥。