From e92becf609794b95f742fba76b60ffd61f0e513e Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Wed, 26 Aug 2026 19:11:18 +0200 Subject: [PATCH] =?UTF-8?q?optimize=20profile:=20d3=20=E2=80=94=20failure-?= =?UTF-8?q?mode=20table=20(script=20absent,=20unknown=20name/verb=20rc=3D1?= =?UTF-8?q?,=20partial=20toggle,=20split=20plugin=20leg,=20current-contrad?= =?UTF-8?q?iction)=20+=20fixture=20de-drift?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- skills/profile/SKILL.md | 11 +++++++++++ skills/profile/test-prompts.json | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/skills/profile/SKILL.md b/skills/profile/SKILL.md index 2f9edc8..40922a1 100644 --- a/skills/profile/SKILL.md +++ b/skills/profile/SKILL.md @@ -111,6 +111,17 @@ skills. bash "$HOME/.claude/lib/profile.sh" $ARGUMENTS ``` +## Failure modes + +| Trigger | First move | If still stuck | +|---|---|---| +| `lib/profile.sh` absent (foreign machine, links broken) | `test -f "$HOME/.claude/lib/profile.sh"` before any verb; missing → propose `bash link.sh` from the config repo | STOP — never hand-move symlinks to emulate the script | +| Unknown profile name (rc=1, `✗ Profile not found`) | Show `list` output + the closest existing name ("`desing` → did you mean `design`?") | Let the user pick — never guess-and-`set` | +| Unknown verb (rc=1 + usage) | Re-map the request to the argument-hint verbs, retry once | Show usage, ask | +| `set`/`apply` exits nonzero MID-TOGGLE (permission, plugin CLI failure) | State may be PARTIAL. Run `current` to show what actually took; name the failed item from the script's output | Offer `reset` as recovery to a known state; never blind-rerun `set` on top of partial state | +| Plugin/MCP leg fails (marketplace/network) while symlink leg succeeded | Report the split state explicitly + print the manual `claude plugin`/`claude mcp` command for the failed leg | — | +| `current` says `none` right after a successful `set ` | Contradiction — do not trust either; show the raw script output to the user | Known failure family (BLK: symlink resolution in `cmd_current`) — report, don't hand-patch | + ## Output policy - After `set` / `apply` / `reset` / `gstack on|off`: show the count of skills diff --git a/skills/profile/test-prompts.json b/skills/profile/test-prompts.json index 5ee3f50..04bb922 100644 --- a/skills/profile/test-prompts.json +++ b/skills/profile/test-prompts.json @@ -1,5 +1,5 @@ [ - {"id": 1, "prompt": "profile list", "expected": "Skill runs `bash $HOME/.claude/lib/profile.sh list` and prints the table of available profiles (web, seo, web-full, backend, design, dev, qa, audit, minimal) without extra commentary."}, + {"id": 1, "prompt": "profile list", "expected": "Skill runs `bash $HOME/.claude/lib/profile.sh list` and prints the table of every profile defined under lib/profiles/*.profile (10 today, incl. web, full, minimal) without extra commentary."}, {"id": 2, "prompt": "active les skills design — désactive le bruit gstack", "expected": "Skill interprets this as `set design` (destructive — disables non-listed gstack skills), confirms first since `set` is destructive, then runs `bash $HOME/.claude/lib/profile.sh set design` and reports the count of skills moved plus the reminder to start a new Claude session to pick up changes."}, {"id": 3, "prompt": "quel profil est actif?", "expected": "Skill runs `bash $HOME/.claude/lib/profile.sh current` and reports the detected active profile with its match percentage; does NOT toggle any symlinks."} ]