From 7c2a37abdbe31887853b2cbdec6b6b5d1dae178a Mon Sep 17 00:00:00 2001 From: kasun Date: Fri, 20 Nov 2026 20:06:11 +0100 Subject: [PATCH] docs: add live-infra rule and verification steps to CLAUDE.md The guard hook only sees shell commands, so file edits to live systems (like the local kubeconfig) need a written rule. --- CLAUDE.md | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index dbc8201..630bb05 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,6 +1,6 @@ # CLAUDE.md -This file provides guidance to Claude Code when working anywhere in this repository. Each stack directory (`01-proxmox-infra`, `02-k8s-bootstrap`, etc.) has its own `CLAUDE.md` with stack-specific commands and architecture — Claude Code loads both this file and the stack's file automatically when working inside a stack directory. +Repository-wide instructions. Each stack directory has its own `CLAUDE.md` with stack-specific commands and architecture. ## Project overview @@ -36,21 +36,37 @@ A stack's outputs must exist (i.e. it must have been deployed) before any downst - **Secrets**: read via `config.requireSecret()`, never via environment variables or hardcoded values. - **`Pulumi.dev.yaml`**: gitignored (contains the encryption salt) — never delete it or secrets become unrecoverable. Encrypted with `PULUMI_CONFIG_PASSPHRASE`. - **Backend**: self-hosted Postgres state backend, set via `PULUMI_BACKEND_URL`. -- Don't add a co-author when committing to git. + +## Git conventions + +Branch names, commit messages and PR titles follow @CONVENTIONS.md. Don't add a co-author when committing to git. + +## Live infrastructure + +- Don't change live systems (cluster, pfSense, Proxmox, VMs, my local kubeconfig) on your own initiative, even for small or reversible changes. Give me the exact steps and let me decide who runs them. +- Code edits in the repo are fine without asking. +- Never recreate VMs to apply a change. Write code for a clean fresh install, plus separate manual steps for the running cluster. + +## Verifying changes + +After editing a stack, run `npm run typecheck` in that stack's directory, then `pulumi preview`, and show the output of both. A passing typecheck only proves the code compiles; the preview is what shows which resources would be created, updated or replaced. ## Common commands (run from a stack directory) ```bash npm install +npm run typecheck pulumi preview -pulumi up --yes -pulumi destroy +pulumi up --yes # run by the user or CI +pulumi destroy # run by the user pulumi stack output pulumi config ``` Requires `PULUMI_BACKEND_URL` and `PULUMI_CONFIG_PASSPHRASE` in the environment (or `pulumi login`). +Start Claude Code sessions from the repository root: the permission rules and the live-infra hook in `.claude/settings.json` only load from there. + ## CI/CD (Gitea Actions) One workflow per stack: `.gitea/workflows/0N-deploy-.yaml`, scoped to changes under that stack's directory.