agentleFS
agentsdanceagentsdance/agentskills/skills/error-message-writer/SKILL.md

error-message-writer

Skill3 starsChanged 11 months agoApache-2.0View on GitHub

Write clear, helpful error messages. Use when the user needs to improve error handling UX, create user-friendly messages, or standardize error formats.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create clear, actionable error messages for better UX.

    line 8

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Error Message Writer

Create clear, actionable error messages for better UX.

Error Message Structure

[What went wrong] + [Why it happened] + [How to fix it]

Good vs Bad Examples

BadGood
"Error""Unable to save your changes. The file may be open in another program."
"Invalid input""Email address is invalid. Please enter a valid email like name@example.com"
"Error 500""Something went wrong on our end. Please try again in a few minutes."
"Forbidden""You don't have permission to view this page. Contact your admin for access."
"Network error""Unable to connect. Please check your internet connection and try again."

Error Message Templates

Validation Errors

const validationMessages = {
  required: (field) => `${field} is required`,
  email: 'Please enter a valid email address',
  minLength: (field, min) => `${field} must be at least ${min} characters`,
  maxLength: (field, max) => `${field} cannot exceed ${max} characters`,
  pattern: (field) => `${field} format is invalid`,
  unique: (field) => `This ${field} is already taken`,
};

API Errors

const apiErrors = {
  401: 'Your session has expired. Please log in again.',
  403: "You don't have permission to perform this action.",
  404: "The requested resource couldn't be found.",
  429: 'Too many requests. Please wait a moment and try again.',
  500: 'Something went wrong. Our team has been notified.',
  503: "We're temporarily unavailable. Please try again shortly.",
};

Form Errors

function formatFormErrors(errors) {
  return {
    email: {
      required: 'Email is required',
      invalid: 'Please enter a valid email address',
      taken: 'This email is already registered. Try logging in instead.',
    },
    password: {
      required: 'Password is required',
      weak: 'Password must include uppercase, lowercase, and a number',
      mismatch: 'Passwords do not match',
    },
  };
}

Guidelines

GuidelineExample
Be specific"File too large (max 5MB)" not "Upload failed"
Be human"Oops!" not "EXCEPTION_OCCURRED"
Suggest action"Try refreshing the page"
Avoid blame"We couldn't process..." not "You entered wrong..."
Avoid jargon"Connection lost" not "ECONNRESET"

Error Component (React)

function ErrorMessage({ type, field, context }) {
  const messages = {
    network: 'Unable to connect. Check your internet and try again.',
    permission: `You need ${context?.requiredRole} access for this.`,
    notFound: `We couldn't find that ${field || 'item'}.`,
    validation: `Please check your ${field} and try again.`,
  };

  return (
    <div role="alert" className="error">
      <span className="error-icon">!</span>
      <span>{messages[type]}</span>
    </div>
  );
}

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.