worktree-setup

Create idempotent symlinks for env and secret files in new git worktrees.

2|1|Updated Mar 26, 2026
Ready to run
npx skills add https://github.com/TeamSPWK/nova --skill worktree-setup-teamspwk
๐Ÿ’ฌ Prompt for ChatGPT / Claude Chatโ–ผ
Please help me install this Agent Skill.
Skill: worktree-setup
Source: https://github.com/TeamSPWK/nova/tree/main/.claude/skills/worktree-setup
Command: npx skills add https://github.com/TeamSPWK/nova --skill worktree-setup-teamspwk

SYSTEM DOCUMENTATION & REQUIREMENTS

git worktree์—์„œ ๋ฉ”์ธ ๋ ˆํฌ์˜ ํ™˜๊ฒฝ ์„ค์ •์ด ํ•„์š”ํ•  ๋•Œ. โ€” MUST TRIGGER: ์ƒˆ worktree ์ง„์ž… ์งํ›„, ์‚ฌ์šฉ์ž๊ฐ€ 'ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์•ˆ ์ฝํž˜ยท์‹œํฌ๋ฆฟ ๋ชป ์ฐพ์Œ'์„ ๋ณด๊ณ ํ•  ๋•Œ, EnterWorktree ๋„๊ตฌ ํ˜ธ์ถœ ์งํ›„. Use when the main repo's environment setup is needed inside a git worktree. โ€” MUST TRIGGER: right after entering a new worktree, when the user reports 'env vars not read' or 'secrets not found', or right after the EnterWorktree tool is called.

What problem does it solve?

git worktree๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ .env, .secret/, .npmrc ๋“ฑ๊ณผ ๊ฐ™์€ ํŒŒ์ผ๋“ค์„ ์ƒˆ ์ž‘์—… ๋””๋ ‰ํ† ๋ฆฌ๋กœ ์ž๋™ ๋ณต์‚ฌํ•˜์ง€ ์•Š์œผ๋ฏ€๋กœ ํ™˜๊ฒฝ๋ณ€์ˆ˜์™€ ์‹œํฌ๋ฆฟ์ด ์‚ฌ๋ผ์ง‘๋‹ˆ๋‹ค. ์ด ์Šคํ‚ฌ์€ ๋ฉ”์ธ ๋ ˆํฌ์˜ ํ™˜๊ฒฝ ๊ตฌ์„ฑ์„ worktree์—์„œ๋„ ๋™์ผํ•˜๊ฒŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก ์‹ฌ๋ณผ๋ฆญ ๋งํฌ๋ฅผ ํ†ตํ•ด ๊ฒฉ์ฐจ๋ฅผ ํ•ด์†Œํ•ฉ๋‹ˆ๋‹ค.

Core Features & Use Cases

  • Automatic environment parity: SessionStart ํ›…์œผ๋กœ worktree ์ง„์ž… ์‹œ ์ž๋™์œผ๋กœ ํ™˜๊ฒฝ ํŒŒ์ผ์„ ์—ฐ๊ฒฐํ•ฉ๋‹ˆ๋‹ค.
  • Robust linking: .env, .env.local, .env.development, .secret, .npmrc๋ฅผ worktree ๋ฃจํŠธ๋กœ ์‹ฌ๋ณผ๋ฆญ ๋งํฌํ•ฉ๋‹ˆ๋‹ค.
  • Safety & overrides: ๊ธฐ์กด ํŒŒ์ผ์„ ๋ฎ์–ด์“ฐ์ง€ ์•Š๊ณ , ๊นจ์ง„ ์‹ฌ๋งํฌ๋ฅผ ๊ฐ์ง€ํ•˜๋ฉฐ .claude/worktree-sync.json์œผ๋กœ ํ”„๋กœ์ ํŠธ ๋ณ„ ์˜ค๋ฒ„๋ผ์ด๋“œ๋ฅผ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.
  • Triggers & UX: ์ž๋™ ํŠธ๋ฆฌ๊ฑฐ( SessionStart ) ๋ฐ ์ˆ˜๋™ ํŠธ๋ฆฌ๊ฑฐ(/nova:worktree-setup)๋ฅผ ๋ชจ๋‘ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.

Quick Start

Enter a new worktree to automatically symlink the main repo's env files and secrets into the worktree.

Frequently Asked Questions about worktree-setup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why are environment variables and secrets missing after switching to a new git worktree?โ–ผ

Git worktree does not automatically copy hidden files like .env or .secret into the new working directory, causing environment variables to disappear when entering a new git worktree. Symlinking the main repo files restores them.

How do I automatically sync .env and secret files into a new git worktree?โ–ผ

You can sync .env and secret files by creating safe symlinks from the main repository to the worktree root, triggered automatically via SessionStart or manually to link .env, .env.local, and .npmrc configurations.

Does worktree environment setup overwrite existing .env files in the new directory?โ–ผ

No, safe linking ensures the worktree environment setup never overwrites existing files. It creates idempotent symlinks for your environment variables and detects broken symlinks without destroying local configurations.

Can I customize which secret files are linked in my git worktree?โ–ผ

Yes, you can customize linked secret files by creating a .claude/worktree-sync.json file to apply project-specific overrides for environment parity, specifying exactly which configurations to link into the worktree.

What is the best way to fix broken symlinks for environment files in git worktrees?โ–ผ

The best way to fix broken symlinks is to run an idempotent linking setup that detects broken symlinks and safely relinks the main repository's .env and secret files into the worktree with clear failure signaling.