bridge-worktree
Skill7 starsChanged 7 days agoMITView on GitHub
Use when starting a feature, experiment or risky refactor in this repo — anything bigger than a one-file fix. Also when the user says "worktree", "new branch", "work on this in parallel", or when a change adds a table, a column or any new persisted data. Covers where the worktree goes, what is missing inside it, and keeping new data off the live bridge DB.
- Reads credentials
In this repository27 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- accessibility-auditSkill
- algorithmic-artSkill
- api-docsSkill
- beautiful-shadowsSkill
- brainstormingSkill
- bridge-eyesSkill
- bridge-feature-sliceSkill
- bridge-shipSkill
- changelogSkill
- color-paletteSkill
- content-strategySkill
- design-firstSkill
- design-implementSkill
- design-reviewSkill
- design-tokensSkill
- emil-design-engSkill
- empty-statesSkill
- frontend-designSkill
- landing-pageSkill
- micro-interactionsSkill
- mystical-assistant-designSkill
- ogilvy-copywritingSkill
- onboarding-guideSkill
- typography-scaleSkill
- visual-style-presetsSkill
- writing-guidelinesSkill
The file
Files
Feature work happens in a worktree
master is the checkout the live bridge runs from. Work there and a half-built
feature is one mystical restart away from being the thing the user is talking
to. One-file fix or doc tweak: master is fine. Anything else: worktree.
Create it where the dashboard can see it
git worktree add -b feat/x ~/projects/.worktrees/mystical-assistant/feat-xInside BASE_PATH is the load-bearing part — _abs_within() drops any tree
outside ~/projects, so a worktree in /tmp is invisible to every surface and no
session can start in it. Git resolves branch→tree, so a hand-made git worktree
add elsewhere under ~/projects still attaches; .worktrees/<repo>/<branch>
(slashes to dashes, _worktree_path() in bridge/dashboard/server.py) is the
convention that keeps it out of the project browser.
What isn't in there
git worktree add checks out tracked files only, so everything git-ignored is
missing:
.env—cp ~/projects/mystical-assistant/.env <wt>/.env. Without itbin/mysticaldies on any command exceptbuild/doctor.node_modules— only if you must build web in the worktree:cd <wt>/bridge/dashboard/web && npm ci. Usually you don't; build from master at ship time instead.
New data goes in a scratch DB
config.BRIDGE_DB defaults to ~/.bridge_state/bridge.db — the live bridge's
sessions, turns and events. A worktree that migrates it or writes new-shape rows
damages the thing the user is working in right now.
- Tests need nothing.
tests/conftest.pyalready pinsBRIDGE_DBto a temp file before config is imported. - Any manual script or REPL:
BRIDGE_DB=/tmp/wt-x.db python3 …. In the environment, before the process starts —bridge/config.pyfreezes the value at import, so setting it afterwards does nothing. - Schema changes stay in
bridge/store.py: a line in_SCHEMAplus an idempotentALTER TABLEininit(), like every column already there. Additive only — master's code keeps reading that DB.
Two traps
mysticalon PATH is the main checkout. It's a symlink tomystical-assistant/bin/mystical, and that script resolvesREPOfrom its own location.mystical restartinside a worktree restarts the live bridge running master's code. Say<wt>/bin/mysticalwhen you mean the worktree.- Worktree code is never live. It can't be, until it's merged and the bridge restarts — see bridge-ship. Don't restart anything to "test" it.
Fold back
git -C ~/projects/mystical-assistant merge feat/x
git worktree remove ~/projects/.worktrees/mystical-assistant/feat-xThen bridge-ship. Abandoned worktrees aren't free: each one is a dirty tree
NEXT UP keeps suggesting and a row in the WORKTREES tab, and each can hold one of
the 8 dev-server slots (devserver.MAX_SERVERS).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

