.agents/skills/oat-worktree-bootstrap/SKILL.md
Use when creating or resuming a git worktree for OAT implementation. Creates or validates a worktree and runs OAT bootstrap checks.
npx skillsauth add tkstang/open-agent-toolkit oat-worktree-bootstrapInstall 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.
Create or resume a git worktree and prepare it for OAT development.
.oat/, .agents/).OAT MODE: Worktree Bootstrap
Purpose: Establish an isolated workspace and run standard OAT readiness checks before implementation work.
BLOCKED Activities:
ALLOWED Activities:
Print a phase banner once at start:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ OAT ▸ WORKTREE BOOTSTRAP ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Before multi-step operations, print step indicators, e.g.:
[1/4] Resolving worktree target…[2/4] Creating/validating worktree…[3/4] Running OAT bootstrap checks…[4/4] Reporting ready state…<branch-name>--base <ref> (default: origin/main)--path <root> (explicit worktree root override)--existing (bootstrap/validate existing worktree instead of creating one)REPO_ROOT=$(git rev-parse --show-toplevel)
REPO_NAME=$(basename "$REPO_ROOT")
Resolve active project from local config:
ACTIVE_PROJECT=$(oat config get activeProject 2>/dev/null || true)
If ACTIVE_PROJECT is set:
state.mdoat-project-clear-activeoat-project-openIf ACTIVE_PROJECT is missing:
If --existing:
git worktree list --porcelainTARGET_WORKTREE to the current directoryWORKTREE_ROOT to the parent directory of TARGET_WORKTREE (informational)~/.codex/worktrees/...)Otherwise, resolve WORKTREE_ROOT using this strict precedence (stop at the first match):
--path <root> (CLI flag — highest priority)OAT_WORKTREES_ROOT (environment variable).oat/config.json -> worktrees.root (persisted project config)${REPO_ROOT}/.worktrees
b. ${REPO_ROOT}/worktrees
c. ../${REPO_NAME}-worktrees../${REPO_NAME}-worktreesIMPORTANT: Precedence level 4 is an ordered list, not a set. Check .worktrees first. If it exists, use it — do NOT continue scanning for ../<repo>-worktrees even if that also exists. Only fall through to the next candidate if the current one does not exist.
For repo-relative values (levels 3–4a–4b), resolve from REPO_ROOT.
Treat .oat/config.json as phase-A non-sync settings ownership (do not mix with .oat/sync/config.json).
If the resolved root is project-local (.worktrees or worktrees), verify it is ignored by git before creating a new worktree.
Set TARGET_WORKTREE to {WORKTREE_ROOT}/{branch-name}.
--existing, validate the current directory is a git worktree and continue.^[a-zA-Z0-9._/-]+$)TARGET_WORKTREEgit worktree add "{TARGET_WORKTREE}" "{branch-name}"git worktree add "{TARGET_WORKTREE}" -b "{branch-name}" "{base-ref}"{base-ref} defaults to origin/main unless --base is provided.
If worktree creation fails, stop and report the exact git error with remediation guidance.
After the worktree is created (or validated with --existing), copy gitignored local-only context files from the source repo into the new worktree so downstream skills (e.g., oat-project-implement) can resolve context without re-prompting.
Config propagation:
Copy .oat/config.local.json if it exists in the source repo:
SRC="$REPO_ROOT/.oat/config.local.json"
DST="{target-path}/.oat/config.local.json"
if [[ -f "$SRC" && ! -f "$DST" ]]; then
cp "$SRC" "$DST"
fi
Rules:
config.local.json uses repo-relative paths, so copied values remain valid across sibling worktrees.activeIdea is stored in config.local.json, so it propagates automatically with the config copy.activeProject (if present in config.local.json) resolves to a real project path in the worktree. If not, print a warning but do not block bootstrap.Local paths sync:
After config propagation, sync configured localPaths into the worktree:
oat local sync "{target-path}" 2>/dev/null || true
localPaths array from .oat/config.json to copy local-only directories (e.g., .oat/ideas/, .oat/projects/local/) into the worktree.localPaths are configured, bootstrap continues.--force to override).Run bootstrap and readiness checks in the target worktree:
pnpm run worktree:init
oat status --scope project
pnpm test
git status --porcelain
Required behavior:
worktree:init or status fails.pnpm test fails:
abort or proceed anywayimplementation.md exists, append a timestamped baseline-failure note theregit status --porcelain is not clean after bootstrap/tests, stop and require cleanup before reporting ready.Report:
oat-project-implementreferences/worktree-conventions.mddocumentation
Use when OAT implementation changes and repository reference docs must be synchronized. Updates .oat/repo/reference to match current behavior.
business
Merge multiple analysis artifacts into a single coherent report with provenance tracking. Reads existing artifacts from /deep-research, /analyze, and /compare.
testing
Use when the user questions or suspects an agent claim is wrong. Adversarially gathers evidence to verify or refute the claim using the best sources available in the current environment.
tools
Use when prioritizing backlog work or evaluating a roadmap. Produces value-effort ratings, dependency mapping, and execution recommendations.