add-cell
Skill1 starsChanged 5 months agoApache-2.0View on GitHub
Scale a geo's capacity out by standing up a brand-new ArcadeDB cell (a 3-node Raft cluster in its own namespace) and registering it for tenant placement. Use when an in-geo cell is full / nearing a placement cap, when onboarding a tenant that needs a dedicated (enterprise/big) cell, or when Placement.place() throws "no in-geo cell can host".
In this repository20 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- control-plane/CLAUDE.mdCLAUDE.md
- docs/CLAUDE.mdCLAUDE.md
- helm/CLAUDE.mdCLAUDE.md
- terraform/CLAUDE.mdCLAUDE.md
- cell-capacity-reportSkill
- deprovision-tenantSkill
- dr-drillSkill
- incident-triageSkill
- migrate-schemaSkill
- new-adrSkill
- provision-tenantSkill
- restore-tenantSkill
- retire-cellSkill
- review-terraform-planSkill
- rotate-secretsSkill
- security-baseline-checkSkill
- tenant-erasureSkill
- tenant-usage-reportSkill
- upgrade-arcadedbSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 1 is distinctive, and 5 are 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.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 39
No click-ops (prime directive #6): every change lands via Terraform + GitOps + the catalog.
- Very specific: line 45
Justify + size: Run cell-capacity-report for the geo/tier to confirm a real capacity need and to pick caps.
- Distinctive: line 64
Raft formed, 3/3 healthy: all 3 pods Ready; the cell elected exactly one leader (its own new Raft group, isolated from every other cell).
- Very specific: line 75
No public exposure: no Service/LB places a DB port (2480/2424/2434/5432/6379/7687) on a public subnet.
- Very specific: line 85
Quorum never formed /
/readynot 204: check pod scheduling across 3 AZs, memory limits (OOM = under-sized vs the sizing rule, prime … - Very specific: line 86
Never: add tenants to a cell that failed verification — for proper teardown of a populated cell use retire-cell (drain → migrate tenants → …
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill 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
Add a cell (scale out)
Stand up a new cell to add capacity in one geo. Adding a cell is purely additive and zero-downtime — no existing tenant, DB, or Raft group is touched. Phase note: the Terraform/apply steps MUTATE AWS + the cluster and are out of scope until after CTO sign-off and require mandatory Spacelift prod approval (prime directive #6). Until then, run plan-only and stop at the approval gate.
Prerequisites
- You know why you are adding a cell (read
cell-capacity-reportfirst — a cell isfullwhen ANY cap trips:max_standard_dbs,max_page_ram_commit_ratio,max_disk_used_ratio). Scaling by adding cells is the ONLY horizontal scale lever — a single cell has a single-leader write ceiling and a DB cannot be split across nodes. - Repo access with the cell module (
../../../terraform/modules/cell), the GitOps repo (Argo CD per-cellApplicationSet, ADR-0021), and the cell catalog (regional DynamoDBCellRecord,../../../control-plane/registry/schema.ts). - Spacelift access for the target geo's stack (plan for everyone; apply needs a manual approver, ADR-0020).
kubectlcontext for the target in-geo regional EKS cluster (or, forcell_isolation=cluster, the dedicated enterprise cluster — ADR-0004).- A KMS key ARN in the target geo for EBS encryption (prime directive #5).
Inputs
| Input | Example | Notes |
cell_id | kb-eu-prod-std-02 | Unique, kebab, ^[a-z][a-z0-9-]{4,50}$. Follow kb-<geo>-<env>-<role>-NN. Must NOT collide with any existing/retired catalog entry. |
geo | eu | us | Residency boundary. Must match the control plane / state bucket you target. |
env | prod | prod forces quorum (replicas≥3, PDB minAvailable≥2). |
region | eu-west-1 | Must be in allowed_regions for the geo (plan precondition + SCP). |
tier | standard | enterprise | Enterprise → typically cell_isolation=cluster, fsync durability. |
cell_isolation | namespace | cluster | Default namespace (pooled). cluster = dedicated EKS for enterprise/regulated. |
| Sizing | maxpage 32 / heap 8 / overhead 6 / limit 46 GiB | pod_memory_limit_gib >= maxpage_ram_gib + heap_gib + overhead_gib (prime directive #7). |
ebs_kms_key_arn | arn:aws:kms:eu-west-1:ACCOUNT_ID:key/... | In-geo KMS key. |
Safety checks (MUST pass before proceeding)
- Residency (prime directive #1):
region∈ the geo'sallowed_regions; KMS key, EKS cluster, and DynamoDB catalog table are all in the SAME geo. NO EU↔US data path. The cell module fails the plan ifregion ∉ allowed_regions; do not rely on that alone — verify by eye. - Quorum (prime directive #3): for
env=prod,replicas=3(one per AZ, 3 distinct AZs) andpdb_min_available=2. Non-prod MAY be single-node. - Sizing (prime directive #7): confirm
pod_memory_limit_gib >= maxpage_ram_gib + heap_gib + overhead_gib. Cross-check the module'ssizing_summaryoutput (required_min_gibvspod_memory_limit_gib) so a too-small pod cannot OOM-kill and break quorum. - No public DB (prime directive #4): the cell module's default-deny NetworkPolicy stays on; ports 2480/2424/2434/5432/6379/7687 are NEVER on a public subnet/LB. Ingress limited to
control-plane,retrieval,observability. - Encrypt everything (prime directive #5):
ebs_kms_key_arnset; gp3-KMS StorageClass managed. The engine provides no native encryption. - Version floor (prime directive #2 / ADR-0012): image tag/digest is a pinned semver ≥ 26.4.1, never
latest. (No re-audit of cross-DB isolation is required here — this cell is brand new and holds no tenants yet; that re-audit is triggered by upgrades, seeupgrade-arcadedb.) - No click-ops (prime directive #6): every change lands via Terraform + GitOps + the catalog. Plan → approve → apply through Spacelift; no manual
kubectl applyof the StatefulSet, no console edits. - Additive guarantee: this skill creates a NEW namespace/StatefulSet/PVCs/Raft group/backup prefix/catalog row only. It must NOT edit, scale, or restart any existing cell. If your diff touches an existing cell's resources, STOP.
cell_iduniqueness: confirm noCellRecordalready exists with thiscell_id(includingstatus=retired) — IDs are not reused.
Steps
- Justify + size. Run
cell-capacity-reportfor the geo/tier to confirm a real capacity need and to pick caps. Choosecell_id,region,tier,cell_isolation, and sizing per the Inputs table. - Add the cell module instance (Terraform). In the target geo/env environment config, add a
module "<cell_id>"block sourcing../../../terraform/modules/cellwith:cell_id,geo,env=prod,region, andallowed_regions(in-geo).replicas = 3,pdb_min_available = 2(prod quorum).arcadedb_image_tag = "26.4.1"(or higher) — pin a digest in prod (arcadedb_image_digest).- Sizing satisfying prime directive #7 (e.g. maxpage 32 / heap 8 / overhead 6 / limit 46).
manage_storage_class = true,ebs_kms_key_arn = <in-geo key>(gp3-KMS).manage_helm_release = false(Argo CD owns the release — GitOps, ADR-0021).enable_default_deny_networkpolicy = true; defaultallowed_ingress_namespaces.backup_bucket/backup_prefixfrom the geo'sbackup-drmodule (defaults tocell/<cell_id>, ADR-0015).
- Add the Argo CD
ApplicationSetgenerator entry (GitOps). In the per-cellApplicationSet, add ONE generator entry for<cell_id>(geo/env/tier overlay, in-geo, sizing values mirroring step 2). This templates the ArcadeDB Helm release for the new cell. Promote config only (dev→stage→prod × eu/us) — never data (ADR-0021). - Register the cell in the catalog (
status=available). Add aCellRecord(PKcell_id) to the regional DynamoDB cell catalog (NEVER a global table — residency, ADR-0008) withgeo,env,tier,cell_isolation,namespace,tx_wal_flush(per tier, ADR-0013),caps,backup_prefix, digest-pinnedarcadedb_image_ref, andstatus = "available"so Placement starts routing NEW tenants here. (No native per-DB quotas exist — F2 — so caps in the catalog + the retrieval proxy are the only capacity controls.) - Plan + review (no mutation yet). Open the change as a PR; let Spacelift produce a plan for the geo stack (graph: landing-zone → network → eks → cell). Run
review-terraform-plan— it flags a DB SG opened to the world, residency violations, destroys of stateful resources, and KMS/role changes. Confirm the plan only CREATES the new cell's resources and touches NO existing cell. - ⛔ APPROVAL GATE — AWS-MUTATING, POST-CTO-SIGN-OFF ONLY. Get the mandatory manual prod approval in Spacelift (prime directive #6 / ADR-0020). Do not proceed until approved and until this phase is in scope.
- Apply (Spacelift). Approver runs the Spacelift apply. Terraform creates the namespace, gp3-KMS StorageClass, PDB, default-deny NetworkPolicy, and governance objects; Argo CD reconciles the new
ApplicationSetentry and deploys the ArcadeDB StatefulSet (3 pods, one per AZ) + PVCs. - Let the cell form its Raft group. The 3 pods discover peers via the headless Service (
<cell_id>-headless.<namespace>.svc.cluster.local) and elect a leader. This is a fresh, empty cluster — it holds no tenant DBs yet.
Verification
- Raft formed, 3/3 healthy: all 3 pods Ready; the cell elected exactly one leader (its own new Raft group, isolated from every other cell).
kubectl -n <namespace> get statefulset,pods -o wide # 3/3, spread across 3 distinct AZs kubectl -n <namespace> get pdb # ALLOWED DISRUPTIONS respects minAvailable=2 /readyon all 3 pods returns HTTP 204:for p in 0 1 2; do kubectl -n <namespace> exec <cell_id>-$p -- \ curl -s -o /dev/null -w '%{http_code}\n' localhost:2480/ready; done # expect 204 ×3- Storage encrypted + gp3-KMS: PVCs Bound to the cell's gp3-KMS StorageClass; underlying EBS volumes encrypted with the in-geo KMS key.
- No public exposure: no Service/LB places a DB port (2480/2424/2434/5432/6379/7687) on a public subnet; default-deny NetworkPolicy present (prime directive #4).
- Catalog reflects reality:
CellRecordfor<cell_id>isstatus=available, correctgeo/env/tier, in the regional table. - Placement uses it / existing cells untouched: a synthetic in-geo placement request for the matching env+tier resolves to
<cell_id>(least-loaded). Confirm NO existing cell changed — its pods did not restart, its leader did not change, its tenants saw zero downtime. (Real tenants land here only on next provision viaprovision-tenant.)
Rollback / if it goes wrong
Because the cell is additive and empty, rollback is clean and low-risk:
- Catalog first: flip the
CellRecordtostatus=draining(orprovisioning) so Placement stops sending NEW tenants here. The cell holds no tenants, so nothing to drain. - Revert GitOps + Terraform: revert the PR — remove the
ApplicationSetgenerator entry and the cell module block. Re-plan and re-apply through Spacelift (manual prod approval again). Argo CD prunes the StatefulSet; Terraform destroys the namespace/PVCs/StorageClass/NetworkPolicy. Then delete theCellRecord. - Quorum never formed /
/readynot 204: check pod scheduling across 3 AZs, memory limits (OOM = under-sized vs the sizing rule, prime directive #7), and KMS key access for EBS. Fix the inputs and re-plan; do NOT hand-edit the StatefulSet (no click-ops). - Never add tenants to a cell that failed verification — for proper teardown of a populated cell use
retire-cell(drain → migrate tenants → retire). - This skill only ever creates resources; it cannot have damaged an existing cell. If a diff/plan ever showed an existing cell being modified or destroyed, you stopped at step 5 — nothing was applied.
Related
retire-cell— drain + decommission a cell (the inverse).cell-capacity-report— decide when a new cell is needed.provision-tenant— places a new tenant DB onto anavailablecell.review-terraform-plan— gate the plan before approval.- ADR-0004 — cell = namespace (cluster for enterprise).
- ADR-0021 — Argo CD ApplicationSet per cell (additive add-cell).
- ADR-0020 — Spacelift (mandatory prod approval).
- ADR-0008 — regional DynamoDB registry/cell catalog.
- Module:
../../../terraform/modules/cell· Helm values:../../../helm/arcadedb/values.yaml· Architecture:../../../docs/architecture.md
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.

