返回顶部
b

batch-file-processor

>

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
181
下载量
0
收藏
概述
安装方式
版本历史

batch-file-processor

# Batch File Processor Process large numbers of files in parallel using sub-agents, avoiding main agent context overflow. ## Workflow ### 1. List files ```bash find <directory> -type f -name "*.md" | sort ``` ### 2. Group Split into batches of 2-4 files each (3 is optimal). ### 3. Dispatch sub-agents One sub-agent per batch. Task template: ``` Read the following files completely and generate a brief summary (under 50 words) for each. 1. /path/to/file1.md 2. /path/to/file2.md 3. /path/to/file3.md Return ONLY a JSON array: [{"file": "relative/path/file1.md", "summary": "..."},...] ``` Key parameters: - `mode`: "run" (one-shot task) - `runTimeoutSeconds`: 120 (increase to 180 for large files) - `label`: descriptive label, e.g. `idx-project-batch1` ### 4. Collect results Sub-agents push results on completion. Use `sessions_yield` to wait and collect incrementally. ### 5. Compile output Once all results are in, the main agent compiles the final deliverable (index file, report, etc.). ## Rules - **2-4 files per sub-agent** — never let one sub-agent process an entire directory sequentially - **Read full file content** — no head/tail truncation; partial reads produce incomplete summaries - **Standardize output format** — JSON makes it easy for the main agent to parse and merge - **One spawn per turn** — system limitation; use multiple spawn + yield cycles ## Anti-patterns | Mistake | Consequence | |---------|-------------| | `head -20` to skim file headers | Poor summary quality, key information missed | | One sub-agent processes entire directory | Context overflow, timeout failure | | Main agent reads all files sequentially | Context window exhausted, later files unreadable | | One sub-agent per large directory | Large directories timeout, small ones waste capacity | ## Benchmarks 70 files → 25 sub-agents (3 files each) → parallel execution → completed in 5 minutes → high accuracy summaries ## Task Template Variants ### File summarization (default) ``` Generate a brief summary (under 50 words) for each file. ``` ### Information extraction ``` Extract the following fields from each file: project name, budget, key contacts, risks. Return JSON: [{"file": "...", "project": "...", "budget": "...", "contacts": [...], "risks": [...]}] ``` ### Content classification ``` Classify each file by checking for these topics: security, compliance, migration. Return JSON: [{"file": "...", "has_security": true/false, "has_compliance": true/false, "has_migration": true/false}] ``` ### Code analysis ``` Analyze each source file: count lines, list imports/dependencies, identify main functions. Return JSON: [{"file": "...", "lines": N, "imports": [...], "main_functions": [...]}] ```

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 batch-file-processor-1776102491 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 batch-file-processor-1776102491 技能

通过命令行安装

skillhub install batch-file-processor-1776102491

下载 Zip 包

⬇ 下载 batch-file-processor v1.0.0

文件大小: 2.17 KB | 发布时间: 2026-4-14 14:44

v1.0.0 最新 2026-4-14 14:44
Initial release: parallel batch file processing methodology using sub-agents

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部