/incubate — Active Development Workflow
SkillAI & modelsClone or create repos for active development — the right hand of /learn. Use when user says "incubate [repo]", "work on [repo]", "clone for dev", or wants to set up a dev workflow. Use --wt SLUG to give each agent its own git worktree body when several agents develop the same repo in parallel. Do NOT trigger for study/exploration (use /learn), finding projects (use /trace), or session mining (use /dig).
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the /incubate — Active Development Workflow skill
What this skill tells your AI
The instructions your AI receives, as published by soul-brews-studio/arra-oracle-skills-cli in skills/incubate/SKILL.md and read by ahel’s review.
Clone or create repos for active development → set up branches, make changes, push PRs.
"/learn reads the book. /incubate writes the next chapter."
Usage
/incubate [url] # Clone via ghq, symlink, ready for dev
/incubate [slug] # Use slug from ψ/memory/slugs.yaml
/incubate [repo-name] # Finds in ghq or creates with default org
/incubate [url] --flash "fix desc" # Issue → branch → fix → PR → offload
/incubate [url] --contribute # Fork if needed → branch per feature → PRs
/incubate --status # List all active ψ/incubate/ with git status
/incubate --status --include-offloaded # Also list offloaded entries from .origins (#280)
/incubate --offload [slug] # Remove symlink, keep ghq clone
/incubate --offload [slug] --purge # Also drop entry from .origins manifest (#280)
/incubate --init # Restore all origins after git clone
# Parallel bodies — one git worktree per agent, same mother clone (#487)
/incubate [slug] --wt <name> # Claim a body on branch incubate/<name>
/incubate [slug] --wt <name> --task "…" # Same, recording who + why (worktree lock reason)
/incubate [slug] --wt <name> --from <ref># Branch from <ref> (default: origin/HEAD)
/incubate --offload [slug] --wt <name> # Retire ONE body (branch survives)
/incubate --offload [slug] --all-wt # Retire every body on this machine
Workflow Modes
| Flag | Scope | Duration | Cleanup |
|---|---|---|---|
| (default) | Long-term dev | Weeks/months | Manual offload |
--wt <slug> | One agent's parallel body | Hours/days | --offload --wt <slug> (branch survives) |
--flash | Single fix | Minutes | Issue → PR → auto-offload + purge |
--contribute | Multi-feature | Days/weeks | Offload when all PRs done |
--status | Query | — | Read-only listing |
--offload | Cleanup | — | Remove symlink (keep ghq) |
incubate → Long-term dev (manual cleanup)
↓
--wt <slug> → N agents, N worktrees, 1 mother clone (parallel bodies)
↓
--contribute → Push → offload (keep ghq)
↓
--flash → Issue → Branch → PR → offload → purge (complete cycle)
Mother and bodies (#487). One ghq clone per repo per machine = one working
tree = one checked-out branch, so N agents on the same repo stomp each other.
--wt gives each agent a body: a git worktree on its own branch
incubate/<slug>, sharing the mother's object store. The mother clone is
untouched — on the --wt path it is fetch-only, never pulled, never stashed.
The claim is atomic for free: git worktree add -b creates the branch ref in a
single ref transaction, so of N agents racing for the same slug exactly one
wins and the losers touch nothing. No lockfiles, no flock (unreliable on NFS,
meaningless across machines), no claim directory.
Directory Structure
ψ/incubate/
├── .origins # Manifest of incubated MOTHERS (committed)
└── OWNER/
└── REPO/
├── origin # Symlink to mother ghq clone (gitignored)
├── REPO.md # Hub file — tracks incubation sessions (committed)
└── wt/ # Parallel bodies (#487)
└── <slug>/
└── origin # Symlink to the worktree (gitignored)
Machine-local side (never in ψ, never committed):
$(ghq root)/github.com/OWNER/REPO # mother clone — one per repo per machine
$WT_ROOT/OWNER/REPO/<slug>/ # body — branch incubate/<slug>
WT_ROOT="${INCUBATE_WT_ROOT:-${XDG_STATE_HOME:-$HOME/.local/state}/incubate/worktrees}"
ψ is the committed soul; worktrees are machine-local scratch. Bodies live
outside ψ and outside $(ghq root). ψ gets one gitignored symlink per body
and nothing else.
Bodies must not live under $(ghq root) (#487). ghq decides "this is a
repository" by stat-ing <dir>/.git, and a linked worktree's .git is a
regular file that passes that test. Measured on ghq 1.10.1, with bodies under
$(ghq root)/.worktrees/:
$ ghq list
.worktrees/acme/api/fix-auth ← phantom
github.com/acme/api
Every consumer of ghq list then sees phantom repos, and .worktrees sorts
before github.com, so any "first match wins" resolver returns the body
instead of the repo. That is a regression in other skills caused by this
one, so the body root lives in the XDG state directory. $INCUBATE_WT_ROOT
relocates it; any path outside $(ghq root) works, including a different
filesystem (E17).
The body link filename is literally origin — this is load-bearing. It means
the existing .gitignore rule ψ/incubate/**/origin already covers bodies (no
new rule), wt/<slug>/ contains nothing git tracks (no .gitkeep), and the
--status/--offload finders keep working unmodified.
There is no per-body manifest file. The registry is
git -C <mother> worktree list --porcelain -z, which git maintains atomically
and which cannot drift from reality. A committed .origins.d/<slug>.yaml was
rejected (#487): committed files mean N agents each git add/commit/push into
ψ, converting a benign file race into a git non-fast-forward race one layer up.
Per-body metadata (who, when, why) rides in the worktree lock reason —
machine-local at <mother>/.git/worktrees/<slug>/locked, surviving kill -9,
never committed:
incubate|<owner-id>|<iso8601>|<task text>
Read the registry with --porcelain -z | tr '\0' '\n', never plain
--porcelain (#487). git C-quotes the entire locked line the moment the
reason holds a non-ASCII byte or a ". Measured on git 2.50.1 with
--task "แก้บั๊ก auth":
locked "incubate|nat@m5|2026-07-27T…|\340\271\201\340\270\201…" ← --porcelain
locked incubate|nat@m5|2026-07-27T…|แก้บั๊ก auth ← --porcelain -z
Under the quoted form awk -F'|' sees field 1 as "incubate, so every
ownership guard silently misses, the body is misreported as another tool's, and
--offload refuses it forever. -z never quotes (it terminates records with
NUL, so there is nothing to escape) and tr '\0' '\n' restores the exact shape
every existing awk expects. Requires git ≥ 2.36.
Three reason classes, and only three:
| field 1 | means | do |
|---|---|---|
incubate | ours | parse who | when | task |
initializing | git's own lock, written during worktree add and left by a kill -9 mid-checkout (E11) | report as crashed-mid-create, offer the heal, allow offload once unlocked |
| anything else | another tool's | report as (locked by another tool), never parse, never break |
initializing is deliberately not in the "another tool" bucket — treating
it as foreign wedges the body, the slug, and the mother's offload permanently.
The full set of registry queries is in
references/worktree-recovery.md.
Offload source, keep hub:
unlink ψ/incubate/OWNER/REPO/origin # Remove symlink
# ghq clone preserved for future use
# Hub file (REPO.md) remains in ψ/incubate/OWNER/REPO/
/incubate --init
Restore all origins after cloning (like git submodule init):
ROOT="$(pwd)"
GHQ_ROOT=$(ghq root) # hoisted — ~24ms per call (#487)
WT_ROOT="${INCUBATE_WT_ROOT:-${XDG_STATE_HOME:-$HOME/.local/state}/incubate/worktrees}"
# Read .origins through a de-duplicated private copy, NEVER the shared file
# directly (#487). The guarded append at Step 0 can leave a duplicate line
# (measured: 15/30 trials with 4 concurrent runs) and every reader must absorb
# it. Redirected, not piped — a pipe would run the loop in a subshell.
ORIGINS_SNAP=$(mktemp "${TMPDIR:-/tmp}/incubate-origins.XXXXXX")
sort -u "$ROOT/ψ/incubate/.origins" > "$ORIGINS_SNAP"
while IFS= read -r repo; do
[ -z "$repo" ] && continue
OWNER=$(dirname "$repo")
REPO=$(basename "$repo")
ghq get -u "https://github.com/$repo"
MOTHER="$GHQ_ROOT/github.com/$repo"
mkdir -p "$ROOT/ψ/incubate/$OWNER/$REPO"
# ln -sfn, NEVER ln -sf: onto an EXISTING symlink-to-directory, `ln -sf`
# follows the link and creates a stray link INSIDE the old target, leaving
# the ψ link still pointing at the old path. Measured (#487).
ln -sfn "$MOTHER" "$ROOT/ψ/incubate/$OWNER/$REPO/origin"
echo "✓ Restored: $repo"
# Body relink pass (#487). Re-points ψ at any worktrees this machine already
# has. No-ops on a vault with zero bodies — `worktree list` reports only the
# mother — so old vaults behave exactly as before.
# -z: mandatory, see "Directory Structure" — plain --porcelain C-quotes.
# sub(/^worktree /,"") + $0: `print $2` truncates at the first space, and
# `$(ghq root)` on a macOS home directory with a space in its name is
# ordinary. Measured: relinking `/…/my ghq root/…` produced `/…/my` (#487).
git -C "$MOTHER" worktree list --porcelain -z 2>/dev/null | tr '\0' '\n' \
| awk '/^worktree /{sub(/^worktree /,""); print $0}' | while IFS= read -r wt; do
[ "$wt" = "$MOTHER" ] && continue
s=$(basename "$wt")
# Registered but gone from disk (E9) — relinking would manufacture a
# DANGLING ψ symlink and report it as a restored body. Report instead.
[ -d "$wt" ] || { echo " ⋯ body wt/$s registered but gone from disk — /incubate --status"; continue; }
mkdir -p "$ROOT/ψ/incubate/$OWNER/$REPO/wt/$s"
ln -sfn "$wt" "$ROOT/ψ/incubate/$OWNER/$REPO/wt/$s/origin"
echo " ↳ relinked body wt/$s"
done
# Bodies that exist only on ANOTHER machine — report, never auto-materialize.
# A vault with 20 recorded bodies would otherwise detonate 20 `worktree add`
# calls on a fresh clone. The human opts in per body (#487).
git -C "$MOTHER" ls-remote --heads origin 'incubate/*' 2>/dev/null \
| sed 's|.*refs/heads/incubate/||' | while IFS= read -r s; do
[ -z "$s" ] && continue
[ -d "$WT_ROOT/$OWNER/$REPO/$s" ] \
|| echo " ⋯ body '$s' lives on another machine — /incubate $OWNER/$REPO --wt $s"
done
done < "$ORIGINS_SNAP"
rm -f "$ORIGINS_SNAP"
.origins keeps its exact format — flat, one OWNER/REPO per line, committed.
Bodies are never recorded in it, because .origins answers "which mothers
must --init re-clone" and a body's mother is already listed. No migration, no
dual-read, no version marker.
Step 0: Detect Input Type + Resolve Path
CRITICAL: Capture ABSOLUTE paths first:
date "+🕐 %H:%M %Z (%A %d %B %Y)" && ROOT="$(pwd)"
echo "Incubating from: $ROOT"
If URL (http* or owner/repo format)
Clone or create, symlink origin, update manifest:
# Replace [URL] with actual URL
URL="[URL]"
ROOT="$(pwd)"
OWNER=$(echo "$URL" | sed -E 's|.*github.com/([^/]+)/.*|\1|')
REPO=$(echo "$URL" | sed -E 's|.*/([^/]+)(\.git)?$|\1|')
SLUG="$OWNER/$REPO"
# Auto-stash unstaged changes in source clone before pulling (#279).
# `ghq get -u` runs `git pull` under the hood and aborts on dirty trees,
# stranding the ritual. Detect + stash with a clear log + restore hint.
GHQ_ROOT_PRECHECK=$(ghq root 2>/dev/null)
SOURCE_PRECHECK="$GHQ_ROOT_PRECHECK/github.com/$SLUG"
if [ -d "$SOURCE_PRECHECK/.git" ]; then
if [ -n "$(git -C "$SOURCE_PRECHECK" status --porcelain 2>/dev/null)" ]; then
STASH_NAME="pre-incubate-$(date +%Y-%m-%d)"
echo "⚠️ Source clone has uncommitted changes — auto-stashing as '$STASH_NAME'"
git -C "$SOURCE_PRECHECK" stash push -u -m "$STASH_NAME"
echo " (run \`git -C $SOURCE_PRECHECK stash pop\` to restore)"
fi
fi
# Check if repo exists on GitHub
if gh repo view "$SLUG" --json name &>/dev/null; then
ghq get -u "https://github.com/$SLUG"
else
echo "Repo not found — creating private repo..."
NEW_REPO_CREATED=1 # our own fresh repo — commit-ignore the breadcrumb (Step 0.5)
gh repo create "$SLUG" --private --clone=false
ghq get "https://github.com/$SLUG"
GHQ_ROOT=$(ghq root)
LOCAL="$GHQ_ROOT/github.com/$SLUG"
# Seed a .gitignore that ignores the incubation breadcrumb from the very first
# commit, so the rule travels with every clone (a local .git/info/exclude does
# not). Safe here — WE just created this private repo; the #447 "don't edit a
# foreign repo's committed .gitignore" rule applies only to CLONES.
grep -qxF '.claude/INCUBATED_BY' "$LOCAL/.gitignore" 2>/dev/null \
|| echo '.claude/INCUBATED_BY' >> "$LOCAL/.gitignore"
[ -f "$LOCAL/README.md" ] || echo "# $REPO" > "$LOCAL/README.md"
git -C "$LOCAL" add README.md .gitignore
git -C "$LOCAL" diff --cached --quiet || git -C "$LOCAL" commit -m "Initial commit"
git -C "$LOCAL" push origin main 2>/dev/null || git -C "$LOCAL" push origin master
fi
GHQ_ROOT=$(ghq root)
mkdir -p "$ROOT/ψ/incubate/$OWNER/$REPO"
# ln -sfn, NEVER ln -sf (#487) — see the comment in --init above.
ln -sfn "$GHQ_ROOT/github.com/$OWNER/$REPO" "$ROOT/ψ/incubate/$OWNER/$REPO/origin"
# Auto-add gitignore pattern if missing (#250)
GITIGNORE="$ROOT/.gitignore"
if [ -f "$GITIGNORE" ]; then
if ! grep -q 'ψ/incubate/\*\*/origin' "$GITIGNORE" 2>/dev/null; then
echo 'ψ/incubate/**/origin' >> "$GITIGNORE"
echo "✓ Added ψ/incubate/**/origin to .gitignore"
fi
else
# Also check ψ/.gitignore as fallback
PSI_GITIGNORE="$ROOT/ψ/.gitignore"
if [ -f "$PSI_GITIGNORE" ] && ! grep -q 'incubate/\*\*/origin' "$PSI_GITIGNORE" 2>/dev/null; then
echo 'incubate/**/origin' >> "$PSI_GITIGNORE"
echo "✓ Added incubate/**/origin to ψ/.gitignore"
fi
fi
# Update manifest — guarded O_APPEND, never read-modify-write (#487).
# The `sort -u -o F F` that lived here re-read and rewrote the whole file:
# measured 8 concurrent writers x 10 trials -> 8/10 trials LOST entries (worst
# kept 5 of 8), and 5 trials emitted `sort: No such file or directory` because
# the file transiently does not exist — so a concurrent --init or --status read
# an EMPTY manifest. A guarded append measured 0/10 lost. Residual TOCTOU can
# only ever produce a DUPLICATE line, never a missing one, and every reader
# absorbs duplicates via `sort -u`. .origins is no longer kept sorted; nothing
# ever consumed its sortedness.
ORIGINS="$ROOT/ψ/incubate/.origins"
mkdir -p "$ROOT/ψ/incubate"
grep -qxF "$OWNER/$REPO" "$ORIGINS" 2>/dev/null || printf '%s\n' "$OWNER/$REPO" >> "$ORIGINS"
echo "✓ Ready: $ROOT/ψ/incubate/$OWNER/$REPO/origin → source"
Step 0.5: Drop INCUBATED_BY Breadcrumb (#226, #228)
After clone/symlink, write .claude/INCUBATED_BY in the target repo (not the oracle repo):
TARGET_REPO="$GHQ_ROOT/github.com/$OWNER/$REPO"
mkdir -p "$TARGET_REPO/.claude"
# Check if this repo was previously /learn'd
LEARNED_FROM=""
if [ -d "$ROOT/ψ/learn/$OWNER/$REPO" ]; then
LEARNED_FROM="learned-from: ψ/learn/$OWNER/$REPO/"
fi
cat > "$TARGET_REPO/.claude/INCUBATED_BY" << BREADCRUMB
oracle: $(basename "$ROOT")
oracle-repo: $(git -C "$ROOT" remote get-url origin 2>/dev/null || echo "local")
date: $(date +%Y-%m-%d)
mode: ${MODE:-default}
source: https://github.com/$OWNER/$REPO
${LEARNED_FROM}
BREADCRUMB
echo "✓ Breadcrumb dropped: $TARGET_REPO/.claude/INCUBATED_BY"
# Keep the breadcrumb OUT of the target repo's tracked history. Pick the mechanism
# by ownership:
# - NEW repo we just created ($NEW_REPO_CREATED): commit-ignore it in .gitignore so
# the rule travels with clones. The initial commit above already staged it.
# - CLONE we don't own (may be public/foreign): use .git/info/exclude — local-only,
# never committed, so we never edit someone else's committed .gitignore (#447).
if [ -d "$TARGET_REPO/.git" ]; then
if [ "${NEW_REPO_CREATED:-0}" = "1" ]; then
grep -qxF '.claude/INCUBATED_BY' "$TARGET_REPO/.gitignore" 2>/dev/null \
|| echo '.claude/INCUBATED_BY' >> "$TARGET_REPO/.gitignore"
echo "✓ Ignored in git: .claude/INCUBATED_BY (committed .gitignore — new repo)"
else
grep -qxF '.claude/INCUBATED_BY' "$TARGET_REPO/.git/info/exclude" 2>/dev/null \
|| echo '.claude/INCUBATED_BY' >> "$TARGET_REPO/.git/info/exclude"
echo "✓ Excluded from git: .claude/INCUBATED_BY (local .git/info/exclude)"
fi
# Either way: if a PRIOR incubation already committed the breadcrumb, an
# exclude/ignore rule won't hide an already-tracked file. Auto-untrack it
# (index-only; the file stays on disk) so "must be ignored" actually holds.
if git -C "$TARGET_REPO" ls-files --error-unmatch .claude/INCUBATED_BY >/dev/null 2>&1; then
git -C "$TARGET_REPO" rm --cached --quiet .claude/INCUBATED_BY
echo "✓ Untracked previously-committed .claude/INCUBATED_BY (git rm --cached)"
fi
fi
The breadcrumb enables:
- Orphan detection: Any Claude session can check who tracks this repo
- Provenance chain:
learned-fromlinks /learn → /incubate (#232) - /recap awareness: /recap shows a warning when INCUBATED_BY exists (#229)
The breadcrumb stays out of the target repo's tracked history. Step 0.5 picks the
mechanism by ownership: a committed .gitignore rule for a repo we just created
(so the rule travels with every clone), or a machine-local .git/info/exclude for
a clone we don't own (#447 — never edit a foreign/public repo's committed .gitignore).
Either way it auto-untracks the file if a prior incubation already committed it
(git rm --cached, index-only — the breadcrumb stays on disk). Nothing manual is
left for you to remember.
Step 0.6: Share the vault — symlink target ψ → parent oracle vault
An incubated repo that writes its own memory (retros, learnings, traces) into a
standalone ψ/ strands that brain — the parent oracle never sees it. Point the
target's ψ at the parent vault so incubated work lands in one shared brain.
# Only if the parent actually has a vault to share
if [ -e "$ROOT/ψ" ]; then
ln -sfn "$ROOT/ψ" "$TARGET_REPO/ψ" # -n: don't descend into an existing symlink
echo "✓ Vault shared: $TARGET_REPO/ψ → $ROOT/ψ"
# Keep it OUT of the target's git history via LOCAL exclude (never the
# committed .gitignore — target may be public; #447 rule).
# GOTCHA (neo, 2026-08-16): a bare symlink `ψ` is NOT matched by `ψ/` — the
# trailing slash only matches a directory. Exclude BOTH forms or the symlink
# shows up as untracked.
if [ -d "$TARGET_REPO/.git" ]; then
for pat in 'ψ' 'ψ/'; do
grep -qxF "$pat" "$TARGET_REPO/.git/info/exclude" 2>/dev/null \
|| echo "$pat" >> "$TARGET_REPO/.git/info/exclude"
done
echo "✓ Excluded from git: ψ and ψ/ (local .git/info/exclude)"
fi
fi
Consequence — the vault is now GLOBAL, not per-repo. Once the target's ψ
symlinks into the parent, incubate/, learn/, and memory/ are the same
directory on disk across every repo that shares that vault. /incubate or
/learn in one shows up for all of them. If the parent vault itself is a
symlink into a private companion repo (e.g. neo-oracle/ψ → neo-oracle-vault),
that's deliberate: it keeps memory out of open-source-bound repos while still
sharing one brain. Don't assume an incubated repo's memory is private to it.
If just a name (no slash, no URL)
Try ghq first, then create with default org:
NAME="[NAME]"
ROOT="$(pwd)"
DEFAULT_ORG="laris-co" # Configurable via --org flag
# Anchor to github.com/ (#487) — ghq enumerates dot-directories and non-GitHub
# hosts alike, so an unanchored match can select a backup tree, a gitlab clone,
# or any stray directory holding a `.git`. Measured on one machine: 54 dot-dir
# entries, 156 non-github.com. (Bodies deliberately live outside $(ghq root)
# entirely, so they never appear here — see "Directory Structure".)
MATCH=$(ghq list | grep '^github\.com/' | grep -i "/$NAME$" | head -1)
if [ -n "$MATCH" ]; then
OWNER=$(echo "$MATCH" | cut -d'/' -f2)
REPO=$(echo "$MATCH" | cut -d'/' -f3)
else
OWNER="$DEFAULT_ORG"
REPO="$NAME"
fi
# Then proceed with URL flow using OWNER/REPO
Verify
ls -la "$ROOT/ψ/incubate/$OWNER/$REPO/"
Step 1: Detect Workflow Mode
Check arguments for workflow flags:
| Argument | Mode | Action |
|---|---|---|
| (none) | Default | Clone + symlink + show status |
--wt <slug> | Body | Claim incubate/<slug> + add worktree + symlink (skip clone — the mother must already exist) (#487) |
--flash | Flash | Issue → branch → fix → PR → offload |
--contribute | Contribute | Fork if needed → multi-feature PRs |
--status | Status | List all incubations + bodies (skip clone) |
--offload | Offload | Remove symlink (skip clone); --wt/--all-wt retire bodies |
Steps 0 and 0.5 do not run for
--wt,--statusor--offload. Read the mode first, then jump straight to that mode's section. Running Step 0 on the--wtpath wouldgit stash push -ua peer's uncommitted work in the mother and thenghq get -u(agit pull) underneath them — the exact operation the--wtsection forbids, printing the restore hint into the wrong transcript (#487). The[ -d "$MOTHER/.git" ]check at Step W2 is the entry gate.
--wt always takes a value. Bare --wt on create is an error — list the
existing slugs instead of guessing one. The branch is always incubate/<slug>,
never configurable.
Calculate ACTUAL paths (replace variables with real values):
REPO_DIR = [ROOT]/ψ/incubate/[OWNER]/[REPO]/
SOURCE_DIR = [ROOT]/ψ/incubate/[OWNER]/[REPO]/origin/ ← symlink to mother
WORK_DIR = [GHQ_ROOT]/github.com/[OWNER]/[REPO]/ ← mother working dir
BODY_LINK = [ROOT]/ψ/incubate/[OWNER]/[REPO]/wt/[SLUG]/origin ← symlink to body
BODY_DIR = [WT_ROOT]/[OWNER]/[REPO]/[SLUG]/ ← agent working dir
WT_ROOT = ${INCUBATE_WT_ROOT:-${XDG_STATE_HOME:-$HOME/.local/state}/incubate/worktrees}
⚠️ With --wt, BODY_DIR is your working directory, not WORK_DIR. The mother
is fetch-only.
⚠️ IMPORTANT: Always use literal paths. Never pass shell variables to subagents.
Mode: Default (long-term dev)
After Step 0 (clone + symlink), the repo is ready for development.
Verify working state:
WORK_DIR="$ROOT/ψ/incubate/$OWNER/$REPO/origin"
echo "Branch: $(git -C "$WORK_DIR" branch --show-current)"
echo "Status: $(git -C "$WORK_DIR" status --short | wc -l) changed files"
echo "Remote: $(git -C "$WORK_DIR" remote get-url origin)"
echo "Last commit: $(git -C "$WORK_DIR" log --oneline -1)"
Skip to Step 2 (create/update hub file).
Mode: --wt (parallel bodies, one per agent) — #487
Use when more than one agent develops the same repo at once. Each agent gets its own worktree on its own branch; they share the mother's object store and never touch each other's files.
Step 0 and Step 0.5 do NOT run on this path. No clone, no ghq get -u, no
auto-stash — the mother must already exist, and the [ -d "$MOTHER/.git" ]
check at the top of W2 is the entry gate. Run plain /incubate OWNER/REPO
first if it does not.
Step W1: Validate the slug
Two stages, both needed. git check-ref-format accepts -lead (which would
be read as an option by the next command) and a/b (which would nest inside
wt/), so the case guard is load-bearing — it runs first.
SLUG="[SLUG]"
case "$SLUG" in
''|-*|*/*|*[!a-zA-Z0-9._-]*)
echo "✗ invalid slug '$SLUG' — [a-zA-Z0-9._-] only, no slashes, no leading dash"
exit 2 ;;
esac
git check-ref-format --branch "incubate/$SLUG" >/dev/null 2>&1 \
|| { echo "✗ invalid slug '$SLUG'"; exit 2; }
Step W2: Claim the body — and own it in the same command
The only atomic primitive is git worktree add. Branch creation is a ref
transaction (O_EXCL + rename(2) inside .git), so 8 concurrent adds of the
same slug yield exactly one rc=0 and seven loud fatals — measured. git worktree add also creates missing nested parent directories itself, so there is no mkdir
to race on either.
Shortened here. Read the whole file on GitHub.
Signals
- GitHub stars
- 121
- Forks
- 55
- Last commit
- Sep 2026
ahel review
K4blow
destructive-scoped
Automated review, not a security audit. Ruleset v1+k2.
Advanced
- Catalog kind
- skill
- Gateway key
incubate- Source
- github.com/soul-brews-studio/arra-oracle-skills-cli