dev.to5 de noviembre de 2026 AFECTA AL EXAMEN
APIHerramienta

Humanize Anthropic API Output in Kotlin: A Status-Page Blurb Linter + 5 Free Tools (2026)

Shipped and tested November 2026. Disclosure before the listing: UnAIMyText is ours, so it ranks...

*Shipped and tested November 2026. Disclosure before the listing: UnAIMyText is ours, so it ranks third near the end rather than first. Copy the Kotlin freely.*

Our status page was starting to sound like a product launch. Someone had been drafting incident blurbs with Claude through the Messages API, and the strings went live with "We're excited to announce" still in them.

On a phone, during an outage, that reads as noise. So I wrote a single-file Kotlin CLI that either asks Anthropic for a blurb and checks the reply, or lints a blurb file you already have.

What it checks

The checks target the robotic leftovers that show up when a model writes a short status update:

1. **Length.** Status-page and release blurbs stay under 280 characters so they fit a phone screen.

2. **Model preamble.** Openings like "Here is...", "Sure", "Certainly" or "Of course".

3. **Code fences.** A fenced block left inside the draft.

4. **Pasted labels.** A leading `Title:` / `Status:` / `Update:` line.

5. **Filler.** Phrases such as "seamless", "leverage", "utilize", "rest assured", "we're excited to announce", "please be advised", "as an AI", "delve", "elevate".

6. **Shouting.** Words of five or more capitals.

7. **Stacked bangs and emoji.** More than one `!`, or more than one emoji.

Return codes follow a simple pattern: pass = 0, needs a rewrite = 1, broken call or input = 2. Use `--json` when CI wants a report.

What the Anthropic docs say

Anthropic's [API overview](https://docs.anthropic.com/en/api/getting-started) describes a REST API at `https://api.anthropic.com`. The [Messages reference](https://docs.anthropic.com/en/api/messages) is the endpoint this script hits. What shaped the code:

  • The call is `POST /v1/messages` with `content-type: application/json` and a required `anthropic-version` header (the docs' current example is `2026-10-21`). Auth is `Authorization: Bearer <token>` or the still-supported `x-api-key` header; the script sends `x-api-key`.
  • The body needs at least `model`, `max_tokens` and a `messages` array of `{role, content}` objects. An optional top-level `system` prompt sets behaviour for the turn.
  • The reply is a `message` whose `content` is an array of blocks; text lives in blocks with `"type":"text"` and a `text` field. Any non-2xx status is exit 2.

The code

Kotlin on the JVM. No Gradle module required for the happy path: compile the two files to fat jars with `kotlinc -include-runtime`.

kotlin
// IncidentLint: draft a status-page / release blurb with Anthropic Messages API, or lint one.
//   kotlinc IncidentLint.kt -include-runtime -d IncidentLint.jar
//   java -jar IncidentLint.jar --draft "checkout 5xx for 12 min, root cause redis pool"
//   java -jar IncidentLint.jar samples/robotic.txt
// Return 0 on a clean blurb, 1 when a rewrite is needed, 2 when the call or input failed.
// Kotlin/JVM; java.net.http + kotlin stdlib only.

import java.net.URI
import java.net.http.HttpClient
import java.net.http.HttpRequest
impor
Leer artículo completo en dev.to