@spardutti/claude-skills 2.60.2 → 2.60.3
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/hooks/registry-lib.mjs +2 -1
- package/hooks/registry.mjs +7 -1
- package/package.json +1 -1
package/hooks/registry-lib.mjs
CHANGED
|
@@ -57,7 +57,8 @@ export function loadRegistry(root, files) {
|
|
|
57
57
|
// Code-shaped words (AimStrategy, pick_target, aimRegistry) or `backticked` — never "implement".
|
|
58
58
|
export function symbolsOf(extendBy = "") {
|
|
59
59
|
const ticked = [...extendBy.matchAll(/`([\w.]+)`/g)].map((m) => m[1]);
|
|
60
|
-
const
|
|
60
|
+
const bare = extendBy.replace(/`[^`]*`/g, " ");
|
|
61
|
+
const shaped = bare.match(/\b(?:[A-Z][a-z0-9]+[A-Z]\w*|[a-z]\w*[A-Z]\w*|\w+_\w+)\b/g) ?? [];
|
|
61
62
|
return [...new Set([...ticked, ...shaped])];
|
|
62
63
|
}
|
|
63
64
|
|
package/hooks/registry.mjs
CHANGED
|
@@ -9,6 +9,12 @@ const root = projectRoot();
|
|
|
9
9
|
const files = projectFiles(root);
|
|
10
10
|
const entries = loadRegistry(root, files);
|
|
11
11
|
const uses = (text, word) => new RegExp(`\\b${escape(word)}\\b`).test(text);
|
|
12
|
+
// Code calls a method on a value (`e.chill(2)`), so `EnemyState.chill` is the type named plus `.chill` used.
|
|
13
|
+
const usesIn = (text, name) => {
|
|
14
|
+
const parts = name.split(".");
|
|
15
|
+
if (parts.length === 1 || uses(text, name)) return uses(text, name);
|
|
16
|
+
return uses(text, parts[0]) && new RegExp(`\\.${escape(parts.at(-1))}\\b`).test(text);
|
|
17
|
+
};
|
|
12
18
|
const fromCwd = (f) => relative(root, resolve(f));
|
|
13
19
|
|
|
14
20
|
function list() {
|
|
@@ -38,7 +44,7 @@ function checkPlan(planPath, stubs) {
|
|
|
38
44
|
for (const e of entries) {
|
|
39
45
|
const mark = marks.get(e.name);
|
|
40
46
|
if (!mark) fails.push(`registry FAIL ${e.name}: missing from ## Registry — mark it reuse or skip`);
|
|
41
|
-
else if (mark === "reuse" && !symbolsOf(e.extend_by).some((s) =>
|
|
47
|
+
else if (mark === "reuse" && !symbolsOf(e.extend_by).some((s) => usesIn(added, s))) {
|
|
42
48
|
fails.push(`registry FAIL ${e.name}: marked reuse, but no stub uses ${symbolsOf(e.extend_by).join(", ") || "a name from extend_by"}`);
|
|
43
49
|
} else if (mark === "skip") {
|
|
44
50
|
const hits = triggerHits(e, added);
|