r3bl-open-core: Skill for Claude Code

.agents/skills/batch-refactor-with-sub-agents/SKILL.md

batch-refactor-with-sub-agents is a skill for Claude Code, Codex from r3bl-org/r3bl-open-core. It costs 31 tokens per session (755 once invoked), scanned A, original, Apache-2.0.

A workflow for using a sub-agent to apply the same semantically meaningful code change across multiple files. It also describes when a custom Rust script is better for very large refactors.

In plain words
What is it for?
Use it for repeated renames, function-signature updates, pattern migrations, and replacing duplicated literals across a codebase.
Why use it?
It reduces repetitive manual edits while keeping changes understandable and checking that the refactored code still works.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents; installed under .agents/ (shared by several agents).

This is r3bl-org/r3bl-open-core's own configuration. It tells Claude Code and Codex how to work on r3bl-open-core itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything r3bl-open-core configures →

Reuse

Borrowing it

Nothing to install: this file belongs to r3bl-org/r3bl-open-core. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/r3bl-org/r3bl-open-core/main/.agents/skills/batch-refactor-with-sub-agents/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/r3bl-org/r3bl-open-core

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for batch-refactor-with-sub-agents

README.md
[![agentmods](https://agentmods.dev/badge/skills/r3bl-org/r3bl-open-core/batch-refactor-with-sub-agents/github.svg)](https://agentmods.dev/skills/r3bl-org/r3bl-open-core/batch-refactor-with-sub-agents)
Your own site
<a href="https://agentmods.dev/skills/r3bl-org/r3bl-open-core/batch-refactor-with-sub-agents"><img src="https://agentmods.dev/badge/skills/r3bl-org/r3bl-open-core/batch-refactor-with-sub-agents/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for batch-refactor-with-sub-agents

Your own site · 80×15
<a href="https://agentmods.dev/skills/r3bl-org/r3bl-open-core/batch-refactor-with-sub-agents"><img src="https://agentmods.dev/badge/skills/r3bl-org/r3bl-open-core/batch-refactor-with-sub-agents.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 755 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Memory Poisoning · line 25
    Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
    Fix: Protect agent memory and state from modification by untrusted content. Use read-only memory for critical instructions and validate all state changes.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00031 $0.00755
Opus 5 $0.00015 $0.00378
Sonnet 5 $0.00006 $0.00151
Haiku 4.5 $0.00003 $0.00076

Measured 9d ago against content hash ee5463f6ccd5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

batch-refactor-with-sub-agents scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/batch-refactor-with-sub-agents/SKILL.md · 45 lines

How it starts

The opening of the file, as written. The whole thing — 45 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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.

Read the full file on GitHub · 45 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 45 lines · 31 tokens per session scan A ee5463f6ccd5

Subscribe to this mod's changes

batch-refactor-with-sub-agents is a skill published in the GitHub repository r3bl-org/r3bl-open-core (483 stars, last pushed 3d ago), licensed Apache-2.0. It adds 31 tokens to every session and 755 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories