@spardutti/claude-skills 1.28.1 → 1.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -5
- package/lib/setup-hook.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -101,18 +101,22 @@ The CLI will:
|
|
|
101
101
|
|
|
102
102
|
After installing skills, the CLI asks if you want to set up automatic skill evaluation. If you say yes, it will:
|
|
103
103
|
|
|
104
|
-
- **
|
|
104
|
+
- **Install two hooks** in `.claude/hooks/`:
|
|
105
|
+
- `skill-gate.sh` — PreToolUse gate on `Write|Edit|MultiEdit`
|
|
106
|
+
- `skill-gate-automark.sh` — PostToolUse on `Skill` that auto-clears the gate
|
|
105
107
|
- **Update your `CLAUDE.md`** with the skill-evaluation rule
|
|
106
108
|
|
|
107
|
-
The gate hard-blocks `Write`, `Edit`, and `MultiEdit`
|
|
109
|
+
The gate hard-blocks `Write`, `Edit`, and `MultiEdit` until a per-session marker file exists at `/tmp/claude-skill-gate-<SESSION_ID>`. The marker is created automatically the first time Claude invokes any `Skill()` in the session — so the normal flow is: Claude lists skills as ACTIVATE/SKIP, calls `Skill()` for the ACTIVATE ones, and the gate clears for the rest of the session. If every skill is SKIP, Claude clears the gate by running `touch /tmp/claude-skill-gate-<SESSION_ID>`.
|
|
110
|
+
|
|
111
|
+
The marker is **per-session, not per-turn** — short follow-ups like "yes" don't re-lock the gate after evaluation has already happened.
|
|
108
112
|
|
|
109
113
|
Unlike a soft reminder injected into context (which Claude can ignore), the gate denies the tool call outright — so the only path forward is to actually evaluate skills.
|
|
110
114
|
|
|
111
|
-
The gate auto-passes when the project has no skills
|
|
115
|
+
The gate auto-passes when the project has no `.claude/skills/*/SKILL.md` files, so it's safe to leave on globally.
|
|
112
116
|
|
|
113
117
|
### What gets created
|
|
114
118
|
|
|
115
|
-
**`.claude/settings.json`** — Registers
|
|
119
|
+
**`.claude/settings.json`** — Registers both hooks:
|
|
116
120
|
|
|
117
121
|
```json
|
|
118
122
|
{
|
|
@@ -127,12 +131,23 @@ The gate auto-passes when the project has no skills installed, so it's safe to l
|
|
|
127
131
|
}
|
|
128
132
|
]
|
|
129
133
|
}
|
|
134
|
+
],
|
|
135
|
+
"PostToolUse": [
|
|
136
|
+
{
|
|
137
|
+
"matcher": "Skill",
|
|
138
|
+
"hooks": [
|
|
139
|
+
{
|
|
140
|
+
"type": "command",
|
|
141
|
+
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/skill-gate-automark.sh"
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
}
|
|
130
145
|
]
|
|
131
146
|
}
|
|
132
147
|
}
|
|
133
148
|
```
|
|
134
149
|
|
|
135
|
-
**`CLAUDE.md`** — Appends the evaluation rule
|
|
150
|
+
**`CLAUDE.md`** — Appends the skill-evaluation rule that tells Claude to enumerate skills as ACTIVATE/SKIP and call `Skill()` for ACTIVATE entries before writing code.
|
|
136
151
|
|
|
137
152
|
## Manual Install
|
|
138
153
|
|
package/lib/setup-hook.mjs
CHANGED
|
@@ -34,7 +34,7 @@ if [ -f "$MARKER" ]; then
|
|
|
34
34
|
fi
|
|
35
35
|
|
|
36
36
|
cat <<EOF
|
|
37
|
-
{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"
|
|
37
|
+
{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"BLOCKED: skill evaluation required before file edits in this session.\\n\\nStep 1 — evaluate every available skill as ACTIVATE or SKIP with a one-line reason.\\n\\nStep 2 — you MUST take EXACTLY ONE of these tool actions to clear the gate. Listing skills in text is NOT enough; retrying the edit without doing one of these will be denied again:\\n (a) If any skill is ACTIVATE → call Skill(name) for it. This auto-clears the gate.\\n (b) If ALL skills are SKIP → run this Bash tool call: touch /tmp/claude-skill-gate-$SESSION_ID\\n\\nStep 3 — only after Step 2 completes, retry the file edit."}}
|
|
38
38
|
EOF
|
|
39
39
|
exit 0
|
|
40
40
|
`;
|