T-132J-worktree-move-creates-parent-dir
Status: closed/obsoleted · Impact: low · Complexity: small
Auto-generated from a /sdlc:task-work post-mortem. Review and
promote to open/ready before picking up.
git worktree move <src> <dst> fails when <dst>’s parent
directory doesn’t exist — the caller must mkdir -p the parent
first. Any convention change that relocates worktrees hits this.
Close the gap either by documenting the mkdir -p prerequisite
wherever prose invokes git worktree move, or by wrapping the move
in a shared helper that creates the parent dir defensively.
| Location | Role today |
|---|---|
apps/sdlc/skills/migrate-runtime-state/migrate_runtime_state.ts | The one programmatic git worktree move caller; already creates the destination parent (mkdirSync(..., { recursive: true })) before moving |
apps/sdlc/skills/migrate-runtime-state/SKILL.md | The only prose mentioning git worktree move; does not state the parent-dir prerequisite |
apps/sdlc/conventions/worktree-scope-guard.md | Home of worktree conventions; no note on the prerequisite |
apps/sdlc/lib/util/git.ts | Shared git/worktree helpers; nothing wraps git worktree move |
Proposed
Section titled “Proposed”Either:
- Doc-only fix: any prose that demonstrates
git worktree moveannotates the prerequisite asmkdir -p <dst-parent> && git worktree move <src> <dst>, andapps/sdlc/conventions/worktree-scope-guard.mdrecords it once. Lowest cost, but only protects future readers of those docs. - Shared helper: a routine in
apps/sdlc/lib/util/git.ts(or an op verb on the sdlc CLI) that creates the destination’s parent, then runsgit worktree move. Callers use it instead of the bare command. Higher up-front cost, but future relocations get the prerequisite for free.
The right answer depends on whether worktree relocations recur: two relocations in plugin history would justify the helper; one suggests the doc fix is enough.
Approach
Section titled “Approach”- Survey
apps/sdlc/skills/**/SKILL.mdandapps/sdlc/conventions/*.mdfor prose that mentionsgit worktree move. If only migrate-runtime-state’s descriptive mentions turn up, this is a one-shot issue and the doc-only fix is appropriate. - Doc-only fix: prepend
mkdir -p <dst-parent> &&to every baregit worktree moveinvocation found, and add a one-line note inapps/sdlc/conventions/worktree-scope-guard.mdcapturing the prerequisite. - Shared helper: add the routine to
apps/sdlc/lib/util/git.ts, replace prose invocations with calls to it, and add a test exercising the happy-path move.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
apps/sdlc/skills/**/SKILL.md | modify | prepend mkdir -p <dst-parent> && to any bare git worktree move invocation |
apps/sdlc/conventions/worktree-scope-guard.md | modify | one-line note: create the destination parent before git worktree move |
apps/sdlc/lib/util/git.ts | modify | helper option: move routine that creates the destination parent, then moves |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: Every
git worktree moveinvocation inapps/sdlc/prose either has a precedingmkdir -p <dst-parent>step OR calls a helper that creates the parent dir. - AC-2: A grep for
git worktree moveacrossapps/sdlc/returns zero un-annotated raw invocations.
Out of scope
Section titled “Out of scope”- Surveying consuming projects’ local skills or hooks for bare
git worktree moveinvocations — this task is about the SDLC plugin’s own surface.
Dependencies
Section titled “Dependencies”- none
Discovery context
Section titled “Discovery context”Spawned by the /sdlc:task-work post-mortem of
T-G834-move-plugin-runtime-state-to-sdlc-dir on 2026-05-22: the
relocation to .sdlc/worktrees/ failed until the destination parent
was created by hand. The dedup search found no overlapping open
task; decision: SPAWNED.