Purpose: Seamless integration with MoAI-ADK Plan-Run-Sync workflow.
Integration Points:
During Plan Phase Integration with /moai:1-plan, after SPEC creation, create the worktree using the new command with the SPEC ID. The output provides guidance for switching to the worktree using either the switch command or the shell eval pattern with the go command.
During Development Phase with /moai:2-run, worktree isolation provides a clean development environment with independent Git state preventing conflicts and automatic registry tracking.
During Sync Phase with /moai:3-sync, before PR creation run the sync command for the SPEC. After PR merge, run the clean command with the merged-only flag to remove completed worktrees.
Auto-Detection Patterns:
The system detects worktree environments by checking for the registry file in the parent directory. When detected, the SPEC ID is extracted from the current directory name. The status command with sync-check option automatically identifies worktrees that need synchronization.
Configuration Integration:
The MoAI configuration supports worktree settings including auto_create for automatic worktree creation, auto_sync for automatic synchronization, cleanup_merged for automatic cleanup of merged branches, and worktree_root for specifying the worktree directory location with project name substitution.
Detailed Reference: Refer to Integration Patterns Module at modules/integration-patterns.md
目的:与MoAI-ADK的Plan-Run-Sync工作流无缝集成。
集成点:
在与/moai:1-plan集成的规划阶段,SPEC创建完成后,使用new命令并指定SPEC ID来创建worktree。输出内容会指导你使用switch命令或配合Shell eval的go命令来切换到worktree。
在使用/moai:2-run的开发阶段,worktree隔离提供了干净的开发环境,独立的Git状态可防止冲突,并自动跟踪注册表。
在使用/moai:3-sync的同步阶段,创建PR前运行对应SPEC的sync命令。PR合并后,使用clean命令并加上merged-only标志来移除已完成的worktree。
自动检测模式:
系统会通过检查父目录中的注册表文件来检测worktree环境。检测到后,会从当前目录名称中提取SPEC ID。使用status命令并加上sync-check选项可自动识别需要同步的worktree。
配置集成:
MoAI配置支持worktree相关设置,包括auto_create(自动创建worktree)、auto_sync(自动同步)、cleanup_merged(自动清理已合并分支)和worktree_root(指定worktree目录位置,支持项目名称替换)。
详细参考:参考modules/integration-patterns.md中的集成模式模块