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, length validation, and per-model cost tracking.From its SKILL.md
npx -y skills add ChronoAIProject/Ornn --skill text-summarizerAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
3 things to look at
- reads credentialsReads from 1 credential source: `ANTHROPIC_API_KEY`.
- 19 stars19 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
- runs commandsInstructs the agent to run 3 commands, including `cd examples/text-summarizer` and 2 more.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
1.8 KB, 326 tokens by cl100k_base, as published. Nobody here has run it
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
Anthropicwith 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
textto the model verbatim; for untrusted callers, strip control characters and cap length before the API call.
What ships with it: 3 files
2.6 KB alongside SKILL.md, 1 of them executable
src/
- index.tsruns1.9 KB
- package.json344 B
- README.md442 B