Skip to content
Back to skills

Text Truncator

ASecurity

Intelligently truncate text while preserving content integrity and semantic coherence. Suitable for long text preprocessing, ensuring text does not exceed specified length limits

  • 523 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 20, 2026
ai-agents

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 9, 2026

npx -y skills add VanGong1999/screen-creative-skills --skill text-truncator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Text Truncator?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Text Truncator
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vangong1999-text-truncator-screen-creative-skills/badge)](https://www.skillsdirectory.com/skills/vangong1999-text-truncator-screen-creative-skills)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: text-truncator
description: >-
  Intelligently truncate text while preserving content integrity and semantic coherence. Suitable for long text preprocessing, ensuring text does not exceed specified length limits
license: MIT
---

# Text Truncator Tool

## Functionality

Intelligently truncate text while maintaining content integrity and semantic coherence, limiting text to a specified length.

## Usage Scenarios

- Preprocess text that exceeds length limits to meet agent input requirements
- Extract key sections for text previews or summary generation to improve efficiency and readability
- Assist content creation by intelligently trimming generated long text to avoid redundancy

## Core Capabilities

- **Semantic-Priority Truncation**: Prioritize truncation at natural semantic boundaries (periods, question marks, exclamation points) to maximize sentence integrity
- **Paragraph Integrity**: When semantic boundaries are insufficient, prioritize truncation at paragraph ends or line breaks to avoid breaking paragraph structure
- **Precise Length Control**: Strictly adhere to user-specified maximum length limits, ensuring output text does not exceed limits
- **Truncation Marker Insertion** (optional): Automatically add custom truncation markers (such as "...") at the end of truncated text to indicate content omission

## Input Requirements

- **Text Content**: Original text to be truncated (string)
- **Maximum Length Limit**: Maximum length after text truncation (integer, such as character count or token count)
- **Truncation Marker** (optional): Custom truncation marker, such as "..." or "[content truncated]"

## Output Format

```
[Text Truncation Report]

- Original text length: [integer] words/tokens
- Truncated length: [integer] words/tokens
- Truncation position: [position description, such as "at end of sentence X"] or "not truncated"

### Truncated Text
[truncated text content]
```

## Constraints

- Truncated text length must strictly comply with maximum length limits
- Ensure truncated text remains as semantically coherent and complete as possible
- If text does not reach maximum length, do not truncate; return original text
- Output format must be structured, clearly displaying length information before and after truncation and truncated text content

## Resources

- [examples.md](references/examples.md)

Files in this skill

  • SKILL.md4.2 KB
  • references/examples.md2.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.