Skip to content

Commit 648bd2e

Browse files
mitchdowneygithub-actions[bot]
authored andcommitted
chore(llm): sync .llm/exports from .cursor
1 parent e154c4c commit 648bd2e

26 files changed

Lines changed: 630 additions & 58 deletions

File tree

.llm/exports/github-copilot/instructions/env-file-formatting.instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ applyTo:
1414
- **Non-empty values**: Use double quotes (e.g. `API_PORT="3000"`).
1515
- **Empty/unset values**: No value after `=` (e.g. `OPTIONAL_VAR=`).
1616
- **Alignment**: When creating or editing generated env files, follow variable order and grouping from canonical templates/examples in [`infra/config/env-templates/`](../../infra/config/env-templates/) and app `.env.example` files. Only values may differ.
17+
- **Order (mixed files)**: When a file mixes server-side keys with `NEXT_PUBLIC_*`, put **all non-`NEXT_PUBLIC_*` assignments first**, blank line, then all `NEXT_PUBLIC_*`. See `.llm/exports/github-copilot/skills/env-file-formatting/SKILL.md`.
1718

1819
Correct: `DATABASE_HOST="localhost"`, `EMPTY_VALUE=`. Incorrect: `DATABASE_HOST=localhost`, `EMPTY_VALUE=""`.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
description: "Converted from no-runtime-change-schema-phase.mdc"
3+
---
4+
# No Runtime Changes During Schema-Only Trust Phase
5+
6+
When implementing a **schema-only** trust/entitlement foundation:
7+
8+
## Required
9+
10+
- Add forward-only migrations, constraints, and backfill.
11+
- Add ORM entities/relations and helper constants/types.
12+
- Update migration bundle wiring and expected migration markers.
13+
14+
## Prohibited
15+
16+
- Do not modify auth middleware behavior for trust/capability gating.
17+
- Do not add route/controller allow-deny checks.
18+
- Do not expose trust settings in API responses.
19+
- Do not change web/management-web blocked-action behavior.
20+
21+
## Intent
22+
23+
Schema-only phases prepare data-model infrastructure only. Runtime behavior belongs to a separate
24+
implementation phase with dedicated integration/E2E coverage.

.llm/exports/github-copilot/skills/argocd-gitops-push/SKILL.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,36 @@ description: When adding or changing files under infra/k8s/ or sync targets for
1010

1111
When adding or changing files under:
1212

13-
- `infra/k8s/` (local, base, or app-of-apps manifests and referenced resources),
14-
- Or any path that is part of an Argo CD Application source (e.g. `infra/k8s/local/apps`, `infra/k8s/local/stack`, `infra/k8s/base/stack`, source under base, and files referenced by those via Kustomize),
15-
- Or **canonical linear migration SQL** under `infra/k8s/base/ops/source/database/linear-migrations/{app,management}/` (versioned chain applied by the linear migration runner),
16-
- Or **ops** manifests under `infra/k8s/base/ops/` (Kustomize bundles: migration CronJob SQL, scripts mounted into jobs, and related `kustomization.yaml` entries that must stay in sync with on-disk files).
13+
- **`infra/k8s/base/`** – reusable Kustomize bases per component (referenced by alpha overlays and/or your GitOps repo),
14+
- **`infra/k8s/alpha/`** – in-repo alpha app-of-apps and child overlays,
15+
- **`infra/k8s/argocd/`** – optional project manifests committed here,
16+
- Any path that is part of an **Argo CD Application** source in **your GitOps repository** (paths vary by installation),
17+
- **Canonical linear migration SQL** under `infra/k8s/base/ops/source/database/linear-migrations/{app,management}/`,
18+
- **Ops** manifests under `infra/k8s/base/ops/` (migration CronJobs, mounted scripts, `kustomization.yaml` entries).
1719

1820
## What Argo CD syncs
1921

20-
- The local app points at repo path `infra/k8s/local/apps` (see `infra/k8s/local-application.yaml`), which references `infra/k8s/local/stack` and the base stack.
21-
- The alpha app-of-apps root points at repo path `infra/k8s/alpha/apps` (see `infra/k8s/alpha-application.yaml`), which references `infra/k8s/alpha/<component>/` overlays.
22-
- Only the **remote** Git repo at the configured revision (e.g. `develop`) is used; the agent does not push. The user must push for Argo CD to see changes.
22+
- **Alpha:** Root **`infra/k8s/alpha-application.yaml`** (when applied) points at **`infra/k8s/alpha/apps`**, which references **`infra/k8s/alpha/<component>/`** overlays.
23+
- **Remote environments:** Application CRs usually live in your **GitOps repo** and reference paths/branches you configure (see [docs/development/k8s/REMOTE-K8S-GITOPS.md](../../../docs/development/k8s/REMOTE-K8S-GITOPS.md)).
24+
- Only the **remote** Git revision Argo CD tracks is authoritative; the agent does not push.
2325

2426
## When a push is required
2527

26-
Any change to files under those paths (or to canonical sources that get copied into them) means the cluster will not reflect the change until the user pushes to the branch Argo CD tracks.
28+
Any change to synced paths (or canonical sources copied into them) is invisible to the cluster until those commits are on the branch Argo CD watches (**often `develop` / `main` on the GitOps repo**).
2729

2830
## Response requirement
2931

30-
When your file-modifying work touches any of these paths, add a short **Push to Git** note in the response (e.g. before or after the verification block):
32+
When file-modifying work touches **`infra/k8s/`** or migration SQL under **`infra/k8s/base/ops/`**, add a short **Push to Git** note:
3133

32-
**Push to Git:** This change affects Argo CD–synced manifests. Push to the branch Argo CD tracks (e.g. `develop`) for the cluster to sync.
34+
**Push to Git:** This change affects Argo CD–synced manifests. Push to the branch Argo CD tracks so the cluster can sync.
3335

3436
## Version updates (GitOps)
3537

36-
- **Manifest changes** (image tags, env, resources, new deployments): Updating the manifest is the change; push is required for Argo CD (covered by the response reminder above).
37-
- **npm/package versions:** Follow the existing AGENTS.md Dependencies section; no separate version rule for GitOps.
38+
- **Manifest changes** (image tags, env, resources): push so Argo CD picks them up.
39+
- **npm/package versions:** Follow AGENTS.md Dependencies; no separate GitOps-only rule.
3840

3941
## See also
4042

41-
- [infra/k8s/INFRA-K8S.md](infra/k8s/INFRA-K8S.md) – k8s layout and local app-of-apps.
42-
- [docs/development/k8s/K3D-ARGOCD-LOCAL.md](docs/development/k8s/K3D-ARGOCD-LOCAL.md) – Local k3d + Argo CD setup.
43+
- [infra/k8s/INFRA-K8S.md](../../../infra/k8s/INFRA-K8S.md) – layout and consumption.
44+
- [docs/development/k8s/REMOTE-K8S-GITOPS.md](../../../docs/development/k8s/REMOTE-K8S-GITOPS.md) – remote cluster workflow.
45+
- [docs/development/k8s/K3D-ARGOCD-LOCAL.md](../../../docs/development/k8s/K3D-ARGOCD-LOCAL.md) – stub (local k3d removed).
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: entitlement-gating-rollout
3+
description: Roll out trust/entitlement behavior after schema foundations. Use when introducing capability checks, resolver logic, and deny contracts.
4+
---
5+
6+
7+
# Entitlement Gating Rollout
8+
9+
Use this skill for the post-foundation runtime phase.
10+
11+
## Rollout order
12+
13+
1. Add centralized entitlement resolver logic.
14+
2. Add trust-tier default policy (env/config driven).
15+
3. Apply per-user override precedence.
16+
4. Introduce capability checks in auth/controller boundaries.
17+
5. Map deny outcomes to stable API payload contracts.
18+
19+
## API deny contract
20+
21+
- Include machine-readable `code`.
22+
- Include stable `i18nKey`.
23+
- Include action path (for example renew/upgrade) when applicable.
24+
25+
## Coverage checklist
26+
27+
- All protected write/update actions use capability checks.
28+
- Stats/notifications behavior follows entitlement policy.
29+
- Management/admin edit surfaces can control overrides.
30+
- Web and management-web map denial payloads consistently.
31+
32+
## Testing expectations
33+
34+
- Integration tests for allow/deny and override precedence.
35+
- E2E tests for blocked UX and admin override effects.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: env-file-formatting
3+
description: Env file value formatting and NEXT_PUBLIC ordering. Use when adding or editing .env,
4+
.env.example, or any *.env template in the repo.
5+
---
6+
7+
8+
# Env file formatting
9+
10+
## When to use
11+
12+
When adding or editing `.env`, `.env.example`, or any `*.env` template (including
13+
`infra/config/env-templates/*.env.example`, `infra/k8s/**/source/*.env`, and `dev/env-overrides/local/*.env.example`).
14+
15+
## Rules
16+
17+
- **Non-empty values**: Double quotes. **Empty/unset**: no value after `=` (see `.llm/exports/github-copilot/instructions/env-file-formatting.instructions.md`).
18+
- **K8s `source/*.env` comments**: at most **one** env var name per `#` line.
19+
20+
## Variable order when mixing server and `NEXT_PUBLIC_*`
21+
22+
If a file defines both keys that are **not** `NEXT_PUBLIC_*` (e.g. `API_PORT`, `READINESS_*`,
23+
`NODE_ENV`, `RUNTIME_CONFIG_*`) **and** any `NEXT_PUBLIC_*`:
24+
25+
1. All non-`NEXT_PUBLIC_*` assignments first (group with section comments as needed).
26+
2. Blank line.
27+
3. All `NEXT_PUBLIC_*` keys.
28+
29+
Files that are only `NEXT_PUBLIC_*` or only server keys need no extra ordering.
30+
31+
## References
32+
33+
- [.llm/exports/github-copilot/instructions/env-file-formatting.instructions.md](../../.llm/exports/github-copilot/instructions/env-file-formatting.instructions.md)
34+
- [AGENTS.md](../../AGENTS.md) — env templates and local overrides
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: linear-baseline-gz-sync
3+
description: Regenerate committed linear baseline .sql.gz artifacts whenever app/management linear SQL migrations change.
4+
---
5+
6+
7+
# Linear Baseline GZ Sync (Metaboost)
8+
9+
Use this skill whenever you add, remove, or edit files under:
10+
11+
- `infra/k8s/base/ops/source/database/linear-migrations/app/**`
12+
- `infra/k8s/base/ops/source/database/linear-migrations/management/**`
13+
- `scripts/database/generate-linear-baseline.sh`
14+
15+
## Goal
16+
17+
Keep committed bootstrap baseline archives aligned with the canonical forward-only SQL chain.
18+
19+
## Required actions
20+
21+
1. Regenerate baseline archives from repo root:
22+
- `bash scripts/database/generate-linear-baseline.sh`
23+
2. Verify generated output is current:
24+
- `bash scripts/database/verify-linear-baseline.sh`
25+
3. Commit changed generated artifacts when they differ:
26+
- `infra/k8s/base/db/source/bootstrap/0003a_app_linear_baseline.sql.gz`
27+
- `infra/k8s/base/db/source/bootstrap/0003b_management_linear_baseline.sql.gz`
28+
29+
## Related files to keep aligned
30+
31+
- `infra/k8s/base/ops/kustomization.yaml` (migration file wiring)
32+
- `infra/k8s/base/api/source/api.env` and `infra/k8s/base/management-api/source/management-api.env` (expected migration markers)
33+
34+
## Notes
35+
36+
- Do not hand-edit `.sql.gz` archives.
37+
- Generated baseline artifacts are source-controlled and must be updated in the same PR as migration changes.

.llm/exports/github-copilot/skills/linear-db-migrations/SKILL.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@ version: 1.0.0
1010
## When to use
1111

1212
- Adding or changing files under `infra/k8s/base/db/source/`, `infra/k8s/base/ops/`, or `scripts/database/`.
13-
- Wiring DB credentials in Compose, k3d, or K8s manifests, or in env templates/examples.
13+
- Wiring DB credentials in Compose, Kubernetes manifests, or env templates/examples.
1414

1515
## Single source of truth
1616

1717
- **Canonical forward-only SQL:** `infra/k8s/base/ops/source/database/linear-migrations/app/` and `infra/k8s/base/ops/source/database/linear-migrations/management/` (ordered `0001_*.sql`, ...).
18-
- **Bootstrap init (`docker-entrypoint-initdb.d`):** `infra/k8s/base/db/source/bootstrap/` — shell steps **`0001`** / **`0002`**, generated **`0003_linear_baseline.sql.gz`** and **`0004_seed_linear_migration_history.sql`**, then **`0006_management_grants.sh`**.
18+
- **Bootstrap init (`docker-entrypoint-initdb.d`):** `infra/k8s/base/db/source/bootstrap/` — shell steps **`0001`** / **`0002`**, then **`0003_apply_linear_baselines.sh`** with generated **`0003a_app_linear_baseline.sql.gz`** / **`0003b_management_linear_baseline.sql.gz`**.
1919
- **Generated bootstrap artifacts:**
20-
- `infra/k8s/base/db/source/bootstrap/0003_linear_baseline.sql.gz`
21-
- `infra/k8s/base/db/source/bootstrap/0004_seed_linear_migration_history.sql`
20+
- `infra/k8s/base/db/source/bootstrap/0003a_app_linear_baseline.sql.gz`
21+
- `infra/k8s/base/db/source/bootstrap/0003b_management_linear_baseline.sql.gz`
2222
- Generated by scripts under `scripts/database/`; do not hand-edit.
2323

2424
## Runner and validation
2525

2626
- Apply migrations: `bash scripts/database/run-linear-migrations.sh --database app|management` (always pass `--database`; there is no default).
27-
- K8s wrapper: `bash scripts/database/run-linear-migrations-k8s.sh` (same requirement).
27+
- **Credentials:** **app** migrations use `DB_APP_MIGRATOR_USER`, `DB_APP_MIGRATOR_PASSWORD`, `DB_APP_NAME`, `DB_HOST`, and `DB_PORT`. **Management** migrations use `DB_MANAGEMENT_MIGRATOR_USER`, `DB_MANAGEMENT_MIGRATOR_PASSWORD`, `DB_MANAGEMENT_NAME`, `DB_HOST`, and `DB_PORT`. Optional: `infra/config/local/db.env` when keys are unset before sourcing.
28+
- K8s wrapper: `bash scripts/database/run-linear-migrations-k8s.sh` (`--database` required); validates the same keys from Secrets.
2829
- Validate: `bash scripts/database/validate-linear-migrations.sh` (and `--check-db` to compare on-disk checksums to `linear_migration_history` when a DB is available).
2930
- Regenerate baseline artifacts:
3031
- `bash scripts/database/generate-linear-baseline.sh`
31-
- `bash scripts/database/generate-linear-migration-history-seed.sh`
3232
- Verify generated artifacts are committed and up to date:
3333
- `bash scripts/database/verify-linear-baseline.sh`
3434
- The migration runner **creates** the `linear_migration_history` table if missing; do not rely on a dedicated SQL file for that.
@@ -40,13 +40,13 @@ version: 1.0.0
4040

4141
## Environment keys (admin vs image)
4242

43-
- **Authoritative in secrets and generated env:** `DB_APP_ADMIN_USER` / `DB_APP_ADMIN_PASSWORD`, `DB_MANAGEMENT_ADMIN_USER` / `DB_MANAGEMENT_ADMIN_PASSWORD`, plus read-only and read-write keys and `DB_APP_NAME` / `DB_MANAGEMENT_NAME` (see `infra/config/env-templates/db.env.example` and local `infra/config/local/db.env` after `scripts/local-env/setup.sh`).
44-
- The **postgres** container image still reads `POSTGRES_USER` / `POSTGRES_PASSWORD` / `POSTGRES_DB` at runtime—**map** those from the `DB_*_ADMIN_*` and `DB_APP_NAME` keys in Compose or Deployment `env`, not the reverse.
43+
- **Authoritative in secrets and generated env:** owner keys (`DB_APP_OWNER_*`, `DB_MANAGEMENT_OWNER_*`) for bootstrap, migrator keys (`DB_APP_MIGRATOR_*`, `DB_MANAGEMENT_MIGRATOR_*`) for linear migrations, plus read-write and read keys and `DB_APP_NAME` / `DB_MANAGEMENT_NAME` (see `infra/config/env-templates/db.env.example` and local `infra/config/local/db.env` after `scripts/local-env/setup.sh`).
44+
- The **postgres** container image still reads `POSTGRES_USER` / `POSTGRES_PASSWORD` / `POSTGRES_DB` at runtime—**map** those from `DB_APP_OWNER_USER` / `DB_APP_OWNER_PASSWORD` and `DB_APP_NAME` in Compose or Deployment `env`, not the reverse.
4545

4646
## Cross-repo invariants
4747

4848
- Canonical forward-only trees under `infra/k8s/base/ops/source/database/linear-migrations/`.
49-
- Generated bootstrap baseline artifacts `0003` and `0004` are machine-derived and committed.
49+
- Generated bootstrap baseline artifacts `0003a` and `0003b` are machine-derived and committed.
5050
- Same npm script naming model in root `package.json` (`db:migrate:linear:*`, `db:validate:linear`, etc.). Product-specific naming differences are expected.
5151

5252
## Documentation
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: local-docker-env-alignment
3+
description: When adding or changing preconditions, cleanup steps, or env usage for local Docker Compose, keep behavior aligned with shared infra/config/local/*.env and documented teardown flows.
4+
---
5+
6+
7+
# Local Docker Compose env alignment
8+
9+
## When to use
10+
11+
When you:
12+
13+
- Add or change **`make`** targets that touch **`infra/config/local/*.env`** or local containers (`metaboost_local_*`),
14+
- Add guards to **`local_env_clean`** / **`local_clean`**, or
15+
- Document local env setup / teardown.
16+
17+
Metaboost does **not** ship an in-repo local Kubernetes (k3d) path; cluster validation is **remote GitOps**.
18+
19+
## Do
20+
21+
- Keep **`local_env_clean`** blocked while **Docker Compose** Metaboost local containers are running (`make local_down` first).
22+
- Keep **`local_clean`** as full teardown: **`local_down`**, **`local_down_volumes`**, **`test_clean`** (and any other documented test/E2E containers).
23+
- Document that **`make local_env_setup`** and Compose share **`infra/config/local/*.env`** where applicable.
24+
25+
## Don't
26+
27+
- Reference k3d or `make local_k3d_*` (removed).
28+
29+
## Reference targets
30+
31+
- **`local_env_clean`**: Aborts if `metaboost_local_*` containers are running.
32+
- **`local_clean`**: Docker + volumes + test stack teardown.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: membership-expiry-ux-contract
3+
description: Keep expiry-related API and UX behavior consistent. Use when implementing reduced-functionality states, blocked-action modals, and renewal/upgrade navigation.
4+
---
5+
6+
7+
# Expiry UX Contract
8+
9+
Use this skill whenever account expiry or eligibility loss affects user actions.
10+
11+
## API contract
12+
13+
- Return non-alarming expiry responses.
14+
- Include `code` + `i18nKey` for deterministic UI mapping.
15+
- Include action path when users can remediate.
16+
17+
## UI contract
18+
19+
- Persistent reminder banner for reduced functionality state.
20+
- Blocked-action modal with:
21+
- dismiss
22+
- direct remediation action (renew/upgrade/contact)
23+
- Shared mapping layer for denial code -> UI message/action.
24+
25+
## Content principles
26+
27+
- Be clear and actionable.
28+
- Avoid alarming error language.
29+
- Explain reduced behavior succinctly.
30+
31+
## Consistency checks
32+
33+
- All protected surfaces consume the same deny contract.
34+
- i18n keys exist for surfaced copy.
35+
- Modal and banner behavior do not conflict.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
name: migration-readiness-marker-sync
3+
description: Keep K8s readiness migration marker env vars aligned with latest linear SQL migrations. Use when adding/changing linear migrations or readiness init checks.
4+
---
5+
6+
7+
# Migration Readiness Marker Sync (Metaboost)
8+
9+
Use this skill whenever you touch:
10+
11+
- `infra/k8s/base/ops/source/database/linear-migrations/**`
12+
- API or management-api migration wait initContainers
13+
- API or management-api K8s `source/*.env` files containing readiness migration marker vars
14+
15+
## Goal
16+
17+
Ensure startup readiness gates verify the correct latest migration marker for each DB domain.
18+
19+
## Required alignment
20+
21+
When new latest migrations are added:
22+
23+
1. Update marker env defaults:
24+
- `infra/k8s/base/api/source/api.env`:
25+
- `API_EXPECTED_MIGRATION_FILENAME`
26+
- `infra/k8s/base/management-api/source/management-api.env`:
27+
- `MANAGEMENT_API_EXPECTED_MIGRATION_FILENAME`
28+
2. Verify initContainer SQL checks in:
29+
- `infra/k8s/base/api/deployment.yaml`
30+
- `infra/k8s/base/management-api/deployment.yaml`
31+
They must read marker env vars and not stale hardcoded filenames.
32+
3. Keep Kustomize configMap wiring in sync so the updated values reach pods.
33+
34+
## Migration source of truth
35+
36+
Use latest SQL filenames under:
37+
38+
- `infra/k8s/base/ops/source/database/linear-migrations/app/`
39+
- `infra/k8s/base/ops/source/database/linear-migrations/management/`
40+
41+
If a migration becomes a startup prerequisite, update marker env values in the same PR.
42+
43+
## Verification checklist
44+
45+
- `kustomize build --load-restrictor LoadRestrictionsNone infra/k8s/base/api`
46+
- `kustomize build --load-restrictor LoadRestrictionsNone infra/k8s/base/management-api`
47+
- Confirm rendered initContainer SQL checks reference updated marker env vars.

0 commit comments

Comments
 (0)