batch
하는 일
패턴에 맞는 파일을 찾고, 그룹으로 나눈 뒤, 병렬 작업 에이전트로 각 그룹을 처리하고 결과를 요약합니다. 같은 변경을 많은 파일에 적용해야 하는 분들을 위한 스킬입니다.
사용하는 경우
- ✓패턴에 맞는 많은 파일에 같은 변경을 적용하고 싶을 때.
- ✓서로 독립적인 많은 편집을 병렬로 처리해야 할 때.
- ✓대량 파일 작업 후 결과 요약이 필요할 때.
스킬 링크
https://github.com/QwenLM/qwen-code/blob/main/packages/core/src/skills/bundled/batch/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“src 폴더에 있는 모든 TypeScript 파일에 짧은 JSDoc 주석을 추가해 주세요. 테스트는 제외하고요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 맞는 파일을 찾고, node_modules, dist, build 같은 흔한 폴더는 건너뛰며, 목록을 덩어리로 나눠 작업 에이전트들을 병렬로 실행합니다. 그다음 결과를 하나의 요약으로 합칩니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
/batch - Parallel Batch Operations
You are orchestrating a batch operation across multiple files. Your job is to:
- Parse the user's request to understand the target files and operation
- Discover matching files using glob
- Split files into chunks for parallel processing
- Launch multiple worker agents to process files concurrently
- 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:
| Total Files | Chunk Count | Files Per Chunk |
|---|---|---|
| 1-5 | 1 | All files |
| 6-15 | 2 | 3-8 each |
| 16-30 | 3 | ~10 each |
| 31-50 | 4 | ~10-12 each |
| 51-75 | 5 | ~10-15 each |
| 76-100 | 5 | ~15-20 each |
Chunking algorithm:
- Minimum chunk size: 3 files (avoid over-parallelization for small batches)
- Maximum chunk size: 15 files (ensure reasonable work per agent)
- Maximum parallel agents: 5 (API rate limit consideration)
Example: 24 files → 3 chunks of ~8 files each
Step 3: Launch Parallel Worker Agents
Launch worker agents in parallel by invoking the task tool (the Agent tool) multiple times in a SINGLE message.
Note: The task tool in allowedTools is the Agent tool used to spawn worker agents.
Each worker agent should receive:
- The list of files to process (full paths)
- The operation to perform
- Clear instructions to report success/failure per file
Use the general-purpose subagent type for workers.
CRITICAL: All Agent tool calls MUST be in a single response to enable parallel execution. The system automatically runs multiple Agent calls concurrently.
Agent Prompt Template
For each chunk, use this prompt format:
You are a worker agent processing a batch of files.
**Operation**: [describe the operation, e.g., "Add JSDoc comments to all exported functions"]
**Files to process**:
- [file1.ts]
- [file2.ts]
- ...
**Instructions**:
1. Process each file independently
2. For each file, report one of:
- SUCCESS: [file path] - [brief description of change]
- FAILED: [file path] - [reason for failure]
- SKIPPED: [file path] - [reason for skipping]
3. If a file fails or is skipped, continue with the next file - do not abort
4. At the end, provide a summary of what was done
**Constraints**:
- Do not modify test files unless explicitly requested
- Preserve existing code style and formatting
- Make minimal necessary changes to accomplish the operation
Example Invocation Pattern
Set run_in_background: false on every worker call so all results return inline
for aggregation in Step 4.
<Agent tool call 1>
description: "Process batch chunk 1/3"
prompt: "You are a worker agent... [full prompt as above]"
subagent_type: "general-purpose"
run_in_background: false
</Agent tool call 1>
<Agent tool call 2>
description: "Process batch chunk 2/3"
prompt: "You are a worker agent... [full prompt as above]"
subagent_type: "general-purpose"
run_in_background: false
</Agent tool call 2>
<Agent tool call 3>
description: "Process batch chunk 3/3"
prompt: "You are a worker agent.
자주 묻는 질문
어떤 파일이 자동으로 건너뛰어지나요?
node_modules, dist, build, .git 같은 흔한 폴더와 테스트 파일, 잠금 파일, 압축된 파일, 바이너리, 500KB를 넘는 파일을 건너뜁니다.
맞는 파일이 없으면 어떻게 하나요?
에이전트가 그 사실을 알리고, 빈 배치를 실행하지 않고 패턴을 확인하라고 제안합니다.
배치 실행이 더 저렴한가요?
꼭 그렇지는 않습니다. 지금은 병렬로 실행되며, 기다릴 수 있는 작업에 대해서는 별도의 배치 API 스킬이 절반 가격 옵션입니다.
상세 정보
작성자의 원본 설명
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.
repo: QwenLM/qwen-code
인기도
- GitHub 스타
- 29k
- 순위
- #9777
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
codegraph
29k에이전트가 색인된 코드베이스를 호출 그래프, 의존성, 죽은 코드, 핫스팟, 의미 검색으로 분석하도록 돕습니다.
qwen-code-claw
29k에이전트가 코드베이스 이해, 버그 수정, 리팩터링, 새 프로젝트 생성 같은 코딩 작업을 Qwen Code에 맡기도록 돕습니다.
structured-debugging
29k에이전트가 어려운 버그를 디버깅하는 단계별 방법을 가르칩니다. 가설을 세우고, 대상 확인을 추가하고, 시험해서 실제 원인을 찾은 뒤 고칩니다.
tmux-real-user-testing
29k에이전트가 tmux 안에서 실제 사용자처럼 터미널 앱을 테스트하고, 각 동작마다 화면 캡처가 담긴 읽기 쉬운 로그를 저장하도록 돕습니다.