map-reduce

Execute map and reduce phases to aggregate batch processing results.

60|2|Updated Jan 21, 2026
One-click install
npx skills add https://github.com/ElliotJLT/Claude-Skill-Potions --skill map-reduce
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: map-reduce
Source: https://github.com/ElliotJLT/Claude-Skill-Potions/tree/main/skills/map-reduce
Command: npx skills add https://github.com/ElliotJLT/Claude-Skill-Potions --skill map-reduce

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a structured pattern for processing large collections of items by splitting work into a Map phase and then reducing results, enabling scalable batch operations.

Core Features & Use Cases

  • Map Phase: Split work into items and apply a per-item operation in parallel.
  • Reduce Phase: Aggregate per-item results into a final summary or report.
  • Use Case: Analyze an entire codebase to compute per-file statistics (lines, functions, complexity) and produce a codebase report.

Quick Start

Define a Map-Reduce Job: map-reduce job name. Input: specify the collection of items. Map function: the per-item operation. Reduce function: the aggregation/summary operation. Then execute to obtain the final results.

Frequently Asked Questions about map-reduce

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I process large datasets across multiple items in parallel?

Map-reduce splits batch processing into two phases: a map phase applies an operation to each item in parallel, then a reduce phase aggregates results into a final summary. This pattern scales codebase-wide analyses, bulk transformations, and large-scale data processing tasks efficiently.

Can I use map-reduce to analyze an entire codebase and generate statistics?

Yes. Map-reduce orchestrates codebase analysis by mapping per-file operations—counting lines, functions, complexity—across all files in parallel, then reducing those results into a unified codebase report with aggregated metrics.

What do I need to define before executing a map-reduce job?

Define four elements: a job name, the input collection of items, a map function specifying the per-item operation, and a reduce function that aggregates results. Execute the job to obtain final processed results.

When should I use map-reduce instead of sequential batch processing?

Map-reduce is suited for large-scale data processing where splitting work into independent per-item operations and then aggregating results improves performance. It handles automation and parallel processing across many items more effectively than sequential approaches.

What aggregation strategy should my reduce function implement?

Your reduce function should combine per-item results into a final summary matching your analysis goal. For codebase statistics, aggregate counts and metrics; for bulk transformations, consolidate outputs. The strategy depends on your end-state reporting or data needs.