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:
parent
35ef01fd70
commit
0a5713c704
5 changed files with 242 additions and 0 deletions
61
files/dev-CLAUDE.md
Normal file
61
files/dev-CLAUDE.md
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
# `~/dev` — lnbits dev workspace
|
||||
|
||||
You're working in a dev workspace bootstrapped by **lnbits-sensei**.
|
||||
This file is workspace-level orientation; per-project CLAUDE.md files
|
||||
(e.g. `~/dev/lnbits/CLAUDE.md`) layer project-specific gotchas on top.
|
||||
|
||||
> This file is a symlink into your lnbits-sensei checkout's
|
||||
> `files/dev-CLAUDE.md` (via home-manager's `mkOutOfStoreSymlink`).
|
||||
> Edits should happen in the checkout and be committed there.
|
||||
|
||||
## Layout
|
||||
|
||||
```
|
||||
~/dev/
|
||||
├── repos/ # bare git repos, one per project
|
||||
├── <project>/<worktree>/ # worktrees per branch
|
||||
├── upstream-prs/<topic>/ # PR branches against upstreams
|
||||
├── shared/, scratch/ # workspace utilities
|
||||
└── refs/ # curated reference repos (optional)
|
||||
```
|
||||
|
||||
Rationale: bare-repos + per-project-worktree directories means one git
|
||||
object database per project (no clone-per-branch churn) and an explicit
|
||||
PR contract in `upstream-prs/`. See the lnbits-sensei README's
|
||||
"Workspace layout" section for the full reasoning.
|
||||
|
||||
## Quick commands
|
||||
|
||||
- `dev up [--fakewallet|--regtest]` — start the lnbits dev server.
|
||||
Default `--fakewallet` is instant, no docker, good for
|
||||
extension/UI/API work.
|
||||
- `dev down` / `dev logs` / `dev shell` — control / inspect.
|
||||
- *(planned)* `prb <repo> <branch>` — create a PR worktree branched
|
||||
from `upstream/main` under `~/dev/upstream-prs/`.
|
||||
- *(planned)* `lb <worktree>` — cd shortcut into `~/dev/lnbits/<worktree>`.
|
||||
|
||||
## Reference docs
|
||||
|
||||
Full reference lives in the lnbits-sensei checkout's `docs/`:
|
||||
|
||||
- `docs/remotes.md` — three remote-topology patterns (upstream-only /
|
||||
github-fork / multi-remote-with-private).
|
||||
- `docs/upstream-prs.md` — PR workflow with a primer for anyone new
|
||||
to fork-based contribution.
|
||||
- `docs/lnbits-upstream-flow.md` — how `lnbits/lnbits` itself moves
|
||||
(the `dev` / `main` branch split, squash-merge convention).
|
||||
- `docs/lnbits-workspace-notes.md` — practical gotchas: port choice,
|
||||
`LNBITS_SRC` build-context traps, extension-folder-upgrade wiping
|
||||
forks, Nostr key handling, CLINK scope, fork versioning, **settings
|
||||
precedence (`.env` vs DB)**.
|
||||
|
||||
## Per-project orientations
|
||||
|
||||
Per-project CLAUDE.md files are placed at the worktree root:
|
||||
|
||||
- `~/dev/lnbits/CLAUDE.md` — LNbits dev gotchas (settings precedence,
|
||||
frontend rules, auth decorators, …).
|
||||
|
||||
These are also symlinked from your lnbits-sensei checkout (under
|
||||
`files/`); the seeding is driven by `lnbits-sensei.devEnv.claude.*`
|
||||
options.
|
||||
Reference in a new issue