joshuadavidthomas/agent-skills/writing-error-messages
Claude Code and agent skill by joshuadavidthomas/agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when writing, reviewing, or rewriting user-facing error messages, validation messages, form errors, empty/error states, auth errors, failure notifications, retry/support copy, CLI errors, or API errors humans will read. Helps make errors specific, actionable, non-blaming, accessible, and safe without leaking sensitive details.
Install
npx vskill@latest install joshuadavidthomas/agent-skills/writing-error-messagesSKILL.md
Writing Error Messages
Quick Start
Before writing, identify:
- Audience: end user, admin, developer, support agent, or operator.
- Failure: what action failed and what still happened successfully.
- Cause: known, unknown, user-correctable, service-side, third-party, or security-sensitive.
- Recovery: what the reader can do now, what the system will do next, and where they can get help.
Then write this shape:
Example:
Core Rules
| Rule | Do | Avoid | |
|---|---|---|---|
| Say what happened | "We couldn't save your file." | "Something went wrong." | |
| Say what was not affected | "Your draft was saved." | Leaving the user to wonder if data was lost | |
| Give the next action | "Check the card number and try again." | "OK" / "Close" as the only path | |
| Use plain language | "We couldn't connect to Dropbox." | "Fetch failed" / "credentials denied" | |
| Avoid blame | "Store name is required." | "You forgot to enter a store name." | |
| Match the stakes | Calm, direct, respectful | "Oops!" / jokes / cutesy tone | |
| Be specific when safe | "Enter a date in the past." | "Invalid input." | |
| Be generic when security requires it | "Invalid email or password." | "That email exists, but the password is wrong." |
Message Anatomy
Use only the pieces the situation needs.
| Piece | Purpose | Pattern | |
|---|---|---|---|
| Title | Summarize the failed action | "Couldn't save changes" | |
| Body | Explain consequence and cause | "Your changes are still open, but we couldn't save them because the connection dropped." | |
| Primary action | Tell the reader what to do | "Try again", "Update details", "Choose another file" | |
| Backup path | Provide a way out | "If this keeps happening, contact support." | |
| Diagnostic detail | Help technical readers or support | Error code, request ID, expected/received values, log location |
Keep UI body copy to 1-2 sentences when possible. Put longer diagnostic details in expandable text, logs, or support context.
References
- Open
references/source-backed-patterns.mdwhen auditing many messages, resolving wording tradeoffs, or checking source-backed rationale. - Open
references/rewrite-examples.mdwhen rewriting multiple messages or testing whether the skill is producing the right shape.
Validation and Form Errors
For field-level errors:
- Put the message next to the field and summarize errors at the top for long forms.
- Match the field label or question so the reader can connect the message to the control.
- Say how to fix it, not only that it is wrong.
- Preserve the user's input so they can correct it.
- Do not validate before the user has had a fair chance to finish typing.
Good patterns:
Avoid:
Placement, Accessibility, and Empty States
- Put the error where the reader is looking: near the field, control, toast source, or failed item.
- Do not rely on color alone. Include visible text, icons or labels, and machine-readable semantics when working in UI code.
- For form pages, move focus to the error summary or first error according to the product's accessibility pattern.
- Preserve the user's work whenever possible.
- Do not turn an empty result into an error. If nothing failed, write an empty state: "No invoices found" plus the next useful action.
Security and Privacy Gate
Specificity is not always better. Use a generic message when detail could reveal account existence, permissions, private data, system internals, fraud signals, or security policy.
Use generic copy for login and account recovery:
Do not reveal:
If the user needs help, give a safe path: support, recovery instructions, request ID, or an audit-safe explanation.
Developer-Facing and CLI Errors
When the reader can act on technical details, include them in a structured way:
Useful details:
- What command, file, field, or resource failed.
- What was expected and what was received.
- The smallest fix or next diagnostic command.
- A request ID, error code, or log path when support/debugging needs it.
Still avoid stack traces, raw exception names, and internal service names unless the audience can use them.
When Asked for a Generic Error
Do not accept "just write a generic error" without checking whether the product can do better. Ask:
- What action was the user trying to complete?
- What triggered this error in the code or service?
- Is the cause known, unknown, intermittent, or security-sensitive?
- Was anything saved, sent, charged, deleted, or left unchanged?
- Can the user fix it, retry, wait, use another path, or contact support?
- How often does it happen, and does it block the main flow?
If the cause is truly unknown, use a generic-but-actionable fallback:
Final Check
Before shipping, verify the message answers the reader's questions:
- What happened?
- Did I lose anything or create a duplicate?
- Why did this happen, if it is safe to say?
- What can I do next?
- What happens if I do nothing?
- Where can I get help if the fix does not work?
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingwriting-error-messages/SKILL.md
Popularity
- Repository stars
- 56
- Repository forks
- 8
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/joshuadavidthomas/agent-skills/writing-error-messages)