‹ 首页

orchestrate-batch-refactor

@dimillian · 收录于 1 周前 · 上游提交 4 个月前

Plan and execute large refactor or rewrite efforts efficiently with parallel multi-agent analysis and implementation. Use when a user asks to refactor many files, split workstreams, analyze a target code area, and coordinate sub-agents with clear ownership and dependency-aware execution.

适合你,如果经常需要重构大量文件并协调多个子任务

/ 通过 npx 安装 校验哈希
npx oh-my-skill add dimillian/skills/orchestrate-batch-refactor
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- dimillian/skills/orchestrate-batch-refactor
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify dimillian/skills/orchestrate-batch-refactor
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
3846GitHub stars
~700最小装载
~1.2K含声明引用
~1.2K文本包总量
索引托管

怎么用

商店整理自技能原文 · 版本 05ba982 · 表述以原文为准
它做什么

Claude 会先并行分析代码范围,然后制定依赖感知的计划,再派发子代理并行执行独立的代码重构或重写任务,最后整合验证并报告结果。

什么时候触发

当你要求重构或重写多个文件、拆分工作流、分析目标代码区域时触发。适用于中等或大规模涉及多个文件或子系统的任务。

装好后可以这样说
Claude 会分析范围、制定计划并派发子代理并行执行。
Claude 会创建依赖图,并行执行独立包。
Claude 会启动 explorer 子代理并行分析。
技能原文 SKILL.md作者撰写 · MIT · 05ba982

Orchestrate Batch Refactor

Overview

Use this skill to run high-throughput refactors safely. Analyze scope in parallel, synthesize a single plan, then execute independent work packets with sub-agents.

Inputs
  • Repo path and target scope (paths, modules, or feature area)
  • Goal type: refactor, rewrite, or hybrid
  • Constraints: behavior parity, API stability, deadlines, test requirements
When to Use Parallelization
  • Use this skill for medium/large scope touching many files or subsystems.
  • Skip multi-agent execution for tiny edits or highly coupled single-file work.
Core Workflow
  1. Define scope and success criteria.
  2. List target paths/modules and non-goals.
  3. State behavior constraints (for example: preserve external behavior).
  4. Run parallel analysis first.
  5. Split target scope into analysis lanes.
  6. Spawn explorer sub-agents in parallel to analyze each lane.
  7. Ask each agent for: intent map, coupling risks, candidate work packets, required validations.
  8. Build one dependency-aware plan.
  9. Merge explorer output into a single work graph.
  10. Create work packets with clear file ownership and validation commands.
  11. Sequence packets by dependency level; run only independent packets in parallel.
  12. Execute with worker agents.
  13. Spawn one worker per independent packet.
  14. Assign explicit ownership (files/responsibility).
  15. Instruct every worker that they are not alone in the codebase and must ignore unrelated edits.
  16. Integrate and verify.
  17. Review packet outputs, resolve overlaps, and run validation gates.
  18. Run targeted tests per packet, then broader suite for integrated scope.
  19. Report and close.
  20. Summarize packet outcomes, key refactors, conflicts resolved, and residual risks.
Work Packet Rules
  • One owner per file per execution wave.
  • No parallel edits on overlapping file sets.
  • Keep packet goals narrow and measurable.
  • Include explicit done criteria and required checks.
  • Prefer behavior-preserving refactors unless user explicitly requests behavior change.
Planning Contract

Every packet must include:

  1. Packet ID and objective.
  2. Owned files.
  3. Dependencies (none or packet IDs).
  4. Risks and invariants to preserve.
  5. Required checks.
  6. Integration notes for main thread.

Use [references/work-packet-template.md](references/work-packet-template.md) for the exact shape.

Agent Prompting Contract
  • Use the prompt templates in [references/agent-prompt-templates.md](references/agent-prompt-templates.md).
  • Explorer prompts focus on analysis and decomposition.
  • Worker prompts focus on implementation and validation with strict ownership boundaries.
Safety Guardrails
  • Do not start worker execution before plan synthesis is complete.
  • Do not parallelize across unresolved dependencies.
  • Do not claim completion if any required packet check fails.
  • Stop and re-plan when packet boundaries cause repeated merge conflicts.
Validation Strategy

Run in this order:

  1. Packet-level checks (fast and scoped).
  2. Cross-packet integration checks.
  3. Full project safety checks when scope is broad.

Prefer fast feedback loops, but never skip required behavior checks.

按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。