Receber por email
← Voltar para o catálogo

text-summarizer

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, le

19estrelas
Atualizado há 4 meses

Ver no GitHub ↗ Licença: Apache-2.0

Como adicionar

/plugin marketplace add ChronoAIProject/Ornn

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Para o autor da skill

Cole no README do seu repo

Mostra que sua skill está catalogada na Skillteca, gera backlink e tráfego rastreável.

[![Skillteca](https://www.skillteca.com.br/api/badge/text-summarizer/svg)](https://www.skillteca.com.br/skills/text-summarizer)

Skills relacionadas

Ver todas de Documentos →

Alerta por categoria

Receba novas skills de Documentos toda segunda

1 email curto, só com as skills novas de Documentos. 4 minutos de leitura, sem spam, cancela com 1 clique.

Você confirma o email no primeiro envio. Sem spam. Cancela com 1 clique.

Ler descrição completa

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):

{ "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):

{ "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

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.
Compartilhar X LinkedIn