浏览代码

optimize skills-perso + commit-change: round 1 — D3 edge cases

skills-perso: add 'Known limits of detection heuristic' section
(false positives in code blocks, false negatives for non-standard
agent paths, override via owner: user marker, malformed frontmatter).

commit-change: add fallback when commit-changer.md unreachable,
plus pre-flight check stub (detached HEAD, missing git identity).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
bastien 4 天之前
父节点
当前提交
db9048877a
共有 2 个文件被更改,包括 23 次插入3 次删除
  1. 6 3
      skills/commit-change/SKILL.md
  2. 17 0
      skills/skills-perso/SKILL.md

+ 6 - 3
skills/commit-change/SKILL.md

@@ -18,9 +18,12 @@ allowed-tools:
   - AskUserQuestion
 ---
 
-Load and follow strictly:
-- $HOME/.claude/agents/commit-changer.md
+Load and follow strictly: `$HOME/.claude/agents/commit-changer.md`.
 
-Execute the COMMIT-CHANGER agent on the current working directory.
+If unreachable, emit `Commit-changer agent missing.` and STOP. Never auto-commit blind — a wrong group is harder to undo than not committing.
+
+Pre-flight checks (the agent should also perform, but flag here):
+- Detached HEAD or unmerged conflicts → STOP, report state.
+- Identity unconfigured (`git config user.email` empty) → STOP, ask user.
 
 $ARGUMENTS

+ 17 - 0
skills/skills-perso/SKILL.md

@@ -99,3 +99,20 @@ fi
 ```
 
 Keep descriptions to one line (~80 chars max, truncate with "..." if needed).
+
+## Known limits of the detection heuristic
+
+- **False positive (rare):** agent references buried in fenced code blocks
+  (` ``` ... ``` `) match Signal 2 even though they are not active delegations.
+  Mitigation: skill author adds `owner: user` (Signal 1) — explicit always wins.
+- **False negative:** personal skills that delegate to agents under non-standard
+  paths (e.g. `~/.config/myagents/`, `agents-shared/`) won't match Signal 2.
+  Mitigation: same — add `owner: user` to frontmatter.
+- **Frontmatter malformed / missing:** `is_personal()` returns false (skill
+  silently excluded). The "0 personal skills detected" diagnostic catches the
+  zero case but not partial misses.
+- **Description extract edge cases:** plain multi-line YAML (no `|`/`>`) is
+  read as first line only. For users of `description: |` block scalars this is
+  intended; otherwise inspect raw `SKILL.md` if a description looks truncated.
+- **Override:** to force-include a framework skill, fork it into `~/.claude/skills/`
+  and add `owner: user`. The fork is then yours to maintain.