一键导入
worktree-init
Create a new git worktree with its own venv, dependencies, .env, and shared data dir. Invoke with the branch name as the only argument.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create a new git worktree with its own venv, dependencies, .env, and shared data dir. Invoke with the branch name as the only argument.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Audit web↔iOS consistency for hand-copied surfaces (preset tables, metrics-catalog, debrief taxonomy, API DTOs) and surface divergences as an actionable task list. Run after a feature that touched one platform, before merge, or any time the two clients may have drifted.
Rsync the latest complete ECMWF GRIB run from the production server into the local ECMWF_GRIB_DIR so refresh can run with ECMWF enrichment locally
Deploy the weatherbrief app to production on weather.flyfun.aero
Start or restart the local dev server (backend + frontend) in a per-worktree tmux session. Use --https (or --simulator) to run the singleton TLS instance for iOS simulator testing.
Run LLM digest eval — replay saved weather contexts through the LLM and compare assessments
Build & maintain the LLM-digest eval SET (corpus) — pull prod briefings, attach pilot debriefs, re-run advisories against saved baselines, promote staging→corpus. Distinct from the `eval-digest` skill (which replays contexts through the LLM).
| name | worktree-init |
| description | Create a new git worktree with its own venv, dependencies, .env, and shared data dir. Invoke with the branch name as the only argument. |
| disable-model-invocation | true |
Create a fresh git worktree set up so the user can immediately run devserver in it. Each worktree has its own venv (no more ../main/venv sharing) but shares heavy data with main/ so we don't re-download GRIB or rebuild nav.db.
<branch-name> — required. The new worktree directory name AND the git branch name.--from <base> — optional. Branch to fork from (default main).If the user invoked the skill without a branch name, ask for one and stop.
git rev-parse --git-common-dir and git rev-parse --git-dir — if they differ, we're in a sub-worktree. Refuse and tell the user to cd to the main checkout first.git worktree list), refuse and point at the existing one.Resolve and remember:
MAIN_DIR = git rev-parse --show-toplevel (absolute)PARENT_DIR = parent of MAIN_DIR (worktrees are siblings of main/)WORKTREE_PATH = $PARENT_DIR/<branch-name> (absolute)If branch <branch-name> already exists locally:
git worktree add "$WORKTREE_PATH" "<branch-name>"
Otherwise create it from the base branch:
git worktree add -b "<branch-name>" "$WORKTREE_PATH" "<base>"
(Default <base> is main.)
If the create fails, stop and surface the error verbatim.
cd "$WORKTREE_PATH"
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -e ".[dev]"
This installs the weatherbrief package in editable mode pointing at the worktree's src/, plus dev tools (pytest, pytest-mock, responses per pyproject.toml).
Sanity check after install:
python -c "import weatherbrief; print(weatherbrief.__file__)"
The path printed MUST start with $WORKTREE_PATH. If it points at main/src or anywhere else, stop and report — something is wrong with the editable install.
cd "$WORKTREE_PATH/web"
npm install
Run only install, not npm run dev — the user invokes that via devserver.
cp "$MAIN_DIR/.env" "$WORKTREE_PATH/.env"
Main's .env already pins data paths (DATA_DIR, AIRPORTS_DB, ECMWF_GRIB_DIR, DATABASE_URL, etc.) to absolute paths under $MAIN_DIR/data, so a verbatim copy is what we want — heavy data + the app DB are shared with main by virtue of the env vars.
Do NOT create a data/ directory or symlink in the worktree. The whole point is that DATA_DIR (and friends) come from .env. If something in the codebase tries to read or write ./data directly, we want it to fail loudly so the bug is visible. A stray data/ dir would silently swallow that signal.
After copying, scan the result for relative path values as a sanity check:
grep -nE '^[A-Z_]+=\.\.?/|^[A-Z_]+=[a-z][a-z0-9_-]*/' "$WORKTREE_PATH/.env" || true
If any matches turn up, warn the user — those would resolve relative to the worktree CWD and probably aren't what they want. Don't auto-rewrite; the user owns .env.
DB sharing: because .env pins DATABASE_URL to main's DB, the worktree shares it. If this branch introduces alembic migrations, it WILL mutate main's DB. To isolate:
cp $MAIN_DIR/data/flyfun.db $WORKTREE_PATH/flyfun.db (or wherever)$WORKTREE_PATH/.env and rewrite DATABASE_URL (and any other DB-pointing vars) to the new path.The skill does NOT do this automatically — print the recipe in the summary if the user wants it.
Output a single block with:
python --version from the new venv.env copy status; flag any relative-path values found in Step 5.env — see skill notes if you need to fork."cd <worktree-path> && /devserverExample:
Worktree ready at /Users/brice/Developer/public/flyfun-weather/issue-65
Branch: issue-65 (forked from main)
Venv: ./venv (Python 3.13.x)
Editable: weatherbrief → /.../issue-65/src/weatherbrief ✓
npm: installed
.env: copied from main (no relative paths found)
Next: cd /.../issue-65 && /devserver
DB note: shared with main via .env. If this branch adds migrations, see skill Step 5 notes to fork.
git worktree remove --force <path> is the nuke).alembic upgrade head — devserver already does that check, and we don't want this skill touching the DB.devserver automatically. Print the next-step command and stop.