ck:worktree

Creates Git worktrees with smart naming, placement, and .env copying for parallel development.

1|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/quanganh208/cookmate --skill ck-worktree-quanganh208
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ck:worktree
Source: https://github.com/quanganh208/cookmate/tree/main/.opencode/skills/worktree
Command: npx skills add https://github.com/quanganh208/cookmate --skill ck-worktree-quanganh208

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill removes the friction of creating isolated git worktrees for parallel feature development across monorepos and standalone repositories by automating branch name generation, safe sanitization, worktree placement, and environment template copying so teams can work in parallel without polluting repository roots.

Core Features & Use Cases

  • Smart branch naming: Detects pre-formed branch names, infers prefixes from natural language descriptions, sanitizes slugs, preserves multi-segment branches with --no-prefix, and enforces length limits.
  • Monorepo & superproject support: Detects projects from .gitmodules, prompts for project selection when needed, and chooses an appropriate worktree root (superproject, monorepo internal, or sibling directory).
  • Safe environment handling & automation: Copies .env*.example templates, validates requested env files to prevent path traversal, supports dry-run and JSON outputs for LLM integration, and warns about dirty working trees.
  • Use Case: Create a per-feature worktree for a mobile app within a monorepo, automatically generate a sanitized feature branch, copy environment templates, and open a clean directory for development.

Quick Start

Create a dry-run worktree for project apps/mobile with the feature "add authentication" using prefix feat and return the proposed branch and worktree path.

Frequently Asked Questions about ck:worktree

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

FAQPage Schema
How do I create an isolated git worktree for parallel feature development in a monorepo?

To create an isolated git worktree in a monorepo, the system detects projects from .gitmodules, prompts for project selection, and automatically chooses an appropriate worktree root such as superproject, monorepo internal, or a sibling directory for parallel development.

How does smart branch naming work when generating git worktrees?

Smart branch naming for git worktrees detects pre-formed branch names, infers prefixes from natural language descriptions, sanitizes slugs to meet length limits, and preserves multi-segment branches when using the --no-prefix flag.

Can I safely copy .env templates when setting up a new git worktree?

Yes, you can safely copy .env templates when setting up a git worktree. The process copies .env*.example files, validates requested environment files to prevent path traversal attacks, and warns about dirty working trees before proceeding.

What is the best way to automate git worktree creation for LLM integration?

The best way to automate git worktree creation for LLM integration is using dry-run and JSON output modes. These modes propose sanitized branch names and worktree paths programmatically without modifying the repository structure.

Does this worktree automation tool support standalone repositories alongside monorepos?

Yes, this worktree automation tool applies to both standalone repositories and monorepos. It handles branch naming conventions, smart worktree root selection, and environment file validation across both project structures.

Why should I use git worktrees instead of cloning a repository multiple times?

Git worktrees enable parallel feature development without polluting repository roots or consuming disk space like duplicate clones. They allow you to manage multiple branches simultaneously in isolated directories while sharing a single git history.