Agent skill

Batch Refactor With Sub Agents

by r3bl-org in r3bl-org/r3bl-open-core

Use a sub-agent (like generalist) to perform repetitive code transformations across multiple files in a single turn.

Apache-2.0Auto-check passedAgent Workflows

Install Batch Refactor With Sub Agents

skills CLI
$ npx skills add r3bl-org/r3bl-open-core --skill batch-refactor-with-sub-agents -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install r3bl-org/r3bl-open-core batch-refactor-with-sub-agents --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/r3bl-org/r3bl-open-core.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/batch-refactor-with-sub-agents .claude/skills/batch-refactor-with-sub-agents && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
batch-refactor-with-sub-agents
GitHub stars
485
Token cost
~816 tokens
SKILL.md length
432 words
Files
1
Skills in repo
25
Repo updated
First seen
Licence
Apache-2.0

At a glance

Use a sub-agent (like generalist) to perform repetitive code transformations across multiple files in a single turn.

  • Works in 5 steps: Write a custom, disposable Rust script.… → Implement a --dry-run CLI argument to… → Use std::fs to read files, apply string… → …
  • Tasks that involve Subagents
  • SKILL.md covers When to Use Sub-Agents, When to Use Custom Rust…, Procedure for Sub-Agents and Pitfalls and Fixes, plus 1 more section
  • Calls cargo

What it does

Batch Refactor With Sub Agents is an agent skill from r3bl-org/r3bl-open-core. Use a sub-agent (like generalist) to perform repetitive code transformations across multiple files in a single turn.

Its SKILL.md is about 820 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering Subagents and Refactoring. The repository describes itself as: TUI framework and developer productivity apps in Rust 🦀. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Subagents
  • Tasks that involve Refactoring

Example prompts

  • “/batch-refactor-with-sub-agents”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Write a custom, disposable Rust script. Save this script in tmpfs (e.g., /tmp/).
  2. Implement a --dry-run CLI argument to test the script before making destructive changes.
  3. Use std::fs to read files, apply string replacements (replace()), and write back (only if not a dry-run).
  4. Compile it natively with rustc and execute it.
  5. Run cargo check to verify.

What it can do on your machine

Read from SKILL.md and the folder at commit 89db352. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cargo

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Batch Refactor With Sub Agents loads about 816 tokens when it runs. Until then it costs about 37 tokens; SKILL.md has 432 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~37
When it runs · the whole SKILL.md, loaded when a task matches
~816

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from r3bl-org/r3bl-open-core at commit 89db352, republished under its Apache-2.0 licence (© r3bl-org). 432 words, ~816 tokens.

Download SKILL.mdSave it as .claude/skills/batch-refactor-with-sub-agents/SKILL.md (or your agent's skills folder).
name
batch-refactor-with-sub-agents
description
Use a sub-agent (like `generalist`) to perform repetitive code transformations across multiple files in a single turn.

When to Use Sub-Agents

  • Renaming symbols or updating function signatures across many files (but not the entire repository).
  • Migrating code from one pattern to another (e.g., manual error handling to a common helper).
  • Replacing literals with centralized constants across the codebase.
  • Performing repetitive tasks that require semantic understanding and cannot be solved with a simple string replace.

When to Use Custom Rust Scripts (Priority for Massive Refactors)

For massive, repository-wide bulk refactoring (typically 6+ files, e.g., renaming a string or trait across 100+ files), you MUST NOT use sed, awk, perl, python, bash, or fish (which are strictly prohibited). Furthermore, spawning sub-agents for a simple find-and-replace across 6+ files is inefficient. Instead:

  1. Write a custom, disposable Rust script. Save this script in tmpfs (e.g., /tmp/).
  2. Implement a --dry-run CLI argument to test the script before making destructive changes.
  3. Use std::fs to read files, apply string replacements (replace()), and write back (only if not a dry-run).
  4. Compile it natively with rustc and execute it.
  5. Run cargo check to verify.

Procedure for Sub-Agents

  1. Define the transformation: Identify the exact "before" and "after" patterns. Create a representative code snippet for the sub-agent to follow.
  2. Locate targets: Use grep_search to find all absolute file paths and line numbers that need modification.
  3. Draft a precise prompt: Call the generalist (or similar) tool with a prompt that includes:
    • Goal: Clear statement of the refactoring objective.
    • Scope: A bulleted list of absolute file paths to modify.
    • Example: A code block showing the old_string vs new_string transformation.
    • Constraints: Instructions to preserve specific logic (e.g., "preserve original closure logic while changing the call site").
    • Verification: Instructions to run cargo check --all-targets or specific tests after finishing.
  4. Delegate: Execute the sub-agent call.
  5. Review and Cleanup: Sub-agents may introduce minor issues like unused_import warnings. Perform a final sweep with cargo clippy and fix manually or via a second batch call.
Show full SKILL.md (113 more words)Show less

Pitfalls and Fixes

  • symptom: Sub-agent misses some files or applies incorrect logic.
  • likely cause: Prompt was too vague or the transformation was too complex for a single turn.
  • fix: Break the task into smaller, more homogeneous batches (e.g., "refactor all files in directory A first").
  • symptom: cargo check fails after the sub-agent finishes.
  • likely cause: Sub-agent clobbered a symbol or messed up indentation/syntax.
  • fix: Read the modified files and use targeted replace calls to fix the syntax errors.

Verification

  • Run cargo check --all-targets to confirm zero compilation errors.
  • Run cargo clippy --all-targets to find and fix any unused_import or style warnings introduced by the refactor.
  • Run relevant integration tests for the modified files.

© r3bl-org, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/batch-refactor-with-sub-agents of r3bl-org/r3bl-open-core.

Open the folder on GitHubat commit 89db352

Compare with similar skills

Batch Refactor With Sub Agents next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Batch Refactor With Sub Agents compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Batch Refactor With Sub Agents this skillr3bl-org/r3bl-open-core485—~816Automated safety check: PassApache-2.0
Antigravity Agentsmarkfulton/claude-antigravity-agents130—~2.1kAutomated safety check: PassMIT
Subagent Coordinatorflyxl/datazen114—~908Automated safety check: PassGPL-3.0
Orchestrate Batch RefactorDimillian/Skills4k—~889Automated safety check: PassMIT
Batch Orchestrationrohitg00/pro-workflow2.9k—~1.2kAutomated safety check: PassNone
Codex CLIkortix-ai/suna20k—~1.6kAutomated safety check: PassCustom licence

Similar skills

  • Antigravity Agents

    markfulton/claude-antigravity-agents

    Delegate coding, code review, analysis, and research jobs to Google Antigravity CLI (agy) sub-agents that run alongside your own work.

    130 GitHub stars~2.1k tokensUpdated 2 mo ago
    Agent WorkflowsAuto-check passed
  • Orchestrate multi-track parallel feature development with subagents and git worktrees.

    114 GitHub stars~908 tokensUpdated 8 days ago
    Agent WorkflowsAuto-check passed
  • Plan and execute large refactor or rewrite efforts efficiently with parallel multi-agent analysis and implementation.

    4k GitHub stars~889 tokensUpdated 6 mo ago
    Agent WorkflowsAuto-check passed
  • Batch Orchestration

    rohitg00/pro-workflow

    Decompose large-scale changes into independent units and spawn parallel agents in isolated worktrees.

    2.9k GitHub stars~1.2k tokensUpdated 9 days ago
    Agent WorkflowsAuto-check passed
  • Codex CLI

    kortix-ai/suna

    Drive OpenAI's Codex CLI (codex exec) as a non-interactive coding sub-agent from inside Claude Code.

    20k GitHub stars~1.6k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Cursor Advanced Composer

    jeremylongshore/tons-of-skills-marketplace

    Advanced Cursor Composer techniques: agent mode, parallel agents, complex refactoring, and multi-step orchestration.

    2.8k GitHub stars~2.3k tokensUpdated today
    Agent WorkflowsAuto-check passed

More from r3bl-org/r3bl-open-core

All 25 skills in this repo
  • Analyze Log Files

    r3bl-org/r3bl-open-core

    Analyze log files by stripping ANSI escape sequences first. An agent skill from r3bl-org/r3bl-open-core.

    485 GitHub stars~632 tokensUpdated today
    Auto-check: notes
  • Analyze Performance

    r3bl-org/r3bl-open-core

    Establish performance baselines and detect regressions using flamegraph analysis.

    485 GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Check Bounds Safety

    r3bl-org/r3bl-open-core

    Apply type-safe bounds checking patterns using VPIndex/VPLength types instead of usize.

    485 GitHub stars~4.1k tokensUpdated today
    Auto-check passed
  • Release Crate

    r3bl-org/r3bl-open-core

    Publish a crate release to crates.io with changelog, standalone release notes, git tag, and GitHub release.

    485 GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Organize Modules

    r3bl-org/r3bl-open-core

    Apply private modules with public re-exports (barrel export) pattern for clean API design.

    485 GitHub stars~5.8k tokensUpdated today
    Auto-check passed
  • Check Code Quality

    r3bl-org/r3bl-open-core

    Run comprehensive Rust code quality checks including compilation, linting, documentation, and tests.

    485 GitHub stars~3.8k tokensUpdated today
    Auto-check passed

Questions about Batch Refactor With Sub Agents

What does Batch Refactor With Sub Agents do?

Use a sub-agent (like generalist) to perform repetitive code transformations across multiple files in a single turn. Batch Refactor With Sub Agents is an agent skill from r3bl-org/r3bl-open-core. Use a sub-agent (like generalist) to perform repetitive code transformations across multiple files in a single turn.

When should I use Batch Refactor With Sub Agents?

Batch Refactor With Sub Agents fits situations like: tasks that involve Subagents; tasks that involve Refactoring.

How do I install Batch Refactor With Sub Agents in Claude Code?

Run `npx skills add r3bl-org/r3bl-open-core --skill batch-refactor-with-sub-agents -a claude-code`. Or copy the skill folder (.agents/skills/batch-refactor-with-sub-agents in r3bl-org/r3bl-open-core) into .claude/skills/batch-refactor-with-sub-agents in your project. Claude Code loads it when a task matches its description.

How do I install Batch Refactor With Sub Agents in Codex?

Run `npx skills add r3bl-org/r3bl-open-core --skill batch-refactor-with-sub-agents -a codex`. Or copy the skill folder (.agents/skills/batch-refactor-with-sub-agents in r3bl-org/r3bl-open-core) into .agents/skills/batch-refactor-with-sub-agents in your project. Codex loads it when a task matches its description.

Can I use Batch Refactor With Sub Agents in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add r3bl-org/r3bl-open-core --skill batch-refactor-with-sub-agents -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/batch-refactor-with-sub-agents, .gemini/skills/batch-refactor-with-sub-agents, .github/skills/batch-refactor-with-sub-agents and .opencode/skills/batch-refactor-with-sub-agents in your project.

What does Batch Refactor With Sub Agents need to run?

Going by SKILL.md and its folder, Batch Refactor With Sub Agents needs the command-line tools its instructions call (cargo).

Does Batch Refactor With Sub Agents access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Batch Refactor With Sub Agents safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Batch Refactor With Sub Agents use?

Batch Refactor With Sub Agents is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Batch Refactor With Sub Agents use?

About 816 tokens (SKILL.md is roughly 3.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Batch Refactor With Sub Agents?

Skills that share tags, products or a category with Batch Refactor With Sub Agents: Antigravity Agents (markfulton/claude-antigravity-agents, 130 stars), Subagent Coordinator (flyxl/datazen, 114 stars), Orchestrate Batch Refactor (Dimillian/Skills, 4k stars) and Batch Orchestration (rohitg00/pro-workflow, 2.9k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Batch Refactor With Sub Agents?

r3bl-org (a GitHub organization) maintains it in r3bl-org/r3bl-open-core, which has 485 GitHub stars. The repository holds 25 skills in this directory. The repository was last updated on October 8, 2026.

Source: r3bl-org/r3bl-open-core on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.