All four git-feature-* skills hardcoded /Users/torcsi/dev/kicad-wasm/ for
the helper-script invocations and one documentation example. That path
only resolved on the original author's machine — anyone else picking up
/git-feature-{start,commit,sync,finish} would hit "No such file or
directory" before the first pre-flight check ran.
Replaces the absolute paths with relative ones (`bash scripts/...`) and
rewrites the rebase-conflict handoff message in git-feature-sync.md to use
`git -C kicad ...` style instead of a hardcoded cd.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
4.5 KiB
| name | description |
|---|---|
| git-feature-finish | Merge the current feature branch back to main (fast-forward only) and push, across all 3 repos. Submodules first, then root - so the root push includes the merged submodule SHAs. Stops for confirmation at each merge and push. Usage - "/git-feature-finish". |
git-feature-finish
Land the current feature branch into each repo's main and push. Uses --ff-only for clean linear history.
Per-repo main mapping is in scripts/git-workflow/repos.sh (root=main, subs=wasm-port).
Pre-flight (all of these must pass before any merge happens)
- Fetch every origin FIRST. Run
bash scripts/git-workflow/for-each-repo.sh fetch origin. This is mandatory and must happen before the status snapshot.repo-status.shderivesup_to_date_with_mainfrom the localorigin/<main>ref without fetching — so without this step a repo whose origin has moved looks "up to date", check 5 passes, and the staleness is only discovered mid-merge (thepull --ff-onlyin the steps below would catch it, but then you've already merged the earlier repos). Fetching here makes the pre-flight STOP cleanly with "run/git-feature-syncfirst" instead of bailing partway through. - Run
bash scripts/git-workflow/repo-status.sh. Parse the JSON. Because step 1 just fetched,up_to_date_with_mainnow reflects true remote state. - All 3 repos must have
dirty: false. If any is dirty, STOP and tell the user to commit (/git-feature-commit) or stash first. - All 3 repos must be on the same feature branch (use root's branch as the reference). If not, STOP and report the mismatch.
- All 3 repos must have
up_to_date_with_main: true(i.e. the feature is rebased onto the latest main). If any isn't, STOP and instruct: "run/git-feature-syncfirst". - None may have
rebase_in_progress: true. If so, STOP.
Steps — order: kicad, wxwidgets, root
Submodules first so that when root checks out main and merges its feature branch, the pointer-bump commits land on root's main referencing the just-merged submodule mains.
For each repo in order [kicad, wxwidgets, root]:
-
Skip if already merged: run
, skipping merge+push" and proceed to step 5 (branch delete prompt).git -C <path> branch --merged <main>and check if the feature branch appears. If so, print ": feature already merged into -
Prose-ask: "About to merge
<feature>into<main>in (ff-only) — proceed?" -
Run, echoing each:
git -C <path> checkout <main>(auto-allowed)git -C <path> pull --ff-only(auto-allowed) — if this fails because main moved with non-ff changes, STOP and tell the user: ": main moved with non-ff changes since last sync. Run/git-feature-syncand try again." Do NOT try--no-ff.git -C <path> merge --ff-only <feature>(hitsaskpermission — user reconfirms at tool layer). If this fails because main moved in a way that breaks ff, STOP with the same message as above.
-
Prose-ask: "Push 's
to origin? — proceed?"git -C <path> push(hitsaskpermission).
-
Prose-ask: "Delete local feature branch
<feature>in ?"git -C <path> branch -d <feature>(hitsaskpermission). This is safe (-d, not-D) — git refuses if the branch isn't fully merged, which is exactly the safety we want.
After all 3 repos done
Report a summary table:
kicad: merged feature/foo into wasm-port, pushed (origin/wasm-port now at <sha>), branch deleted
wxwidgets: merged feature/foo into wasm-port, pushed (origin/wasm-port now at <sha>), branch deleted
root: merged feature/foo into main, pushed (origin/main now at <sha>), branch deleted
If features/<feature>/ exists from scripts/create-feature-patches.sh, mention it but do NOT auto-delete. The user may want to keep the patches as history.
Edge cases
- Feature already merged in some repos but not all: the per-repo
--mergedcheck handles this naturally — finish skips re-merging and just offers branch delete. - No local feature branch left to delete in some repo:
branch -dwill fail; report and continue. Don't make this fatal. -ufirst-push: this workflow never pushes feature branches, only mains. Mains always have tracking already.
Safety
--ff-onlyeverywhere, no fallback to--no-ff.branch -dnot-D— never force-delete.- Never
--forcepush. The settings.jsondenyrule blocks this regardless. - Always echo commands before running.
- Always pose the prose confirmation BEFORE invoking the tool-layer prompt.