specweave 1.0.253 → 1.0.255

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 (138) hide show
  1. package/CLAUDE.md +24 -24
  2. package/README.md +163 -1
  3. package/dist/src/adapters/agents-md-generator.d.ts.map +1 -1
  4. package/dist/src/adapters/agents-md-generator.js +0 -1
  5. package/dist/src/adapters/agents-md-generator.js.map +1 -1
  6. package/dist/src/adapters/claude/README.md +0 -1
  7. package/dist/src/adapters/claude-md-generator.d.ts.map +1 -1
  8. package/dist/src/adapters/claude-md-generator.js +0 -1
  9. package/dist/src/adapters/claude-md-generator.js.map +1 -1
  10. package/dist/src/cli/commands/docs.d.ts.map +1 -1
  11. package/dist/src/cli/commands/docs.js +59 -55
  12. package/dist/src/cli/commands/docs.js.map +1 -1
  13. package/dist/src/cli/helpers/init/smart-defaults.d.ts.map +1 -1
  14. package/dist/src/cli/helpers/init/smart-defaults.js +7 -1
  15. package/dist/src/cli/helpers/init/smart-defaults.js.map +1 -1
  16. package/dist/src/core/config/types.d.ts +2 -0
  17. package/dist/src/core/config/types.d.ts.map +1 -1
  18. package/dist/src/core/config/types.js.map +1 -1
  19. package/dist/src/core/discrepancy/analyzers/api-route-analyzer.d.ts.map +1 -1
  20. package/dist/src/core/discrepancy/analyzers/api-route-analyzer.js +5 -0
  21. package/dist/src/core/discrepancy/analyzers/api-route-analyzer.js.map +1 -1
  22. package/dist/src/core/lazy-loading/llm-plugin-detector.d.ts +21 -0
  23. package/dist/src/core/lazy-loading/llm-plugin-detector.d.ts.map +1 -1
  24. package/dist/src/core/lazy-loading/llm-plugin-detector.js +61 -107
  25. package/dist/src/core/lazy-loading/llm-plugin-detector.js.map +1 -1
  26. package/dist/src/core/living-docs/enterprise/history-analyzer.d.ts.map +1 -1
  27. package/dist/src/core/living-docs/enterprise/history-analyzer.js +1 -3
  28. package/dist/src/core/living-docs/enterprise/history-analyzer.js.map +1 -1
  29. package/dist/src/core/living-docs/governance/java-standards-parser.d.ts.map +1 -1
  30. package/dist/src/core/living-docs/governance/java-standards-parser.js +37 -18
  31. package/dist/src/core/living-docs/governance/java-standards-parser.js.map +1 -1
  32. package/dist/src/core/living-docs/operations/ops-generator.js +2 -2
  33. package/dist/src/core/living-docs/operations/ops-generator.js.map +1 -1
  34. package/dist/src/core/reflection/index.d.ts +1 -1
  35. package/dist/src/core/reflection/index.d.ts.map +1 -1
  36. package/dist/src/core/reflection/index.js +1 -1
  37. package/dist/src/core/reflection/index.js.map +1 -1
  38. package/dist/src/core/reflection/reflect-handler.d.ts.map +1 -1
  39. package/dist/src/core/reflection/reflect-handler.js +1 -2
  40. package/dist/src/core/reflection/reflect-handler.js.map +1 -1
  41. package/dist/src/core/reflection/skill-memories.d.ts +13 -1
  42. package/dist/src/core/reflection/skill-memories.d.ts.map +1 -1
  43. package/dist/src/core/reflection/skill-memories.js +55 -10
  44. package/dist/src/core/reflection/skill-memories.js.map +1 -1
  45. package/dist/src/core/repo-structure/prefix-validator.d.ts +25 -0
  46. package/dist/src/core/repo-structure/prefix-validator.d.ts.map +1 -0
  47. package/dist/src/core/repo-structure/prefix-validator.js +47 -0
  48. package/dist/src/core/repo-structure/prefix-validator.js.map +1 -0
  49. package/dist/src/core/repo-structure/repo-structure-manager.d.ts +4 -0
  50. package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
  51. package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
  52. package/dist/src/core/repo-structure/role-prefix-collector.d.ts +45 -0
  53. package/dist/src/core/repo-structure/role-prefix-collector.d.ts.map +1 -0
  54. package/dist/src/core/repo-structure/role-prefix-collector.js +106 -0
  55. package/dist/src/core/repo-structure/role-prefix-collector.js.map +1 -0
  56. package/dist/src/hooks/session-start.js +7 -0
  57. package/dist/src/hooks/session-start.js.map +1 -1
  58. package/dist/src/sync/story-router.d.ts +36 -0
  59. package/dist/src/sync/story-router.d.ts.map +1 -0
  60. package/dist/src/sync/story-router.js +56 -0
  61. package/dist/src/sync/story-router.js.map +1 -0
  62. package/dist/src/utils/agents-md-compiler.d.ts.map +1 -1
  63. package/dist/src/utils/agents-md-compiler.js +0 -1
  64. package/dist/src/utils/agents-md-compiler.js.map +1 -1
  65. package/dist/src/utils/state-cleanup.d.ts +19 -0
  66. package/dist/src/utils/state-cleanup.d.ts.map +1 -0
  67. package/dist/src/utils/state-cleanup.js +61 -0
  68. package/dist/src/utils/state-cleanup.js.map +1 -0
  69. package/package.json +1 -1
  70. package/plugins/specweave/PLUGIN.md +0 -1
  71. package/plugins/specweave/commands/brownfield-analyzer.md +0 -10
  72. package/plugins/specweave/commands/brownfield-onboarder.md +0 -10
  73. package/plugins/specweave/commands/export-skills.md +0 -10
  74. package/plugins/specweave/commands/plugin-validator.md +0 -10
  75. package/plugins/specweave/hooks/stop-reflect.sh +4 -2
  76. package/plugins/specweave/hooks/user-prompt-submit.sh +29 -68
  77. package/plugins/specweave/hooks/v2/dispatchers/session-start.sh +0 -3
  78. package/plugins/specweave/skills/architect/SKILL.md +2 -6
  79. package/plugins/specweave/skills/archive-increments/SKILL.md +0 -10
  80. package/plugins/specweave/skills/auto/SKILL.md +4 -0
  81. package/plugins/specweave/skills/cancel-auto/SKILL.md +5 -1
  82. package/plugins/specweave/skills/code-review/SKILL.md +1 -11
  83. package/plugins/specweave/skills/code-simplifier/SKILL.md +3 -7
  84. package/plugins/specweave/skills/do/SKILL.md +6 -2
  85. package/plugins/specweave/skills/docs/SKILL.md +5 -8
  86. package/plugins/specweave/skills/docs-updater/SKILL.md +4 -10
  87. package/plugins/specweave/skills/done/SKILL.md +6 -3
  88. package/plugins/specweave/skills/framework/SKILL.md +4 -10
  89. package/plugins/specweave/skills/grill/SKILL.md +7 -12
  90. package/plugins/specweave/skills/increment/SKILL.md +5 -0
  91. package/plugins/specweave/skills/increment-planner/SKILL.md +4 -7
  92. package/plugins/specweave/skills/increment-work-router/SKILL.md +0 -10
  93. package/plugins/specweave/skills/judge-llm/SKILL.md +0 -11
  94. package/plugins/specweave/skills/lsp/SKILL.md +4 -10
  95. package/plugins/specweave/skills/multi-project-spec-mapper/SKILL.md +0 -10
  96. package/plugins/specweave/skills/next/SKILL.md +1 -1
  97. package/plugins/specweave/skills/plan/SKILL.md +1 -1
  98. package/plugins/specweave/skills/pm/SKILL.md +6 -11
  99. package/plugins/specweave/skills/pm-closure-validation/SKILL.md +0 -10
  100. package/plugins/specweave/skills/progress/SKILL.md +5 -1
  101. package/plugins/specweave/skills/progress-sync/SKILL.md +2 -11
  102. package/plugins/specweave/skills/save/SKILL.md +6 -1
  103. package/plugins/specweave/skills/security/SKILL.md +2 -6
  104. package/plugins/specweave/skills/security-patterns/SKILL.md +4 -10
  105. package/plugins/specweave/skills/smart-reopen-detector/SKILL.md +0 -10
  106. package/plugins/specweave/skills/spec-generator/SKILL.md +0 -10
  107. package/plugins/specweave/skills/tdd-cycle/SKILL.md +5 -1
  108. package/plugins/specweave/skills/tdd-green/SKILL.md +5 -1
  109. package/plugins/specweave/skills/tdd-orchestrator/SKILL.md +4 -10
  110. package/plugins/specweave/skills/tdd-red/SKILL.md +5 -1
  111. package/plugins/specweave/skills/tdd-refactor/SKILL.md +1 -1
  112. package/plugins/specweave/skills/team-build/SKILL.md +1 -1
  113. package/plugins/specweave/skills/team-lead/SKILL.md +3 -3
  114. package/plugins/specweave/skills/test-aware-planner/SKILL.md +0 -10
  115. package/plugins/specweave/skills/umbrella-repo-detector/SKILL.md +0 -10
  116. package/plugins/specweave/skills/update-instructions/SKILL.md +0 -10
  117. package/plugins/specweave/skills/validate/SKILL.md +6 -1
  118. package/plugins/specweave-github/commands/close.md +2 -2
  119. package/src/templates/CLAUDE.md.template +1 -1
  120. package/src/templates/docs/adr-template.md +1 -1
  121. package/src/templates/docs/hld-template.md +1 -1
  122. package/src/templates/docs/lld-template.md +2 -2
  123. package/src/templates/docs/rfc-template.md +1 -1
  124. package/src/templates/docs/spec-template.md +1 -1
  125. package/dist/src/core/reflection/skill-memory-injector.d.ts +0 -42
  126. package/dist/src/core/reflection/skill-memory-injector.d.ts.map +0 -1
  127. package/dist/src/core/reflection/skill-memory-injector.js +0 -67
  128. package/dist/src/core/reflection/skill-memory-injector.js.map +0 -1
  129. package/plugins/specweave/commands/skill.md +0 -620
  130. package/plugins/specweave/skills/tech-lead/SKILL.md +0 -25
  131. package/plugins/specweave/templates/coding-standards.md.template +0 -535
  132. package/plugins/specweave/templates/hookify/README.md +0 -47
  133. package/plugins/specweave/templates/hookify/hookify.block-force-push.local.md +0 -19
  134. package/plugins/specweave/templates/hookify/hookify.block-metadata-status.local.md +0 -18
  135. package/plugins/specweave/templates/hookify/hookify.block-secrets.local.md +0 -26
  136. package/plugins/specweave/templates/hookify/hookify.require-tests.local.md +0 -22
  137. package/plugins/specweave/templates/hookify/hookify.warn-dangerous-rm.local.md +0 -23
  138. package/plugins/specweave/templates/hookify/hookify.warn-root-files.local.md +0 -21
@@ -1,620 +0,0 @@
1
- ---
2
- description: Create and validate Claude Code skills with proper YAML frontmatter. Use for skill creation, validation, and auditing. Activates for: create skill, validate skill, audit skills, check skills, skill format, SKILL.md.
3
- argument-hint: [--validate [path]] [--audit] [--name skill-name] [--type auto|command|knowledge]
4
- disable-model-invocation: true
5
- ---
6
-
7
- # Skill Creator & Validator
8
-
9
- Create and validate Claude Code skills with proper YAML frontmatter, validation, and best practices.
10
-
11
- ## Modes
12
-
13
- | Mode | Command | Description |
14
- |------|---------|-------------|
15
- | **Create** | `/sw:skill` | Interactive skill creation |
16
- | **Validate** | `/sw:skill --validate [path]` | Validate single skill |
17
- | **Audit** | `/sw:skill --audit` | Audit ALL skills in project |
18
-
19
- ---
20
-
21
- ## Validation Mode (`--validate`)
22
-
23
- Validate a single skill file against official Anthropic format.
24
-
25
- ### Usage
26
-
27
- ```bash
28
- /sw:skill --validate # Validate current skill (if in skill dir)
29
- /sw:skill --validate plugins/specweave/skills/pm/SKILL.md
30
- /sw:skill --validate .claude/skills/my-skill/SKILL.md
31
- ```
32
-
33
- ### Validation Checks (Official Anthropic Format)
34
-
35
- Run these checks on every SKILL.md:
36
-
37
- #### 1. Frontmatter Structure
38
- ```
39
- [ ] File starts with `---` on line 1
40
- [ ] Closing `---` present before markdown content
41
- [ ] Valid YAML syntax between delimiters
42
- [ ] No tabs in YAML (spaces only)
43
- ```
44
-
45
- #### 2. Required Fields
46
- ```
47
- [ ] `description:` present (CRITICAL for activation)
48
- ```
49
-
50
- > **WARNING**: Do NOT use `name:` in SKILL.md frontmatter for plugin-based skills.
51
- > It causes Claude Code to strip the plugin namespace prefix (e.g., `/sw:grill` becomes `/grill`).
52
- > The skill name is derived from the directory name automatically.
53
-
54
- #### 3. Description Quality (moved up - name validation removed)
55
-
56
- #### 4. Description Quality
57
- ```
58
- [ ] Under 1024 characters
59
- [ ] Contains activation keywords (e.g., "Use when...", "Activates for...")
60
- [ ] Front-loads the purpose (first sentence explains what it does)
61
- [ ] Not too generic (specific enough for auto-activation)
62
- ```
63
-
64
- #### 5. Optional Fields (Valid Values)
65
- ```
66
- [ ] `allowed-tools:` - valid tool names only (Read, Write, Edit, Grep, Glob, Bash, WebSearch, WebFetch, Task, etc.)
67
- [ ] `disable-model-invocation:` - boolean (true/false)
68
- [ ] `user-invocable:` - boolean (true/false)
69
- [ ] `model:` - valid model (sonnet, opus, haiku)
70
- [ ] `context:` - valid value (fork)
71
- [ ] `agent:` - valid subagent type if context:fork
72
- ```
73
-
74
- #### 6. Content Quality
75
- ```
76
- [ ] Has meaningful content after frontmatter
77
- [ ] Reasonable length (50-2000 lines recommended)
78
- [ ] No orphaned template placeholders ({placeholder})
79
- ```
80
-
81
- ### Output Format
82
-
83
- ```
84
- ## Skill Validation Report
85
-
86
- **File**: plugins/specweave/skills/pm/SKILL.md
87
- **Status**: PASS | WARN | FAIL
88
-
89
- ### Checks
90
- | Check | Status | Details |
91
- |-------|--------|---------|
92
- | Frontmatter | PASS | Valid YAML |
93
- | Name | PASS | "pm" matches pattern |
94
- | Description | WARN | Missing activation keywords |
95
- | Tools | PASS | Valid tool list |
96
- | Content | PASS | 245 lines |
97
-
98
- ### Issues Found
99
- - WARN: Description lacks "Activates for:" or "Use when" keywords
100
- - INFO: Consider adding trigger phrases for better auto-activation
101
-
102
- ### Suggested Fix
103
- Add to description: "Activates for: product management, user stories, requirements"
104
- ```
105
-
106
- ---
107
-
108
- ## Audit Mode (`--audit`)
109
-
110
- Comprehensive audit of ALL skills across project.
111
-
112
- ### Usage
113
-
114
- ```bash
115
- /sw:skill --audit # Audit all skills
116
- /sw:skill --audit --fix # Audit and offer auto-fixes
117
- /sw:skill --audit --json # Output as JSON
118
- ```
119
-
120
- ### Scan Locations
121
-
122
- 1. **Project skills**: `.claude/skills/*/SKILL.md`
123
- 2. **Plugin skills**: `plugins/*/skills/*/SKILL.md`
124
- 3. **Legacy commands**: `plugins/*/commands/*.md` (check frontmatter)
125
-
126
- ### Audit Report (Leaderboard Style)
127
-
128
- ```
129
- ## Skills Audit Report
130
-
131
- **Scanned**: 127 skills, 45 commands
132
- **Date**: 2026-02-03
133
-
134
- ### Summary
135
- | Status | Count | Percentage |
136
- |--------|-------|------------|
137
- | PASS | 98 | 77% |
138
- | WARN | 21 | 17% |
139
- | FAIL | 8 | 6% |
140
-
141
- ### Critical Issues (FAIL)
142
- | Location | Issue | Severity |
143
- |----------|-------|----------|
144
- | plugins/specweave-mobile/commands/build-config.md | Missing frontmatter | CRITICAL |
145
- | plugins/specweave-n8n/skills/n8n-workflow/SKILL.md | Invalid YAML | CRITICAL |
146
- | ... | ... | ... |
147
-
148
- ### Warnings
149
- | Location | Issue |
150
- |----------|-------|
151
- | plugins/specweave/skills/pm/SKILL.md | Description lacks keywords |
152
- | plugins/specweave-frontend/skills/react-expert/SKILL.md | Name too long (67 chars) |
153
- | ... | ... |
154
-
155
- ### By Plugin (Worst First)
156
- | Plugin | Pass | Warn | Fail | Score |
157
- |--------|------|------|------|-------|
158
- | specweave-mobile | 2 | 3 | 2 | 57% |
159
- | specweave-n8n | 4 | 2 | 1 | 71% |
160
- | specweave-testing | 8 | 1 | 0 | 94% |
161
- | specweave | 25 | 3 | 0 | 94% |
162
- | ... | ... | ... | ... | ... |
163
-
164
- ### Auto-Fix Available
165
- 8 issues can be auto-fixed. Run `/sw:skill --audit --fix`
166
- ```
167
-
168
- ### Auto-Fix Capabilities
169
-
170
- | Issue | Auto-Fix |
171
- |-------|----------|
172
- | Missing frontmatter | Add minimal `---\ndescription: TODO\n---` |
173
- | Name mismatch | Update to match directory name |
174
- | Invalid characters in name | Convert to kebab-case |
175
- | Missing description | Add placeholder with TODO marker |
176
-
177
- ---
178
-
179
- ## Commands vs Skills: Clarification
180
-
181
- **Per official Anthropic docs (2025):**
182
-
183
- > "Custom slash commands have been merged into skills. A file at `.claude/commands/review.md` and a skill at `.claude/skills/review/SKILL.md` both create `/review` and work the same way."
184
-
185
- ### Migration Recommendation
186
-
187
- | Format | Status | Recommendation |
188
- |--------|--------|----------------|
189
- | `commands/*.md` | Legacy | Migrate to skills or add frontmatter |
190
- | `skills/*/SKILL.md` | Current | Preferred format |
191
-
192
- ### Command Frontmatter (If Keeping Commands)
193
-
194
- ```yaml
195
- ---
196
- name: test-init
197
- description: Initialize testing infrastructure with Vitest and Playwright
198
- argument-hint: [--framework vitest|jest]
199
- allowed-tools: [Read, Write, Edit, Bash]
200
- ---
201
- ```
202
-
203
- ---
204
-
205
- ## Create Mode (Interactive)
206
-
207
- **Quick skill scaffolding** - from concept to working skill in under 2 minutes.
208
-
209
- ## Interactive Questionnaire
210
-
211
- Use **AskUserQuestion** to gather information:
212
-
213
- ### Question 1: Skill Name
214
- ```
215
- What should we name this skill?
216
- - Use lowercase letters, numbers, and hyphens only
217
- - Max 64 characters
218
- - Examples: python-expert, react-hooks, kubernetes-helper
219
- ```
220
-
221
- **Validation**:
222
- - Must match: `^[a-z0-9][a-z0-9-]*[a-z0-9]$` (or single char `^[a-z0-9]$`)
223
- - No consecutive hyphens
224
- - Cannot start/end with hyphen
225
- - Max 64 characters
226
-
227
- ### Question 2: Skill Type
228
-
229
- ```
230
- What type of skill?
231
-
232
- ○ Auto-activating (Recommended)
233
- → Claude loads it when keywords match user's request
234
- → Best for: domain expertise, best practices, knowledge
235
-
236
- ○ Command skill
237
- → User must invoke with /skill-name explicitly
238
- → Best for: workflows with side effects (deploy, commit, send)
239
-
240
- ○ Knowledge skill
241
- → Only Claude can activate, user cannot invoke directly
242
- → Best for: background context, internal APIs, legacy systems
243
- ```
244
-
245
- **Frontmatter mapping**:
246
- | Type | Frontmatter |
247
- |------|-------------|
248
- | Auto-activating | (default, no extra fields) |
249
- | Command | `disable-model-invocation: true` |
250
- | Knowledge | `user-invocable: false` |
251
-
252
- ### Question 3: Description
253
-
254
- ```
255
- Describe what this skill does AND when to use it.
256
- Include trigger keywords users might say.
257
-
258
- Example:
259
- "React hooks expert. Explains useState, useEffect, custom hooks.
260
- Activates for: React hooks, useState, useEffect, custom hook, React state"
261
- ```
262
-
263
- **Requirements**:
264
- - Max 1024 characters
265
- - MUST include "Activates for:" with keywords
266
- - Front-load the purpose
267
-
268
- ### Question 4: Location
269
-
270
- ```
271
- Where should this skill live?
272
-
273
- ○ Project (.claude/skills/) (Recommended)
274
- → Only in this project
275
- → Shared with team via git
276
-
277
- ○ Personal (~/.claude/skills/)
278
- → Available in ALL your projects
279
- → Private to you
280
- ```
281
-
282
- ### Question 5 (Optional): Tool Restrictions
283
-
284
- ```
285
- Should this skill have restricted tool access?
286
-
287
- ○ Full access (default)
288
- → Can use all tools
289
-
290
- ○ Read-only
291
- → allowed-tools: Read, Grep, Glob, WebSearch
292
-
293
- ○ Custom
294
- → Specify which tools: Read, Write, Edit, Grep, Glob, Bash, WebSearch, WebFetch
295
- ```
296
-
297
- ## Generation
298
-
299
- ### Step 1: Create Directory
300
-
301
- ```bash
302
- # Personal skill
303
- mkdir -p ~/.claude/skills/{skill-name}
304
-
305
- # Project skill
306
- mkdir -p .claude/skills/{skill-name}
307
- ```
308
-
309
- ### Step 2: Generate SKILL.md
310
-
311
- **Auto-activating skill**:
312
- ```yaml
313
- ---
314
- description: {description with "Activates for:" keywords}
315
- ---
316
-
317
- # {Skill Title}
318
-
319
- ## What I Know
320
-
321
- - [Topic 1]
322
- - [Topic 2]
323
- - [Topic 3]
324
-
325
- ## When to Use
326
-
327
- Ask me about:
328
- - "How do I [use case 1]..."
329
- - "What's the best way to [use case 2]..."
330
-
331
- ## Key Concepts
332
-
333
- ### [Concept 1]
334
-
335
- [Explanation with code examples]
336
-
337
- ## Best Practices
338
-
339
- 1. ✅ **[Practice 1]**: [Why]
340
- 2. ⚠️ **[Anti-pattern]**: [Why to avoid]
341
-
342
- ## Examples
343
-
344
- ### [Example 1]
345
-
346
- ```[language]
347
- [code]
348
- ```
349
- ```
350
-
351
- **Command skill** (add frontmatter):
352
- ```yaml
353
- ---
354
- description: {description}
355
- disable-model-invocation: true
356
- ---
357
- ```
358
-
359
- **Knowledge skill** (add frontmatter):
360
- ```yaml
361
- ---
362
- description: {description}
363
- user-invocable: false
364
- ---
365
- ```
366
-
367
- **With tool restrictions** (add frontmatter):
368
- ```yaml
369
- ---
370
- description: {description}
371
- allowed-tools: Read, Grep, Glob, WebSearch
372
- ---
373
- ```
374
-
375
- ### Step 3: Validate
376
-
377
- Check these before finishing:
378
- - [ ] SKILL.md starts with `---` on line 1
379
- - [ ] Has `description:` field (includes "Activates for:")
380
- - [ ] Closing `---` present before markdown content
381
- - [ ] Description under 1024 characters
382
- - [ ] Does NOT have `name:` field (causes prefix stripping in plugins)
383
-
384
- ### Step 4: Show Next Steps
385
-
386
- ```
387
- ✅ Skill created: {path}/SKILL.md
388
-
389
- Next steps:
390
- 1. Edit SKILL.md with your expertise content
391
- 2. Restart Claude Code to load the skill
392
- 3. Test: Ask a question with your trigger keywords
393
-
394
- Test your skill:
395
- "{example trigger question based on description}"
396
-
397
- Troubleshooting:
398
- - Skill doesn't activate → Add more keywords to description
399
- - YAML errors → Check frontmatter format (---)
400
- - Not loading → Restart Claude Code
401
- ```
402
-
403
- ## Non-Interactive Mode
404
-
405
- Support flags for automation:
406
-
407
- ```bash
408
- /sw:skill --name python-expert --type auto --location personal \
409
- --description "Python expert. Activates for: python, pip, virtualenv"
410
- ```
411
-
412
- | Flag | Values | Default |
413
- |------|--------|---------|
414
- | `--name` | skill-name | (required) |
415
- | `--type` | `auto`, `command`, `knowledge` | `auto` |
416
- | `--location` | `project`, `personal` | `project` |
417
- | `--description` | "text" | (required) |
418
- | `--tools` | `full`, `readonly`, or comma-separated list | `full` |
419
-
420
- ## Examples
421
-
422
- ### Example 1: React Hooks Expert
423
-
424
- ```
425
- /sw:skill
426
-
427
- Name: react-hooks-expert
428
- Type: Auto-activating
429
- Description: React hooks expert. Explains useState, useEffect, useContext,
430
- useMemo, useCallback, and custom hooks patterns. Activates for: React hooks,
431
- useState, useEffect, custom hook, React state management, hooks patterns.
432
- Location: Project
433
- Tools: Full access
434
- ```
435
-
436
- **Creates** `.claude/skills/react-hooks-expert/SKILL.md`
437
-
438
- ### Example 2: Deploy Command
439
-
440
- ```
441
- /sw:skill
442
-
443
- Name: deploy-production
444
- Type: Command skill
445
- Description: Production deployment workflow with safety checks.
446
- Location: Project
447
- Tools: Full access
448
- ```
449
-
450
- **Creates** `.claude/skills/deploy-production/SKILL.md` with `disable-model-invocation: true`
451
-
452
- ### Example 3: Internal API Docs
453
-
454
- ```
455
- /sw:skill
456
-
457
- Name: internal-api-docs
458
- Type: Knowledge skill
459
- Description: Internal API documentation for company services.
460
- Activates for: internal API, company API, service endpoints.
461
- Location: Project
462
- Tools: Read-only
463
- ```
464
-
465
- **Creates** `.claude/skills/internal-api-docs/SKILL.md` with:
466
- ```yaml
467
- ---
468
- name: internal-api-docs
469
- description: Internal API documentation...
470
- user-invocable: false
471
- allowed-tools: Read, Grep, Glob, WebSearch
472
- ---
473
- ```
474
-
475
- ## Validation Errors
476
-
477
- | Error | Fix |
478
- |-------|-----|
479
- | "Invalid name format" | Use lowercase, hyphens only |
480
- | "Name too long" | Max 64 characters |
481
- | "Description too long" | Max 1024 characters |
482
- | "Missing Activates for:" | Add trigger keywords |
483
- | "Directory exists" | Choose different name or remove existing |
484
-
485
- ## Quick Reference
486
-
487
- **Skill types**:
488
- - **Auto-activating**: Claude loads when keywords match (default)
489
- - **Command**: User invokes with `/skill-name` explicitly
490
- - **Knowledge**: Only Claude activates, user cannot invoke
491
-
492
- **Locations**:
493
- - **Personal**: `~/.claude/skills/` (all projects)
494
- - **Project**: `.claude/skills/` (this project only)
495
-
496
- **Tool restrictions**:
497
- - Read-only: `allowed-tools: Read, Grep, Glob, WebSearch`
498
- - Custom: specify tools you need
499
-
500
- Create your skill!
501
-
502
- ---
503
-
504
- ## Implementation: Validation Algorithm
505
-
506
- When running validation, use this algorithm:
507
-
508
- ### Step 1: Find Skills to Validate
509
-
510
- ```bash
511
- # For --audit mode, find all skills
512
- find plugins -name "SKILL.md" -type f 2>/dev/null
513
- find .claude/skills -name "SKILL.md" -type f 2>/dev/null
514
-
515
- # Also check commands for frontmatter compliance
516
- find plugins -path "*/commands/*.md" -type f 2>/dev/null
517
- ```
518
-
519
- ### Step 2: Parse Frontmatter
520
-
521
- For each file:
522
- 1. Read file content
523
- 2. Check if starts with `---`
524
- 3. Find closing `---`
525
- 4. Parse YAML between delimiters
526
- 5. Extract fields: name, description, allowed-tools, etc.
527
-
528
- ### Step 3: Run Validation Checks
529
-
530
- ```typescript
531
- interface ValidationResult {
532
- file: string;
533
- status: 'PASS' | 'WARN' | 'FAIL';
534
- checks: {
535
- frontmatter: { status: string; details: string };
536
- name: { status: string; details: string };
537
- description: { status: string; details: string };
538
- tools: { status: string; details: string };
539
- content: { status: string; details: string };
540
- };
541
- issues: { severity: string; message: string }[];
542
- suggestions: string[];
543
- }
544
-
545
- // Name pattern (official Anthropic spec)
546
- const NAME_PATTERN = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;
547
- const MAX_NAME_LENGTH = 64;
548
- const MAX_DESC_LENGTH = 1024;
549
-
550
- // Valid tools (Claude Code built-in)
551
- const VALID_TOOLS = [
552
- 'Read', 'Write', 'Edit', 'Grep', 'Glob', 'Bash',
553
- 'WebSearch', 'WebFetch', 'Task', 'TodoWrite',
554
- 'AskUserQuestion', 'Skill', 'NotebookEdit'
555
- ];
556
-
557
- // Activation keyword patterns
558
- const ACTIVATION_PATTERNS = [
559
- /activates? for:?/i,
560
- /use when/i,
561
- /triggers? on/i,
562
- /invoke when/i,
563
- /use this skill when/i
564
- ];
565
- ```
566
-
567
- ### Step 4: Generate Report
568
-
569
- Use leaderboard format for audit mode:
570
- - Group by plugin
571
- - Sort by score (worst first for issues, best first for passing)
572
- - Calculate percentages
573
- - Identify auto-fixable issues
574
-
575
- ### Step 5: Apply Fixes (if --fix)
576
-
577
- For auto-fixable issues:
578
- 1. Backup original file
579
- 2. Apply fix (add frontmatter, correct name, etc.)
580
- 3. Re-validate to confirm fix worked
581
- 4. Report changes made
582
-
583
- ---
584
-
585
- ## Official Anthropic Frontmatter Reference
586
-
587
- From https://code.claude.com/docs/en/skills:
588
-
589
- | Field | Required | Type | Description |
590
- |-------|----------|------|-------------|
591
- | `name` | **AVOID for plugins** | string | Strips plugin prefix! Only for standalone `~/.claude/skills/` |
592
- | `description` | Recommended | string | When to use (max 1024 chars, include keywords) |
593
- | `argument-hint` | Optional | string | Hint for arguments (e.g., `[issue-number]`) |
594
- | `disable-model-invocation` | Optional | boolean | Prevent Claude auto-loading (default: false) |
595
- | `user-invocable` | Optional | boolean | Hide from / menu (default: true) |
596
- | `allowed-tools` | Optional | array | Tools Claude can use without permission |
597
- | `model` | Optional | string | Model override (sonnet, opus, haiku) |
598
- | `context` | Optional | string | Set to `fork` for subagent execution |
599
- | `agent` | Optional | string | Subagent type when context:fork |
600
- | `hooks` | Optional | object | Lifecycle hooks for this skill |
601
-
602
- ### Invocation Control Matrix
603
-
604
- | Frontmatter | User Can Invoke | Claude Can Invoke | When Loaded |
605
- |-------------|-----------------|-------------------|-------------|
606
- | (default) | Yes | Yes | Description in context, full skill on invoke |
607
- | `disable-model-invocation: true` | Yes | No | Description NOT in context |
608
- | `user-invocable: false` | No | Yes | Description always in context |
609
-
610
- ---
611
-
612
- ## Troubleshooting Validation
613
-
614
- | Error | Cause | Fix |
615
- |-------|-------|-----|
616
- | "Invalid YAML" | Tabs, bad indentation, unclosed quotes | Use spaces, check syntax |
617
- | "Name mismatch" | `name:` differs from directory | Update to match directory name |
618
- | "No activation keywords" | Description too generic | Add "Activates for:" or "Use when" |
619
- | "Invalid tool" | Typo in allowed-tools | Check against VALID_TOOLS list |
620
- | "Missing frontmatter" | File doesn't start with `---` | Add YAML frontmatter block |
@@ -1,25 +0,0 @@
1
- ---
2
- description: Technical lead bridging architecture and implementation for code quality and guidance. Use when reviewing code, refactoring for maintainability, or breaking features into implementation tasks. Covers design patterns, SOLID principles, code organization, and technical debt management.
3
- ---
4
-
5
- # Tech Lead
6
-
7
- ## Project-Specific Learnings
8
-
9
- Before starting work, check for project-specific learnings:
10
-
11
- ```bash
12
- cat .specweave/skill-memories/tech-lead.md 2>/dev/null || echo "No project learnings yet"
13
- ```
14
-
15
- ## Approach
16
-
17
- Bridge architecture decisions with implementation quality:
18
-
19
- 1. **Code quality** — SOLID principles, design patterns, clean code
20
- 2. **Refactoring** — Improve structure while preserving behavior
21
- 3. **Task breakdown** — Convert architecture into actionable implementation tasks
22
- 4. **Tech debt** — Identify and prioritize technical debt reduction
23
-
24
- For pre-ship bug-finding, use `/sw:grill` instead.
25
- For security review, use `/sw:security-patterns` instead.