@spardutti/claude-skills 2.61.0 → 2.62.0

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.
@@ -40,7 +40,7 @@ export function parseEntry(text) {
40
40
  const m = line.match(/^([a-z_]+):\s*(.*?)\s*(?:\s#.*)?$/);
41
41
  if (m) entry[m[1]] = value(m[2]);
42
42
  }
43
- for (const key of ["triggers", "does", "allowed"]) entry[key] = [].concat(entry[key] ?? []).filter(Boolean);
43
+ for (const key of ["triggers", "does", "allowed", "rules"]) entry[key] = [].concat(entry[key] ?? []).filter(Boolean);
44
44
  return entry;
45
45
  }
46
46
 
@@ -4,6 +4,7 @@ import { dirname, join, relative, resolve } from "node:path";
4
4
  import {
5
5
  REGISTRY_SUFFIX, addedText, escape, insideLocation, loadRegistry, projectFiles, projectRoot, symbolsOf, triggerHits,
6
6
  } from "./registry-lib.mjs";
7
+ import { loadEditRules } from "./text-rules.mjs";
7
8
 
8
9
  const root = projectRoot();
9
10
  const files = projectFiles(root);
@@ -72,6 +73,7 @@ function evaluate() {
72
73
  function stale() {
73
74
  const problems = [];
74
75
  const seen = new Set();
76
+ const ruleIds = entries.some((e) => e.rules.length) ? Object.values(loadEditRules(root)).flat().map((r) => r.id) : [];
75
77
  for (const e of entries) {
76
78
  const say = (why) => problems.push(`registry stale ${e.file}: ${why}`);
77
79
  for (const key of ["name", "summary", "location", "extend_by"]) {
@@ -80,6 +82,7 @@ function stale() {
80
82
  }
81
83
  if (!e.triggers.length) say("no triggers");
82
84
  for (const f of e.allowed) if (!existsSync(join(root, f))) say(`allowed ${f} not found`);
85
+ for (const id of e.rules) if (!ruleIds.includes(id)) say(`rule ${id} not found in .edit-rules.json`);
83
86
  if (e.name && !/^[\w.-]+$/.test(e.name)) say(`name ${e.name} may hold only letters, digits, dashes and dots`);
84
87
  if (/^\s+-\s/m.test(e.text)) say("write lists on one line, like triggers: [aim, target]");
85
88
  if (seen.has(e.name)) say(`name ${e.name} is used twice`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spardutti/claude-skills",
3
- "version": "2.61.0",
3
+ "version": "2.62.0",
4
4
  "description": "Guardrails for Claude Code — best-practice skills, planning commands, and delivery gates.",
5
5
  "type": "module",
6
6
  "repository": {