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.
This commit is contained in:
1 parent
9a884acc22
commit
7c2a37abdb
1 file changed
+20
-4
@@ -1,6 +1,6 @@
|
|||||||
# CLAUDE.md
|
# 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
|
## 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.
|
- **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`.
|
- **`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`.
|
- **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)
|
## Common commands (run from a stack directory)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install
|
npm install
|
||||||
|
npm run typecheck
|
||||||
pulumi preview
|
pulumi preview
|
||||||
pulumi up --yes
|
pulumi up --yes # run by the user or CI
|
||||||
pulumi destroy
|
pulumi destroy # run by the user
|
||||||
pulumi stack output
|
pulumi stack output
|
||||||
pulumi config
|
pulumi config
|
||||||
```
|
```
|
||||||
|
|
||||||
Requires `PULUMI_BACKEND_URL` and `PULUMI_CONFIG_PASSPHRASE` in the environment (or `pulumi login`).
|
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)
|
## CI/CD (Gitea Actions)
|
||||||
|
|
||||||
One workflow per stack: `.gitea/workflows/0N-deploy-<stack>.yaml`, scoped to changes under that stack's directory.
|
One workflow per stack: `.gitea/workflows/0N-deploy-<stack>.yaml`, scoped to changes under that stack's directory.
|
||||||
|
|||||||
Reference in new issue
Block a user