AgentSkillsCN

split

阅读文档,并将其拆分为多个小节。

SKILL.md
--- frontmatter
name: split
description: Read documents and split them into chunks
allowed-tools:
  - Read
  - Bash(wc *)

Split Skill

Read documents and split them into manageable chunks for processing, analysis, or transfer. Like a master breaking boards, this skill shatters overwhelming information into fragments that can be easily mastered.

Capabilities

  • Split by Lines: Split files into chunks of a precise number of lines.
  • Split by Size: Split files into chunks of an approximate character count.
  • Split by Sections: Split at structural boundaries like markdown headers.
  • Split by Paragraphs: Split at blank line delimiters.
  • Support Overlap: Maintain context between chunks with an overlapping buffer.

Usage Examples

Split a file into standard chunks:

code
/split README.md

Split by precise line count:

code
/split document.txt --lines 100

Split by markdown sections:

code
/split document.md --sections

Split by paragraphs:

code
/split article.txt --paragraphs

Split with context overlap:

code
/split document.txt --lines 100 --overlap 10

Options

OptionDescriptionDefault
--lines NSplit every N lines100
--size NSplit at approximately N characters-
--sectionsSplit at markdown headers (# ## ###)-
--paragraphsSplit at blank lines-
--overlap NInclude N lines of context0

Output Format

Present each chunk with a header showing its number and line range:

code
══════════════════════════════════════════════════════
CHUNK 1 of 5 (lines 1-100)
══════════════════════════════════════════════════════

[chunk content here]

══════════════════════════════════════════════════════
CHUNK 2 of 5 (lines 101-200)
══════════════════════════════════════════════════════

[chunk content here]

Splitting Strategies

By Lines (default)

Split at fixed line intervals. Best for uniform content like logs or data files.

By Size

Split at approximate character counts, breaking at line boundaries. Best when targeting specific output sizes.

By Sections

Split at markdown headers (lines starting with #). Best for documentation. Each section becomes its own chunk.

By Paragraphs

Split at blank lines. Best for prose where paragraphs are the logical units.

Workflow

  1. Read the file using the Read tool.
  2. Get file stats using wc -l to show total lines.
  3. Apply splitting strategy based on options.
  4. Display chunks with headers and summaries.
  5. Show summary with total chunks and average chunk size.