RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/AGENTS.md/photoprism/photoprism

AGENTS.md

internal/AGENTS.md
AGENTS.md

Quality

71/100

Scores the file, not the repository.

Length

480 words

6 headings · 0 code blocks

Repository

40k

— · pushed 0 days ago

Last changed

2 days ago

First indexed 2 days ago.
photoprism/photoprism/internal/AGENTS.mdRawGitHub
1# Internal Go Guidelines
2 
3**Last Updated:** April 9, 2026
4 
5This file applies to `internal/` and defers subtree-specific rules to the narrower guides under `internal/api/`, `internal/config/`, `internal/commands/`, `internal/photoprism/`, and `internal/service/cluster/`.
6 
7## Internal Linting
8 
9- Run `make lint-go` after Go changes; for focused work, prefer `golangci-lint run ./internal/<pkg>/...`.
10 
11## Logging, Naming & Status
12 
13- When adding GORM struct fields with uppercase abbreviations such as `LabelNSFW`, `UserID`, or `URLHash`, set an explicit `gorm:"column:<name>"` tag so column names stay stable.
14- Use the shared logger via the package-level `log` variable backed by `event.Log`; avoid `fmt.Print*` and ad-hoc loggers.
15- In human-readable log text, prefer `instance` and `service`; reserve `node` for contract-bound names such as `/cluster/nodes`, `Node*`, and `PHOTOPRISM_NODE_*`.
16- End every `event.Audit*` slice with exactly one status token from `pkg/log/status`, such as `status.Succeeded`, `status.Failed`, or `status.Denied`.
17- When the outcome should be a sanitized error string, use `status.Error(err)` instead of hand-building it.
18 
19## Internal Tests & Fixtures
20 
21- Keep Go scratch work inside `internal/...`; Go rejects imports from `internal/` when helpers live under paths such as `/tmp`.
22- Heavy packages such as `internal/entity` and `internal/photoprism` run migrations and fixtures; expect slower first runs and narrow them with `-run`.
23- For database updates, prefer `entity.Values` over raw `map[string]interface{}`.
24- When adding persistent fixtures, generate IDs with `rnd.GenerateUID(...)` and the matching prefix instead of inventing manual strings.
25- Prefer `config.NewMinimalTestConfig(t.TempDir())` for filesystem or config scaffolding and `config.NewMinimalTestConfigWithDb("<name>", t.TempDir())` for isolated SQLite schemas.
26- `internal/config` test helpers now auto-discover the repository `assets/` directory; do not set `PHOTOPRISM_ASSETS_PATH` manually in `init()` unless you truly have a non-standard layout.
27- Hub API traffic is disabled in tests by default via `hub.ApplyTestConfig()`; opt back in with `PHOTOPRISM_TEST_HUB=test`.
28- Avoid `config.TestConfig()` in new tests unless you need the fully seeded singleton fixture set; tests that write to Originals or Import should use isolated minimal configs plus `conf.CreateDirectories()`.
29- `config.NewTestConfig("<pkg>")` defaults to SQLite with a per-suite DSN such as `.<pkg>.db`; do not assert an empty DSN, and clean up captured DSNs with `t.Cleanup(...)` if needed.
30- `NewTestConfig("<pkg>")` already calls `InitializeTestData()`. If you build a custom config, call `c.InitializeTestData()` and optionally `c.AssertTestData(t)` so Originals, Import, cache, and temp exist.
31- `PhotoFixtures.Get()` and similar helpers return value copies; re-query with helpers such as `entity.FindPhoto(...)` when a test needs the persisted row with associations.
32- Reuse shared `Example*` constants for illustrative credentials in tests and docs.
33 
34## Focused Internal Test Runs
35 
36- Thumbnails: `go test ./internal/thumb/... -count=1`
37- FFmpeg command builders: `go test ./internal/ffmpeg -run 'Remux|Transcode|Extract' -count=1`
38 
39## FFmpeg Hardware Gating
40 
41- Do not run GPU or hardware encoder integrations in CI by default; gate them with `PHOTOPRISM_FFMPEG_ENCODER` set to `vaapi`, `intel`, or `nvidia`.
42- Keep negative-path ffmpeg tests fast and always runnable: missing ffmpeg should fail immediately, and unwritable destinations should fail without creating files.
43- When hardware is unavailable, prefer command-string assertions; enable full hardware runs locally only when a device is configured.
44 

Commands it names

  • make lint-go
  • node
  • go test ./internal/thumb/... -count=1
  • go test ./internal/ffmpeg -run 'Remux|Transcode|Extract' -count=1

Sections

  • Internal Go Guidelines
  • Internal Linting
  • Logging, Naming & Status
  • Internal Tests & Fixtures
  • Focused Internal Test Runs
  • FFmpeg Hardware Gating

What it covers

testcode-styletesting-strategy

Stack — with the evidence

go

(1.00)

eslint

(1.00)

ai-agent

(0.90)

vue

(0.70)

vite

(0.70)

vitest

(0.70)

javascript

(0.60)

docker

(0.60)

github-actions

(0.60)

Format

AGENTS.md

A plain-markdown README for coding agents, deliberately unopinionated: no frontmatter, no globs, no vendor keys. That minimalism is why it became the one file a dozen different agents will read, and why it carries the least per-file targeting power of any format here.

What the corpus says about it

Repository

Owner
photoprism
Language
—
License
—
Archived
no

All configs in this repo

Also in photoprism/photoprism

Diff this repo’s formats

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?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
photoprism/photoprisminternal/config/AGENTS.md · 40kAGENTS.mdgoeslint+7databasedo-not46/1002 days ago
photoprism/photoprisminternal/entity/migrate/AGENTS.md · 40kAGENTS.mdgoeslint+7testtesting-strategydatabase63/1002 days ago
photoprism/photoprisminternal/photoprism/AGENTS.md · 40kAGENTS.mdgoeslint+7no sections39/1002 days ago
photoprism/photoprisminternal/service/cluster/AGENTS.md · 40kAGENTS.mdgoeslint+7buildtestapi76/1002 days ago
photoprism/photoprismpkg/AGENTS.md · 40kAGENTS.mdgoeslint+7teststylesecurity55/1002 days ago
photoprism/photoprisminternal/commands/AGENTS.md · 40kAGENTS.mdgoeslint+7teststyle66/1002 days ago
photoprism/photoprism.claude/CLAUDE.md · 40kCLAUDE.mdgoeslint+7buildtestlint-formatstyle+796/1002 days ago
photoprism/photoprism.github/copilot-instructions.md · 40kCopilot instructionsgoeslint+7buildtestlint-formatstyle+590/1002 days ago
photoprism/photoprism.github/instructions/backend.instructions.md · 40kCopilot instructionsgoeslint+7testlint-formatstyletypes+483/1002 days ago
photoprism/photoprism.github/instructions/frontend.instructions.md · 40kCopilot instructionsgoeslint+7testlint-formatstyleagent-behaviour76/1002 days ago
photoprism/photoprismAGENTS.md · 40kAGENTS.mdgoeslint+8setupbuildtestlint-format+882/1002 days ago
photoprism/photoprismfrontend/AGENTS.md · 40kAGENTS.mdgovitest+7setupteststyletesting-strategy+176/1002 days ago
photoprism/photoprisminternal/api/AGENTS.md · 40kAGENTS.mdgoeslint+7teststyletesting-strategyapi62/1002 days ago
Diff against internal/config/AGENTS.md Diff against internal/entity/migrate/AGENTS.md Diff against internal/photoprism/AGENTS.md Diff against internal/service/cluster/AGENTS.md Diff against pkg/AGENTS.md Diff against internal/commands/AGENTS.md Diff against .claude/CLAUDE.md Diff against .github/copilot-instructions.md Diff against .github/instructions/backend.instructions.md Diff against .github/instructions/frontend.instructions.md Diff against AGENTS.md Diff against frontend/AGENTS.md Diff against internal/api/AGENTS.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
trick77/agents-md-syncAGENTS.md · 2AGENTS.mdtypescriptnode+4setupbuildteststyle+5100/1003 days ago
SkeneTechnologies/skene-cookbookAGENTS.md · 51AGENTS.mdpythoneslint+4setupbuildtestlint-format+7100/1002 days ago
duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70AGENTS.mdtypescriptjavascript+5buildteststylearch+3100/1003 days ago
mui/material-uiAGENTS.md · 99kAGENTS.mdtypescriptjavascript+13setupbuildtestlint-format+9100/1003 days ago
n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199kAGENTS.mdtypescriptlangchain+16buildteststylearch+3100/1003 days ago
TryGhost/Ghoste2e/AGENTS.md · 55kAGENTS.mdtypescriptjavascript+12setupteststylearch+2100/1003 days ago
code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 67kAGENTS.mdtypescriptbun+10setupbuildtestlint-format+6100/1002 days ago
ethereum/go-ethereumAGENTS.md · 51kAGENTS.mdgodocker+1buildtestlint-formatgit+1100/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack