Longread Skill
Use this skill when a file is too large to read in a single pass (e.g. cat, read_file, or Read tool hits size limits or truncates output).
Step 0: Assess Suitability (REQUIRED)
Before splitting, determine whether the file is actually suitable for the chunk-and-summarize pattern. Not all large files benefit from this approach.
Files SUITABLE for this skill (non-structured, prose-like content):
- PDF documents (reports, papers, books, manuals)
- DOCX documents (articles, contracts, essays)
- TXT / MD files (long-form text, documentation)
- PPTX files (slide decks with text content)
Files NOT suitable — use code instead:
- CSV, TSV, DTA, XLS/XLSX — structured/tabular data. Use pandas, Stata, or other data tools to query, filter, aggregate. Splitting rows across chunks destroys data integrity.
- JSON, JSONL — structured data. Use jq or Python to parse and extract.
- Log files — typically need grep/awk/filtering, not summarization.
- Source code files — use grep, AST tools, or targeted reads with offset/limit.
Also consider whether the task itself fits the pattern:
- Suitable tasks: summarization, information extraction, question answering over prose, finding specific sections in a long document.
- Unsuitable tasks: statistical analysis, counting, aggregation, joins, sorting, exact search — these need code, not parallel reading.
If the file or task is unsuitable, do NOT proceed with this skill. Instead, use the appropriate tool (Python/pandas for data, grep for logs, targeted Read with offset for code, etc.) and tell the user why you chose that approach.
Workflow (only after confirming suitability)
Step 1: Split the Document
python /app/.agents/skills/longread/scripts/split_doc.py <file_path>
The script will output JSON with chunk file paths:
{
"status": "success",
"chunk_files": ["/mnt/agents/chunks/doc_part_1.txt", ...],
"num_chunks": 5
}
Step 2: Create a Reader Subagent
create_subagent(
name="chunk_reader",
system_prompt="You are a document reader. Read the assigned chunk carefully and extract key information. Summarize the main points concisely."
)
Step 3: Launch Parallel Tasks
For each chunk file, launch a subagent in parallel (single message, multiple tool calls):
task(agent="chunk_reader", prompt="Read /mnt/agents/chunks/doc_part_1.txt and summarize the key points.")
task(agent="chunk_reader", prompt="Read /mnt/agents/chunks/doc_part_2.txt and summarize the key points.")
...
Step 4: Aggregate Results
After all subagents complete, combine their summaries to answer the user's original question.
Script Options
The split script supports:
- PDF, DOCX, TXT, MD, PPTX files
- Default chunk size: 32k tokens with 10% overlap
- Output directory:
/mnt/agents/chunks/
1---2name: longread3description: Use this skill when an agent (main agent or subagent) encounters a file too large to read in a single pass — e.g. cat, read_file, or Read tool hits size limits or truncates output. First assess whether the file is suitable for chunk-based parallel reading, then proceed accordingly. Supports PDF, DOCX, TXT, MD, PPTX files. NOT for structured data (CSV, DTA, XLSX, etc.).4---56# Longread Skill78Use this skill when a file is too large to read in a single pass (e.g. cat, read_file, or Read tool hits size limits or truncates output).910## Step 0: Assess Suitability (REQUIRED)1112Before splitting, determine whether the file is actually suitable for the chunk-and-summarize pattern. **Not all large files benefit from this approach.**1314### Files SUITABLE for this skill (non-structured, prose-like content):15- PDF documents (reports, papers, books, manuals)16- DOCX documents (articles, contracts, essays)17- TXT / MD files (long-form text, documentation)18- PPTX files (slide decks with text content)1920### Files NOT suitable — use code instead:21- **CSV, TSV, DTA, XLS/XLSX** — structured/tabular data. Use pandas, Stata, or other data tools to query, filter, aggregate. Splitting rows across chunks destroys data integrity.22- **JSON, JSONL** — structured data. Use jq or Python to parse and extract.23- **Log files** — typically need grep/awk/filtering, not summarization.24- **Source code files** — use grep, AST tools, or targeted reads with offset/limit.2526### Also consider whether the task itself fits the pattern:27- **Suitable tasks**: summarization, information extraction, question answering over prose, finding specific sections in a long document.28- **Unsuitable tasks**: statistical analysis, counting, aggregation, joins, sorting, exact search — these need code, not parallel reading.2930**If the file or task is unsuitable, do NOT proceed with this skill.** Instead, use the appropriate tool (Python/pandas for data, grep for logs, targeted Read with offset for code, etc.) and tell the user why you chose that approach.3132---3334## Workflow (only after confirming suitability)3536### Step 1: Split the Document3738```bash39python /app/.agents/skills/longread/scripts/split_doc.py <file_path>40```4142The script will output JSON with chunk file paths:43```json44{45 "status": "success",46 "chunk_files": ["/mnt/agents/chunks/doc_part_1.txt", ...],47 "num_chunks": 548}49```5051### Step 2: Create a Reader Subagent5253```54create_subagent(55 name="chunk_reader",56 system_prompt="You are a document reader. Read the assigned chunk carefully and extract key information. Summarize the main points concisely."57)58```5960### Step 3: Launch Parallel Tasks6162For each chunk file, launch a subagent in **parallel** (single message, multiple tool calls):6364```65task(agent="chunk_reader", prompt="Read /mnt/agents/chunks/doc_part_1.txt and summarize the key points.")66task(agent="chunk_reader", prompt="Read /mnt/agents/chunks/doc_part_2.txt and summarize the key points.")67...68```6970### Step 4: Aggregate Results7172After all subagents complete, combine their summaries to answer the user's original question.7374## Script Options7576The split script supports:77- PDF, DOCX, TXT, MD, PPTX files78- Default chunk size: 32k tokens with 10% overlap79- Output directory: `/mnt/agents/chunks/`