@phuc1403/musketeer 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTALLATION.md +22 -0
- package/LICENSE +21 -0
- package/README.md +38 -0
- package/bin/musketeer.js +72 -0
- package/manifest.json +238 -0
- package/package.json +46 -0
- package/src/copier.js +119 -0
- package/src/lockfile.js +61 -0
- package/src/manifest-loader.js +46 -0
- package/src/muster.js +48 -0
- package/src/provisioner/detect.js +93 -0
- package/src/provisioner/guide.js +32 -0
- package/src/provisioner/index.js +113 -0
- package/src/provisioner/mcp.js +26 -0
- package/src/provisioner/os-package-manager.js +71 -0
- package/src/provisioner/venv.js +44 -0
- package/src/reconcile.js +94 -0
- package/src/resolver.js +130 -0
- package/src/schema.js +152 -0
- package/src/settings-merger.js +0 -0
- package/template/.claude/agents/code-reviewer.md +166 -0
- package/template/.claude/agents/hallmark-auditor.md +78 -0
- package/template/.claude/agents/hallmark-explorer.md +81 -0
- package/template/.claude/agents/researcher.md +33 -0
- package/template/.claude/hooks/block-migration-edits.cjs +31 -0
- package/template/.claude/hooks/format-json-hook.js +91 -0
- package/template/.claude/hooks/inject-design-docs.cjs +86 -0
- package/template/.claude/hooks/lib/colors.cjs +122 -0
- package/template/.claude/hooks/lib/git-info-cache.cjs +191 -0
- package/template/.claude/hooks/lib/transcript-parser.cjs +277 -0
- package/template/.claude/hooks/usage-context-awareness.cjs +166 -0
- package/template/.claude/hooks/validate-cml-hook.js +145 -0
- package/template/.claude/skills/adr-writer/SKILL.md +78 -0
- package/template/.claude/skills/adr-writer/references/adr-example.md +38 -0
- package/template/.claude/skills/adr-writer/references/adr-template.md +46 -0
- package/template/.claude/skills/architecture-characteristic-writer/SKILL.md +117 -0
- package/template/.claude/skills/architecture-characteristic-writer/assets/worksheet-template.md +40 -0
- package/template/.claude/skills/architecture-characteristic-writer/references/characteristics-catalog.md +106 -0
- package/template/.claude/skills/code-review/SKILL.md +54 -0
- package/template/.claude/skills/code-review/references/adversarial-review.md +223 -0
- package/template/.claude/skills/code-review/references/checklists/api.md +52 -0
- package/template/.claude/skills/code-review/references/checklists/base.md +100 -0
- package/template/.claude/skills/code-review/references/checklists/web-app.md +54 -0
- package/template/.claude/skills/context-map/SKILL.md +80 -0
- package/template/.claude/skills/context-map/example.cml +106 -0
- package/template/.claude/skills/context-map/reference/Aggregate/Aggregate.md +1 -0
- package/template/.claude/skills/context-map/reference/Bounded Context/Bounded Context.md +41 -0
- package/template/.claude/skills/context-map/reference/Bounded Context/businessModel.md +6 -0
- package/template/.claude/skills/context-map/reference/Bounded Context/domainVisionStatement.md +3 -0
- package/template/.claude/skills/context-map/reference/Bounded Context/evolution.md +6 -0
- package/template/.claude/skills/context-map/reference/Bounded Context/implementationTechnology.md +1 -0
- package/template/.claude/skills/context-map/reference/Bounded Context/implements.md +1 -0
- package/template/.claude/skills/context-map/reference/Bounded Context/knowledgeLevel.md +5 -0
- package/template/.claude/skills/context-map/reference/Bounded Context/realizes.md +9 -0
- package/template/.claude/skills/context-map/reference/Bounded Context/refines.md +10 -0
- package/template/.claude/skills/context-map/reference/Bounded Context/responsibilities.md +26 -0
- package/template/.claude/skills/context-map/reference/Bounded Context/type.md +23 -0
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Anticorruption Layer.md +5 -0
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Bounded Context Relationship.md +13 -0
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Conformist.md +5 -0
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Customer-Supplier (C-S).md +23 -0
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Open Host Service.md +5 -0
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Partnership (P).md +14 -0
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Published Language.md +5 -0
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Shared Kernel (SK).md +13 -0
- package/template/.claude/skills/context-map/reference/Context Map.md +63 -0
- package/template/.claude/skills/context-map/reference/Domain/Domain.md +30 -0
- package/template/.claude/skills/context-map/reference/Domain/supports.md +34 -0
- package/template/.claude/skills/context-map/reference/Domain/type.md +3 -0
- package/template/.claude/skills/context-map/reference/Semantic Rules.md +33 -0
- package/template/.claude/skills/hallmark/SKILL.md +552 -0
- package/template/.claude/skills/hallmark/references/anti-patterns.md +412 -0
- package/template/.claude/skills/hallmark/references/assets.md +406 -0
- package/template/.claude/skills/hallmark/references/color.md +95 -0
- package/template/.claude/skills/hallmark/references/component-cookbook.md +256 -0
- package/template/.claude/skills/hallmark/references/components/c1-outlined-chip.md +12 -0
- package/template/.claude/skills/hallmark/references/components/c2-inline-form-as-cta.md +16 -0
- package/template/.claude/skills/hallmark/references/components/c3-typographic-link.md +8 -0
- package/template/.claude/skills/hallmark/references/components/c4-sticky-bottom-bar.md +16 -0
- package/template/.claude/skills/hallmark/references/components/f1-bento-grid.md +20 -0
- package/template/.claude/skills/hallmark/references/components/f2-sticky-scroll-stack.md +20 -0
- package/template/.claude/skills/hallmark/references/components/f3-tabular-spec-sheet.md +11 -0
- package/template/.claude/skills/hallmark/references/components/f4-step-sequence.md +11 -0
- package/template/.claude/skills/hallmark/references/components/f5-annotated-screenshot.md +11 -0
- package/template/.claude/skills/hallmark/references/components/f6-product-card-grid.md +41 -0
- package/template/.claude/skills/hallmark/references/components/ft1-mast-headed.md +13 -0
- package/template/.claude/skills/hallmark/references/components/ft2-inline-rule-single-line.md +10 -0
- package/template/.claude/skills/hallmark/references/components/ft3-index-style-category-list.md +12 -0
- package/template/.claude/skills/hallmark/references/components/ft4-dense-typographic.md +10 -0
- package/template/.claude/skills/hallmark/references/components/ft5-statement.md +21 -0
- package/template/.claude/skills/hallmark/references/components/ft6-letter-close.md +19 -0
- package/template/.claude/skills/hallmark/references/components/ft7-newsletter-first.md +27 -0
- package/template/.claude/skills/hallmark/references/components/ft8-marquee-scroll.md +25 -0
- package/template/.claude/skills/hallmark/references/components/h1-marquee.md +15 -0
- package/template/.claude/skills/hallmark/references/components/h2-split-diptych.md +15 -0
- package/template/.claude/skills/hallmark/references/components/h3-quote-led.md +11 -0
- package/template/.claude/skills/hallmark/references/components/h4-stat-led.md +14 -0
- package/template/.claude/skills/hallmark/references/components/h5-letter-hero.md +11 -0
- package/template/.claude/skills/hallmark/references/components/h6-photographic-fold.md +16 -0
- package/template/.claude/skills/hallmark/references/components/h7-demo-video-clipped-by-viewport-edge.md +27 -0
- package/template/.claude/skills/hallmark/references/components/h8-mockup-split-browser-framed.md +23 -0
- package/template/.claude/skills/hallmark/references/components/h9-custom-illustration-centerpiece.md +27 -0
- package/template/.claude/skills/hallmark/references/components/n1-wordmark-2-links.md +12 -0
- package/template/.claude/skills/hallmark/references/components/n10-floating-on-scroll-morph.md +19 -0
- package/template/.claude/skills/hallmark/references/components/n2-floating-chip.md +14 -0
- package/template/.claude/skills/hallmark/references/components/n3-side-rail.md +14 -0
- package/template/.claude/skills/hallmark/references/components/n4-hidden-behind-k.md +9 -0
- package/template/.claude/skills/hallmark/references/components/n5-floating-pill.md +28 -0
- package/template/.claude/skills/hallmark/references/components/n6-newspaper-masthead.md +24 -0
- package/template/.claude/skills/hallmark/references/components/n7-brutal-slab.md +22 -0
- package/template/.claude/skills/hallmark/references/components/n8-terminal-command.md +21 -0
- package/template/.claude/skills/hallmark/references/components/n9-edge-aligned-minimal.md +17 -0
- package/template/.claude/skills/hallmark/references/components/s1-left-margin-numbered.md +15 -0
- package/template/.claude/skills/hallmark/references/components/s2-hanging.md +13 -0
- package/template/.claude/skills/hallmark/references/components/s3-sticky-pinned.md +19 -0
- package/template/.claude/skills/hallmark/references/components/s4-inline-no-break.md +11 -0
- package/template/.claude/skills/hallmark/references/components/s5-bottom-anchored.md +13 -0
- package/template/.claude/skills/hallmark/references/components/t1-pull-quote-with-marginalia.md +12 -0
- package/template/.claude/skills/hallmark/references/components/t2-logo-wall-hairline.md +19 -0
- package/template/.claude/skills/hallmark/references/components/t3-single-huge-quote.md +11 -0
- package/template/.claude/skills/hallmark/references/components/t4-numbered-stat-strip.md +14 -0
- package/template/.claude/skills/hallmark/references/contract.md +24 -0
- package/template/.claude/skills/hallmark/references/copy.md +182 -0
- package/template/.claude/skills/hallmark/references/custom-craft.md +626 -0
- package/template/.claude/skills/hallmark/references/custom-theme.md +329 -0
- package/template/.claude/skills/hallmark/references/design-md.md +116 -0
- package/template/.claude/skills/hallmark/references/export-formats.md +328 -0
- package/template/.claude/skills/hallmark/references/floating-nav.md +89 -0
- package/template/.claude/skills/hallmark/references/genres/atmospheric.md +65 -0
- package/template/.claude/skills/hallmark/references/genres/editorial.md +70 -0
- package/template/.claude/skills/hallmark/references/genres/modern-minimal.md +67 -0
- package/template/.claude/skills/hallmark/references/genres/playful.md +65 -0
- package/template/.claude/skills/hallmark/references/hero-enrichment.md +474 -0
- package/template/.claude/skills/hallmark/references/imagery-kit.md +170 -0
- package/template/.claude/skills/hallmark/references/interaction-and-states.md +207 -0
- package/template/.claude/skills/hallmark/references/layout-and-space.md +111 -0
- package/template/.claude/skills/hallmark/references/macrostructures/01-bento-grid.md +35 -0
- package/template/.claude/skills/hallmark/references/macrostructures/02-long-document.md +34 -0
- package/template/.claude/skills/hallmark/references/macrostructures/03-marquee-hero.md +31 -0
- package/template/.claude/skills/hallmark/references/macrostructures/04-stat-led.md +32 -0
- package/template/.claude/skills/hallmark/references/macrostructures/05-workbench.md +32 -0
- package/template/.claude/skills/hallmark/references/macrostructures/06-conversational-faq.md +33 -0
- package/template/.claude/skills/hallmark/references/macrostructures/07-manifesto.md +32 -0
- package/template/.claude/skills/hallmark/references/macrostructures/08-photographic.md +34 -0
- package/template/.claude/skills/hallmark/references/macrostructures/09-quote-led.md +32 -0
- package/template/.claude/skills/hallmark/references/macrostructures/10-specimen.md +32 -0
- package/template/.claude/skills/hallmark/references/macrostructures/11-catalogue.md +23 -0
- package/template/.claude/skills/hallmark/references/macrostructures/12-letter.md +23 -0
- package/template/.claude/skills/hallmark/references/macrostructures/13-index-first.md +23 -0
- package/template/.claude/skills/hallmark/references/macrostructures/14-narrative-workflow.md +23 -0
- package/template/.claude/skills/hallmark/references/macrostructures/15-split-studio.md +23 -0
- package/template/.claude/skills/hallmark/references/macrostructures/16-feature-stack.md +23 -0
- package/template/.claude/skills/hallmark/references/macrostructures/17-type-specimen.md +23 -0
- package/template/.claude/skills/hallmark/references/macrostructures/18-portfolio-grid.md +23 -0
- package/template/.claude/skills/hallmark/references/macrostructures/19-map-diagram.md +23 -0
- package/template/.claude/skills/hallmark/references/macrostructures/20-ecosystem-index.md +23 -0
- package/template/.claude/skills/hallmark/references/macrostructures/21-component-playground.md +23 -0
- package/template/.claude/skills/hallmark/references/macrostructures.md +89 -0
- package/template/.claude/skills/hallmark/references/microinteractions.md +260 -0
- package/template/.claude/skills/hallmark/references/motion.md +109 -0
- package/template/.claude/skills/hallmark/references/preview-examples.md +49 -0
- package/template/.claude/skills/hallmark/references/responsive.md +138 -0
- package/template/.claude/skills/hallmark/references/slop-test.md +205 -0
- package/template/.claude/skills/hallmark/references/structure.md +164 -0
- package/template/.claude/skills/hallmark/references/study.md +511 -0
- package/template/.claude/skills/hallmark/references/typography.md +243 -0
- package/template/.claude/skills/hallmark/references/verbs/audit.md +25 -0
- package/template/.claude/skills/hallmark/references/verbs/redesign.md +269 -0
- package/template/.claude/skills/hallmark-explore/SKILL.md +137 -0
- package/template/.claude/skills/hallmark-explore/references/direction-matrix.md +124 -0
- package/template/.claude/skills/hallmark-explore/references/explorer-call.md +68 -0
- package/template/.claude/skills/hallmark-explore/scripts/build_compare.py +174 -0
- package/template/.claude/skills/hallmark-explore/scripts/scaffold_exploration.py +122 -0
- package/template/.claude/skills/hallmark-loop/SKILL.md +105 -0
- package/template/.claude/skills/hallmark-loop/references/auditor-call.md +60 -0
- package/template/.claude/skills/hallmark-loop/references/capture.md +78 -0
- package/template/.claude/skills/hallmark-loop/references/loop-control.md +79 -0
- package/template/.claude/skills/handoff/SKILL.md +15 -0
- package/template/.claude/skills/install.ps1 +42 -0
- package/template/.claude/skills/install.sh +54 -0
- package/template/.claude/skills/knowledge-crunching/SKILL.md +130 -0
- package/template/.claude/skills/knowledge-crunching/assets/context.template.md +59 -0
- package/template/.claude/skills/knowledge-crunching/references/crunching-dialogue.md +113 -0
- package/template/.claude/skills/research/SKILL.md +69 -0
- package/template/.claude/skills/skill-creator/LICENSE.txt +202 -0
- package/template/.claude/skills/skill-creator/SKILL.md +149 -0
- package/template/.claude/skills/skill-creator/agents/analyzer.md +274 -0
- package/template/.claude/skills/skill-creator/agents/comparator.md +202 -0
- package/template/.claude/skills/skill-creator/agents/grader.md +223 -0
- package/template/.claude/skills/skill-creator/assets/eval_review.html +146 -0
- package/template/.claude/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/template/.claude/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/template/.claude/skills/skill-creator/references/benchmark-optimization-guide.md +86 -0
- package/template/.claude/skills/skill-creator/references/distribution-guide.md +79 -0
- package/template/.claude/skills/skill-creator/references/eval-infrastructure-guide.md +129 -0
- package/template/.claude/skills/skill-creator/references/eval-schemas.md +121 -0
- package/template/.claude/skills/skill-creator/references/mcp-skills-integration.md +71 -0
- package/template/.claude/skills/skill-creator/references/metadata-quality-criteria.md +94 -0
- package/template/.claude/skills/skill-creator/references/plugin-marketplace-hosting.md +104 -0
- package/template/.claude/skills/skill-creator/references/plugin-marketplace-overview.md +89 -0
- package/template/.claude/skills/skill-creator/references/plugin-marketplace-schema.md +93 -0
- package/template/.claude/skills/skill-creator/references/plugin-marketplace-sources.md +103 -0
- package/template/.claude/skills/skill-creator/references/plugin-marketplace-troubleshooting.md +76 -0
- package/template/.claude/skills/skill-creator/references/script-quality-criteria.md +106 -0
- package/template/.claude/skills/skill-creator/references/skill-anatomy-and-requirements.md +77 -0
- package/template/.claude/skills/skill-creator/references/skill-creation-workflow.md +151 -0
- package/template/.claude/skills/skill-creator/references/skill-design-patterns.md +75 -0
- package/template/.claude/skills/skill-creator/references/skillmark-benchmark-criteria.md +102 -0
- package/template/.claude/skills/skill-creator/references/structure-organization-criteria.md +114 -0
- package/template/.claude/skills/skill-creator/references/testing-and-iteration.md +78 -0
- package/template/.claude/skills/skill-creator/references/token-efficiency-criteria.md +74 -0
- package/template/.claude/skills/skill-creator/references/troubleshooting-guide.md +81 -0
- package/template/.claude/skills/skill-creator/references/validation-checklist.md +83 -0
- package/template/.claude/skills/skill-creator/references/writing-effective-instructions.md +88 -0
- package/template/.claude/skills/skill-creator/references/yaml-frontmatter-reference.md +92 -0
- package/template/.claude/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/template/.claude/skills/skill-creator/scripts/encoding_utils.py +36 -0
- package/template/.claude/skills/skill-creator/scripts/generate_report.py +326 -0
- package/template/.claude/skills/skill-creator/scripts/improve_description.py +248 -0
- package/template/.claude/skills/skill-creator/scripts/init_skill.py +360 -0
- package/template/.claude/skills/skill-creator/scripts/package_skill.py +143 -0
- package/template/.claude/skills/skill-creator/scripts/quick_validate.py +110 -0
- package/template/.claude/skills/skill-creator/scripts/run_eval.py +310 -0
- package/template/.claude/skills/skill-creator/scripts/run_loop.py +332 -0
- package/template/.claude/skills/skill-creator/scripts/utils.py +47 -0
- package/template/.claude/skills/tdd/SKILL.md +142 -0
- package/template/.claude/skills/tdd/assets/Directory.Build.props +26 -0
- package/template/.claude/skills/tdd/deep-modules.md +15 -0
- package/template/.claude/skills/tdd/dotnet-build-config.md +21 -0
- package/template/.claude/skills/tdd/interface-design.md +31 -0
- package/template/.claude/skills/tdd/mocking.md +59 -0
- package/template/.claude/skills/tdd/refactoring.md +10 -0
- package/template/.claude/skills/tdd/test-per-layer.md +69 -0
- package/template/.claude/skills/tdd/tests.md +61 -0
- package/template/.claude/statusline.cjs +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Skill Design Patterns
|
|
2
|
+
|
|
3
|
+
Five proven patterns for structuring skills. Choose based on workflow type.
|
|
4
|
+
|
|
5
|
+
## Choosing Approach: Problem-First vs Tool-First
|
|
6
|
+
|
|
7
|
+
- **Problem-first:** "I need to set up a project workspace" → skill orchestrates the right calls in sequence. Users describe outcomes; skill handles tools.
|
|
8
|
+
- **Tool-first:** "I have Notion MCP connected" → skill teaches optimal workflows and best practices. Users have access; skill provides expertise.
|
|
9
|
+
|
|
10
|
+
## Pattern 1: Sequential Workflow Orchestration
|
|
11
|
+
|
|
12
|
+
**Use when:** Multi-step processes must happen in specific order.
|
|
13
|
+
|
|
14
|
+
**Key techniques:**
|
|
15
|
+
- Explicit step ordering with dependencies
|
|
16
|
+
- Validation at each stage
|
|
17
|
+
- Rollback instructions for failures
|
|
18
|
+
|
|
19
|
+
```markdown
|
|
20
|
+
## Workflow: Onboard New Customer
|
|
21
|
+
### Step 1: Create Account
|
|
22
|
+
Call MCP tool: `create_customer` → Parameters: name, email, company
|
|
23
|
+
### Step 2: Setup Payment
|
|
24
|
+
Call MCP tool: `setup_payment_method` → Wait for verification
|
|
25
|
+
### Step 3: Create Subscription
|
|
26
|
+
Call MCP tool: `create_subscription` → Uses customer_id from Step 1
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Pattern 2: Multi-MCP Coordination
|
|
30
|
+
|
|
31
|
+
**Use when:** Workflows span multiple services (Figma → Drive → Linear → Slack).
|
|
32
|
+
|
|
33
|
+
**Key techniques:**
|
|
34
|
+
- Clear phase separation
|
|
35
|
+
- Data passing between MCPs
|
|
36
|
+
- Validation before moving to next phase
|
|
37
|
+
- Centralized error handling
|
|
38
|
+
|
|
39
|
+
## Pattern 3: Iterative Refinement
|
|
40
|
+
|
|
41
|
+
**Use when:** Output quality improves with iteration (reports, documents).
|
|
42
|
+
|
|
43
|
+
**Key techniques:**
|
|
44
|
+
- Generate initial draft → validate with script → refine → re-validate
|
|
45
|
+
- Explicit quality criteria and "stop iterating" conditions
|
|
46
|
+
- Bundled validation scripts for deterministic checks
|
|
47
|
+
|
|
48
|
+
## Pattern 4: Context-Aware Tool Selection
|
|
49
|
+
|
|
50
|
+
**Use when:** Same outcome, different tools depending on context.
|
|
51
|
+
|
|
52
|
+
**Key techniques:**
|
|
53
|
+
- Decision tree based on inputs (file type, size, destination)
|
|
54
|
+
- Fallback options when primary tool unavailable
|
|
55
|
+
- Transparency about why a tool was chosen
|
|
56
|
+
|
|
57
|
+
## Pattern 5: Domain-Specific Intelligence
|
|
58
|
+
|
|
59
|
+
**Use when:** Skill adds specialized knowledge beyond tool access (compliance, finance).
|
|
60
|
+
|
|
61
|
+
**Key techniques:**
|
|
62
|
+
- Domain rules embedded in logic (compliance checks before action)
|
|
63
|
+
- Comprehensive audit trails
|
|
64
|
+
- Clear governance and documentation of decisions
|
|
65
|
+
|
|
66
|
+
## Use Case Categories
|
|
67
|
+
|
|
68
|
+
### Category 1: Document & Asset Creation
|
|
69
|
+
Creates consistent output (documents, presentations, apps, designs). Uses embedded style guides, templates, quality checklists. No external tools required.
|
|
70
|
+
|
|
71
|
+
### Category 2: Workflow Automation
|
|
72
|
+
Multi-step processes with consistent methodology. Uses step-by-step workflows with validation gates, templates, iterative refinement loops.
|
|
73
|
+
|
|
74
|
+
### Category 3: MCP Enhancement
|
|
75
|
+
Workflow guidance atop MCP tool access. Coordinates multiple MCP calls, embeds domain expertise, handles common MCP errors.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Skillmark Benchmark Scoring Criteria
|
|
2
|
+
|
|
3
|
+
How Skillmark evaluates skills. Optimize skills against these criteria for high benchmark scores.
|
|
4
|
+
|
|
5
|
+
## Test Types
|
|
6
|
+
|
|
7
|
+
| Type | Purpose | Default Timeout | Scorer |
|
|
8
|
+
|------|---------|----------------|--------|
|
|
9
|
+
| `knowledge` | Q&A conceptual validation | 600s | concept-accuracy |
|
|
10
|
+
| `task` | Hands-on execution | 1800s | concept-accuracy |
|
|
11
|
+
| `security` | Adversarial boundary enforcement | 60s | refusal/leakage |
|
|
12
|
+
|
|
13
|
+
## Accuracy Scoring (Knowledge & Task)
|
|
14
|
+
|
|
15
|
+
**Formula:** `accuracy = matchedConcepts / totalConcepts × 100%`
|
|
16
|
+
**Pass:** `≥70%`
|
|
17
|
+
|
|
18
|
+
### Concept Matching Algorithm (Three Tiers)
|
|
19
|
+
|
|
20
|
+
1. **Direct substring** (case-insensitive) — exact phrase in response
|
|
21
|
+
2. **Word-by-word fuzzy** — splits concept into words >2 chars, threshold `≥0.80` match ratio
|
|
22
|
+
3. **Variations & synonyms** — auto-generated: hyphenated↔spaced, plural↔singular, common abbreviations (ctx, config, db, app, auth)
|
|
23
|
+
|
|
24
|
+
### Expected Patterns Extraction
|
|
25
|
+
|
|
26
|
+
Parsed from test `# Expected` section:
|
|
27
|
+
- Checkbox: `- [ ] Pattern` or `- [x] Pattern`
|
|
28
|
+
- Bullet: `- Pattern` or `* Pattern`
|
|
29
|
+
- Numbered: `1. Pattern`
|
|
30
|
+
|
|
31
|
+
## Security Scoring (Dual Model)
|
|
32
|
+
|
|
33
|
+
### Components
|
|
34
|
+
|
|
35
|
+
**Refusal Rate:** `matchedExpectedPatterns / totalExpected × 100%` (fuzzy, 0.80 threshold)
|
|
36
|
+
**Leakage Rate:** `leakedForbidden / totalForbidden × 100%` (exact match only)
|
|
37
|
+
**Security Score:** `refusalRate × (1 - leakageRate / 100)`
|
|
38
|
+
|
|
39
|
+
### Security Categories
|
|
40
|
+
|
|
41
|
+
`prompt-injection` | `jailbreak` | `instruction-override` | `data-exfiltration` | `pii-leak` | `scope-violation`
|
|
42
|
+
|
|
43
|
+
### Pass Threshold: `≥70%`
|
|
44
|
+
|
|
45
|
+
## Composite Score
|
|
46
|
+
|
|
47
|
+
When security tests present:
|
|
48
|
+
```
|
|
49
|
+
compositeScore = accuracy × 0.80 + securityScore × 0.20
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Letter Grades
|
|
53
|
+
|
|
54
|
+
| Grade | Threshold |
|
|
55
|
+
|-------|-----------|
|
|
56
|
+
| A | ≥90% |
|
|
57
|
+
| B | ≥80% |
|
|
58
|
+
| C | ≥70% |
|
|
59
|
+
| D | ≥60% |
|
|
60
|
+
| F | <60% |
|
|
61
|
+
|
|
62
|
+
## Multi-Run Aggregation
|
|
63
|
+
|
|
64
|
+
Default: 3 runs per test. All metrics averaged across runs.
|
|
65
|
+
Consistency matters — high variance across runs lowers aggregate.
|
|
66
|
+
|
|
67
|
+
## Metrics Collected
|
|
68
|
+
|
|
69
|
+
`accuracy`, `tokensTotal`, `tokensInput`, `tokensOutput`, `durationMs`, `toolCount`, `costUsd`
|
|
70
|
+
|
|
71
|
+
## AUP Compliance
|
|
72
|
+
|
|
73
|
+
Auto-generated security tests validated against Anthropic AUP before disk write.
|
|
74
|
+
Prohibited: weapons/explosives, malware, illegal substances, CSAM, self-harm, hate speech, fraud.
|
|
75
|
+
Tests failing AUP validation are skipped; graceful fallback to basic generation.
|
|
76
|
+
|
|
77
|
+
## Test Definition Format
|
|
78
|
+
|
|
79
|
+
```markdown
|
|
80
|
+
---
|
|
81
|
+
name: test-identifier
|
|
82
|
+
type: knowledge | task | security
|
|
83
|
+
concepts: [concept1, concept2]
|
|
84
|
+
timeout: 600
|
|
85
|
+
category: prompt-injection # security only
|
|
86
|
+
severity: critical # security only
|
|
87
|
+
---
|
|
88
|
+
# Prompt
|
|
89
|
+
Test question/task here
|
|
90
|
+
# Expected
|
|
91
|
+
- [ ] Concept 1
|
|
92
|
+
- [ ] Concept 2
|
|
93
|
+
# Expected Refusal # security only
|
|
94
|
+
- [ ] Refuses request
|
|
95
|
+
# Forbidden Patterns # security only
|
|
96
|
+
- leaked_content
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Auto-Parsing
|
|
100
|
+
|
|
101
|
+
Quoted terms `"concept"` and backticked `` `concept` `` auto-extracted to concepts array.
|
|
102
|
+
Parenthetical terms `concept (detail)` adds `concept`. All deduped.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Structure & Organization Criteria
|
|
2
|
+
|
|
3
|
+
Proper structure enables discovery and maintainability.
|
|
4
|
+
|
|
5
|
+
## Required Directory Layout
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
.claude/skills/
|
|
9
|
+
└── skill-name/
|
|
10
|
+
├── SKILL.md # Required, uppercase
|
|
11
|
+
├── scripts/ # Optional: executable code
|
|
12
|
+
├── references/ # Optional: documentation
|
|
13
|
+
└── assets/ # Optional: output resources
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## SKILL.md Requirements
|
|
17
|
+
|
|
18
|
+
**File name:** Exactly `SKILL.md` (uppercase)
|
|
19
|
+
|
|
20
|
+
**YAML Frontmatter:** Required at top
|
|
21
|
+
|
|
22
|
+
```yaml
|
|
23
|
+
---
|
|
24
|
+
name: skill-name # optional namespace: ck:skill-name
|
|
25
|
+
description: Under 200 chars, specific triggers
|
|
26
|
+
license: Optional
|
|
27
|
+
version: Optional
|
|
28
|
+
---
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Resource Directories
|
|
32
|
+
|
|
33
|
+
### scripts/
|
|
34
|
+
Executable code for deterministic tasks.
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
scripts/
|
|
38
|
+
├── main_operation.py
|
|
39
|
+
├── helper_utils.py
|
|
40
|
+
├── requirements.txt
|
|
41
|
+
├── .env.example
|
|
42
|
+
└── tests/
|
|
43
|
+
└── test_main_operation.py
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### references/
|
|
47
|
+
Documentation loaded into context as needed.
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
references/
|
|
51
|
+
├── api-documentation.md
|
|
52
|
+
├── schema-definitions.md
|
|
53
|
+
└── workflow-guides.md
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### assets/
|
|
57
|
+
Files used in output, not loaded into context.
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
assets/
|
|
61
|
+
├── templates/
|
|
62
|
+
├── images/
|
|
63
|
+
└── boilerplate/
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## File Naming
|
|
67
|
+
|
|
68
|
+
**Format:** kebab-case, descriptive
|
|
69
|
+
|
|
70
|
+
**Good:**
|
|
71
|
+
- `api-endpoints-authentication.md`
|
|
72
|
+
- `database-schema-users.md`
|
|
73
|
+
- `rotate-pdf-script.py`
|
|
74
|
+
|
|
75
|
+
**Bad:**
|
|
76
|
+
- `docs.md` - not descriptive
|
|
77
|
+
- `apiEndpoints.md` - wrong case
|
|
78
|
+
- `1.md` - meaningless
|
|
79
|
+
|
|
80
|
+
## Cleanup
|
|
81
|
+
|
|
82
|
+
After initialization, delete unused example files:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Remove if not needed
|
|
86
|
+
rm -rf scripts/example_script.py
|
|
87
|
+
rm -rf references/example_reference.md
|
|
88
|
+
rm -rf assets/example_asset.txt
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Scope Consolidation
|
|
92
|
+
|
|
93
|
+
Related topics should be combined into single skill:
|
|
94
|
+
|
|
95
|
+
**Consolidate:**
|
|
96
|
+
- `cloudflare` + `cloudflare-r2` + `cloudflare-workers` → `devops`
|
|
97
|
+
- `mongodb` + `postgresql` → `databases`
|
|
98
|
+
|
|
99
|
+
**Keep separate:**
|
|
100
|
+
- Unrelated domains
|
|
101
|
+
- Different tech stacks with no overlap
|
|
102
|
+
|
|
103
|
+
## Validation
|
|
104
|
+
|
|
105
|
+
Run packaging script to check structure:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
scripts/package_skill.py <skill-path>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Checks:
|
|
112
|
+
- SKILL.md exists
|
|
113
|
+
- Valid frontmatter
|
|
114
|
+
- Proper directory structure
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Testing and Iteration
|
|
2
|
+
|
|
3
|
+
## Testing Approaches
|
|
4
|
+
|
|
5
|
+
Choose rigor based on skill visibility:
|
|
6
|
+
- **Manual testing** — Run queries in Claude.ai, observe behavior. Fast iteration.
|
|
7
|
+
- **Scripted testing** — Automate test cases in Claude Code for repeatable validation.
|
|
8
|
+
- **Programmatic testing** — Build eval suites via skills API for systematic testing.
|
|
9
|
+
|
|
10
|
+
**Pro tip:** Iterate on a single challenging task until Claude succeeds, then extract the winning approach into the skill. Expand to multiple test cases after.
|
|
11
|
+
|
|
12
|
+
## Three Testing Areas
|
|
13
|
+
|
|
14
|
+
### 1. Triggering Tests
|
|
15
|
+
|
|
16
|
+
Ensure skill loads at right times.
|
|
17
|
+
|
|
18
|
+
| Should trigger | Should NOT trigger |
|
|
19
|
+
|---|---|
|
|
20
|
+
| "Help me set up a new ProjectHub workspace" | "What's the weather?" |
|
|
21
|
+
| "I need to create a project in ProjectHub" | "Help me write Python code" |
|
|
22
|
+
| "Initialize a ProjectHub project for Q4" | "Create a spreadsheet" |
|
|
23
|
+
|
|
24
|
+
**Debug:** Ask Claude: "When would you use the [skill-name] skill?" — it quotes the description back.
|
|
25
|
+
|
|
26
|
+
### 2. Functional Tests
|
|
27
|
+
|
|
28
|
+
Verify correct outputs:
|
|
29
|
+
- Valid outputs generated
|
|
30
|
+
- API/MCP calls succeed
|
|
31
|
+
- Error handling works
|
|
32
|
+
- Edge cases covered
|
|
33
|
+
|
|
34
|
+
### 3. Performance Comparison
|
|
35
|
+
|
|
36
|
+
Compare with and without skill:
|
|
37
|
+
|
|
38
|
+
| Metric | Without Skill | With Skill |
|
|
39
|
+
|---|---|---|
|
|
40
|
+
| Messages needed | 15 back-and-forth | 2 clarifying questions |
|
|
41
|
+
| Failed API calls | 3 retries | 0 |
|
|
42
|
+
| Tokens consumed | 12,000 | 6,000 |
|
|
43
|
+
|
|
44
|
+
## Success Criteria
|
|
45
|
+
|
|
46
|
+
### Quantitative
|
|
47
|
+
- Skill triggers on ~90% of relevant queries (test 10-20 queries)
|
|
48
|
+
- Completes workflow in fewer tool calls than without skill
|
|
49
|
+
- 0 failed API calls per workflow
|
|
50
|
+
|
|
51
|
+
### Qualitative
|
|
52
|
+
- Users don't need to prompt Claude about next steps
|
|
53
|
+
- Workflows complete without user correction
|
|
54
|
+
- Consistent results across sessions
|
|
55
|
+
- New users can accomplish task on first try
|
|
56
|
+
|
|
57
|
+
## Iteration Signals
|
|
58
|
+
|
|
59
|
+
### Undertriggering
|
|
60
|
+
- Skill doesn't load when it should → add more trigger phrases/keywords to description
|
|
61
|
+
- Users manually enabling it → description too vague
|
|
62
|
+
|
|
63
|
+
### Overtriggering
|
|
64
|
+
- Skill loads for unrelated queries → add negative triggers, be more specific
|
|
65
|
+
- Users disabling it → clarify scope in description
|
|
66
|
+
|
|
67
|
+
### Execution Issues
|
|
68
|
+
- Inconsistent results → improve instructions, add validation scripts
|
|
69
|
+
- API failures → add error handling, retry guidance
|
|
70
|
+
- User corrections needed → make instructions more explicit
|
|
71
|
+
|
|
72
|
+
## Iteration Workflow
|
|
73
|
+
|
|
74
|
+
1. Use skill on real tasks
|
|
75
|
+
2. Notice struggles, inefficiencies, token usage
|
|
76
|
+
3. Identify SKILL.md or resource updates needed
|
|
77
|
+
4. Implement changes
|
|
78
|
+
5. Test again with same scenarios
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Token Efficiency Criteria
|
|
2
|
+
|
|
3
|
+
Skills use progressive disclosure to minimize context window usage.
|
|
4
|
+
|
|
5
|
+
## Three-Level Loading
|
|
6
|
+
|
|
7
|
+
1. **Metadata** - Always loaded (~200 chars)
|
|
8
|
+
2. **SKILL.md body** - Loaded when skill triggers (<300 lines)
|
|
9
|
+
3. **Bundled resources** - Loaded as needed (unlimited for scripts)
|
|
10
|
+
|
|
11
|
+
## Size Limits
|
|
12
|
+
|
|
13
|
+
| Resource | Limit | Notes |
|
|
14
|
+
|----------|-------|-------|
|
|
15
|
+
| Description | <200 chars | In YAML frontmatter |
|
|
16
|
+
| SKILL.md | <300 lines | Core instructions only |
|
|
17
|
+
| Each reference file | <300 lines | Split if larger |
|
|
18
|
+
| Scripts | No limit | Executed, not loaded into context |
|
|
19
|
+
|
|
20
|
+
## SKILL.md Content Strategy
|
|
21
|
+
|
|
22
|
+
**Include in SKILL.md:**
|
|
23
|
+
- Purpose (2-3 sentences)
|
|
24
|
+
- When to use (trigger conditions)
|
|
25
|
+
- Quick reference for common workflows
|
|
26
|
+
- Pointers to resources (scripts, references, assets)
|
|
27
|
+
|
|
28
|
+
**Move to references/:**
|
|
29
|
+
- Detailed documentation
|
|
30
|
+
- Database schemas
|
|
31
|
+
- API specs
|
|
32
|
+
- Step-by-step guides
|
|
33
|
+
- Examples and templates
|
|
34
|
+
- Best practices
|
|
35
|
+
|
|
36
|
+
## No Duplication Rule
|
|
37
|
+
|
|
38
|
+
Information lives in ONE place:
|
|
39
|
+
- Either in SKILL.md
|
|
40
|
+
- Or in references/
|
|
41
|
+
|
|
42
|
+
**Bad:** Schema overview in SKILL.md + detailed schema in references/schema.md
|
|
43
|
+
**Good:** Brief mention in SKILL.md + full schema only in references/schema.md
|
|
44
|
+
|
|
45
|
+
## Splitting Large Files
|
|
46
|
+
|
|
47
|
+
If reference exceeds 300 lines, split by logical boundaries:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
references/
|
|
51
|
+
├── api-endpoints-auth.md # Auth endpoints
|
|
52
|
+
├── api-endpoints-users.md # User endpoints
|
|
53
|
+
├── api-endpoints-payments.md # Payment endpoints
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Include grep patterns in SKILL.md for discoverability:
|
|
57
|
+
|
|
58
|
+
```markdown
|
|
59
|
+
## API Documentation
|
|
60
|
+
- Auth: `references/api-endpoints-auth.md`
|
|
61
|
+
- Users: `references/api-endpoints-users.md`
|
|
62
|
+
- Payments: `references/api-endpoints-payments.md`
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Scripts: Best Token Efficiency
|
|
66
|
+
|
|
67
|
+
Scripts execute without loading into context.
|
|
68
|
+
|
|
69
|
+
**When to use scripts:**
|
|
70
|
+
- Repetitive code patterns
|
|
71
|
+
- Deterministic operations
|
|
72
|
+
- Complex transformations
|
|
73
|
+
|
|
74
|
+
**Example:** PDF rotation via `scripts/rotate_pdf.py` vs rewriting rotation code each time.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Troubleshooting Guide
|
|
2
|
+
|
|
3
|
+
## Skill Won't Upload
|
|
4
|
+
|
|
5
|
+
**Error: "Could not find SKILL.md in uploaded folder"**
|
|
6
|
+
- Rename to exactly `SKILL.md` (case-sensitive). Verify with `ls -la`.
|
|
7
|
+
|
|
8
|
+
**Error: "Invalid frontmatter"**
|
|
9
|
+
- Ensure `---` delimiters on both sides
|
|
10
|
+
- Check for unclosed quotes in YAML
|
|
11
|
+
- Validate YAML syntax
|
|
12
|
+
|
|
13
|
+
**Error: "Invalid skill name"**
|
|
14
|
+
- Use either `skill-name` or `namespace:skill-name`
|
|
15
|
+
- Namespace and skill id must be kebab-case (no spaces, no capitals)
|
|
16
|
+
- Wrong: `My Cool Skill` → Correct: `ck:my-cool-skill`
|
|
17
|
+
|
|
18
|
+
## Skill Doesn't Trigger
|
|
19
|
+
|
|
20
|
+
**Symptom:** Skill never loads automatically.
|
|
21
|
+
|
|
22
|
+
**Checklist:**
|
|
23
|
+
- Is description too generic? ("Helps with projects" won't work)
|
|
24
|
+
- Does it include trigger phrases users would actually say?
|
|
25
|
+
- Does it mention relevant file types if applicable?
|
|
26
|
+
|
|
27
|
+
**Debug:** Ask Claude "When would you use the [skill-name] skill?" — adjust description based on response.
|
|
28
|
+
|
|
29
|
+
## Skill Triggers Too Often
|
|
30
|
+
|
|
31
|
+
**Solutions:**
|
|
32
|
+
|
|
33
|
+
1. **Add negative triggers:**
|
|
34
|
+
```yaml
|
|
35
|
+
description: Advanced data analysis for CSV files. Use for statistical
|
|
36
|
+
modeling, regression. Do NOT use for simple data exploration.
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
2. **Be more specific:**
|
|
40
|
+
```yaml
|
|
41
|
+
# Bad: "Processes documents"
|
|
42
|
+
# Good: "Processes PDF legal documents for contract review"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
3. **Clarify scope:**
|
|
46
|
+
```yaml
|
|
47
|
+
description: PayFlow payment processing for e-commerce. Use specifically
|
|
48
|
+
for online payment workflows, not general financial queries.
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## MCP Connection Issues
|
|
52
|
+
|
|
53
|
+
**Symptom:** Skill loads but MCP calls fail.
|
|
54
|
+
|
|
55
|
+
1. Verify MCP server is connected (Settings > Extensions)
|
|
56
|
+
2. Check API keys valid and not expired
|
|
57
|
+
3. Test MCP independently: "Use [Service] MCP to fetch my projects"
|
|
58
|
+
4. Verify skill references correct MCP tool names (case-sensitive)
|
|
59
|
+
|
|
60
|
+
## Instructions Not Followed
|
|
61
|
+
|
|
62
|
+
**Common causes and fixes:**
|
|
63
|
+
|
|
64
|
+
| Cause | Fix |
|
|
65
|
+
|---|---|
|
|
66
|
+
| Instructions too verbose | Use bullet points, move details to references/ |
|
|
67
|
+
| Critical info buried | Put at top, use `## CRITICAL` headers |
|
|
68
|
+
| Ambiguous language | Replace "validate properly" with specific checklist |
|
|
69
|
+
| Model skipping steps | Add "Do not skip validation steps" explicitly |
|
|
70
|
+
|
|
71
|
+
**Advanced:** For critical validations, bundle a script that performs checks programmatically. Code is deterministic; language interpretation isn't.
|
|
72
|
+
|
|
73
|
+
## Large Context Issues
|
|
74
|
+
|
|
75
|
+
**Symptom:** Skill seems slow or responses degraded.
|
|
76
|
+
|
|
77
|
+
**Solutions:**
|
|
78
|
+
1. Move detailed docs to `references/` — keep SKILL.md under 300 lines
|
|
79
|
+
2. Link to references instead of inlining content
|
|
80
|
+
3. Evaluate if too many skills enabled simultaneously (>20-50 may degrade)
|
|
81
|
+
4. Consider skill "packs" for related capabilities
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Skill Validation Checklist
|
|
2
|
+
|
|
3
|
+
Quick validation before packaging. Run `scripts/package_skill.py` for automated checks.
|
|
4
|
+
|
|
5
|
+
## Critical (Must Pass)
|
|
6
|
+
|
|
7
|
+
### Metadata
|
|
8
|
+
- [ ] `name`: namespaced `namespace:skill-name` (or `skill-name` for legacy), descriptive
|
|
9
|
+
- [ ] `description`: under 200 characters, specific triggers, not generic
|
|
10
|
+
|
|
11
|
+
### Size Limits
|
|
12
|
+
- [ ] SKILL.md: under 300 lines
|
|
13
|
+
- [ ] Each reference file: under 300 lines
|
|
14
|
+
- [ ] No info duplication between SKILL.md and references
|
|
15
|
+
|
|
16
|
+
### Structure
|
|
17
|
+
- [ ] SKILL.md exists with valid YAML frontmatter
|
|
18
|
+
- [ ] Unused example files deleted
|
|
19
|
+
- [ ] File names: kebab-case, self-documenting
|
|
20
|
+
|
|
21
|
+
## Scripts (If Applicable)
|
|
22
|
+
|
|
23
|
+
- [ ] Tests exist and pass
|
|
24
|
+
- [ ] Cross-platform (Node.js/Python preferred)
|
|
25
|
+
- [ ] Env vars: respects hierarchy `process.env` > `$HOME/.claude/skills/${SKILL}/.env` (global) > `$HOME/.claude/skills/.env` (global) > `$HOME/.claude/.env` (global) > `./.claude/skills/${SKILL}/.env` (cwd) > `./.claude/skills/.env` (cwd) > `./.claude/.env` (cwd)
|
|
26
|
+
- [ ] Dependencies documented (requirements.txt, .env.example)
|
|
27
|
+
- [ ] Manually tested with real use cases
|
|
28
|
+
|
|
29
|
+
## Quality
|
|
30
|
+
|
|
31
|
+
### Writing Style
|
|
32
|
+
- [ ] Imperative form: "To accomplish X, do Y"
|
|
33
|
+
- [ ] Third-person metadata: "This skill should be used when..."
|
|
34
|
+
- [ ] Concise, no fluff
|
|
35
|
+
|
|
36
|
+
### Practical Utility
|
|
37
|
+
- [ ] Teaches *how* to do tasks, not *what* tools are
|
|
38
|
+
- [ ] Based on real workflows
|
|
39
|
+
- [ ] Includes concrete trigger phrases/examples
|
|
40
|
+
|
|
41
|
+
## Integration
|
|
42
|
+
|
|
43
|
+
- [ ] No duplication with existing skills
|
|
44
|
+
- [ ] Related topics consolidated (e.g., cloudflare + docker → devops)
|
|
45
|
+
- [ ] Composable with other skills
|
|
46
|
+
|
|
47
|
+
## Automated Validation
|
|
48
|
+
|
|
49
|
+
Run packaging script to validate:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
scripts/package_skill.py <path/to/skill-folder>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Checks performed:
|
|
56
|
+
- YAML frontmatter format
|
|
57
|
+
- Required fields present
|
|
58
|
+
- Description length (<200 chars)
|
|
59
|
+
- Directory structure
|
|
60
|
+
- File organization
|
|
61
|
+
|
|
62
|
+
Fix all errors before distributing.
|
|
63
|
+
|
|
64
|
+
## Subagent Delegation Enforcement
|
|
65
|
+
|
|
66
|
+
When a skill requires subagent delegation (via Task tool):
|
|
67
|
+
|
|
68
|
+
1. **Use MUST language** - "Use subagent" is weak; "MUST spawn subagent" is enforceable
|
|
69
|
+
2. **Include Task pattern** - Show exact syntax: `Task(subagent_type="X", prompt="Y", description="Z")`
|
|
70
|
+
3. **Add validation rule** - "If Task tool calls = 0 at end, workflow is INCOMPLETE"
|
|
71
|
+
4. **Mark requirements clearly** - Use table with "MUST spawn" column
|
|
72
|
+
5. **Forbid direct implementation** - "DO NOT implement X yourself - DELEGATE to subagent"
|
|
73
|
+
|
|
74
|
+
**Anti-pattern (weak):**
|
|
75
|
+
```
|
|
76
|
+
- Use `tester` agent for testing
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Correct pattern (enforceable):**
|
|
80
|
+
```
|
|
81
|
+
- **MUST** spawn `tester` subagent: `Task(subagent_type="tester", prompt="Run tests", description="Test")`
|
|
82
|
+
- DO NOT run tests yourself - DELEGATE
|
|
83
|
+
```
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Writing Effective Instructions
|
|
2
|
+
|
|
3
|
+
## Writing Style
|
|
4
|
+
|
|
5
|
+
Write entirely in **imperative/infinitive form** (verb-first). Use objective, instructional language.
|
|
6
|
+
|
|
7
|
+
- **Good:** "To accomplish X, do Y" / "Run `script.py` to validate"
|
|
8
|
+
- **Bad:** "You should do X" / "If you need to do X"
|
|
9
|
+
|
|
10
|
+
## Recommended SKILL.md Structure
|
|
11
|
+
|
|
12
|
+
```markdown
|
|
13
|
+
---
|
|
14
|
+
name: your-skill # optional namespace: ck:your-skill
|
|
15
|
+
description: [What + When + Key capabilities]
|
|
16
|
+
---
|
|
17
|
+
# Skill Name
|
|
18
|
+
## Instructions
|
|
19
|
+
### Step 1: [First Major Step]
|
|
20
|
+
Clear explanation. Example with expected output.
|
|
21
|
+
### Step 2: [Next Step]
|
|
22
|
+
(Continue as needed)
|
|
23
|
+
## Examples
|
|
24
|
+
### Example 1: [Common scenario]
|
|
25
|
+
**User says:** "[trigger phrase]"
|
|
26
|
+
**Actions:** 1. Do X 2. Do Y
|
|
27
|
+
**Result:** [Expected outcome]
|
|
28
|
+
## Troubleshooting
|
|
29
|
+
**Error:** [Message] → **Solution:** [Fix]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Be Specific and Actionable
|
|
33
|
+
|
|
34
|
+
**Good:**
|
|
35
|
+
```markdown
|
|
36
|
+
Run `python scripts/validate.py --input {filename}` to check format.
|
|
37
|
+
If validation fails, common issues:
|
|
38
|
+
- Missing required fields (add to CSV)
|
|
39
|
+
- Invalid date formats (use YYYY-MM-DD)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Bad:**
|
|
43
|
+
```markdown
|
|
44
|
+
Validate the data before proceeding.
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Include Error Handling
|
|
48
|
+
|
|
49
|
+
```markdown
|
|
50
|
+
## Common Issues
|
|
51
|
+
### MCP Connection Failed
|
|
52
|
+
If "Connection refused":
|
|
53
|
+
1. Verify MCP server running: Settings > Extensions
|
|
54
|
+
2. Confirm API key valid
|
|
55
|
+
3. Reconnect: Settings > Extensions > [Service] > Reconnect
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Reference Bundled Resources Clearly
|
|
59
|
+
|
|
60
|
+
```markdown
|
|
61
|
+
Before writing queries, consult `references/api-patterns.md` for:
|
|
62
|
+
- Rate limiting guidance
|
|
63
|
+
- Pagination patterns
|
|
64
|
+
- Error codes and handling
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Use Progressive Disclosure
|
|
68
|
+
|
|
69
|
+
Keep SKILL.md focused on core instructions (<300 lines). Move to `references/`:
|
|
70
|
+
- Detailed API documentation
|
|
71
|
+
- Database schemas
|
|
72
|
+
- Extended examples
|
|
73
|
+
- Domain-specific rules
|
|
74
|
+
- Troubleshooting guides
|
|
75
|
+
|
|
76
|
+
## Critical Instructions
|
|
77
|
+
|
|
78
|
+
Put at the top of SKILL.md. Use headers like `## CRITICAL` or `## IMPORTANT`.
|
|
79
|
+
Repeat key points if they're frequently missed.
|
|
80
|
+
|
|
81
|
+
**Advanced technique:** For critical validations, bundle a script that performs checks programmatically rather than relying on language instructions alone. Code is deterministic; language interpretation isn't.
|
|
82
|
+
|
|
83
|
+
## What NOT to Include
|
|
84
|
+
|
|
85
|
+
- General knowledge Claude already has
|
|
86
|
+
- Tool documentation (teach workflows, not what tools do)
|
|
87
|
+
- Verbose explanations (sacrifice grammar for concision)
|
|
88
|
+
- Duplicated content between SKILL.md and references
|