multi-forge 0.2.0__py3-none-any.whl
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.
- forge/__init__.py +3 -0
- forge/_extensions/agents/.gitkeep +0 -0
- forge/_extensions/commands/.gitkeep +0 -0
- forge/_extensions/skills/analyze/SKILL.md +87 -0
- forge/_extensions/skills/challenge/SKILL.md +91 -0
- forge/_extensions/skills/consensus/SKILL.md +120 -0
- forge/_extensions/skills/consensus/resources/code_consensus_evaluation.md +94 -0
- forge/_extensions/skills/consensus/resources/consensus_evaluation.md +70 -0
- forge/_extensions/skills/consensus/resources/synthesis.md +101 -0
- forge/_extensions/skills/debate/SKILL.md +116 -0
- forge/_extensions/skills/debate/resources/code_debate_evaluation.md +101 -0
- forge/_extensions/skills/debate/resources/debate_evaluation.md +90 -0
- forge/_extensions/skills/panel/SKILL.md +141 -0
- forge/_extensions/skills/panel/resources/synthesis.md +103 -0
- forge/_extensions/skills/qa/SKILL.md +704 -0
- forge/_extensions/skills/qa/resources/checklist/0-enable.md +78 -0
- forge/_extensions/skills/qa/resources/checklist/1-preflight.md +24 -0
- forge/_extensions/skills/qa/resources/checklist/10-resume.md +143 -0
- forge/_extensions/skills/qa/resources/checklist/11-config.md +150 -0
- forge/_extensions/skills/qa/resources/checklist/12-search.md +58 -0
- forge/_extensions/skills/qa/resources/checklist/13-guard.md +237 -0
- forge/_extensions/skills/qa/resources/checklist/14-workflow.md +305 -0
- forge/_extensions/skills/qa/resources/checklist/15-skills.md +155 -0
- forge/_extensions/skills/qa/resources/checklist/16-handoff.md +224 -0
- forge/_extensions/skills/qa/resources/checklist/17-info.md +50 -0
- forge/_extensions/skills/qa/resources/checklist/18-disable.md +84 -0
- forge/_extensions/skills/qa/resources/checklist/19-uninstall.md +146 -0
- forge/_extensions/skills/qa/resources/checklist/2-extensions.md +188 -0
- forge/_extensions/skills/qa/resources/checklist/20-cleanup.md +36 -0
- forge/_extensions/skills/qa/resources/checklist/3-auth.md +234 -0
- forge/_extensions/skills/qa/resources/checklist/4-proxy.md +481 -0
- forge/_extensions/skills/qa/resources/checklist/5-session.md +541 -0
- forge/_extensions/skills/qa/resources/checklist/6-hooks.md +275 -0
- forge/_extensions/skills/qa/resources/checklist/7-costs.md +309 -0
- forge/_extensions/skills/qa/resources/checklist/8-status-line.md +174 -0
- forge/_extensions/skills/qa/resources/checklist/9-direct-commands.md +146 -0
- forge/_extensions/skills/qa/resources/checklist.md +103 -0
- forge/_extensions/skills/qa/resources/report-template.md +62 -0
- forge/_extensions/skills/qa/scripts/start-container.sh +529 -0
- forge/_extensions/skills/qa/scripts/walkthrough-state.py +1137 -0
- forge/_extensions/skills/review/SKILL.md +125 -0
- forge/_extensions/skills/review/references/claude-4.6.md +474 -0
- forge/_extensions/skills/review/references/claude-4.7.md +710 -0
- forge/_extensions/skills/review/references/gemini-3.1.md +546 -0
- forge/_extensions/skills/review/references/gpt-5.5.md +490 -0
- forge/_extensions/skills/review/references/skills-writing-guide.md +1588 -0
- forge/_extensions/skills/review/resources/code-anthropic.md +160 -0
- forge/_extensions/skills/review/resources/code-gemini.md +184 -0
- forge/_extensions/skills/review/resources/code-openai.md +203 -0
- forge/_extensions/skills/review/resources/code.md +160 -0
- forge/_extensions/skills/review-docs/SKILL.md +121 -0
- forge/_extensions/skills/review-docs/resources/docs-anthropic.md +170 -0
- forge/_extensions/skills/review-docs/resources/docs-gemini.md +204 -0
- forge/_extensions/skills/review-docs/resources/docs-openai.md +231 -0
- forge/_extensions/skills/review-docs/resources/docs.md +170 -0
- forge/_extensions/skills/smoke-test/SKILL.md +27 -0
- forge/_extensions/skills/smoke-test/scripts/smoke-test.sh +118 -0
- forge/_extensions/skills/understand/SKILL.md +148 -0
- forge/_extensions/skills/understand/resources/code-anthropic.md +163 -0
- forge/_extensions/skills/understand/resources/code-gemini.md +194 -0
- forge/_extensions/skills/understand/resources/code-openai.md +181 -0
- forge/_extensions/skills/understand/resources/code.md +163 -0
- forge/_extensions/skills/understand/resources/docs-anthropic.md +177 -0
- forge/_extensions/skills/understand/resources/docs-gemini.md +202 -0
- forge/_extensions/skills/understand/resources/docs-openai.md +191 -0
- forge/_extensions/skills/understand/resources/docs.md +177 -0
- forge/_extensions/skills/walkthrough/SKILL.md +599 -0
- forge/_extensions/skills/walkthrough/resources/checklist.md +765 -0
- forge/_extensions/skills/walkthrough/scripts/run-in-repo.sh +118 -0
- forge/_extensions/skills/walkthrough/scripts/setup-test-repo.sh +198 -0
- forge/_extensions/skills/walkthrough/scripts/walkthrough-state.py +1137 -0
- forge/backend/__init__.py +174 -0
- forge/backend/adapters/__init__.py +38 -0
- forge/backend/adapters/litellm.py +158 -0
- forge/backend/creation.py +89 -0
- forge/backend/registry.py +178 -0
- forge/cli/__init__.py +16 -0
- forge/cli/auth.py +483 -0
- forge/cli/backend.py +298 -0
- forge/cli/claude.py +411 -0
- forge/cli/config_cmd.py +303 -0
- forge/cli/extensions.py +1001 -0
- forge/cli/gc.py +165 -0
- forge/cli/guard.py +1018 -0
- forge/cli/guards.py +106 -0
- forge/cli/handoff.py +110 -0
- forge/cli/hooks/__init__.py +36 -0
- forge/cli/hooks/_group.py +20 -0
- forge/cli/hooks/_helpers.py +149 -0
- forge/cli/hooks/commands.py +1677 -0
- forge/cli/hooks/direct_commands.py +1304 -0
- forge/cli/hooks/install.py +232 -0
- forge/cli/hooks/policy.py +151 -0
- forge/cli/hooks/read_hygiene.py +74 -0
- forge/cli/hooks/verification.py +370 -0
- forge/cli/logs.py +406 -0
- forge/cli/main.py +292 -0
- forge/cli/proxy.py +1821 -0
- forge/cli/proxy_costs.py +313 -0
- forge/cli/search.py +416 -0
- forge/cli/session.py +892 -0
- forge/cli/session_addendum.py +81 -0
- forge/cli/session_fork.py +750 -0
- forge/cli/session_handoff.py +141 -0
- forge/cli/session_lifecycle.py +2053 -0
- forge/cli/session_manage.py +1336 -0
- forge/cli/session_memory.py +201 -0
- forge/cli/status_line.py +1398 -0
- forge/cli/workflow.py +1964 -0
- forge/config/__init__.py +110 -0
- forge/config/dataclass_utils.py +88 -0
- forge/config/defaults/__init__.py +0 -0
- forge/config/defaults/backends/__init__.py +0 -0
- forge/config/defaults/backends/litellm.yaml +196 -0
- forge/config/defaults/templates/__init__.py +0 -0
- forge/config/defaults/templates/litellm-anthropic-local.yaml +33 -0
- forge/config/defaults/templates/litellm-anthropic.yaml +24 -0
- forge/config/defaults/templates/litellm-gemini-flash-local.yaml +37 -0
- forge/config/defaults/templates/litellm-gemini-local.yaml +32 -0
- forge/config/defaults/templates/litellm-gemini-test.yaml +34 -0
- forge/config/defaults/templates/litellm-gemini.yaml +21 -0
- forge/config/defaults/templates/litellm-openai-codex-local.yaml +36 -0
- forge/config/defaults/templates/litellm-openai-local.yaml +38 -0
- forge/config/defaults/templates/litellm-openai.yaml +28 -0
- forge/config/defaults/templates/openrouter-anthropic.yaml +23 -0
- forge/config/defaults/templates/openrouter-deepseek.yaml +26 -0
- forge/config/defaults/templates/openrouter-gemini-flash.yaml +26 -0
- forge/config/defaults/templates/openrouter-gemini.yaml +23 -0
- forge/config/defaults/templates/openrouter-glm.yaml +23 -0
- forge/config/defaults/templates/openrouter-kimi.yaml +30 -0
- forge/config/defaults/templates/openrouter-minimax.yaml +26 -0
- forge/config/defaults/templates/openrouter-openai-codex.yaml +23 -0
- forge/config/defaults/templates/openrouter-openai.yaml +28 -0
- forge/config/defaults/templates/openrouter-qwen.yaml +25 -0
- forge/config/loader.py +675 -0
- forge/config/schema.py +448 -0
- forge/core/__init__.py +5 -0
- forge/core/auth/__init__.py +67 -0
- forge/core/auth/capabilities.py +219 -0
- forge/core/auth/credentials_file.py +244 -0
- forge/core/auth/protocols.py +18 -0
- forge/core/auth/secrets.py +243 -0
- forge/core/auth/template_secrets.py +112 -0
- forge/core/data/__init__.py +5 -0
- forge/core/data/model_catalog.yaml +1522 -0
- forge/core/data/pricing.yaml +140 -0
- forge/core/data/system_prompt_addendums/__init__.py +0 -0
- forge/core/data/system_prompt_addendums/gemini.md +330 -0
- forge/core/data/system_prompt_addendums/openai.md +328 -0
- forge/core/llm/__init__.py +231 -0
- forge/core/llm/clients/__init__.py +14 -0
- forge/core/llm/clients/base.py +115 -0
- forge/core/llm/clients/litellm.py +619 -0
- forge/core/llm/clients/openai_compat.py +244 -0
- forge/core/llm/clients/openrouter.py +234 -0
- forge/core/llm/credentials.py +439 -0
- forge/core/llm/detection.py +86 -0
- forge/core/llm/errors.py +44 -0
- forge/core/llm/protocols.py +80 -0
- forge/core/llm/types.py +176 -0
- forge/core/logging.py +146 -0
- forge/core/models/__init__.py +91 -0
- forge/core/models/catalog.py +467 -0
- forge/core/models/pricing.py +165 -0
- forge/core/models/types.py +167 -0
- forge/core/naming.py +212 -0
- forge/core/ops/__init__.py +73 -0
- forge/core/ops/context.py +141 -0
- forge/core/ops/gc.py +802 -0
- forge/core/ops/proxy.py +146 -0
- forge/core/ops/resolution.py +135 -0
- forge/core/ops/session.py +344 -0
- forge/core/ops/session_context.py +548 -0
- forge/core/paths.py +38 -0
- forge/core/process.py +54 -0
- forge/core/reactive/__init__.py +38 -0
- forge/core/reactive/cost_tracking.py +300 -0
- forge/core/reactive/env.py +180 -0
- forge/core/reactive/proxy.py +78 -0
- forge/core/reactive/routing.py +622 -0
- forge/core/reactive/session_runner.py +185 -0
- forge/core/reactive/structured_output.py +62 -0
- forge/core/reactive/tagger.py +94 -0
- forge/core/reactive/throttle.py +132 -0
- forge/core/state/__init__.py +59 -0
- forge/core/state/exceptions.py +59 -0
- forge/core/state/io.py +140 -0
- forge/core/state/lock.py +99 -0
- forge/core/state/timestamps.py +60 -0
- forge/core/transcript.py +78 -0
- forge/core/typing_helpers.py +24 -0
- forge/core/workqueue/__init__.py +67 -0
- forge/core/workqueue/queue.py +552 -0
- forge/core/workqueue/types.py +63 -0
- forge/guard/__init__.py +26 -0
- forge/guard/deterministic/__init__.py +26 -0
- forge/guard/deterministic/base.py +158 -0
- forge/guard/deterministic/coding_standards.py +256 -0
- forge/guard/deterministic/registry.py +148 -0
- forge/guard/deterministic/tdd.py +171 -0
- forge/guard/engine.py +216 -0
- forge/guard/protocols.py +91 -0
- forge/guard/queries.py +96 -0
- forge/guard/semantic/__init__.py +34 -0
- forge/guard/semantic/promotion.py +18 -0
- forge/guard/semantic/supervisor.py +813 -0
- forge/guard/semantic/verdict.py +183 -0
- forge/guard/store.py +124 -0
- forge/guard/team/__init__.py +6 -0
- forge/guard/team/config.py +24 -0
- forge/guard/team/handlers.py +209 -0
- forge/guard/team/prompts.py +41 -0
- forge/guard/types.py +125 -0
- forge/guard/workflow/__init__.py +17 -0
- forge/guard/workflow/branches.py +67 -0
- forge/guard/workflow/config.py +63 -0
- forge/guard/workflow/divergence.py +113 -0
- forge/guard/workflow/policy.py +87 -0
- forge/guard/workflow/stages.py +205 -0
- forge/install/__init__.py +55 -0
- forge/install/cli.py +281 -0
- forge/install/exceptions.py +163 -0
- forge/install/hooks.py +109 -0
- forge/install/installer.py +1037 -0
- forge/install/models.py +321 -0
- forge/install/preset.py +272 -0
- forge/install/settings_merge.py +831 -0
- forge/install/tracking.py +238 -0
- forge/install/version.py +141 -0
- forge/proxy/__init__.py +0 -0
- forge/proxy/base_client.py +181 -0
- forge/proxy/client_adapter.py +476 -0
- forge/proxy/client_factory.py +531 -0
- forge/proxy/converters.py +1206 -0
- forge/proxy/cost_logger.py +132 -0
- forge/proxy/cost_tracker.py +242 -0
- forge/proxy/data_models.py +338 -0
- forge/proxy/error_hints.py +92 -0
- forge/proxy/metrics.py +222 -0
- forge/proxy/model_spec.py +158 -0
- forge/proxy/proxies.py +333 -0
- forge/proxy/proxy_identity.py +134 -0
- forge/proxy/proxy_orchestrator.py +1018 -0
- forge/proxy/proxy_startup.py +54 -0
- forge/proxy/server.py +1561 -0
- forge/proxy/utils.py +537 -0
- forge/review/__init__.py +6 -0
- forge/review/adversarial.py +111 -0
- forge/review/consensus.py +236 -0
- forge/review/engine.py +356 -0
- forge/review/models.py +437 -0
- forge/review/resources/__init__.py +5 -0
- forge/review/resources/codereview-performance.md +85 -0
- forge/review/resources/codereview-quick.md +75 -0
- forge/review/resources/codereview-security.md +92 -0
- forge/review/resources/codereview.md +85 -0
- forge/review/resources/docreview-quick.md +75 -0
- forge/review/resources/docreview.md +86 -0
- forge/review/resources/thinkdeep.md +89 -0
- forge/review/routing.py +368 -0
- forge/review/synthesis.py +73 -0
- forge/runtime_config.py +438 -0
- forge/search/__init__.py +55 -0
- forge/search/bm25_store.py +264 -0
- forge/search/content_store.py +197 -0
- forge/search/engine.py +352 -0
- forge/search/exceptions.py +51 -0
- forge/search/extractor.py +234 -0
- forge/search/index_state.py +295 -0
- forge/search/store.py +215 -0
- forge/search/tokenizer.py +24 -0
- forge/session/__init__.py +130 -0
- forge/session/active.py +339 -0
- forge/session/artifacts.py +202 -0
- forge/session/claude/__init__.py +50 -0
- forge/session/claude/cleanup.py +105 -0
- forge/session/claude/invoke.py +236 -0
- forge/session/claude/paths.py +200 -0
- forge/session/cleanup.py +216 -0
- forge/session/config.py +34 -0
- forge/session/direct_model.py +107 -0
- forge/session/effective.py +169 -0
- forge/session/exceptions.py +255 -0
- forge/session/handoff.py +881 -0
- forge/session/handoff_agent.py +544 -0
- forge/session/hooks/__init__.py +35 -0
- forge/session/hooks/models.py +73 -0
- forge/session/hooks/session_start.py +507 -0
- forge/session/identity.py +84 -0
- forge/session/index.py +553 -0
- forge/session/manager.py +1506 -0
- forge/session/models.py +572 -0
- forge/session/overrides.py +344 -0
- forge/session/plan_resolution.py +286 -0
- forge/session/prev_sessions.py +128 -0
- forge/session/store.py +431 -0
- forge/session/validation.py +47 -0
- forge/session/worktree/__init__.py +65 -0
- forge/session/worktree/cleanup.py +262 -0
- forge/session/worktree/config_copy.py +203 -0
- forge/session/worktree/create.py +332 -0
- forge/sidecar/__init__.py +29 -0
- forge/sidecar/container.py +161 -0
- forge/sidecar/docker.py +86 -0
- forge/sidecar/secrets.py +19 -0
- multi_forge-0.2.0.dist-info/METADATA +242 -0
- multi_forge-0.2.0.dist-info/RECORD +311 -0
- multi_forge-0.2.0.dist-info/WHEEL +4 -0
- multi_forge-0.2.0.dist-info/entry_points.txt +2 -0
- multi_forge-0.2.0.dist-info/licenses/LICENSE +203 -0
- multi_forge-0.2.0.dist-info/licenses/NOTICE +14 -0
|
@@ -0,0 +1,1588 @@
|
|
|
1
|
+
# The Complete Guide to Building Skills for Claude
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
1. [Introduction](#introduction)
|
|
6
|
+
2. [Fundamentals](#chapter-1-fundamentals)
|
|
7
|
+
3. [Planning and design](#chapter-2-planning-and-design)
|
|
8
|
+
4. [Testing and iteration](#chapter-3-testing-and-iteration)
|
|
9
|
+
5. [Distribution and sharing](#chapter-4-distribution-and-sharing)
|
|
10
|
+
6. [Patterns and troubleshooting](#chapter-5-patterns-and-troubleshooting)
|
|
11
|
+
7. [Claude Code specifics](#chapter-6-claude-code-specifics)
|
|
12
|
+
8. [Resources and references](#chapter-7-resources-and-references)
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Introduction
|
|
17
|
+
|
|
18
|
+
A [skill](https://claude.com/blog/skills) is a set of instructions - packaged as a simple folder - that teaches Claude
|
|
19
|
+
how to handle specific tasks or workflows. Skills follow the [Agent Skills](https://agentskills.io) open standard, which
|
|
20
|
+
works across multiple AI tools. Instead of re-explaining your preferences, processes, and domain expertise in every
|
|
21
|
+
conversation, skills let you teach Claude once and reuse that guidance every time.
|
|
22
|
+
|
|
23
|
+
Skills are most useful for repeatable workflows: frontend design, research, document creation, and multi-step processes.
|
|
24
|
+
They pair well with Claude's built-in capabilities and with MCP integrations.
|
|
25
|
+
|
|
26
|
+
**What you'll learn:**
|
|
27
|
+
|
|
28
|
+
- Skill structure and writing guidance
|
|
29
|
+
- Patterns for standalone and MCP-backed skills
|
|
30
|
+
- Testing, iteration, and distribution
|
|
31
|
+
|
|
32
|
+
**How to use this guide:** For standalone skills, focus on Fundamentals, Planning and Design, and category 1-2. For MCP
|
|
33
|
+
integrations, read the "Skills + MCP" section and category 3. For Claude Code-specific features like subagent execution,
|
|
34
|
+
dynamic context injection, and permission control, see Chapter 6.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Chapter 1: Fundamentals
|
|
39
|
+
|
|
40
|
+
### What is a skill?
|
|
41
|
+
|
|
42
|
+
A skill is a folder containing:
|
|
43
|
+
|
|
44
|
+
- **SKILL.md** (required): Instructions in Markdown with YAML frontmatter
|
|
45
|
+
- **scripts/** (optional): Executable code (Python, Bash, etc.)
|
|
46
|
+
- **references/** (optional): Documentation loaded as needed
|
|
47
|
+
- **assets/** (optional): Templates, fonts, icons used in output
|
|
48
|
+
- **agents/** (optional): Subagent prompts for delegating specialized tasks (e.g., grading, comparison, analysis)
|
|
49
|
+
|
|
50
|
+
### Core design principles
|
|
51
|
+
|
|
52
|
+
#### Progressive Disclosure
|
|
53
|
+
|
|
54
|
+
Skills use a three-level system:
|
|
55
|
+
|
|
56
|
+
- **First level (YAML frontmatter):** Always loaded in Claude's system prompt. Provides just enough information for
|
|
57
|
+
Claude to know when each skill should be used without loading all of it into context.
|
|
58
|
+
- **Second level (SKILL.md body):** Loaded when Claude thinks the skill is relevant to the current task. Contains the
|
|
59
|
+
full instructions and guidance. Keep under 500 lines; if approaching this limit, add hierarchy with clear pointers to
|
|
60
|
+
reference files.
|
|
61
|
+
- **Third level (Linked files):** Additional files bundled within the skill directory that Claude can choose to navigate
|
|
62
|
+
and discover only as needed. Scripts can execute without loading into context.
|
|
63
|
+
|
|
64
|
+
This progressive disclosure minimizes token usage while maintaining specialized expertise.
|
|
65
|
+
|
|
66
|
+
**Context budget:** Skill descriptions share a pool of approximately 2% of the context window (with a 16K character
|
|
67
|
+
fallback). If you have many skills enabled, they may exceed this budget. In Claude Code, run `/context` to check for
|
|
68
|
+
warnings about excluded skills. Override the limit with the `SLASH_COMMAND_TOOL_CHAR_BUDGET` environment variable.
|
|
69
|
+
|
|
70
|
+
#### Composability
|
|
71
|
+
|
|
72
|
+
Claude can load multiple skills simultaneously. Your skill should work well alongside others, not assume it's the only
|
|
73
|
+
capability available.
|
|
74
|
+
|
|
75
|
+
#### Portability
|
|
76
|
+
|
|
77
|
+
Skills work identically across Claude.ai, Claude Code, and API. Create a skill once and it works across all surfaces
|
|
78
|
+
without modification, provided the environment supports any dependencies the skill requires. Claude Code extends the
|
|
79
|
+
open standard with additional features like invocation control, subagent execution (`context: fork`), and dynamic
|
|
80
|
+
context injection -- see Chapter 6.
|
|
81
|
+
|
|
82
|
+
### For MCP Builders: Skills + Connectors
|
|
83
|
+
|
|
84
|
+
> *Building standalone skills without MCP? Skip to Planning and Design.*
|
|
85
|
+
|
|
86
|
+
If you already have a
|
|
87
|
+
[working MCP server](https://support.claude.com/en/articles/10949351-getting-started-with-local-mcp-servers-on-claude-desktop),
|
|
88
|
+
skills add the workflow layer: the steps, conventions, and guardrails Claude should follow when using those tools.
|
|
89
|
+
|
|
90
|
+
**How they work together:**
|
|
91
|
+
|
|
92
|
+
| MCP (Connectivity) | Skills (Knowledge) |
|
|
93
|
+
| ------------------------------------------------------------- | -------------------------------------------------- |
|
|
94
|
+
| Connects Claude to your service (Notion, Asana, Linear, etc.) | Teaches Claude how to use your service effectively |
|
|
95
|
+
| Provides real-time data access and tool invocation | Captures workflows and conventions |
|
|
96
|
+
| What Claude can do | How Claude should do it |
|
|
97
|
+
|
|
98
|
+
In practice, this reduces prompt variance, inconsistent tool use, and support overhead.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Chapter 2: Planning and design
|
|
103
|
+
|
|
104
|
+
### Start with use cases
|
|
105
|
+
|
|
106
|
+
Before writing any code, identify 2-3 concrete use cases your skill should enable.
|
|
107
|
+
|
|
108
|
+
**Good use case definition:**
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
Use Case: Project Sprint Planning
|
|
112
|
+
Trigger: User says "help me plan this sprint" or "create sprint tasks"
|
|
113
|
+
Steps:
|
|
114
|
+
1. Fetch current project status from Linear (via MCP)
|
|
115
|
+
2. Analyze team velocity and capacity
|
|
116
|
+
3. Suggest task prioritization
|
|
117
|
+
4. Create tasks in Linear with proper labels and estimates
|
|
118
|
+
Result: Fully planned sprint with tasks created
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Ask yourself:**
|
|
122
|
+
|
|
123
|
+
- What does a user want to accomplish?
|
|
124
|
+
- What multi-step workflows does this require?
|
|
125
|
+
- Which tools are needed (built-in or MCP?)
|
|
126
|
+
- What domain knowledge or conventions should be embedded?
|
|
127
|
+
|
|
128
|
+
### Common skill use case categories
|
|
129
|
+
|
|
130
|
+
At Anthropic, we've observed three common use cases:
|
|
131
|
+
|
|
132
|
+
#### Category 1: Document & Asset Creation
|
|
133
|
+
|
|
134
|
+
Used for: Creating consistent output -- documents, presentations, apps, designs, code.
|
|
135
|
+
|
|
136
|
+
*Real example:* [frontend-design skill](https://github.com/anthropics/skills/tree/main/skills/frontend-design) (also see
|
|
137
|
+
[skills for docx, pptx, xlsx, and ppt](https://github.com/anthropics/skills/tree/main/skills))
|
|
138
|
+
|
|
139
|
+
"Create distinctive frontend interfaces with polished design. Use when building web components, pages, artifacts,
|
|
140
|
+
posters, or applications."
|
|
141
|
+
|
|
142
|
+
**Key techniques:**
|
|
143
|
+
|
|
144
|
+
- Embedded style guides and brand standards
|
|
145
|
+
- Template structures for consistent output
|
|
146
|
+
- Quality checklists before finalizing
|
|
147
|
+
- No external tools required - uses Claude's built-in capabilities
|
|
148
|
+
|
|
149
|
+
#### Category 2: Workflow Automation
|
|
150
|
+
|
|
151
|
+
Used for: Multi-step processes that benefit from consistent methodology, including coordination across multiple MCP
|
|
152
|
+
servers.
|
|
153
|
+
|
|
154
|
+
*Real example:* [skill-creator skill](https://github.com/anthropics/skills/blob/main/skills/skill-creator/SKILL.md)
|
|
155
|
+
|
|
156
|
+
"Interactive guide for creating new skills. Walks the user through use case definition, frontmatter generation,
|
|
157
|
+
instruction writing, and validation."
|
|
158
|
+
|
|
159
|
+
**Key techniques:**
|
|
160
|
+
|
|
161
|
+
- Step-by-step workflow with validation gates
|
|
162
|
+
- Templates for common structures
|
|
163
|
+
- Built-in review and improvement suggestions
|
|
164
|
+
- Iterative refinement loops
|
|
165
|
+
|
|
166
|
+
#### Category 3: MCP Enhancement
|
|
167
|
+
|
|
168
|
+
Used for: Workflow guidance to enhance the tool access an MCP server provides.
|
|
169
|
+
|
|
170
|
+
*Real example:*
|
|
171
|
+
[sentry-code-review skill (from Sentry)](https://github.com/getsentry/sentry-for-claude/tree/main/skills)
|
|
172
|
+
|
|
173
|
+
"Automatically analyzes and fixes detected bugs in GitHub Pull Requests using Sentry's error monitoring data via their
|
|
174
|
+
MCP server."
|
|
175
|
+
|
|
176
|
+
**Key techniques:**
|
|
177
|
+
|
|
178
|
+
- Coordinates multiple MCP calls in sequence
|
|
179
|
+
- Embeds domain expertise
|
|
180
|
+
- Provides context users would otherwise need to specify
|
|
181
|
+
- Error handling for common MCP issues
|
|
182
|
+
|
|
183
|
+
### Define success criteria
|
|
184
|
+
|
|
185
|
+
#### How will you know your skill is working?
|
|
186
|
+
|
|
187
|
+
These are aspirational targets - rough benchmarks rather than precise thresholds. Aim for rigor but accept that there
|
|
188
|
+
will be an element of vibes-based assessment. Anthropic is developing better measurement guidance and tooling.
|
|
189
|
+
|
|
190
|
+
**Quantitative metrics:**
|
|
191
|
+
|
|
192
|
+
- Skill triggers on 90% of relevant queries - *How to measure:* Run 10-20 test queries that should trigger your skill.
|
|
193
|
+
Track how many times it loads automatically vs. requires explicit invocation.
|
|
194
|
+
- Completes workflow in X tool calls - *How to measure:* Compare the same task with and without the skill enabled. Count
|
|
195
|
+
tool calls and total tokens consumed.
|
|
196
|
+
- 0 failed API calls per workflow - *How to measure:* Monitor MCP server logs during test runs. Track retry rates and
|
|
197
|
+
error codes.
|
|
198
|
+
|
|
199
|
+
**Qualitative metrics:**
|
|
200
|
+
|
|
201
|
+
- Users don't need to prompt Claude about next steps - *How to assess:* During testing, note how often you need to
|
|
202
|
+
redirect or clarify. Ask beta users for feedback.
|
|
203
|
+
- Workflows complete without user correction - *How to assess:* Run the same request 3-5 times. Compare outputs for
|
|
204
|
+
structural consistency and quality.
|
|
205
|
+
- Consistent results across sessions - *How to assess:* Can a new user accomplish the task on first try with minimal
|
|
206
|
+
guidance?
|
|
207
|
+
|
|
208
|
+
### Technical requirements
|
|
209
|
+
|
|
210
|
+
#### File structure
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
your-skill-name/
|
|
214
|
+
|-- SKILL.md # Required - main skill file
|
|
215
|
+
|-- scripts/ # Optional - executable code
|
|
216
|
+
| |-- process_data.py # Example
|
|
217
|
+
| |-- validate.sh # Example
|
|
218
|
+
|-- references/ # Optional - documentation
|
|
219
|
+
| |-- api-guide.md # Example
|
|
220
|
+
| |-- examples/ # Example
|
|
221
|
+
|-- agents/ # Optional - subagent prompts
|
|
222
|
+
| |-- grader.md # Example: evaluates assertions against outputs
|
|
223
|
+
| |-- comparator.md # Example: blind A/B quality comparison
|
|
224
|
+
|-- assets/ # Optional - templates, etc.
|
|
225
|
+
|-- report-template.md # Example
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
#### Critical rules
|
|
229
|
+
|
|
230
|
+
**SKILL.md naming:**
|
|
231
|
+
|
|
232
|
+
- Must be exactly `SKILL.md` (case-sensitive)
|
|
233
|
+
- No variations accepted (SKILL.MD, skill.md, etc.)
|
|
234
|
+
|
|
235
|
+
**Skill folder naming:**
|
|
236
|
+
|
|
237
|
+
- Use kebab-case: `notion-project-setup`
|
|
238
|
+
- No spaces: ~~`Notion Project Setup`~~
|
|
239
|
+
- No underscores: ~~`notion_project_setup`~~
|
|
240
|
+
- No capitals: ~~`NotionProjectSetup`~~
|
|
241
|
+
|
|
242
|
+
**No README.md:**
|
|
243
|
+
|
|
244
|
+
- Don't include README.md inside your skill folder
|
|
245
|
+
- All documentation goes in SKILL.md or references/
|
|
246
|
+
- Note: when distributing via GitHub, you'll still want a repo-level README for human users -- see Distribution and
|
|
247
|
+
Sharing.
|
|
248
|
+
|
|
249
|
+
### YAML frontmatter: The most important part
|
|
250
|
+
|
|
251
|
+
The YAML frontmatter is how Claude decides whether to load your skill. Get this right.
|
|
252
|
+
|
|
253
|
+
**Minimal required format:**
|
|
254
|
+
|
|
255
|
+
```yaml
|
|
256
|
+
---
|
|
257
|
+
name: your-skill-name
|
|
258
|
+
description: What it does. Use when user asks to [specific phrases].
|
|
259
|
+
---
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
That's all you need to start.
|
|
263
|
+
|
|
264
|
+
#### Field requirements
|
|
265
|
+
|
|
266
|
+
**name** (required):
|
|
267
|
+
|
|
268
|
+
- kebab-case only
|
|
269
|
+
- No spaces or capitals
|
|
270
|
+
- Should match folder name
|
|
271
|
+
- Max 64 characters
|
|
272
|
+
- Note: Claude Code treats `name` as optional (defaults to directory name), but include it for cross-platform
|
|
273
|
+
portability
|
|
274
|
+
|
|
275
|
+
**description** (required):
|
|
276
|
+
|
|
277
|
+
- **MUST include BOTH:** what the skill does and when to use it (trigger conditions)
|
|
278
|
+
- Under 1024 characters (hard limit -- descriptions over this are truncated)
|
|
279
|
+
- No XML tags (< or >)
|
|
280
|
+
- Include specific tasks users might say
|
|
281
|
+
- Mention file types if relevant
|
|
282
|
+
- If omitted, Claude uses the first paragraph of markdown content
|
|
283
|
+
|
|
284
|
+
**license** (optional):
|
|
285
|
+
|
|
286
|
+
- Use if making skill open source
|
|
287
|
+
- Common: MIT, Apache-2.0
|
|
288
|
+
|
|
289
|
+
**compatibility** (optional):
|
|
290
|
+
|
|
291
|
+
- 1-500 characters
|
|
292
|
+
- Indicates environment requirements: e.g. intended product, required system packages, network access needs, etc.
|
|
293
|
+
|
|
294
|
+
**allowed-tools** (optional):
|
|
295
|
+
|
|
296
|
+
- Restrict which tools Claude can use without asking permission when this skill is active
|
|
297
|
+
- Example: `allowed-tools: Read, Grep, Glob` (read-only mode)
|
|
298
|
+
|
|
299
|
+
**metadata** (optional):
|
|
300
|
+
|
|
301
|
+
- Any custom key-value pairs
|
|
302
|
+
- Suggested: author, version, mcp-server
|
|
303
|
+
- Example:
|
|
304
|
+
```yaml
|
|
305
|
+
metadata:
|
|
306
|
+
author: ProjectHub
|
|
307
|
+
version: 1.0.0
|
|
308
|
+
mcp-server: projecthub
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
#### Extended frontmatter fields (Claude Code)
|
|
312
|
+
|
|
313
|
+
Claude Code supports additional frontmatter fields beyond the open standard:
|
|
314
|
+
|
|
315
|
+
| Field | Description |
|
|
316
|
+
| -------------------------- | ------------------------------------------------------------------------------------------------- |
|
|
317
|
+
| `argument-hint` | Hint shown during autocomplete. Example: `[issue-number]` or `[filename] [format]` |
|
|
318
|
+
| `disable-model-invocation` | Set `true` to prevent Claude from auto-loading. Use for side-effect skills (`/deploy`, `/commit`) |
|
|
319
|
+
| `user-invocable` | Set `false` to hide from `/` menu. Use for background knowledge Claude should auto-apply |
|
|
320
|
+
| `model` | Model to use when this skill is active |
|
|
321
|
+
| `effort` | Effort level override: `low`, `medium`, `high`, `max` (Opus 4.6 only) |
|
|
322
|
+
| `context` | Set to `fork` to run in a forked subagent context |
|
|
323
|
+
| `agent` | Subagent type when `context: fork` is set (e.g., `Explore`, `Plan`, or custom agent name) |
|
|
324
|
+
| `hooks` | Hooks scoped to this skill's lifecycle |
|
|
325
|
+
|
|
326
|
+
**Invocation control matrix:**
|
|
327
|
+
|
|
328
|
+
| Frontmatter | You invoke | Claude invokes | When loaded into context |
|
|
329
|
+
| -------------------------------- | ---------- | -------------- | ------------------------------------------------------ |
|
|
330
|
+
| (default) | Yes | Yes | Description always in context; full skill when invoked |
|
|
331
|
+
| `disable-model-invocation: true` | Yes | No | Description NOT in context; loads when you invoke |
|
|
332
|
+
| `user-invocable: false` | No | Yes | Description always in context; loads when invoked |
|
|
333
|
+
|
|
334
|
+
#### Security restrictions
|
|
335
|
+
|
|
336
|
+
**Forbidden in frontmatter:**
|
|
337
|
+
|
|
338
|
+
- XML angle brackets (< >)
|
|
339
|
+
- Skills with "claude" or "anthropic" in name (reserved)
|
|
340
|
+
|
|
341
|
+
**Why:** Frontmatter appears in Claude's system prompt. Malicious content could inject instructions.
|
|
342
|
+
|
|
343
|
+
### Writing effective skills
|
|
344
|
+
|
|
345
|
+
#### The description field
|
|
346
|
+
|
|
347
|
+
According to Anthropic's
|
|
348
|
+
[engineering blog](https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills): "This
|
|
349
|
+
metadata...provides just enough information for Claude to know when each skill should be used without loading all of it
|
|
350
|
+
into context." This is the first level of progressive disclosure.
|
|
351
|
+
|
|
352
|
+
**Structure:**
|
|
353
|
+
|
|
354
|
+
```
|
|
355
|
+
[What it does] + [When to use it] + [Key capabilities]
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
**Examples of good descriptions:**
|
|
359
|
+
|
|
360
|
+
```yaml
|
|
361
|
+
# Good - specific and actionable
|
|
362
|
+
description: Analyzes Figma design files and generates
|
|
363
|
+
developer handoff documentation. Use when user uploads .fig
|
|
364
|
+
files, asks for "design specs", "component documentation", or
|
|
365
|
+
"design-to-code handoff".
|
|
366
|
+
|
|
367
|
+
# Good - includes trigger phrases
|
|
368
|
+
description: Manages Linear project workflows including sprint
|
|
369
|
+
planning, task creation, and status tracking. Use when user
|
|
370
|
+
mentions "sprint", "Linear tasks", "project planning", or asks
|
|
371
|
+
to "create tickets".
|
|
372
|
+
|
|
373
|
+
# Good - clear value proposition
|
|
374
|
+
description: End-to-end customer onboarding workflow for
|
|
375
|
+
PayFlow. Handles account creation, payment setup, and
|
|
376
|
+
subscription management. Use when user says "onboard new
|
|
377
|
+
customer", "set up subscription", or "create PayFlow account".
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
**Examples of bad descriptions:**
|
|
381
|
+
|
|
382
|
+
```yaml
|
|
383
|
+
# Too vague
|
|
384
|
+
description: Helps with projects.
|
|
385
|
+
|
|
386
|
+
# Missing triggers
|
|
387
|
+
description: Creates sophisticated multi-page documentation
|
|
388
|
+
systems.
|
|
389
|
+
|
|
390
|
+
# Too technical, no user triggers
|
|
391
|
+
description: Implements the Project entity model with
|
|
392
|
+
hierarchical relationships.
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
#### Combating undertriggering
|
|
396
|
+
|
|
397
|
+
Claude tends to undertrigger skills -- to not use them when they would be useful. To combat this, make descriptions
|
|
398
|
+
slightly "pushy" by explicitly listing trigger scenarios. Instead of:
|
|
399
|
+
|
|
400
|
+
> "How to build a simple fast dashboard to display internal data."
|
|
401
|
+
|
|
402
|
+
Write:
|
|
403
|
+
|
|
404
|
+
> "How to build a simple fast dashboard to display internal data. Use this skill whenever the user mentions dashboards,
|
|
405
|
+
> data visualization, internal metrics, or wants to display any kind of company data, even if they don't explicitly ask
|
|
406
|
+
> for a 'dashboard.'"
|
|
407
|
+
|
|
408
|
+
Claude only consults skills for tasks it cannot easily handle on its own -- simple, one-step queries may not trigger a
|
|
409
|
+
skill even if the description matches, because Claude can handle them directly with basic tools. Complex, multi-step, or
|
|
410
|
+
specialized queries reliably trigger skills when the description matches.
|
|
411
|
+
|
|
412
|
+
### Writing the main instructions
|
|
413
|
+
|
|
414
|
+
After the frontmatter, write the actual instructions in Markdown.
|
|
415
|
+
|
|
416
|
+
**Recommended structure:**
|
|
417
|
+
|
|
418
|
+
*Adapt this template for your skill. Replace bracketed sections with your specific content.*
|
|
419
|
+
|
|
420
|
+
```markdown
|
|
421
|
+
---
|
|
422
|
+
name: your-skill
|
|
423
|
+
description: [...]
|
|
424
|
+
---
|
|
425
|
+
# Your Skill Name
|
|
426
|
+
## Instructions
|
|
427
|
+
### Step 1: [First Major Step]
|
|
428
|
+
Clear explanation of what happens.
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
*Example:*
|
|
432
|
+
|
|
433
|
+
````markdown
|
|
434
|
+
```bash
|
|
435
|
+
python scripts/fetch_data.py --project-id PROJECT_ID Expected output: [describe what success looks like]
|
|
436
|
+
```
|
|
437
|
+
````
|
|
438
|
+
|
|
439
|
+
(Add more steps as needed)
|
|
440
|
+
|
|
441
|
+
**Examples:**
|
|
442
|
+
|
|
443
|
+
*Example 1: [common scenario]*
|
|
444
|
+
|
|
445
|
+
User says: "Set up a new marketing campaign"
|
|
446
|
+
|
|
447
|
+
Actions:
|
|
448
|
+
|
|
449
|
+
1. Fetch existing campaigns via MCP
|
|
450
|
+
2. Create new campaign with provided parameters
|
|
451
|
+
|
|
452
|
+
Result: Campaign created with confirmation link
|
|
453
|
+
|
|
454
|
+
(Add more examples as needed)
|
|
455
|
+
|
|
456
|
+
**Troubleshooting:**
|
|
457
|
+
|
|
458
|
+
*Error: [Common error message]*
|
|
459
|
+
|
|
460
|
+
Cause: [Why it happens]
|
|
461
|
+
|
|
462
|
+
Solution: [How to fix]
|
|
463
|
+
|
|
464
|
+
(Add more error cases as needed)
|
|
465
|
+
|
|
466
|
+
### Best practices for instructions
|
|
467
|
+
|
|
468
|
+
#### Be Specific and Actionable
|
|
469
|
+
|
|
470
|
+
Good:
|
|
471
|
+
|
|
472
|
+
```
|
|
473
|
+
Run `python scripts/validate.py --input {filename}` to check
|
|
474
|
+
data format.
|
|
475
|
+
If validation fails, common issues include:
|
|
476
|
+
- Missing required fields (add them to the CSV)
|
|
477
|
+
- Invalid date formats (use YYYY-MM-DD)
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
Bad:
|
|
481
|
+
|
|
482
|
+
```
|
|
483
|
+
Validate the data before proceeding.
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
#### Explain the why, not MUST/NEVER
|
|
487
|
+
|
|
488
|
+
Explain the **why** behind instructions rather than using heavy-handed imperatives. Today's LLMs have good theory of
|
|
489
|
+
mind and can go beyond rote instructions when given reasoning. If you find yourself writing ALWAYS or NEVER in all caps,
|
|
490
|
+
or using rigid structures, that is a yellow flag. Reframe and explain the reasoning so the model understands why the
|
|
491
|
+
thing you are asking for is important. This is a more effective approach than blunt directives.
|
|
492
|
+
|
|
493
|
+
For example, instead of "NEVER use inline styles", write "Avoid inline styles because they break the design system's
|
|
494
|
+
theming and make future redesigns require touching every component."
|
|
495
|
+
|
|
496
|
+
#### Extract bundled scripts from repeated work
|
|
497
|
+
|
|
498
|
+
When testing a skill, read the transcripts from test runs. If subagents or test executions all independently write
|
|
499
|
+
similar helper scripts (e.g., every test run creates its own `create_docx.py` or `build_chart.py`), that is a strong
|
|
500
|
+
signal the skill should bundle that script in `scripts/`. Write it once and tell the skill to use it -- this saves every
|
|
501
|
+
future invocation from reinventing the wheel.
|
|
502
|
+
|
|
503
|
+
#### Include error handling
|
|
504
|
+
|
|
505
|
+
```markdown
|
|
506
|
+
## Common Issues
|
|
507
|
+
### MCP Connection Failed
|
|
508
|
+
If you see "Connection refused":
|
|
509
|
+
1. Verify MCP server is running: Check Settings > Extensions
|
|
510
|
+
2. Confirm API key is valid
|
|
511
|
+
3. Try reconnecting: Settings > Extensions > [Your Service] >
|
|
512
|
+
Reconnect
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
#### Reference bundled resources clearly
|
|
516
|
+
|
|
517
|
+
```markdown
|
|
518
|
+
Before writing queries, consult `references/api-patterns.md`
|
|
519
|
+
for:
|
|
520
|
+
- Rate limiting guidance
|
|
521
|
+
- Pagination patterns
|
|
522
|
+
- Error codes and handling
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
#### Use progressive disclosure
|
|
526
|
+
|
|
527
|
+
Keep SKILL.md focused on core instructions (under 500 lines). Move detailed documentation to `references/` and link to
|
|
528
|
+
it. For large reference files (>300 lines), include a table of contents.
|
|
529
|
+
|
|
530
|
+
---
|
|
531
|
+
|
|
532
|
+
## Chapter 3: Testing and iteration
|
|
533
|
+
|
|
534
|
+
Skills can be tested at varying levels of rigor depending on your needs:
|
|
535
|
+
|
|
536
|
+
- **Manual testing in Claude.ai** - Run queries directly and observe behavior. Fast iteration, no setup required.
|
|
537
|
+
- **Scripted testing in Claude Code** - Automate test cases for repeatable validation across changes.
|
|
538
|
+
- **Programmatic testing via skills API** - Build evaluation suites that run systematically against defined test sets.
|
|
539
|
+
|
|
540
|
+
Choose the approach that matches your quality requirements and the visibility of your skill. A skill used internally by
|
|
541
|
+
a small team has different testing needs than one deployed to thousands of enterprise users.
|
|
542
|
+
|
|
543
|
+
> **Pro Tip:** Iterate on a single task before expanding
|
|
544
|
+
|
|
545
|
+
We've found that the most effective skill creators iterate on a single challenging task until Claude succeeds, then
|
|
546
|
+
extract the winning approach into a skill. This leverages Claude's in-context learning and provides faster signal than
|
|
547
|
+
broad testing. Once you have a working foundation, expand to multiple test cases for coverage.
|
|
548
|
+
|
|
549
|
+
### Recommended Testing Approach
|
|
550
|
+
|
|
551
|
+
Based on early experience, effective skills testing typically covers three areas:
|
|
552
|
+
|
|
553
|
+
#### 1. Triggering tests
|
|
554
|
+
|
|
555
|
+
**Goal:** Ensure your skill loads at the right times.
|
|
556
|
+
|
|
557
|
+
**Test cases:**
|
|
558
|
+
|
|
559
|
+
- Triggers on obvious tasks
|
|
560
|
+
- Triggers on paraphrased requests
|
|
561
|
+
- Doesn't trigger on unrelated topics
|
|
562
|
+
|
|
563
|
+
**Example test suite:**
|
|
564
|
+
|
|
565
|
+
```
|
|
566
|
+
Should trigger:
|
|
567
|
+
- "Help me set up a new ProjectHub workspace"
|
|
568
|
+
- "I need to create a project in ProjectHub"
|
|
569
|
+
- "Initialize a ProjectHub project for Q4 planning"
|
|
570
|
+
|
|
571
|
+
Should NOT trigger:
|
|
572
|
+
- "What's the weather in San Francisco?"
|
|
573
|
+
- "Help me write Python code"
|
|
574
|
+
- "Create a spreadsheet" (unless ProjectHub skill handles sheets)
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
**Automated trigger testing (Claude Code):** You can test whether a skill triggers programmatically by running
|
|
578
|
+
`claude -p` as a subprocess with the skill installed and checking if Claude chose to use it. Remove the `CLAUDECODE`
|
|
579
|
+
environment variable to allow nesting `claude -p` inside a Claude Code session. Run each query multiple times (3x is a
|
|
580
|
+
good default) for reliable trigger rates, and track precision/recall/accuracy across iterations.
|
|
581
|
+
|
|
582
|
+
#### 2. Functional tests
|
|
583
|
+
|
|
584
|
+
**Goal:** Verify the skill produces correct outputs.
|
|
585
|
+
|
|
586
|
+
**Test cases:**
|
|
587
|
+
|
|
588
|
+
- Valid outputs generated
|
|
589
|
+
- API calls succeed
|
|
590
|
+
- Error handling works
|
|
591
|
+
- Edge cases covered
|
|
592
|
+
|
|
593
|
+
**Example:**
|
|
594
|
+
|
|
595
|
+
```
|
|
596
|
+
Test: Create project with 5 tasks
|
|
597
|
+
Given: Project name "Q4 Planning", 5 task descriptions
|
|
598
|
+
When: Skill executes workflow
|
|
599
|
+
Then:
|
|
600
|
+
- Project created in ProjectHub
|
|
601
|
+
- 5 tasks created with correct properties
|
|
602
|
+
- All tasks linked to project
|
|
603
|
+
- No API errors
|
|
604
|
+
```
|
|
605
|
+
|
|
606
|
+
#### 3. Performance comparison
|
|
607
|
+
|
|
608
|
+
**Goal:** Prove the skill improves results vs. baseline.
|
|
609
|
+
|
|
610
|
+
Use the metrics from Define Success Criteria. Here's what a comparison might look like.
|
|
611
|
+
|
|
612
|
+
**Baseline comparison:**
|
|
613
|
+
|
|
614
|
+
```
|
|
615
|
+
Without skill:
|
|
616
|
+
- User provides instructions each time
|
|
617
|
+
- 15 back-and-forth messages
|
|
618
|
+
- 3 failed API calls requiring retry
|
|
619
|
+
- 12,000 tokens consumed
|
|
620
|
+
|
|
621
|
+
With skill:
|
|
622
|
+
- Automatic workflow execution
|
|
623
|
+
- 2 clarifying questions only
|
|
624
|
+
- 0 failed API calls
|
|
625
|
+
- 6,000 tokens consumed
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
#### Blind A/B comparison (advanced)
|
|
629
|
+
|
|
630
|
+
For rigorous comparison between two skill versions, use a blind evaluation approach: give two outputs (with-skill and
|
|
631
|
+
without-skill, or old-skill and new-skill) to an independent evaluator without revealing which produced which. The
|
|
632
|
+
evaluator judges purely on output quality using a rubric covering content (correctness, completeness, accuracy) and
|
|
633
|
+
structure (organization, formatting, usability). Then a post-hoc analyzer "unblinds" the results and identifies what
|
|
634
|
+
made the winner better -- specific instruction changes, script usage, or error handling differences.
|
|
635
|
+
|
|
636
|
+
This prevents bias toward a particular skill version and produces actionable improvement suggestions. The skill-creator
|
|
637
|
+
skill includes ready-made agents for this workflow (`agents/comparator.md` and `agents/analyzer.md`).
|
|
638
|
+
|
|
639
|
+
### Using the skill-creator skill
|
|
640
|
+
|
|
641
|
+
The [skill-creator](https://github.com/anthropics/skills/tree/main/skills/skill-creator) skill - available in Claude.ai
|
|
642
|
+
via plugin directory or download for Claude Code - can help you build and iterate on skills. If you have an MCP server
|
|
643
|
+
and know your top 2-3 workflows, you can build and test a functional skill in a single sitting - often in 15-30 minutes.
|
|
644
|
+
|
|
645
|
+
**Creating skills:**
|
|
646
|
+
|
|
647
|
+
- Generate skills from natural language descriptions
|
|
648
|
+
- Produce properly formatted SKILL.md with frontmatter
|
|
649
|
+
- Suggest trigger phrases and structure
|
|
650
|
+
|
|
651
|
+
**Reviewing skills:**
|
|
652
|
+
|
|
653
|
+
- Flag common issues (vague descriptions, missing triggers, structural problems)
|
|
654
|
+
- Identify potential over/under-triggering risks
|
|
655
|
+
- Suggest test cases based on the skill's stated purpose
|
|
656
|
+
|
|
657
|
+
**Iterative improvement:**
|
|
658
|
+
|
|
659
|
+
- After using your skill and encountering edge cases or failures, bring those examples back to skill-creator
|
|
660
|
+
- Example: "Use the issues & solution identified in this chat to improve how the skill handles [specific edge case]"
|
|
661
|
+
|
|
662
|
+
**Advanced features** (in the skill-creator source):
|
|
663
|
+
|
|
664
|
+
- **agents/ directory** with specialized subagent prompts for grading, blind comparison, and post-hoc analysis
|
|
665
|
+
- **Workspace iteration structure** organizing results by iteration (`iteration-1/`, `iteration-2/`) with per-eval
|
|
666
|
+
directories containing `with_skill/` and `without_skill/` outputs
|
|
667
|
+
- **Eval viewer** (`generate_review.py`) that builds an interactive HTML viewer with output review, feedback textboxes,
|
|
668
|
+
and benchmark statistics
|
|
669
|
+
- **`.skill` packaging** (`package_skill.py`) that validates and packages skills as distributable ZIP files
|
|
670
|
+
|
|
671
|
+
**To use:**
|
|
672
|
+
|
|
673
|
+
```
|
|
674
|
+
"Use the skill-creator skill to help me build a skill for
|
|
675
|
+
[your use case]"
|
|
676
|
+
```
|
|
677
|
+
|
|
678
|
+
*Note: skill-creator helps you design and refine skills but does not execute automated test suites or produce
|
|
679
|
+
quantitative evaluation results.*
|
|
680
|
+
|
|
681
|
+
### Iteration based on feedback
|
|
682
|
+
|
|
683
|
+
Skills are living documents. Plan to iterate based on:
|
|
684
|
+
|
|
685
|
+
**Undertriggering signals:**
|
|
686
|
+
|
|
687
|
+
- Skill doesn't load when it should
|
|
688
|
+
- Users manually enabling it
|
|
689
|
+
- Support questions about when to use it
|
|
690
|
+
|
|
691
|
+
> **Solution:** Add more detail and nuance to the description - this may include keywords particularly for technical
|
|
692
|
+
> terms. See Combating undertriggering above.
|
|
693
|
+
|
|
694
|
+
**Overtriggering signals:**
|
|
695
|
+
|
|
696
|
+
- Skill loads for irrelevant queries
|
|
697
|
+
- Users disabling it
|
|
698
|
+
- Confusion about purpose
|
|
699
|
+
|
|
700
|
+
> **Solution:** Add negative triggers, be more specific
|
|
701
|
+
|
|
702
|
+
#### Improvement philosophy
|
|
703
|
+
|
|
704
|
+
When iterating on a skill based on test feedback:
|
|
705
|
+
|
|
706
|
+
1. **Generalize from feedback.** Skills may be used millions of times across many different prompts. You and the user
|
|
707
|
+
are iterating on only a few examples because it is faster, but if the skill works only for those examples, it is
|
|
708
|
+
useless. Rather than fiddly, overfitty changes or oppressively constrictive MUSTs, try branching out with different
|
|
709
|
+
metaphors or recommending different patterns of working.
|
|
710
|
+
|
|
711
|
+
2. **Keep the prompt lean.** Remove instructions that are not pulling their weight. Read the transcripts, not just the
|
|
712
|
+
final outputs -- if the skill is making the model waste time on unproductive steps, remove those parts.
|
|
713
|
+
|
|
714
|
+
3. **Look for repeated work across test runs.** See "Extract bundled scripts from repeated work" above.
|
|
715
|
+
|
|
716
|
+
### Automated description optimization
|
|
717
|
+
|
|
718
|
+
For systematic improvement of skill triggering accuracy (requires Claude Code with `claude -p`):
|
|
719
|
+
|
|
720
|
+
1. **Create eval queries** -- Generate ~20 queries: half should-trigger, half should-not-trigger. Make them realistic
|
|
721
|
+
with concrete details (file paths, personal context, typos, casual speech). The most valuable negative cases are
|
|
722
|
+
near-misses -- queries that share keywords but need something different.
|
|
723
|
+
|
|
724
|
+
2. **Train/test split** -- Split 60% train, 40% held-out test to prevent overfitting. The optimization loop only sees
|
|
725
|
+
train results; test scores select the best description.
|
|
726
|
+
|
|
727
|
+
3. **Optimization loop** -- Evaluate current description (running each query 3x for reliability), call Claude to propose
|
|
728
|
+
improvements based on failures, re-evaluate, iterate up to 5 times. Best description selected by test score, not
|
|
729
|
+
train score.
|
|
730
|
+
|
|
731
|
+
4. **Metrics** -- Track precision (correct triggers / total triggers), recall (correct triggers / should-trigger),
|
|
732
|
+
accuracy (all correct / total). Description must stay under 1024 characters.
|
|
733
|
+
|
|
734
|
+
The skill-creator includes a ready-made optimization loop (`scripts/run_loop.py`) that handles this automatically. See
|
|
735
|
+
the [skill-creator source](https://github.com/anthropics/skills/tree/main/skills/skill-creator) for details.
|
|
736
|
+
|
|
737
|
+
---
|
|
738
|
+
|
|
739
|
+
## Chapter 4: Distribution and sharing
|
|
740
|
+
|
|
741
|
+
Skills complement MCP integrations by packaging workflow guidance alongside tool access.
|
|
742
|
+
|
|
743
|
+
### Where skills live
|
|
744
|
+
|
|
745
|
+
Where you store a skill determines who can use it:
|
|
746
|
+
|
|
747
|
+
| Location | Path | Applies to |
|
|
748
|
+
| ---------- | ---------------------------------------- | ------------------------------ |
|
|
749
|
+
| Enterprise | Managed settings | All users in your organization |
|
|
750
|
+
| Personal | `~/.claude/skills/<skill-name>/SKILL.md` | All your projects |
|
|
751
|
+
| Project | `.claude/skills/<skill-name>/SKILL.md` | This project only |
|
|
752
|
+
| Plugin | `<plugin>/skills/<skill-name>/SKILL.md` | Where plugin is enabled |
|
|
753
|
+
|
|
754
|
+
Higher-priority locations win: enterprise > personal > project. Plugin skills use a `plugin-name:skill-name` namespace,
|
|
755
|
+
so they cannot conflict with other levels.
|
|
756
|
+
|
|
757
|
+
**Commands merged into skills:** Files at `.claude/commands/deploy.md` and skills at `.claude/skills/deploy/SKILL.md`
|
|
758
|
+
both create `/deploy`. Existing `.claude/commands/` files keep working, but if a skill and a command share the same
|
|
759
|
+
name, the skill takes precedence. Skills are recommended since they support additional features like supporting files
|
|
760
|
+
and frontmatter.
|
|
761
|
+
|
|
762
|
+
**Skills via `--add-dir`:** Skills in `.claude/skills/` within directories added via `--add-dir` are loaded
|
|
763
|
+
automatically and picked up by live change detection -- you can edit them during a session without restarting.
|
|
764
|
+
|
|
765
|
+
### Current distribution model (January 2026)
|
|
766
|
+
|
|
767
|
+
Individuals either upload a zipped skill to Claude.ai or place it in a Claude Code skills directory. Organizations can
|
|
768
|
+
deploy skills workspace-wide with automatic updates and centralized management.
|
|
769
|
+
|
|
770
|
+
**`.skill` packaging:** The skill-creator includes a `package_skill.py` script that validates the skill structure and
|
|
771
|
+
frontmatter, excludes build artifacts (`__pycache__`, `node_modules`, `evals/`), and produces a distributable `.skill`
|
|
772
|
+
file (ZIP format) that users can upload to Claude.ai or share directly. Note: the packager's validator hard-requires
|
|
773
|
+
`name` and `description` and may reject extended Claude Code-only frontmatter fields (`disable-model-invocation`,
|
|
774
|
+
`context`, `agent`, `effort`, etc.). If packaging a Claude Code skill with extended fields, validate manually or update
|
|
775
|
+
the packager's allowlist.
|
|
776
|
+
|
|
777
|
+
### An open standard
|
|
778
|
+
|
|
779
|
+
[Agent Skills](https://agentskills.io/home) is an open standard intended to keep skills portable across tools and
|
|
780
|
+
platforms. Authors can use the `compatibility` field when a skill depends on platform-specific features. Claude Code
|
|
781
|
+
adds features like invocation control, subagent execution, and dynamic context injection (see Chapter 6).
|
|
782
|
+
|
|
783
|
+
### Using skills via API
|
|
784
|
+
|
|
785
|
+
For programmatic use cases -- building applications, agents, or automated workflows with skills -- the API provides
|
|
786
|
+
direct control over skill management and execution.
|
|
787
|
+
|
|
788
|
+
**Key capabilities:**
|
|
789
|
+
|
|
790
|
+
- `/v1/skills` endpoint for listing and managing skills
|
|
791
|
+
- Add skills to Messages API requests via the `container.skills` parameter
|
|
792
|
+
- Version control and management through the Claude Console
|
|
793
|
+
- Works with the Claude Agent SDK for building custom agents
|
|
794
|
+
|
|
795
|
+
**Note:** Skills in the API require the Code Execution Tool beta, which provides the secure environment skills need to
|
|
796
|
+
run.
|
|
797
|
+
|
|
798
|
+
References:
|
|
799
|
+
|
|
800
|
+
- [Skills API Quickstart](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/quickstart)
|
|
801
|
+
- [Create Custom skills](https://docs.claude.com/en/api/skills/create-skill)
|
|
802
|
+
- [Skills in the Agent SDK](https://docs.claude.com/en/docs/agent-sdk/skills)
|
|
803
|
+
|
|
804
|
+
**When to use skills via the API vs. Claude.ai:**
|
|
805
|
+
|
|
806
|
+
| Use Case | Best Surface |
|
|
807
|
+
| ----------------------------------------------- | ----------------------- |
|
|
808
|
+
| End users interacting with skills directly | Claude.ai / Claude Code |
|
|
809
|
+
| Manual testing and iteration during development | Claude.ai / Claude Code |
|
|
810
|
+
| Individual, ad-hoc workflows | Claude.ai / Claude Code |
|
|
811
|
+
| Applications using skills programmatically | API |
|
|
812
|
+
| Production deployments at scale | API |
|
|
813
|
+
| Automated pipelines and agent systems | API |
|
|
814
|
+
|
|
815
|
+
### External publishing (optional)
|
|
816
|
+
|
|
817
|
+
If you're publishing a skill externally:
|
|
818
|
+
|
|
819
|
+
- Host it in a public GitHub repo with a human-facing README and screenshots
|
|
820
|
+
- Link it from MCP documentation and include concise installation steps
|
|
821
|
+
- Describe outcomes and workflows, not folder structure or frontmatter mechanics
|
|
822
|
+
- If both MCP and skills are involved, explain the split: MCP provides tool access; skills encode workflow
|
|
823
|
+
|
|
824
|
+
---
|
|
825
|
+
|
|
826
|
+
## Chapter 5: Patterns and troubleshooting
|
|
827
|
+
|
|
828
|
+
These patterns emerged from skills created by early adopters and internal teams. They represent common approaches we've
|
|
829
|
+
seen work well, not prescriptive templates.
|
|
830
|
+
|
|
831
|
+
### Choosing your approach: Problem-first vs. tool-first
|
|
832
|
+
|
|
833
|
+
Think of it like Home Depot. You might walk in with a problem - "I need to fix a kitchen cabinet" - and an employee
|
|
834
|
+
points you to the right tools. Or you might pick out a new drill and ask how to use it for your specific job.
|
|
835
|
+
|
|
836
|
+
Skills work the same way:
|
|
837
|
+
|
|
838
|
+
- **Problem-first:** "I need to set up a project workspace" -> Your skill orchestrates the right MCP calls in the right
|
|
839
|
+
sequence. Users describe outcomes; the skill handles the tools.
|
|
840
|
+
- **Tool-first:** "I have Notion MCP connected" -> Your skill teaches Claude the optimal workflows and best practices.
|
|
841
|
+
Users have access; the skill provides expertise.
|
|
842
|
+
|
|
843
|
+
Most skills lean one direction. Knowing which framing fits your use case helps you choose the right pattern below.
|
|
844
|
+
|
|
845
|
+
### Pattern 1: Sequential workflow orchestration
|
|
846
|
+
|
|
847
|
+
**Use when:** Your users need multi-step processes in a specific order.
|
|
848
|
+
|
|
849
|
+
**Example structure:**
|
|
850
|
+
|
|
851
|
+
```markdown
|
|
852
|
+
## Workflow: Onboard New Customer
|
|
853
|
+
### Step 1: Create Account
|
|
854
|
+
Call MCP tool: `create_customer`
|
|
855
|
+
Parameters: name, email, company
|
|
856
|
+
|
|
857
|
+
### Step 2: Setup Payment
|
|
858
|
+
Call MCP tool: `setup_payment_method`
|
|
859
|
+
Wait for: payment method verification
|
|
860
|
+
|
|
861
|
+
### Step 3: Create Subscription
|
|
862
|
+
Call MCP tool: `create_subscription`
|
|
863
|
+
Parameters: plan_id, customer_id (from Step 1)
|
|
864
|
+
|
|
865
|
+
### Step 4: Send Welcome Email
|
|
866
|
+
Call MCP tool: `send_email`
|
|
867
|
+
Template: welcome_email_template
|
|
868
|
+
```
|
|
869
|
+
|
|
870
|
+
**Key techniques:**
|
|
871
|
+
|
|
872
|
+
- Explicit step ordering
|
|
873
|
+
- Dependencies between steps
|
|
874
|
+
- Validation at each stage
|
|
875
|
+
- Rollback instructions for failures
|
|
876
|
+
|
|
877
|
+
### Pattern 2: Multi-MCP coordination
|
|
878
|
+
|
|
879
|
+
**Use when:** Workflows span multiple services.
|
|
880
|
+
|
|
881
|
+
**Example: Design-to-development handoff**
|
|
882
|
+
|
|
883
|
+
```markdown
|
|
884
|
+
### Phase 1: Design Export (Figma MCP)
|
|
885
|
+
1. Export design assets from Figma
|
|
886
|
+
2. Generate design specifications
|
|
887
|
+
3. Create asset manifest
|
|
888
|
+
|
|
889
|
+
### Phase 2: Asset Storage (Drive MCP)
|
|
890
|
+
1. Create project folder in Drive
|
|
891
|
+
2. Upload all assets
|
|
892
|
+
3. Generate shareable links
|
|
893
|
+
|
|
894
|
+
### Phase 3: Task Creation (Linear MCP)
|
|
895
|
+
1. Create development tasks
|
|
896
|
+
2. Attach asset links to tasks
|
|
897
|
+
3. Assign to engineering team
|
|
898
|
+
|
|
899
|
+
### Phase 4: Notification (Slack MCP)
|
|
900
|
+
1. Post handoff summary to #engineering
|
|
901
|
+
2. Include asset links and task references
|
|
902
|
+
```
|
|
903
|
+
|
|
904
|
+
**Key techniques:**
|
|
905
|
+
|
|
906
|
+
- Clear phase separation
|
|
907
|
+
- Data passing between MCPs
|
|
908
|
+
- Validation before moving to next phase
|
|
909
|
+
- Centralized error handling
|
|
910
|
+
|
|
911
|
+
### Pattern 3: Iterative refinement
|
|
912
|
+
|
|
913
|
+
**Use when:** Output quality improves with iteration.
|
|
914
|
+
|
|
915
|
+
**Example: Report generation**
|
|
916
|
+
|
|
917
|
+
```markdown
|
|
918
|
+
## Iterative Report Creation
|
|
919
|
+
### Initial Draft
|
|
920
|
+
1. Fetch data via MCP
|
|
921
|
+
2. Generate first draft report
|
|
922
|
+
3. Save to temporary file
|
|
923
|
+
|
|
924
|
+
### Quality Check
|
|
925
|
+
1. Run validation script: `scripts/check_report.py`
|
|
926
|
+
2. Identify issues:
|
|
927
|
+
- Missing sections
|
|
928
|
+
- Inconsistent formatting
|
|
929
|
+
- Data validation errors
|
|
930
|
+
|
|
931
|
+
### Refinement Loop
|
|
932
|
+
1. Address each identified issue
|
|
933
|
+
2. Regenerate affected sections
|
|
934
|
+
3. Re-validate
|
|
935
|
+
4. Repeat until quality threshold met
|
|
936
|
+
|
|
937
|
+
### Finalization
|
|
938
|
+
1. Apply final formatting
|
|
939
|
+
2. Generate summary
|
|
940
|
+
3. Save final version
|
|
941
|
+
```
|
|
942
|
+
|
|
943
|
+
**Key techniques:**
|
|
944
|
+
|
|
945
|
+
- Explicit quality criteria
|
|
946
|
+
- Iterative improvement
|
|
947
|
+
- Validation scripts
|
|
948
|
+
- Know when to stop iterating
|
|
949
|
+
|
|
950
|
+
### Pattern 4: Context-aware tool selection
|
|
951
|
+
|
|
952
|
+
**Use when:** Same outcome, different tools depending on context.
|
|
953
|
+
|
|
954
|
+
**Example: File storage**
|
|
955
|
+
|
|
956
|
+
```markdown
|
|
957
|
+
## Smart File Storage
|
|
958
|
+
### Decision Tree
|
|
959
|
+
1. Check file type and size
|
|
960
|
+
2. Determine best storage location:
|
|
961
|
+
- Large files (>10MB): Use cloud storage MCP
|
|
962
|
+
- Collaborative docs: Use Notion/Docs MCP
|
|
963
|
+
- Code files: Use GitHub MCP
|
|
964
|
+
- Temporary files: Use local storage
|
|
965
|
+
|
|
966
|
+
### Execute Storage
|
|
967
|
+
Based on decision:
|
|
968
|
+
- Call appropriate MCP tool
|
|
969
|
+
- Apply service-specific metadata
|
|
970
|
+
- Generate access link
|
|
971
|
+
|
|
972
|
+
### Provide Context to User
|
|
973
|
+
Explain why that storage was chosen
|
|
974
|
+
```
|
|
975
|
+
|
|
976
|
+
**Key techniques:**
|
|
977
|
+
|
|
978
|
+
- Clear decision criteria
|
|
979
|
+
- Fallback options
|
|
980
|
+
- Transparency about choices
|
|
981
|
+
|
|
982
|
+
### Pattern 5: Domain-specific intelligence
|
|
983
|
+
|
|
984
|
+
**Use when:** Your skill adds specialized knowledge beyond tool access.
|
|
985
|
+
|
|
986
|
+
**Example: Financial compliance**
|
|
987
|
+
|
|
988
|
+
```markdown
|
|
989
|
+
## Payment Processing with Compliance
|
|
990
|
+
### Before Processing (Compliance Check)
|
|
991
|
+
1. Fetch transaction details via MCP
|
|
992
|
+
2. Apply compliance rules:
|
|
993
|
+
- Check sanctions lists
|
|
994
|
+
- Verify jurisdiction allowances
|
|
995
|
+
- Assess risk level
|
|
996
|
+
3. Document compliance decision
|
|
997
|
+
|
|
998
|
+
### Processing
|
|
999
|
+
IF compliance passed:
|
|
1000
|
+
- Call payment processing MCP tool
|
|
1001
|
+
- Apply appropriate fraud checks
|
|
1002
|
+
- Process transaction
|
|
1003
|
+
ELSE:
|
|
1004
|
+
- Flag for review
|
|
1005
|
+
- Create compliance case
|
|
1006
|
+
|
|
1007
|
+
### Audit Trail
|
|
1008
|
+
- Log all compliance checks
|
|
1009
|
+
- Record processing decisions
|
|
1010
|
+
- Generate audit report
|
|
1011
|
+
```
|
|
1012
|
+
|
|
1013
|
+
**Key techniques:**
|
|
1014
|
+
|
|
1015
|
+
- Domain expertise embedded in logic
|
|
1016
|
+
- Compliance before action
|
|
1017
|
+
- Full audit trail
|
|
1018
|
+
- Clear governance
|
|
1019
|
+
|
|
1020
|
+
### Pattern 6: Subagent delegation
|
|
1021
|
+
|
|
1022
|
+
**Use when:** Your skill needs to delegate specialized evaluation, analysis, or comparison tasks to independent agents.
|
|
1023
|
+
|
|
1024
|
+
**Example structure:**
|
|
1025
|
+
|
|
1026
|
+
```
|
|
1027
|
+
my-evaluator-skill/
|
|
1028
|
+
SKILL.md
|
|
1029
|
+
agents/
|
|
1030
|
+
grader.md # Evaluates assertions against outputs
|
|
1031
|
+
comparator.md # Blind A/B quality comparison
|
|
1032
|
+
analyzer.md # Post-hoc analysis of why winner won
|
|
1033
|
+
```
|
|
1034
|
+
|
|
1035
|
+
Each agent file is a self-contained prompt with role, inputs, process steps, and structured JSON output format. The main
|
|
1036
|
+
skill reads the relevant agent file and spawns a subagent with it. In Claude Code, use `context: fork` with the `agent`
|
|
1037
|
+
field to run skills in isolated subagent contexts (see Chapter 6).
|
|
1038
|
+
|
|
1039
|
+
**Key techniques:**
|
|
1040
|
+
|
|
1041
|
+
- Each agent file is a complete, self-contained prompt
|
|
1042
|
+
- Blind comparison prevents bias (comparator judges without knowing which version produced which output)
|
|
1043
|
+
- Structured JSON output schemas enable downstream aggregation and benchmarking
|
|
1044
|
+
- Post-hoc analysis identifies actionable improvement suggestions with priority and category
|
|
1045
|
+
|
|
1046
|
+
### Troubleshooting
|
|
1047
|
+
|
|
1048
|
+
#### Skill won't upload
|
|
1049
|
+
|
|
1050
|
+
**Error: "Could not find SKILL.md in uploaded folder"**
|
|
1051
|
+
|
|
1052
|
+
Cause: File not named exactly SKILL.md
|
|
1053
|
+
|
|
1054
|
+
**Solution:**
|
|
1055
|
+
|
|
1056
|
+
- Rename to SKILL.md (case-sensitive)
|
|
1057
|
+
- Verify with: `ls -la` should show SKILL.md
|
|
1058
|
+
|
|
1059
|
+
**Error: "Invalid frontmatter"**
|
|
1060
|
+
|
|
1061
|
+
Cause: YAML formatting issue
|
|
1062
|
+
|
|
1063
|
+
Common mistakes:
|
|
1064
|
+
|
|
1065
|
+
```yaml
|
|
1066
|
+
# Wrong - missing delimiters
|
|
1067
|
+
name: my-skill
|
|
1068
|
+
description: Does things
|
|
1069
|
+
|
|
1070
|
+
# Wrong - unclosed quotes
|
|
1071
|
+
name: my-skill
|
|
1072
|
+
description: "Does things
|
|
1073
|
+
|
|
1074
|
+
# Correct
|
|
1075
|
+
---
|
|
1076
|
+
name: my-skill
|
|
1077
|
+
description: Does things
|
|
1078
|
+
---
|
|
1079
|
+
```
|
|
1080
|
+
|
|
1081
|
+
**Error: "Invalid skill name"**
|
|
1082
|
+
|
|
1083
|
+
Cause: Name has spaces or capitals
|
|
1084
|
+
|
|
1085
|
+
```yaml
|
|
1086
|
+
# Wrong
|
|
1087
|
+
name: My Cool Skill
|
|
1088
|
+
|
|
1089
|
+
# Correct
|
|
1090
|
+
name: my-cool-skill
|
|
1091
|
+
```
|
|
1092
|
+
|
|
1093
|
+
#### Skill doesn't trigger
|
|
1094
|
+
|
|
1095
|
+
**Symptom:** Skill never loads automatically
|
|
1096
|
+
|
|
1097
|
+
**Fix:** Revise your description field. See The Description Field and Combating undertriggering for good/bad examples.
|
|
1098
|
+
|
|
1099
|
+
**Quick checklist:**
|
|
1100
|
+
|
|
1101
|
+
- Is it too generic? ("Helps with projects" won't work)
|
|
1102
|
+
- Does it include trigger phrases users would actually say?
|
|
1103
|
+
- Does it mention relevant file types if applicable?
|
|
1104
|
+
- Have skill descriptions exceeded the character budget? In Claude Code, run `/context` to check for warnings about
|
|
1105
|
+
excluded skills. Override the limit with `SLASH_COMMAND_TOOL_CHAR_BUDGET`.
|
|
1106
|
+
|
|
1107
|
+
**Debugging approach:** Ask Claude: "When would you use the [skill name] skill?" Claude will quote the description back.
|
|
1108
|
+
Adjust based on what's missing.
|
|
1109
|
+
|
|
1110
|
+
#### Skill triggers too often
|
|
1111
|
+
|
|
1112
|
+
**Symptom:** Skill loads for unrelated queries
|
|
1113
|
+
|
|
1114
|
+
**Solutions:**
|
|
1115
|
+
|
|
1116
|
+
1. **Add negative triggers**
|
|
1117
|
+
|
|
1118
|
+
```yaml
|
|
1119
|
+
description: Advanced data analysis for CSV files. Use for
|
|
1120
|
+
statistical modeling, regression, clustering. Do NOT use for
|
|
1121
|
+
simple data exploration (use data-viz skill instead).
|
|
1122
|
+
```
|
|
1123
|
+
|
|
1124
|
+
2. **Be more specific**
|
|
1125
|
+
|
|
1126
|
+
```yaml
|
|
1127
|
+
# Too broad
|
|
1128
|
+
description: Processes documents
|
|
1129
|
+
|
|
1130
|
+
# More specific
|
|
1131
|
+
description: Processes PDF legal documents for contract review
|
|
1132
|
+
```
|
|
1133
|
+
|
|
1134
|
+
3. **Clarify scope**
|
|
1135
|
+
|
|
1136
|
+
```yaml
|
|
1137
|
+
description: PayFlow payment processing for e-commerce. Use
|
|
1138
|
+
specifically for online payment workflows, not for general
|
|
1139
|
+
financial queries.
|
|
1140
|
+
```
|
|
1141
|
+
|
|
1142
|
+
#### Instructions not followed
|
|
1143
|
+
|
|
1144
|
+
**Symptom:** Skill loads but Claude doesn't follow instructions
|
|
1145
|
+
|
|
1146
|
+
**Common causes:**
|
|
1147
|
+
|
|
1148
|
+
1. **Instructions too verbose**
|
|
1149
|
+
|
|
1150
|
+
- Keep instructions concise
|
|
1151
|
+
- Use bullet points and numbered lists
|
|
1152
|
+
- Move detailed reference to separate files
|
|
1153
|
+
|
|
1154
|
+
2. **Instructions buried**
|
|
1155
|
+
|
|
1156
|
+
- Put critical instructions at the top
|
|
1157
|
+
- Use ## Important or ## Critical headers
|
|
1158
|
+
- Repeat key points if needed
|
|
1159
|
+
|
|
1160
|
+
3. **Ambiguous language**
|
|
1161
|
+
|
|
1162
|
+
```markdown
|
|
1163
|
+
# Bad
|
|
1164
|
+
Make sure to validate things properly
|
|
1165
|
+
|
|
1166
|
+
# Good
|
|
1167
|
+
CRITICAL: Before calling create_project, verify:
|
|
1168
|
+
- Project name is non-empty
|
|
1169
|
+
- At least one team member assigned
|
|
1170
|
+
- Start date is not in the past
|
|
1171
|
+
```
|
|
1172
|
+
|
|
1173
|
+
**Advanced technique:** For critical validations, consider bundling a script that performs the checks programmatically
|
|
1174
|
+
rather than relying on language instructions. Code is deterministic; language interpretation isn't. See the
|
|
1175
|
+
[Office skills](https://github.com/anthropics/skills/tree/main/skills) for examples of this pattern.
|
|
1176
|
+
|
|
1177
|
+
4. **Blunt directives instead of reasoning:** Before adding more ALL CAPS imperatives, try explaining the reasoning
|
|
1178
|
+
behind the instruction. LLMs respond well to understanding *why* something matters, which often produces better
|
|
1179
|
+
compliance than MUST/NEVER directives. See "Explain the why" in Best Practices above.
|
|
1180
|
+
|
|
1181
|
+
5. **Model "laziness"** Add explicit encouragement:
|
|
1182
|
+
|
|
1183
|
+
```markdown
|
|
1184
|
+
## Performance Notes
|
|
1185
|
+
- Take your time to do this thoroughly
|
|
1186
|
+
- Quality is more important than speed
|
|
1187
|
+
- Do not skip validation steps
|
|
1188
|
+
```
|
|
1189
|
+
|
|
1190
|
+
Note: Adding this to user prompts is more effective than in SKILL.md
|
|
1191
|
+
|
|
1192
|
+
#### MCP connection issues
|
|
1193
|
+
|
|
1194
|
+
**Symptom:** Skill loads but MCP calls fail
|
|
1195
|
+
|
|
1196
|
+
**Checklist:**
|
|
1197
|
+
|
|
1198
|
+
1. **Verify MCP server is connected**
|
|
1199
|
+
|
|
1200
|
+
- Claude.ai: Settings > Extensions > [Your Service]
|
|
1201
|
+
- Should show "Connected" status
|
|
1202
|
+
|
|
1203
|
+
2. **Check authentication**
|
|
1204
|
+
|
|
1205
|
+
- API keys valid and not expired
|
|
1206
|
+
- Proper permissions/scopes granted
|
|
1207
|
+
- OAuth tokens refreshed
|
|
1208
|
+
|
|
1209
|
+
3. **Test MCP independently**
|
|
1210
|
+
|
|
1211
|
+
- Ask Claude to call MCP directly (without skill)
|
|
1212
|
+
- "Use [Service] MCP to fetch my projects"
|
|
1213
|
+
- If this fails, issue is MCP not skill
|
|
1214
|
+
|
|
1215
|
+
4. **Verify tool names**
|
|
1216
|
+
|
|
1217
|
+
- Skill references correct MCP tool names
|
|
1218
|
+
- Check MCP server documentation
|
|
1219
|
+
- Tool names are case-sensitive
|
|
1220
|
+
|
|
1221
|
+
#### Large context issues
|
|
1222
|
+
|
|
1223
|
+
**Symptom:** Skill seems slow or responses degraded
|
|
1224
|
+
|
|
1225
|
+
**Causes:**
|
|
1226
|
+
|
|
1227
|
+
- Skill content too large
|
|
1228
|
+
- Too many skills enabled simultaneously
|
|
1229
|
+
- All content loaded instead of progressive disclosure
|
|
1230
|
+
|
|
1231
|
+
**Solutions:**
|
|
1232
|
+
|
|
1233
|
+
1. **Optimize SKILL.md size**
|
|
1234
|
+
|
|
1235
|
+
- Move detailed docs to references/
|
|
1236
|
+
- Link to references instead of inline
|
|
1237
|
+
- Keep SKILL.md under 500 lines / 5,000 words
|
|
1238
|
+
|
|
1239
|
+
2. **Reduce enabled skills**
|
|
1240
|
+
|
|
1241
|
+
- Evaluate if you have more than 20-50 skills enabled simultaneously
|
|
1242
|
+
- Recommend selective enablement
|
|
1243
|
+
- Consider skill "packs" for related capabilities
|
|
1244
|
+
|
|
1245
|
+
---
|
|
1246
|
+
|
|
1247
|
+
## Chapter 6: Claude Code specifics
|
|
1248
|
+
|
|
1249
|
+
Claude Code extends the Agent Skills open standard with platform-specific runtime features. Most of these (string
|
|
1250
|
+
substitutions, `context: fork`, dynamic injection, permission control) are Claude Code-only. A few (`.skill` packaging,
|
|
1251
|
+
skill format itself) work across surfaces. This chapter covers the Claude Code extensions and notes where features cross
|
|
1252
|
+
platform boundaries.
|
|
1253
|
+
|
|
1254
|
+
### String substitutions
|
|
1255
|
+
|
|
1256
|
+
Skills support variable substitution for dynamic values:
|
|
1257
|
+
|
|
1258
|
+
| Variable | Description |
|
|
1259
|
+
| ---------------------- | ------------------------------------------------------------- |
|
|
1260
|
+
| `$ARGUMENTS` | All arguments passed when invoking the skill |
|
|
1261
|
+
| `$ARGUMENTS[N]` | Access a specific argument by 0-based index |
|
|
1262
|
+
| `$N` | Shorthand for `$ARGUMENTS[N]` (e.g., `$0` for first argument) |
|
|
1263
|
+
| `${CLAUDE_SESSION_ID}` | The current session ID |
|
|
1264
|
+
| `${CLAUDE_SKILL_DIR}` | The directory containing the skill's SKILL.md file |
|
|
1265
|
+
|
|
1266
|
+
**Example:**
|
|
1267
|
+
|
|
1268
|
+
```yaml
|
|
1269
|
+
---
|
|
1270
|
+
name: migrate-component
|
|
1271
|
+
description: Migrate a component from one framework to another
|
|
1272
|
+
---
|
|
1273
|
+
Migrate the $0 component from $1 to $2.
|
|
1274
|
+
Preserve all existing behavior and tests.
|
|
1275
|
+
```
|
|
1276
|
+
|
|
1277
|
+
Running `/migrate-component SearchBar React Vue` replaces `$0` with `SearchBar`, `$1` with `React`, `$2` with `Vue`.
|
|
1278
|
+
|
|
1279
|
+
If `$ARGUMENTS` is not present in the skill content, arguments are appended as `ARGUMENTS: <value>`.
|
|
1280
|
+
|
|
1281
|
+
### Dynamic context injection
|
|
1282
|
+
|
|
1283
|
+
The `` !`<command>` `` syntax runs shell commands before the skill content is sent to Claude. The command output
|
|
1284
|
+
replaces the placeholder -- this is preprocessing, not something Claude executes.
|
|
1285
|
+
|
|
1286
|
+
**Example: PR summary skill**
|
|
1287
|
+
|
|
1288
|
+
```yaml
|
|
1289
|
+
---
|
|
1290
|
+
name: pr-summary
|
|
1291
|
+
description: Summarize changes in a pull request
|
|
1292
|
+
context: fork
|
|
1293
|
+
agent: Explore
|
|
1294
|
+
allowed-tools: Bash(gh *)
|
|
1295
|
+
---
|
|
1296
|
+
## Pull request context
|
|
1297
|
+
- PR diff: !`gh pr diff`
|
|
1298
|
+
- PR comments: !`gh pr view --comments`
|
|
1299
|
+
- Changed files: !`gh pr diff --name-only`
|
|
1300
|
+
|
|
1301
|
+
## Your task
|
|
1302
|
+
Summarize this pull request...
|
|
1303
|
+
```
|
|
1304
|
+
|
|
1305
|
+
When this skill runs, each `` !`<command>` `` executes immediately, the output replaces the placeholder, and Claude
|
|
1306
|
+
receives the fully-rendered prompt with actual PR data.
|
|
1307
|
+
|
|
1308
|
+
### Running skills in a subagent
|
|
1309
|
+
|
|
1310
|
+
Add `context: fork` to your frontmatter when you want a skill to run in isolation. The skill content becomes the prompt
|
|
1311
|
+
that drives the subagent -- it will not have access to your conversation history.
|
|
1312
|
+
|
|
1313
|
+
```yaml
|
|
1314
|
+
---
|
|
1315
|
+
name: deep-research
|
|
1316
|
+
description: Research a topic thoroughly
|
|
1317
|
+
context: fork
|
|
1318
|
+
agent: Explore
|
|
1319
|
+
---
|
|
1320
|
+
Research $ARGUMENTS thoroughly:
|
|
1321
|
+
1. Find relevant files using Glob and Grep
|
|
1322
|
+
2. Read and analyze the code
|
|
1323
|
+
3. Summarize findings with specific file references
|
|
1324
|
+
```
|
|
1325
|
+
|
|
1326
|
+
The `agent` field specifies which subagent configuration to use: built-in agents (`Explore`, `Plan`, `general-purpose`)
|
|
1327
|
+
or any custom subagent from `.claude/agents/`. If omitted, uses `general-purpose`.
|
|
1328
|
+
|
|
1329
|
+
**Skills with `context: fork` vs subagents with preloaded skills:**
|
|
1330
|
+
|
|
1331
|
+
| Approach | System prompt | Task | Also loads |
|
|
1332
|
+
| -------------------------- | ----------------------------------------- | ------------------ | ------------------ |
|
|
1333
|
+
| Skill with `context: fork` | From agent type (`Explore`, `Plan`, etc.) | SKILL.md content | CLAUDE.md |
|
|
1334
|
+
| Subagent with `skills` | Subagent's markdown body | Delegation message | Skills + CLAUDE.md |
|
|
1335
|
+
|
|
1336
|
+
**Note:** `context: fork` only makes sense for skills with explicit instructions (tasks). If your skill contains
|
|
1337
|
+
guidelines without a task, the subagent receives guidelines but no actionable prompt and returns without output.
|
|
1338
|
+
|
|
1339
|
+
### Bundled skills
|
|
1340
|
+
|
|
1341
|
+
Claude Code ships with built-in skills available in every session:
|
|
1342
|
+
|
|
1343
|
+
| Skill | Purpose |
|
|
1344
|
+
| --------------------------- | --------------------------------------------------------------------- |
|
|
1345
|
+
| `/batch <instruction>` | Orchestrate large-scale changes across a codebase in parallel |
|
|
1346
|
+
| `/claude-api` | Load Claude API reference material for your project's language |
|
|
1347
|
+
| `/debug [description]` | Troubleshoot your current session by reading the debug log |
|
|
1348
|
+
| `/loop [interval] <prompt>` | Run a prompt repeatedly on an interval while the session stays open |
|
|
1349
|
+
| `/simplify [focus]` | Review recently changed files for code reuse, quality, and efficiency |
|
|
1350
|
+
|
|
1351
|
+
Unlike built-in commands (which execute fixed logic), bundled skills are prompt-based -- they give Claude a playbook and
|
|
1352
|
+
let it orchestrate using its tools.
|
|
1353
|
+
|
|
1354
|
+
### Permission control
|
|
1355
|
+
|
|
1356
|
+
Three ways to control which skills Claude can invoke:
|
|
1357
|
+
|
|
1358
|
+
- **Disable all skills:** Deny the `Skill` tool in `/permissions`
|
|
1359
|
+
- **Allow/deny specific skills:** `Skill(commit)` (exact match) or `Skill(review-pr *)` (prefix match)
|
|
1360
|
+
- **Hide individual skills:** Add `disable-model-invocation: true` to their frontmatter
|
|
1361
|
+
|
|
1362
|
+
### Skill discovery in monorepos
|
|
1363
|
+
|
|
1364
|
+
When you work with files in subdirectories, Claude Code automatically discovers skills from nested `.claude/skills/`
|
|
1365
|
+
directories. For example, editing a file in `packages/frontend/` makes Claude also look for skills in
|
|
1366
|
+
`packages/frontend/.claude/skills/`. This supports monorepo setups where packages have their own skills.
|
|
1367
|
+
|
|
1368
|
+
### Claude.ai vs Claude Code differences
|
|
1369
|
+
|
|
1370
|
+
The core skill format is identical, but runtime features differ by platform:
|
|
1371
|
+
|
|
1372
|
+
| Feature | Claude.ai | Claude Code |
|
|
1373
|
+
| ------------------------------ | --------- | ----------- |
|
|
1374
|
+
| Subagents (parallel test runs) | No | Yes |
|
|
1375
|
+
| `claude -p` trigger testing | No | Yes |
|
|
1376
|
+
| Browser-based eval viewer | No | Yes |
|
|
1377
|
+
| Description optimization loop | No | Yes |
|
|
1378
|
+
| `context: fork` | No | Yes |
|
|
1379
|
+
| Dynamic injection (`` !` `` ) | No | Yes |
|
|
1380
|
+
| String substitutions | No | Yes |
|
|
1381
|
+
| `.skill` packaging | Yes | Yes |
|
|
1382
|
+
| Inline result review | Yes | Yes |
|
|
1383
|
+
|
|
1384
|
+
**Claude.ai adaptations:** No subagents means no parallel execution -- run test cases one at a time. Skip baseline runs
|
|
1385
|
+
and quantitative benchmarking. Present results directly in conversation and ask for feedback inline.
|
|
1386
|
+
|
|
1387
|
+
---
|
|
1388
|
+
|
|
1389
|
+
## Chapter 7: Resources and references
|
|
1390
|
+
|
|
1391
|
+
If you're building your first skill, start with the Best Practices Guide, then reference the API docs as needed.
|
|
1392
|
+
|
|
1393
|
+
### Official Documentation
|
|
1394
|
+
|
|
1395
|
+
**Anthropic Resources:**
|
|
1396
|
+
|
|
1397
|
+
- [Best Practices Guide](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices)
|
|
1398
|
+
- [Skills Documentation](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview)
|
|
1399
|
+
- [Claude Code Skills](https://code.claude.com/docs/en/skills) -- extended frontmatter, subagents, string substitutions,
|
|
1400
|
+
dynamic injection
|
|
1401
|
+
- [API Reference](https://platform.claude.com/docs/en/api/overview)
|
|
1402
|
+
- [MCP Documentation](https://modelcontextprotocol.io)
|
|
1403
|
+
|
|
1404
|
+
**Blog Posts:**
|
|
1405
|
+
|
|
1406
|
+
- [Introducing Agent Skills](https://claude.com/blog/skills)
|
|
1407
|
+
- [Engineering Blog: Equipping Agents for the Real World](https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills)
|
|
1408
|
+
- [Skills Explained](https://www.claude.com/blog/skills-explained)
|
|
1409
|
+
- [How to Create Skills for Claude](https://www.claude.com/blog/how-to-create-skills-key-steps-limitations-and-examples)
|
|
1410
|
+
- [Building Skills for Claude Code](https://www.claude.com/blog/building-skills-for-claude-code)
|
|
1411
|
+
- [Improving Frontend Design through Skills](https://www.claude.com/blog/improving-frontend-design-through-skills)
|
|
1412
|
+
|
|
1413
|
+
### Example skills
|
|
1414
|
+
|
|
1415
|
+
**Public skills repository:**
|
|
1416
|
+
|
|
1417
|
+
- GitHub: [anthropics/skills](https://github.com/anthropics/skills)
|
|
1418
|
+
- Contains Anthropic-created skills you can customize
|
|
1419
|
+
|
|
1420
|
+
### Tools and Utilities
|
|
1421
|
+
|
|
1422
|
+
**skill-creator skill:**
|
|
1423
|
+
|
|
1424
|
+
- Source:
|
|
1425
|
+
[anthropics/skills/tree/main/skills/skill-creator](https://github.com/anthropics/skills/tree/main/skills/skill-creator)
|
|
1426
|
+
- Built into Claude.ai and available for Claude Code
|
|
1427
|
+
- Includes: eval infrastructure (agents/, eval-viewer, benchmarking), description optimization loop
|
|
1428
|
+
(`scripts/run_loop.py`), blind A/B comparison (`agents/comparator.md`), `.skill` packaging
|
|
1429
|
+
(`scripts/package_skill.py`)
|
|
1430
|
+
- Use: "Help me build a skill using skill-creator"
|
|
1431
|
+
|
|
1432
|
+
**Validation:**
|
|
1433
|
+
|
|
1434
|
+
- skill-creator can assess your skills
|
|
1435
|
+
- Ask: "Review this skill and suggest improvements"
|
|
1436
|
+
|
|
1437
|
+
### Getting Support
|
|
1438
|
+
|
|
1439
|
+
**For Technical Questions:**
|
|
1440
|
+
|
|
1441
|
+
- General questions: Community forums at the [Claude Developers Discord](https://discord.com/invite/6PPFFzqPDZ)
|
|
1442
|
+
|
|
1443
|
+
**For Bug Reports:**
|
|
1444
|
+
|
|
1445
|
+
- GitHub Issues: [anthropics/skills/issues](https://github.com/anthropics/skills/issues)
|
|
1446
|
+
- Include: Skill name, error message, steps to reproduce
|
|
1447
|
+
|
|
1448
|
+
---
|
|
1449
|
+
|
|
1450
|
+
## Reference A: Quick checklist
|
|
1451
|
+
|
|
1452
|
+
Use this checklist to validate your skill before and after upload. If you want a faster start, use the skill-creator
|
|
1453
|
+
skill to generate your first draft, then run through this list to make sure you haven't missed anything.
|
|
1454
|
+
|
|
1455
|
+
### Before you start
|
|
1456
|
+
|
|
1457
|
+
- [ ] Identified 2-3 concrete use cases
|
|
1458
|
+
- [ ] Tools identified (built-in or MCP)
|
|
1459
|
+
- [ ] Reviewed this guide and example skills
|
|
1460
|
+
- [ ] Planned folder structure
|
|
1461
|
+
|
|
1462
|
+
### During development
|
|
1463
|
+
|
|
1464
|
+
- [ ] Folder named in kebab-case
|
|
1465
|
+
- [ ] SKILL.md file exists (exact spelling)
|
|
1466
|
+
- [ ] YAML frontmatter has `---` delimiters
|
|
1467
|
+
- [ ] name field: kebab-case, no spaces, no capitals
|
|
1468
|
+
- [ ] description includes WHAT and WHEN, under 1024 characters
|
|
1469
|
+
- [ ] No XML tags (< >) anywhere
|
|
1470
|
+
- [ ] Instructions are clear and actionable (explain the why)
|
|
1471
|
+
- [ ] Error handling included
|
|
1472
|
+
- [ ] Examples provided
|
|
1473
|
+
- [ ] References clearly linked
|
|
1474
|
+
- [ ] Considered `disable-model-invocation` for side-effect skills
|
|
1475
|
+
- [ ] Considered `context: fork` for isolated execution (Claude Code)
|
|
1476
|
+
|
|
1477
|
+
### Before upload
|
|
1478
|
+
|
|
1479
|
+
- [ ] Tested triggering on obvious tasks
|
|
1480
|
+
- [ ] Tested triggering on paraphrased requests
|
|
1481
|
+
- [ ] Verified doesn't trigger on unrelated topics
|
|
1482
|
+
- [ ] Functional tests pass
|
|
1483
|
+
- [ ] Tool integration works (if applicable)
|
|
1484
|
+
- [ ] Compressed as .zip file
|
|
1485
|
+
|
|
1486
|
+
### After upload
|
|
1487
|
+
|
|
1488
|
+
- [ ] Test in real conversations
|
|
1489
|
+
- [ ] Monitor for under/over-triggering
|
|
1490
|
+
- [ ] Collect user feedback
|
|
1491
|
+
- [ ] Iterate on description and instructions
|
|
1492
|
+
- [ ] Update version in metadata
|
|
1493
|
+
|
|
1494
|
+
---
|
|
1495
|
+
|
|
1496
|
+
## Reference B: YAML frontmatter
|
|
1497
|
+
|
|
1498
|
+
### Required fields
|
|
1499
|
+
|
|
1500
|
+
```yaml
|
|
1501
|
+
---
|
|
1502
|
+
name: skill-name-in-kebab-case
|
|
1503
|
+
description: What it does and when to use it. Include specific
|
|
1504
|
+
trigger phrases.
|
|
1505
|
+
---
|
|
1506
|
+
```
|
|
1507
|
+
|
|
1508
|
+
### All fields
|
|
1509
|
+
|
|
1510
|
+
```yaml
|
|
1511
|
+
---
|
|
1512
|
+
# Identity (required for cross-platform; Claude Code defaults name to directory name)
|
|
1513
|
+
name: skill-name # kebab-case, max 64 chars
|
|
1514
|
+
description: [what + when] # under 1024 chars, no XML tags
|
|
1515
|
+
|
|
1516
|
+
# Invocation control (Claude Code)
|
|
1517
|
+
disable-model-invocation: true # prevent Claude from auto-loading
|
|
1518
|
+
user-invocable: false # hide from / menu
|
|
1519
|
+
argument-hint: "[issue-number]" # autocomplete hint
|
|
1520
|
+
|
|
1521
|
+
# Execution (Claude Code)
|
|
1522
|
+
context: fork # run in isolated subagent
|
|
1523
|
+
agent: Explore # subagent type (Explore, Plan, general-purpose, or custom)
|
|
1524
|
+
model: claude-sonnet-4-6 # model override
|
|
1525
|
+
effort: high # effort override (low, medium, high, max)
|
|
1526
|
+
allowed-tools: "Read Grep Glob" # restrict tool access
|
|
1527
|
+
hooks: {} # hooks scoped to skill lifecycle
|
|
1528
|
+
|
|
1529
|
+
# Distribution
|
|
1530
|
+
license: MIT # open-source license
|
|
1531
|
+
compatibility: "Claude Code" # environment requirements (1-500 chars)
|
|
1532
|
+
metadata: # custom key-value pairs
|
|
1533
|
+
author: Company Name
|
|
1534
|
+
version: 1.0.0
|
|
1535
|
+
mcp-server: server-name
|
|
1536
|
+
category: productivity
|
|
1537
|
+
tags: [project-management, automation]
|
|
1538
|
+
documentation: https://example.com/docs
|
|
1539
|
+
support: support@example.com
|
|
1540
|
+
---
|
|
1541
|
+
```
|
|
1542
|
+
|
|
1543
|
+
### Security notes
|
|
1544
|
+
|
|
1545
|
+
**Allowed:**
|
|
1546
|
+
|
|
1547
|
+
- Any standard YAML types (strings, numbers, booleans, lists, objects)
|
|
1548
|
+
- Custom metadata fields
|
|
1549
|
+
- Long descriptions (up to 1024 characters)
|
|
1550
|
+
|
|
1551
|
+
**Forbidden:**
|
|
1552
|
+
|
|
1553
|
+
- XML angle brackets (< >) - security restriction
|
|
1554
|
+
- Code execution in YAML (uses safe YAML parsing)
|
|
1555
|
+
- Skills named with "claude" or "anthropic" prefix (reserved)
|
|
1556
|
+
|
|
1557
|
+
---
|
|
1558
|
+
|
|
1559
|
+
## Reference C: Complete skill examples
|
|
1560
|
+
|
|
1561
|
+
For full, production-ready skills demonstrating the patterns in this guide:
|
|
1562
|
+
|
|
1563
|
+
- Document Skills - [PDF](https://github.com/anthropics/skills/tree/main/skills/pdf),
|
|
1564
|
+
[DOCX](https://github.com/anthropics/skills/tree/main/skills/docx),
|
|
1565
|
+
[PPTX](https://github.com/anthropics/skills/tree/main/skills/pptx),
|
|
1566
|
+
[XLSX](https://github.com/anthropics/skills/tree/main/skills/xlsx) creation
|
|
1567
|
+
- [Example Skills](https://github.com/anthropics/skills/tree/main/skills) - Various workflow patterns
|
|
1568
|
+
- [Partner Skills Directory](https://www.claude.com/connectors) - View skills from various partners such as Asana,
|
|
1569
|
+
Atlassian, Canva, Figma, Sentry, Zapier, and more
|
|
1570
|
+
|
|
1571
|
+
These repositories stay up-to-date and include additional examples beyond what's covered here. Clone them, modify them
|
|
1572
|
+
for your use case, and use them as templates.
|
|
1573
|
+
|
|
1574
|
+
---
|
|
1575
|
+
|
|
1576
|
+
## Sources
|
|
1577
|
+
|
|
1578
|
+
This guide synthesizes content from three sources:
|
|
1579
|
+
|
|
1580
|
+
- **Anthropic's official skills guide** (PDF, January 2026) -- the foundation for chapters 1-5 and the reference
|
|
1581
|
+
appendices
|
|
1582
|
+
- **skill-creator skill**
|
|
1583
|
+
([anthropics/skills/tree/main/skills/skill-creator](https://github.com/anthropics/skills/tree/main/skills/skill-creator))
|
|
1584
|
+
-- eval infrastructure, blind A/B comparison, description optimization loop, improvement philosophy, practical
|
|
1585
|
+
skill-writing guidance
|
|
1586
|
+
- **Claude Code skills documentation** ([code.claude.com/docs/en/skills](https://code.claude.com/docs/en/skills)) --
|
|
1587
|
+
extended frontmatter fields, string substitutions, subagent execution, dynamic context injection, bundled skills,
|
|
1588
|
+
permission control, monorepo discovery
|