[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EEF7APCAS3YJTDJYJNQHH5":3,"skill-same:01M6EEF7APCAS3YJTDJYJNQHH5":48},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":21,"linkOnly":22,"markdownContent":23,"markdownBody":23,"frontMatter":24,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M6EEF7APCAS3YJTDJYJNQHH5","batch-processor",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fbatch-processor\u002FSKILL.md",[],[18,19,20],"batch","processor","batch processor","2026-11-10 10:12:30",false,"# Batch Processor\n\n## Overview\n\nProcess multiple documents and files in bulk using parallel execution. Handles large-scale file operations including format conversion, data extraction, transformation, and validation across hundreds or thousands of files with configurable concurrency, error recovery, and progress reporting.\n\n## Instructions\n\nWhen a user asks for batch processing, determine which approach fits their needs:\n\n### Task A: Parallel file processing with shell tools\n\nFor simple transformations, use `xargs` or GNU `parallel`:\n\n```bash\n# Convert all PNG files to JPEG using ImageMagick (8 parallel jobs)\nfind .\u002Fimages -name \"*.png\" | xargs -P 8 -I {} bash -c \\\n  'convert \"$1\" \"${1%.png}.jpg\"' _ {}\n\n# Process files with GNU parallel and progress bar\nfind .\u002Fdocs -name \"*.csv\" | parallel --bar --jobs 8 \\\n  'python transform.py {} {.}_processed.csv'\n\n# Bulk compress PDFs (4 parallel jobs)\nfind .\u002Freports -name \"*.pdf\" | xargs -P 4 -I {} bash -c \\\n  'gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=\u002Febook \\\n   -dNOPAUSE -dBATCH -sOutputFile=\"{}.compressed\" \"{}\" && mv \"{}.compressed\" \"{}\"'\n```\n\n### Task B: Python batch processor with concurrency control\n\nCreate a reusable batch processing script:\n\n```python\nimport asyncio\nimport os\nfrom pathlib import Path\nfrom dataclasses import dataclass, field\n\n@dataclass\nclass BatchResult:\n    total: int = 0\n    success: int = 0\n    failed: int = 0\n    errors: list = field(default_factory=list)\n\nasync def process_file(filepath: Path, semaphore: asyncio.Semaphore) -> tuple[bool, str]:\n    async with semaphore:\n        try:\n            # Replace with actual processing logic\n            content = filepath.read_text()\n            output = content.upper()  # Example transformation\n            out_path = filepath.with_suffix('.processed' + filepath.suffix)\n            out_path.write_text(output)\n            return True, str(filepath)\n        except Exception as e:\n            return False, f\"{filepath}: {e}\"\n\nasync def batch_process(\n    input_dir: str,\n    pattern: str = \"*.*\",\n    max_concurrent: int = 10\n) -> BatchResult:\n    semaphore = asyncio.Semaphore(max_concurrent)\n    files = list(Path(input_dir).glob(pattern))\n    result = BatchResult(total=len(files))\n\n    tasks = [process_file(f, semaphore) for f in files]\n    for coro in asyncio.as_completed(tasks):\n        success, msg = await coro\n        if success:\n            result.success += 1\n        else:\n            result.failed += 1\n            result.errors.append(msg)\n        # Progress reporting\n        done = result.success + result.failed\n        print(f\"\\rProgress: {done}\u002F{result.total}\", end=\"\", flush=True)\n\n    print()  # Newline after progress\n    return result\n\nif __name__ == \"__main__\":\n    result = asyncio.run(batch_process(\".\u002Finput\", pattern=\"*.txt\", max_concurrent=8))\n    print(f\"Done: {result.success} succeeded, {result.failed} failed\")\n    for err in result.errors:\n        print(f\"  ERROR: {err}\")\n```\n\n### Task C: Batch processing with error recovery\n\nFor long-running jobs, track progress and allow resuming:\n\n```python\nimport json\nfrom pathlib import Path\n\nPROGRESS_FILE = \".batch_progress.json\"\n\ndef load_progress() -> set:\n    if Path(PROGRESS_FILE).exists():\n        return set(json.loads(Path(PROGRESS_FILE).read_text()))\n    return set()\n\ndef save_progress(completed: set):\n    Path(PROGRESS_FILE).write_text(json.dumps(list(completed)))\n\ndef batch_with_resume(input_dir: str, pattern: str = \"*.*\"):\n    completed = load_progress()\n    files = [f for f in Path(input_dir).glob(pattern) if str(f) not in completed]\n    print(f\"Resuming: {len(completed)} done, {len(files)} remaining\")\n\n    for i, filepath in enumerate(files):\n        try:\n            process_single_file(filepath)  # Your processing function\n            completed.add(str(filepath))\n            if i % 10 == 0:  # Checkpoint every 10 files\n                save_progress(completed)\n        except KeyboardInterrupt:\n            save_progress(completed)\n            print(f\"\\nSaved progress at {len(completed)} files\")\n            raise\n        except Exception as e:\n            print(f\"Error on {filepath}: {e}\")\n\n    save_progress(completed)\n    Path(PROGRESS_FILE).unlink()  # Clean up on completion\n```\n\n### Task D: Shell-based batch with logging\n\n```bash\n#!\u002Fbin\u002Fbash\nINPUT_DIR=\"$1\"\nOUTPUT_DIR=\"$2\"\nLOG_FILE=\"batch_$(date +%Y%m%d_%H%M%S).log\"\nPARALLEL_JOBS=8\nTOTAL=$(find \"$INPUT_DIR\" -type f | wc -l)\nCOUNT=0\n\nmkdir -p \"$OUTPUT_DIR\"\n\nprocess_file() {\n    local file=\"$1\"\n    local outfile=\"$OUTPUT_DIR\u002F$(basename \"$file\")\"\n    # Replace with your processing command\n    cp \"$file\" \"$outfile\" 2>&1\n    echo $?\n}\n\nexport -f process_file\nexport OUTPUT_DIR\n\nfind \"$INPUT_DIR\" -type f | parallel --jobs \"$PARALLEL_JOBS\" --bar \\\n  --joblog \"$LOG_FILE\" process_file {}\n\necho \"Results logged to $LOG_FILE\"\nawk 'NR>1 {if($7!=0) fail++; else ok++} END {print ok\" succeeded, \"fail\" failed\"}' \"$LOG_FILE\"\n```\n\n## Examples\n\n### Example 1: Convert a directory of Markdown files to PDF\n\n**User request:** \"Convert all 200 Markdown files in docs\u002F to PDF\"\n\n```bash\n# Install pandoc if needed\n# Process in parallel with 6 workers\nfind .\u002Fdocs -name \"*.md\" | parallel --bar --jobs 6 \\\n  'pandoc {} -o {.}.pdf --pdf-engine=xelatex'\necho \"Conversion complete. Check for errors above.\"\n```\n\n### Example 2: Extract text from hundreds of images\n\n**User request:** \"OCR all scanned documents in the scans\u002F folder\"\n\n```bash\n# Using tesseract with parallel processing\nfind .\u002Fscans -name \"*.png\" -o -name \"*.jpg\" | parallel --bar --jobs 4 \\\n  'tesseract {} {.} -l eng 2>\u002Fdev\u002Fnull && echo \"OK: {}\"'\n```\n\n### Example 3: Bulk resize images for web\n\n**User request:** \"Resize all product images to 800px wide, keep aspect ratio\"\n\n```bash\nmkdir -p .\u002Fresized\nfind .\u002Fproducts -name \"*.jpg\" | xargs -P 8 -I {} bash -c \\\n  'convert \"$1\" -resize 800x -quality 85 \".\u002Fresized\u002F$(basename $1)\"' _ {}\necho \"Resized $(ls .\u002Fresized | wc -l) images\"\n```\n\n## Guidelines\n\n- Always test batch operations on a small subset (5-10 files) before processing the full set.\n- Set a reasonable concurrency limit. Start with CPU core count for CPU-bound tasks, or 2-4x for I\u002FO-bound tasks.\n- Implement progress reporting so users can monitor long-running jobs.\n- Write errors to a log file rather than stopping the entire batch.\n- Create a checkpoint\u002Fresume mechanism for batches over 100 files.\n- Back up original files or write output to a separate directory; never overwrite in place without confirmation.\n- Use `--dry-run` flags in scripts to preview operations before executing.\n- Monitor system resources (RAM, disk space) during large batch operations.\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FTerminalSkills\u002Fskills\u002Fbatch-processor",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill batch-processor",{"tool":40,"command":41},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill batch-processor",{"tool":43,"command":44},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill batch-processor","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fbatch-processor\u002FSKILL.md",true,[],[49,58,67,76,82,88],{"skillNo":50,"name":51,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":21},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[55,56,57],"model","model hierarchy","model hierarchy skill",{"skillNo":59,"name":60,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":21},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[64,65,66],"MCP","zoom","zoom mcp",{"skillNo":68,"name":69,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":21},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[73,74,75,65],"sdk","zoom apps sdk","apps",{"skillNo":77,"name":78,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":21},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[78],{"skillNo":83,"name":84,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":21},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[84],{"skillNo":89,"name":90,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":21},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[90]]