Add formatters, hooks, memory entries and context-load improvements

- formatters/js, md, yaml: new/updated formatter scripts
- hooks/set-wezterm-profile.sh: new hook for WezTerm profile switching
- scripts/context-load: improvements from recent sessions
- HOOKS.md, MEMORY.md: updated documentation and index entries
- memory/log, memory/reference-infrastructure-docs.md: session logs and reference

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Paul O'Reilly
2026-03-19 10:54:49 +13:00
parent 9d747199fc
commit c3557a3d97
9 changed files with 200 additions and 3 deletions

View File

@@ -0,0 +1,23 @@
# Session Log — 2026-03-18
## Summary
Created a shared infrastructure catalog repo (`homelab/infrastructure-docs`) documenting all homelab systems with dependency tracking. 20 system files covering physical hosts, cluster core, networking, identity, platform services, and applications.
## Decisions
- Decision: Infrastructure knowledge goes in a dedicated repo, not MEMORY.md — Rationale: Infrastructure maps are authoritative and maintained (add/remove systems), not accumulated learnings. Different lifecycle than gotchas/reflections.
- Decision: Located at `~/dev/claude/docs/infrastructure/homelab/` with parent structure supporting future locations (e.g., customer sites) — Rationale: User expects to have infrastructure at multiple logical locations in future.
- Decision: Repo in `homelab` org on Gitea, not `skynet` — Rationale: Infrastructure documentation, not AI-focused.
- Decision: Each system file uses consistent structure (what it does, depends on, depended on by, managed by) — Rationale: Enables tracing dependencies in either direction.
## Gotchas Discovered
- **[gitea]** Symptom: Push to new repo failed with "User permission denied for writing" — Fix: The SSH alias `gitea.oreillyit.nz-homelab` authenticates as `cluster-administrator`, but repo was created by `ai_admin` via API. Added `cluster-administrator` as admin collaborator via API before push succeeded.
## Key Context
- `ai_admin` Gitea token is in `cluster-bootstrap/local_secrets/gitea_ai_admin` (not in `~/dev/claude/secrets/`)
- Created repo via Gitea API: `POST /api/v1/orgs/homelab/repos`
- Added collaborator via API: `PUT /api/v1/repos/homelab/infrastructure-docs/collaborators/cluster-administrator`
- Memory reference added to both claude-foundations MEMORY.md and Claude profile memory
## Process Notes
- Good pattern: discussing the conceptual approach (MEMORY vs SPEC vs dedicated catalog) before jumping into implementation
- The Gitea permission issue could be avoided by always adding `cluster-administrator` as collaborator when creating repos via `ai_admin` API token for the `homelab` org

View File

@@ -0,0 +1,40 @@
# Infrastructure Docs Repo
## Location
- Filesystem: `~/dev/claude/docs/infrastructure/homelab/`
- Repo: `gitea.oreillyit.nz/homelab/infrastructure-docs`
- SSH remote: `git@gitea.oreillyit.nz-homelab:homelab/infrastructure-docs.git`
## Purpose
Authoritative catalog of all systems in the homelab environment. Unlike MEMORY.md (accumulated learnings) or CLAUDE.md (project conventions), this is a **maintained map** — updated when systems are added/removed, not accumulated over time.
Answers: "What depends on X?", "What breaks if Y goes down?", "What manages Z?"
## Structure
- `INDEX.md` — thin index listing all system files, grouped by category
- One `.md` per system (e.g., `cilium.md`, `traefik.md`, `authelia.md`)
- Each file: what it does, network details, depends on, depended on by, managed by
- Parent `docs/infrastructure/` supports multiple locations (future: `customer-site-x/`)
## Categories
- Physical/Hosting: proxmox, vps, bootstrap-vm
- Cluster Core: talos, cilium, argocd
- Storage: proxmox-csi, proxmox-ccm
- Networking: wireguard, caddy, traefik, coredns, dnsmasq
- Identity: authelia, headscale
- Platform: gitea, email-relay, homepage, cert-pipeline
- Applications: octopus-deploy, external-services
## Source projects
Documents systems from both `cluster-bootstrap` and `cluster-apps`. Shared across projects — not inside any single project repo.
## When to update
- Adding/removing/replacing a system
- Dependencies change (new service depends on Authelia, etc.)
- Major version upgrades worth noting