agentleFS
thunder-idthunder-id/thunderid/backend/AGENTS.md

thunderid / backend

AGENTS.md588 starsChanged 7 months agoApache-2.0View on GitHub

Read with the root AGENTS.md. The backend is a Go application under backend/ (module github.com/thunder-id/thunderid): domain packages under backend/internal/, entry points under backend/cmd/, public packages under backend/pkg/. For the canonical, deeper reference (flat package/file layout, export rules, logging), see the Backend Development overview.

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository5 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read with the root AGENTS.md.

    line 3
  2. Distinctive:

    Ensure all identity-related code aligns with relevant RFC specifications.

    line 14

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Backend — Agent Guide

Read with the root AGENTS.md. The backend is a Go application under backend/ (module github.com/thunder-id/thunderid): domain packages under backend/internal/, entry points under backend/cmd/, public packages under backend/pkg/.

For the canonical, deeper reference (flat package/file layout, export rules, logging), see the Backend Development overview.

When to Load Other Guides

  • Touching store.go, schema, or queries → read .agent/skills/db/SKILL.md.
  • Changing any interface → regenerate mocks with make mockery. CI's verify_mocks job fails if mocks are out of sync. Never hand-edit mock files.

Conventions

  • Ensure all identity-related code aligns with relevant RFC specifications.
  • Declarative resource attributes use camelCase, matching the REST API. The yaml struct tag must use the same camelCase name as the field's json tag (for example yaml:"ouId", not yaml:"ou_id"). This does not apply to non-declarative YAML such as deployment.yaml server config, or to json tags for protocol payloads (OAuth, DCR) that follow their own RFC conventions.
  • Logging: use the log package from internal/system and pass the request context.Context first so entries carry the trace ID; avoid PII. See the overview for the full conventions (non-request contexts, MaskString).
  • Cryptographic operations (encrypt/decrypt/sign/verify) must go through the injected providers.RuntimeCryptoProvider, not internal/system/cryptolib directly. cryptolib is a low-level primitives package meant to be wrapped by the default key manager provider (internal/system/kmprovider/defaultkm); other packages should depend on the RuntimeCryptoProvider interface so alternate key manager providers stay swappable.
  • JWE "alg"/"enc" validation (e.g. checking a configured algorithm is supported) must use jwe.JWEServiceInterface's SupportedKeyEncryptionAlgorithms() / SupportedContentEncryptionAlgorithms() methods, not ad-hoc calls to the crypto provider or hardcoded algorithm lists.

Test Selection

  • Inner loop:
    • service / store / API handler change → make test_unit first.
    • DB or API-contract change → also add make test_integration (filter with RUN="TestName" or PACKAGE="pkg/path").
  • Final gate: make test_unit + make test_integration, or make pr_checks before opening a PR.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.