
Worktree Workflow
- 2 installs
- 29 repo stars
- Updated March 27, 2026
- different-ai/openwork-hub
Enforces a worktree-per-task workflow with scripts to start a fresh worktree and commit and push regularly.
About
Requires each file-changing task to begin in a dedicated worktree, with scripts for starting the worktree and committing/pushing after each chunk. A developer uses it to keep tasks isolated with frequent commits and pushes.
- start-task-worktree.sh creates a per-task worktree with submodules
- regular-commit.sh commits and pushes each meaningful chunk
Worktree Workflow by the numbers
- 2 all-time installs (skills.sh)
- Ranked #498 of 733 Git & Pull Requests skills by installs in the Skillselion catalog
- Data as of Aug 3, 2026 (Skillselion catalog sync)
npx skills add https://github.com/different-ai/openwork-hub --skill worktree-workflowAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 2 |
|---|---|
| repo stars | ★ 29 |
| Last updated | March 27, 2026 |
| Repository | different-ai/openwork-hub ↗ |
What it does
Enforces a worktree-per-task workflow with scripts to start a fresh worktree and commit and push regularly.
Files
Quick Usage (Already Configured)
Start a task with a fresh worktree
skills/worktree-workflow/scripts/start-task-worktree.sh "task-name"Commit regularly and push
skills/worktree-workflow/scripts/regular-commit.sh "message describing why"Behavior
- Any task that changes files should begin by creating a dedicated worktree.
- Commit after each meaningful chunk of work.
- Push the branch after each commit.
- Submodules are initialized in the new worktree.
Related skills
- For UX PR flows with screenshots, use
skills/worktree-ux-pr/SKILL.md.
Common Gotchas
- Use a short, kebab-case task name; it becomes the branch suffix.
- If your default branch is not
main, setBASE_BRANCH. - If you update submodule pins, make sure the target submodule SHA is reachable from a remote branch/tag (avoid pinning to commits that were only on a force-pushed ref).
First-Time Setup (If Not Configured)
1. Ensure you are in a git repo with origin configured. 2. Optional: set BASE_BRANCH or WORKTREES_DIR in your shell.
.env
#!/usr/bin/env bash
set -euo pipefail
MESSAGE=${1:-}
if [[ -z "$MESSAGE" ]]; then
echo "Usage: regular-commit.sh \"message describing why\""
exit 1
fi
if [[ -z "$(git status --porcelain)" ]]; then
echo "No changes to commit."
exit 0
fi
git add -A
git commit -m "$MESSAGE"
git push -u origin HEAD
#!/usr/bin/env bash
set -euo pipefail
TASK_NAME=${1:-}
if [[ -z "$TASK_NAME" ]]; then
echo "Usage: start-task-worktree.sh \"task-name\""
exit 1
fi
BASE_BRANCH=${BASE_BRANCH:-main}
WORKTREES_DIR=${WORKTREES_DIR:-_worktrees}
SAFE_TASK_NAME=$(echo "$TASK_NAME" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
BRANCH_NAME="task/${SAFE_TASK_NAME}"
WORKTREE_PATH="${WORKTREES_DIR}/${SAFE_TASK_NAME}"
if git show-ref --verify --quiet "refs/heads/${BRANCH_NAME}"; then
echo "Branch already exists: ${BRANCH_NAME}"
exit 1
fi
if git show-ref --verify --quiet "refs/remotes/origin/${BASE_BRANCH}"; then
BASE_REF="origin/${BASE_BRANCH}"
else
BASE_REF="${BASE_BRANCH}"
fi
mkdir -p "${WORKTREES_DIR}"
git worktree add "${WORKTREE_PATH}" -b "${BRANCH_NAME}" "${BASE_REF}"
git -C "${WORKTREE_PATH}" submodule update --init --recursive
echo "Worktree created at ${WORKTREE_PATH} on ${BRANCH_NAME}"