src/autoskillit/skills_extended/implement-worktree-no-merge/SKILL.md
Implementation executor. ALWAYS invoke this skill when instructed to implement a plan in a worktree. Do not read the plan or edit files directly — use this skill first to load the full implementation workflow.
npx skillsauth add talont-org/autoskillit implement-worktree-no-mergeInstall 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.
Implement a provided plan in an isolated git worktree branched from the current branch. The worktree is left intact for the orchestrator to test and merge separately.
run_skill{plan_path} — Absolute path to the implementation plan file (required)
NEVER:
tail, head, or other truncation commandsgit merge commands (including --no-ff, --no-commit, or any variant). All branch content must be applied via git cherry-pick <commit> for individual commits or git checkout <branch> -- <file> for specific files. merge_worktree requires linear commit history — merge commits cannot be rebased and will cause WORKTREE_INTACT_MERGE_COMMITS_DETECTED failure.run_in_background: true is prohibited)ALWAYS:
model: "sonnet" when spawning all subagents via the Task toolEdit call on any file, ensure you have issued a Read on that file earlier in this session. Claude Code rejects Edit on unread files — the retry wastes a full API turn at current context size. If you are uncertain whether a file was read, issue a targeted Read (offset + limit to the region you plan to edit) rather than risk an error.limit 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.If this skill hits the Claude context limit mid-execution, the headless session
terminates with needs_retry=true in the tool response. The worktree remains
intact on disk with all commits made up to that point.
The orchestrator must not retry this skill when needs_retry=true. Retrying
creates a brand-new timestamped worktree, discarding all partial progress.
Correct orchestration on needs_retry=true:
/autoskillit:retry-worktree (via retry.on_exhausted)run_skill response now includes worktree_path as a top-level JSON
field when needs_retry=true. The orchestrator reads it from
result.worktree_path — no filesystem search is needed.max_attempts: 0 on this step's retry block to ensure immediate escalation/, ./, {{AUTOSKILLIT_TEMP}}/,
or .autoskillit/ — that token is the plan path. Ignore any non-path words
that appear before it (orchestrators sometimes prepend descriptive text such
as "the verified plan"). When no path-like token is present, treat the entire
argument string as pasted plan content. Verify the resolved file exists before
proceeding; if it does not, abort with:
"Plan file not found: {path}. Correct format: /autoskillit:implement-worktree-no-merge <plan_path>"Dry-walkthrough verified = TRUE:
AskUserQuestion to prompt: "Do you want to continue without dry-walkthrough validation?"/autoskillit:dry-walkthrough firstgit status --porcelain — if dirty, warn user_part_ (e.g., _part_a, _part_b, _part_1):
"🚧 SCOPE FENCE ACTIVE: I am implementing PART {X} ONLY. I MUST NOT open, read, or execute any other part files, regardless of what I encounter in {{AUTOSKILLIT_TEMP}}/ or any other directory. Sibling part files are out of scope for this entire session."
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
WORKTREE_NAME="impl-{plan_name}-$(date +%Y%m%d-%H%M%S)"
WORKTREE_PATH="../worktrees/${WORKTREE_NAME}"
git worktree add -b "${WORKTREE_NAME}" "${WORKTREE_PATH}"
WORKTREE_PATH="$(cd "${WORKTREE_PATH}" && pwd)"
# Record the base branch in two ways for reliable discovery by retry-worktree:
# 1) Write an explicit file store (stdlib-only, works with any Git version, works offline)
python3 -c "
from pathlib import Path
import tempfile, os
project_root = Path('$(git rev-parse --show-toplevel)')
sidecar_dir = project_root / '.autoskillit' / 'temp' / 'worktrees' / '${WORKTREE_NAME}'
sidecar_dir.mkdir(parents=True, exist_ok=True)
sidecar_file = sidecar_dir / 'base-branch'
fd, tmp = tempfile.mkstemp(dir=str(sidecar_dir))
os.write(fd, ('${CURRENT_BRANCH}' + '\n').encode())
os.close(fd)
os.replace(tmp, str(sidecar_file))
"
# 2) Set git upstream tracking (requires remote tracking ref in local fetch cache)
REMOTE=$(git remote get-url upstream 2>/dev/null | grep -qv "^file://" && echo upstream || echo origin)
if ! git fetch "$REMOTE" "${CURRENT_BRANCH}" 2>/dev/null; then
echo "NOTE: Branch '${CURRENT_BRANCH}' has no remote tracking ref on $REMOTE."
echo " merge_worktree will fail unless you push first: git push -u $REMOTE ${CURRENT_BRANCH}"
echo " Continuing — implementation will proceed, but the merge step will be blocked."
fi
if ! git -C "${WORKTREE_PATH}" branch --set-upstream-to="${REMOTE}/${CURRENT_BRANCH}" "${WORKTREE_NAME}" 2>/dev/null; then
echo "NOTE: Could not set upstream tracking for '${WORKTREE_NAME}' → '$REMOTE/${CURRENT_BRANCH}'."
fi
Immediately after the worktree is created, output these tokens on their own
lines so the execution layer can capture them from assistant_messages even
if context is exhausted before Step 6:
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 = ${WORKTREE_NAME}
Why emit early? If context exhaustion occurs during Steps 2–5, the
execution layer scans assistant_messages for worktree_path= and surfaces
it as a top-level field in the run_skill JSON response. The orchestrator
reads this field directly without filesystem discovery heuristics.
Before implementing ANY code, launch parallel Explore subagents to understand affected systems:
Set up the project's development environment in the worktree. Use the project's configured worktree_setup.command from .autoskillit/config.yaml if available. If not configured, check for a Taskfile with install-worktree task, or detect the project type and run appropriate setup.
cd "${WORKTREE_PATH}"
# If worktree_setup.command is configured, run it. Otherwise:
task install-worktree # or equivalent for the project type
Why isolated env matters: Installing packages without isolation overwrites the global state. When the worktree is deleted, CLI commands break with import errors.
All commands in Steps 4–5 must run from ${WORKTREE_PATH}. Use absolute paths to avoid CWD drift across Bash tool calls.
For each phase, begin implementation immediately (no announcement):
pre-commit run --all-files and stage any auto-fixed files
before each commit.Where practical, delegate test updates to subagents to keep main conversation context lean.
cd "${WORKTREE_PATH}" && pre-commit run --all-files
Fix any formatting or linting issues. Do NOT run the full test suite.
If the plan contains a PR Changes Inventory section, perform a completeness check before
handoff:
git diff {base_branch}...HEAD --name-only to get all files in the implementation.git show origin/{pr_branch}:{file_path}fix: carry over {file_path} from PR branchThis guard prevents silent data loss: Category C files are PR-only changes that require no conflict resolution and must be preserved in full.
Output to terminal:
${WORKTREE_PATH}${WORKTREE_NAME}Explicitly state: "Worktree left intact for orchestrator to test and merge."
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 = ${WORKTREE_NAME}
If this is a _part_ plan file: The orchestrator MUST merge this worktree
(merge_worktree) into the base branch BEFORE invoking
implement-worktree-no-merge for the next part. Part N+1's worktree must be
created from the post-merge state of the base branch, not from Part N's base
commit. This is a global sequencing rule — it applies even when operating
off-recipe.
git worktree list, suggest git worktree prunedevelopment
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?"