

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1# Internal/Errors Package Guidelines23## Critical Rules45### Import ONLY This Package67```go8// ✅ CORRECT9import "github.com/tphakala/birdnet-go/internal/errors"1011// ❌ DO NOT import standard errors, unless it is to avoid circular dependency12import "errors" // FORBIDDEN13```1415## Component Registration1617### Required: Register in init() (errors.go:334-348)1819```go20func init() {21 RegisterComponent("packagename", "display-name")22}23```2425### Current Components2627- birdnet, myaudio, datastore, imageprovider28- diskmanager, mqtt, weather, conf, telemetry29- birdweather, backup3031⚠️ **Unregistered components cause incorrect telemetry tagging**3233## Quick Patterns3435### Basic Error3637```go38err := errors.New(originalErr).39 Component("datastore").40 Category(errors.CategoryDatabase).41 Context("operation", "save_detection").42 Build()43```4445### Descriptive Error (Preferred)4647```go48err := errors.Newf("Wikipedia API missing 'query.pages' structure").49 Component("imageprovider").50 Category(errors.CategoryImageFetch).51 Context("operation", "parse_pages_from_response").52 Context("expected_path", "query.pages").53 Build()54```5556### Validation Error5758```go59err := errors.Newf("scientific name cannot be empty").60 Component("imageprovider").61 Category(errors.CategoryValidation).62 Build()63```6465## Categories (errors.go:23-50)6667- **Critical**: CategoryModelInit, CategoryModelLoad, CategoryConfiguration68- **Data**: CategoryDatabase, CategoryFileIO, CategoryFileParsing69- **Network**: CategoryNetwork, CategoryHTTP, CategoryRTSP70- **Service**: CategoryImageFetch, CategoryMQTTConnection, CategoryWeather71- **System**: CategoryDiskUsage, CategorySystem, CategoryProcessing7273## Troubleshooting7475### Wrong Component in Telemetry?76771. Check component is registered in init()782. Always use `.Component()` explicitly793. See README.md:436-4658081### Generic Sentry Titles?8283- Add `Context("operation", "specific_action")`84- Use descriptive messages with `errors.Newf()`85- See README.md:427-4348687### Performance Concerns?8889- Event bus handles async (2.5ns overhead when disabled)90- See README.md:569-5749192## Full Documentation9394For comprehensive details: `internal/errors/README.md`9596- Import guidelines: lines 16-3297- Context best practices: lines 163-19198- Component registration: lines 195-26599- Common patterns: lines 283-362100
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| tphakala/birdnet-go.cursor/rules/database.mdc · 1.6k | Cursor rules | databasedo-not | 45/100 | today | |
| tphakala/birdnet-go.cursor/rules/frontend.mdc · 1.6k | Cursor rules | dependenciesuido-not | 61/100 | today | |
| tphakala/birdnet-go.cursor/rules/go.mdc · 1.6k | Cursor rules | buildteststylearch+5 | 69/100 | today | |
| tphakala/birdnet-go.cursor/rules/go_test.mdc · 1.6k | Cursor rules | setupteststyletesting-strategy+1 | 56/100 | today | |
| tphakala/birdnet-goAGENTS.md · 1.6k | AGENTS.md | teststylegitdo-not+1 | 78/100 | today | |
| tphakala/birdnet-goCLAUDE.md · 1.6k | CLAUDE.md | buildtestlint-formatstyle+8 | 100/100 | today | |
| tphakala/birdnet-gofrontend/CLAUDE.md · 1.6k | CLAUDE.md | setuptestlint-formatstyle+7 | 84/100 | today | |
| tphakala/birdnet-gofrontend/src/lib/desktop/components/CLAUDE.md · 1.6k | CLAUDE.md | teststylearchui | 70/100 | today | |
| tphakala/birdnet-gofrontend/src/lib/desktop/components/ui/CLAUDE.md · 1.6k | CLAUDE.md | styleuidocs | 54/100 | today | |
| tphakala/birdnet-gofrontend/src/lib/desktop/features/settings/CLAUDE.md · 1.6k | CLAUDE.md | buildstylearchtypes+2 | 66/100 | today | |
| tphakala/birdnet-gofrontend/static/messages/CLAUDE.md · 1.6k | CLAUDE.md | archuido-notagent-behaviour | 67/100 | today | |
| tphakala/birdnet-gofrontend/tools/CLAUDE.md · 1.6k | CLAUDE.md | no sections | 65/100 | today | |
| tphakala/birdnet-gointernal/CLAUDE.md · 1.6k | CLAUDE.md | buildteststylearch+5 | 88/100 | today | |
| tphakala/birdnet-gointernal/api/v2/CLAUDE.md · 1.6k | CLAUDE.md | teststylesecurityapi+1 | 84/100 | today |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| stacklok/toolhiveCLAUDE.md · 2.0k | CLAUDE.md | buildteststylearch+4 | 100/100 | 14 days ago | |
| Adit-Jain-srm/NightmareNetCLAUDE.md · 46 | CLAUDE.md | buildtestlint-formatstyle+6 | 100/100 | 14 days ago | |
| microsoft/playwrightCLAUDE.md · 95k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 7 days ago | |
| nimbalyst/nimbalystpackages/android/CLAUDE.md · 1.5k | CLAUDE.md | setupbuildstylearch+2 | 100/100 | 14 days ago | |
| dotCMS/corecore-web/CLAUDE.md · 949 | CLAUDE.md | teststylearchtesting-strategy+3 | 100/100 | 14 days ago | |
| tphakala/birdnet-goCLAUDE.md · 1.6k | CLAUDE.md | buildtestlint-formatstyle+8 | 100/100 | today | |
| tyrchen/geektime-bootcamp-aiw7/genslides/backend/CLAUDE.md · 230 | CLAUDE.md | testlint-formatstylearch+6 | 100/100 | 9 days ago | |
| bagisto/bagistoCLAUDE.md · 28k | CLAUDE.md | setupbuildteststyle+5 | 100/100 | 7 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/tphakala-birdnet-go-internal-errors-claude)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.