projx / infra
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: the IaC + deploy plumbing copied into scaffolded projects. It targets AWS via Terraform and supports two runtimes — EKS (the k8s/ path) and EC2 + Docker Compose (the compose/ path). Run via scripts/ci-local.sh infra section and .githooks/pre-commit on staged *.tf: terraform fmt -recursive → terraform validate → tflint (config in `
- Reads credentials
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
- go/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 39
Run via scripts/ci-local.sh infra section and .githooks/pre-commit on staged *.tf:
≈ “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
infra — Terraform / AWS infrastructure (projx template)
Stack-scoped notes. The root
../CLAUDE.mdcarries cross-cutting standards — read both, they compose.This directory is a projx template: the IaC + deploy plumbing copied into scaffolded projects. It targets AWS via Terraform and supports two runtimes — EKS (the
k8s/path) and EC2 + Docker Compose (thecompose/path).
Stack
- IaC — Terraform
>= 1.11.0 - Providers — AWS
~> 5.95, Helm~> 3.1, Kubernetes~> 3.0, random~> 3.8 - Cloud — AWS; RDS Postgres; ECR; EKS or EC2 + Compose
- Identity — Keycloak (provisioned in
stack/k8s/keycloak.tf+environments/keycloak/) - CI/CD — AWS CodeBuild buildspecs in
cicd/ - Lint —
tflint(stack/.tflint.hcl)
Layout
| Path | What it holds |
stack/*.tf | Root config: versions, providers, backend, variables, locals, network, rds, eks, deployment, monitoring, cicd, outputs |
stack/k8s/ | EKS path: apps, db-bootstrap, ingress, keycloak, scaling |
stack/compose/ | EC2 + Docker Compose path: main, variables, outputs, user-data.sh.tftpl |
stack/.tflint.hcl | tflint config |
bin/ | tf, plan, apply, destroy, output — env-aware wrappers |
environments/ | dev.tfvars, staging.tfvars, prod.tfvars, keycloak/; generated <env>.tfplan |
cicd/ | buildspec.{backend,frontend,infra,rollback}.yml |
scripts/ | keep-recent-images.sh, rollback-compose.sh, setup-ssl.sh |
Conventions
- One run = one environment, via
bin/tf <command> <env>(plan/apply/destroy/output/exec; env ∈dev/staging/prod). The wrapper runsterraform initthen the command with-var-file=../environments/<env>.tfvars, saving plans toenvironments/<env>.tfplan. This stack uses var-files per env, notterraform workspace. - Secrets never in code — runtime creds resolve at boot, not committed plaintext.
.env.<env>files are gitignored (and excluded from the CLI copy). - Variables carry
description+type; tag every resource (Project,Environment,ManagedBy). - Destructive resources (RDS, KMS) get
lifecycle { prevent_destroy = true }in prod. - App source dirs are resolved, never hard-coded (root
../CLAUDE.md§"Never hard-code a component directory"). The backend/frontend CodeBuildFOLDER_PATHchange-detector and thedocker buildcontext readvar.backend_source_dir/var.frontend_source_dir(defaultsbackend/frontend, overridden per scaffold by the projx-renderedstack/projx.auto.tfvars); the backend/frontend buildspecs are referenced viafile("${path.module}/../cicd/…")so a renamedinfra/dir still resolves. Don't reintroduce literalfastapi/frontendbuild contexts.
Quality gates
Run via scripts/ci-local.sh infra section and .githooks/pre-commit on staged *.tf:
terraform fmt -recursive → terraform validate → tflint (config in stack/.tflint.hcl) → review bin/tf plan <env> before bin/tf apply <env>.
terraform validate needs providers initialized (terraform init -backend=false at minimum). Nginx serving config is validated separately by scripts/validate-nginx-config.sh.
Things that bite
- A reviewed plan is mandatory before apply — never
bin/tf applyan unreviewed diff againststaging/prod. prevent_destroyblocking a destroy is the guard working, not a bug — don't disable it as a shortcut.
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.

