compose:worktree

Creates isolated git worktree workspaces with baseline test verification before feature work.

Updated Jun 27, 2026
One-click install
npx skills add https://github.com/HKUST-QUANT-SOCIETY/quantcode --skill compose-worktree-hkust-quant-society
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: compose:worktree
Source: https://github.com/HKUST-QUANT-SOCIETY/quantcode/tree/main/.opencode/meta-skills/worktree
Command: npx skills add https://github.com/HKUST-QUANT-SOCIETY/quantcode --skill compose-worktree-hkust-quant-society

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Starting feature work directly on your current branch risks polluting your working state, and manually managing git worktrees is error-prone—nested worktrees, unignored directories, and untested baselines cause confusion later. ## Core Features & Use Cases - Isolation Detection: Detects whether you are already inside a linked worktree or a submodule before creating anything, preventing nested worktrees. - Native Tool Preference with Git Fallback: Uses platform-native worktree tools when available and falls back to git worktree add with directory priority rules (.worktrees/, worktrees/, legacy global path) and gitignore verification. - Project Setup and Baseline Verification: Auto-detects Node.js, Rust, Python, or Go projects, installs dependencies, and runs the test suite to confirm a clean baseline before implementation. - Use Case: Before implementing a new feature, ask the agent to set up an isolated workspace; it creates a worktree on a new branch, installs dependencies, runs tests, and reports readiness. ## Quick Start Set up an isolated worktree for my new feature branch and verify the test baseline is clean before I start implementing.

Frequently Asked Questions about compose:worktree

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

FAQPage Schema
How do I create an isolated git worktree for feature development?▼

Run git worktree add with a target path and new branch name, such as git worktree add .worktrees/my-feature -b my-feature. Verify the directory is gitignored first, then install dependencies and run tests to confirm a clean baseline.

Should I use git worktree or a separate branch for isolated work?▼

A worktree gives you a separate working directory on its own branch, so you avoid stashing or switching branches in your main checkout. A plain branch switch is simpler but disrupts your current working state.

How do I check if I am already inside a git worktree?▼

Compare git rev-parse --git-dir with git rev-parse --git-common-dir; if they differ, you are in a linked worktree. Also check git rev-parse --show-superproject-working-tree to rule out being inside a submodule.

Why does git worktree add fail with a permission error?▼

Sandboxed environments can block worktree creation with permission denials. In that case, work in the current directory instead, then run project setup and baseline tests in place.

What should I do when baseline tests fail before starting work?▼

Report the pre-existing failures and ask whether to proceed or investigate first. Proceeding without confirmation makes it impossible to distinguish new bugs from failures that existed before your changes.