@intentsolutionsio/skill-creator 5.0.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.
- package/.claude-plugin/plugin.json +17 -0
- package/README.md +55 -0
- package/package.json +38 -0
- package/scripts/validate-skill.py +1132 -0
- package/skills/agent-creator/SKILL.md +305 -0
- package/skills/agent-creator/references/anthropic-agent-spec.md +89 -0
- package/skills/skill-creator/SKILL.md +267 -0
- package/skills/skill-creator/agents/analyzer.md +279 -0
- package/skills/skill-creator/agents/comparator.md +207 -0
- package/skills/skill-creator/agents/grader.md +228 -0
- package/skills/skill-creator/assets/eval_review.html +146 -0
- package/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/skills/skill-creator/references/advanced-eval-workflow.md +320 -0
- package/skills/skill-creator/references/anthropic-comparison.md +93 -0
- package/skills/skill-creator/references/ard-template.md +47 -0
- package/skills/skill-creator/references/creation-guide.md +305 -0
- package/skills/skill-creator/references/errors-template.md +27 -0
- package/skills/skill-creator/references/examples-template.md +40 -0
- package/skills/skill-creator/references/frontmatter-spec.md +531 -0
- package/skills/skill-creator/references/implementation-template.md +42 -0
- package/skills/skill-creator/references/output-patterns.md +193 -0
- package/skills/skill-creator/references/prd-template.md +55 -0
- package/skills/skill-creator/references/schemas.md +430 -0
- package/skills/skill-creator/references/source-of-truth.md +658 -0
- package/skills/skill-creator/references/validation-rules.md +528 -0
- package/skills/skill-creator/references/workflows.md +233 -0
- package/skills/skill-creator/scripts/__init__.py +0 -0
- package/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/skills/skill-creator/scripts/generate_report.py +326 -0
- package/skills/skill-creator/scripts/improve_description.py +247 -0
- package/skills/skill-creator/scripts/package_skill.py +136 -0
- package/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/skills/skill-creator/scripts/run_eval.py +344 -0
- package/skills/skill-creator/scripts/run_loop.py +329 -0
- package/skills/skill-creator/scripts/utils.py +47 -0
- package/skills/skill-creator/scripts/validate-skill.py +87 -0
- package/skills/skill-creator/templates/agent-template.md +99 -0
- package/skills/skill-creator/templates/skill-template.md +122 -0
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
# Skill & Plugin Validation Rules
|
|
2
|
+
Sources: [Anthropic docs](https://code.claude.com/docs/en/skills) · Intent Solutions enterprise policy
|
|
3
|
+
|
|
4
|
+
Universal validation aligned with the Anthropic 2026 spec. Two tiers: Standard (Anthropic minimum) and Enterprise (our marketplace default — all fields required, zero tolerance for non-standard fields).
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Validation Tiers
|
|
9
|
+
|
|
10
|
+
### Standard Tier (Anthropic Minimum)
|
|
11
|
+
|
|
12
|
+
The baseline for any SKILL.md to be syntactically valid in Claude Code.
|
|
13
|
+
|
|
14
|
+
- Valid YAML frontmatter (parses without error, `---` delimiters present)
|
|
15
|
+
- `name` present, kebab-case (`^[a-z][a-z0-9-]*[a-z0-9]$`), no consecutive hyphens, matches directory name
|
|
16
|
+
- `description` present, third person, includes what + when context
|
|
17
|
+
- No first/second person in description
|
|
18
|
+
- Body under 500 lines
|
|
19
|
+
- No absolute paths (`/home/`, `/Users/`, `C:\`) outside code blocks
|
|
20
|
+
|
|
21
|
+
### Enterprise Tier (Marketplace Default)
|
|
22
|
+
|
|
23
|
+
Everything in Standard, plus ALL 8 core fields REQUIRED as hard ERRORS:
|
|
24
|
+
|
|
25
|
+
| # | Field | Validation |
|
|
26
|
+
|---|-------|-----------|
|
|
27
|
+
| 1 | `name` | 1-64 chars, kebab-case, matches directory name, no XML tags |
|
|
28
|
+
| 2 | `description` | 1-1024 chars, third person, what + when + keywords, "Use when" pattern, "Trigger with" pattern, no XML tags |
|
|
29
|
+
| 3 | `allowed-tools` | Non-empty, all tools from valid set, Bash scoped (unscoped = ERROR) |
|
|
30
|
+
| 4 | `version` | Semver format (`X.Y.Z`) — top-level, NOT under metadata |
|
|
31
|
+
| 5 | `author` | Non-empty string, email recommended (`Name <email>`) — top-level, NOT under metadata |
|
|
32
|
+
| 6 | `license` | Non-empty string, SPDX identifier — top-level |
|
|
33
|
+
| 7 | `compatible-with` | Non-empty, values from known platforms (`claude-code`, `cursor`, `codex`, `openclaw`, `windsurf`, `cline`) |
|
|
34
|
+
| 8 | `tags` | Non-empty array of discovery tags |
|
|
35
|
+
|
|
36
|
+
Conditional fields (required when relevant):
|
|
37
|
+
|
|
38
|
+
| Field | Condition | Level |
|
|
39
|
+
|-------|-----------|-------|
|
|
40
|
+
| `context` | Required if `agent` is set | ERROR |
|
|
41
|
+
| `agent` | Required if `context: fork` | ERROR |
|
|
42
|
+
| `argument-hint` | Recommended if `user-invocable` or body uses `$ARGUMENTS` | WARNING |
|
|
43
|
+
| `model` | Recommended for all skills | INFO |
|
|
44
|
+
| `effort` | Recommended for all skills | INFO |
|
|
45
|
+
| `hooks` | Only validated if present | — |
|
|
46
|
+
|
|
47
|
+
Body must contain all 7 sections (hard ERROR if any missing):
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
## Overview — what the skill does and why it exists
|
|
51
|
+
## Prerequisites — what must be true before running
|
|
52
|
+
## Instructions — step-by-step workflow (numbered steps required)
|
|
53
|
+
## Output — what the user gets back
|
|
54
|
+
## Error Handling — failure modes and recovery
|
|
55
|
+
## Examples — concrete input/output pairs
|
|
56
|
+
## Resources — references to supporting files
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Supporting files required (gold standard):
|
|
60
|
+
- `PRD.md` must exist in skill root — Product Requirements Document
|
|
61
|
+
- `ARD.md` must exist in skill root — Architecture Requirements Document
|
|
62
|
+
- `references/` directory must exist (plural directory, NOT `reference.md` singular)
|
|
63
|
+
- `references/errors.md` must exist — troubleshooting table
|
|
64
|
+
- `references/examples.md` must exist — real usage examples with code
|
|
65
|
+
- `references/implementation.md` must exist — how the skill works internally
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Invalid Fields (ERROR — reject on sight)
|
|
70
|
+
|
|
71
|
+
Any field not in the Anthropic spec is an ERROR, not a warning. No "tolerated" or "transition" fields.
|
|
72
|
+
|
|
73
|
+
| Field | Reason |
|
|
74
|
+
|-------|--------|
|
|
75
|
+
| `capabilities` | Invented — not in Anthropic spec |
|
|
76
|
+
| `expertise_level` | Invented — not in Anthropic spec |
|
|
77
|
+
| `activation_priority` | Invented — not in Anthropic spec |
|
|
78
|
+
| `color` | Invented — not in Anthropic spec |
|
|
79
|
+
| `activation_triggers` | Invented — not in Anthropic spec |
|
|
80
|
+
| `type` | Invented — not in Anthropic spec |
|
|
81
|
+
| `category` | Invented — not in Anthropic spec |
|
|
82
|
+
| `compatibility` | Not Anthropic — remove or move to description prose |
|
|
83
|
+
| `metadata` | Not Anthropic — move nested fields to top-level |
|
|
84
|
+
| `when_to_use` | Deprecated — move content to `description` |
|
|
85
|
+
| `mode` | Deprecated — use `disable-model-invocation` |
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Valid Frontmatter Fields (Complete List)
|
|
90
|
+
|
|
91
|
+
### SKILL.md Fields (Anthropic 2026)
|
|
92
|
+
|
|
93
|
+
```yaml
|
|
94
|
+
# Required (Enterprise)
|
|
95
|
+
name: kebab-case-name
|
|
96
|
+
description: |
|
|
97
|
+
Third person. What + when + trigger phrases.
|
|
98
|
+
allowed-tools: "Read,Write,Edit,Bash(git:*)"
|
|
99
|
+
version: 1.0.0
|
|
100
|
+
author: Name <email>
|
|
101
|
+
license: MIT
|
|
102
|
+
compatible-with: claude-code, cursor
|
|
103
|
+
tags: [devops, ci]
|
|
104
|
+
|
|
105
|
+
# Optional (Anthropic spec)
|
|
106
|
+
model: sonnet # sonnet | haiku | opus | inherit
|
|
107
|
+
effort: low # low | medium | high | max (max requires Opus 4.6)
|
|
108
|
+
context: fork # Must be "fork" if present
|
|
109
|
+
agent: general-purpose # Non-empty string; requires context: fork
|
|
110
|
+
argument-hint: "<file-path>" # Autocomplete hint for $ARGUMENTS
|
|
111
|
+
user-invocable: false # Boolean — hide from / menu
|
|
112
|
+
disable-model-invocation: true # Boolean — prevent auto-activation
|
|
113
|
+
hooks: # Valid object with known event keys
|
|
114
|
+
pre-tool-call: ...
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Agent Fields (Anthropic 2026 — 14 total)
|
|
118
|
+
|
|
119
|
+
```yaml
|
|
120
|
+
# Required
|
|
121
|
+
name: agent-name
|
|
122
|
+
description: "20-200 char description"
|
|
123
|
+
|
|
124
|
+
# Optional (Anthropic spec)
|
|
125
|
+
model: sonnet
|
|
126
|
+
effort: low | medium | high
|
|
127
|
+
maxTurns: 10
|
|
128
|
+
disallowedTools: ["mcp__servername"]
|
|
129
|
+
permissionMode: default
|
|
130
|
+
|
|
131
|
+
# Valid but less common
|
|
132
|
+
capabilities: [] # NOTE: valid for agents ONLY, not skills
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Plugin agents CANNOT use** (WARN if present):
|
|
136
|
+
- `hooks` — plugin-level only, not agent-level
|
|
137
|
+
- `mcpServers` — plugin-level only
|
|
138
|
+
- `permissionMode` — standalone agent only, not plugin-scoped
|
|
139
|
+
|
|
140
|
+
**Invalid for agents** (ERROR):
|
|
141
|
+
- `expertise_level`, `activation_priority`, `color`, `activation_triggers`, `type`, `category` — invented, not Anthropic
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Description Validation
|
|
146
|
+
|
|
147
|
+
### Must Include (Both Tiers)
|
|
148
|
+
|
|
149
|
+
- What the skill does (action-oriented, third person)
|
|
150
|
+
- When to use it (context/triggers)
|
|
151
|
+
- Specific keywords for discovery
|
|
152
|
+
|
|
153
|
+
### Must Not Include (Both Tiers)
|
|
154
|
+
|
|
155
|
+
| Pattern | Regex | Example |
|
|
156
|
+
|---------|-------|---------|
|
|
157
|
+
| First person | `\b(I can\|I will\|I'm\|I help)\b` | "I can generate..." |
|
|
158
|
+
| Second person | `\b(You can\|You should\|You will)\b` | "You can use..." |
|
|
159
|
+
|
|
160
|
+
### Enterprise Additions
|
|
161
|
+
|
|
162
|
+
- Must include "Use when" pattern (+3 pts)
|
|
163
|
+
- Must include "Trigger with" pattern (+3 pts)
|
|
164
|
+
- Action verbs (analyze, create, generate, build, debug, optimize, validate)
|
|
165
|
+
- Third person throughout
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Body Validation
|
|
170
|
+
|
|
171
|
+
### Standard Tier
|
|
172
|
+
|
|
173
|
+
| Check | Level | Detail |
|
|
174
|
+
|-------|-------|--------|
|
|
175
|
+
| Line count <=500 | Error | Must be under 500 lines |
|
|
176
|
+
| Line count 301-500 | Warning | Consider splitting to references |
|
|
177
|
+
| Absolute paths | Error | No `/home/`, `/Users/`, `C:\` outside code blocks |
|
|
178
|
+
| Has H1 title | Warning | Should have `# Title` |
|
|
179
|
+
| No time-sensitive info | Warning | Avoid dates, version numbers, or temporal references that rot |
|
|
180
|
+
| No XML tags in frontmatter | Error | XML tags in YAML frontmatter cause parse failures |
|
|
181
|
+
| Consistent terminology | Warning | Same concept should use same term throughout |
|
|
182
|
+
| Feedback loops present | Warning | Should include validation steps or self-check instructions |
|
|
183
|
+
| Required packages listed | Warning | External dependencies should be declared in Prerequisites |
|
|
184
|
+
|
|
185
|
+
### Enterprise Tier (adds)
|
|
186
|
+
|
|
187
|
+
| Check | Level | Detail |
|
|
188
|
+
|-------|-------|--------|
|
|
189
|
+
| 7 required sections present | Error | Overview, Prerequisites, Instructions, Output, Error Handling, Examples, Resources |
|
|
190
|
+
| Instructions have numbered steps | Warning | Should have numbered steps or `### Step N` headings |
|
|
191
|
+
| All `${CLAUDE_SKILL_DIR}/` refs exist | Error | Referenced scripts, references, templates must exist |
|
|
192
|
+
| No path escapes | Error | No `${CLAUDE_SKILL_DIR}/../` |
|
|
193
|
+
| `references/` directory exists | Error | Must use `references/` (plural directory), not `reference.md` singular |
|
|
194
|
+
| Word count | Warning | Over 5000 words suggests splitting to references |
|
|
195
|
+
|
|
196
|
+
### SKILL.md Line Limits
|
|
197
|
+
|
|
198
|
+
| Range | Level |
|
|
199
|
+
|-------|-------|
|
|
200
|
+
| 1-300 lines | OK |
|
|
201
|
+
| 301-500 lines | WARNING |
|
|
202
|
+
| >500 lines | ERROR |
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## Stub Detection Rules
|
|
207
|
+
|
|
208
|
+
A component is flagged as a "stub" (ERROR at enterprise tier, WARNING at standard) if ANY of these are true:
|
|
209
|
+
|
|
210
|
+
| Condition | Detection |
|
|
211
|
+
|-----------|-----------|
|
|
212
|
+
| Body too short | SKILL.md body (after frontmatter) < 30 lines |
|
|
213
|
+
| No substantive content | Zero code blocks AND zero markdown links to supporting files |
|
|
214
|
+
| Empty supporting files | Files in `references/`, `scripts/`, `templates/` exist but are 0 bytes |
|
|
215
|
+
| Generic description | Matches patterns: "A helpful tool", "Generates...", or lacks "use when" |
|
|
216
|
+
| No instructions | Missing `## Instructions` section entirely |
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## Tool Validation
|
|
221
|
+
|
|
222
|
+
### Valid Tool Names
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
Read, Write, Edit, Bash, Glob, Grep,
|
|
226
|
+
WebFetch, WebSearch, Task, NotebookEdit,
|
|
227
|
+
AskUserQuestion, Skill
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Plus MCP tools in `ServerName:tool_name` format.
|
|
231
|
+
|
|
232
|
+
### Bash Scoping
|
|
233
|
+
|
|
234
|
+
| Tier | Unscoped `Bash` |
|
|
235
|
+
|------|-----------------|
|
|
236
|
+
| Standard | Warning |
|
|
237
|
+
| Enterprise | Error |
|
|
238
|
+
|
|
239
|
+
Valid scoped patterns:
|
|
240
|
+
```
|
|
241
|
+
Bash(git:*)
|
|
242
|
+
Bash(npm:*)
|
|
243
|
+
Bash(python:*)
|
|
244
|
+
Bash(mkdir:*)
|
|
245
|
+
Bash(chmod:*)
|
|
246
|
+
Bash(curl:*)
|
|
247
|
+
Bash(docker:*)
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## Plugin-Level Validation
|
|
253
|
+
|
|
254
|
+
When the validator is pointed at a plugin directory (not just a single SKILL.md):
|
|
255
|
+
|
|
256
|
+
### 1. Validate `plugin.json`
|
|
257
|
+
|
|
258
|
+
Check against the 8-field schema. Only `name` is strictly required by Anthropic; enterprise requires all populated fields to be from the valid set:
|
|
259
|
+
|
|
260
|
+
Valid fields: `name`, `version`, `description`, `author`, `repository`, `homepage`, `license`, `keywords`
|
|
261
|
+
|
|
262
|
+
ERROR on any field not in this list.
|
|
263
|
+
|
|
264
|
+
### 2. Walk `skills/*/SKILL.md`
|
|
265
|
+
|
|
266
|
+
Validate each SKILL.md against the active tier (standard or enterprise). Each skill scores independently.
|
|
267
|
+
|
|
268
|
+
### 3. Walk `agents/*.md`
|
|
269
|
+
|
|
270
|
+
Validate each agent against the 14-field Anthropic agent schema. Flag plugin agents using standalone-only fields (`permissionMode`).
|
|
271
|
+
|
|
272
|
+
### 4. Walk `commands/*.md`
|
|
273
|
+
|
|
274
|
+
Validate each command file (YAML frontmatter + body). Legacy format — emit INFO suggesting migration to skills where appropriate.
|
|
275
|
+
|
|
276
|
+
### 5. Check `hooks/hooks.json` (if present)
|
|
277
|
+
|
|
278
|
+
Validate hook event keys are from the known set. Validate referenced scripts exist and are executable.
|
|
279
|
+
|
|
280
|
+
### 6. Check `.mcp.json` (if present)
|
|
281
|
+
|
|
282
|
+
Validate MCP server configuration structure.
|
|
283
|
+
|
|
284
|
+
### 7. Roll Up Plugin Score
|
|
285
|
+
|
|
286
|
+
Plugin score = weighted average of component scores:
|
|
287
|
+
- Skills: 50% weight
|
|
288
|
+
- Agents: 20% weight
|
|
289
|
+
- Commands: 15% weight
|
|
290
|
+
- Plugin.json completeness: 10% weight
|
|
291
|
+
- Hooks/MCP correctness: 5% weight
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## Agent Validation Rules
|
|
296
|
+
|
|
297
|
+
Anthropic defines 14 valid fields for agents. `name` and `description` are REQUIRED (both tiers).
|
|
298
|
+
|
|
299
|
+
### Valid Agent Fields
|
|
300
|
+
|
|
301
|
+
| Field | Required | Validation |
|
|
302
|
+
|-------|----------|-----------|
|
|
303
|
+
| `name` | Yes | 1-64 chars, kebab-case |
|
|
304
|
+
| `description` | Yes | 20-200 chars, specific to agent's specialty |
|
|
305
|
+
| `model` | No | `sonnet`, `haiku`, `opus`, or valid model ID |
|
|
306
|
+
| `effort` | No | `low`, `medium`, `high` |
|
|
307
|
+
| `maxTurns` | No | Positive integer, controls autonomous iteration |
|
|
308
|
+
| `disallowedTools` | No | Array of tool names (denylist — opposite of skills' `allowed-tools`) |
|
|
309
|
+
| `permissionMode` | No | `default` — standalone agents only, NOT plugin agents |
|
|
310
|
+
|
|
311
|
+
### Context-Aware Rules
|
|
312
|
+
|
|
313
|
+
**Plugin agents** (`plugins/*/agents/*.md`):
|
|
314
|
+
- WARN if `hooks` present (hooks belong at plugin level, not agent level)
|
|
315
|
+
- WARN if `mcpServers` present (plugin-level concern)
|
|
316
|
+
- WARN if `permissionMode` present (standalone-only field)
|
|
317
|
+
|
|
318
|
+
**Standalone agents** (`~/.claude/agents/*.md`):
|
|
319
|
+
- All fields valid without restriction
|
|
320
|
+
|
|
321
|
+
### Invalid Agent Fields (ERROR)
|
|
322
|
+
|
|
323
|
+
These are invented fields that appear in no Anthropic documentation:
|
|
324
|
+
|
|
325
|
+
`capabilities` (valid for agents only per spec, but flag if used as a freeform list), `expertise_level`, `activation_priority`, `color`, `activation_triggers`, `type`, `category`
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## Anti-Pattern Detection
|
|
330
|
+
|
|
331
|
+
| Anti-Pattern | Check | Level |
|
|
332
|
+
|-------------|-------|-------|
|
|
333
|
+
| Windows paths | `C:\` or backslash paths | Error |
|
|
334
|
+
| Nested references | `${CLAUDE_SKILL_DIR}/references/sub/dir/file` (more than 1 level deep) | Warning |
|
|
335
|
+
| Hardcoded model IDs | `claude-*-20\d{6}` pattern (use `sonnet`/`haiku`/`opus` instead) | Warning |
|
|
336
|
+
| Voodoo constants | Unexplained magic numbers | Info |
|
|
337
|
+
| Over-verbose | >5000 words in SKILL.md body | Warning |
|
|
338
|
+
| Missing progressive disclosure | >300 lines + no `references/` directory | Warning |
|
|
339
|
+
| Singular reference file | `reference.md` instead of `references/` directory | Error |
|
|
340
|
+
| Time-sensitive info | Dates, version numbers, or temporal references that rot | Warning |
|
|
341
|
+
| XML tags in frontmatter | `<tag>` syntax in YAML frontmatter fields | Error |
|
|
342
|
+
| Missing feedback loops | No validation steps or self-check instructions in workflow | Warning |
|
|
343
|
+
|
|
344
|
+
---
|
|
345
|
+
|
|
346
|
+
## Progressive Disclosure Scoring
|
|
347
|
+
|
|
348
|
+
| Metric | Score |
|
|
349
|
+
|--------|-------|
|
|
350
|
+
| SKILL.md under 200 lines | +2 |
|
|
351
|
+
| SKILL.md 200-400 lines | +1 |
|
|
352
|
+
| SKILL.md 400-500 lines | 0 |
|
|
353
|
+
| SKILL.md over 500 lines | -2 |
|
|
354
|
+
| Has `references/` directory | +1 |
|
|
355
|
+
| Has `scripts/` directory | +1 |
|
|
356
|
+
| Description under 200 chars | +1 |
|
|
357
|
+
| Description over 500 chars | -1 |
|
|
358
|
+
| Has unnecessary TOC | -1 (modifier) |
|
|
359
|
+
| Uses dynamic context injection | +1 (modifier) |
|
|
360
|
+
| Reference files >100 lines have TOC | +1 |
|
|
361
|
+
|
|
362
|
+
Score 4+: Excellent disclosure. Score 2-3: Good. Score 0-1: Needs improvement.
|
|
363
|
+
|
|
364
|
+
**Navigation signals** are scored by section header density (7+ `##` headers = 5/5), not by TOC presence. TOC in SKILL.md body wastes tokens and is not part of the Anthropic spec. However, reference files over 100 lines SHOULD have a TOC for navigability — this is a different context than the main SKILL.md body.
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
## Dynamic Context Injection
|
|
369
|
+
|
|
370
|
+
Skills can use `` !`command` `` syntax (Anthropic spec preprocessing) to inject dynamic content at activation time.
|
|
371
|
+
|
|
372
|
+
### Scoring
|
|
373
|
+
|
|
374
|
+
| Pattern | Effect |
|
|
375
|
+
|---------|--------|
|
|
376
|
+
| `` !`command` `` directives present | +1 modifier bonus |
|
|
377
|
+
| Combined with `references/` directory | INFO note on layered structure |
|
|
378
|
+
|
|
379
|
+
### DCI Validation Rules
|
|
380
|
+
|
|
381
|
+
| Check | Level |
|
|
382
|
+
|-------|-------|
|
|
383
|
+
| Command has error fallback (`2>/dev/null \|\| echo '...'`) | Warning if missing |
|
|
384
|
+
| Output expected to be small (<5KB) | Info if potentially large |
|
|
385
|
+
| No secrets in DCI commands (API keys, tokens) | Error |
|
|
386
|
+
|
|
387
|
+
### When to Use
|
|
388
|
+
|
|
389
|
+
| Scenario | Method |
|
|
390
|
+
|----------|--------|
|
|
391
|
+
| Always-needed, small references (<5KB) | `` !`cat ${CLAUDE_SKILL_DIR}/references/small.md` `` |
|
|
392
|
+
| Dynamic state (git log, env vars) | `` !`git log --oneline -5` `` |
|
|
393
|
+
| Conditional or large references (>5KB) | Manual `Load ...` instructions |
|
|
394
|
+
|
|
395
|
+
The command runs at skill activation time. Output is injected verbatim into the body before Claude processes it.
|
|
396
|
+
|
|
397
|
+
---
|
|
398
|
+
|
|
399
|
+
## Token Budget Validation
|
|
400
|
+
|
|
401
|
+
| Metric | Warning | Error |
|
|
402
|
+
|--------|---------|-------|
|
|
403
|
+
| Single description length | >500 chars | >1024 chars |
|
|
404
|
+
| SKILL.md body tokens (est.) | >4000 | >6000 |
|
|
405
|
+
| Estimated: `word_count * 1.3` | | |
|
|
406
|
+
|
|
407
|
+
---
|
|
408
|
+
|
|
409
|
+
## String Substitution Validation
|
|
410
|
+
|
|
411
|
+
If SKILL.md body contains `$ARGUMENTS` or `$0`, `$1`, etc.:
|
|
412
|
+
- `argument-hint` SHOULD be set in frontmatter (WARNING if missing)
|
|
413
|
+
- Instructions SHOULD handle empty `$ARGUMENTS` case
|
|
414
|
+
- `$ARGUMENTS[N]` indexing should be sequential from 0
|
|
415
|
+
|
|
416
|
+
Also recognized: `${CLAUDE_SESSION_ID}` — current session identifier (Anthropic substitution).
|
|
417
|
+
|
|
418
|
+
---
|
|
419
|
+
|
|
420
|
+
## Validation Process
|
|
421
|
+
|
|
422
|
+
### Pre-flight
|
|
423
|
+
1. File exists and is readable
|
|
424
|
+
2. YAML frontmatter parses without error
|
|
425
|
+
3. Frontmatter separator (`---`) present at start and end
|
|
426
|
+
4. No non-standard fields present (ERROR on any invented/deprecated field)
|
|
427
|
+
|
|
428
|
+
### Field Validation
|
|
429
|
+
1. All 8 required fields present (enterprise) or 2 required fields (standard)
|
|
430
|
+
2. Field types correct (string, array, boolean, semver)
|
|
431
|
+
3. Field constraints met (kebab-case, SPDX, valid tool names)
|
|
432
|
+
4. No deprecated fields (ERROR: `when_to_use`, `mode`, `compatibility`, `metadata`)
|
|
433
|
+
5. No invented fields (ERROR: `capabilities`, `expertise_level`, `activation_priority`, etc.)
|
|
434
|
+
6. Conditional field logic (`context` requires `agent` and vice versa)
|
|
435
|
+
|
|
436
|
+
### Body Validation
|
|
437
|
+
1. Length within limits (301-500 = WARNING, >500 = ERROR)
|
|
438
|
+
2. All 7 required sections present (enterprise) — hard ERROR if any missing
|
|
439
|
+
3. No absolute paths outside code blocks
|
|
440
|
+
4. Instructions have numbered steps (enterprise)
|
|
441
|
+
5. Stub detection (body <30 lines, no code blocks, no links, generic description)
|
|
442
|
+
6. `references/` directory exists (enterprise)
|
|
443
|
+
|
|
444
|
+
### Resource Validation
|
|
445
|
+
1. All `${CLAUDE_SKILL_DIR}/scripts/*` references exist
|
|
446
|
+
2. All `${CLAUDE_SKILL_DIR}/references/*` references exist
|
|
447
|
+
3. All `${CLAUDE_SKILL_DIR}/templates/*` references exist
|
|
448
|
+
4. All `${CLAUDE_SKILL_DIR}/assets/*` references exist
|
|
449
|
+
5. Relative markdown links (e.g., `[ref](references/api.md)`) point to existing files
|
|
450
|
+
6. No path escape attempts (`../`)
|
|
451
|
+
7. No empty (0-byte) supporting files (stub detection)
|
|
452
|
+
|
|
453
|
+
### Report
|
|
454
|
+
- Errors: Must fix (blocks pass)
|
|
455
|
+
- Warnings: Should fix (does not block pass)
|
|
456
|
+
- Info: Optional improvements (includes structural advisor suggestions)
|
|
457
|
+
- Score: Progressive disclosure score
|
|
458
|
+
- Stats: Word count, line count, token estimate
|
|
459
|
+
- Stub flags: Components identified as stubs
|
|
460
|
+
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
## Structural Advisors (Enterprise Tier)
|
|
464
|
+
|
|
465
|
+
INFO-level suggestions emitted after grading. Not scored — purely advisory.
|
|
466
|
+
|
|
467
|
+
### Split to Commands
|
|
468
|
+
- **Trigger**: 3+ kebab-case `## operation-name` sections without `commands/` directory
|
|
469
|
+
- **Suggestion**: Split into individual `commands/*.md` files
|
|
470
|
+
- **Why**: Each operation becomes a separate slash command; skill stays lean
|
|
471
|
+
|
|
472
|
+
### Offload to References
|
|
473
|
+
- **Trigger**: Body sections >20 lines (Output, Error Handling, Examples) without `references/`
|
|
474
|
+
- **Suggestion**: Move to `references/section-name.md` with relative markdown link
|
|
475
|
+
- **Why**: Reduces token footprint; Claude reads on demand
|
|
476
|
+
|
|
477
|
+
### DCI Opportunities
|
|
478
|
+
- **Trigger**: File existence checks, git operations, or tool version detection without DCI
|
|
479
|
+
- **Suggestion**: Add `` !`command` `` directives for auto-detection at activation
|
|
480
|
+
- **Why**: Eliminates discovery tool calls; Claude starts with context pre-loaded
|
|
481
|
+
|
|
482
|
+
### Migrate Commands to Skills
|
|
483
|
+
- **Trigger**: `commands/*.md` files present without corresponding `skills/` entries
|
|
484
|
+
- **Suggestion**: Consider migrating to SKILL.md format for auto-activation
|
|
485
|
+
- **Why**: Skills activate automatically on context; commands require explicit `/name` invocation
|
|
486
|
+
|
|
487
|
+
---
|
|
488
|
+
|
|
489
|
+
## Anthropic Official Checklist Alignment
|
|
490
|
+
|
|
491
|
+
22-item checklist mapped to validation checks, organized by category. Each item references the Anthropic best practices (2026) and maps to an existing validation rule or anti-pattern in this document.
|
|
492
|
+
|
|
493
|
+
### Content Quality (8 items)
|
|
494
|
+
|
|
495
|
+
| # | Checklist Item | Maps To | Level |
|
|
496
|
+
|---|---------------|---------|-------|
|
|
497
|
+
| 1 | Description is third person, action-oriented | Description Validation > Must Include | Error |
|
|
498
|
+
| 2 | No first/second person pronouns | Description Validation > Must Not Include | Error |
|
|
499
|
+
| 3 | Keywords present for discovery | Description Validation > Must Include | Warning |
|
|
500
|
+
| 4 | No XML tags in frontmatter values | Enterprise Tier table (`name`, `description`), Body Validation > Standard Tier | Error |
|
|
501
|
+
| 5 | No time-sensitive information (dates, versions that rot) | Body Validation > Standard Tier, Anti-Pattern Detection | Warning |
|
|
502
|
+
| 6 | Consistent terminology throughout | Body Validation > Standard Tier | Warning |
|
|
503
|
+
| 7 | No hardcoded model IDs (use `sonnet`/`haiku`/`opus`) | Anti-Pattern Detection > Hardcoded model IDs | Warning |
|
|
504
|
+
| 8 | No absolute paths outside code blocks | Body Validation > Standard Tier | Error |
|
|
505
|
+
|
|
506
|
+
### Structure & Disclosure (8 items)
|
|
507
|
+
|
|
508
|
+
| # | Checklist Item | Maps To | Level |
|
|
509
|
+
|---|---------------|---------|-------|
|
|
510
|
+
| 9 | SKILL.md body under 500 lines | Body Validation > Standard Tier, SKILL.md Line Limits | Error |
|
|
511
|
+
| 10 | Progressive disclosure used (references/ for heavy content) | Progressive Disclosure Scoring | Warning |
|
|
512
|
+
| 11 | No TOC in SKILL.md body (wastes tokens) | Progressive Disclosure Scoring > Has unnecessary TOC | -1 modifier |
|
|
513
|
+
| 12 | Reference files >100 lines have TOC | Progressive Disclosure Scoring > Reference files TOC | +1 modifier |
|
|
514
|
+
| 13 | All `${CLAUDE_SKILL_DIR}/` references resolve to existing files | Body Validation > Enterprise Tier, Resource Validation | Error |
|
|
515
|
+
| 14 | No path escapes (`../`) | Body Validation > Enterprise Tier, Resource Validation | Error |
|
|
516
|
+
| 15 | Required packages and dependencies listed | Body Validation > Standard Tier > Required packages listed | Warning |
|
|
517
|
+
| 16 | 7 required body sections present (Enterprise) | Body Validation > Enterprise Tier > 7 required sections | Error |
|
|
518
|
+
|
|
519
|
+
### Testing & Evaluation (6 items)
|
|
520
|
+
|
|
521
|
+
| # | Checklist Item | Maps To | Level |
|
|
522
|
+
|---|---------------|---------|-------|
|
|
523
|
+
| 17 | Feedback loops present (validation/self-check steps) | Body Validation > Standard Tier, Anti-Pattern Detection | Warning |
|
|
524
|
+
| 18 | Error handling section documents failure modes and recovery | Body Validation > Enterprise Tier > Error handling | Warning |
|
|
525
|
+
| 19 | Examples section has concrete input/output pairs | Body Validation > Enterprise Tier > Has examples | Warning |
|
|
526
|
+
| 20 | Instructions have numbered steps | Body Validation > Enterprise Tier > Instructions have steps | Warning |
|
|
527
|
+
| 21 | Stub detection passes (body >=30 lines, has code blocks or links) | Stub Detection Rules | Error (enterprise) |
|
|
528
|
+
| 22 | DCI commands have error fallbacks | Dynamic Context Injection > DCI Validation Rules | Warning |
|