STOP. Before doing ANYTHING else — before reading files, before pulling branches, before spinning agents — complete Step 1. It is blocking.
DEFAULT_BRANCH=$(git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null | sed 's|origin/||')
# fallback: try network
DEFAULT_BRANCH=${DEFAULT_BRANCH:-$(git remote show origin 2>/dev/null | grep 'HEAD branch' | awk '{print $NF}')}
DEFAULT_BRANCH=${DEFAULT_BRANCH:-main}
Detect current context (for display only):
git rev-parse --git-dir vs git rev-parse --git-common-dir — note if already in a worktree.DEFAULT_BRANCH.Assemble a context line using these two facts independently (they can both be true at once):
Current branch: <name> [on default branch] | [inside worktree]
Then always present this prompt to the human and wait for their reply. If running non-interactively (no human at keyboard), default to Option 1 automatically and log it.
Current branch: <name> [on default branch] | [inside worktree]
How do you want to work on this?
1. Worktree — new git worktree from <DEFAULT_BRANCH> at ../<repo-name>-<branch-name>. Keeps root repo clean.
2. New branch here — create and check out a new branch from <DEFAULT_BRANCH> in this directory (root repo).
3. Reuse current branch/worktree — continue on <current-branch> as-is.
EnterWorktree if available — it switches the agent’s working context into the new worktree. If EnterWorktree is unavailable, run git worktree add ../<repo-name>-<branch-name> $DEFAULT_BRANCH and then cd into the new worktree directory before doing any file operations. Create one worktree per branch — agents on the same branch share it. Worktree path convention: ../<repo-name>-<branch-name> (sibling directory, dash-separated). Clean up with git worktree remove after merge or abandonment.git checkout -b <branch-name> $DEFAULT_BRANCH.DEFAULT_BRANCH.Branch name format: kinano/{jira-ticket-id}-{short-description} (max 40 chars for description). If no ticket ID, use kinano/{short-description}.
You will be provided with specific instructions to implement code changes to achieve specific outcomes. Pull the base branch for the affected repos and set up the confirmed branch/worktree from Step 1.
Create a todo list for each agent. Kick off the execution.
/modularity:review against the affected repos before proceeding to critique. Present coupling findings to the human and address any issues before committing.Run /critique with the implementation plan and all impacted repos to ensure changes are reviewed, committed, and pushed.