batch-mode
Skill4 starsChanged 8 months agoMITView on GitHub
When the user needs to perform the same operation across multiple files, components, or entities. Use when the user says "do this to all," "batch," "bulk update," "across all files," "every component," "mass refactor," "rename everywhere," "update all," "migrate all," or when a task involves applying a consistent pattern to 3+ targets. Orchestrates parallel processing of repetitive tasks with consistency guarantees.
In this repository21 other files it gives its agents.
- docs/llms.txtllms.txt
- llms.txtllms.txt
- anti-distillationSkill
- autodreamSkill
- bughunterSkill
- codebase-insightSkill
- code-reviewSkill
- context-compressionSkill
- coordinator-modeSkill
- effort-estimateSkill
- frustration-awareSkill
- kairos-sessionSkill
- magic-docsSkill
- pr-autofixSkill
- prompt-speculationSkill
- security-reviewSkill
- session-reviewSkill
- stuck-recoverySkill
- thinkbackSkill
- ultraplanSkill
- undercover-modeSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 120
For independent targets: Use Agent tool with isolation: "worktree" to process in parallel (up to 5 at a time).
- Distinctive: line 126
When a target doesn't fit the pattern:
- Distinctive: line 139
Never force a pattern onto code that doesn't fit.
- Distinctive: line 202
Always dry run first: Never apply a batch without verifying the pattern on one target.
- Distinctive: line 205
Verify after each change: If verification is possible (compile check, test run), do it per target, not just at the end.
- Distinctive: line 208
Don't batch what shouldn't be batched: If each target needs a unique approach, it's not a batch — it's a task list.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Batch Mode — Parallel Consistent Processing
You are a batch processing engine. When the same operation needs to happen across multiple targets, you systematize it for speed, consistency, and reliability.
When To Use
- Same change across 3+ files
- Migrating patterns across a codebase
- Bulk renaming (variables, functions, files, imports)
- Applying a new standard to existing code
- Mass-generating similar content (tests, docs, components)
- Processing multiple items from a list
The Batch Protocol
Step 1: Define the Operation
Formalize what needs to happen:
BATCH OPERATION:
─────────────────
Template: [the exact change pattern]
Targets: [what gets changed]
Scope: [where to look]
Exceptions: [what to skip]
Validation: [how to verify each change]Example:
BATCH OPERATION:
─────────────────
Template: Add error boundary wrapper to React components
Targets: All page-level components in src/pages/
Scope: 14 files matching src/pages/**/*.tsx
Exceptions: Skip _app.tsx and _document.tsx
Validation: Each wrapped component still renders without errorsStep 2: Discover Targets
Systematically find all targets:
# File-based targets
glob: src/pages/**/*.tsx → 14 files
# Pattern-based targets
grep: "export default function.*Page" → 12 matches
# Intersection
targets = glob ∩ grep - exceptions = 10 filesPresent the target list to the user:
Found 10 targets for batch operation:
1. src/pages/Dashboard.tsx
2. src/pages/Settings.tsx
3. src/pages/Profile.tsx
...
Excluded:
- src/pages/_app.tsx (exception rule)
- src/pages/_document.tsx (exception rule)
Proceed with all 10? Or modify the list?Step 3: Dry Run
Process ONE target as a reference implementation:
DRY RUN — src/pages/Dashboard.tsx:
─────────────────────────────────
Before:
export default function Dashboard() { ... }
After:
export default function Dashboard() {
return <ErrorBoundary><DashboardContent /></ErrorBoundary>
}
Changes: +3 lines, +1 import
Validation: ✅ compiles, ✅ matches patternGet user approval: "This is the pattern. Apply to remaining 9 targets?"
Step 4: Execute Batch
Process all targets, tracking progress:
Batch Progress:
[██████████░░░░░░░░░░] 5/10
✅ Dashboard.tsx — applied
✅ Settings.tsx — applied
✅ Profile.tsx — applied
✅ Users.tsx — applied
✅ Analytics.tsx — applied
⏳ Billing.tsx — processing
⬜ Reports.tsx
⬜ Integrations.tsx
⬜ Admin.tsx
⬜ Support.tsxFor independent targets: Use Agent tool with isolation: "worktree" to process in parallel (up to 5 at a time).
For dependent targets: Process sequentially, using each result to inform the next.
Step 5: Handle Exceptions
When a target doesn't fit the pattern:
⚠️ EXCEPTION: src/pages/Billing.tsx
Reason: Already has a different error boundary implementation
Options:
a) Replace existing with new pattern
b) Skip this file
c) Merge both patterns
→ Marking as skipped, flagging for manual reviewNever force a pattern onto code that doesn't fit. Flag it and move on.
Step 6: Batch Report
After completion:
BATCH REPORT
═══════════════════════
Operation: Add error boundary wrapper
Targets: 10 files
Completed: 9 ✅
Skipped: 1 ⚠️ (Billing.tsx — pre-existing pattern)
Failed: 0
Files Modified:
- src/pages/Dashboard.tsx (+3 lines)
- src/pages/Settings.tsx (+3 lines)
...
Manual Review Needed:
- src/pages/Billing.tsx — has existing error boundary, needs human decision
Validation:
- All modified files compile ✅
- Pattern consistency verified ✅
═══════════════════════Batch Patterns
Pattern: Find & Replace
Operation: Rename `oldFunction` to `newFunction` across codebase
Method: grep → verify each usage → replace → check importsPattern: Mass Migration
Operation: Migrate from library A to library B
Method: Find all imports of A → map to B equivalents → replace → update usage patternsPattern: Bulk Generation
Operation: Generate tests for all untested components
Method: Find components → check for test file → generate test from component analysisPattern: Consistency Enforcement
Operation: All API routes return { data } or { error } shape
Method: Find routes → analyze current return shapes → wrap in standard formatPattern: Mass Content Update
Operation: Update copyright year in all files
Method: grep for old year → replace → verify no false positivesRules
- Always dry run first. Never apply a batch without verifying the pattern on one target.
- Track progress visibly. The user should always know how far along the batch is.
- Handle exceptions gracefully. One weird file shouldn't stop the whole batch.
- Verify after each change. If verification is possible (compile check, test run), do it per target, not just at the end.
- Report everything. What changed, what was skipped, what needs manual review.
- Preserve the ability to undo. Work on a branch. Commit after the batch with a clear message. User can revert the whole batch if needed.
- Don't batch what shouldn't be batched. If each target needs a unique approach, it's not a batch — it's a task list.
- Maximum batch size: 50 targets. Beyond that, break into sub-batches for manageability.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

