src/autoskillit/skills_extended/retry-worktree/SKILL.md
Worktree retry executor. ALWAYS invoke this skill when instructed to continue or retry an implementation in an existing worktree. Do not resume editing files directly — use this skill first to load the retry workflow.
npx skillsauth add talont-org/autoskillit retry-worktreeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Continue implementing a plan in an existing git worktree. This skill is used when a previous /autoskillit:implement-worktree session hit context limits before completing.
/autoskillit:implement-worktree session exhausted its context/autoskillit:retry-worktree {plan_path} {worktree_path}
NEVER:
task install-worktree) unless the environment is missing/brokentail, head, or other truncation commands — tail -N buffers the entire stream and produces no output if the process is killed before EOFmain as the base branch — always discover it from git's upstream structure or the explicit base-branch store filerun_in_background: true is prohibited)ALWAYS:
model: "sonnet" when spawning all subagents via the Task toollimit parameter. Do not paginate files with sequential offset reads — read once completely. Use limit/offset only for targeted section reads of files you have already read in full.When context is exhausted mid-execution, implementation changes may be on disk but
not yet committed. The recipe routes to on_context_limit, preserving the worktree.
Before emitting structured output tokens:
git -C {WORKTREE_PATH} status --porcelaingit -C {WORKTREE_PATH} add -A && git -C {WORKTREE_PATH} commit -m "chore: commit pending changes before context limit"worktree_path, branch_name, and phases_implemented tokensThis ensures that all implementation progress is committed and the downstream merge gate receives a clean worktree when the recipe resumes.
Parse two positional arguments from the prompt:
.venv exists for Python projects)Path Detection: Use path detection to locate both arguments. Scan all
tokens after the skill name for those starting with /, ./, {{AUTOSKILLIT_TEMP}}/, or
.autoskillit/. The first such token is plan_path; the second is
worktree_path. Ignore any non-path tokens that appear before them (e.g.,
extra descriptive text like "use this plan" or "from worktree"). If fewer than
two path-like tokens are found, abort with a clear error listing what was
missing and the correct format:
/autoskillit:retry-worktree <plan_path> <worktree_path>
If the worktree path does not exist:
If the environment is missing or broken:
worktree_setup.command, or: cd {WORKTREE_PATH} && task install-worktreeIf worktree_path argument is empty or missing:
Abort with error: "Worktree path argument is empty. The implement step must have
captured worktree_path before context exhaustion. Check that the implement step's
capture block ran before context was exhausted."
This is not a fallback — if worktree_path is empty, the recipe must be inspected to determine why the capture did not complete. A common cause is context exhaustion occurring before the skill reached its Step 6 handoff report.
Discover the base branch from git's upstream tracking (primary) or the explicit
base-branch store file written by implement-worktree-no-merge (fallback).
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
# Primary: read upstream tracking set by implement-worktree-no-merge
BASE_BRANCH=$(git rev-parse --abbrev-ref @{upstream} 2>/dev/null | sed 's|^[^/]*/||')
if [ -z "$BASE_BRANCH" ]; then
# Fallback: read explicit file store written by implement-worktree-no-merge
MAIN_GIT_DIR=$(git rev-parse --git-common-dir)
MAIN_REPO_ROOT=$(dirname "${MAIN_GIT_DIR}")
WORKTREE_DIR_NAME=$(basename "$(pwd)")
STORE_FILE="${MAIN_REPO_ROOT}/{{AUTOSKILLIT_TEMP}}/worktrees/${WORKTREE_DIR_NAME}/base-branch"
BASE_BRANCH=$(cat "${STORE_FILE}" 2>/dev/null)
fi
if [ -z "$BASE_BRANCH" ]; then
# Last resort: project-level default from config (always available)
BASE_BRANCH="{{DEFAULT_BASE_BRANCH}}"
echo "WARNING: Could not determine base branch from git upstream or sidecar file."
echo "Falling back to project default: ${BASE_BRANCH}"
fi
Then assess what has been implemented:
REMOTE=$(git remote get-url upstream >/dev/null 2>&1 && echo upstream || echo origin)
git log --oneline $(git merge-base HEAD $REMOTE/${BASE_BRANCH})..HEAD
git diff --stat $(git merge-base HEAD $REMOTE/${BASE_BRANCH})..HEAD
Only explore systems related to the remaining phases. Do NOT re-explore already-completed work. Use Explore subagents for:
All commands must run from {WORKTREE_PATH}. Use absolute paths to avoid CWD drift across Bash tool calls.
Initialize a counter before iterating: PHASES_IMPLEMENTED=0
NEVER use AskUserQuestion between phase iterations. Each phase begins immediately after the previous phase completes.
For each remaining/incomplete phase, begin implementation immediately (no announcement):
PHASES_IMPLEMENTED=$((PHASES_IMPLEMENTED + 1))Where practical, delegate test updates to subagents to keep main conversation context lean.
Run the project's code quality checks and test suite from the worktree.
cd {WORKTREE_PATH} && pre-commit run --all-files
cd {WORKTREE_PATH} && \
AUTOSKILLIT_TEST_FILTER="${AUTOSKILLIT_TEST_FILTER:-conservative}" \
AUTOSKILLIT_TEST_BASE_REF="${BASE_BRANCH:-}" \
task test-all
If tests fail, fix the issue and re-run.
REMOTE=$(git remote get-url upstream >/dev/null 2>&1 && echo upstream || echo origin)
git fetch "$REMOTE"
git rebase "$REMOTE/${BASE_BRANCH}"
If conflicts occur, resolve them, git rebase --continue, then re-run tests. Report rebase status.
Output to terminal: worktree path, branch name, base branch ($BASE_BRANCH), status, summary of changes, and next steps (fast-forward merge then clean up).
Change directory before removing worktree to prevent deleting the cwd.
Always confirm the merge went through before removing worktree.
Do not merge until user confirms first!
Then emit these structured output tokens on their own lines so recipe capture blocks can extract them:
IMPORTANT: Emit the structured output tokens as literal plain text with no markdown formatting on the token names. Do not wrap token names in
**bold**,*italic*, or any other markdown. The adjudicator performs a regex match on the exact token name — decorators cause match failure.
worktree_path = ${WORKTREE_PATH}
branch_name = ${CURRENT_BRANCH}
phases_implemented = ${PHASES_IMPLEMENTED}
Where PHASES_IMPLEMENTED is the count from Step 3. If Step 3 was skipped entirely
(all phases already complete), emit phases_implemented = 0.
worktree_setup.command, or: task install-worktreedevelopment
Generate YAML recipes for .autoskillit/recipes/. Use when user says "make script skill", "generate script", "script a workflow", "write a script", "create a script", "new recipe", "write a pipeline", or when loaded by other skills for script formatting.
data-ai
Create Uncertainty Representation visualization planning spec showing error bar definitions, distribution-aware alternatives, and multi-seed variance protocols. Statistical lens answering "How is uncertainty honestly represented?"
data-ai
Create Temporal Dynamics visualization planning spec showing axis scaling (linear vs log), smoothing disclosure, epoch/step alignment, run aggregation (mean + variance bands), early-stopping markers, and wall-clock vs step-count x-axis. Temporal lens answering "Are training dynamics shown clearly and honestly?"
data-ai
Create Narrative Story Arc visualization planning spec showing visual consistency across the report (same color = same model everywhere), logical figure progression, redundant figure detection, and narrative dependency between figures. Narrative lens answering "Do the figures tell a coherent story across the report?"