

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
12345# Backend Instructions (Go)67**Last Updated:** July 28, 202689Package-level rules live in the nearest `AGENTS.md`, for example `internal/AGENTS.md`, `internal/api/AGENTS.md`, `internal/config/AGENTS.md`, `internal/commands/AGENTS.md`, and `pkg/AGENTS.md`.1011## Style1213- Keep functions small and focused, wrap errors with context, and keep the exported surface minimal.14- Doc comments begin with the name of the identifier and stay compact: one line for the "what", plus a line or two only when the "why" cannot be inferred from the code. No issue numbers, no change history.15- Every package contains a `<package>.go` file with the license header and a short package comment.16- Run `make fmt-go` (gofmt + goimports) and `make lint-go` after edits; never hand-format indentation.1718## Package Boundaries & Filesystem1920- `pkg/*` must not import from `internal/*`. Code that needs config, entity, or database access belongs under `internal/`.21- Use the permission constants from `pkg/fs` (`fs.ModeDir`, `fs.ModeFile`, `fs.ModeConfigFile`, `fs.ModeSecretFile`) instead of literal file modes, and alias the standard library as `iofs "io/fs"` where both are needed.22- Use `filepath.Join` for filesystem paths and reserve `path.Join` for URL paths.2324## Tests2526- Every added function, including unexported helpers and helpers extracted by a refactor, needs a matching `Test<Name>` in a sibling `*_test.go`, with at least a success and a failure case.27- Group cases with `t.Run(...)` and PascalCase names such as `Success` or `InvalidRequest`.28- Prefer focused runs — `go test ./internal/<pkg> -run '<TestName>' -count=1` — over `make test-go`, which takes about 20 minutes. `make test-short` is the fast full pass, and `make reset-testdb` resets the test databases.2930## API, Config & Schema3132- Keep handlers thin, register new routes in `internal/server/routes.go`, and regenerate the documentation with `make fmt-go swag-fmt swag`. Never edit `internal/api/swagger.json` by hand.33- Declare new config options in `internal/config/options.go`, register them in `internal/config/flags.go`, and expose a getter. Confirm names with `photoprism --help`, `photoprism show config-options`, or `photoprism show config-yaml` before suggesting them.34- Schema changes need a migration in `internal/entity/migrate/`; verify with `photoprism migrations ls` and `photoprism migrations run`.35
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 |
|---|---|---|---|---|---|
| photoprism/photoprism.github/instructions/frontend.instructions.md · 40k | Copilot instructions | testlint-formatstyleagent-behaviour | 76/100 | 13 days ago | |
| photoprism/photoprismAGENTS.md · 40k | AGENTS.md | setupbuildtestlint-format+8 | 82/100 | 13 days ago | |
| photoprism/photoprisminternal/service/cluster/AGENTS.md · 40k | AGENTS.md | buildtestapi | 76/100 | 13 days ago | |
| photoprism/photoprismpkg/AGENTS.md · 40k | AGENTS.md | teststylesecurity | 55/100 | 13 days ago | |
| photoprism/photoprism.claude/CLAUDE.md · 40k | CLAUDE.md | buildtestlint-formatstyle+7 | 96/100 | 13 days ago | |
| photoprism/photoprism.github/copilot-instructions.md · 40k | Copilot instructions | buildtestlint-formatstyle+5 | 90/100 | 13 days ago | |
| photoprism/photoprismfrontend/AGENTS.md · 40k | AGENTS.md | setupteststyletesting-strategy+1 | 76/100 | 9 days ago | |
| photoprism/photoprisminternal/AGENTS.md · 40k | AGENTS.md | teststyletesting-strategy | 71/100 | 13 days ago | |
| photoprism/photoprisminternal/api/AGENTS.md · 40k | AGENTS.md | teststyletesting-strategyapi | 62/100 | 13 days ago | |
| photoprism/photoprisminternal/config/AGENTS.md · 40k | AGENTS.md | databasedo-not | 46/100 | 13 days ago | |
| photoprism/photoprisminternal/entity/migrate/AGENTS.md · 40k | AGENTS.md | testtesting-strategydatabase | 63/100 | 13 days ago | |
| photoprism/photoprisminternal/photoprism/AGENTS.md · 40k | AGENTS.md | no sections | 39/100 | today | |
| photoprism/photoprisminternal/commands/AGENTS.md · 40k | AGENTS.md | teststyle | 66/100 | 13 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 65 | Copilot instructions | buildlint-formatstylearch+4 | 100/100 | 14 days ago | |
| louislam/uptime-kuma.github/copilot-instructions.md · 90k | Copilot instructions | setupbuildtestlint-format+9 | 100/100 | 14 days ago | |
| hiyouga/LlamaFactory.github/copilot-instructions.md · 74k | Copilot instructions | setupbuildtestlint-format+5 | 97/100 | 13 days ago | |
| JCodesMore/ai-website-cloner-template.github/copilot-instructions.md · 32k | Copilot instructions | buildlint-formatstylearch+3 | 97/100 | 7 days ago | |
| nerolis-lab/nerolis-lab.github/copilot-instructions.md · 32 | Copilot instructions | setupbuildtestlint-format+11 | 96/100 | 14 days ago | |
| thangaram611/second-brain.github/copilot-instructions.md · 0 | Copilot instructions | setupteststylearch+4 | 96/100 | 14 days ago | |
| darkmatter/nixmac.github/copilot-instructions.md · 25 | Copilot instructions | setupbuildtestlint-format+8 | 96/100 | 14 days ago | |
| keycloak/keycloak.github/copilot-instructions.md · 36k | Copilot instructions | setupbuildtestlint-format+6 | 93/100 | 14 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/photoprism-photoprism-github-instructions-backend-instructions)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.