orchestrate-batch-refactor – skill Lập trình cho agent AI
Lập kế hoạch và thực hiện các đợt refactor lớn với các gói công việc có tính đến phụ thuộc và phân tích song song.
Cài skill orchestrate-batch-refactor bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/orchestrate-batch-refactor-556c7.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /orchestrate-batch-refactor – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/orchestrate-batch-refactor-556c7.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $orchestrate-batch-refactor – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/orchestrate-batch-refactor-556c7.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /orchestrate-batch-refactor – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/orchestrate-batch-refactor-556c7.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /orchestrate-batch-refactor – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Orchestrate Batch Refactor
Overview
Use this skill to run high-throughput refactors safely.
When delegation is explicitly authorized by current user or repository instructions, analyze scope in parallel, synthesize a single plan, then execute independent work packets. Otherwise apply the same packet planning sequentially; no agent type or model is implicitly available.
When to Use
- When a refactor spans many files or subsystems and needs clear work partitioning.
- When you need dependency-aware planning before parallel implementation.
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.
- List target paths/modules and non-goals.
- State behavior constraints (for example: preserve external behavior).
2. Run parallel analysis first.
- Split target scope into analysis lanes.
- Spawn
explorersub-agents in parallel to analyze each lane. - Ask each agent for: intent map, coupling risks, candidate work packets, required validations.
3. Build one dependency-aware plan.
- Merge explorer output into a single work graph.
- Create work packets with clear file ownership and validation commands.
- Sequence packets by dependency level; run only independent packets in parallel.
4. Execute with worker agents.
- Spawn one
workerper independent packet. - Assign explicit ownership (files/responsibility).
- Instruct every worker that they are not alone in the codebase and must ignore unrelated edits.
5. Integrate and verify.
- Review packet outputs, resolve overlaps, and run validation gates.
- Run targeted tests per packet, then broader suite for integrated scope.
6. Report and close.
- 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.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Skill liên quan
- papers-skill – Kỹ năng cho quy trình nghiên cứu học thuật: tìm kiếm trên Semantic Scholar (hơn 200…
- parcel-coupon – Gọi API phiếu giảm giá bưu kiện/chuyển phát để lấy phiếu dịch vụ logistics trọn gói, bao…
- penetration-testing – Thực hiện kiểm thử xâm nhập cơ bản và đánh giá bảo mật.
- performance-engineer – Chẩn đoán nút thắt hiệu năng bằng profiling, trace, kiểm thử tải và observability; xác…
- performance-management – Sổ đánh giá hiệu suất: loại đánh giá, kỳ đánh giá, nhân viên và người đánh giá, điểm…
- performance-optimizer – Xác định và sửa nút thắt hiệu năng trong mã nguồn, cơ sở dữ liệu và API. Đo trước và sau…
- performance-testing-review-ai-review – Rà soát các thay đổi mã nhạy cảm về hiệu năng với mốc chuẩn tái lập được, chỉ số khối…
- performance-testing-review-multi-agent-review – Rà soát một diff mã đã xác định từ góc nhìn đúng đắn, phân quyền và hiệu năng liên quan…