projx / go
CLAUDE.md71 starsChanged 4 months agoMITView on GitHub
Stack-scoped notes. The root ../CLAUDE.md carries cross-cutting standards — read both, they compose. This directory is a projx template: a working backend whose own suite must stay green on the projx repo (root §"Per-template gates") and the source the CLI copies into scaffolded projects. It ships the same runtime surface as fastify//express/ (auto-CRUD, request_id envelope, soft-delete, lifecycle hooks) with Go idioms. main.go carries // projx-anchor: markers — imports, entity-imports, entity-registrations, plugins. gen entity and --auth=go insert relative to these; keep…
In this repository15 other files it gives its agents.
- admin-panel/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- cli/CLAUDE.mdCLAUDE.md
- e2e/CLAUDE.mdCLAUDE.md
- express/CLAUDE.mdCLAUDE.md
- fastapi/CLAUDE.mdCLAUDE.md
- fastify/CLAUDE.mdCLAUDE.md
- infra/CLAUDE.mdCLAUDE.md
- laravel/CLAUDE.mdCLAUDE.md
- mobile/CLAUDE.mdCLAUDE.md
- nextjs/CLAUDE.mdCLAUDE.md
- rust/CLAUDE.mdCLAUDE.md
- scripts/CLAUDE.mdCLAUDE.md
- vitejs/CLAUDE.mdCLAUDE.md
- projxSkill
The file
We split this CLAUDE.md into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
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
- Very specific: line 48
entneedsgo generate ./ent/...thengo mod tidy: before build (schema-as-code emits the client).
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.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.
Files
go — Go / Chi backend (projx template)
Stack-scoped notes. The root
../CLAUDE.mdcarries cross-cutting standards — read both, they compose.This directory is a projx template: a working backend whose own suite must stay green on the projx repo (root §"Per-template gates") and the source the CLI copies into scaffolded projects. It ships the same runtime surface as
fastify//express/(auto-CRUD, request_id envelope, soft-delete, lifecycle hooks) with Go idioms.
Stack
- Language — Go (module
projx.local/go; real module path is rewritten at scaffold time) - Router — Chi (
github.com/go-chi/chi/v5) - ORM / DB — GORM + Postgres (default; alternates
sqlc,entviaaddons/orms/<orm>/) - Auth — JWT verifier (HS256 shared-secret / RS256 JWKS),
internal/auth - Config — DB-backed encrypted
service_configs(internal/serviceconfig), env bootstrap-only - Test —
go test -race+sqlmockfor unit, real Postgres behindtesting.Short()for integration - Logging —
log/slogJSON + access-log middleware,request_idcorrelation
Layout
| Path | What it holds |
main.go | Chi server boot; middleware order requestid → logging → cors → recoverer; 4 anchors |
internal/apperr/ | AppError types + middleware: {detail, request_id} envelope, FromDB pg→status |
internal/auth/ | verifier.go (alg-confusion-guarded), middleware.go (Authenticate / AuthzRequire*) |
internal/cors/ | CORS middleware, CORS_ALLOW_ORIGINS |
internal/serviceconfig/ | AES-256-GCM reader, cross-language wire-format (iv‖tag‖ct), 10-min TTL cache |
internal/ratelimit/ | Per-user token bucket + X-RateLimit-* / Retry-After headers (NOT IP-keyed) |
internal/entities/ | types.go, registry.go, auto_routes.go, query.go, reflectutil.go |
internal/posts/ | Example Post entity using the registry |
internal/sync/ | /api/v1/_meta/schemas emitter (GORM schema parse, hidden-field filtering) |
internal/{db,health,httputil,envutil,logging,requestid,uuid}/ | Connection pool, health probes, helpers |
scripts/check-coverage.sh | Coverage gate (≥80%) |
Anchors
main.go carries // projx-anchor: markers — imports, entity-imports, entity-registrations, plugins. gen entity and --auth=go insert relative to these; keep them stable and at matching positions to fastify/express.
ORM addons
GORM is the base. sqlc + ent live at ../addons/orms/<orm>/. Shared adapter machinery (auto_routes, apperr) is deduped under ../addons/orms/_shared/. All three preserve the same auto-route contract (pagination, equality filter, ILIKE search, order_by with - desc, bulk ops, lifecycle hooks). BulkDelete returns (affected, error) so the handler maps 0-affected → 404.
Quality gates (root §"Per-template gates")
gofmt -l . (clean) → golangci-lint run ./... (incl. goimports; go vet runs inside) → go test -race -coverprofile=coverage.out ./... → bash scripts/check-coverage.sh (≥80%) → govulncheck ./.... Green or not done. Locally: bash ../scripts/ci-local.sh go.
Things that bite
- Module path is
projx.local/goin the template but rewritten to the user's module at scaffold time —gen entityreads it fromgo.mod, never hardcode it. entneedsgo generate ./ent/...thengo mod tidybefore build (schema-as-code emits the client).setup.shdoes this; CI has a drift gate.internal/authis not mounted globally — it's reserved for--auth=goto mount per-router. The base only constructs the verifier whenJWT_*env is set.- Runtime creds are DB-backed (
service_configs), env is bootstrap-only — never readJWT_SECRETat request time, go throughserviceconfig.
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.

