From 5ad27ae0406d81efb9e7f217c8e6638ac092fe0c Mon Sep 17 00:00:00 2001 From: Hugo Nijhuis Date: Tue, 13 Jan 2026 00:06:28 +0100 Subject: [PATCH] fix(worktrees): use full paths for bundled scripts Users were confused by ./scripts/ references, thinking they needed to copy scripts into their project. Scripts are in ~/.claude/skills/worktrees/scripts/ and should be referenced with full paths. Changes: - Updated spawn-issues to use full script paths - Updated worktrees skill with full paths in all examples - Fixed gitea model name to claude-haiku-4-5 - Added tools list to issue-worker agent Co-Authored-By: Claude Code --- agents/issue-worker/AGENT.md | 1 + skills/gitea/SKILL.md | 2 +- skills/spawn-issues/SKILL.md | 6 +++--- skills/worktrees/SKILL.md | 40 ++++++++++++++++++------------------ 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/agents/issue-worker/AGENT.md b/agents/issue-worker/AGENT.md index 6d9343d..ac581f4 100644 --- a/agents/issue-worker/AGENT.md +++ b/agents/issue-worker/AGENT.md @@ -5,6 +5,7 @@ description: > implementation, commits, pushes, and creates PR. Use when implementing an issue as part of parallel workflow. model: claude-sonnet-4-5 +tools: Bash, Read, Write, Edit, Glob, Grep, TodoWrite skills: gitea, issue-writing, worktrees --- diff --git a/skills/gitea/SKILL.md b/skills/gitea/SKILL.md index 6970bf3..511196f 100644 --- a/skills/gitea/SKILL.md +++ b/skills/gitea/SKILL.md @@ -1,6 +1,6 @@ --- name: gitea -model: haiku +model: claude-haiku-4-5 description: View, create, and manage Gitea issues and pull requests using tea CLI. Use when working with issues, PRs, viewing issue details, creating pull requests, adding comments, merging PRs, or when the user mentions tea, gitea, issue numbers, or PR numbers. user-invocable: false --- diff --git a/skills/spawn-issues/SKILL.md b/skills/spawn-issues/SKILL.md index 23be681..5669c4e 100644 --- a/skills/spawn-issues/SKILL.md +++ b/skills/spawn-issues/SKILL.md @@ -61,7 +61,7 @@ git rev-parse --git-dir >/dev/null 2>&1 || exit 1 For each issue, create worktree using script: ```bash cd "$REPO_PATH" -worktree_path=$(./scripts/create-worktree.sh issue ) +worktree_path=$(~/.claude/skills/worktrees/scripts/create-worktree.sh issue ) ``` Track worktree paths: @@ -174,7 +174,7 @@ branch_name = worker_result.branch **Create review worktree:** ```bash cd "$REPO_PATH" -review_worktree=$(./scripts/create-worktree.sh review ) +review_worktree=$(~/.claude/skills/worktrees/scripts/create-worktree.sh review ) ``` **Spawn code-reviewer agent:** @@ -230,7 +230,7 @@ After all issues reach terminal state: ```bash cd "$REPO_PATH" -./scripts/cleanup-worktrees.sh "$WORKTREES_DIR" +~/.claude/skills/worktrees/scripts/cleanup-worktrees.sh "$WORKTREES_DIR" ``` This removes all issue and review worktrees created during this run. diff --git a/skills/worktrees/SKILL.md b/skills/worktrees/SKILL.md index 335ea9a..7ff587c 100644 --- a/skills/worktrees/SKILL.md +++ b/skills/worktrees/SKILL.md @@ -83,16 +83,16 @@ git worktree add "${WORKTREES_DIR}/${REPO_NAME}-review-${PR_NUMBER}" \ ## Bundled Scripts -Use bundled scripts for error-prone operations: +Use bundled scripts for error-prone operations. Scripts are located in `~/.claude/skills/worktrees/scripts/`: ### Create Worktree ```bash -# Usage: ./scripts/create-worktree.sh issue -# Usage: ./scripts/create-worktree.sh review +# Usage: ~/.claude/skills/worktrees/scripts/create-worktree.sh issue +# Usage: ~/.claude/skills/worktrees/scripts/create-worktree.sh review -./scripts/create-worktree.sh issue 42 -./scripts/create-worktree.sh review 55 issue-42-feature-name +~/.claude/skills/worktrees/scripts/create-worktree.sh issue 42 +~/.claude/skills/worktrees/scripts/create-worktree.sh review 55 issue-42-feature-name ``` Returns worktree path on success. @@ -100,7 +100,7 @@ Returns worktree path on success. ### List Worktrees ```bash -./scripts/list-worktrees.sh +~/.claude/skills/worktrees/scripts/list-worktrees.sh ``` Shows all active worktrees with their branches. @@ -109,13 +109,13 @@ Shows all active worktrees with their branches. ```bash # Remove specific worktree -./scripts/cleanup-worktrees.sh "${WORKTREES_DIR}/${REPO_NAME}-issue-42" +~/.claude/skills/worktrees/scripts/cleanup-worktrees.sh "${WORKTREES_DIR}/${REPO_NAME}-issue-42" # Remove all worktrees in directory -./scripts/cleanup-worktrees.sh "${WORKTREES_DIR}" +~/.claude/skills/worktrees/scripts/cleanup-worktrees.sh "${WORKTREES_DIR}" # Force remove even if dirty -./scripts/cleanup-worktrees.sh --force "${WORKTREES_DIR}" +~/.claude/skills/worktrees/scripts/cleanup-worktrees.sh --force "${WORKTREES_DIR}" ``` ## Patterns @@ -125,7 +125,7 @@ Shows all active worktrees with their branches. **Orchestrator creates all worktrees upfront:** ```bash for issue in 42 43 44; do - worktree_path=$(./scripts/create-worktree.sh issue $issue) + worktree_path=$(~/.claude/skills/worktrees/scripts/create-worktree.sh issue $issue) # Spawn worker with worktree_path done ``` @@ -140,14 +140,14 @@ git push -u origin $(git branch --show-current) **Orchestrator cleans up after all complete:** ```bash -./scripts/cleanup-worktrees.sh "${WORKTREES_DIR}" +~/.claude/skills/worktrees/scripts/cleanup-worktrees.sh "${WORKTREES_DIR}" ``` ### Pattern: Review in Isolation **Create review worktree:** ```bash -worktree_path=$(./scripts/create-worktree.sh review $PR_NUMBER $BRANCH_NAME) +worktree_path=$(~/.claude/skills/worktrees/scripts/create-worktree.sh review $PR_NUMBER $BRANCH_NAME) cd "$worktree_path" git diff origin/main...HEAD # Review changes ``` @@ -156,12 +156,12 @@ git diff origin/main...HEAD # Review changes **List stale worktrees:** ```bash -./scripts/list-worktrees.sh +~/.claude/skills/worktrees/scripts/list-worktrees.sh ``` **Force cleanup:** ```bash -./scripts/cleanup-worktrees.sh --force "${WORKTREES_DIR}" +~/.claude/skills/worktrees/scripts/cleanup-worktrees.sh --force "${WORKTREES_DIR}" ``` ## Best Practices @@ -181,8 +181,8 @@ git diff origin/main...HEAD # Review changes ```bash # In orchestrator declare -A worktrees -worktrees[42]=$(./scripts/create-worktree.sh issue 42) -worktrees[43]=$(./scripts/create-worktree.sh issue 43) +worktrees[42]=$(~/.claude/skills/worktrees/scripts/create-worktree.sh issue 42) +worktrees[43]=$(~/.claude/skills/worktrees/scripts/create-worktree.sh issue 43) # Pass to agents spawn_agent --worktree="${worktrees[42]}" @@ -198,10 +198,10 @@ spawn_agent --worktree="${worktrees[42]}" **Worktree already exists:** ```bash # Remove old worktree first -./scripts/cleanup-worktrees.sh "${WORKTREES_DIR}/${REPO_NAME}-issue-42" +~/.claude/skills/worktrees/scripts/cleanup-worktrees.sh "${WORKTREES_DIR}/${REPO_NAME}-issue-42" # Then create new one -./scripts/create-worktree.sh issue 42 +~/.claude/skills/worktrees/scripts/create-worktree.sh issue 42 ``` **Branch already exists:** @@ -216,8 +216,8 @@ git branch -D issue-42-old-name **Stale worktrees after crash:** ```bash # List and force remove -./scripts/list-worktrees.sh -./scripts/cleanup-worktrees.sh --force "${WORKTREES_DIR}" +~/.claude/skills/worktrees/scripts/list-worktrees.sh +~/.claude/skills/worktrees/scripts/cleanup-worktrees.sh --force "${WORKTREES_DIR}" ``` ## Tips