@spardutti/claude-skills 2.8.0 → 2.8.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.
Files changed (2) hide show
  1. package/lib/setup-hook.mjs +31 -20
  2. package/package.json +1 -1
@@ -89,45 +89,56 @@ if [ ! -f "/tmp/claude-skill-gate-$SESSION_ID" ]; then
89
89
  exit 0
90
90
  fi
91
91
 
92
- # Find the first loaded-but-unacked skill (handle one at a time; the next
93
- # blocked write will surface the next skill).
92
+ # Collect every loaded-but-unacked skill so a single ack clears them all.
94
93
  UNACKED=""
95
94
  for marker in /tmp/claude-skill-loaded-$SESSION_ID-*; do
96
95
  [ ! -f "$marker" ] && continue
97
96
  skill_name="\${marker##/tmp/claude-skill-loaded-$SESSION_ID-}"
98
97
  if [ ! -f "/tmp/claude-skill-acked-$SESSION_ID-$skill_name" ]; then
99
- UNACKED="$skill_name"
100
- break
98
+ UNACKED="$UNACKED $skill_name"
101
99
  fi
102
100
  done
101
+ UNACKED="\${UNACKED# }"
103
102
 
104
103
  if [ -z "$UNACKED" ]; then
105
104
  exit 0
106
105
  fi
107
106
 
108
- SKILL_MD="$PROJECT_DIR/.claude/skills/$UNACKED/SKILL.md"
109
- RULES=""
110
- if [ -f "$SKILL_MD" ]; then
111
- RULES=$(awk '/^## Rules/{flag=1} /^## /{if(flag && !/^## Rules/)exit} flag' "$SKILL_MD")
112
- fi
113
- if [ -z "$RULES" ]; then
114
- RULES="(Rules section not found in $SKILL_MD — refer to the loaded skill content already in context.)"
115
- fi
107
+ # One touch call with explicit paths — brace expansion is not used because
108
+ # bash leaves a single-element {name} literal, creating a garbage marker.
109
+ ACK_CMD="touch"
110
+ NAMES=""
111
+ RULES_BLOCKS=""
112
+ for skill in $UNACKED; do
113
+ ACK_CMD="$ACK_CMD /tmp/claude-skill-acked-$SESSION_ID-$skill"
114
+ NAMES="$NAMES, '$skill'"
115
+ SKILL_MD="$PROJECT_DIR/.claude/skills/$skill/SKILL.md"
116
+ RULES=""
117
+ if [ -f "$SKILL_MD" ]; then
118
+ RULES=$(awk '/^## Rules/{flag=1} /^## /{if(flag && !/^## Rules/)exit} flag' "$SKILL_MD")
119
+ fi
120
+ if [ -z "$RULES" ]; then
121
+ RULES="(Rules section not found in $SKILL_MD — refer to the loaded skill content already in context.)"
122
+ fi
123
+ RULES_BLOCKS="$RULES_BLOCKS
124
+ ### Rules from $skill/SKILL.md
116
125
 
117
- MSG="BLOCKED: skill '$UNACKED' was loaded but not yet applied to your work.
126
+ $RULES
127
+ "
128
+ done
129
+ NAMES="\${NAMES#, }"
130
+
131
+ MSG="BLOCKED: loaded skills not yet applied to your work: $NAMES
118
132
 
119
133
  Before this Write/Edit, you must:
120
134
 
121
- 1. State the specific rules from '$UNACKED' that apply to the file you're about to write.
135
+ 1. For each skill listed above, state the specific rules that apply to the file you're about to write.
122
136
  2. State how your next write respects each rule.
123
- 3. Then ack the application by running this Bash tool call:
124
- touch /tmp/claude-skill-acked-$SESSION_ID-$UNACKED
137
+ 3. Then ack all of them in a single Bash tool call:
138
+ $ACK_CMD
125
139
 
126
140
  One ack per skill per session. After acking, retry the Write/Edit.
127
-
128
- Rules from $UNACKED/SKILL.md:
129
-
130
- $RULES"
141
+ $RULES_BLOCKS"
131
142
 
132
143
  json_escape() {
133
144
  local s="$1"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spardutti/claude-skills",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "description": "CLI to install Claude Code skills from the claude-skills collection",
5
5
  "type": "module",
6
6
  "bin": {