batch
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.
Оригинален текст · няма потвърден превод на българскиПърво прочетете инструкцията.
Файлът се зарежда от посочения източник само по ваше действие. Можете да го прочетете тук, да го копирате или да го запазите като .md.
GitHub хранилище- Звезди на репото
- 28 085
- Лиценз
- Apache-2.0
- Последна проверка на записа
- 20.09.2026 г.
Добавете в своя инструмент.
Командата отваря избора на skills от репозитория. Прочетете файла и условията на автора преди изпълнение.
npx skills add QwenLM/qwen-codeСтраницата копира текст. Не инсталира и не изпълнява нищо на устройството ви.
Откъс от SKILL.md
Началото на файла на автора, без превод.
/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