danwright32

slack-alerts

Use when writing, changing or reviewing any message that code posts to Slack by itself, such as an alert, a failure or error notice, a recovery or all clear, a reminder, a daily or weekly digest or report, a request for someone to approve something, a webhook or Block Kit payload, or the name and description of a monitor in a vendor's tool. Also use when an existing alert reads too long, too wordy, or unlike the other alerts.

danwright32 0 Updated 2w ago

Resources

2
GitHub

Install

npx skillscat add danwright32/claude-config/slack-alerts

Install via the SkillsCat registry.

SKILL.md

Slack alerts

One standard for every message code posts to Slack, in every project, so they all read as if one
person wrote them. The reader is not an engineer but is technical: they know what a sync job, a
webhook and an HTTP 503 are, and they have never seen your code.

Three decisions before any wording

  1. Does it post? A message posts when the reader has something to look into. When every finding
    is a normal outcome the code posts nothing, and a missed run alert covers the silence.
  2. Which kind? alert, recovery, reminder, digest or request.
  3. Urgent or internal? Urgent means it is costing money or stopping customers now. Everything
    else is internal.

The message is five slots, in this order

Slot What goes in it
1. First line One bold sentence that says what happened and names the thing, with its numbers. On an urgent message a mention comes first, on the same line: <!here>, or the one person the project's CLAUDE.md names instead.
2. One sentence The one fact that neither the first line nor the error block carries: a cause, or a next step that is specific. Empty on most alerts. Slots 1 and 2 together come to 200 characters at most.
3. List The affected things, one per line, up to 5 lines, then and N more.
4. Error block What the other system answered, as it sent it, in one code block of up to 500 characters cut on a word boundary.
5. Link The last line: a link straight to the failed thing, labelled with a verb and the thing it opens (View run, Open sync page). When the reader has to open several pages to fix it, each listed thing links its own page instead, or more closing lines do.

A brief usually holds more facts than the message has slots. Fill the slots, and the message is
finished: every other fact (what it means for customers, how the check decides, when it posts
again, the retry schedule, the runbook) already has a home in the code and the runbook.

What each kind fills

Kind First line Slot 2 Mention Link
alert what happened 0 or 1 sentence urgent only: <!here>, or the person the project's CLAUDE.md names always
reminder Still open after 2 hours: then the alert's first line, shortened empty the same as its alert always
recovery Recovered: then what works again 0 or 1 sentence: how long it lasted and what it cost none when there is something to open
digest the count that makes it worth opening 0 or 1 sentence none always
request who asks the person for what up to 2: the asker's note in quotes, and the one fact needed to decide the person asked always
  • An internal alert posts once, and again only when it changes. An urgent alert gets reminders.
  • A recovery is a new message in the channel.
  • Several links are allowed when each opens a different page and the reader has to visit every
    one of them to act. Dan, 18 Nov 2026: "Multiple links are fine if they genuinely link to
    different pages and I have to go to each of them to fix the problem." Each link goes on the
    list line of the thing it opens, or on a closing line of its own. The checker checks only that
    their targets differ; whether each is a page to act on, and not a runbook or other reference,
    is yours to judge before it posts.
  • A request carries buttons when pressing one does the thing (Approve, Decline).
  • A thread reply exists to add a diagnosis the message lacks, in projects that opted in.

Wording

  • Counts are digits, and the noun matches the count (1 account, 2 accounts).
  • Things are named the way the reader's screen names them (an advisor's name, pull request 641).
  • A time appears when it differs from the time of the post, written 3:05 PM ET, or
    3:05 PM ET, Nov 14 when it is not today.
  • Sentence case, plain words, and commas, colons and full stops for punctuation.
  • A credential inside the other system's answer (a token, a key, a password) is cut out of the
    error block. A cleaner the project already runs on error text stays in place.

Examples

Internal alert, the usual size:

*The nightly warehouse export has not run since 3:05 AM ET, Nov 14*
<https://shop.example.com/admin/jobs/nightly-export|Open export job>

Urgent alert with a list and an error block, which already says why:

<!here> *3 of 40 invoices were not sent this morning*
• Invoice 1042, Ridgeway Dental
• Invoice 1043, Corner Bakery
• Invoice 1047, Elm Street Books
```HTTP 413 {"message":"Attachment exceeds 10 MB"}```
<https://shop.example.com/admin/invoices?status=failed|View failed invoices>

Internal alert where each listed thing has its own page to fix:

*3 bookings for Nov 21 have no advisor assigned*
• <https://shop.example.com/admin/bookings/1041|Booking 1041>, Ridgeway Dental
• <https://shop.example.com/admin/bookings/1042|Booking 1042>, Corner Bakery
• <https://shop.example.com/admin/bookings/1047|Booking 1047>, Elm Street Books

reminder:

<!here> *Still open after 2 hours: 3 invoices have not been sent*
<https://shop.example.com/admin/invoices?status=failed|View failed invoices>

recovery:

*Recovered: all 40 invoices have been sent*
3 were held from 8:05 AM to 11:20 AM ET.

digest:

*4 imports were skipped last week, 1 of them for a missing column*
• Orders, 2:46 PM ET, Nov 13: no column named "total"
• Customers, 10:12 AM ET, Nov 14: the file was empty
• Refunds, 4:03 PM ET, Nov 12: the file was empty
• Stock, 9:30 AM ET, Nov 11: the file was empty
<https://shop.example.com/admin/imports|Open import log>

request:

<@U045GHIJKL> *Priya asks you to approve a refund of $240 on order 1038*
"The parcel arrived damaged." It is over the $200 she can approve herself.
<https://shop.example.com/admin/refunds/77|Open refund>

Check it

Render the message with the longest values the code can produce, save it as the text Slack
receives, and run the checker beside this file:

python3 ~/.claude/skills/slack-alerts/check_alert.py --kind alert --urgent --app "Shop Admin" message.txt

--kind is required. --urgent goes on an urgent alert and its reminder. --app is the name of
the bot that posts, which already tells the reader which app is speaking. Exit 0 is a pass. Each
FAIL line names the rule and what it measured, so fix that and run it again. The checker cannot
tell whether the first line is true, whether the link opens the failed thing, or whether the
problem is urgent: read the rendered message once for those.

A project's record

Three forms the standard refuses are allowed on one alert only when the project has recorded it,
with the date Dan decided it. The record is one text file the project keeps beside its copy of
the checker, one entry per line: the date, the alert's key, and what that alert may do.

# date      alert key       what it allows
2026-11-18  time-off-note   own-zone
2026-11-18  queue-backlog   labelled-id
2026-11-18  page-watch      exempt bare-url
  • own-zone: a clock time may name the person's own zone in place of ET, one of CT, MT, PT, AZ,
    AKT, HST (9:00 AM to 1:00 PM MT), for text about that person's own time. Any other zone fails.
  • labelled-id: a bare id in the dashed 8, 4, 4, 4 and 12 character form the checker refuses,
    such as 8d41c7e2-5b9a-4f03-b6de-2c7a91e4f5b3, may stand alone on a list line after a label saying
    what it is (Queue row: and the id). An id with no label, in a sentence, or with more words
    after it fails. A short number such as Queue row: 4817 passes with no record at all.
  • exempt and one rule: that alert is not judged on that one rule, such as bare-url for an
    alert that keeps the address of the page it is about. Every other rule still applies.

The project's test passes the record with every message it renders:

python3 check_alert.py --kind alert --record slack-alerts-record.txt --alert page-watch --alert-keys time-off-note,queue-backlog,page-watch message.txt

--alert is the key of the message being judged and --alert-keys is every alert the project
posts, so an entry naming any other key is refused rather than left to do nothing. A line the
checker cannot read (no date, a date that is not a day, an allowance or rule it does not know, a
second copy of an entry) exits 2 naming the line, and the whole record is refused with it. With no
record nothing beyond the standard is allowed. Each entry is Dan's to add, with his date: never
add one to make a failing message pass.

Around the message

  • The project's CLAUDE.md records the bot and channel, which alerts are urgent, the one person
    an urgent alert mentions in place of <!here> when there is one, and any alert that keeps its
    own layout, named with the date it was approved. An alert recorded there is left exactly as it
    posts. Asked who an urgent alert mentions, Dan answered "@here" (2026-11-17).
  • The project's tests run the checker over every message the code can render. CI has no
    Claude config folder, so the project keeps its own copy of check_alert.py, with a test that
    runs where this one exists and fails when the two differ (Dan, 2026-11-17).
  • The route has to render formatting. Read one posted message in Slack. If the asterisks and
    angle brackets show as typed, which is what a workflow builder variable does, move the alert to
    an app webhook.
  • A monitor in a vendor's tool is drawn by the vendor. Write its name as a first line and its
    description as slot 2.
  • Rewriting a repo's existing alerts is one issue per repo, and the change merges when its
    checks and the lessons review pass, with nothing brought back to Dan to approve. His words,
    2026-11-17: "This shouldn't require my approval on them at all. it should literally just go
    through in every repo (separate issues for each repo) and update all alerts without me".