create-worktree-and-test

Create a git worktree from HEAD and run tests in isolation.

3|1|Updated Jan 13, 2026
One-click install
npx skills add https://github.com/sirius-cc-wu/sirius-skills --skill create-worktree-and-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-worktree-and-test
Source: https://github.com/sirius-cc-wu/sirius-skills/tree/main/create-worktree-and-test
Command: npx skills add https://github.com/sirius-cc-wu/sirius-skills --skill create-worktree-and-test

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires git, pnpm, yarn, npm, pytest, go, cargo, and includes scripts (resource) components.

What problem does it solve?

This Skill automates the creation of a git worktree from the current HEAD and runs project tests in isolation, enabling safe testing of changes without affecting the main checkout.

Core Features & Use Cases

  • Create a new worktree at a specified path or default sibling directory.
  • Reuse an existing worktree if present.
  • Auto-detect project type to run appropriate test commands (e.g., npm, pytest, go test, cargo test) or use a provided command.
  • Switch into the new worktree and execute tests, returning results.

Quick Start

Run the script at <path-to-skill>/scripts/run.sh using optional worktree-path, branch-name, and test-command to create a worktree and run tests.

Frequently Asked Questions about create-worktree-and-test

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

FAQPage Schema
How do I run tests in an isolated git worktree without affecting my main checkout?

To run tests in an isolated git worktree, you can create a new worktree from your current HEAD and execute tests within that separate directory. This ensures your main checkout remains unaffected by test changes.

What is the best way to automate git branch management and testing for local development?

Automating git branch management and testing involves creating a sibling worktree from HEAD and running project tests inside it. This local development workflow isolates test execution safely without manual branch switching.

Does git worktree testing work with npm, pytest, go, and cargo projects?

Yes, git worktree testing supports npm, pytest, go, and cargo projects. The script auto-detects your project type and runs the appropriate default test commands, or you can provide a custom test command.

Can I reuse an existing worktree path when running isolated tests?

Yes, you can reuse an existing worktree path when running isolated tests. If a worktree is already present at the specified path, the script will reuse it instead of creating a new one.

How do I specify a custom branch name and test command when creating a worktree?

You can specify a custom branch name and test command by passing optional inputs for branch name and test command to the script. This allows you to override the default test execution within the new worktree.

Why should I use a git worktree for running tests instead of a regular branch checkout?

You should use a git worktree for running tests to maintain an isolated workspace that does not disrupt your main checkout. This allows safe testing of changes while preserving your current development environment.