feat(claude): seed curated CLAUDE.md files into ~/dev/ workspace

Adds the omnixy-pattern out-of-store-symlink wiring so consumers can
opt into Claude Code orientation without copying anything by hand.
Files live in lnbits-sensei (so they evolve via PR), symlinks point
back at the consumer's checkout (so edits take effect on the next
Claude session without a nixos-rebuild).

New files under files/:

- dev-CLAUDE.md — generic workspace orientation. Workspace layout,
  quick command set, pointers to docs/. Opt-in (clobbers an existing
  ~/dev/CLAUDE.md, so off by default).
- lnbits-CLAUDE.md — per-project orientation for the lnbits worktree
  subtree. Inline summary of the four most-stepped-on gotchas
  (settings precedence, Quasar UMD self-closing rule, auth-decorator
  distinctions, upstream PR target = `dev` not `main`) plus pointers
  to the docs/ for full reference.

New options under lnbits-sensei.devEnv:

- scaffoldPath — absolute path to the consumer's lnbits-sensei
  checkout. types.str (not types.path) intentionally: types.path
  would copy the file into the Nix store and defeat
  mkOutOfStoreSymlink. Required when any claude.* flag is on.
- claude.enable — seeds ~/dev/lnbits/CLAUDE.md.
- claude.workspaceOrientation — additionally seeds ~/dev/CLAUDE.md.

Wiring lives in home.nix (gated via `osConfig.lnbits-sensei.devEnv.*`)
rather than the dev-env NixOS module, since the file destinations are
under home-manager's purview and the home-manager scope is where
`mkOutOfStoreSymlink` is in scope.

`nix flake check` stays green — `optionalAttrs` is lazy, so
`scaffoldPath` isn't accessed when claude.{enable,workspaceOrientation}
are both false (their defaults).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Padreug 2026-05-26 00:54:55 +02:00
commit 0a5713c704
5 changed files with 242 additions and 0 deletions

View file

@ -114,6 +114,40 @@ in follow-up passes.
The `dev` CLI is the single entry point. See the top of this README
for the verb set.
### Claude orientation seeding (optional)
If you use [Claude Code](https://docs.anthropic.com/en/docs/claude-code),
opt in to having curated CLAUDE.md files seeded into your workspace.
The files live under `files/` in this repo and are symlinked into
`~/dev/` via home-manager's `mkOutOfStoreSymlink` — edits in your
checkout take effect on the next Claude session, no rebuild.
Wire it in `settings.nix`:
```nix
devEnv = {
enable = true;
scaffoldPath = "/home/<you>/dev/lnbits-sensei"; # absolute path to your checkout
claude = {
enable = true; # ~/dev/lnbits/CLAUDE.md
workspaceOrientation = false; # also ~/dev/CLAUDE.md (opt-in;
# clobbers any existing one)
};
};
```
- `claude.enable` seeds `~/dev/lnbits/CLAUDE.md` from
`files/lnbits-CLAUDE.md` — project-level orientation that loads for
any Claude session in the lnbits worktree subtree (settings
precedence, Quasar UMD self-closing-tag rule, auth-decorator
distinctions, …).
- `claude.workspaceOrientation` *additionally* seeds `~/dev/CLAUDE.md`
from `files/dev-CLAUDE.md` — generic workspace orientation. Off by
default because most people already maintain their own.
If you don't use Claude Code, leave both off — the same content is in
`docs/` for human reading.
### Workspace layout (the `~/dev/` tree)
The dev-env module's job is to put every project, every worktree, and