claude-agent-skills 1.3.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.
Files changed (153) hide show
  1. package/README.md +65 -0
  2. package/bundled-skills/ask-matt/SKILL.md +61 -0
  3. package/bundled-skills/brainstorming/SKILL.md +159 -0
  4. package/bundled-skills/brainstorming/scripts/frame-template.html +213 -0
  5. package/bundled-skills/brainstorming/scripts/helper.js +167 -0
  6. package/bundled-skills/brainstorming/scripts/server.cjs +723 -0
  7. package/bundled-skills/brainstorming/scripts/start-server.sh +209 -0
  8. package/bundled-skills/brainstorming/scripts/stop-server.sh +120 -0
  9. package/bundled-skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  10. package/bundled-skills/brainstorming/visual-companion.md +298 -0
  11. package/bundled-skills/cavecrew/README.md +41 -0
  12. package/bundled-skills/cavecrew/SKILL.md +82 -0
  13. package/bundled-skills/caveman/README.md +48 -0
  14. package/bundled-skills/caveman/SKILL.md +78 -0
  15. package/bundled-skills/caveman-commit/README.md +44 -0
  16. package/bundled-skills/caveman-commit/SKILL.md +65 -0
  17. package/bundled-skills/caveman-compress/README.md +163 -0
  18. package/bundled-skills/caveman-compress/SECURITY.md +31 -0
  19. package/bundled-skills/caveman-compress/SKILL.md +111 -0
  20. package/bundled-skills/caveman-compress/scripts/__init__.py +9 -0
  21. package/bundled-skills/caveman-compress/scripts/__main__.py +3 -0
  22. package/bundled-skills/caveman-compress/scripts/benchmark.py +80 -0
  23. package/bundled-skills/caveman-compress/scripts/cli.py +85 -0
  24. package/bundled-skills/caveman-compress/scripts/compress.py +342 -0
  25. package/bundled-skills/caveman-compress/scripts/detect.py +121 -0
  26. package/bundled-skills/caveman-compress/scripts/validate.py +213 -0
  27. package/bundled-skills/caveman-help/README.md +38 -0
  28. package/bundled-skills/caveman-help/SKILL.md +63 -0
  29. package/bundled-skills/caveman-review/README.md +33 -0
  30. package/bundled-skills/caveman-review/SKILL.md +55 -0
  31. package/bundled-skills/caveman-stats/README.md +30 -0
  32. package/bundled-skills/caveman-stats/SKILL.md +10 -0
  33. package/bundled-skills/codebase-design/DEEPENING.md +37 -0
  34. package/bundled-skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  35. package/bundled-skills/codebase-design/SKILL.md +114 -0
  36. package/bundled-skills/council/SKILL.md +77 -0
  37. package/bundled-skills/diagnosing-bugs/SKILL.md +134 -0
  38. package/bundled-skills/diagnosing-bugs/scripts/hitl-loop.template.sh +41 -0
  39. package/bundled-skills/dispatching-parallel-agents/SKILL.md +185 -0
  40. package/bundled-skills/domain-modeling/ADR-FORMAT.md +47 -0
  41. package/bundled-skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  42. package/bundled-skills/domain-modeling/SKILL.md +74 -0
  43. package/bundled-skills/edit-article/SKILL.md +15 -0
  44. package/bundled-skills/executing-plans/SKILL.md +70 -0
  45. package/bundled-skills/finishing-a-development-branch/SKILL.md +241 -0
  46. package/bundled-skills/git-guardrails-claude-code/SKILL.md +95 -0
  47. package/bundled-skills/git-guardrails-claude-code/scripts/block-dangerous-git.sh +25 -0
  48. package/bundled-skills/grill-me/SKILL.md +7 -0
  49. package/bundled-skills/grill-with-docs/SKILL.md +7 -0
  50. package/bundled-skills/grilling/SKILL.md +10 -0
  51. package/bundled-skills/handoff/SKILL.md +16 -0
  52. package/bundled-skills/i-am-dumb/SKILL.md +57 -0
  53. package/bundled-skills/implement/SKILL.md +15 -0
  54. package/bundled-skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
  55. package/bundled-skills/improve-codebase-architecture/SKILL.md +66 -0
  56. package/bundled-skills/migrate-to-shoehorn/SKILL.md +118 -0
  57. package/bundled-skills/obsidian-vault/SKILL.md +59 -0
  58. package/bundled-skills/ponytail/SKILL.md +117 -0
  59. package/bundled-skills/ponytail-audit/SKILL.md +50 -0
  60. package/bundled-skills/ponytail-debt/SKILL.md +59 -0
  61. package/bundled-skills/ponytail-gain/SKILL.md +51 -0
  62. package/bundled-skills/ponytail-help/SKILL.md +43 -0
  63. package/bundled-skills/ponytail-review/SKILL.md +51 -0
  64. package/bundled-skills/prototype/LOGIC.md +79 -0
  65. package/bundled-skills/prototype/SKILL.md +31 -0
  66. package/bundled-skills/prototype/UI.md +112 -0
  67. package/bundled-skills/receiving-code-review/SKILL.md +213 -0
  68. package/bundled-skills/requesting-code-review/SKILL.md +103 -0
  69. package/bundled-skills/requesting-code-review/code-reviewer.md +172 -0
  70. package/bundled-skills/resolving-merge-conflicts/SKILL.md +14 -0
  71. package/bundled-skills/scaffold-exercises/SKILL.md +106 -0
  72. package/bundled-skills/setup-matt-pocock-skills/SKILL.md +127 -0
  73. package/bundled-skills/setup-matt-pocock-skills/domain.md +51 -0
  74. package/bundled-skills/setup-matt-pocock-skills/issue-tracker-github.md +34 -0
  75. package/bundled-skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +35 -0
  76. package/bundled-skills/setup-matt-pocock-skills/issue-tracker-local.md +19 -0
  77. package/bundled-skills/setup-matt-pocock-skills/triage-labels.md +15 -0
  78. package/bundled-skills/setup-pre-commit/SKILL.md +91 -0
  79. package/bundled-skills/subagent-driven-development/SKILL.md +418 -0
  80. package/bundled-skills/subagent-driven-development/implementer-prompt.md +139 -0
  81. package/bundled-skills/subagent-driven-development/scripts/review-package +44 -0
  82. package/bundled-skills/subagent-driven-development/scripts/sdd-workspace +22 -0
  83. package/bundled-skills/subagent-driven-development/scripts/task-brief +40 -0
  84. package/bundled-skills/subagent-driven-development/task-reviewer-prompt.md +188 -0
  85. package/bundled-skills/systematic-debugging/CREATION-LOG.md +119 -0
  86. package/bundled-skills/systematic-debugging/SKILL.md +296 -0
  87. package/bundled-skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  88. package/bundled-skills/systematic-debugging/condition-based-waiting.md +115 -0
  89. package/bundled-skills/systematic-debugging/defense-in-depth.md +122 -0
  90. package/bundled-skills/systematic-debugging/find-polluter.sh +63 -0
  91. package/bundled-skills/systematic-debugging/root-cause-tracing.md +169 -0
  92. package/bundled-skills/systematic-debugging/test-academic.md +14 -0
  93. package/bundled-skills/systematic-debugging/test-pressure-1.md +58 -0
  94. package/bundled-skills/systematic-debugging/test-pressure-2.md +68 -0
  95. package/bundled-skills/systematic-debugging/test-pressure-3.md +69 -0
  96. package/bundled-skills/tdd/SKILL.md +108 -0
  97. package/bundled-skills/tdd/mocking.md +59 -0
  98. package/bundled-skills/tdd/refactoring.md +10 -0
  99. package/bundled-skills/tdd/tests.md +61 -0
  100. package/bundled-skills/teach/GLOSSARY-FORMAT.md +35 -0
  101. package/bundled-skills/teach/LEARNING-RECORD-FORMAT.md +46 -0
  102. package/bundled-skills/teach/MISSION-FORMAT.md +31 -0
  103. package/bundled-skills/teach/RESOURCES-FORMAT.md +32 -0
  104. package/bundled-skills/teach/SKILL.md +140 -0
  105. package/bundled-skills/test-driven-development/SKILL.md +371 -0
  106. package/bundled-skills/test-driven-development/testing-anti-patterns.md +299 -0
  107. package/bundled-skills/to-issues/SKILL.md +84 -0
  108. package/bundled-skills/to-prd/SKILL.md +75 -0
  109. package/bundled-skills/triage/AGENT-BRIEF.md +207 -0
  110. package/bundled-skills/triage/OUT-OF-SCOPE.md +105 -0
  111. package/bundled-skills/triage/SKILL.md +112 -0
  112. package/bundled-skills/using-git-worktrees/SKILL.md +202 -0
  113. package/bundled-skills/using-superpowers/SKILL.md +121 -0
  114. package/bundled-skills/using-superpowers/references/antigravity-tools.md +96 -0
  115. package/bundled-skills/using-superpowers/references/claude-code-tools.md +50 -0
  116. package/bundled-skills/using-superpowers/references/codex-tools.md +72 -0
  117. package/bundled-skills/using-superpowers/references/copilot-tools.md +49 -0
  118. package/bundled-skills/using-superpowers/references/gemini-tools.md +63 -0
  119. package/bundled-skills/using-superpowers/references/pi-tools.md +28 -0
  120. package/bundled-skills/verification-before-completion/SKILL.md +139 -0
  121. package/bundled-skills/writing-great-skills/GLOSSARY.md +195 -0
  122. package/bundled-skills/writing-great-skills/SKILL.md +82 -0
  123. package/bundled-skills/writing-plans/SKILL.md +174 -0
  124. package/bundled-skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  125. package/bundled-skills/writing-skills/SKILL.md +689 -0
  126. package/bundled-skills/writing-skills/anthropic-best-practices.md +1150 -0
  127. package/bundled-skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  128. package/bundled-skills/writing-skills/graphviz-conventions.dot +172 -0
  129. package/bundled-skills/writing-skills/persuasion-principles.md +187 -0
  130. package/bundled-skills/writing-skills/render-graphs.js +168 -0
  131. package/bundled-skills/writing-skills/testing-skills-with-subagents.md +384 -0
  132. package/commands/add.js +97 -0
  133. package/commands/check.js +54 -0
  134. package/commands/exportSkills.js +30 -0
  135. package/commands/hub.js +52 -0
  136. package/commands/importSkills.js +68 -0
  137. package/commands/list.js +37 -0
  138. package/commands/remove.js +59 -0
  139. package/commands/sync.js +66 -0
  140. package/commands/update.js +70 -0
  141. package/index.js +100 -0
  142. package/lib/banner.js +108 -0
  143. package/lib/constants.js +10 -0
  144. package/lib/deps.js +51 -0
  145. package/lib/hash.js +26 -0
  146. package/lib/install.js +31 -0
  147. package/lib/lockfile.js +37 -0
  148. package/lib/prompts.js +50 -0
  149. package/lib/scope.js +19 -0
  150. package/lib/summary.js +108 -0
  151. package/lib/theme.js +11 -0
  152. package/package.json +43 -0
  153. package/skills.json +164 -0
@@ -0,0 +1,213 @@
1
+ #!/usr/bin/env python3
2
+ import re
3
+ from collections import Counter
4
+ from pathlib import Path
5
+
6
+ URL_REGEX = re.compile(r"https?://[^\s)]+")
7
+ FENCE_OPEN_REGEX = re.compile(r"^(\s{0,3})(`{3,}|~{3,})(.*)$")
8
+ HEADING_REGEX = re.compile(r"^(#{1,6})\s+(.*)", re.MULTILINE)
9
+ BULLET_REGEX = re.compile(r"^\s*[-*+]\s+", re.MULTILINE)
10
+
11
+ # crude but effective path detection
12
+ # Requires either a path prefix (./ ../ / or drive letter) or a slash/backslash within the match
13
+ PATH_REGEX = re.compile(r"(?:\./|\.\./|/|[A-Za-z]:\\)[\w\-/\\\.]+|[\w\-\.]+[/\\][\w\-/\\\.]+")
14
+
15
+
16
+ class ValidationResult:
17
+ def __init__(self):
18
+ self.is_valid = True
19
+ self.errors = []
20
+ self.warnings = []
21
+
22
+ def add_error(self, msg):
23
+ self.is_valid = False
24
+ self.errors.append(msg)
25
+
26
+ def add_warning(self, msg):
27
+ self.warnings.append(msg)
28
+
29
+
30
+ def read_file(path: Path) -> str:
31
+ return path.read_text(errors="ignore")
32
+
33
+
34
+ # ---------- Extractors ----------
35
+
36
+
37
+ def extract_headings(text):
38
+ return [(level, title.strip()) for level, title in HEADING_REGEX.findall(text)]
39
+
40
+
41
+ def extract_code_blocks(text):
42
+ """Line-based fenced code block extractor.
43
+
44
+ Handles ``` and ~~~ fences with variable length (CommonMark: closing
45
+ fence must use same char and be at least as long as opening). Supports
46
+ nested fences (e.g. an outer 4-backtick block wrapping inner 3-backtick
47
+ content).
48
+ """
49
+ blocks = []
50
+ lines = text.split("\n")
51
+ i = 0
52
+ n = len(lines)
53
+ while i < n:
54
+ m = FENCE_OPEN_REGEX.match(lines[i])
55
+ if not m:
56
+ i += 1
57
+ continue
58
+ fence_char = m.group(2)[0]
59
+ fence_len = len(m.group(2))
60
+ open_line = lines[i]
61
+ block_lines = [open_line]
62
+ i += 1
63
+ closed = False
64
+ while i < n:
65
+ close_m = FENCE_OPEN_REGEX.match(lines[i])
66
+ if (
67
+ close_m
68
+ and close_m.group(2)[0] == fence_char
69
+ and len(close_m.group(2)) >= fence_len
70
+ and close_m.group(3).strip() == ""
71
+ ):
72
+ block_lines.append(lines[i])
73
+ closed = True
74
+ i += 1
75
+ break
76
+ block_lines.append(lines[i])
77
+ i += 1
78
+ if closed:
79
+ blocks.append("\n".join(block_lines))
80
+ # Unclosed fences are silently skipped — they indicate malformed markdown
81
+ # and including them would cause false-positive validation failures.
82
+ return blocks
83
+
84
+
85
+ def extract_urls(text):
86
+ return set(URL_REGEX.findall(text))
87
+
88
+
89
+ def extract_paths(text):
90
+ return set(PATH_REGEX.findall(text))
91
+
92
+
93
+ def count_bullets(text):
94
+ return len(BULLET_REGEX.findall(text))
95
+
96
+
97
+ def extract_inline_codes(text):
98
+ text_without_fences = re.sub(r"^```[\s\S]*?^```", "", text, flags=re.MULTILINE)
99
+ text_without_fences = re.sub(r"^~~~[\s\S]*?^~~~", "", text_without_fences, flags=re.MULTILINE)
100
+ return re.findall(r"`([^`]+)`", text_without_fences)
101
+
102
+
103
+ # ---------- Validators ----------
104
+
105
+
106
+ def validate_headings(orig, comp, result):
107
+ h1 = extract_headings(orig)
108
+ h2 = extract_headings(comp)
109
+
110
+ if len(h1) != len(h2):
111
+ result.add_error(f"Heading count mismatch: {len(h1)} vs {len(h2)}")
112
+
113
+ if h1 != h2:
114
+ result.add_warning("Heading text/order changed")
115
+
116
+
117
+ def validate_code_blocks(orig, comp, result):
118
+ c1 = extract_code_blocks(orig)
119
+ c2 = extract_code_blocks(comp)
120
+
121
+ if c1 != c2:
122
+ result.add_error("Code blocks not preserved exactly")
123
+
124
+
125
+ def validate_urls(orig, comp, result):
126
+ u1 = extract_urls(orig)
127
+ u2 = extract_urls(comp)
128
+
129
+ if u1 != u2:
130
+ result.add_error(f"URL mismatch: lost={u1 - u2}, added={u2 - u1}")
131
+
132
+
133
+ def validate_paths(orig, comp, result):
134
+ p1 = extract_paths(orig)
135
+ p2 = extract_paths(comp)
136
+
137
+ if p1 != p2:
138
+ result.add_warning(f"Path mismatch: lost={p1 - p2}, added={p2 - p1}")
139
+
140
+
141
+ def validate_bullets(orig, comp, result):
142
+ b1 = count_bullets(orig)
143
+ b2 = count_bullets(comp)
144
+
145
+ if b1 == 0:
146
+ return
147
+
148
+ diff = abs(b1 - b2) / b1
149
+
150
+ if diff > 0.15:
151
+ result.add_warning(f"Bullet count changed too much: {b1} -> {b2}")
152
+
153
+
154
+ def validate_inline_codes(orig, comp, result):
155
+ c1 = Counter(extract_inline_codes(orig))
156
+ c2 = Counter(extract_inline_codes(comp))
157
+
158
+ if c1 != c2:
159
+ lost = set(c1.keys()) - set(c2.keys())
160
+ added = set(c2.keys()) - set(c1.keys())
161
+ for code, count in c1.items():
162
+ if code in c2 and c2[code] < count:
163
+ lost.add(f"{code} (lost {count - c2[code]} of {count} occurrences)")
164
+ if lost:
165
+ result.add_error(f"Inline code lost: {lost}")
166
+ if added:
167
+ result.add_warning(f"Inline code added: {added}")
168
+
169
+
170
+ # ---------- Main ----------
171
+
172
+
173
+ def validate(original_path: Path, compressed_path: Path) -> ValidationResult:
174
+ result = ValidationResult()
175
+
176
+ orig = read_file(original_path)
177
+ comp = read_file(compressed_path)
178
+
179
+ validate_headings(orig, comp, result)
180
+ validate_code_blocks(orig, comp, result)
181
+ validate_urls(orig, comp, result)
182
+ validate_paths(orig, comp, result)
183
+ validate_bullets(orig, comp, result)
184
+ validate_inline_codes(orig, comp, result)
185
+
186
+ return result
187
+
188
+
189
+ # ---------- CLI ----------
190
+
191
+ if __name__ == "__main__":
192
+ import sys
193
+
194
+ if len(sys.argv) != 3:
195
+ print("Usage: python validate.py <original> <compressed>")
196
+ sys.exit(1)
197
+
198
+ orig = Path(sys.argv[1]).resolve()
199
+ comp = Path(sys.argv[2]).resolve()
200
+
201
+ res = validate(orig, comp)
202
+
203
+ print(f"\nValid: {res.is_valid}")
204
+
205
+ if res.errors:
206
+ print("\nErrors:")
207
+ for e in res.errors:
208
+ print(f" - {e}")
209
+
210
+ if res.warnings:
211
+ print("\nWarnings:")
212
+ for w in res.warnings:
213
+ print(f" - {w}")
@@ -0,0 +1,38 @@
1
+ # caveman-help
2
+
3
+ Quick-reference card. One shot, no mode change.
4
+
5
+ ## What it does
6
+
7
+ Prints a cheat sheet of all caveman modes, sibling skills, deactivation triggers, and how to set the default mode via env var or config file. One-shot display — does not flip the active mode, write flag files, or persist anything. Use when you forget the slash commands.
8
+
9
+ ## How to invoke
10
+
11
+ ```
12
+ /caveman-help
13
+ ```
14
+
15
+ Also triggers on "caveman help", "what caveman commands", "how do I use caveman".
16
+
17
+ ## Example output
18
+
19
+ ```
20
+ Modes:
21
+ /caveman full (default)
22
+ /caveman lite lighter
23
+ /caveman ultra extreme
24
+ /caveman wenyan classical Chinese
25
+
26
+ Skills:
27
+ /caveman-commit terse Conventional Commits
28
+ /caveman-review one-line PR comments
29
+ /caveman-stats session token savings
30
+
31
+ Deactivate:
32
+ "stop caveman" or "normal mode"
33
+ ```
34
+
35
+ ## See also
36
+
37
+ - [`SKILL.md`](./SKILL.md) — full reference card
38
+ - [Caveman README](../../README.md) — repo overview
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: caveman-help
3
+ description: >
4
+ Quick-reference card for all caveman modes, skills, and commands.
5
+ One-shot display, not a persistent mode. Trigger: /caveman-help,
6
+ "caveman help", "what caveman commands", "how do I use caveman".
7
+ ---
8
+
9
+ # Caveman Help
10
+
11
+ Display this reference card when invoked. One-shot — do NOT change mode, write flag files, or persist anything. Output in caveman style.
12
+
13
+ ## Modes
14
+
15
+ | Mode | Trigger | What change |
16
+ |------|---------|-------------|
17
+ | **Lite** | `/caveman lite` | Drop filler. Keep sentence structure. |
18
+ | **Full** | `/caveman` | Drop articles, filler, pleasantries, hedging. Fragments OK. Default. |
19
+ | **Ultra** | `/caveman ultra` | Extreme compression. Bare fragments. Tables over prose. |
20
+ | **Wenyan-Lite** | `/caveman wenyan-lite` | Classical Chinese style, light compression. |
21
+ | **Wenyan-Full** | `/caveman wenyan` | Full 文言文. Maximum classical terseness. |
22
+ | **Wenyan-Ultra** | `/caveman wenyan-ultra` | Extreme. Ancient scholar on a budget. |
23
+
24
+ Mode stick until changed or session end.
25
+
26
+ ## Skills
27
+
28
+ | Skill | Trigger | What it do |
29
+ |-------|---------|-----------|
30
+ | **caveman-commit** | `/caveman-commit` | Terse commit messages. Conventional Commits. ≤50 char subject. |
31
+ | **caveman-review** | `/caveman-review` | One-line PR comments: `L42: bug: user null. Add guard.` |
32
+ | **caveman-compress** | `/caveman-compress <file>` | Compress .md files to caveman prose. Saves ~46% input tokens. |
33
+ | **caveman-help** | `/caveman-help` | This card. |
34
+
35
+ ## Deactivate
36
+
37
+ Say "stop caveman" or "normal mode". Resume anytime with `/caveman`.
38
+
39
+ ## Language
40
+
41
+ Keep user's language by default. User write Portuguese → reply Portuguese caveman. Compress the style, not the language. Technical terms, code, commands, commit types, and exact error strings stay verbatim unless user ask for translation.
42
+
43
+ ## Configure Default Mode
44
+
45
+ Default mode = `full`. Change it:
46
+
47
+ **Environment variable** (highest priority):
48
+ ```bash
49
+ export CAVEMAN_DEFAULT_MODE=ultra
50
+ ```
51
+
52
+ **Config file** (`~/.config/caveman/config.json`):
53
+ ```json
54
+ { "defaultMode": "lite" }
55
+ ```
56
+
57
+ Set `"off"` to disable auto-activation on session start. User can still activate manually with `/caveman`.
58
+
59
+ Resolution: env var > config file > `full`.
60
+
61
+ ## More
62
+
63
+ Full docs: https://github.com/JuliusBrussee/caveman
@@ -0,0 +1,33 @@
1
+ # caveman-review
2
+
3
+ One-line PR comments. Location, problem, fix. No throat-clearing.
4
+
5
+ ## What it does
6
+
7
+ Generates code review comments in `L<line>: <severity> <problem>. <fix>.` format. One line per finding. Severity emoji: 🔴 bug, 🟡 risk, 🔵 nit, ❓ question. Drops "I noticed that...", hedging, and restating what the diff already shows. Keeps exact line numbers, backticked symbols, and concrete fixes.
8
+
9
+ Auto-clarity: drops terse mode for CVE-class security findings, architectural disagreements, and onboarding contexts where the author needs the *why*. Resumes terse for the rest.
10
+
11
+ Output only — does not approve, request changes, or run linters.
12
+
13
+ ## How to invoke
14
+
15
+ ```
16
+ /caveman-review
17
+ ```
18
+
19
+ Also triggers on "review this PR", "code review", "review the diff".
20
+
21
+ ## Example output
22
+
23
+ ```
24
+ L42: 🔴 bug: user can be null after .find(). Add guard before .email.
25
+ L88-140: 🔵 nit: 50-line fn does 4 things. Extract validate/normalize/persist.
26
+ L23: 🟡 risk: no retry on 429. Wrap in withBackoff(3).
27
+ L107: ❓ q: why drop the cache here? Reads on next request will miss.
28
+ ```
29
+
30
+ ## See also
31
+
32
+ - [`SKILL.md`](./SKILL.md) — full LLM-facing instructions
33
+ - [Caveman README](../../README.md) — repo overview
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: caveman-review
3
+ description: >
4
+ Ultra-compressed code review comments. Cuts noise from PR feedback while preserving
5
+ the actionable signal. Each comment is one line: location, problem, fix. Use when user
6
+ says "review this PR", "code review", "review the diff", "/review", or invokes
7
+ /caveman-review. Auto-triggers when reviewing pull requests.
8
+ ---
9
+
10
+ Write code review comments terse and actionable. One line per finding. Location, problem, fix. No throat-clearing.
11
+
12
+ ## Rules
13
+
14
+ **Format:** `L<line>: <problem>. <fix>.` — or `<file>:L<line>: ...` when reviewing multi-file diffs.
15
+
16
+ **Severity prefix (optional, when mixed):**
17
+ - `🔴 bug:` — broken behavior, will cause incident
18
+ - `🟡 risk:` — works but fragile (race, missing null check, swallowed error)
19
+ - `🔵 nit:` — style, naming, micro-optim. Author can ignore
20
+ - `❓ q:` — genuine question, not a suggestion
21
+
22
+ **Drop:**
23
+ - "I noticed that...", "It seems like...", "You might want to consider..."
24
+ - "This is just a suggestion but..." — use `nit:` instead
25
+ - "Great work!", "Looks good overall but..." — say it once at the top, not per comment
26
+ - Restating what the line does — the reviewer can read the diff
27
+ - Hedging ("perhaps", "maybe", "I think") — if unsure use `q:`
28
+
29
+ **Keep:**
30
+ - Exact line numbers
31
+ - Exact symbol/function/variable names in backticks
32
+ - Concrete fix, not "consider refactoring this"
33
+ - The *why* if the fix isn't obvious from the problem statement
34
+
35
+ ## Examples
36
+
37
+ ❌ "I noticed that on line 42 you're not checking if the user object is null before accessing the email property. This could potentially cause a crash if the user is not found in the database. You might want to add a null check here."
38
+
39
+ ✅ `L42: 🔴 bug: user can be null after .find(). Add guard before .email.`
40
+
41
+ ❌ "It looks like this function is doing a lot of things and might benefit from being broken up into smaller functions for readability."
42
+
43
+ ✅ `L88-140: 🔵 nit: 50-line fn does 4 things. Extract validate/normalize/persist.`
44
+
45
+ ❌ "Have you considered what happens if the API returns a 429? I think we should probably handle that case."
46
+
47
+ ✅ `L23: 🟡 risk: no retry on 429. Wrap in withBackoff(3).`
48
+
49
+ ## Auto-Clarity
50
+
51
+ Drop terse mode for: security findings (CVE-class bugs need full explanation + reference), architectural disagreements (need rationale, not just a one-liner), and onboarding contexts where the author is new and needs the "why". In those cases write a normal paragraph, then resume terse for the rest.
52
+
53
+ ## Boundaries
54
+
55
+ Reviews only — does not write the code fix, does not approve/request-changes, does not run linters. Output the comment(s) ready to paste into the PR. "stop caveman-review" or "normal mode": revert to verbose review style.
@@ -0,0 +1,30 @@
1
+ # caveman-stats
2
+
3
+ Real session token receipts. No AI estimation.
4
+
5
+ ## What it does
6
+
7
+ Reads the current Claude Code session log directly and reports actual input/output token usage plus estimated savings versus a non-caveman baseline. Numbers come from the JSONL session log on disk — the model itself does not compute or estimate them. Output is injected by the `caveman-mode-tracker` hook, which intercepts `/caveman-stats` and returns the formatted stats as a blocked-decision reason.
8
+
9
+ Each run also writes a lifetime-savings suffix file used by the statusline badge (`⛏ 12.4k`).
10
+
11
+ ## How to invoke
12
+
13
+ ```
14
+ /caveman-stats
15
+ ```
16
+
17
+ ## Example output
18
+
19
+ ```
20
+ Session: 47 turns
21
+ Input: 12,304 tokens
22
+ Output: 3,891 tokens (caveman)
23
+ Baseline: 11,247 tokens (estimated without caveman)
24
+ Saved: 7,356 tokens (~65%)
25
+ ```
26
+
27
+ ## See also
28
+
29
+ - [`SKILL.md`](./SKILL.md) — hook contract and mechanics
30
+ - [Caveman README](../../README.md) — repo overview
@@ -0,0 +1,10 @@
1
+ ---
2
+ name: caveman-stats
3
+ description: >
4
+ Show real token usage and estimated savings for the current session.
5
+ Reads directly from the Claude Code session log — no AI estimation.
6
+ Triggers on /caveman-stats. Output is injected by the mode-tracker hook;
7
+ the model itself does not compute the numbers.
8
+ ---
9
+
10
+ This skill is delivered by `hooks/caveman-stats.js` (read by `hooks/caveman-mode-tracker.js` on `/caveman-stats`). The model does not need to do anything when this skill fires — the hook returns `decision: "block"` with the formatted stats as the reason. The user sees the numbers immediately.
@@ -0,0 +1,37 @@
1
+ # Deepening
2
+
3
+ How to deepen a cluster of shallow modules safely, given its dependencies. Assumes the vocabulary in [SKILL.md](SKILL.md) — **module**, **interface**, **seam**, **adapter**.
4
+
5
+ ## Dependency categories
6
+
7
+ When assessing a candidate for deepening, classify its dependencies. The category determines how the deepened module is tested across its seam.
8
+
9
+ ### 1. In-process
10
+
11
+ Pure computation, in-memory state, no I/O. Always deepenable — merge the modules and test through the new interface directly. No adapter needed.
12
+
13
+ ### 2. Local-substitutable
14
+
15
+ Dependencies that have local test stand-ins (PGLite for Postgres, in-memory filesystem). Deepenable if the stand-in exists. The deepened module is tested with the stand-in running in the test suite. The seam is internal; no port at the module's external interface.
16
+
17
+ ### 3. Remote but owned (Ports & Adapters)
18
+
19
+ Your own services across a network boundary (microservices, internal APIs). Define a **port** (interface) at the seam. The deep module owns the logic; the transport is injected as an **adapter**. Tests use an in-memory adapter. Production uses an HTTP/gRPC/queue adapter.
20
+
21
+ Recommendation shape: *"Define a port at the seam, implement an HTTP adapter for production and an in-memory adapter for testing, so the logic sits in one deep module even though it's deployed across a network."*
22
+
23
+ ### 4. True external (Mock)
24
+
25
+ Third-party services (Stripe, Twilio, etc.) you don't control. The deepened module takes the external dependency as an injected port; tests provide a mock adapter.
26
+
27
+ ## Seam discipline
28
+
29
+ - **One adapter means a hypothetical seam. Two adapters means a real one.** Don't introduce a port unless at least two adapters are justified (typically production + test). A single-adapter seam is just indirection.
30
+ - **Internal seams vs external seams.** A deep module can have internal seams (private to its implementation, used by its own tests) as well as the external seam at its interface. Don't expose internal seams through the interface just because tests use them.
31
+
32
+ ## Testing strategy: replace, don't layer
33
+
34
+ - Old unit tests on shallow modules become waste once tests at the deepened module's interface exist — delete them.
35
+ - Write new tests at the deepened module's interface. The **interface is the test surface**.
36
+ - Tests assert on observable outcomes through the interface, not internal state.
37
+ - Tests should survive internal refactors — they describe behaviour, not implementation. If a test has to change when the implementation changes, it's testing past the interface.
@@ -0,0 +1,44 @@
1
+ # Design It Twice
2
+
3
+ When the user wants to explore alternative interfaces for a chosen deepening candidate, use this parallel sub-agent pattern. Based on "Design It Twice" (Ousterhout) — your first idea is unlikely to be the best.
4
+
5
+ Uses the vocabulary in [SKILL.md](SKILL.md) — **module**, **interface**, **seam**, **adapter**, **leverage**.
6
+
7
+ ## Process
8
+
9
+ ### 1. Frame the problem space
10
+
11
+ Before spawning sub-agents, write a user-facing explanation of the problem space for the chosen candidate:
12
+
13
+ - The constraints any new interface would need to satisfy
14
+ - The dependencies it would rely on, and which category they fall into (see [DEEPENING.md](DEEPENING.md))
15
+ - A rough illustrative code sketch to ground the constraints — not a proposal, just a way to make the constraints concrete
16
+
17
+ Show this to the user, then immediately proceed to Step 2. The user reads and thinks while the sub-agents work in parallel.
18
+
19
+ ### 2. Spawn sub-agents
20
+
21
+ Spawn 3+ sub-agents in parallel using the Agent tool. Each must produce a **radically different** interface for the deepened module.
22
+
23
+ Prompt each sub-agent with a separate technical brief (file paths, coupling details, dependency category from [DEEPENING.md](DEEPENING.md), what sits behind the seam). The brief is independent of the user-facing problem-space explanation in Step 1. Give each agent a different design constraint:
24
+
25
+ - Agent 1: "Minimize the interface — aim for 1–3 entry points max. Maximise leverage per entry point."
26
+ - Agent 2: "Maximise flexibility — support many use cases and extension."
27
+ - Agent 3: "Optimise for the most common caller — make the default case trivial."
28
+ - Agent 4 (if applicable): "Design around ports & adapters for cross-seam dependencies."
29
+
30
+ Include both [SKILL.md](SKILL.md) vocabulary and CONTEXT.md vocabulary in the brief so each sub-agent names things consistently with the architecture language and the project's domain language.
31
+
32
+ Each sub-agent outputs:
33
+
34
+ 1. Interface (types, methods, params — plus invariants, ordering, error modes)
35
+ 2. Usage example showing how callers use it
36
+ 3. What the implementation hides behind the seam
37
+ 4. Dependency strategy and adapters (see [DEEPENING.md](DEEPENING.md))
38
+ 5. Trade-offs — where leverage is high, where it's thin
39
+
40
+ ### 3. Present and compare
41
+
42
+ Present designs sequentially so the user can absorb each one, then compare them in prose. Contrast by **depth** (leverage at the interface), **locality** (where change concentrates), and **seam placement**.
43
+
44
+ After comparing, give your own recommendation: which design you think is strongest and why. If elements from different designs would combine well, propose a hybrid. Be opinionated — the user wants a strong read, not a menu.
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: codebase-design
3
+ description: Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
4
+ ---
5
+
6
+ # Codebase Design
7
+
8
+ Design **deep modules**: a lot of behaviour behind a small interface, placed at a clean seam, testable through that interface. Use this language and these principles wherever code is being designed or restructured. The aim is leverage for callers, locality for maintainers, and testability for everyone.
9
+
10
+ ## Glossary
11
+
12
+ Use these terms exactly — don't substitute "component," "service," "API," or "boundary." Consistent language is the whole point.
13
+
14
+ **Module** — anything with an interface and an implementation. Deliberately scale-agnostic: a function, class, package, or tier-spanning slice. _Avoid_: unit, component, service.
15
+
16
+ **Interface** — everything a caller must know to use the module correctly: the type signature, but also invariants, ordering constraints, error modes, required configuration, and performance characteristics. _Avoid_: API, signature (too narrow — they refer only to the type-level surface).
17
+
18
+ **Implementation** — what's inside a module, its body of code. Distinct from **Adapter**: a thing can be a small adapter with a large implementation (a Postgres repo) or a large adapter with a small implementation (an in-memory fake). Reach for "adapter" when the seam is the topic; "implementation" otherwise.
19
+
20
+ **Depth** — leverage at the interface: the amount of behaviour a caller (or test) can exercise per unit of interface they have to learn. A module is **deep** when a large amount of behaviour sits behind a small interface, **shallow** when the interface is nearly as complex as the implementation.
21
+
22
+ **Seam** _(Michael Feathers)_ — a place where you can alter behaviour without editing in that place; the *location* at which a module's interface lives. Where to put the seam is its own design decision, distinct from what goes behind it. _Avoid_: boundary (overloaded with DDD's bounded context).
23
+
24
+ **Adapter** — a concrete thing that satisfies an interface at a seam. Describes *role* (what slot it fills), not substance (what's inside).
25
+
26
+ **Leverage** — what callers get from depth: more capability per unit of interface they learn. One implementation pays back across N call sites and M tests.
27
+
28
+ **Locality** — what maintainers get from depth: change, bugs, knowledge, and verification concentrate in one place rather than spreading across callers. Fix once, fixed everywhere.
29
+
30
+ ## Deep vs shallow
31
+
32
+ **Deep module** = small interface + lots of implementation:
33
+
34
+ ```
35
+ ┌─────────────────────┐
36
+ │ Small Interface │ ← Few methods, simple params
37
+ ├─────────────────────┤
38
+ │ │
39
+ │ Deep Implementation│ ← Complex logic hidden
40
+ │ │
41
+ └─────────────────────┘
42
+ ```
43
+
44
+ **Shallow module** = large interface + little implementation (avoid):
45
+
46
+ ```
47
+ ┌─────────────────────────────────┐
48
+ │ Large Interface │ ← Many methods, complex params
49
+ ├─────────────────────────────────┤
50
+ │ Thin Implementation │ ← Just passes through
51
+ └─────────────────────────────────┘
52
+ ```
53
+
54
+ When designing an interface, ask:
55
+
56
+ - Can I reduce the number of methods?
57
+ - Can I simplify the parameters?
58
+ - Can I hide more complexity inside?
59
+
60
+ ## Principles
61
+
62
+ - **Depth is a property of the interface, not the implementation.** A deep module can be internally composed of small, mockable, swappable parts — they just aren't part of the interface. A module can have **internal seams** (private to its implementation, used by its own tests) as well as the **external seam** at its interface.
63
+ - **The deletion test.** Imagine deleting the module. If complexity vanishes, it was a pass-through. If complexity reappears across N callers, it was earning its keep.
64
+ - **The interface is the test surface.** Callers and tests cross the same seam. If you want to test *past* the interface, the module is probably the wrong shape.
65
+ - **One adapter means a hypothetical seam. Two adapters means a real one.** Don't introduce a seam unless something actually varies across it.
66
+
67
+ ## Designing for testability
68
+
69
+ Good interfaces make testing natural:
70
+
71
+ 1. **Accept dependencies, don't create them.**
72
+
73
+ ```typescript
74
+ // Testable
75
+ function processOrder(order, paymentGateway) {}
76
+
77
+ // Hard to test
78
+ function processOrder(order) {
79
+ const gateway = new StripeGateway();
80
+ }
81
+ ```
82
+
83
+ 2. **Return results, don't produce side effects.**
84
+
85
+ ```typescript
86
+ // Testable
87
+ function calculateDiscount(cart): Discount {}
88
+
89
+ // Hard to test
90
+ function applyDiscount(cart): void {
91
+ cart.total -= discount;
92
+ }
93
+ ```
94
+
95
+ 3. **Small surface area.** Fewer methods = fewer tests needed. Fewer params = simpler test setup.
96
+
97
+ ## Relationships
98
+
99
+ - A **Module** has exactly one **Interface** (the surface it presents to callers and tests).
100
+ - **Depth** is a property of a **Module**, measured against its **Interface**.
101
+ - A **Seam** is where a **Module**'s **Interface** lives.
102
+ - An **Adapter** sits at a **Seam** and satisfies the **Interface**.
103
+ - **Depth** produces **Leverage** for callers and **Locality** for maintainers.
104
+
105
+ ## Rejected framings
106
+
107
+ - **Depth as ratio of implementation-lines to interface-lines** (Ousterhout): rewards padding the implementation. We use depth-as-leverage instead.
108
+ - **"Interface" as the TypeScript `interface` keyword or a class's public methods**: too narrow — interface here includes every fact a caller must know.
109
+ - **"Boundary"**: overloaded with DDD's bounded context. Say **seam** or **interface**.
110
+
111
+ ## Going deeper
112
+
113
+ - **Deepening a cluster given its dependencies** — see [DEEPENING.md](DEEPENING.md): dependency categories, seam discipline, and replace-don't-layer testing.
114
+ - **Exploring alternative interfaces** — see [DESIGN-IT-TWICE.md](DESIGN-IT-TWICE.md): spin up parallel sub-agents to design the interface several radically different ways, then compare on depth, locality, and seam placement.