write-better-error-messages
Skill0 starsChanged 5 months agoMITView on GitHub
Draft, rewrite, audit, and systematize product error messages so they explain what happened, avoid blame and jargon, reassure users, provide a clear recovery path, and expose cases that need engineering or product investigation. Use when asked to improve error copy, empty/error states, validation messages, toast alerts, form errors, API failure messages, fallback "something went wrong" messages, customer-facing incident copy, or product guidelines for error handling.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- RhysSullivan/skillstheir own version, first seen Jul 10, 2026
- gillkyle/skillstheir own version, first seen Jul 8, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- RhysSullivan/skills★ 104same name
- gillkyle/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository3 other files it gives its agents.
- expo-react-nativeSkill
- prompt-betterSkill
- rn-reviewSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 10 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Before rewriting, look for or ask for:
- Distinctive: line 28
If the cause is unknown, do not invent one.
- Distinctive: line 47
Use this order unless the product surface has strong local conventions:
- Distinctive: line 77
Avoid third-party blame such as "[service] isn't responding." Prefer "We're having trouble connecting to..."
- Distinctive: line 82
Do not over-apologize. One apology can fit severe or unrecoverable situations, but clarity matters more.
- Distinctive: line 83
Use "please" sparingly for high-friction asks, support handoffs, or cases the product cannot resolve for the user.
- Distinctive: line 85
Prefer active, concrete verbs: "Check", "Reconnect", "Try again", "Contact support".
- Distinctive: line 86
Use short sentences, plain words.
- Distinctive: line 87
Write for localization: avoid idioms, keep variable substitution at end of strings where possible.
- Very specific: line 97
Use Follow-up for instrumentation, support routing, UI changes, missing state knowledge, or cases where copy depends on engineering …
- Distinctive: line 109
When auditing many errors, rank first by flow-blocking severity, frequency, trust impact, known cause hidden behind generic copy, and …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Write Better Error Messages
Operating Loop
- Gather only the context needed to write truthfully.
- Classify the current issue: generic, unclear, blameful, jargon-heavy, dead-end, or wrong tone.
- Decide whether copy can fix it or whether product/engineering must map causes, impact, recovery, or instrumentation. If the error condition can be eliminated upstream — do that first, before improving the copy.
- Rewrite with the helpful-error structure.
- Return improved copy plus follow-ups for anything copy cannot responsibly solve.
Context Needed
Before rewriting, look for or ask for:
- Trigger: What condition causes it?
- User goal: What was the user trying to do?
- Impact: What did or did not happen?
- Safety: Were changes, money, orders, messages, or data saved, queued, rolled back, or lost?
- Recovery: Can the user retry, edit input, reconnect, refresh, wait, contact support, or take another path?
- Ownership: Is it validation, permissions, connectivity, payment, third-party integration, backend failure, rate limit, or unknown fallback?
- Priority: How often does it happen, and does it block the flow?
If the cause is unknown, do not invent one. Write a truthful fallback and recommend mapping or instrumentation.
Bad Patterns
Flag messages with these problems:
- Cutesy tone in a high-stakes moment: "Oops!", "Uh oh!", "Yikes!"
- Technical jargon: "fetch failed", "credentials denied", "500", "unprocessable entity", "timeout exception"
- Raw error codes or HTTP status codes exposed directly to users
- Blame: "You entered the wrong...", "Your account caused...", "Stripe is not responding"
- Generic wording when the system knows more: "Something went wrong"
- False certainty: claiming the issue is fixed by retrying when it might persist
- Dead ends: no next step, contact path, or alternative
- Missing reassurance: leaving users unsure whether work, money, orders, or data were affected
- Unclear explanations: words are present, but the user still cannot tell what happened
- First-person software voice: "I couldn't find that", "I'm having trouble" — the product speaks, not a persona
Helpful Structure
Use this order unless the product surface has strong local conventions:
- State what happened in user language.
- Explain why, only as specifically as the product can truthfully support.
- Reassure the user about what was not affected, when known.
- Give the best next action.
- Provide a way out if the user cannot fix it.
Compact formula:
We couldn't [complete user goal] because [plain-language reason]. [Safety reassurance.] [Specific next step or support path.]Common patterns:
System-side:
We couldn't [complete action] because of an issue on our end. [Safety reassurance.] Try again in a few minutes, or contact support if this keeps happening.
Validation:
[Field/value] needs [specific requirement]. [Example or correction.]
Permission:
You do not have permission to [action]. Ask an admin to update your access, or switch to an account with permission.
Integration:
We're having trouble connecting to [service]. Reconnect your account or try again later.Avoid third-party blame such as "[service] isn't responding." Prefer "We're having trouble connecting to..."
Tone Rules
- Match severity. Avoid playful language for payments, publishing, data loss, account access, health, legal, or income-impacting workflows.
- Do not over-apologize. One apology can fit severe or unrecoverable situations, but clarity matters more.
- Use "please" sparingly for high-friction asks, support handoffs, or cases the product cannot resolve for the user.
- Focus on the problem and recovery, not on the user's mistake.
- Prefer active, concrete verbs: "Check", "Reconnect", "Try again", "Contact support".
- Use short sentences, plain words.
- Write for localization: avoid idioms, keep variable substitution at end of strings where possible.
Audit Output
For audits, use a concise table:
| Current message | Issue | Better message | Follow-up |
| Something went wrong | Generic; no recovery | We couldn't save your changes because of an issue on our end. Your draft is still saved. Try again in a few minutes. | Confirm draft state and add retry tracking. |
Use Follow-up for instrumentation, support routing, UI changes, missing state knowledge, or cases where copy depends on engineering investigation.
For single-message rewrites, return:
Better message: ...
Why: ...
Follow-up: ...Prioritize
When auditing many errors, rank first by flow-blocking severity, frequency, trust impact, known cause hidden behind generic copy, and cross-functional effort needed. Trust-impacting errors include money, publishing, orders, user data, access, compliance, or safety.
Placement
Error messages should appear near the element that triggered them — inline below a field, not only at the top of a form or in a distant toast. Placement is as important as wording: a correct message in the wrong place is still a usability failure. Flag placement issues in the Follow-up column when copy alone cannot fix them.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

