Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
},
"permissions": {
"allow": [
"Bash(cat *)",
"Bash(find *)",
"Bash(gh auth status)",
"Bash(gh issue comment *)",
"Bash(gh issue list *)",
Expand All @@ -97,7 +99,12 @@
"Bash(gh project view *)",
"Bash(gh repo view *)",
"Bash(gh search issues *)",
"Bash(radio *)"
"Bash(ls *)",
"Bash(radio *)",
"Bash(rg *)",
"Glob",
"Grep",
"Read"
]
}
}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),

### Fixed

- **`task-done --remove-worktree` now force-deletes reviewer branches so `task-reviewer` re-dispatch isn't blocked.** The cleanup's `git branch -d` is the safe-delete variant that requires the branch to be fully merged into HEAD — correct for worker branches (don't drop unmerged work), but wrong for reviewer worktrees, whose `task/review-pr<N>` branch is forked from the PR's head ref and is never going to land in main (the PR is). Result: every reviewer cleanup left `task/review-pr<N>` behind as an orphan, and the next `task-reviewer <N>` refused to dispatch via its per-PR guard with `Error: a review worktree or branch already exists`. The user had to manually `git branch -D task/review-pr<N>` between every re-review round. `task-done` now branches on the `PR_NUMBER=` marker that `task-reviewer` writes into the worktree's `.info` file: when present it does `git branch -D` (scaffold-only, safe to force); when absent worker behavior is unchanged. Lands across the `task-done-std` and `task-done-local` drift groups (7 binaries). (#148)
- **`task-reviewer`'s spec-issue cross-check now works on `claude-jira` / `claude-notion` / `claude-local`.** The dispatcher and the `/reviewer` prompt were both GitHub-only: `parse_issue_number` rejected anything that wasn't a bare integer or `github.com/.../issues/N`; PR-body auto-detect only matched `Closes #N`; the URL-synthesis step always emitted a GitHub issues URL; and the prompt hardcoded `gh issue view <M>` for spec lookup. Net result: in any non-gh loadout, `task-reviewer <pr> <spec-id>` silently degraded to a diff-only review. The dispatcher is now loadout-aware (detects from its own file path) — `claude-gh` keeps numeric / URL parsing and PR-body auto-detect; `claude-jira` / `claude-notion` / `claude-local` accept any non-empty 2nd positional arg as an opaque spec identifier (Jira key, Notion URL, local task slug) and pass it through to `/reviewer` unchanged. The 4 dispatcher bodies stay byte-identical (drift-checked). Each loadout's `commands/reviewer.md` now points the spec-lookup step at the right tool: GH stays on `gh issue view`; `claude-jira` uses `mcp__atlassian__getJiraIssue`; `claude-notion` uses `mcp__notion__notion-fetch`; `claude-local` reads `tasks/<id>-<slug>.md` via the `Read` tool. With no 2nd arg in a non-gh loadout, the wrapper emits a clear "PR-body auto-detect is GitHub-only — pass the spec id explicitly" advisory and proceeds diff-only. **Upgrading**: re-run `task-init <loadout>` after pulling this change so the updated `/reviewer` prompt lands in `.claude/commands/`. (#144)

### Changed
Expand Down
25 changes: 22 additions & 3 deletions claude-gh/bin/task-done
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ INFO_FILE="${WORKTREE_BASE}/.${SLUG}.info"

# Load base branch written by task-work; fall back to "main"
BASE_BRANCH="main"
# Zero PR_NUMBER before sourcing $INFO_FILE so an ambient shell export
# (e.g., from an earlier task-reviewer in the same shell) can't sneak
# into the reviewer-branch force-delete guard below and -D a worker
# branch with unmerged commits (#148 review).
PR_NUMBER=
# shellcheck source=/dev/null
[[ -f "$INFO_FILE" ]] && source "$INFO_FILE"
# endregion:worktree-context
Expand Down Expand Up @@ -147,10 +152,24 @@ git worktree remove "$WORKTREE_DIR" --force || {
# Clean up info file
[[ -f "$INFO_FILE" ]] && rm -f "$INFO_FILE"

if git branch -d "$BRANCH" 2>/dev/null; then
echo "Done. Deleted local branch '$BRANCH'."
# Reviewer worktrees write PR_NUMBER into their info file; they're pure
# scaffolding and their branch never merges into main (the PR does — its
# head ref is what landed). Force-delete in that case so a subsequent
# `task-reviewer <N>` re-dispatch isn't blocked by the per-PR branch
# guard (#148). Worker branches keep the safe-delete `-d` so unmerged
# work isn't silently dropped.
if [[ -n "${PR_NUMBER:-}" ]]; then
if git branch -D "$BRANCH" 2>/dev/null; then
echo "Done. Deleted reviewer branch '$BRANCH' (-D, scaffold-only)."
else
echo "Done. Branch '$BRANCH' could not be deleted — clean up manually: git branch -D $BRANCH"
fi
else
echo "Done. Branch '$BRANCH' still has unmerged commits — delete manually after PR merge: git branch -D $BRANCH"
if git branch -d "$BRANCH" 2>/dev/null; then
echo "Done. Deleted local branch '$BRANCH'."
else
echo "Done. Branch '$BRANCH' still has unmerged commits — delete manually after PR merge: git branch -D $BRANCH"
fi
fi

# Close this worker's zellij tab by its stable tab_id, captured before
Expand Down
25 changes: 22 additions & 3 deletions claude-jira/bin/task-done
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ INFO_FILE="${WORKTREE_BASE}/.${SLUG}.info"

# Load base branch written by task-work; fall back to "main"
BASE_BRANCH="main"
# Zero PR_NUMBER before sourcing $INFO_FILE so an ambient shell export
# (e.g., from an earlier task-reviewer in the same shell) can't sneak
# into the reviewer-branch force-delete guard below and -D a worker
# branch with unmerged commits (#148 review).
PR_NUMBER=
# shellcheck source=/dev/null
[[ -f "$INFO_FILE" ]] && source "$INFO_FILE"
# endregion:worktree-context
Expand Down Expand Up @@ -153,10 +158,24 @@ git worktree remove "$WORKTREE_DIR" --force || {
# Clean up info file
[[ -f "$INFO_FILE" ]] && rm -f "$INFO_FILE"

if git branch -d "$BRANCH" 2>/dev/null; then
echo "Done. Deleted local branch '$BRANCH'."
# Reviewer worktrees write PR_NUMBER into their info file; they're pure
# scaffolding and their branch never merges into main (the PR does — its
# head ref is what landed). Force-delete in that case so a subsequent
# `task-reviewer <N>` re-dispatch isn't blocked by the per-PR branch
# guard (#148). Worker branches keep the safe-delete `-d` so unmerged
# work isn't silently dropped.
if [[ -n "${PR_NUMBER:-}" ]]; then
if git branch -D "$BRANCH" 2>/dev/null; then
echo "Done. Deleted reviewer branch '$BRANCH' (-D, scaffold-only)."
else
echo "Done. Branch '$BRANCH' could not be deleted — clean up manually: git branch -D $BRANCH"
fi
else
echo "Done. Branch '$BRANCH' still has unmerged commits — delete manually after PR merge: git branch -D $BRANCH"
if git branch -d "$BRANCH" 2>/dev/null; then
echo "Done. Deleted local branch '$BRANCH'."
else
echo "Done. Branch '$BRANCH' still has unmerged commits — delete manually after PR merge: git branch -D $BRANCH"
fi
fi

# Close this worker's zellij tab by its stable tab_id, captured before
Expand Down
25 changes: 22 additions & 3 deletions claude-local/bin/task-done
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ INFO_FILE="${WORKTREE_BASE}/.${SLUG}.info"

# Load base branch written by task-work; fall back to "main"
BASE_BRANCH="main"
# Zero PR_NUMBER before sourcing $INFO_FILE so an ambient shell export
# (e.g., from an earlier task-reviewer in the same shell) can't sneak
# into the reviewer-branch force-delete guard below and -D a worker
# branch with unmerged commits (#148 review).
PR_NUMBER=
# shellcheck source=/dev/null
[[ -f "$INFO_FILE" ]] && source "$INFO_FILE"
# endregion:worktree-context
Expand Down Expand Up @@ -167,10 +172,24 @@ else
fi
fi

if git branch -d "$BRANCH" 2>/dev/null; then
echo "Done. Deleted local branch '$BRANCH'."
# Reviewer worktrees write PR_NUMBER into their info file; they're pure
# scaffolding and their branch never merges into main (the PR does — its
# head ref is what landed). Force-delete in that case so a subsequent
# `task-reviewer <N>` re-dispatch isn't blocked by the per-PR branch
# guard (#148). Worker branches keep the safe-delete `-d` so unmerged
# work isn't silently dropped.
if [[ -n "${PR_NUMBER:-}" ]]; then
if git branch -D "$BRANCH" 2>/dev/null; then
echo "Done. Deleted reviewer branch '$BRANCH' (-D, scaffold-only)."
else
echo "Done. Branch '$BRANCH' could not be deleted — clean up manually: git branch -D $BRANCH"
fi
else
echo "Done. Branch '$BRANCH' still has unmerged commits — delete manually after PR merge: git branch -D $BRANCH"
if git branch -d "$BRANCH" 2>/dev/null; then
echo "Done. Deleted local branch '$BRANCH'."
else
echo "Done. Branch '$BRANCH' still has unmerged commits — delete manually after PR merge: git branch -D $BRANCH"
fi
fi

# Close this worker's zellij tab by its stable tab_id, captured before
Expand Down
25 changes: 22 additions & 3 deletions claude-notion/bin/task-done
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ INFO_FILE="${WORKTREE_BASE}/.${SLUG}.info"

# Load base branch written by task-work; fall back to "main"
BASE_BRANCH="main"
# Zero PR_NUMBER before sourcing $INFO_FILE so an ambient shell export
# (e.g., from an earlier task-reviewer in the same shell) can't sneak
# into the reviewer-branch force-delete guard below and -D a worker
# branch with unmerged commits (#148 review).
PR_NUMBER=
# shellcheck source=/dev/null
[[ -f "$INFO_FILE" ]] && source "$INFO_FILE"
# endregion:worktree-context
Expand Down Expand Up @@ -147,10 +152,24 @@ git worktree remove "$WORKTREE_DIR" --force || {
# Clean up info file
[[ -f "$INFO_FILE" ]] && rm -f "$INFO_FILE"

if git branch -d "$BRANCH" 2>/dev/null; then
echo "Done. Deleted local branch '$BRANCH'."
# Reviewer worktrees write PR_NUMBER into their info file; they're pure
# scaffolding and their branch never merges into main (the PR does — its
# head ref is what landed). Force-delete in that case so a subsequent
# `task-reviewer <N>` re-dispatch isn't blocked by the per-PR branch
# guard (#148). Worker branches keep the safe-delete `-d` so unmerged
# work isn't silently dropped.
if [[ -n "${PR_NUMBER:-}" ]]; then
if git branch -D "$BRANCH" 2>/dev/null; then
echo "Done. Deleted reviewer branch '$BRANCH' (-D, scaffold-only)."
else
echo "Done. Branch '$BRANCH' could not be deleted — clean up manually: git branch -D $BRANCH"
fi
else
echo "Done. Branch '$BRANCH' still has unmerged commits — delete manually after PR merge: git branch -D $BRANCH"
if git branch -d "$BRANCH" 2>/dev/null; then
echo "Done. Deleted local branch '$BRANCH'."
else
echo "Done. Branch '$BRANCH' still has unmerged commits — delete manually after PR merge: git branch -D $BRANCH"
fi
fi

# Close this worker's zellij tab by its stable tab_id, captured before
Expand Down
25 changes: 22 additions & 3 deletions kiro-gh/bin/task-done
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ INFO_FILE="${WORKTREE_BASE}/.${SLUG}.info"

# Load base branch written by task-work; fall back to "main"
BASE_BRANCH="main"
# Zero PR_NUMBER before sourcing $INFO_FILE so an ambient shell export
# (e.g., from an earlier task-reviewer in the same shell) can't sneak
# into the reviewer-branch force-delete guard below and -D a worker
# branch with unmerged commits (#148 review).
PR_NUMBER=
# shellcheck source=/dev/null
[[ -f "$INFO_FILE" ]] && source "$INFO_FILE"
# endregion:worktree-context
Expand Down Expand Up @@ -147,10 +152,24 @@ git worktree remove "$WORKTREE_DIR" --force || {
# Clean up info file
[[ -f "$INFO_FILE" ]] && rm -f "$INFO_FILE"

if git branch -d "$BRANCH" 2>/dev/null; then
echo "Done. Deleted local branch '$BRANCH'."
# Reviewer worktrees write PR_NUMBER into their info file; they're pure
# scaffolding and their branch never merges into main (the PR does — its
# head ref is what landed). Force-delete in that case so a subsequent
# `task-reviewer <N>` re-dispatch isn't blocked by the per-PR branch
# guard (#148). Worker branches keep the safe-delete `-d` so unmerged
# work isn't silently dropped.
if [[ -n "${PR_NUMBER:-}" ]]; then
if git branch -D "$BRANCH" 2>/dev/null; then
echo "Done. Deleted reviewer branch '$BRANCH' (-D, scaffold-only)."
else
echo "Done. Branch '$BRANCH' could not be deleted — clean up manually: git branch -D $BRANCH"
fi
else
echo "Done. Branch '$BRANCH' still has unmerged commits — delete manually after PR merge: git branch -D $BRANCH"
if git branch -d "$BRANCH" 2>/dev/null; then
echo "Done. Deleted local branch '$BRANCH'."
else
echo "Done. Branch '$BRANCH' still has unmerged commits — delete manually after PR merge: git branch -D $BRANCH"
fi
fi

# Close this worker's zellij tab by its stable tab_id, captured before
Expand Down
25 changes: 22 additions & 3 deletions kiro-local/bin/task-done
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ INFO_FILE="${WORKTREE_BASE}/.${SLUG}.info"

# Load base branch written by task-work; fall back to "main"
BASE_BRANCH="main"
# Zero PR_NUMBER before sourcing $INFO_FILE so an ambient shell export
# (e.g., from an earlier task-reviewer in the same shell) can't sneak
# into the reviewer-branch force-delete guard below and -D a worker
# branch with unmerged commits (#148 review).
PR_NUMBER=
# shellcheck source=/dev/null
[[ -f "$INFO_FILE" ]] && source "$INFO_FILE"
# endregion:worktree-context
Expand Down Expand Up @@ -167,10 +172,24 @@ else
fi
fi

if git branch -d "$BRANCH" 2>/dev/null; then
echo "Done. Deleted local branch '$BRANCH'."
# Reviewer worktrees write PR_NUMBER into their info file; they're pure
# scaffolding and their branch never merges into main (the PR does — its
# head ref is what landed). Force-delete in that case so a subsequent
# `task-reviewer <N>` re-dispatch isn't blocked by the per-PR branch
# guard (#148). Worker branches keep the safe-delete `-d` so unmerged
# work isn't silently dropped.
if [[ -n "${PR_NUMBER:-}" ]]; then
if git branch -D "$BRANCH" 2>/dev/null; then
echo "Done. Deleted reviewer branch '$BRANCH' (-D, scaffold-only)."
else
echo "Done. Branch '$BRANCH' could not be deleted — clean up manually: git branch -D $BRANCH"
fi
else
echo "Done. Branch '$BRANCH' still has unmerged commits — delete manually after PR merge: git branch -D $BRANCH"
if git branch -d "$BRANCH" 2>/dev/null; then
echo "Done. Deleted local branch '$BRANCH'."
else
echo "Done. Branch '$BRANCH' still has unmerged commits — delete manually after PR merge: git branch -D $BRANCH"
fi
fi

# Close this worker's zellij tab by its stable tab_id, captured before
Expand Down
25 changes: 22 additions & 3 deletions kiro-notion/bin/task-done
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ INFO_FILE="${WORKTREE_BASE}/.${SLUG}.info"

# Load base branch written by task-work; fall back to "main"
BASE_BRANCH="main"
# Zero PR_NUMBER before sourcing $INFO_FILE so an ambient shell export
# (e.g., from an earlier task-reviewer in the same shell) can't sneak
# into the reviewer-branch force-delete guard below and -D a worker
# branch with unmerged commits (#148 review).
PR_NUMBER=
# shellcheck source=/dev/null
[[ -f "$INFO_FILE" ]] && source "$INFO_FILE"
# endregion:worktree-context
Expand Down Expand Up @@ -147,10 +152,24 @@ git worktree remove "$WORKTREE_DIR" --force || {
# Clean up info file
[[ -f "$INFO_FILE" ]] && rm -f "$INFO_FILE"

if git branch -d "$BRANCH" 2>/dev/null; then
echo "Done. Deleted local branch '$BRANCH'."
# Reviewer worktrees write PR_NUMBER into their info file; they're pure
# scaffolding and their branch never merges into main (the PR does — its
# head ref is what landed). Force-delete in that case so a subsequent
# `task-reviewer <N>` re-dispatch isn't blocked by the per-PR branch
# guard (#148). Worker branches keep the safe-delete `-d` so unmerged
# work isn't silently dropped.
if [[ -n "${PR_NUMBER:-}" ]]; then
if git branch -D "$BRANCH" 2>/dev/null; then
echo "Done. Deleted reviewer branch '$BRANCH' (-D, scaffold-only)."
else
echo "Done. Branch '$BRANCH' could not be deleted — clean up manually: git branch -D $BRANCH"
fi
else
echo "Done. Branch '$BRANCH' still has unmerged commits — delete manually after PR merge: git branch -D $BRANCH"
if git branch -d "$BRANCH" 2>/dev/null; then
echo "Done. Deleted local branch '$BRANCH'."
else
echo "Done. Branch '$BRANCH' still has unmerged commits — delete manually after PR merge: git branch -D $BRANCH"
fi
fi

# Close this worker's zellij tab by its stable tab_id, captured before
Expand Down
Loading
Loading