
- Installs
- 121
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/vangong1999/screen-creative-skills --skill text-truncator- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads text-truncator automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
文本截断工具
功能
智能截断文本,在保持内容完整性和语义连贯性的前提下,将文本截断至指定长度。
使用场景
- 对超出长度限制的文本进行预处理,使其符合智能体的输入要求。
- 在展示文本预览或生成摘要时,截取关键部分以提高效率和可读性。
- 辅助内容创作,对生成的长文本进行智能裁剪,避免冗余。
核心能力
- 语义优先截断: 优先在自然语义边界(如句号、问号、感叹号)处进行截断,最大限度地保持句子的完整性。
- 段落完整性: 在语义边界不足时,优先考虑在段落末尾或换行符处截断,避免破坏段落结构。
- 精确长度控制: 严格遵守用户指定的最大长度限制,确保输出文本不会超限。
- 截断标记插入(可选): 可以在截断文本的末尾自动添加自定义截断标记(如"..."),以指示内容有删节。
输入要求
- 文本内容: 待截断的原始文本(字符串)。
- 最大长度限制: 文本截断后的最大长度(整数,如字符数或 token 数)。
- 截断标记(可选): 自定义截断标记,如 "..." 或 "[内容已截断]"。
输出格式
【文本截断报告】
- 原始文本长度: [整数] 字/Token
- 截断后长度: [整数] 字/Token
- 截断位置: [位置描述,如 "在第X句末尾"] 或 "未截断"
### 截断后的文本
[截断后的文本内容]
约束条件
- 截断后的文本长度必须严格符合最大长度限制。
- 确保截断后的文本在语义上尽可能连贯和完整。
- 如果文本未达到最大长度,则不进行截断,返回原始文本。
- 输出格式必须结构化,清晰展示截断前后的长度信息和截断后的文本内容。
硬性约束
- 未超过目标长度则不截断
- 优先在段落/章节边界截断,避免句子截断
- 截断后标注已截断及原长/现长
参考资料
- examples.md
FAQ
What does the text-truncator skill do?
智能截断文本,保持内容的完整性和语义连贯性。适用于长文本预处理、确保文本不超过指定长度限制
How do I install text-truncator?
Run npx skills add https://github.com/vangong1999/screen-creative-skills --skill text-truncator in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/text-truncator/ (personal) or .claude/skills/text-truncator/ (project).
Which AI agents can use text-truncator?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is text-truncator safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains text-truncator?
It is published by vangong1999 in vangong1999/screen-creative-skills. It has 121 recorded installs.
More from vangong1999/screen-creative-skills
drama-creator
vangong1999/screen-creative-skills
创作与优化竖屏短剧剧本:宏观建构、分集撰写、节奏台词优化、打脸/悬念创意。 适用于从零写短剧、改剧本、设计大纲与钩子时使用。
drama-planner
vangong1999/screen-creative-skills
制定竖屏短剧专业策划方案,含情绪价值分析、黄金三秒钩子设计、三幕式结构规划等。适用于短剧项目前期策划、商业化方案设计、创作指导
drama-evaluator
vangong1999/screen-creative-skills
依据竖屏短剧评估标准,从核心爽点、故事类型等维度评估打分。适用于评估故事改编为竖屏短剧的潜力、分析市场竞争力
drama-analyzer
vangong1999/screen-creative-skills
分析故事文本,提炼主要情节点并分析戏剧功能。适用于分析小说、剧本大纲、故事梗概等文本,识别关键转折点和情感节点
character-profile
vangong1999/screen-creative-skills
基于故事文本分析人物特征,生成详细人物小传。适用于理解人物设定、为演员塑造角色提供参考、为剧本创作建立人物档案; 当用户提到人物小传、角色档案、人设分析时使用。
novel-evaluator
vangong1999/screen-creative-skills
仅依据用户提供的故事文本做多维度初筛打分(市场潜力、创新属性、内容亮点)。 适用于小说/故事文本初筛、无外网信息时的质量判断;不要在需要联网查热度、作者履历、版权数据时使用(那时用 ip-evaluator)。
Popular media & creative skills
hyperframes
heygen-com/hyperframes
Read first to make, edit, animate or render any video with HyperFrames (HTML rendered to video), including launch films, explainers, music videos, charts, maps, vertical clips, title cards, captions and overlays. Holds the render contract, the work loop and what each kind of video needs.
media-use
heygen-com/hyperframes
Get or make any media for a HyperFrames video - music, sound effects, images, icons, logos, voiceover, avatar and generated video, transcripts, cutouts, colour grades and looks - with HeyGen or free local tools, and mix placed audio. Also for footage that looks dark, flat or dull, or should be stylized or hidden.
hyperframes-registry
heygen-com/hyperframes
About 450 ready-made HyperFrames blocks and components installed as editable source - transitions, overlays, titles, kinetic type, captions, charts, map overlays, 3D, camera moves. Use it before hand-building any named visual (CRT scanlines, glitch, film grain, a chart); also for hyperframes add and catalog.
hyperframes-creative
heygen-com/hyperframes
Non-animation creative direction for HyperFrames videos. Use for design spec (frame.md / design.md) handling, palettes, typography, narration, beat planning, audio-reactive visuals, composition patterns, and brand / style decisions. For atomic motion patterns and scene blueprints, use hyperframes-animation.
ai-video-generation
101-skills/superpowers
Generate AI videos with Google Veo, Seedance 2.0, HappyHorse, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 2.0, HappyHorse 1.0, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, reference-to-video, video editing, lipsync, avatar animation, video upscaling, foley sound. Use for: social media videos, marketing content, explainer videos, product demos, AI avatars. Triggers: video generation, ai video, text to video, image to video, veo, animate image, video from image, ai animation, video generator, generate video, t2v, i2v, ai video maker, create video with ai, runway alternative, pika alternative, sora alternative, kling alternative, seedance, happyhorse
ai-image-generation
101-skills/superpowers
Generate AI images with GPT-Image-2, FLUX, Gemini, Grok, Seedream, Reve and 50+ models via inference.sh CLI. Models: GPT-Image-2, FLUX Dev LoRA, FLUX.2 Klein LoRA, Gemini 3 Pro Image, Grok Imagine, Seedream 4.5, Reve, ImagineArt. Capabilities: text-to-image, image-to-image, inpainting, LoRA, image editing, upscaling, text rendering. Use for: AI art, product mockups, concept art, social media graphics, marketing visuals, illustrations. Triggers: flux, image generation, ai image, text to image, stable diffusion, generate image, ai art, midjourney alternative, dall-e alternative, text2img, t2i, image generator, ai picture, create image with ai, generative ai, ai illustration, grok image, gemini image, gpt image, openai image, chatgpt image