Create Feature Worktree Skill
This skill helps you initialize a new feature development environment properly.
When to Use
Use this skill when you have:
- •Created a new spec or plan file.
- •Staged those files.
- •Want to implement the feature in a clean, isolated worktree without disturbing your current workspace.
Workflow
The skill provides a script to automate the git gymnastics required to move staged changes to a new branch and open a worktree.
1. Identify Branch Name
Determine the branch name from your spec file (e.g., 007-refactor-uds-file-transfer-server).
2. Run the Start Script
Execute the bundled script to create the branch, commit changes, and setup the worktree.
bash
bash <path-to-feature-starter>/scripts/start_feature.sh <branch-name> "<commit-message>"
Example:
bash
bash <path-to-feature-starter>/scripts/start_feature.sh 007-refactor-uds-file-transfer-server "docs: add spec for uds file transfer refactor"
3. Add Worktree to Workspace
After the script completes, add the new worktree directory to your current VS Code workspace.
- •Go to File > Add Folder to Workspace...
- •Select the new directory (usually
../<branch-name>). - •This allows you to edit files in the feature branch while keeping the main workspace open for reference.
Manual Steps (Reference)
If the script fails or you prefer manual control:
- •Create and switch to new branch:
git checkout -b my-feature - •Commit staged changes:
git commit -m "docs: add spec" - •Return to main branch:
git checkout master - •Create worktree:
git worktree add ../my-feature my-feature