/moai-workflow-worktree
Git worktree management for parallel SPEC development with isolated workspaces, automatic branch registration, and seamless MoAI-ADK integration. Use when setting up parallel development environments.
$ npx -y skills add modu-ai/moai-adk --skill moai-workflow-worktree --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/moai-workflow-worktree
Context preview
The summary Claude sees to decide when to auto-load this skill.
Git worktree management for parallel SPEC development with isolated workspaces, automatic branch registration, and seamless MoAI-ADK integration. Use when setting up parallel development environments.
SKILL.md
moai-workflow-worktree.SKILL.mdname: moai-workflow-worktree
description: >
Git worktree management for parallel SPEC development with isolated workspaces,
automatic branch registration, and seamless MoAI-ADK integration. Use when
setting up parallel development environments.
when_to_use: >
Use for git worktree management: parallel SPEC development with isolated
workspaces, automatic branch registration, branch isolation, and
seamless MoAI-ADK integration for multiple concurrent SPECs.
license: Apache-2.0
compatibility: Designed for Claude Code
allowed-tools: Read, Write, Grep, Glob
user-invocable: false
metadata:
version: "1.1.0"
category: "workflow"
status: "active"
updated: "2026-01-08"
modularized: "true"
tags: "git, worktree, parallel, development, spec, isolation"
# MoAI Extension: Progressive Disclosure
progressive_disclosure:
enabled: true
level1_tokens: 100
level2_tokens: 5000
MoAI Worktree Management
Git worktree management system for parallel SPEC development with isolated workspaces, automatic registration, and seamless MoAI-ADK integration.
Core Philosophy: Each SPEC deserves its own isolated workspace to enable true parallel development without context switching overhead.
Quick Reference (30 seconds)
What is MoAI Worktree Management? A specialized Git worktree system that creates isolated development environments for each SPEC, enabling parallel development without conflicts.
Key Features:
- Isolated Workspaces: Each SPEC gets its own worktree with independent Git state
- Automatic Registration: Worktree registry tracks all active workspaces
- Parallel Development: Multiple SPECs can be developed simultaneously
- Seamless Integration: Works with /moai:1-plan, /moai:2-run, /moai:3-sync workflow
- Smart Synchronization: Automatic sync with base branch when needed
- Cleanup Automation: Automatic cleanup of merged worktrees
Quick Access:
- CLI commands: Refer to Worktree Commands Module at modules/worktree-commands.md
- Management patterns: Refer to Worktree Management Module at modules/worktree-management.md
- Parallel workflow: Refer to Parallel Development Module at modules/parallel-development.md
- Integration guide: Refer to Integration Patterns Module at modules/integration-patterns.md
- Troubleshooting: Refer to Troubleshooting Module at modules/troubleshooting.md
Use Cases:
- Multiple SPECs development in parallel
- Isolated testing environments
- Feature branch isolation
- Code review workflows
- Experimental feature development
---
Implementation Guide (5 minutes)
1. Core Architecture - Worktree Management System
Purpose: Create isolated Git worktrees for parallel SPEC development.
Key Components:
1. Worktree Registry - Central registry tracking all worktrees 2. Manager Layer - Core worktree operations including create, switch, remove, and sync 3. CLI Interface - User-friendly command interface 4. Models - Data structures for worktree metadata 5. Integration Layer - MoAI-ADK workflow integration
Registry Structure:
The registry file stores worktree metadata in JSON format. Each worktree entry contains an identifier, file path, branch name, creation timestamp, last sync time, status (active or merged), and base branch reference. The config section defines the worktree root directory, auto-sync preference, and cleanup behavior for merged branches.
File Structure:
The worktree system creates a dedicated directory structure in the user's global home directory. At the worktree root (~/.moai/worktrees/{ProjectName}/), you will find the central registry JSON file and individual directories for each SPEC. Each SPEC directory contains a .git file for worktree metadata and a complete copy of all project files.
Detailed Reference: Refer to Worktree Management Module at modules/worktree-management.md
---
2. CLI Commands - Complete Command Interface
Purpose: Provide intuitive CLI commands for worktree management.
Core Commands:
To create a new worktree for a SPEC, use the new command followed by the SPEC ID and description. To list all worktrees, use the list command. To switch to a specific worktree, use the switch command with the SPEC ID. To get the worktree path for shell integration, use the go command with eval. To sync a worktree with its base branch, use the sync command. To remove a worktree, use the remove command. To clean up merged worktrees, use the clean command. To show worktree status, use the status command. For configuration management, use the config command with get or set subcommands.
Command Categories:
1. Creation: The new command creates an isolated worktree 2. Navigation: The list, switch, and go commands enable browsing and navigating 3. Management: The sync, remove, and clean commands maintain worktrees 4. Status: The status command checks worktree state 5. Configuration: The config command manages settings
Shell Integration:
For switching to a worktree directory, two approaches work well. The switch command directly changes to the worktree directory. The go command outputs a cd command that can be evaluated by the shell, which is the recommended pattern for shell scripts and automation.
Detailed Reference: Refer to Worktree Commands Module at modules/worktree-commands.md
---
3. Parallel Development Workflow - Isolated SPEC Development
Purpose: Enable true parallel development without context switching.
Workflow Integration:
During the Plan Phase using /moai:1-plan, the SPEC is created and the worktree new command sets up automatic worktree isolation.
During the Development Phase, the isolated worktree environment provides independent Git state with zero context switching overhead.
During the Sync Phase using /moai:3-sync, the worktree sync command ensures clean integration with conflict resolution support.
During the Cleanup Phase, the worktree clean command provides automatic cleanup with registry maintenance.
Parallel Development Benefits:
1. Context Isolation: Each SPEC has its own G
Read more
name: moai-workflow-worktree description: > Git worktree management for parallel SPEC development with isolated workspaces, automatic branch registration, and seamless MoAI-ADK integration. Use when setting up parallel development environments. when_to_use: > Use for git worktree management: parallel SPEC development with isolated workspaces, automatic branch registration, branch isolation, and seamless MoAI-ADK integration for multiple concurrent SPECs. license: Apache-2.0 compatibility: Designed for Claude Code allowed-tools: Read, Write, Grep, Glob user-invocable: false metadata: version: "1.1.0" category: "workflow" status: "active" updated: "2026-01-08" modularized: "true" tags: "git, worktree, parallel, development, spec, isolation" # MoAI Extension: Progressive Disclosure progressive_disclosure: enabled: true level1_tokens: 100 level2_tokens: 5000
MoAI Worktree Management
Git worktree management system for parallel SPEC development with isolated workspaces, automatic registration, and seamless MoAI-ADK integration.
Core Philosophy: Each SPEC deserves its own isolated workspace to enable true parallel development without context switching overhead.
Quick Reference (30 seconds)
What is MoAI Worktree Management? A specialized Git worktree system that creates isolated development environments for each SPEC, enabling parallel development without conflicts.
Key Features:
- Isolated Workspaces: Each SPEC gets its own worktree with independent Git state
- Automatic Registration: Worktree registry tracks all active workspaces
- Parallel Development: Multiple SPECs can be developed simultaneously
- Seamless Integration: Works with /moai:1-plan, /moai:2-run, /moai:3-sync workflow
- Smart Synchronization: Automatic sync with base branch when needed
- Cleanup Automation: Automatic cleanup of merged worktrees
Quick Access:
- CLI commands: Refer to Worktree Commands Module at modules/worktree-commands.md
- Management patterns: Refer to Worktree Management Module at modules/worktree-management.md
- Parallel workflow: Refer to Parallel Development Module at modules/parallel-development.md
- Integration guide: Refer to Integration Patterns Module at modules/integration-patterns.md
- Troubleshooting: Refer to Troubleshooting Module at modules/troubleshooting.md
Use Cases:
- Multiple SPECs development in parallel
- Isolated testing environments
- Feature branch isolation
- Code review workflows
- Experimental feature development
---
Implementation Guide (5 minutes)
1. Core Architecture - Worktree Management System
Purpose: Create isolated Git worktrees for parallel SPEC development.
Key Components:
1. Worktree Registry - Central registry tracking all worktrees 2. Manager Layer - Core worktree operations including create, switch, remove, and sync 3. CLI Interface - User-friendly command interface 4. Models - Data structures for worktree metadata 5. Integration Layer - MoAI-ADK workflow integration
Registry Structure:
The registry file stores worktree metadata in JSON format. Each worktree entry contains an identifier, file path, branch name, creation timestamp, last sync time, status (active or merged), and base branch reference. The config section defines the worktree root directory, auto-sync preference, and cleanup behavior for merged branches.
File Structure:
The worktree system creates a dedicated directory structure in the user's global home directory. At the worktree root (~/.moai/worktrees/{ProjectName}/), you will find the central registry JSON file and individual directories for each SPEC. Each SPEC directory contains a .git file for worktree metadata and a complete copy of all project files.
Detailed Reference: Refer to Worktree Management Module at modules/worktree-management.md
---
2. CLI Commands - Complete Command Interface
Purpose: Provide intuitive CLI commands for worktree management.
Core Commands:
To create a new worktree for a SPEC, use the new command followed by the SPEC ID and description. To list all worktrees, use the list command. To switch to a specific worktree, use the switch command with the SPEC ID. To get the worktree path for shell integration, use the go command with eval. To sync a worktree with its base branch, use the sync command. To remove a worktree, use the remove command. To clean up merged worktrees, use the clean command. To show worktree status, use the status command. For configuration management, use the config command with get or set subcommands.
Command Categories:
1. Creation: The new command creates an isolated worktree 2. Navigation: The list, switch, and go commands enable browsing and navigating 3. Management: The sync, remove, and clean commands maintain worktrees 4. Status: The status command checks worktree state 5. Configuration: The config command manages settings
Shell Integration:
For switching to a worktree directory, two approaches work well. The switch command directly changes to the worktree directory. The go command outputs a cd command that can be evaluated by the shell, which is the recommended pattern for shell scripts and automation.
Detailed Reference: Refer to Worktree Commands Module at modules/worktree-commands.md
---
3. Parallel Development Workflow - Isolated SPEC Development
Purpose: Enable true parallel development without context switching.
Workflow Integration:
During the Plan Phase using /moai:1-plan, the SPEC is created and the worktree new command sets up automatic worktree isolation.
During the Development Phase, the isolated worktree environment provides independent Git state with zero context switching overhead.
During the Sync Phase using /moai:3-sync, the worktree sync command ensures clean integration with conflict resolution support.
During the Cleanup Phase, the worktree clean command provides automatic cleanup with registry maintenance.
Parallel Development Benefits:
1. Context Isolation: Each SPEC has its own G
Agentic development harness for Claude Code — SPEC-driven plan/run/sync, TRUST 5 quality gates, model+effort routing, and Claude×GLM multi-LLM cost control. Single Go binary, 16 languages, zero deps.
Repo: modu-ai/moai-adk
Other skills on moai-adk.
- /hns-lsel-applier
Local Self-Evolution Loop (LSEL) APPLY engine — the playback-only consumer of approved decision.json records that drives `.moai/hooks/lsel-apply.sh` for the GOOS-local PROPOSE→APPLY seam closure (SPEC-LSEL-LOCAL-EVOLUTION-001 M3). Reads an approved decision.json, validates the
Open skill - /hns-lsel-curator
Local Self-Evolution Loop (LSEL) curator — the CLUSTER + drain engine for the GOOS-local PROPOSE→APPLY seam closure (SPEC-LSEL-LOCAL-EVOLUTION-001). Companion-offset drain of .moai/lessons-inbox.jsonl with a drain-side severity filter that drops the ~65% Bash-timeout/sandbox
Open skill - /hns-moaiadk-best-practices
moai-adk-go best-practices reference for the 4 harness specialists (cli-template-specialist, quality-specialist, workflow-specialist, hook-ci-specialist). Covers TRUST 5 gates, Go test isolation (t.TempDir, no OTEL env in parallel tests), hardcoding-prevention rules (env
Open skill - /hns-moaiadk-dev-reference
moai-adk-go local dev reference — version management/release process (sec 5), shell-script hook development (sec 7), build & dev commands (sec 10). Load only when performing these specific tasks.
Open skill - /hns-moaiadk-patterns
moai-adk-go domain-patterns reference for the 4 harness specialists (cli-template-specialist, quality-specialist, workflow-specialist, hook-ci-specialist). Covers the CLI/template/config/hook/spec subsystem architecture, key source paths, the Pipeline specialist delegation map,
Open skill - /hns-oss-docs-i18n-rules
HARD i18n rules digest for the oss-docs harness specialists working on moai-adk-go README 4-locale set and the docs-site (adk.mo.ai.kr). Covers the canonical-locale chains, the 4-locale same-PR obligation, Mermaid TD-only, the no-emoji + icon-shortcode rule, emphasis-marker
Open skill

