text-splitter

Split long text into size-limited chunks while preserving sentence and paragraph boundaries.

410|79|Updated Jan 10, 2026
One-click install
npx skills add https://github.com/VanGong1999/screen-creative-skills --skill text-splitter-vangong1999
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: text-splitter
Source: https://github.com/VanGong1999/screen-creative-skills/tree/main/category/tools/text-splitter
Command: npx skills add https://github.com/VanGong1999/screen-creative-skills --skill text-splitter-vangong1999

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Long texts often exceed the context limits of AI models or processing pipelines, and naive splitting cuts sentences mid-way, destroying meaning. This Skill splits text into size-controlled chunks while keeping semantic integrity intact. ## Core Features & Use Cases - Semantic-Aware Splitting: Breaks text at sentence endings (。!?;) or paragraph boundaries instead of cutting mid-sentence. - Multiple Split Strategies: Supports splitting by character count, paragraph, sentence, or custom ratio for two-part division. - Structured Split Reports: Outputs original length, chunk count, and per-chunk size statistics for verification. - Use Case: When feeding a 50,000-character novel chapter into an AI for analysis, split it into 10,000-character chunks that end at complete sentences, then process each chunk independently. ## Quick Start Split the attached long document into chunks of 5000 characters each, breaking at sentence boundaries to keep the meaning complete.

Frequently Asked Questions about text-splitter

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

FAQPage Schema
How do I split long text into chunks in Python?▼

Use the TextSplitter class with a target chunk_size, then call split_text with your content. It returns a list of text chunks, each within the size limit and broken at sentence boundaries where possible.

How to split text without cutting sentences in half?▼

Use sentence-boundary splitting that searches for ending punctuation like periods, question marks, and Chinese markers (。!?) within the chunk range. The splitter picks the last valid boundary past the halfway point of each chunk.

Can I split text by paragraphs instead of character count?▼

Yes, set split_by_paragraph to true to group whole paragraphs into chunks. Paragraphs exceeding the chunk size are automatically subdivided at sentence boundaries to respect the limit.

What happens when a single paragraph exceeds the chunk size?▼

Oversized paragraphs are further split using sentence-based splitting so no chunk exceeds the limit. This fallback ensures size constraints hold even for dense, unbroken text blocks.

Does text splitting work for Chinese content?▼

Yes, the splitter recognizes Chinese sentence-ending punctuation including 。!?;… and Chinese commas as break candidates. It is designed primarily for Chinese text but works with any character-based content.