error-messages
Skill5.3k starsChanged 6 months agoMITView on GitHub
Write consistent, actionable validation error messages in gh-aw.
2 other projects use a version of this, 2 of them edited.
Trending
Quiet since March.thin dataabout the whole repository
Most recently taken up by
- github/gh-aw-threat-detectionedited, first seen Sep 18, 2026
- github/gh-aw-harnessedited, first seen May 26, 2026
Who's talking about github/gh-aw
- A Hacker News story“GitHub Agentic Workflows”Hacker News · Feb 11, 2026 · 2 points
- @kcieslak.io“We see that a lot in our OSSed AW repository which uses fully agentic development - github.com/github/gh-aw …”Bluesky · Mar 24, 2026 · 1 likes
- @github-trending.bsky.social“🚀 Skyrocketing! 🚀 (200+ new stars) 📦 github / gh-aw ⭐ 2,482 (+213) 🗒 Go GitHub Agentic Workflows”Bluesky · Feb 15, 2026
The biggest 3 of 3 mentions linking to the repository that our crawl found. Each line is their own headline.
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- github/gh-aw-threat-detection★ 1595% same
- github/gh-aw-harness★ 395% same
Wrote their own version · 0
None found.
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 repository108 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/src/content/docs/engines/claude.mdCLAUDE.md
- pkg/workflow/data/engines/claude.mdCLAUDE.md
- .squad/templates/copilot-instructions.mdCopilot instructions
- playwright-cliSkill
- agentic-workflowsSkill
- awf-release-integratorSkill
- checkout-credential-reviewSkill
- console-renderingSkill
- copilot-reviewSkill
- create-canvasSkill
- custom-agentsSkill
- custom-engine-implementationSkill
- debugging-workflowsSkill
- developer-code-organizationSkill
- developer-internalsSkill
- developer-releaseSkill
- developer-securitySkill
- developerSkill
- documentationSkill
- error-pattern-safetySkill
- error-recovery-patternsSkill
- gh-agent-sessionSkill
- gh-agent-taskSkill
- github-copilot-agent-tips-and-tricksSkill
- github-discussion-querySkill
- github-issue-querySkill
- github-labels-querySkill
- github-mcp-serverSkill
- github-pr-querySkill
- github-scriptSkill
- github-workflows-querySkill
- go-codemodSkill
- go-lintersSkill
- http-mcp-headersSkill
- javascript-refactoringSkill
- jqschemaSkill
- messagesSkill
- npmSkill
- open-pull-requestSkill
- operational-value-designerSkill
- optimize-agentic-workflowSkill
- otel-queriesSkill
- pr-finisherSkill
- prompt-token-efficiencySkill
- pr-to-go-linterSkill
- reportingSkill
- resolve-merge-conflictsSkill
- restricted-tool-triageSkill
- review-agentic-workflowsSkill
- security-advisory-compat-enforcerSkill
- sergo-examplesSkill
- skillz-integrationSkill
- ssl-skill-normalizerSkill
- temporary-id-safe-outputSkill
- workflow-step-summariesSkill
- GitHub Agentic WorkflowsSkill
- {skill-name}Skill
- agent-collaborationSkill
- agent-conductSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
22 rules. About 0 are common, 15 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
Use this format for gh-aw validation errors.
- Distinctive: line 24
Avoid standalone negative wording.
- Very specific: line 41
Use NewValidationError(field, value, reason, suggestion) in *_validation.go logic.
- Very specific: line 42
Use field for the exact config path
- Very specific: line 43
Use reason for what failed
- Very specific: line 44
Use suggestion for an actionable fix with an example
- Very specific: line 45
Use fmt.Errorf for operational/wrapping errors (%w) where you are propagating a lower-level failure with context.
- Very specific: line 46
Avoid generic wrappers like fmt.Errorf("failed to X: %w", err) unless you add recovery guidance.
- Distinctive: line 54
Use ✓/✗ markers when ambiguity is likely
- Distinctive: line 69
Keep examples minimal and valid YAML
- Distinctive: line 70
Use real frontmatter field names
- Distinctive: line 142
No guidance on fixing the error
- Distinctive: line 147
Always include examples for:
- Distinctive: line 173
Error is from wrapped error: - When wrapping another error with context
- Distinctive: line 204
Use proper YAML syntax in examples:
- Distinctive: line 214
Use the same field names as in YAML:
- Distinctive: line 225
All improved error messages should have corresponding tests:
- Distinctive: line 245
When improving existing error messages:
- Distinctive: line 249
Apply template: - Add what's wrong + expected + example
- Distinctive: line 250
Add tests: - Verify error message content
- Distinctive: line 251
Update comments: - Document the validation logic
- Distinctive: line 311
When writing error messages, consider:
≈ “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.
Files
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: unknownYAML 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 context
return fmt.Errorf("duplicate unit '%s' in time delta: +%s", unit, deltaStr) - Error points to specific documentation
return fmt.Errorf("unsupported feature. See https://docs.example.com/features")
Formatting Guidelines
Use Type Verbs for Dynamic Content
%s- strings%d- integers%T- type of value%v- general value%w- wrapped errors
Multi-line Examples
For YAML configuration examples spanning multiple lines:
fmt.Errorf("invalid config. Example:\ntools:\n github:\n mode: \"remote\"")Quoting in Examples
Use proper YAML syntax in examples:
// Good - shows quotes when needed
fmt.Errorf("Example: name: \"my-workflow\"")
// Good - shows no quotes for simple values
fmt.Errorf("Example: timeout-minutes: 10")Consistent Terminology
Use the same field names as in YAML:
// Good - matches YAML field name
fmt.Errorf("timeout-minutes must be positive")
// Bad - uses different name
fmt.Errorf("timeout must be positive")Error Message Testing
All improved error messages should have corresponding tests:
func TestErrorMessageQuality(t *testing.T) {
err := validateSomething(invalidInput)
require.Error(t, err)
// Error should explain what's wrong
assert.Contains(t, err.Error(), "invalid")
// Error should include expected format or values
assert.Contains(t, err.Error(), "Expected")
// Error should include example
assert.Contains(t, err.Error(), "Example:")
}Migration Strategy
When improving existing error messages:
- Identify the error - Find validation error that lacks clarity
- Analyze context - Understand what's being validated
- Apply template - Add what's wrong + expected + example
- Add tests - Verify error message content
- Update comments - Document the validation logic
Examples by Category
Format Validation
// Time deltas
fmt.Errorf("invalid time delta format: +%s. Expected format like +25h, +3d, +1w, +1mo, +1d12h30m", input)
// Dates
fmt.Errorf("invalid date format: %s. Expected: YYYY-MM-DD or relative like -1w. Example: 2024-01-15 or -7d", input)
// URLs
fmt.Errorf("invalid URL format: %s. Expected: https:// URL. Example: https://api.example.com", input)Type Validation
// Boolean expected
fmt.Errorf("read-only must be a boolean, got %T. Example: read-only: true", value)
// String expected
fmt.Errorf("workflow name must be a string, got %T. Example: name: \"my-workflow\"", value)
// Object expected
fmt.Errorf("permissions must be an object, got %T. Example: permissions:\n contents: read", value)Choice/Enum Validation
// Engine selection
fmt.Errorf("invalid engine: %s. Valid engines: copilot, claude, codex, custom. Example: engine: copilot", id)
// Permission levels
fmt.Errorf("invalid permission level: %s. Valid levels: read, write, none. Example: contents: read", level)
// Tool modes
fmt.Errorf("invalid mode: %s. Valid modes: local, remote. Example: mode: \"remote\"", mode)Configuration Validation
// Missing required field
fmt.Errorf("tool '%s' missing required 'command' field. Example:\ntools:\n %s:\n command: \"node server.js\"", name, name)
// Mutually exclusive fields
fmt.Errorf("cannot specify both 'command' and 'container'. Choose one. Example: command: \"node server.js\"")
// Invalid combination
fmt.Errorf("http MCP servers cannot use 'container' field. Example:\ntools:\n my-http:\n type: http\n url: \"https://api.example.com\"")References
- Excellent example to follow:
pkg/workflow/time_delta.go - Pattern inspiration: Go standard library error messages
- Testing examples:
pkg/workflow/*_test.go
Tools
When writing error messages, consider:
- The user's perspective (what do they need to fix it?)
- The context (where in the workflow is the error?)
- The documentation (should we reference specific docs?)
- The complexity (is multi-line example needed?)
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.

