Agent skill

Python Parallelization

by benchflow-ai in benchflow-ai/skillsbench

Transform sequential Python code into parallel/concurrent implementations.

Apache-2.0Auto-check passed

Install Python Parallelization

skills CLI
$ npx skills add benchflow-ai/skillsbench --skill python-parallelization -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install benchflow-ai/skillsbench python-parallelization --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/benchflow-ai/skillsbench.git skills-src && mkdir -p .claude/skills && cp -r skills-src/tasks/parallel-tfidf-search/environment/skills/python-parallelization .claude/skills/python-parallelization && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
python-parallelization
GitHub stars
1.8k
Token cost
~1.3k tokens
SKILL.md length
319 words
Files
2 (incl. references)
Skills in repo
180
Repo updated
First seen
Licence
Apache-2.0

At a glance

Transform sequential Python code into parallel/concurrent implementations.

  • Works in 5 steps: Analyze the code to identify… → Classify the workload type (CPU-bound,… → Select the appropriate parallelization… → …
  • Asked to parallelize Python code
  • SKILL.md covers Workflow, Parallelization Decision Tree, Transformation Patterns and Parallelization Candidates, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Python Parallelization is an agent skill from benchflow-ai/skillsbench. Transform sequential Python code into parallel/concurrent implementations. Use when asked to parallelize Python code, improve code performance through concurrency, convert loops to parallel execution, or identify parallelization opportunities. Handles CPU-bound (multiprocessing), I/O-bound (asyncio, threading), and data-parallel (vectorization) scenarios.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/advanced_techniques.md`).

It works with Python. The repository describes itself as: SkillsBench evaluates how well skills work and how effective agents are at using them. The licence is Apache-2.0.

When your agent uses it

  • Asked to parallelize Python code
  • Improve code performance through concurrency
  • Convert loops to parallel execution
  • Identify parallelization opportunities

Example prompts

  • “/python-parallelization”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Analyze the code to identify parallelization candidates
  2. Classify the workload type (CPU-bound, I/O-bound, or data-parallel)
  3. Select the appropriate parallelization strategy
  4. Transform the code with proper synchronization and error handling
  5. Verify correctness and measure expected speedup

What it can do on your machine

Read from SKILL.md and the folder at commit 9a1f4dd. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Python Parallelization loads about 1.3k tokens when it runs, and up to ~2.7k if it reads all its reference files. Until then it costs about 95 tokens; SKILL.md has 319 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~95
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from benchflow-ai/skillsbench at commit 9a1f4dd, republished under its Apache-2.0 licence (© benchflow-ai). 319 words, ~1,348 tokens.

Download SKILL.mdSave it as .claude/skills/python-parallelization/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
python-parallelization
description
Transform sequential Python code into parallel/concurrent implementations. Use when asked to parallelize Python code, improve code performance through concurrency, convert loops to parallel execution, or identify parallelization opportunities. Handles CPU-bound (multiprocessing), I/O-bound (asyncio, threading), and data-parallel (vectorization) scenarios.

Python Parallelization Skill

Transform sequential Python code to leverage parallel and concurrent execution patterns.

Workflow

  1. Analyze the code to identify parallelization candidates
  2. Classify the workload type (CPU-bound, I/O-bound, or data-parallel)
  3. Select the appropriate parallelization strategy
  4. Transform the code with proper synchronization and error handling
  5. Verify correctness and measure expected speedup

Parallelization Decision Tree

Is the bottleneck CPU-bound or I/O-bound?

CPU-bound (computation-heavy):
├── Independent iterations? → multiprocessing.Pool / ProcessPoolExecutor
├── Shared state needed? → multiprocessing with Manager or shared memory
├── NumPy/Pandas operations? → Vectorization first, then consider numba/dask
└── Large data chunks? → chunked processing with Pool.map

I/O-bound (network, disk, database):
├── Many independent requests? → asyncio with aiohttp/aiofiles
├── Legacy sync code? → ThreadPoolExecutor
├── Mixed sync/async? → asyncio.to_thread()
└── Database queries? → Connection pooling + async drivers

Data-parallel (array/matrix ops):
├── NumPy arrays? → Vectorize, avoid Python loops
├── Pandas DataFrames? → Use built-in vectorized methods
├── Large datasets? → Dask for out-of-core parallelism
└── GPU available? → Consider CuPy or JAX

Transformation Patterns

Pattern 1: Loop to ProcessPoolExecutor (CPU-bound)

Before:

python
results = []
for item in items:
    results.append(expensive_computation(item))

After:

python
from concurrent.futures import ProcessPoolExecutor

with ProcessPoolExecutor() as executor:
    results = list(executor.map(expensive_computation, items))
Pattern 2: Sequential I/O to Async (I/O-bound)

Before:

python
import requests

def fetch_all(urls):
    return [requests.get(url).json() for url in urls]

After:

python
import asyncio
import aiohttp

async def fetch_all(urls):
    async with aiohttp.ClientSession() as session:
        tasks = [fetch_one(session, url) for url in urls]
        return await asyncio.gather(*tasks)

async def fetch_one(session, url):
    async with session.get(url) as response:
        return await response.json()
Pattern 3: Nested Loops to Vectorization

Before:

python
result = []
for i in range(len(a)):
    row = []
    for j in range(len(b)):
        row.append(a[i] * b[j])
    result.append(row)

After:

python
import numpy as np
result = np.outer(a, b)
Pattern 4: Mixed CPU/IO with asyncio
python
import asyncio
from concurrent.futures import ProcessPoolExecutor

async def hybrid_pipeline(data, urls):
    loop = asyncio.get_event_loop()

    # CPU-bound in process pool
    with ProcessPoolExecutor() as pool:
        processed = await loop.run_in_executor(pool, cpu_heavy_fn, data)

    # I/O-bound with async
    results = await asyncio.gather(*[fetch(url) for url in urls])

    return processed, results

Parallelization Candidates

Look for these patterns in code:

PatternIndicatorStrategy
for item in collection with independent iterationsNo shared mutationPool.map / executor.map
Multiple requests.get() or file readsSequential I/Oasyncio.gather()
Nested loops over arraysNumerical computationNumPy vectorization
time.sleep() or blocking waitsWaiting on externalThreading or async
Large list comprehensionsIndependent transformsPool.map with chunking

Safety Requirements

Always preserve correctness when parallelizing:

  1. Identify shared state - variables modified across iterations break parallelism
  2. Check dependencies - iteration N depending on N-1 requires sequential execution
  3. Handle exceptions - wrap parallel code in try/except, use executor.submit() for granular error handling
  4. Manage resources - use context managers, limit worker count to avoid exhaustion
  5. Preserve ordering - use map() over submit() when order matters

Common Pitfalls

  • GIL trap: Threading doesn't help CPU-bound Python code—use multiprocessing
  • Pickle failures: Lambda functions and nested classes can't be pickled for multiprocessing
  • Memory explosion: ProcessPoolExecutor copies data to each process—use shared memory for large data
  • Async in sync: Can't just add async to existing code—requires restructuring call chain
  • Over-parallelization: Parallel overhead exceeds gains for small workloads (<1000 items typically)

Verification Checklist

Before finalizing transformed code:

  • Output matches sequential version for test inputs
  • No race conditions (shared mutable state properly synchronized)
  • Exceptions are caught and handled appropriately
  • Resources are properly cleaned up (pools closed, connections released)
  • Worker count is bounded (default or explicit limit)
  • Added appropriate imports

© benchflow-ai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in tasks/parallel-tfidf-search/environment/skills/python-parallelization of benchflow-ai/skillsbench.

  • SKILL.md
  • references/advanced_techniques.md

Open the folder on GitHubat commit 9a1f4dd

Compare with similar skills

Python Parallelization next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Python Parallelization compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Python Parallelization this skillbenchflow-ai/skillsbench1.8k—~1.3kAutomated safety check: PassApache-2.0
MCP Server Builderanthropics/skills180k62 repos~2.3kAutomated safety check: PassApache-2.0
PDF Processinganthropics/skills180k48 repos~2kAutomated safety check: PassProprietary
NotebookLM Research AssistantPleasePrompto/notebooklm-skill7.8k13 repos~2.4kAutomated safety check: NotesMIT
Manim Video Productionbrowser-use/video-use28k6 repos~3kAutomated safety check: PassMIT
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • MCP Server Builder

    anthropics/skills

    Official

    Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.

    180k GitHub starsUsed in 62 repos~2.3k tokens
    Agent WorkflowsAuto-check passed
  • PDF Processing

    anthropics/skills

    Official

    Handles everyday PDF jobs in Python and on the command line: extract text and tables, merge, split, rotate, watermark, fill forms, encrypt and OCR.

    180k GitHub starsUsed in 48 repos~2k tokens
    Documents & OfficeAuto-check passed
  • NotebookLM Research Assistant

    PleasePrompto/notebooklm-skill

    Lets Claude Code ask questions of your Google NotebookLM notebooks through browser automation and return answers grounded in your uploaded sources.

    7.8k GitHub starsUsed in 13 repos~2.4k tokens
    Knowledge ManagementAuto-check: notes
  • Manim Video Production

    browser-use/video-use

    Produces math and technical explainer videos with Manim Community Edition: concept animations, equation derivations, algorithm walkthroughs and data stories.

    28k GitHub starsUsed in 6 repos~3k tokens
    Media & CreativeAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • PPT Master

    hugohe3/ppt-master

    Generates editable PowerPoint decks, rebuilds slides from images, fills .pptx templates and polishes existing presentations through routed workflows.

    58k GitHub starsUsed in 1 repo~2.5k tokens
    Documents & OfficeAuto-check passed

More from benchflow-ai/skillsbench

All 180 skills in this repo
  • Lean4 Memories

    benchflow-ai/skillsbench

    This skill should be used when working on Lean 4 formalization projects to maintain persistent memory of successful proof patterns, failed approaches, project conventions, and user preferences…

    1.8k GitHub stars~3.2k tokensUpdated 2 mo ago
    Auto-check passed
  • Senior Data Engineer

    benchflow-ai/skillsbench

    World-class data engineering skill for building scalable data pipelines, ETL/ELT systems, real-time streaming, and data infrastructure.

    1.8k GitHub stars~5.9k tokensUpdated 2 mo ago
    Auto-check passed
  • Ac Branch Pi Model

    benchflow-ai/skillsbench

    AC branch pi-model power flow equations (P/Q and |S|) with transformer tap ratio and phase shift, matching acopf-math-model.md and MATPOWER branch fields.

    1.8k GitHub stars~1.1k tokensUpdated 2 mo ago
    Auto-check passed
  • Civ6lib

    benchflow-ai/skillsbench

    Civilization 6 district mechanics library. An agent skill from benchflow-ai/skillsbench.

    1.8k GitHub stars~1.7k tokensUpdated 2 mo ago
    Auto-check passed
  • D3 Visualization

    benchflow-ai/skillsbench

    Build deterministic, verifiable data visualizations with D3.js (v6).

    1.8k GitHub stars~1.5k tokensUpdated 2 mo ago
    Auto-check passed
  • Dc Power Flow

    benchflow-ai/skillsbench

    DC power flow analysis for power systems. An agent skill from benchflow-ai/skillsbench.

    1.8k GitHub stars~717 tokensUpdated 2 mo ago
    Auto-check passed

Works with

Questions about Python Parallelization

What does Python Parallelization do?

Transform sequential Python code into parallel/concurrent implementations. Python Parallelization is an agent skill from benchflow-ai/skillsbench. Transform sequential Python code into parallel/concurrent implementations.

When should I use Python Parallelization?

Python Parallelization fits situations like: asked to parallelize Python code; improve code performance through concurrency; convert loops to parallel execution; identify parallelization opportunities.

How do I install Python Parallelization in Claude Code?

Run `npx skills add benchflow-ai/skillsbench --skill python-parallelization -a claude-code`. Or copy the skill folder (tasks/parallel-tfidf-search/environment/skills/python-parallelization in benchflow-ai/skillsbench) into .claude/skills/python-parallelization in your project. Claude Code loads it when a task matches its description.

How do I install Python Parallelization in Codex?

Run `npx skills add benchflow-ai/skillsbench --skill python-parallelization -a codex`. Or copy the skill folder (tasks/parallel-tfidf-search/environment/skills/python-parallelization in benchflow-ai/skillsbench) into .agents/skills/python-parallelization in your project. Codex loads it when a task matches its description.

Can I use Python Parallelization in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add benchflow-ai/skillsbench --skill python-parallelization -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/python-parallelization, .gemini/skills/python-parallelization, .github/skills/python-parallelization and .opencode/skills/python-parallelization in your project.

What does Python Parallelization need to run?

SKILL.md names no scripts, command-line tools or credentials: Python Parallelization is instructions for the agent only. Our summary lists: Python 3.

Does Python Parallelization access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Python Parallelization safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Python Parallelization use?

Python Parallelization is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Python Parallelization use?

About 1.3k tokens (SKILL.md is roughly 5.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.4k tokens, read only when the agent opens those files.

What are the alternatives to Python Parallelization?

Skills that share tags, products or a category with Python Parallelization: MCP Server Builder (anthropics/skills, 180k stars), PDF Processing (anthropics/skills, 180k stars), NotebookLM Research Assistant (PleasePrompto/notebooklm-skill, 7.8k stars) and Manim Video Production (browser-use/video-use, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Python Parallelization?

benchflow-ai (a GitHub organization) maintains it in benchflow-ai/skillsbench, which has 1,832 GitHub stars. The repository holds 180 skills in this directory. The repository was last updated on July 23, 2026.

Source: benchflow-ai/skillsbench on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.