SKILL.md
RFC 9457 Problem Details Author
Use this skill when the user asks to:
- return API errors over HTTP (or similar) in a structured way
- define a problem-details schema/payload
- map internal errors to HTTP status codes
- standardize error responses across handlers/services
Mandatory references (read in order)
references/nonnegotiables.mdreferences/doterr.mdreferences/clearpath.md(production code only)references/go-dt-paths.md(only if paths/files appear in metadata)references/rfc9457-package-notes.md(go-rfc9457 catalog notes)
Core requirements
- Prefer
go-rfc9457for Problem Details instead of ad-hoc maps/structs. - Do not leak internal error strings; use stable sentinels + metadata.
- Map known sentinel errors to stable
typeidentifiers and HTTP status codes. - Include only safe details in responses (no secrets, tokens, internal stack traces).
Design guidance (default)
When designing problem details:
- Define a small set of stable problem
typevalues (URIs or uri-like strings). - Use
titleas a short, stable human label; usedetailfor request-specific explanation (safe). - Use
instancewhen you have a request id / trace id / correlation id. - Add extensions/metadata keys for machine-consumable specifics (validated fields, limits, etc.).
What to deliver
When implementing:
- Provide the Problem Details builder/mapping code (often a function that accepts
errorand request context). - Provide handler examples showing how to return it consistently.
- Provide tests if requested (tests follow
references/testing.mdrules).
Self-check before final output
- No compound
if init; cond {}forms. - No ignored errors.
- Uses doterr for internal errors and go-rfc9457 for external representation.
- Problem response does not expose sensitive/internal information.