Skip to content
Back to skills

Text Summarizer

ASecurity

Summarise a chunk of text down to roughly `length` words using the agent's configured LLM provider. Input shape `{ text: string, length?: number }` on stdin, JSON; output shape `{ summary: string }` on stdout, JSON. Minimal: ~50 lines, no streaming, no retries — a deliberate baseline so the wiring is visible. For a production summariser, fork this and add retries, prompt-injection sanitisation, length validation, and per-model cost tracking.

  • 20 stars
  • 0 votes
  • 0 copies
  • 7 views
  • Added May 26, 2026
ai-agentstypescriptrustgobashapibackend

Works with

  • api

Security analysis

A100/100

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

Scanned May 27, 2026

npx -y skills add ChronoAIProject/Ornn --skill text-summarizer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Text Summarizer?

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

Security grade badge for Text Summarizer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/chronoaiproject-text-summarizer/badge)](https://www.skillsdirectory.com/skills/chronoaiproject-text-summarizer)

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-summarizer
description: Summarise a chunk of text down to roughly `length` words using the agent's configured LLM provider. Input shape `{ text: string, length?: number }` on stdin, JSON; output shape `{ summary: string }` on stdout, JSON. Minimal: ~50 lines, no streaming, no retries — a deliberate baseline so the wiring is visible. For a production summariser, fork this and add retries, prompt-injection sanitisation, length validation, and per-model cost tracking.
version: "1.0"
license: MIT
metadata:
  category: text
  tag:
    - example
    - llm
    - summarization
    - typescript
---

# text-summarizer

A minimum-viable LLM skill — the smallest amount of code that takes structured input, calls an LLM, and emits structured output.

## Contract

**Input** (stdin, JSON):

```json
{ "text": "...long input...", "length": 60 }
```

- `text` (string, required) — what to summarise.
- `length` (number, optional, default 60) — target word count for the summary.

**Output** (stdout, JSON):

```json
{ "summary": "..." }
```

**Errors** — written to stderr as `{ "error": "...message..." }` and exit code `1`.

## Required environment

| Var | Purpose |
|---|---|
| `ANTHROPIC_API_KEY` | Talks to Claude. Swap the SDK call to point at OpenAI / Gemini / your own backend; nothing else changes. |

## Run locally

```bash
cd examples/text-summarizer
bun install
ANTHROPIC_API_KEY=sk-ant-... echo '{"text":"...","length":40}' | bun run src/index.ts
```

## Adapt this

- **Different model vendor** — replace `Anthropic` with the SDK of your choice; the I/O shape stays.
- **Stream output** — emit one JSON line per token instead of one final blob.
- **Sanitise input** — the current code passes `text` to the model verbatim; for untrusted callers, strip control characters and cap length before the API call.

Files in this skill

  • README.md442 B
  • SKILL.md1.8 KB
  • package.json344 B
  • src/index.ts1.9 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.