errors
Skill4 starsChanged 2 months agoMITView on GitHub
Define and register error types for a context. Use when adding new domain or application errors. Use this skill whenever you need custom error types with HTTP status codes, error codes, and frontend translations. Dispatch hub — routes to typescript/go variants by file extension.
Files
Errors
Vocabulary of what can go wrong in the business. DomainErrors are invariant violations raised by entities and value objects (INVALID_STATUS_TRANSITION, PROFANE_COMMENT). ApplicationErrors are orchestration failures raised by use cases and handlers (VIDEO_NOT_FOUND, UNAUTHORIZED). Each carries a code, HTTP status, and i18n key — never a free-form string.
Architecture (identical across both languages)
Core defines a runtime registry mapping error-code → HTTP-status plus a register* function. Each context plugs in its own codes at startup. Core never imports from contexts — adding a new context-specific code means touching the context's errors/ file, never the framework.
| TypeScript | Go | |
| Register fn (in core) | registerErrorCodes(codes) | RegisterErrorCodes(map) |
| Per-context call site | module-load side-effect at bottom of <ctx>/errors/index.ts | init() in <ctx>/errors/codes.go |
| Side-effect trigger | import './errors' in <ctx>/registry.ts | anonymous _ "…/errors" import in <ctx>/module.go |
| Status lookup | GlobalErrorMapper[code] | MapErrorToHTTP middleware |
The shape and idioms of this primitive differ per backend language; the lang-specific playbooks below carry the concrete rules, code, and bad practices.
Language variants
| Backend | Playbook | Registry |
TypeScript — packages/api/typescript/ | typescript/SKILL.md | typescript/registry.yaml |
Go — packages/api/go/ | go/SKILL.md | go/registry.yaml |
How dispatch works
scripts/review.ts infers the language from the file extension (.ts / .go) and loads the matching <lang>/registry.yaml. The CLI scaffolder takes a --lang flag (--lang=typescript / --lang=go) or infers it from cwd. When editing or reviewing code, open the lang playbook matching the file you're touching — patterns and bad practices are coded per-language (e.g. ERR-GO-01).
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- LedgerHQ/ledger-live★ 624same name
- ayrshare/ayrshare-social-media-api-claude-plugin★ 19same name
- mr-ske1r/1c-ai-devstart★ 16same name
- aihu-project/aihu★ 4same name
- VectorLabAU/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 repository45 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- agentSkill
- bounded-contextSkill
- clean-branchSkill
- commitSkill
- componentSkill
- controllerSkill
- db-modellingSkill
- ddd-modelingSkill
- ddd-specSkill
- design-systemSkill
- desktop-shellSkill
- e2eSkill
- entitySkill
- enumSkill
- eventSkill
- formSkill
- grill-with-docsSkill
- handlerSkill
- handoffSkill
- middlewareSkill
- migrateSkill
- prdSkill
- primitiveSkill
- projectionSkill
- projectorSkill
- querySkill
- repositorySkill
- reviewSkill
- routeSkill
- saas-researchSkill
- schedulerSkill
- schemaSkill
- sdkSkill
- serviceSkill
- spec-reviewSkill
- storeSkill
- storybookSkill
- task-breakdownSkill
- testSkill
- trace-analysisSkill
- ui-compositionSkill
- usecaseSkill
- user-storiesSkill
- value-objectSkill
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.

