@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.
Files changed (39) hide show
  1. package/.claude-plugin/plugin.json +17 -0
  2. package/README.md +55 -0
  3. package/package.json +38 -0
  4. package/scripts/validate-skill.py +1132 -0
  5. package/skills/agent-creator/SKILL.md +305 -0
  6. package/skills/agent-creator/references/anthropic-agent-spec.md +89 -0
  7. package/skills/skill-creator/SKILL.md +267 -0
  8. package/skills/skill-creator/agents/analyzer.md +279 -0
  9. package/skills/skill-creator/agents/comparator.md +207 -0
  10. package/skills/skill-creator/agents/grader.md +228 -0
  11. package/skills/skill-creator/assets/eval_review.html +146 -0
  12. package/skills/skill-creator/eval-viewer/generate_review.py +471 -0
  13. package/skills/skill-creator/eval-viewer/viewer.html +1325 -0
  14. package/skills/skill-creator/references/advanced-eval-workflow.md +320 -0
  15. package/skills/skill-creator/references/anthropic-comparison.md +93 -0
  16. package/skills/skill-creator/references/ard-template.md +47 -0
  17. package/skills/skill-creator/references/creation-guide.md +305 -0
  18. package/skills/skill-creator/references/errors-template.md +27 -0
  19. package/skills/skill-creator/references/examples-template.md +40 -0
  20. package/skills/skill-creator/references/frontmatter-spec.md +531 -0
  21. package/skills/skill-creator/references/implementation-template.md +42 -0
  22. package/skills/skill-creator/references/output-patterns.md +193 -0
  23. package/skills/skill-creator/references/prd-template.md +55 -0
  24. package/skills/skill-creator/references/schemas.md +430 -0
  25. package/skills/skill-creator/references/source-of-truth.md +658 -0
  26. package/skills/skill-creator/references/validation-rules.md +528 -0
  27. package/skills/skill-creator/references/workflows.md +233 -0
  28. package/skills/skill-creator/scripts/__init__.py +0 -0
  29. package/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  30. package/skills/skill-creator/scripts/generate_report.py +326 -0
  31. package/skills/skill-creator/scripts/improve_description.py +247 -0
  32. package/skills/skill-creator/scripts/package_skill.py +136 -0
  33. package/skills/skill-creator/scripts/quick_validate.py +103 -0
  34. package/skills/skill-creator/scripts/run_eval.py +344 -0
  35. package/skills/skill-creator/scripts/run_loop.py +329 -0
  36. package/skills/skill-creator/scripts/utils.py +47 -0
  37. package/skills/skill-creator/scripts/validate-skill.py +87 -0
  38. package/skills/skill-creator/templates/agent-template.md +99 -0
  39. package/skills/skill-creator/templates/skill-template.md +122 -0
@@ -0,0 +1,658 @@
1
+ # Claude Agent Skills: Source of Truth Specification
2
+
3
+ Canonical reference from [Anthropic docs](https://code.claude.com/docs/en/skills). Last synced: 2026-03-21.
4
+
5
+ Additional references:
6
+ - **Claude Code Extensions** — platform-specific fields ([changelog](https://code.claude.com/docs/en/changelog))
7
+ - **Anthropic Engineering Blog** — progressive disclosure, degrees of freedom
8
+ - **anthropics/skills** — [github.com/anthropics/skills](https://github.com/anthropics/skills) (official skill-creator reference implementation)
9
+
10
+ ---
11
+
12
+ ## 1. Frontmatter Fields
13
+
14
+ ### Anthropic Standard (11 fields)
15
+
16
+ | Field | Type | Required | Constraints |
17
+ |-------|------|----------|-------------|
18
+ | `name` | string | Yes | 1-64 chars, kebab-case, must match directory name, no XML tags (`<`, `>`) |
19
+ | `description` | string | Yes | 1-1024 chars, what + when to use, third person, no XML tags |
20
+ | `allowed-tools` | string | No | Comma-separated tool names |
21
+ | `model` | string | No | `sonnet`, `haiku`, `opus`, `inherit`, or full model ID |
22
+ | `effort` | string | No | `low`, `medium`, `high`, `max` |
23
+ | `argument-hint` | string | No | Autocomplete hint for `/skill-name` |
24
+ | `context` | string | No | `fork` only |
25
+ | `agent` | string | No | Subagent type (requires `context: fork`) |
26
+ | `user-invocable` | boolean | No | Default: `true` |
27
+ | `disable-model-invocation` | boolean | No | Default: `false` |
28
+ | `hooks` | object | No | Lifecycle hooks (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd) |
29
+
30
+ ### Enterprise Additions (5 fields)
31
+
32
+ These are not part of the Anthropic core spec but are used by the Tons of Skills marketplace and enterprise validators.
33
+
34
+ | Field | Type | Constraints |
35
+ |-------|------|-------------|
36
+ | `version` | string | Semver (`X.Y.Z`) |
37
+ | `author` | string | `Name <email>` |
38
+ | `license` | string | SPDX identifier (MIT, Apache-2.0, etc.) |
39
+ | `compatible-with` | string | Comma-separated platforms (`claude-code`, `codex`, `openclaw`, `aider`, `continue`, `cursor`, `windsurf`) |
40
+ | `tags` | array | Discovery tags as list of strings |
41
+
42
+ ### Field Relationships
43
+
44
+ - `context: fork` + `agent` work together (agent requires fork context)
45
+ - `disable-model-invocation: true` + `user-invocable: false` are contradictory (use one)
46
+ - `allowed-tools` scoped Bash like `Bash(git:*)` is best practice but not enforced by runtime
47
+ - `author`, `version`, `license`, `tags`, `compatible-with` are TOP-LEVEL fields (marketplace validator scores them at top-level)
48
+ - `effort` overrides model reasoning effort (works independently of other fields)
49
+ - `max` effort is only available with Opus 4.6
50
+
51
+ ### Fields NOT in Anthropic Spec (ERROR if found)
52
+
53
+ | Field | Origin | Migration |
54
+ |-------|--------|-----------|
55
+ | `capabilities` | Invented | Remove — describe capabilities in `description` |
56
+ | `expertise_level` | Invented | Remove — no replacement |
57
+ | `activation_priority` | Invented | Remove — no replacement |
58
+ | `compatibility` | AgentSkills.io | Remove — note requirements in SKILL.md body or description |
59
+ | `metadata` | AgentSkills.io | Remove — use top-level fields instead |
60
+ | `when_to_use` | Deprecated | Move content to `description` |
61
+ | `mode` | Deprecated | Use `disable-model-invocation` instead |
62
+
63
+ ### Recommended Field Order
64
+
65
+ ```yaml
66
+ ---
67
+ # Required (Anthropic)
68
+ name: skill-name
69
+ description: |
70
+ What it does. Use when [scenario].
71
+ Trigger with "/skill-name" or "[natural phrase]".
72
+
73
+ # Tools
74
+ allowed-tools: "Read,Write,Glob,Grep"
75
+
76
+ # Enterprise identity (top-level)
77
+ version: 1.0.0
78
+ author: Name <email>
79
+ license: MIT
80
+
81
+ # Anthropic extensions (as needed)
82
+ model: inherit
83
+ # effort: high
84
+ argument-hint: "[arg]"
85
+ context: fork
86
+ agent: general-purpose
87
+ disable-model-invocation: false
88
+ user-invocable: true
89
+
90
+ # Enterprise discovery (optional)
91
+ compatible-with: claude-code, codex, openclaw
92
+ tags: [devops, automation]
93
+ ---
94
+ ```
95
+
96
+ ### Valid Tools for `allowed-tools`
97
+
98
+ `Read`, `Write`, `Edit`, `Bash`, `Glob`, `Grep`, `WebFetch`, `WebSearch`, `Task`, `TodoWrite`, `NotebookEdit`, `AskUserQuestion`, `Skill`
99
+
100
+ MCP tools use `ServerName:tool_name` format.
101
+
102
+ Bash scoping patterns:
103
+ ```yaml
104
+ Bash(git:*) # All git commands
105
+ Bash(npm:*) # All npm commands
106
+ Bash(python:*) # All python commands
107
+ Bash(mkdir:*) # Directory creation
108
+ ```
109
+
110
+ ---
111
+
112
+ ## 2. Agent Frontmatter (14 Anthropic fields)
113
+
114
+ Agents live in `agents/*.md` and use a different frontmatter schema than skills.
115
+
116
+ ### Agent Fields
117
+
118
+ | Field | Type | Required | Constraints |
119
+ |-------|------|----------|-------------|
120
+ | `name` | string | Yes | Agent identifier |
121
+ | `description` | string | Yes | 20-200 chars, agent's specialty |
122
+ | `model` | string | No | `sonnet`, `haiku`, `opus`, `inherit`, or full model ID |
123
+ | `effort` | string | No | `low`, `medium`, `high`, `max` |
124
+ | `maxTurns` | integer | No | Max agentic loop iterations |
125
+ | `tools` | string | No | Comma-separated allowed tools |
126
+ | `disallowedTools` | string | No | Comma-separated denied tools (denylist) |
127
+ | `skills` | array | No | Skill names to preload into subagent context |
128
+ | `mcpServers` | object\|array | No | MCP server configuration |
129
+ | `hooks` | object | No | Lifecycle hooks |
130
+ | `memory` | string | No | `user`, `project`, or `local` |
131
+ | `background` | boolean | No | Run in background |
132
+ | `isolation` | string | No | `worktree` only |
133
+ | `permissionMode` | string | No | `default`, `acceptEdits`, `dontAsk`, `bypassPermissions`, `plan` |
134
+
135
+ ### Key Differences from Skills
136
+
137
+ - Agents use `disallowedTools` (denylist) while skills use `allowed-tools` (allowlist)
138
+ - `effort` and `maxTurns` control autonomous iteration behavior (agent-only semantics)
139
+ - Agents support `mcpServers`, `memory`, `background`, `isolation`, and `permissionMode`
140
+
141
+ ### Plugin Agent Restrictions
142
+
143
+ When agents are distributed inside plugins, these fields are NOT supported:
144
+ - `hooks`
145
+ - `mcpServers`
146
+ - `permissionMode`
147
+
148
+ ---
149
+
150
+ ## 3. Plugin.json Schema (15 fields)
151
+
152
+ Every plugin requires `.claude-plugin/plugin.json`. Only `name` is required.
153
+
154
+ | Field | Type | Required | Purpose |
155
+ |-------|------|----------|---------|
156
+ | `name` | string | Yes | Plugin identifier |
157
+ | `version` | string | No | Semver version |
158
+ | `description` | string | No | Plugin description |
159
+ | `author` | object | No | `{name, email, url}` |
160
+ | `homepage` | string | No | Plugin homepage URL |
161
+ | `repository` | string | No | Source repository URL |
162
+ | `license` | string | No | SPDX identifier |
163
+ | `keywords` | array | No | Discovery keywords |
164
+ | `commands` | object | No | Command definitions |
165
+ | `agents` | object | No | Agent definitions |
166
+ | `skills` | object | No | Skill definitions |
167
+ | `hooks` | object | No | Plugin-level lifecycle hooks |
168
+ | `mcpServers` | object | No | MCP server configuration |
169
+ | `outputStyles` | object | No | Output formatting rules |
170
+ | `lspServers` | object | No | Language server configuration |
171
+
172
+ **CI enforcement**: Only these 15 fields are allowed. CI rejects any others.
173
+
174
+ ### Plugin Directory Structure (Anthropic Official)
175
+
176
+ ```
177
+ plugin-root/
178
+ ├── .claude-plugin/plugin.json # Required — plugin manifest
179
+ ├── commands/ # Slash commands (*.md with YAML frontmatter)
180
+ ├── agents/ # Custom agents (*.md with YAML frontmatter)
181
+ ├── skills/
182
+ │ └── skill-name/
183
+ │ └── SKILL.md # Auto-activating skill
184
+ ├── hooks/hooks.json # Lifecycle hooks configuration
185
+ ├── .mcp.json # MCP server declarations
186
+ ├── .lsp.json # LSP server declarations
187
+ ├── settings.json # Plugin settings
188
+ ├── scripts/ # Executable automation code
189
+ ├── LICENSE # License file
190
+ └── CHANGELOG.md # Version history
191
+ ```
192
+
193
+ ### Skill Subdirectory Structure (Gold Standard)
194
+
195
+ The crypto pack defines the gold standard. Every marketplace skill should target this structure.
196
+
197
+ ```
198
+ skill-name/
199
+ ├── SKILL.md # Required — frontmatter + instructions (≤150 lines)
200
+ ├── PRD.md # Required — Product Requirements Document
201
+ ├── ARD.md # Required — Architecture Requirements Document
202
+ ├── references/ # Required — progressive disclosure docs
203
+ │ ├── errors.md # Required — troubleshooting table (error | cause | fix)
204
+ │ ├── examples.md # Required — real usage examples with code
205
+ │ └── implementation.md # Required — how the skill works internally
206
+ ├── scripts/ # If skill uses ${CLAUDE_SKILL_DIR}/scripts/
207
+ ├── config/ # If skill needs configuration templates
208
+ ├── templates/ # Optional — boilerplate files for generation
209
+ └── assets/ # Optional — static resources (images, configs)
210
+ ```
211
+
212
+ **PRD.md** — Product Requirements Document. Answers: what problem, who uses it, success criteria, functional requirements, dependencies, out of scope. Written from the perspective of the skill's purpose, not generic template filler.
213
+
214
+ **ARD.md** — Architecture Requirements Document. Answers: system context, data flow, key design decisions, tool usage pattern, error handling strategy, extension points. Written from the perspective of how the skill actually works.
215
+
216
+ **Gold Standard Compliance**: tracked in `freshie/inventory.sqlite` as `gold_standard_pct` (0-100%). Target: 87%+ for all marketplace skills.
217
+
218
+ ---
219
+
220
+ ## 4. Progressive Disclosure (Three Levels)
221
+
222
+ Skills use progressive disclosure to minimize context window usage.
223
+
224
+ ### Level 1: Metadata (~100 tokens)
225
+ - Frontmatter `name` and `description` only
226
+ - Always loaded at startup for all installed skills
227
+ - Aggregated into skill list in Claude's system prompt
228
+ - **Budget**: ~2% of context window (configurable via `SLASH_COMMAND_TOOL_CHAR_BUDGET`)
229
+
230
+ ### Level 2: SKILL.md Body (<5000 tokens / <500 lines)
231
+ - Full instruction body loaded when skill activates
232
+ - Contains workflow steps, examples, edge cases
233
+ - Keep concise — Claude is already capable
234
+
235
+ ### Level 3: Bundled Resources (unlimited)
236
+ - `references/`, `scripts/`, `templates/`, `assets/`
237
+ - Loaded only when explicitly needed during execution
238
+ - Use clear section headers for navigability
239
+ - No TOC in SKILL.md body (wastes tokens). For reference files >100 lines, include a TOC at top so Claude can see full scope even with partial reads
240
+ - Heavy content belongs here, not in SKILL.md body
241
+
242
+ ### Design Implications
243
+
244
+ - Descriptions must be self-contained for discovery (Level 1)
245
+ - SKILL.md body should be actionable instructions, not encyclopedic (Level 2)
246
+ - Offload detailed specs, examples, and data to references (Level 3)
247
+
248
+ ---
249
+
250
+ ## 5. Description Writing Rules
251
+
252
+ The description is the most important field. It determines when and whether the skill activates.
253
+
254
+ ### Requirements
255
+
256
+ 1. **Third person always** — "Generates reports..." not "I generate..." or "You can generate..."
257
+ 2. **What + When** — Include both what it does AND when to use it
258
+ 3. **Specific keywords** — Use discovery-relevant terms the model will match on
259
+ 4. **Action verbs** — Start with or include: analyze, create, generate, build, debug, optimize, validate, deploy, configure, process
260
+ 5. **No first person** — Never "I can", "I will", "I help", "I'm"
261
+ 6. **No second person** — Never "You can", "You should", "You will"
262
+
263
+ ### Recommended Pattern
264
+
265
+ ```yaml
266
+ description: |
267
+ {What it does in 1-2 sentences with specific keywords}. {When to use it}.
268
+ {Optional: slash command reference}.
269
+ ```
270
+
271
+ ### Good Examples
272
+
273
+ ```yaml
274
+ # Clear what + when + keywords
275
+ description: |
276
+ Generate PDF reports from markdown with professional styling and TOC.
277
+ Use when converting documentation to distributable format.
278
+
279
+ # Specific keywords for discovery
280
+ description: |
281
+ Analyze Python code for security vulnerabilities, dependency risks, and
282
+ OWASP compliance issues. Use when reviewing code before deployment or
283
+ during security audits.
284
+ ```
285
+
286
+ ### Bad Examples
287
+
288
+ ```yaml
289
+ # First person
290
+ description: "I help you create PDFs"
291
+
292
+ # Missing when-to-use
293
+ description: "Generates PDF reports"
294
+
295
+ # Too vague - no keywords for discovery
296
+ description: "A helpful tool for documents"
297
+ ```
298
+
299
+ ### Naming Convention
300
+
301
+ - **Gerund naming preferred**: `processing-pdfs`, `analyzing-data`, `generating-reports`
302
+ - Kebab-case always: `my-skill-name`
303
+ - No reserved words: `anthropic`, `claude`
304
+
305
+ ---
306
+
307
+ ## 6. Core Principles (Anthropic Official)
308
+
309
+ ### Concise is Key
310
+ Claude is already smart. Don't over-explain. Provide:
311
+ - Clear workflow steps
312
+ - Concrete examples
313
+ - Edge cases that matter
314
+ - Nothing else
315
+
316
+ ### Degrees of Freedom
317
+
318
+ Skills have three levels of constraint:
319
+
320
+ | Level | Description | When to Use |
321
+ |-------|-------------|-------------|
322
+ | **High** | Loose guidance, Claude decides specifics | Creative tasks, analysis, open-ended work |
323
+ | **Medium** | Defined structure with flexible content | Most skills — defined workflow, flexible execution |
324
+ | **Low** | Strict templates, exact output format | Compliance, API calls, deterministic output |
325
+
326
+ Choose the right level. Over-constraining wastes tokens and fights Claude's capabilities.
327
+
328
+ **Analogy**: Think of it as a narrow bridge vs. an open field. Low degrees of freedom = narrow bridge (Claude must cross exactly this way). High degrees of freedom = open field (Claude picks the best path). Most skills should be medium — a wide road with guardrails, not a tightrope.
329
+
330
+ ### Evaluation-Driven Development
331
+
332
+ 1. Write skill
333
+ 2. Create `evals/evals.json` with at least 3 scenarios (happy path, edge case, negative test)
334
+ 3. Test with Haiku, Sonnet, AND Opus (behavior differs)
335
+ 4. Use parallel subagent methodology:
336
+ - Agent A: executes the prompt WITH the skill installed
337
+ - Agent B: executes the same prompt WITHOUT the skill
338
+ - Compare outputs against assertions
339
+ 5. Iterate based on evaluation results
340
+ 6. Optimize description with trigger eval queries (10 should-trigger, 10 should-not-trigger)
341
+ 7. Use train/test split (14/6) for description optimization — target >90% accuracy
342
+
343
+ ### Checklist Workflow Pattern
344
+
345
+ For complex skills, structure the body as a checklist that Claude works through sequentially. Each item should be:
346
+ - A concrete action (not a vague instruction)
347
+ - Independently verifiable (Claude can confirm it's done)
348
+ - Ordered by dependency (prerequisites first)
349
+
350
+ This pattern reduces skipped steps and improves consistency across models (Haiku benefits most).
351
+
352
+ ### Observation of Claude Navigation
353
+
354
+ Claude navigates SKILL.md and references differently than humans:
355
+ - **Reads top-down on first activation** — front-load the most important instructions
356
+ - **Searches by heading** when returning to a section — use descriptive H2/H3 headers
357
+ - **Follows markdown links eagerly** — a `[reference](./references/foo.md)` link will trigger a Read tool call
358
+ - **Skips content after long code blocks** — keep code examples short, move long ones to references
359
+ - **Loses context in long files** — the 500-line limit exists because Claude's attention degrades past it
360
+
361
+ ### Team Feedback
362
+
363
+ When multiple authors maintain skills in a shared plugin:
364
+ - Establish a shared glossary of terms used in descriptions (prevents synonym drift)
365
+ - Use PR review checklists that include trigger-eval accuracy checks
366
+ - Rotate skill ownership periodically to catch assumptions baked into instructions
367
+ - Track description optimization scores over time (should-trigger / should-not-trigger accuracy)
368
+
369
+ ### Description Optimization ("Pushy" Pattern)
370
+
371
+ Skills frequently undertrigger because descriptions are too passive. Use aggressive claiming language:
372
+ - "Make sure to use this skill whenever..." + specific scenarios
373
+ - Front-load distinctive keywords
374
+ - Include trigger phrases: "Use when...", "Activates for..."
375
+ - Token budget: all descriptions load at startup (~15,000 char total via `SLASH_COMMAND_TOOL_CHAR_BUDGET`)
376
+
377
+ ### No Time-Sensitive Information
378
+ - Don't include dates, versions, or URLs that change
379
+ - Reference tools by name, not version
380
+
381
+ ### Consistent Terminology
382
+ - Pick terms and stick with them throughout
383
+ - Don't alternate between synonyms
384
+ - Match terminology to the domain
385
+
386
+ ---
387
+
388
+ ## 7. Body Content Guidelines
389
+
390
+ ### Format
391
+
392
+ - **No mandatory format** — Anthropic explicitly states "no format restrictions"
393
+ - Recommended but not required: Instructions, Examples, Edge Cases
394
+ - Single H1 heading for the skill title
395
+ - Keep under 500 lines total
396
+ - Markdown formatting (headers, lists, code blocks, tables)
397
+
398
+ ### Required Sections (Enterprise)
399
+
400
+ Enterprise-grade skills should include these 7 sections:
401
+
402
+ | Section | Purpose | Notes |
403
+ |---------|---------|-------|
404
+ | **Title** (`# Name`) | Identify the skill | Required — single H1 |
405
+ | **Overview** | What this does | 1-2 sentences |
406
+ | **Prerequisites** | Tools, runtimes, env needed | List dependencies |
407
+ | **Instructions** | Step-by-step workflow | Numbered steps or sub-headers |
408
+ | **Output** | Expected deliverables | What the skill produces |
409
+ | **Error Handling** | Failure modes and recovery | Common errors + fixes |
410
+ | **Examples** | Concrete input/output | At least 1, ideally 2-3 |
411
+ | **Resources** | Links to bundled files | `${CLAUDE_SKILL_DIR}/` paths |
412
+
413
+ ### Content Quality
414
+
415
+ - Concrete examples over abstract explanations
416
+ - Show input AND expected output
417
+ - Include edge cases that actually occur
418
+ - One-level-deep file references only
419
+ - Clear section headers for navigability (TOC not required)
420
+ - Code blocks with language identifiers
421
+ - No time-sensitive information (dates, versions, URLs that change)
422
+ - Consistent terminology throughout — pick terms and stick with them
423
+ - Feedback loops: include verification steps so Claude can confirm each phase completed correctly
424
+ - Required packages/tools documented in Prerequisites or description (don't assume availability)
425
+
426
+ ---
427
+
428
+ ## 8. String Substitutions
429
+
430
+ Available in SKILL.md body for dynamic content:
431
+
432
+ | Substitution | Resolves To |
433
+ |-------------|-------------|
434
+ | `$ARGUMENTS` | All arguments passed after `/skill-name` |
435
+ | `$ARGUMENTS[0]`, `$ARGUMENTS[1]`, ... | Specific positional argument |
436
+ | `$0`, `$1`, `$2`, ... | Shorthand for `$ARGUMENTS[N]` |
437
+ | `${CLAUDE_SESSION_ID}` | Current session identifier |
438
+ | `` !`command` `` | Dynamic context injection — runs command, injects output |
439
+
440
+ ### Path Variables
441
+
442
+ | Variable | Context | Purpose |
443
+ |----------|---------|---------|
444
+ | `${CLAUDE_SKILL_DIR}` | Bash/DCI in skills | Resolves to skill's root directory |
445
+ | `${CLAUDE_PLUGIN_ROOT}` | Hooks, plugin-level | Resolves to plugin root directory |
446
+ | `${CLAUDE_PLUGIN_DATA}` | Persistent state | Survives updates/reinstalls (v2.1.78+) |
447
+
448
+ Relative markdown links (`[API Reference](reference.md)`) work without path variables — Claude follows these with the Read tool on demand.
449
+
450
+ ### Usage Examples
451
+
452
+ ```markdown
453
+ ## Instructions
454
+
455
+ Analyze the issue: $ARGUMENTS[0]
456
+
457
+ Run the following to get context:
458
+ !`git log --oneline -10`
459
+
460
+ Session tracking: ${CLAUDE_SESSION_ID}
461
+ ```
462
+
463
+ ### When to Use Backtick Injection vs Manual Loading
464
+
465
+ | Scenario | Method | Why |
466
+ |----------|--------|-----|
467
+ | Always-needed, small (<5KB) | `` !`cat ${CLAUDE_SKILL_DIR}/references/small.md` `` | Saves a Read tool call, always available |
468
+ | Conditional (mode-dependent) | Manual `Load ${CLAUDE_SKILL_DIR}/references/...` | Only loads when the branch executes |
469
+ | Large (>5KB) | Manual load | Avoids bloating context on every activation |
470
+ | Dynamic state (git log, env) | `` !`git log --oneline -5` `` | Fresh data at activation time |
471
+
472
+ ### Best Practices
473
+
474
+ - Add a `## Current State` section with DCI directives right after the skill title heading
475
+ - Always use fallbacks to avoid error output: `` !`terraform version 2>/dev/null || echo 'not installed'` ``
476
+ - Keep injections small — summaries and version info, not full file contents
477
+ - For skills that typically run 3+ discovery commands first, DCI saves those entire tool call rounds
478
+
479
+ ### Notes
480
+
481
+ - `$ARGUMENTS` is empty string if no arguments provided
482
+ - `` !`command` `` runs at skill **activation** time (preprocessing), not on demand
483
+ - Output is injected verbatim into the SKILL.md body before Claude sees it
484
+ - Guard against empty arguments in instructions
485
+
486
+ ---
487
+
488
+ ## 9. Skill Patterns
489
+
490
+ ### Script Automation
491
+ Deterministic scripts that solve specific problems.
492
+ ```
493
+ skill activates -> runs script -> returns result
494
+ ```
495
+ Best for: file conversion, data transformation, API calls.
496
+
497
+ ### Read-Process-Write
498
+ Format conversion and transformation pipeline.
499
+ ```
500
+ read input -> process/transform -> write output
501
+ ```
502
+ Best for: document conversion, code generation, data formatting.
503
+
504
+ ### Search-Analyze-Report
505
+ Codebase analysis and reporting.
506
+ ```
507
+ search codebase -> analyze findings -> generate report
508
+ ```
509
+ Best for: code review, security audit, dependency analysis.
510
+
511
+ ### Template-Based Generation
512
+ Generate output from templates with variable substitution.
513
+ ```
514
+ load template -> fill variables -> validate -> output
515
+ ```
516
+ Best for: boilerplate generation, project scaffolding, config files.
517
+
518
+ ### Wizard-Style Workflow
519
+ Interactive multi-step gathering with AskUserQuestion.
520
+ ```
521
+ ask question -> gather input -> ask more -> generate result
522
+ ```
523
+ Best for: complex configuration, multi-option setup.
524
+
525
+ ### Conditional Workflow
526
+ Branch based on input or context.
527
+ ```
528
+ analyze input -> choose path -> execute branch -> output
529
+ ```
530
+ Best for: skills that handle multiple related tasks.
531
+
532
+ ### Plan-Validate-Execute
533
+ Verifiable intermediates with feedback loops.
534
+ ```
535
+ plan steps -> validate plan -> execute -> verify each step -> report
536
+ ```
537
+ Best for: deployment, migration, refactoring tasks.
538
+
539
+ ### Visual Output Generation
540
+ Generate HTML or visual artifacts.
541
+ ```
542
+ gather data -> generate HTML -> render preview
543
+ ```
544
+ Best for: dashboards, reports, documentation sites.
545
+
546
+ ---
547
+
548
+ ## 10. Anti-Patterns
549
+
550
+ | Anti-Pattern | Why It's Bad | Fix |
551
+ |-------------|-------------|-----|
552
+ | Windows-style paths | Not portable | Use `${CLAUDE_SKILL_DIR}/` or Unix paths |
553
+ | Too many options without defaults | Analysis paralysis | Provide sensible defaults |
554
+ | Deeply nested references (>1 level) | Loading failures | Flatten to one level |
555
+ | Assuming tools are installed | Runtime failures | Note requirements in description or body |
556
+ | Over-verbose explanations | Wastes tokens, Claude is smart | Be concise |
557
+ | Vague descriptions | Poor discovery, wrong activation | Specific keywords + what/when |
558
+ | Time-sensitive information | Goes stale | Use generic references |
559
+ | Monolithic SKILL.md | Slow loading, poor disclosure | Split into references/ |
560
+ | Hardcoded model IDs | Break on deprecation | Use `inherit` or short names |
561
+ | First/second person in description | Spec violation | Third person always |
562
+ | Mandatory format enforcement | Fights Anthropic guidance | Recommend, don't require |
563
+ | Unscoped Bash in allowed-tools | Security risk | Use `Bash(git:*)` patterns |
564
+ | Voodoo constants | Unmaintainable | Document why each value exists |
565
+ | XML tags in name/description | Breaks frontmatter parsing | Use plain text, no `<` or `>` characters |
566
+ | System prompt injection in description | Security risk, spec violation | Description is for discovery only, not behavioral instructions |
567
+ | Reserved words in name (`anthropic`, `claude`) | Trademark conflict, confusing | Choose distinctive skill names |
568
+ | Long code blocks in SKILL.md body | Claude loses context after them | Move to `references/examples.md` |
569
+ | Using `compatibility` field | Not in Anthropic spec | Note requirements in body or description |
570
+ | Using `metadata` field | Not in Anthropic spec | Use top-level fields instead |
571
+ | Using `capabilities` / `expertise_level` | Invented fields, not in any spec | Remove entirely |
572
+
573
+ ---
574
+
575
+ ## 11. Validation Checklist
576
+
577
+ ### Core Quality (Anthropic Standard)
578
+
579
+ - [ ] `name` is kebab-case, 1-64 chars, matches directory name
580
+ - [ ] `description` is specific with key terms for discovery
581
+ - [ ] `description` includes what + when (third person)
582
+ - [ ] `description` has no first/second person language
583
+ - [ ] SKILL.md body under 500 lines
584
+ - [ ] Heavy details in `references/` files (progressive disclosure)
585
+ - [ ] No time-sensitive information
586
+ - [ ] Consistent terminology throughout
587
+ - [ ] Concrete examples (not abstract descriptions)
588
+ - [ ] File references one level deep only
589
+ - [ ] Clear workflow steps in instructions
590
+ - [ ] No invalid fields (`compatibility`, `metadata`, `capabilities`, `expertise_level`, `activation_priority`, `when_to_use`, `mode`)
591
+
592
+ ### Code/Scripts Quality
593
+
594
+ - [ ] Scripts solve problems (don't punt to Claude)
595
+ - [ ] Explicit error handling in scripts
596
+ - [ ] No voodoo constants (all values justified)
597
+ - [ ] Required packages/tools documented
598
+ - [ ] Scripts documented with usage comments
599
+ - [ ] No Windows paths in scripts
600
+ - [ ] Validation/verification steps included
601
+ - [ ] Feedback loops for quality assurance
602
+
603
+ ### Testing
604
+
605
+ - [ ] At least 3 evaluation scenarios created
606
+ - [ ] Tested with Haiku, Sonnet, and Opus
607
+ - [ ] Tested with real usage scenarios
608
+ - [ ] Edge cases tested (empty args, missing files, etc.)
609
+
610
+ ### Anthropic Best Practices (2026)
611
+
612
+ - [ ] No XML tags in `name` or `description` fields
613
+ - [ ] No system prompt injection patterns in description
614
+ - [ ] No reserved words (`anthropic`, `claude`) in skill name
615
+ - [ ] Description uses "pushy" pattern with "Make sure to use this skill whenever..." language
616
+ - [ ] Degrees of freedom explicitly chosen (high/medium/low) and documented
617
+ - [ ] Checklist workflow pattern used for complex multi-step skills
618
+ - [ ] Reference files >100 lines include TOC at top
619
+ - [ ] No long code blocks in SKILL.md body (moved to references)
620
+ - [ ] Trigger eval queries defined (10 should-trigger, 10 should-not-trigger)
621
+ - [ ] DCI (`!`backtick`) used for always-needed small context (<5KB)
622
+ - [ ] Feedback loops included (verification steps after each phase)
623
+
624
+ ### Enterprise Extensions
625
+
626
+ - [ ] `author` and `version` present (top-level fields)
627
+ - [ ] `allowed-tools` scoped (Bash specifically)
628
+ - [ ] Error handling section or guidance included
629
+ - [ ] Resources section references all bundled files
630
+ - [ ] `${CLAUDE_SKILL_DIR}` used for all internal paths
631
+ - [ ] All 7 required body sections present (Title, Overview, Prerequisites, Instructions, Output, Error Handling, Examples)
632
+
633
+ ---
634
+
635
+ ## 12. MCP Tool References
636
+
637
+ Skills can reference MCP (Model Context Protocol) tools:
638
+
639
+ ```yaml
640
+ allowed-tools: "Read,Write,ServerName:tool_name"
641
+ ```
642
+
643
+ Format: `ServerName:tool_name` where ServerName matches the MCP server configuration.
644
+
645
+ ---
646
+
647
+ ## 13. Token Budget
648
+
649
+ The skill list (all descriptions) loads into Claude's system prompt at startup.
650
+
651
+ | Metric | Guideline |
652
+ |--------|-----------|
653
+ | Single description | Keep under 200 chars for efficiency |
654
+ | Total all skills | ~2% of context window |
655
+ | SKILL.md body | Under 500 lines / ~5000 tokens |
656
+ | Configurable via | `SLASH_COMMAND_TOOL_CHAR_BUDGET` env var |
657
+
658
+ Longer descriptions reduce space for other skills and conversation context.