@spardutti/claude-skills 1.16.1 → 1.16.2

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.
@@ -12,7 +12,15 @@ skill_evaluation:
12
12
  4. Only THEN proceed to implementation
13
13
  If you skip this evaluation, your response is INCOMPLETE and WRONG.`;
14
14
 
15
- const MARKER = "skill_evaluation:";
15
+ const FILE_SIZE_BLOCK = `
16
+ ## File Size Enforcement
17
+
18
+ - **Never write a file longer than 200 lines of code.** If a file would exceed 200 lines, split it into smaller modules before writing.
19
+ - This rule applies during skill evaluation: if the code you're about to write would exceed 200 lines in any single file, refactor into multiple files first.
20
+ - Skill evaluation must check this limit as part of every ACTIVATE decision.`;
21
+
22
+ const EVAL_MARKER = "skill_evaluation:";
23
+ const FILE_SIZE_MARKER = "## File Size Enforcement";
16
24
 
17
25
  export async function setupClaudeMd(targetDir = process.cwd()) {
18
26
  const resolved = resolve(targetDir);
@@ -25,18 +33,33 @@ export async function setupClaudeMd(targetDir = process.cwd()) {
25
33
  // File doesn't exist — will create
26
34
  }
27
35
 
28
- // Don't add duplicate block
29
- if (existing.includes(MARKER)) {
30
- console.log(" CLAUDE.md already has skill_evaluation block — skipped.");
36
+ const hasEval = existing.includes(EVAL_MARKER);
37
+ const hasFileSize = existing.includes(FILE_SIZE_MARKER);
38
+
39
+ if (hasEval && hasFileSize) {
40
+ console.log(" CLAUDE.md already has skill_evaluation and file size rules — skipped.");
31
41
  return;
32
42
  }
33
43
 
34
- // Append the block (after trailing ``` if the file uses a yaml code fence)
35
- const trimmed = existing.trimEnd();
36
- const content = trimmed.length > 0
37
- ? trimmed + "\n" + SKILL_EVAL_BLOCK + "\n"
38
- : SKILL_EVAL_BLOCK.trimStart() + "\n";
44
+ let content = existing.trimEnd();
45
+
46
+ if (!hasEval) {
47
+ content = content.length > 0
48
+ ? content + "\n" + SKILL_EVAL_BLOCK
49
+ : SKILL_EVAL_BLOCK.trimStart();
50
+ }
39
51
 
40
- await writeFile(claudeMdPath, content, { mode: 0o644 });
41
- console.log(" CLAUDE.md updated with skill_evaluation block.");
52
+ if (!hasFileSize) {
53
+ content = content + "\n" + FILE_SIZE_BLOCK;
54
+ }
55
+
56
+ await writeFile(claudeMdPath, content + "\n", { mode: 0o644 });
57
+
58
+ if (!hasEval && !hasFileSize) {
59
+ console.log(" CLAUDE.md updated with skill_evaluation and file size rules.");
60
+ } else if (!hasEval) {
61
+ console.log(" CLAUDE.md updated with skill_evaluation block.");
62
+ } else {
63
+ console.log(" CLAUDE.md updated with file size enforcement rule.");
64
+ }
42
65
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spardutti/claude-skills",
3
- "version": "1.16.1",
3
+ "version": "1.16.2",
4
4
  "description": "CLI to install Claude Code skills from the claude-skills collection",
5
5
  "type": "module",
6
6
  "bin": {