error-messages
БесплатноБез исполняемых скриптовНе проверенWrite consistent, actionable validation error messages in gh-aw.
от github★ 5 758 звёзд на GitHubОб этом скилле
Error Message Style Guide
Use this format for gh-aw validation errors. Keep messages clear, actionable, and example-driven.
Error Message Template
[what's wrong]. [what's expected]. [example of correct usage]
Make each error message answer three questions:
- What's wrong? - Clearly state the validation error
- What's expected? - Explain the valid format or values
- How to fix it? - Provide a concrete example of correct usage
Constructive Language
Avoid standalone negative wording. Pair it with expected behavior and a concrete fix.
| Avoid only-negative wording | Prefer constructive wording |
|---|---|
invalid |
expected + valid format/options |
cannot |
requires + precondition |
must |
should + example |
failed |
action context + recovery step |
❌ invalid repo format: %s
✅ invalid repo format '%s' — expected 'owner/repo' format (for example: 'github/gh-aw')
❌ not in a git repository
✅ not in a git repository — run 'git init' or 'cd' to a git repository
When to use NewValidationError vs fmt.Errorf
- Use
NewValidationError(field, value, reason, suggestion)in*_validation.gologic.- Use
fieldfor the exact config path - Use
reasonfor what failed - Use
suggestionfor an actionable fix with an example
- Use
- Use
fmt.Errorffor operational/wrapping errors (%w) where you are propagating a lower-level failure with context. - Avoid generic wrappers like
fmt.Errorf("failed to X: %w", err)unless you add recovery guidance.
Suggestion Text Checklist
Every suggestion should:
- Explain what to change
- Include a minimal valid YAML/code example
- Use ✓/✗ markers when ambiguity is likely
Example:
Use one supported engine.
✓ Example:
engine: copilot
✗ Avoid:
engine: unknown
YAML Example Guidelines
- Keep examples minimal and valid YAML
- Use real frontmatter field names
- Quote only when YAML requires it
- Prefer 2-space indentation
Good Examples
These examples follow the template and provide actionable guidance:
Time Delta Validation (from time_delta.go)
return nil, fmt.Errorf("invalid time delta format: +%s. Expected format like +25h, +3d, +1w, +1mo, +1d12h30m", deltaStr)
✅ Why it's good:
- Clearly identifies the invalid input
- Lists multiple valid format examples
- Shows combined formats (+1d12h30m)
Type Validation with Example
return "", fmt.Errorf("manual-approval value must be a string, got %T. Example: manual-approval: \"production\"", val)
✅ Why it's good:
- Shows actual type received (%T)
- Provides concrete YAML example
- Uses proper YAML syntax with quotes
Enum Validation with Options
return fmt.Errorf("invalid engine: %s. Valid engines are: copilot, claude, codex, custom. Example: engine: copilot", engineID)
✅ Why it's good:
- Lists all valid options
- Provides simplest example
- Uses consistent formatting
MCP Configuration
return fmt.Errorf("tool '%s' mcp configuration must specify either 'command' or 'container'. Example:\ntools:\n %s:\n command: \"npx @my/tool\"", toolName, toolName)
✅ Why it's good:
- Explains mutual exclusivity
- Shows realistic tool name
- Formats multi-line YAML example
Bad Examples
These examples lack clarity or actionable guidance:
Too Vague
return fmt.Errorf("invalid format")
❌ Problems:
- Doesn't specify what format is invalid
- Doesn't explain expected format
- No example provided
Missing Example
return fmt.Errorf("manual-approval value must be a string")
❌ Problems:
- States requirement but no example
- User doesn't know proper YAML syntax
- Could be clearer about type received
Incomplete Information
return fmt.Errorf("invalid engine: %s", engineID)
❌ Problems:
- Doesn't list valid options
- No guidance on fixing the error
- User must search documentation
When to Include Examples
Always include examples for:
Format/Syntax Errors - Show the correct syntax
fmt.Errorf("invalid date format. Expected: YYYY-MM-DD HH:MM:SS. Example: 2024-01-15 14:30:00")Enum/Choice Fields - List all valid options
fmt.Errorf("invalid permission level: %s. Valid levels: read, write, none. Example: permissions:\n contents: read", level)Type Mismatches - Show expected type and example
fmt.Errorf("timeout-minutes must be an integer, got %T. Example: timeout-minutes: 10", value)Complex Configurations - Provide complete valid example
fmt.Errorf("invalid MCP server config. Example:\nmcp-servers:\n my-server:\n command: \"node\"\n args: [\"server.js\"]")
When Examples May Be Optional
Examples can be omitted when:
Error is from wrapped error - When wrapping another error with context
return fmt.Errorf("failed to parse configuration: %w", err)**Error is self-explanatory with clear c
Установить error-messages в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл error-messages?
Write consistent, actionable validation error messages in gh-aw.
Как установить скилл error-messages?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл error-messages запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic