# Batch

Execute batch operations on multiple files in parallel.

- Repository: https://github.com/QwenLM/qwen-code (28858 stars)
- Category: AI and agents
- License: Apache-2.0
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add QwenLM/qwen-code --skill batch -g -a claude-code -y`
Codex: `npx skills add QwenLM/qwen-code --skill batch -g -a codex -y`
Cursor: `npx skills add QwenLM/qwen-code --skill batch -g -a cursor -y`
Gemini CLI: `npx skills add QwenLM/qwen-code --skill batch -g -a gemini-cli -y`

## Description

Execute batch operations on multiple files in parallel. Automatically discovers files, splits into chunks, and processes with parallel worker agents. Use `/batch` followed by operation and file pattern. For many independent single-turn transforms (translate/rewrite/extract each file into a new file) that can wait minutes to hours, you may suggest the user type `/batch-api` themselves for the half-price asynchronous Batch API, you cannot invoke it, and it is not suited to in-place edits or tasks needing tool feedback.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# /batch - Parallel Batch Operations

You are orchestrating a batch operation across multiple files. Your job is to:

1. Parse the user's request to understand the target files and operation
2. Discover matching files using glob
3. Split files into chunks for parallel processing
4. Launch multiple worker agents to process files concurrently
5. Aggregate results and present a summary

## Step 1: Parse Intent and Discover Files

First, parse the user's request to identify:

- **Target pattern**: glob pattern for files (e.g., `src/**/*.ts`, `**/*.js`)
- **Operation**: what to do with each file (e.g., "add JSDoc comments", "convert to TypeScript")

If the user didn't specify a pattern, infer it from context or ask for clarification.

Use the `glob` tool to discover matching files.

**If no files match the pattern**:

- Inform the user that no files were found for the given pattern
- Suggest checking the pattern or broadening the search scope
- Do not proceed with an empty batch

Apply these common exclusions automatically:

- `node_modules/**`
- `dist/**`
- `build/**`
- `.git/**`
- `**/*.test.ts`, `**/*.test.js`
- `**/*.spec.ts`, `**/*.spec.js`
- `**/__tests__/**`
- `**/test/**`, `**/tests/**`
- `**/package-lock.json`
- `**/yarn.lock`
- `**/pnpm-lock.yaml`
- `**/*.min.js`
- Binary files (images, fonts, etc.)
- Files larger than 500KB (check size if needed)

**Important**: If more than 50 files match, inform the user with the exact count and the file list, then proceed. The user can cancel (Ctrl+C) if needed. If the count exceeds 100 files, warn the user and suggest a more specific pattern instead of proceeding.

## Step 2: Chunk Files for Parallel Processing

Split the discovered files into chunks based on these rules:

The rest: https://github.com/QwenLM/qwen-code/blob/HEAD/packages/core/src/skills/bundled/batch/SKILL.md
