Agent skill

Text Truncator

by VanGong1999 in VanGong1999/screen-creative-skills

智能截断文本,保持内容的完整性和语义连贯性。适用于长文本预处理、确保文本不超过指定长度限制. An agent skill from VanGong1999/screen-creative-skills.

MITAuto-check passed

Install Text Truncator

skills CLI
$ npx skills add VanGong1999/screen-creative-skills --skill text-truncator -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install VanGong1999/screen-creative-skills text-truncator --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/VanGong1999/screen-creative-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/category/tools/text-truncator .claude/skills/text-truncator && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
text-truncator
GitHub stars
446
Token cost
~519 tokens
SKILL.md length
59 words
Files
3 (incl. scripts, references)
Skills in repo
62
Repo updated
First seen
Licence
MIT

At a glance

智能截断文本,保持内容的完整性和语义连贯性。适用于长文本预处理、确保文本不超过指定长度限制. An agent skill from VanGong1999/screen-creative-skills.

  • SKILL.md covers 功能, 使用场景, 核心能力 and 输入要求, plus 5 more sections
  • Runs Python scripts from its folder

What it does

Text Truncator is an agent skill from VanGong1999/screen-creative-skills. 智能截断文本,保持内容的完整性和语义连贯性。适用于长文本预处理、确保文本不超过指定长度限制

Its SKILL.md is about 520 tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including scripts and reference files (for example `references/examples.md` and `scripts/text_truncator.py`). Compatibility notes: Claude Code 1.0+

The repository describes itself as: Skills for Film and Television Creation Agents|31 个影视创作评估策划Agent Skills|AI影视自动化工作流|竖屏短剧长剧IP改编|情节题材提炼|剧本小说IP创作策划评估|人物小传|拉片人物剧集故事五元素分析|大纲生成|. The licence is MIT.

Example prompts

  • “/text-truncator”

Requirements

  • Python 3
  • Compatibility (from SKILL.md): Claude Code 1.0+

What it can do on your machine

Read from SKILL.md and the folder at commit 6ced54f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Claude Code 1.0+

    From compatibility in the SKILL.md frontmatter.

Context cost

Text Truncator loads about 519 tokens when it runs, and up to ~1.1k if it reads all its reference files. Until then it costs about 15 tokens; SKILL.md has 59 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~15
When it runs · the whole SKILL.md, loaded when a task matches
~519
With references · SKILL.md plus every file in references/, read only if the agent opens them
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from VanGong1999/screen-creative-skills at commit 6ced54f, republished under its MIT licence (© VanGong1999). 59 words, ~519 tokens.

Download SKILL.mdSave it as .claude/skills/text-truncator/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
text-truncator
description
智能截断文本,保持内容的完整性和语义连贯性。适用于长文本预处理、确保文本不超过指定长度限制
compatibility
Claude Code 1.0+
category
tools
version
2.1.0
last_updated
2026-01-11
license
MIT
maintainer
宫凡
model
opus

文本截断工具

功能

智能截断文本,在保持内容完整性和语义连贯性的前提下,将文本截断至指定长度。

使用场景

  • 对超出长度限制的文本进行预处理,使其符合智能体的输入要求。
  • 在展示文本预览或生成摘要时,截取关键部分以提高效率和可读性。
  • 辅助内容创作,对生成的长文本进行智能裁剪,避免冗余。

核心能力

  • 语义优先截断: 优先在自然语义边界(如句号、问号、感叹号)处进行截断,最大限度地保持句子的完整性。
  • 段落完整性: 在语义边界不足时,优先考虑在段落末尾或换行符处截断,避免破坏段落结构。
  • 精确长度控制: 严格遵守用户指定的最大长度限制,确保输出文本不会超限。
  • 截断标记插入(可选): 可以在截断文本的末尾自动添加自定义截断标记(如"..."),以指示内容有删节。

输入要求

  • 文本内容: 待截断的原始文本(字符串)。
  • 最大长度限制: 文本截断后的最大长度(整数,如字符数或 token 数)。
  • 截断标记(可选): 自定义截断标记,如 "..." 或 "[内容已截断]"。

输出格式

【文本截断报告】

- 原始文本长度: [整数] 字/Token
- 截断后长度: [整数] 字/Token
- 截断位置: [位置描述,如 "在第X句末尾"] 或 "未截断"

### 截断后的文本
[截断后的文本内容]

约束条件

  • 截断后的文本长度必须严格符合最大长度限制。
  • 确保截断后的文本在语义上尽可能连贯和完整。
  • 如果文本未达到最大长度,则不进行截断,返回原始文本。
  • 输出格式必须结构化,清晰展示截断前后的长度信息和截断后的文本内容。

示例

参见 {baseDir}/references/examples.md 目录获取更多详细示例:

  • examples.md - 包含不同长度、不同截断标记和复杂文本结构的截断示例。

详细文档

参见 {baseDir}/references/examples.md 获取关于文本截断工具的详细指导与案例。


版本历史

版本日期变更
2.1.02026-01-11优化 description 字段,使其更精简并符合命令式语言规范;模型更改为 opus;优化功能、核心能力、输入要求、输出格式的描述,使其更符合命令式语言规范;添加使用场景、约束条件、示例和详细文档部分。
2.0.02026-01-11按官方规范重构
1.0.02026-01-10初始版本

© VanGong1999, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (scripts, references) in category/tools/text-truncator of VanGong1999/screen-creative-skills.

  • SKILL.md
  • references/examples.md
  • scripts/text_truncator.py

Open the folder on GitHubat commit 6ced54f

Compare with similar skills

Text Truncator next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Text Truncator compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Text Truncator this skillVanGong1999/screen-creative-skills446—~519Automated safety check: PassMIT
Text Expansionthedaviddias/Front-End-Checklist74k—~534Automated safety check: PassMIT
Hugging Face TokenizersOrchestra-Research/AI-Research-SKILLs13k6 repos~3.4kAutomated safety check: PassMIT
Subject Line Labaaron-he-zhu/aaron-marketing-skills2.9k2 repos~3.6kAutomated safety check: PassApache-2.0
Fetchtinyfish-io/tinyfish-cookbook2.2k—~772Automated safety check: PassMIT
Bio Data Visualization Volcano And Ma PlotsGPTomics/bioSkills1.2k2 repos~5.3kAutomated safety check: PassMIT

Similar skills

  • Text Expansion

    thedaviddias/Front-End-Checklist

    A skill your agent uses when reviewing CSS for fixed dimensions, truncation, or overflow rules on elements that render translatable strings.

    74k GitHub stars~534 tokensUpdated 3 days ago
    Frontend & DesignAuto-check passed
  • Hugging Face Tokenizers

    Orchestra-Research/AI-Research-SKILLs

    Shows how to load, train and use fast Hugging Face tokenizers, with BPE, WordPiece and Unigram models, padding, truncation and alignment tracking.

    13k GitHub starsUsed in 6 repos~3.4k tokens
    AI & LLM EngineeringAuto-check passed
  • Subject Line Lab

    aaron-he-zhu/aaron-marketing-skills

    A skill your agent uses when the user asks to "generate subject line variants", "pre-score my subject lines", or "will this subject get truncated / trigger spam filters"; produces a labeled subject…

    2.9k GitHub starsUsed in 2 repos~3.6k tokens
    Marketing & SEOAuto-check passed
  • Fetch

    tinyfish-io/tinyfish-cookbook

    Default, free, and fastest way to read a URL's actual content — pulls clean, full page content (not a summary or a truncated snippet) as markdown, HTML, or structured JSON, including from…

    2.2k GitHub stars~772 tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Build volcano and MA plots from differential-expression / association results with LFC shrinkage, FDR-adjusted thresholds, sensible label placement, and axis-truncation conventions.

    1.2k GitHub starsUsed in 2 repos~5.3k tokens
    Data & AnalyticsAuto-check passed
  • Detect single-nucleotide crosslink (CL) sites in CLIP-seq data using truncation patterns (iCLIP/eCLIP CITS), crosslink-induced mutations (HITS-CLIP CIMS deletions, PAR-CLIP T-to-C), or…

    1.2k GitHub starsUsed in 2 repos~5k tokens
    Research & ScienceAuto-check passed

More from VanGong1999/screen-creative-skills

All 62 skills in this repo
  • Drama Creator

    VanGong1999/screen-creative-skills

    Create vertical short drama scripts covering macro construction, episode writing, precise optimization, and creative ideation using Emotional Spring Theory.

    446 GitHub stars~2.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Drama Workflow

    VanGong1999/screen-creative-skills

    Orchestrate the full plot-point dramatic function analysis pipeline — text preprocessing, parallel segment analysis, result integration, and report generation — for long-form story content.

    446 GitHub stars~850 tokensUpdated 4 mo ago
    Auto-check passed
  • Novel Evaluator

    VanGong1999/screen-creative-skills

    Evaluate and score story text across market potential, innovation attributes, and content highlights dimensions, producing structured scoring reports with development recommendations.

    446 GitHub stars~1.2k tokensUpdated 4 mo ago
    Auto-check passed
  • Script Evaluator

    VanGong1999/screen-creative-skills

    Evaluate film and TV scripts across ideological, artistic, and entertainment value dimensions, producing structured scoring reports with follow-up recommendations.

    446 GitHub stars~1.4k tokensUpdated 4 mo ago
    Auto-check passed
  • Story Five Elements

    VanGong1999/screen-creative-skills

    Analyze five core story elements — genre type, story summary, character biographies, character relationships, and major plot points — producing a structured comprehensive report with optional mind…

    446 GitHub stars~781 tokensUpdated 4 mo ago
    Auto-check passed
  • Character Profile

    VanGong1999/screen-creative-skills

    基于故事文本分析人物特征,生成详细的人物小传。适用于深度理解故事人物设定、为演员塑造角色提供参考、为剧本创作建立人物档案

    446 GitHub stars~609 tokensUpdated 4 mo ago
    Auto-check passed

Questions about Text Truncator

What does Text Truncator do?

智能截断文本,保持内容的完整性和语义连贯性。适用于长文本预处理、确保文本不超过指定长度限制. An agent skill from VanGong1999/screen-creative-skills. Text Truncator is an agent skill from VanGong1999/screen-creative-skills.

How do I install Text Truncator in Claude Code?

Run `npx skills add VanGong1999/screen-creative-skills --skill text-truncator -a claude-code`. Or copy the skill folder (category/tools/text-truncator in VanGong1999/screen-creative-skills) into .claude/skills/text-truncator in your project. Claude Code loads it when a task matches its description.

How do I install Text Truncator in Codex?

Run `npx skills add VanGong1999/screen-creative-skills --skill text-truncator -a codex`. Or copy the skill folder (category/tools/text-truncator in VanGong1999/screen-creative-skills) into .agents/skills/text-truncator in your project. Codex loads it when a task matches its description.

Can I use Text Truncator in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add VanGong1999/screen-creative-skills --skill text-truncator -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/text-truncator, .gemini/skills/text-truncator, .github/skills/text-truncator and .opencode/skills/text-truncator in your project.

What does Text Truncator need to run?

Going by SKILL.md and its folder, Text Truncator needs Python for the scripts in its folder. Our summary lists: Python 3. Compatibility (from SKILL.md): Claude Code 1.0+.

Does Text Truncator access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Text Truncator safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Text Truncator use?

Text Truncator is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Text Truncator use?

About 519 tokens (SKILL.md is roughly 2.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 531 tokens, read only when the agent opens those files.

What are the alternatives to Text Truncator?

Skills that share tags, products or a category with Text Truncator: Text Expansion (thedaviddias/Front-End-Checklist, 74k stars), Hugging Face Tokenizers (Orchestra-Research/AI-Research-SKILLs, 13k stars), Subject Line Lab (aaron-he-zhu/aaron-marketing-skills, 2.9k stars) and Fetch (tinyfish-io/tinyfish-cookbook, 2.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Text Truncator?

VanGong1999 (a GitHub user) maintains it in VanGong1999/screen-creative-skills, which has 446 GitHub stars. The repository holds 62 skills in this directory. The repository was last updated on May 26, 2026.

Source: VanGong1999/screen-creative-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.