From 056f82b25f17526f052a83eaca2f3cc062f7c91d Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Wed, 26 Aug 2026 19:57:21 +0200 Subject: [PATCH] =?UTF-8?q?optimize=20gitflow:=20d3=20=E2=80=94=20mechanic?= =?UTF-8?q?al=20failure=20table=20keyed=20to=20lib=20return=20codes=20(rc?= =?UTF-8?q?=3D4=20conflict=20resume,=20rc=3D2/3/1=20start=20paths,=20best-?= =?UTF-8?q?effort=20purge,=20socle=20abort)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- skills/gitflow/SKILL.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/skills/gitflow/SKILL.md b/skills/gitflow/SKILL.md index 684bb24..62f2f79 100644 --- a/skills/gitflow/SKILL.md +++ b/skills/gitflow/SKILL.md @@ -77,6 +77,18 @@ call `start ` to branch first; on a working branch they commit in place. S `protected-base` predicate the out-of-skill hook uses. Caller→type map + rationale: `lib/gitflow-aiguillage.md`. +## Failure modes (mechanical — lib return codes are the contract) + +| Trigger | Move | +|---|---| +| `~/.claude/lib/gitflow.sh` absent (foreign machine, links broken) | STOP; remedy = `bash link.sh` from the config repo. Never emulate the model by hand-git | +| `finish` rc=4 — merge conflict (message: "resolve, commit, re-run finish") | The conflict sits in the tree ON the target branch. Show conflicted files, resolve WITH the user (it's shared-branch content), `git add` + commit, re-run `finish`. The human GO already given covers completing THIS merge — no new gate. A fan-out (hotfix/release) interrupted mid-way resumes on re-run; already-merged targets no-op | +| `start` rc=2 — bad/missing type or name | Fix the arguments (`/`), retry once | +| `start` rc=3 — base branch missing | `gitflow init` first, then retry `start` | +| `start`/`finish` rc=1 — checkout failed (dirty tree blocking, or branch already exists) | Report git's message verbatim; if the branch exists, ask resume-it vs new name. Never fall back to raw `git checkout -b` | +| finish warning "transient artifacts … purge skipped, finishing without it" | Non-fatal BY CONTRACT (purge is best-effort) — the merge completed; clean `docs/superpowers/` by hand later | +| `init` rc=1 — socle commit failed | Recoverable: aborted BEFORE hook activation by design; fix the cause (hooks, perms), re-run `init` | + ## Common Mistakes - Using `finishing-a-development-branch` for a gitflow merge → it can't do directed/fan-out merges. Use `gitflow finish`.