Skip to content

Commit 4e32d23

Browse files
authored
chore: add setup-worktree skill (#3278)
* chore: add setup-worktree skill for new worktree initialization * chore: simplify setup-worktree skill to cp .env and build:server only * chore: remove hardcoded path from setup-worktree skill
1 parent ca90492 commit 4e32d23

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: setup-worktree
3+
description: Set up a new git worktree for this repo by copying gitignored files (bin/) and building server assets so pnpm dev works without errors
4+
---
5+
6+
## Purpose
7+
8+
When a new git worktree is created, gitignored files (like the Temporal CLI binary in `bin/`) are missing and server assets haven't been built. Run this skill to get a new worktree ready for development.
9+
10+
## Steps
11+
12+
### 1. Find the main worktree path
13+
14+
```bash
15+
git worktree list
16+
```
17+
18+
The first entry is the main worktree. Use it as `$MAIN`.
19+
20+
### 2. Copy .env from the main worktree
21+
22+
```bash
23+
MAIN=$(git worktree list | head -1 | awk '{print $1}')
24+
cp $MAIN/.env ./.env
25+
```
26+
27+
### 3. Build server assets
28+
29+
Builds the frontend into `server/ui/assets/` which the Go server embeds. Required for `pnpm dev` to start.
30+
31+
```bash
32+
pnpm build:server
33+
```
34+
35+
`pnpm dev` should now start without errors.
36+
37+
## Why each step is needed
38+
39+
| Step | Why |
40+
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
41+
| Copy `.env` | Gitignored — not present in a fresh worktree, needed for dev modes |
42+
| `pnpm build:server` | Runs `VITE_API= BUILD_PATH=server/ui/assets/local vite build` — without this, `pnpm dev` fails because the embedded server assets are missing |

0 commit comments

Comments
 (0)