feat(gitflow): chore branch type + aiguillage for standalone memory/doc skills

Standalone /capitalize /close /prune-memory /reconcile no longer lean on the .claude/** hook exemption when run on main/develop: the aiguillage branches them to chore/* off develop before writing. New chore type (base develop, finish->develop) added to the lib; hook unchanged (chore/* non-protected). Closes the leak where standalone memory work (memory IS the work, no code branch to follow) landed direct on a protected base. 64/64 gitflow-test green, shellcheck clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RNaYKPEkjH1jbgoX1TwKMX
This commit is contained in:
Bastien Chanot
2026-07-01 13:25:36 +02:00
co-authored by Claude Opus 4.8
parent 53bd7beee8
commit e8807a7333
9 changed files with 82 additions and 28 deletions
+28 -13
View File
@@ -1,26 +1,41 @@
# Gitflow aiguillage — assistance flows branch on a protected base
# Gitflow aiguillage — branch on a protected base before writing
Assistance flows (`/feat`, `/bugfix`, `/hotfix`) commit IN PLACE on a working
branch — the frequent case, behavior unchanged. But they must NEVER commit code
on a protected base (`main`/`develop`). Run this check **before editing any
file**. The caller passes its TYPE: feat→`feature`, bugfix→`bugfix`,
hotfix→`hotfix`.
Flows that WRITE — code, OR standalone memory/doc work — must NEVER commit on a
protected base (`main`/`develop`). Run this check **before editing any file**.
```bash
bash "$HOME/.claude/lib/gitflow.sh" protected-base && echo PROTECTED || echo WORKING
```
- **WORKING** (`feature/*`, `bugfix/*`, `hotfix/*`, or any non-protected branch)
→ proceed; you commit in place on this branch. Nothing changes.
- **WORKING** (`feature/*`, `bugfix/*`, `hotfix/*`, `chore/*`, or any non-protected
branch) → proceed; you commit in place on this branch. Nothing changes.
- **PROTECTED** (`main`/`develop`) → branch first, do NOT commit here:
```bash
bash "$HOME/.claude/lib/gitflow.sh" start <YOUR-TYPE> <short-kebab-name>
```
`<short-kebab-name>` derived from the request. Then do the work on the new branch.
**Never run `gitflow finish`** — assistance flows commit, they do not merge.
Integration is a separate, human-gated step (the `gitflow` skill).
The caller passes its TYPE:
Note: `hotfix` branches off **main** (prod) even when invoked from `develop` —
that is the gitflow definition of a hotfix. For a dev-scoped small fix, use
`/bugfix` (branches off develop).
| Caller | TYPE | Base |
|--------|------|------|
| `/feat` | `feature` | develop |
| `/bugfix` | `bugfix` | develop |
| `/hotfix` | `hotfix` | main |
| `/capitalize` · `/close` · `/prune-memory` · `/reconcile` | `chore` | develop |
The `chore` row = **standalone memory/doc work**: the registry / TODO / doc
reconciliation & curation skills, run OUTSIDE an assistance flow. Inside `/feat`
`/bugfix` `/hotfix` `/ship-feature` a working branch already exists (this check
returns WORKING) and the memory commit rides it. The aiguillage only fires when
such a skill is invoked directly on `main`/`develop` — i.e. memory IS the work,
with no code branch to follow. That is the leak it closes: the `.claude/**` hook
exemption still lets a *manual* memory commit through on a protected base, but a
skill-driven one now branches to `chore/*` first.
**Never run `gitflow finish`** — these flows commit, they do not merge. Integration
is a separate, human-gated step (the `gitflow` skill).
Note: `hotfix` branches off **main** (prod) even when invoked from `develop` — that
is the gitflow definition of a hotfix. For a dev-scoped small fix, use `/bugfix`
(branches off develop).