claude/lib
Bastien Chanot 131d0bcb5d feat(secrets): .env source-of-truth in ~/.claude + repo symlink
Move the real secret out of the git tree: the key lives in ~/.claude/.env
(outside the repo), and link.sh symlinks repo/.env -> ~/.claude/.env so
`source "$REPO/.env"` resolves transparently. The secret never enters git —
not as content (it's a link) and not by accident (gitignored).

link.sh: add link_env() — verify ~/.claude/.env exists + has MAGIC_API_KEY
(warn, never create/copy the secret), then create repo/.env -> ~/.claude/.env.
Defensive + idempotent: links only when repo/.env is absent or already the
right symlink; a residual REAL repo/.env is left untouched with a migrate hint
(never clobbered, so the secret can't be destroyed).

.gitignore: harden .env -> .env + .env.* + !.env.example (covers .env.local,
.env.bak, .env.save; keeps the template tracked).

Messages point at ~/.claude/.env (the canonical edit location) instead of the
ambiguous $REPO/.env: design-tool-gate.sh gate output, design-gate.md
(branch 3 + IMPORTANT), toggle-external.sh, install-plugins.sh.

Verified: shellcheck clean (link.sh, toggle-external.sh, design-tool-gate.sh);
link.sh created the symlink (1 change, idempotent re-run); repo/.env absent
from git status; magic-off path still exits 10 with the ~/.claude/.env hint.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 11:44:47 +02:00
..
profiles feat(design-gate): profile-based toolchain gate + design-tool-gate.sh 2026-06-21 11:21:48 +02:00
project-archetypes refactor(onboard,init-project): migrate file paths to .claude/ 2026-04-23 16:06:14 +02:00
animation-lib-check.sh feat(animation): auto-install motion lib + detection across init/onboard/advisor 2026-04-27 15:32:46 +02:00
archetype-detector.md feat(archetypes): add project archetype library + detection algorithm 2026-04-21 22:37:07 +02:00
design-gate.md feat(secrets): .env source-of-truth in ~/.claude + repo symlink 2026-06-21 11:44:47 +02:00
design-tool-gate.sh feat(secrets): .env source-of-truth in ~/.claude + repo symlink 2026-06-21 11:44:47 +02:00
detect-plugins.sh chore(caveman): purge plugin + always-on integration 2026-06-19 19:08:40 +02:00
profile.sh feat(profile): list counters + grouped show + --plain parse mode 2026-06-19 19:59:19 +02:00
toggle-external.sh feat(secrets): .env source-of-truth in ~/.claude + repo symlink 2026-06-21 11:44:47 +02:00