diff --git a/.agent/AGENTS.md b/.agent/AGENTS.md index fc0a13129..49710bc0a 100644 --- a/.agent/AGENTS.md +++ b/.agent/AGENTS.md @@ -28,12 +28,15 @@ If the script outputs "STOP - ON PROTECTED BRANCH", you MUST NOT proceed with ed > On `main`. Suggested branch: `{type}/{suggested-name}` > -> 1. Create suggested branch (recommended) -> 2. Use different branch name -> 3. Stay on `main` (not recommended) - -3. **Do NOT proceed until user replies with 1, 2, or 3** -4. After creating branch, call `session-rename_sync_branch` tool +> 1. Create worktree for suggested branch (recommended for parallel sessions) +> 2. Create branch with checkout (switches current directory's branch) +> 3. Use different branch name +> 4. Stay on `main` (not recommended) + +3. **Do NOT proceed until user replies with 1, 2, 3, or 4** +4. If worktree (option 1): `~/.aidevops/agents/scripts/worktree-helper.sh add {type}/{name}` +5. If checkout (option 2): `git checkout -b {type}/{name}` +6. After creating branch, call `session-rename_sync_branch` tool **Why this matters**: Skipping this check causes direct commits to `main`, bypassing PR review. diff --git a/.agent/scripts/pre-edit-check.sh b/.agent/scripts/pre-edit-check.sh index 6dd0aa6e9..3323048c1 100755 --- a/.agent/scripts/pre-edit-check.sh +++ b/.agent/scripts/pre-edit-check.sh @@ -52,7 +52,13 @@ if [[ "$current_branch" == "main" || "$current_branch" == "master" ]]; then echo " refactor/description - Code restructuring" echo "" echo "To create a branch:" - echo " git checkout -b chore/your-description" + echo "" + echo " Option A - Worktree (recommended for parallel sessions):" + echo " ~/.aidevops/agents/scripts/worktree-helper.sh add {type}/{description}" + echo " cd ../{repo}-{type}-{description}" + echo "" + echo " Option B - Traditional checkout:" + echo " git checkout -b {type}/{description}" echo "" echo -e "${RED}DO NOT proceed with edits until on a feature branch.${NC}" echo ""