sdcorejs-using-worktrees

Create isolated git worktrees for AI coding tasks before builds.

2|Updated Apr 18, 2026
One-click install
npx skills add https://github.com/sdcorejs/sdcorejs-agent --skill sdcorejs-using-worktrees
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sdcorejs-using-worktrees
Source: https://github.com/sdcorejs/sdcorejs-agent/tree/main/plugin/skills/sdcorejs-using-worktrees
Command: npx skills add https://github.com/sdcorejs/sdcorejs-agent --skill sdcorejs-using-worktrees

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents AI code generation from modifying the user’s live branch by creating an isolated workspace for the build and subsequent write-code steps.

Core Features & Use Cases

  • Detects existing isolation first: skips worktree creation when already inside a linked worktree (with a submodule guard).
  • Creates isolated workspace safely: uses a native worktree tool when available, otherwise falls back to git worktree with a project-local ignored directory.
  • Prepares a clean baseline: runs per-stack setup and a baseline build/test so later failures are attributable to new changes.
  • Enables parallel agent fan-out: provides separate directories for parallel/split execution without trampling branches.
  • Use Case: When a user asks to “chạy song song nhiều feature”, each feature generation can run in its own isolated worktree, preserving the current branch.

Quick Start

Tell the AI: “Tạo worktree riêng trước khi chạy angular-portal-write-code để cô lập công việc, không đụng nhánh hiện tại.”

Frequently Asked Questions about sdcorejs-using-worktrees

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

FAQPage Schema
How do I isolate AI code generation from my current git branch?▼

Git worktrees isolate AI code generation by creating a separate workspace directory for write-code steps. This prevents automated changes from modifying your live branch while still allowing builds and tests to run safely.

Can I run parallel feature development without trampling my git branches?▼

Yes, you can run parallel feature development without trampling branches by dispatching each feature generation into its own isolated git worktree. This workspace isolation provides separate directories for parallel execution, protecting the main branch from concurrent modifications.

Does git worktree workspace isolation work with NestJS and Next.js workflows?▼

Git worktree workspace isolation works with NestJS and Next.js workflows by applying stack-appropriate dependency installation before code generation. It detects the existing stack and runs a clean baseline build and test to ensure later failures are attributable to new changes.

What happens if I run a worktree setup inside an existing git worktree?▼

If you run a worktree setup inside an existing linked worktree, the process detects the current isolation and skips creating a new one. It includes a submodule guard to prevent duplicate workspace creation and avoid directory conflicts.

How do I prepare a clean baseline build before dispatching parallel code generation tasks?▼

To prepare a clean baseline build before parallel dispatch, set up an isolated git worktree and run stack-appropriate dependency installation. This clean baseline build and test ensures any subsequent failures during code generation are directly attributable to new changes.

What is the best way to avoid AI coding agents modifying my live Node.js project branch?▼

The best way to avoid AI agents modifying your live Node.js project branch is creating an isolated git worktree. This workspace isolation safely diverts write-code steps into a project-local ignored directory, keeping your active branch untouched.