slicing-long-contexts

Slice long text inputs into chunks for map/reduce pipelines.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/aufrank/agent-skills --skill slicing-long-contexts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: slicing-long-contexts
Source: https://github.com/aufrank/agent-skills/tree/main/skills/slicing-long-contexts
Command: npx skills add https://github.com/aufrank/agent-skills --skill slicing-long-contexts

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill tackles the challenge of processing extremely long or dense text inputs that exceed the context window limits of language models, enabling detailed analysis and summarization of large documents, codebases, or logs.

Core Features & Use Cases

  • Reproducible Map/Reduce Pipelines: Slices large inputs into manageable chunks, processes each chunk with sub-LM calls, and aggregates the results.
  • Dynamic Context Handling: Ideal for multi-document reasoning, codebase understanding, and processing extensive chat histories or terminal logs.
  • Use Case: Summarize a 500-page research paper by breaking it into sections, having an LLM summarize each section, and then combining those summaries into a concise overview.

Quick Start

Use the slicing-long-contexts skill to summarize the provided document 'research_paper.pdf' into a concise bulleted list.

Frequently Asked Questions about slicing-long-contexts

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

FAQPage Schema
How do I process large texts that exceed LLM context window limits?

To process large texts that exceed context window limits, you can use a map/reduce pipeline to slice inputs into smaller chunks, process each with sub-LM calls, and aggregate the results. This makes extensive codebase analysis and log processing reproducible.

What is the best way to summarize large documents using map reduce?

The best way to summarize large documents using map reduce is to slice the text into manageable sections, have a sub-LM summarize each section, and then combine those summaries into a concise overview. This handles dense inputs effectively.

Can I analyze an entire codebase or terminal logs with an LLM?

Yes, you can analyze an entire codebase or terminal logs by slicing the dense text inputs into smaller chunks. The skill supports heading-based, marker-based, and fixed-size chunking strategies to process the data recursively.

Does this map reduce approach support network access for LLM providers?

Yes, the map reduce approach supports network access for LLM providers. It also includes options for retries and verification during the recursive sub-LM calls to ensure reliable aggregation of the sliced text chunks.

What are the limitations of fixed-size chunking for text processing?

Fixed-size chunking for text processing may split related context or logical sections across multiple slices, potentially degrading sub-LM reasoning quality. Alternatives like heading-based or marker-based slicing help preserve structural boundaries for better results.