@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.
Files changed (235) hide show
  1. package/INSTALLATION.md +22 -0
  2. package/LICENSE +21 -0
  3. package/README.md +38 -0
  4. package/bin/musketeer.js +72 -0
  5. package/manifest.json +238 -0
  6. package/package.json +46 -0
  7. package/src/copier.js +119 -0
  8. package/src/lockfile.js +61 -0
  9. package/src/manifest-loader.js +46 -0
  10. package/src/muster.js +48 -0
  11. package/src/provisioner/detect.js +93 -0
  12. package/src/provisioner/guide.js +32 -0
  13. package/src/provisioner/index.js +113 -0
  14. package/src/provisioner/mcp.js +26 -0
  15. package/src/provisioner/os-package-manager.js +71 -0
  16. package/src/provisioner/venv.js +44 -0
  17. package/src/reconcile.js +94 -0
  18. package/src/resolver.js +130 -0
  19. package/src/schema.js +152 -0
  20. package/src/settings-merger.js +0 -0
  21. package/template/.claude/agents/code-reviewer.md +166 -0
  22. package/template/.claude/agents/hallmark-auditor.md +78 -0
  23. package/template/.claude/agents/hallmark-explorer.md +81 -0
  24. package/template/.claude/agents/researcher.md +33 -0
  25. package/template/.claude/hooks/block-migration-edits.cjs +31 -0
  26. package/template/.claude/hooks/format-json-hook.js +91 -0
  27. package/template/.claude/hooks/inject-design-docs.cjs +86 -0
  28. package/template/.claude/hooks/lib/colors.cjs +122 -0
  29. package/template/.claude/hooks/lib/git-info-cache.cjs +191 -0
  30. package/template/.claude/hooks/lib/transcript-parser.cjs +277 -0
  31. package/template/.claude/hooks/usage-context-awareness.cjs +166 -0
  32. package/template/.claude/hooks/validate-cml-hook.js +145 -0
  33. package/template/.claude/skills/adr-writer/SKILL.md +78 -0
  34. package/template/.claude/skills/adr-writer/references/adr-example.md +38 -0
  35. package/template/.claude/skills/adr-writer/references/adr-template.md +46 -0
  36. package/template/.claude/skills/architecture-characteristic-writer/SKILL.md +117 -0
  37. package/template/.claude/skills/architecture-characteristic-writer/assets/worksheet-template.md +40 -0
  38. package/template/.claude/skills/architecture-characteristic-writer/references/characteristics-catalog.md +106 -0
  39. package/template/.claude/skills/code-review/SKILL.md +54 -0
  40. package/template/.claude/skills/code-review/references/adversarial-review.md +223 -0
  41. package/template/.claude/skills/code-review/references/checklists/api.md +52 -0
  42. package/template/.claude/skills/code-review/references/checklists/base.md +100 -0
  43. package/template/.claude/skills/code-review/references/checklists/web-app.md +54 -0
  44. package/template/.claude/skills/context-map/SKILL.md +80 -0
  45. package/template/.claude/skills/context-map/example.cml +106 -0
  46. package/template/.claude/skills/context-map/reference/Aggregate/Aggregate.md +1 -0
  47. package/template/.claude/skills/context-map/reference/Bounded Context/Bounded Context.md +41 -0
  48. package/template/.claude/skills/context-map/reference/Bounded Context/businessModel.md +6 -0
  49. package/template/.claude/skills/context-map/reference/Bounded Context/domainVisionStatement.md +3 -0
  50. package/template/.claude/skills/context-map/reference/Bounded Context/evolution.md +6 -0
  51. package/template/.claude/skills/context-map/reference/Bounded Context/implementationTechnology.md +1 -0
  52. package/template/.claude/skills/context-map/reference/Bounded Context/implements.md +1 -0
  53. package/template/.claude/skills/context-map/reference/Bounded Context/knowledgeLevel.md +5 -0
  54. package/template/.claude/skills/context-map/reference/Bounded Context/realizes.md +9 -0
  55. package/template/.claude/skills/context-map/reference/Bounded Context/refines.md +10 -0
  56. package/template/.claude/skills/context-map/reference/Bounded Context/responsibilities.md +26 -0
  57. package/template/.claude/skills/context-map/reference/Bounded Context/type.md +23 -0
  58. package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Anticorruption Layer.md +5 -0
  59. package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Bounded Context Relationship.md +13 -0
  60. package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Conformist.md +5 -0
  61. package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Customer-Supplier (C-S).md +23 -0
  62. package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Open Host Service.md +5 -0
  63. package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Partnership (P).md +14 -0
  64. package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Published Language.md +5 -0
  65. package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Shared Kernel (SK).md +13 -0
  66. package/template/.claude/skills/context-map/reference/Context Map.md +63 -0
  67. package/template/.claude/skills/context-map/reference/Domain/Domain.md +30 -0
  68. package/template/.claude/skills/context-map/reference/Domain/supports.md +34 -0
  69. package/template/.claude/skills/context-map/reference/Domain/type.md +3 -0
  70. package/template/.claude/skills/context-map/reference/Semantic Rules.md +33 -0
  71. package/template/.claude/skills/hallmark/SKILL.md +552 -0
  72. package/template/.claude/skills/hallmark/references/anti-patterns.md +412 -0
  73. package/template/.claude/skills/hallmark/references/assets.md +406 -0
  74. package/template/.claude/skills/hallmark/references/color.md +95 -0
  75. package/template/.claude/skills/hallmark/references/component-cookbook.md +256 -0
  76. package/template/.claude/skills/hallmark/references/components/c1-outlined-chip.md +12 -0
  77. package/template/.claude/skills/hallmark/references/components/c2-inline-form-as-cta.md +16 -0
  78. package/template/.claude/skills/hallmark/references/components/c3-typographic-link.md +8 -0
  79. package/template/.claude/skills/hallmark/references/components/c4-sticky-bottom-bar.md +16 -0
  80. package/template/.claude/skills/hallmark/references/components/f1-bento-grid.md +20 -0
  81. package/template/.claude/skills/hallmark/references/components/f2-sticky-scroll-stack.md +20 -0
  82. package/template/.claude/skills/hallmark/references/components/f3-tabular-spec-sheet.md +11 -0
  83. package/template/.claude/skills/hallmark/references/components/f4-step-sequence.md +11 -0
  84. package/template/.claude/skills/hallmark/references/components/f5-annotated-screenshot.md +11 -0
  85. package/template/.claude/skills/hallmark/references/components/f6-product-card-grid.md +41 -0
  86. package/template/.claude/skills/hallmark/references/components/ft1-mast-headed.md +13 -0
  87. package/template/.claude/skills/hallmark/references/components/ft2-inline-rule-single-line.md +10 -0
  88. package/template/.claude/skills/hallmark/references/components/ft3-index-style-category-list.md +12 -0
  89. package/template/.claude/skills/hallmark/references/components/ft4-dense-typographic.md +10 -0
  90. package/template/.claude/skills/hallmark/references/components/ft5-statement.md +21 -0
  91. package/template/.claude/skills/hallmark/references/components/ft6-letter-close.md +19 -0
  92. package/template/.claude/skills/hallmark/references/components/ft7-newsletter-first.md +27 -0
  93. package/template/.claude/skills/hallmark/references/components/ft8-marquee-scroll.md +25 -0
  94. package/template/.claude/skills/hallmark/references/components/h1-marquee.md +15 -0
  95. package/template/.claude/skills/hallmark/references/components/h2-split-diptych.md +15 -0
  96. package/template/.claude/skills/hallmark/references/components/h3-quote-led.md +11 -0
  97. package/template/.claude/skills/hallmark/references/components/h4-stat-led.md +14 -0
  98. package/template/.claude/skills/hallmark/references/components/h5-letter-hero.md +11 -0
  99. package/template/.claude/skills/hallmark/references/components/h6-photographic-fold.md +16 -0
  100. package/template/.claude/skills/hallmark/references/components/h7-demo-video-clipped-by-viewport-edge.md +27 -0
  101. package/template/.claude/skills/hallmark/references/components/h8-mockup-split-browser-framed.md +23 -0
  102. package/template/.claude/skills/hallmark/references/components/h9-custom-illustration-centerpiece.md +27 -0
  103. package/template/.claude/skills/hallmark/references/components/n1-wordmark-2-links.md +12 -0
  104. package/template/.claude/skills/hallmark/references/components/n10-floating-on-scroll-morph.md +19 -0
  105. package/template/.claude/skills/hallmark/references/components/n2-floating-chip.md +14 -0
  106. package/template/.claude/skills/hallmark/references/components/n3-side-rail.md +14 -0
  107. package/template/.claude/skills/hallmark/references/components/n4-hidden-behind-k.md +9 -0
  108. package/template/.claude/skills/hallmark/references/components/n5-floating-pill.md +28 -0
  109. package/template/.claude/skills/hallmark/references/components/n6-newspaper-masthead.md +24 -0
  110. package/template/.claude/skills/hallmark/references/components/n7-brutal-slab.md +22 -0
  111. package/template/.claude/skills/hallmark/references/components/n8-terminal-command.md +21 -0
  112. package/template/.claude/skills/hallmark/references/components/n9-edge-aligned-minimal.md +17 -0
  113. package/template/.claude/skills/hallmark/references/components/s1-left-margin-numbered.md +15 -0
  114. package/template/.claude/skills/hallmark/references/components/s2-hanging.md +13 -0
  115. package/template/.claude/skills/hallmark/references/components/s3-sticky-pinned.md +19 -0
  116. package/template/.claude/skills/hallmark/references/components/s4-inline-no-break.md +11 -0
  117. package/template/.claude/skills/hallmark/references/components/s5-bottom-anchored.md +13 -0
  118. package/template/.claude/skills/hallmark/references/components/t1-pull-quote-with-marginalia.md +12 -0
  119. package/template/.claude/skills/hallmark/references/components/t2-logo-wall-hairline.md +19 -0
  120. package/template/.claude/skills/hallmark/references/components/t3-single-huge-quote.md +11 -0
  121. package/template/.claude/skills/hallmark/references/components/t4-numbered-stat-strip.md +14 -0
  122. package/template/.claude/skills/hallmark/references/contract.md +24 -0
  123. package/template/.claude/skills/hallmark/references/copy.md +182 -0
  124. package/template/.claude/skills/hallmark/references/custom-craft.md +626 -0
  125. package/template/.claude/skills/hallmark/references/custom-theme.md +329 -0
  126. package/template/.claude/skills/hallmark/references/design-md.md +116 -0
  127. package/template/.claude/skills/hallmark/references/export-formats.md +328 -0
  128. package/template/.claude/skills/hallmark/references/floating-nav.md +89 -0
  129. package/template/.claude/skills/hallmark/references/genres/atmospheric.md +65 -0
  130. package/template/.claude/skills/hallmark/references/genres/editorial.md +70 -0
  131. package/template/.claude/skills/hallmark/references/genres/modern-minimal.md +67 -0
  132. package/template/.claude/skills/hallmark/references/genres/playful.md +65 -0
  133. package/template/.claude/skills/hallmark/references/hero-enrichment.md +474 -0
  134. package/template/.claude/skills/hallmark/references/imagery-kit.md +170 -0
  135. package/template/.claude/skills/hallmark/references/interaction-and-states.md +207 -0
  136. package/template/.claude/skills/hallmark/references/layout-and-space.md +111 -0
  137. package/template/.claude/skills/hallmark/references/macrostructures/01-bento-grid.md +35 -0
  138. package/template/.claude/skills/hallmark/references/macrostructures/02-long-document.md +34 -0
  139. package/template/.claude/skills/hallmark/references/macrostructures/03-marquee-hero.md +31 -0
  140. package/template/.claude/skills/hallmark/references/macrostructures/04-stat-led.md +32 -0
  141. package/template/.claude/skills/hallmark/references/macrostructures/05-workbench.md +32 -0
  142. package/template/.claude/skills/hallmark/references/macrostructures/06-conversational-faq.md +33 -0
  143. package/template/.claude/skills/hallmark/references/macrostructures/07-manifesto.md +32 -0
  144. package/template/.claude/skills/hallmark/references/macrostructures/08-photographic.md +34 -0
  145. package/template/.claude/skills/hallmark/references/macrostructures/09-quote-led.md +32 -0
  146. package/template/.claude/skills/hallmark/references/macrostructures/10-specimen.md +32 -0
  147. package/template/.claude/skills/hallmark/references/macrostructures/11-catalogue.md +23 -0
  148. package/template/.claude/skills/hallmark/references/macrostructures/12-letter.md +23 -0
  149. package/template/.claude/skills/hallmark/references/macrostructures/13-index-first.md +23 -0
  150. package/template/.claude/skills/hallmark/references/macrostructures/14-narrative-workflow.md +23 -0
  151. package/template/.claude/skills/hallmark/references/macrostructures/15-split-studio.md +23 -0
  152. package/template/.claude/skills/hallmark/references/macrostructures/16-feature-stack.md +23 -0
  153. package/template/.claude/skills/hallmark/references/macrostructures/17-type-specimen.md +23 -0
  154. package/template/.claude/skills/hallmark/references/macrostructures/18-portfolio-grid.md +23 -0
  155. package/template/.claude/skills/hallmark/references/macrostructures/19-map-diagram.md +23 -0
  156. package/template/.claude/skills/hallmark/references/macrostructures/20-ecosystem-index.md +23 -0
  157. package/template/.claude/skills/hallmark/references/macrostructures/21-component-playground.md +23 -0
  158. package/template/.claude/skills/hallmark/references/macrostructures.md +89 -0
  159. package/template/.claude/skills/hallmark/references/microinteractions.md +260 -0
  160. package/template/.claude/skills/hallmark/references/motion.md +109 -0
  161. package/template/.claude/skills/hallmark/references/preview-examples.md +49 -0
  162. package/template/.claude/skills/hallmark/references/responsive.md +138 -0
  163. package/template/.claude/skills/hallmark/references/slop-test.md +205 -0
  164. package/template/.claude/skills/hallmark/references/structure.md +164 -0
  165. package/template/.claude/skills/hallmark/references/study.md +511 -0
  166. package/template/.claude/skills/hallmark/references/typography.md +243 -0
  167. package/template/.claude/skills/hallmark/references/verbs/audit.md +25 -0
  168. package/template/.claude/skills/hallmark/references/verbs/redesign.md +269 -0
  169. package/template/.claude/skills/hallmark-explore/SKILL.md +137 -0
  170. package/template/.claude/skills/hallmark-explore/references/direction-matrix.md +124 -0
  171. package/template/.claude/skills/hallmark-explore/references/explorer-call.md +68 -0
  172. package/template/.claude/skills/hallmark-explore/scripts/build_compare.py +174 -0
  173. package/template/.claude/skills/hallmark-explore/scripts/scaffold_exploration.py +122 -0
  174. package/template/.claude/skills/hallmark-loop/SKILL.md +105 -0
  175. package/template/.claude/skills/hallmark-loop/references/auditor-call.md +60 -0
  176. package/template/.claude/skills/hallmark-loop/references/capture.md +78 -0
  177. package/template/.claude/skills/hallmark-loop/references/loop-control.md +79 -0
  178. package/template/.claude/skills/handoff/SKILL.md +15 -0
  179. package/template/.claude/skills/install.ps1 +42 -0
  180. package/template/.claude/skills/install.sh +54 -0
  181. package/template/.claude/skills/knowledge-crunching/SKILL.md +130 -0
  182. package/template/.claude/skills/knowledge-crunching/assets/context.template.md +59 -0
  183. package/template/.claude/skills/knowledge-crunching/references/crunching-dialogue.md +113 -0
  184. package/template/.claude/skills/research/SKILL.md +69 -0
  185. package/template/.claude/skills/skill-creator/LICENSE.txt +202 -0
  186. package/template/.claude/skills/skill-creator/SKILL.md +149 -0
  187. package/template/.claude/skills/skill-creator/agents/analyzer.md +274 -0
  188. package/template/.claude/skills/skill-creator/agents/comparator.md +202 -0
  189. package/template/.claude/skills/skill-creator/agents/grader.md +223 -0
  190. package/template/.claude/skills/skill-creator/assets/eval_review.html +146 -0
  191. package/template/.claude/skills/skill-creator/eval-viewer/generate_review.py +471 -0
  192. package/template/.claude/skills/skill-creator/eval-viewer/viewer.html +1325 -0
  193. package/template/.claude/skills/skill-creator/references/benchmark-optimization-guide.md +86 -0
  194. package/template/.claude/skills/skill-creator/references/distribution-guide.md +79 -0
  195. package/template/.claude/skills/skill-creator/references/eval-infrastructure-guide.md +129 -0
  196. package/template/.claude/skills/skill-creator/references/eval-schemas.md +121 -0
  197. package/template/.claude/skills/skill-creator/references/mcp-skills-integration.md +71 -0
  198. package/template/.claude/skills/skill-creator/references/metadata-quality-criteria.md +94 -0
  199. package/template/.claude/skills/skill-creator/references/plugin-marketplace-hosting.md +104 -0
  200. package/template/.claude/skills/skill-creator/references/plugin-marketplace-overview.md +89 -0
  201. package/template/.claude/skills/skill-creator/references/plugin-marketplace-schema.md +93 -0
  202. package/template/.claude/skills/skill-creator/references/plugin-marketplace-sources.md +103 -0
  203. package/template/.claude/skills/skill-creator/references/plugin-marketplace-troubleshooting.md +76 -0
  204. package/template/.claude/skills/skill-creator/references/script-quality-criteria.md +106 -0
  205. package/template/.claude/skills/skill-creator/references/skill-anatomy-and-requirements.md +77 -0
  206. package/template/.claude/skills/skill-creator/references/skill-creation-workflow.md +151 -0
  207. package/template/.claude/skills/skill-creator/references/skill-design-patterns.md +75 -0
  208. package/template/.claude/skills/skill-creator/references/skillmark-benchmark-criteria.md +102 -0
  209. package/template/.claude/skills/skill-creator/references/structure-organization-criteria.md +114 -0
  210. package/template/.claude/skills/skill-creator/references/testing-and-iteration.md +78 -0
  211. package/template/.claude/skills/skill-creator/references/token-efficiency-criteria.md +74 -0
  212. package/template/.claude/skills/skill-creator/references/troubleshooting-guide.md +81 -0
  213. package/template/.claude/skills/skill-creator/references/validation-checklist.md +83 -0
  214. package/template/.claude/skills/skill-creator/references/writing-effective-instructions.md +88 -0
  215. package/template/.claude/skills/skill-creator/references/yaml-frontmatter-reference.md +92 -0
  216. package/template/.claude/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  217. package/template/.claude/skills/skill-creator/scripts/encoding_utils.py +36 -0
  218. package/template/.claude/skills/skill-creator/scripts/generate_report.py +326 -0
  219. package/template/.claude/skills/skill-creator/scripts/improve_description.py +248 -0
  220. package/template/.claude/skills/skill-creator/scripts/init_skill.py +360 -0
  221. package/template/.claude/skills/skill-creator/scripts/package_skill.py +143 -0
  222. package/template/.claude/skills/skill-creator/scripts/quick_validate.py +110 -0
  223. package/template/.claude/skills/skill-creator/scripts/run_eval.py +310 -0
  224. package/template/.claude/skills/skill-creator/scripts/run_loop.py +332 -0
  225. package/template/.claude/skills/skill-creator/scripts/utils.py +47 -0
  226. package/template/.claude/skills/tdd/SKILL.md +142 -0
  227. package/template/.claude/skills/tdd/assets/Directory.Build.props +26 -0
  228. package/template/.claude/skills/tdd/deep-modules.md +15 -0
  229. package/template/.claude/skills/tdd/dotnet-build-config.md +21 -0
  230. package/template/.claude/skills/tdd/interface-design.md +31 -0
  231. package/template/.claude/skills/tdd/mocking.md +59 -0
  232. package/template/.claude/skills/tdd/refactoring.md +10 -0
  233. package/template/.claude/skills/tdd/test-per-layer.md +69 -0
  234. package/template/.claude/skills/tdd/tests.md +61 -0
  235. package/template/.claude/statusline.cjs +0 -0
@@ -0,0 +1,360 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Skill Initializer - Creates a new skill from template
4
+
5
+ Usage:
6
+ init_skill.py <skill-name> --path <path>
7
+
8
+ Examples:
9
+ init_skill.py my-new-skill --path skills/public
10
+ init_skill.py my-api-helper --path skills/private
11
+ init_skill.py custom-skill --path /custom/location
12
+ """
13
+
14
+ import sys
15
+ import re
16
+ from pathlib import Path
17
+
18
+ from encoding_utils import configure_utf8_console, write_text_utf8
19
+
20
+ # Fix Windows console encoding for Unicode output (emojis, arrows)
21
+ configure_utf8_console()
22
+
23
+
24
+ SKILL_TEMPLATE = """---
25
+ name: {skill_name}
26
+ description: [TODO: Complete and informative explanation of what the skill does and when to use it. Include WHEN to use this skill - specific scenarios, file types, or tasks that trigger it.]
27
+ ---
28
+
29
+ # {skill_title}
30
+
31
+ ## Overview
32
+
33
+ [TODO: 1-2 sentences explaining what this skill enables]
34
+
35
+ ## Structuring This Skill
36
+
37
+ [TODO: Choose the structure that best fits this skill's purpose. Common patterns:
38
+
39
+ **1. Workflow-Based** (best for sequential processes)
40
+ - Works well when there are clear step-by-step procedures
41
+ - Example: DOCX skill with "Workflow Decision Tree" → "Reading" → "Creating" → "Editing"
42
+ - Structure: ## Overview → ## Workflow Decision Tree → ## Step 1 → ## Step 2...
43
+
44
+ **2. Task-Based** (best for tool collections)
45
+ - Works well when the skill offers different operations/capabilities
46
+ - Example: PDF skill with "Quick Start" → "Merge PDFs" → "Split PDFs" → "Extract Text"
47
+ - Structure: ## Overview → ## Quick Start → ## Task Category 1 → ## Task Category 2...
48
+
49
+ **3. Reference/Guidelines** (best for standards or specifications)
50
+ - Works well for brand guidelines, coding standards, or requirements
51
+ - Example: Brand styling with "Brand Guidelines" → "Colors" → "Typography" → "Features"
52
+ - Structure: ## Overview → ## Guidelines → ## Specifications → ## Usage...
53
+
54
+ **4. Capabilities-Based** (best for integrated systems)
55
+ - Works well when the skill provides multiple interrelated features
56
+ - Example: Product Management with "Core Capabilities" → numbered capability list
57
+ - Structure: ## Overview → ## Core Capabilities → ### 1. Feature → ### 2. Feature...
58
+
59
+ Patterns can be mixed and matched as needed. Most skills combine patterns (e.g., start with task-based, add workflow for complex operations).
60
+
61
+ Delete this entire "Structuring This Skill" section when done - it's just guidance.]
62
+
63
+ ## [TODO: Replace with the first main section based on chosen structure]
64
+
65
+ [TODO: Add content here. See examples in existing skills:
66
+ - Code samples for technical skills
67
+ - Decision trees for complex workflows
68
+ - Concrete examples with realistic user requests
69
+ - References to scripts/templates/references as needed]
70
+
71
+ ## Resources
72
+
73
+ This skill includes example resource directories that demonstrate how to organize different types of bundled resources:
74
+
75
+ ### scripts/
76
+ Executable code (Python/Bash/etc.) that can be run directly to perform specific operations.
77
+
78
+ **Examples from other skills:**
79
+ - PDF skill: `fill_fillable_fields.py`, `extract_form_field_info.py` - utilities for PDF manipulation
80
+ - DOCX skill: `document.py`, `utilities.py` - Python modules for document processing
81
+
82
+ **Appropriate for:** Python scripts, shell scripts, or any executable code that performs automation, data processing, or specific operations.
83
+
84
+ **Note:** Scripts may be executed without loading into context, but can still be read by Claude for patching or environment adjustments.
85
+
86
+ ### references/
87
+ Documentation and reference material intended to be loaded into context to inform Claude's process and thinking.
88
+
89
+ **Examples from other skills:**
90
+ - Product management: `communication.md`, `context_building.md` - detailed workflow guides
91
+ - BigQuery: API reference documentation and query examples
92
+ - Finance: Schema documentation, company policies
93
+
94
+ **Appropriate for:** In-depth documentation, API references, database schemas, comprehensive guides, or any detailed information that Claude should reference while working.
95
+
96
+ ### assets/
97
+ Files not intended to be loaded into context, but rather used within the output Claude produces.
98
+
99
+ **Examples from other skills:**
100
+ - Brand styling: PowerPoint template files (.pptx), logo files
101
+ - Frontend builder: HTML/React boilerplate project directories
102
+ - Typography: Font files (.ttf, .woff2)
103
+
104
+ **Appropriate for:** Templates, boilerplate code, document templates, images, icons, fonts, or any files meant to be copied or used in the final output.
105
+
106
+ ---
107
+
108
+ **Any unneeded directories can be deleted.** Not every skill requires all three types of resources.
109
+ """
110
+
111
+ EXAMPLE_SCRIPT = '''#!/usr/bin/env python3
112
+ """
113
+ Example helper script for {skill_name}
114
+
115
+ This is a placeholder script that can be executed directly.
116
+ Replace with actual implementation or delete if not needed.
117
+
118
+ Example real scripts from other skills:
119
+ - pdf/scripts/fill_fillable_fields.py - Fills PDF form fields
120
+ - pdf/scripts/convert_pdf_to_images.py - Converts PDF pages to images
121
+ """
122
+
123
+ def main():
124
+ print("This is an example script for {skill_name}")
125
+ # TODO: Add actual script logic here
126
+ # This could be data processing, file conversion, API calls, etc.
127
+
128
+ if __name__ == "__main__":
129
+ main()
130
+ '''
131
+
132
+ EXAMPLE_REFERENCE = """# Reference Documentation for {skill_title}
133
+
134
+ This is a placeholder for detailed reference documentation.
135
+ Replace with actual reference content or delete if not needed.
136
+
137
+ Example real reference docs from other skills:
138
+ - product-management/references/communication.md - Comprehensive guide for status updates
139
+ - product-management/references/context_building.md - Deep-dive on gathering context
140
+ - bigquery/references/ - API references and query examples
141
+
142
+ ## When Reference Docs Are Useful
143
+
144
+ Reference docs are ideal for:
145
+ - Comprehensive API documentation
146
+ - Detailed workflow guides
147
+ - Complex multi-step processes
148
+ - Information too lengthy for main SKILL.md
149
+ - Content that's only needed for specific use cases
150
+
151
+ ## Structure Suggestions
152
+
153
+ ### API Reference Example
154
+ - Overview
155
+ - Authentication
156
+ - Endpoints with examples
157
+ - Error codes
158
+ - Rate limits
159
+
160
+ ### Workflow Guide Example
161
+ - Prerequisites
162
+ - Step-by-step instructions
163
+ - Common patterns
164
+ - Troubleshooting
165
+ - Best practices
166
+ """
167
+
168
+ EXAMPLE_ASSET = """# Example Asset File
169
+
170
+ This placeholder represents where asset files would be stored.
171
+ Replace with actual asset files (templates, images, fonts, etc.) or delete if not needed.
172
+
173
+ Asset files are NOT intended to be loaded into context, but rather used within
174
+ the output Claude produces.
175
+
176
+ Example asset files from other skills:
177
+ - Brand guidelines: logo.png, slides_template.pptx
178
+ - Frontend builder: hello-world/ directory with HTML/React boilerplate
179
+ - Typography: custom-font.ttf, font-family.woff2
180
+ - Data: sample_data.csv, test_dataset.json
181
+
182
+ ## Common Asset Types
183
+
184
+ - Templates: .pptx, .docx, boilerplate directories
185
+ - Images: .png, .jpg, .svg, .gif
186
+ - Fonts: .ttf, .otf, .woff, .woff2
187
+ - Boilerplate code: Project directories, starter files
188
+ - Icons: .ico, .svg
189
+ - Data files: .csv, .json, .xml, .yaml
190
+
191
+ Note: This is a text placeholder. Actual assets can be any file type.
192
+ """
193
+
194
+
195
+ def title_case_skill_name(skill_name):
196
+ """Convert hyphenated skill name to Title Case for display."""
197
+ return ' '.join(word.capitalize() for word in skill_name.split('-'))
198
+
199
+
200
+ def parse_skill_identifier(skill_identifier):
201
+ """
202
+ Parse and validate skill identifier.
203
+
204
+ Accepted formats:
205
+ - skill-name
206
+ - namespace:skill-name (single colon)
207
+ """
208
+ value = skill_identifier.strip().strip('"').strip("'")
209
+
210
+ if value.count(':') > 1:
211
+ raise ValueError(
212
+ "Skill name must contain at most one colon: use 'skill-name' or "
213
+ "'namespace:skill-name'"
214
+ )
215
+
216
+ namespace = None
217
+ skill_slug = value
218
+ if ':' in value:
219
+ namespace, skill_slug = value.split(':', 1)
220
+
221
+ pattern = r'^[a-z0-9-]+$'
222
+ if namespace and not re.match(pattern, namespace):
223
+ raise ValueError(
224
+ f"Invalid namespace '{namespace}'. Use lowercase letters, digits, and hyphens only."
225
+ )
226
+ if not re.match(pattern, skill_slug):
227
+ raise ValueError(
228
+ f"Invalid skill id '{skill_slug}'. Use lowercase letters, digits, and hyphens only."
229
+ )
230
+
231
+ for label, segment in [("Namespace", namespace), ("Skill id", skill_slug)]:
232
+ if segment and (segment.startswith('-') or segment.endswith('-') or '--' in segment):
233
+ raise ValueError(
234
+ f"{label} '{segment}' cannot start/end with hyphen or contain consecutive hyphens."
235
+ )
236
+
237
+ if len(skill_slug) > 40:
238
+ raise ValueError("Skill id must be 40 characters or fewer.")
239
+
240
+ full_name = f"{namespace}:{skill_slug}" if namespace else skill_slug
241
+ return full_name, skill_slug
242
+
243
+
244
+ def init_skill(skill_name, path):
245
+ """
246
+ Initialize a new skill directory with template SKILL.md.
247
+
248
+ Args:
249
+ skill_name: Name of the skill
250
+ path: Path where the skill directory should be created
251
+
252
+ Returns:
253
+ Path to created skill directory, or None if error
254
+ """
255
+ try:
256
+ full_name, skill_slug = parse_skill_identifier(skill_name)
257
+ except ValueError as exc:
258
+ print(f"āŒ Error: {exc}")
259
+ return None
260
+
261
+ # Determine skill directory path (always use slug for folder name)
262
+ skill_dir = Path(path).resolve() / skill_slug
263
+
264
+ # Check if directory already exists
265
+ if skill_dir.exists():
266
+ print(f"āŒ Error: Skill directory already exists: {skill_dir}")
267
+ return None
268
+
269
+ # Create skill directory
270
+ try:
271
+ skill_dir.mkdir(parents=True, exist_ok=False)
272
+ print(f"āœ… Created skill directory: {skill_dir}")
273
+ except Exception as e:
274
+ print(f"āŒ Error creating directory: {e}")
275
+ return None
276
+
277
+ # Create SKILL.md from template
278
+ skill_title = title_case_skill_name(skill_slug)
279
+ skill_content = SKILL_TEMPLATE.format(
280
+ skill_name=full_name,
281
+ skill_title=skill_title
282
+ )
283
+
284
+ skill_md_path = skill_dir / 'SKILL.md'
285
+ try:
286
+ write_text_utf8(skill_md_path, skill_content)
287
+ print("āœ… Created SKILL.md")
288
+ except Exception as e:
289
+ print(f"āŒ Error creating SKILL.md: {e}")
290
+ return None
291
+
292
+ # Create resource directories with example files
293
+ try:
294
+ # Create scripts/ directory with example script
295
+ scripts_dir = skill_dir / 'scripts'
296
+ scripts_dir.mkdir(exist_ok=True)
297
+ example_script = scripts_dir / 'example.py'
298
+ write_text_utf8(example_script, EXAMPLE_SCRIPT.format(skill_name=full_name))
299
+ example_script.chmod(0o755)
300
+ print("āœ… Created scripts/example.py")
301
+
302
+ # Create references/ directory with example reference doc
303
+ references_dir = skill_dir / 'references'
304
+ references_dir.mkdir(exist_ok=True)
305
+ example_reference = references_dir / 'api_reference.md'
306
+ write_text_utf8(example_reference, EXAMPLE_REFERENCE.format(skill_title=skill_title))
307
+ print("āœ… Created references/api_reference.md")
308
+
309
+ # Create assets/ directory with example asset placeholder
310
+ assets_dir = skill_dir / 'assets'
311
+ assets_dir.mkdir(exist_ok=True)
312
+ example_asset = assets_dir / 'example_asset.txt'
313
+ write_text_utf8(example_asset, EXAMPLE_ASSET)
314
+ print("āœ… Created assets/example_asset.txt")
315
+ except Exception as e:
316
+ print(f"āŒ Error creating resource directories: {e}")
317
+ return None
318
+
319
+ # Print next steps
320
+ print(f"\nāœ… Skill '{full_name}' initialized successfully at {skill_dir}")
321
+ print("\nNext steps:")
322
+ print("1. Edit SKILL.md to complete the TODO items and update the description")
323
+ print("2. Customize or delete the example files in scripts/, references/, and assets/")
324
+ print("3. Run the validator when ready to check the skill structure")
325
+
326
+ return skill_dir
327
+
328
+
329
+ def main():
330
+ if len(sys.argv) < 4 or sys.argv[2] != '--path':
331
+ print("Usage: init_skill.py <skill-name> --path <path>")
332
+ print("\nSkill name requirements:")
333
+ print(" - Use either 'skill-name' or 'namespace:skill-name' (e.g., 'ck:data-analyzer')")
334
+ print(" - Namespace and skill id: lowercase letters, digits, and hyphens only")
335
+ print(" - Skill id max 40 characters")
336
+ print(" - Directory name is always the skill id segment")
337
+ print("\nExamples:")
338
+ print(" init_skill.py my-new-skill --path skills/public")
339
+ print(" init_skill.py ck:my-new-skill --path skills/public")
340
+ print(" init_skill.py my-api-helper --path skills/private")
341
+ print(" init_skill.py custom-skill --path /custom/location")
342
+ sys.exit(1)
343
+
344
+ skill_name = sys.argv[1]
345
+ path = sys.argv[3]
346
+
347
+ print(f"šŸš€ Initializing skill: {skill_name}")
348
+ print(f" Location: {path}")
349
+ print()
350
+
351
+ result = init_skill(skill_name, path)
352
+
353
+ if result:
354
+ sys.exit(0)
355
+ else:
356
+ sys.exit(1)
357
+
358
+
359
+ if __name__ == "__main__":
360
+ main()
@@ -0,0 +1,143 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Skill Packager - Creates a distributable zip file of a skill folder
4
+
5
+ Usage:
6
+ python utils/package_skill.py <path/to/skill-folder> [output-directory]
7
+
8
+ Example:
9
+ python utils/package_skill.py skills/public/my-skill
10
+ python utils/package_skill.py skills/public/my-skill ./dist
11
+ """
12
+
13
+ import fnmatch
14
+ import sys
15
+ import zipfile
16
+ from pathlib import Path
17
+
18
+ from encoding_utils import configure_utf8_console
19
+ from quick_validate import validate_skill
20
+
21
+ # Fix Windows console encoding for Unicode output (emojis, arrows)
22
+ configure_utf8_console()
23
+
24
+ # Exclusion patterns (from official Anthropic skill-creator)
25
+ EXCLUDE_DIRS = {'__pycache__', 'node_modules', '.git', '.DS_Store'}
26
+ EXCLUDE_GLOBS = {'*.pyc', '*.pyo', '.DS_Store', '*.egg-info'}
27
+ ROOT_EXCLUDE_DIRS = {'evals'} # Only excluded at skill root level
28
+
29
+
30
+ def package_skill(skill_path, output_dir=None):
31
+ """
32
+ Package a skill folder into a zip file.
33
+
34
+ Args:
35
+ skill_path: Path to the skill folder
36
+ output_dir: Optional output directory for the zip file (defaults to current directory)
37
+
38
+ Returns:
39
+ Path to the created zip file, or None if error
40
+ """
41
+ skill_path = Path(skill_path).resolve()
42
+
43
+ # Validate skill folder exists
44
+ if not skill_path.exists():
45
+ print(f"āŒ Error: Skill folder not found: {skill_path}")
46
+ return None
47
+
48
+ if not skill_path.is_dir():
49
+ print(f"āŒ Error: Path is not a directory: {skill_path}")
50
+ return None
51
+
52
+ # Validate SKILL.md exists
53
+ skill_md = skill_path / "SKILL.md"
54
+ if not skill_md.exists():
55
+ print(f"āŒ Error: SKILL.md not found in {skill_path}")
56
+ return None
57
+
58
+ # Run validation before packaging
59
+ print("šŸ” Validating skill...")
60
+ valid, message = validate_skill(skill_path)
61
+ if not valid:
62
+ print(f"āŒ Validation failed: {message}")
63
+ print(" Please fix the validation errors before packaging.")
64
+ return None
65
+ print(f"āœ… {message}\n")
66
+
67
+ # Determine output location
68
+ skill_name = skill_path.name
69
+ if output_dir:
70
+ output_path = Path(output_dir).resolve()
71
+ output_path.mkdir(parents=True, exist_ok=True)
72
+ else:
73
+ output_path = Path.cwd()
74
+
75
+ zip_filename = output_path / f"{skill_name}.zip"
76
+
77
+ # Create the zip file
78
+ try:
79
+ with zipfile.ZipFile(zip_filename, 'w', zipfile.ZIP_DEFLATED) as zipf:
80
+ # Walk through the skill directory, excluding unwanted files
81
+ skipped = []
82
+ for file_path in skill_path.rglob('*'):
83
+ if file_path.is_file():
84
+ rel = file_path.relative_to(skill_path)
85
+ parts = rel.parts
86
+
87
+ # Skip excluded directories
88
+ if any(p in EXCLUDE_DIRS for p in parts):
89
+ skipped.append(str(rel))
90
+ continue
91
+
92
+ # Skip root-only excluded dirs (e.g., evals/)
93
+ if parts[0] in ROOT_EXCLUDE_DIRS:
94
+ skipped.append(str(rel))
95
+ continue
96
+
97
+ # Skip excluded file patterns
98
+ if any(fnmatch.fnmatch(file_path.name, g) for g in EXCLUDE_GLOBS):
99
+ skipped.append(str(rel))
100
+ continue
101
+
102
+ arcname = file_path.relative_to(skill_path.parent)
103
+ zipf.write(file_path, arcname)
104
+ print(f" Added: {arcname}")
105
+
106
+ if skipped:
107
+ print(f"\n Skipped {len(skipped)} file(s): {', '.join(skipped[:5])}"
108
+ + ("..." if len(skipped) > 5 else ""))
109
+
110
+ print(f"\nāœ… Successfully packaged skill to: {zip_filename}")
111
+ return zip_filename
112
+
113
+ except Exception as e:
114
+ print(f"āŒ Error creating zip file: {e}")
115
+ return None
116
+
117
+
118
+ def main():
119
+ if len(sys.argv) < 2:
120
+ print("Usage: python utils/package_skill.py <path/to/skill-folder> [output-directory]")
121
+ print("\nExample:")
122
+ print(" python utils/package_skill.py skills/public/my-skill")
123
+ print(" python utils/package_skill.py skills/public/my-skill ./dist")
124
+ sys.exit(1)
125
+
126
+ skill_path = sys.argv[1]
127
+ output_dir = sys.argv[2] if len(sys.argv) > 2 else None
128
+
129
+ print(f"šŸ“¦ Packaging skill: {skill_path}")
130
+ if output_dir:
131
+ print(f" Output directory: {output_dir}")
132
+ print()
133
+
134
+ result = package_skill(skill_path, output_dir)
135
+
136
+ if result:
137
+ sys.exit(0)
138
+ else:
139
+ sys.exit(1)
140
+
141
+
142
+ if __name__ == "__main__":
143
+ main()
@@ -0,0 +1,110 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Quick validation script for skills - minimal version
4
+ """
5
+
6
+ import sys
7
+ import re
8
+ from pathlib import Path
9
+
10
+ from encoding_utils import configure_utf8_console, read_text_utf8
11
+
12
+ # Fix Windows console encoding for Unicode output
13
+ configure_utf8_console()
14
+
15
+ def validate_skill(skill_path):
16
+ """Basic validation of a skill"""
17
+ skill_path = Path(skill_path)
18
+
19
+ # Check SKILL.md exists
20
+ skill_md = skill_path / 'SKILL.md'
21
+ if not skill_md.exists():
22
+ return False, "SKILL.md not found"
23
+
24
+ # Read and validate frontmatter
25
+ content = read_text_utf8(skill_md)
26
+ if not content.startswith('---'):
27
+ return False, "No YAML frontmatter found"
28
+
29
+ # Extract frontmatter
30
+ match = re.match(r'^---\n(.*?)\n---', content, re.DOTALL)
31
+ if not match:
32
+ return False, "Invalid frontmatter format"
33
+
34
+ frontmatter = match.group(1)
35
+
36
+ # Check required fields
37
+ if 'name:' not in frontmatter:
38
+ return False, "Missing 'name' in frontmatter"
39
+ if 'description:' not in frontmatter:
40
+ return False, "Missing 'description' in frontmatter"
41
+
42
+ # Extract name for validation
43
+ name_match = re.search(r'name:\s*(.+)', frontmatter)
44
+ if name_match:
45
+ name = name_match.group(1).strip().strip('"').strip("'")
46
+
47
+ # Support namespaced identifiers: ck:skill-name (single namespace segment)
48
+ if name.count(':') > 1:
49
+ return False, (
50
+ f"Name '{name}' is invalid. Use either 'skill-name' or "
51
+ "'namespace:skill-name' with a single colon."
52
+ )
53
+
54
+ namespace = None
55
+ skill_id = name
56
+ if ':' in name:
57
+ namespace, skill_id = name.split(':', 1)
58
+
59
+ id_pattern = r'^[a-z0-9-]+$'
60
+ if namespace and not re.match(id_pattern, namespace):
61
+ return False, (
62
+ f"Namespace '{namespace}' must be lowercase letters, digits, and hyphens only"
63
+ )
64
+
65
+ if not re.match(id_pattern, skill_id):
66
+ return False, (
67
+ f"Skill id '{skill_id}' must be lowercase letters, digits, and hyphens only"
68
+ )
69
+
70
+ for segment_name, segment in [("namespace", namespace), ("skill id", skill_id)]:
71
+ if segment and (segment.startswith('-') or segment.endswith('-') or '--' in segment):
72
+ return False, (
73
+ f"{segment_name.capitalize()} '{segment}' cannot start/end with hyphen "
74
+ "or contain consecutive hyphens"
75
+ )
76
+
77
+ # Validate name length (official max: 64 chars)
78
+ if name_match:
79
+ if len(skill_id) > 64:
80
+ return False, f"Skill id '{skill_id}' exceeds 64 characters ({len(skill_id)})"
81
+ if namespace and len(namespace) > 64:
82
+ return False, f"Namespace '{namespace}' exceeds 64 characters ({len(namespace)})"
83
+
84
+ # Extract and validate description
85
+ desc_match = re.search(r'description:\s*(.+)', frontmatter)
86
+ if desc_match:
87
+ description = desc_match.group(1).strip().strip('"').strip("'")
88
+
89
+ # YAML block scalar indicators are valid (e.g. description: >-)
90
+ if description in {'>', '>-', '|', '|-'}:
91
+ description = ''
92
+
93
+ # Check for angle brackets
94
+ if '<' in description or '>' in description:
95
+ return False, "Description cannot contain angle brackets (< or >)"
96
+
97
+ # Check description length (official max: 1024 chars)
98
+ if len(description) > 1024:
99
+ return False, f"Description exceeds 1024 characters ({len(description)})"
100
+
101
+ return True, "Skill is valid!"
102
+
103
+ if __name__ == "__main__":
104
+ if len(sys.argv) != 2:
105
+ print("Usage: python quick_validate.py <skill_directory>")
106
+ sys.exit(1)
107
+
108
+ valid, message = validate_skill(sys.argv[1])
109
+ print(message)
110
+ sys.exit(0 if valid else 1)