ma-agents 3.2.0 → 3.3.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 (86) hide show
  1. package/.opencode/skills/.ma-agents.json +99 -99
  2. package/.roo/rules/00-ma-agents.md +13 -0
  3. package/.roo/skills/.ma-agents.json +241 -0
  4. package/.roo/skills/MANIFEST.yaml +254 -0
  5. package/.roo/skills/ai-audit-trail/SKILL.md +23 -0
  6. package/.roo/skills/auto-bug-detection/SKILL.md +169 -0
  7. package/.roo/skills/cmake-best-practices/SKILL.md +64 -0
  8. package/.roo/skills/cmake-best-practices/examples/cmake.md +59 -0
  9. package/.roo/skills/code-documentation/SKILL.md +57 -0
  10. package/.roo/skills/code-documentation/examples/cpp.md +29 -0
  11. package/.roo/skills/code-documentation/examples/csharp.md +28 -0
  12. package/.roo/skills/code-documentation/examples/javascript_typescript.md +28 -0
  13. package/.roo/skills/code-documentation/examples/python.md +57 -0
  14. package/.roo/skills/code-review/SKILL.md +43 -0
  15. package/.roo/skills/commit-message/SKILL.md +79 -0
  16. package/.roo/skills/cpp-best-practices/SKILL.md +234 -0
  17. package/.roo/skills/cpp-best-practices/examples/modern-idioms.md +189 -0
  18. package/.roo/skills/cpp-best-practices/examples/naming-and-organization.md +102 -0
  19. package/.roo/skills/cpp-concurrency-safety/SKILL.md +60 -0
  20. package/.roo/skills/cpp-concurrency-safety/examples/concurrency.md +73 -0
  21. package/.roo/skills/cpp-const-correctness/SKILL.md +63 -0
  22. package/.roo/skills/cpp-const-correctness/examples/const_correctness.md +54 -0
  23. package/.roo/skills/cpp-memory-handling/SKILL.md +42 -0
  24. package/.roo/skills/cpp-memory-handling/examples/modern-cpp.md +49 -0
  25. package/.roo/skills/cpp-memory-handling/examples/smart-pointers.md +46 -0
  26. package/.roo/skills/cpp-modern-composition/SKILL.md +64 -0
  27. package/.roo/skills/cpp-modern-composition/examples/composition.md +51 -0
  28. package/.roo/skills/cpp-robust-interfaces/SKILL.md +55 -0
  29. package/.roo/skills/cpp-robust-interfaces/examples/interfaces.md +56 -0
  30. package/.roo/skills/create-hardened-docker-skill/SKILL.md +637 -0
  31. package/.roo/skills/create-hardened-docker-skill/scripts/create-all.sh +489 -0
  32. package/.roo/skills/csharp-best-practices/SKILL.md +278 -0
  33. package/.roo/skills/docker-hardening-verification/SKILL.md +28 -0
  34. package/.roo/skills/docker-hardening-verification/scripts/verify-hardening.sh +39 -0
  35. package/.roo/skills/docker-image-signing/SKILL.md +28 -0
  36. package/.roo/skills/docker-image-signing/scripts/sign-image.sh +33 -0
  37. package/.roo/skills/document-revision-history/SKILL.md +104 -0
  38. package/.roo/skills/git-workflow-skill/SKILL.md +194 -0
  39. package/.roo/skills/git-workflow-skill/hooks/commit-msg +61 -0
  40. package/.roo/skills/git-workflow-skill/hooks/pre-commit +38 -0
  41. package/.roo/skills/git-workflow-skill/hooks/prepare-commit-msg +56 -0
  42. package/.roo/skills/git-workflow-skill/scripts/finish-feature.sh +192 -0
  43. package/.roo/skills/git-workflow-skill/scripts/install-hooks.sh +55 -0
  44. package/.roo/skills/git-workflow-skill/scripts/start-feature.sh +110 -0
  45. package/.roo/skills/git-workflow-skill/scripts/validate-workflow.sh +229 -0
  46. package/.roo/skills/js-ts-dependency-mgmt/SKILL.md +49 -0
  47. package/.roo/skills/js-ts-dependency-mgmt/examples/dependency_mgmt.md +60 -0
  48. package/.roo/skills/js-ts-security-skill/SKILL.md +64 -0
  49. package/.roo/skills/js-ts-security-skill/scripts/verify-security.sh +136 -0
  50. package/.roo/skills/logging-best-practices/SKILL.md +50 -0
  51. package/.roo/skills/logging-best-practices/examples/cpp.md +36 -0
  52. package/.roo/skills/logging-best-practices/examples/csharp.md +49 -0
  53. package/.roo/skills/logging-best-practices/examples/javascript.md +77 -0
  54. package/.roo/skills/logging-best-practices/examples/python.md +57 -0
  55. package/.roo/skills/logging-best-practices/references/logging-standards.md +29 -0
  56. package/.roo/skills/open-presentation/SKILL.md +35 -0
  57. package/.roo/skills/opentelemetry-best-practices/SKILL.md +34 -0
  58. package/.roo/skills/opentelemetry-best-practices/examples/go.md +32 -0
  59. package/.roo/skills/opentelemetry-best-practices/examples/javascript.md +58 -0
  60. package/.roo/skills/opentelemetry-best-practices/examples/python.md +37 -0
  61. package/.roo/skills/opentelemetry-best-practices/references/otel-standards.md +37 -0
  62. package/.roo/skills/python-best-practices/SKILL.md +385 -0
  63. package/.roo/skills/python-dependency-mgmt/SKILL.md +42 -0
  64. package/.roo/skills/python-dependency-mgmt/examples/dependency_mgmt.md +67 -0
  65. package/.roo/skills/python-security-skill/SKILL.md +56 -0
  66. package/.roo/skills/python-security-skill/examples/security.md +56 -0
  67. package/.roo/skills/self-signed-cert/SKILL.md +42 -0
  68. package/.roo/skills/self-signed-cert/scripts/generate-cert.ps1 +45 -0
  69. package/.roo/skills/self-signed-cert/scripts/generate-cert.sh +43 -0
  70. package/.roo/skills/skill-creator/SKILL.md +196 -0
  71. package/.roo/skills/skill-creator/references/output-patterns.md +82 -0
  72. package/.roo/skills/skill-creator/references/workflows.md +28 -0
  73. package/.roo/skills/skill-creator/scripts/init_skill.py +208 -0
  74. package/.roo/skills/skill-creator/scripts/package_skill.py +99 -0
  75. package/.roo/skills/skill-creator/scripts/quick_validate.py +113 -0
  76. package/.roo/skills/story-status-lookup/SKILL.md +78 -0
  77. package/.roo/skills/test-accompanied-development/SKILL.md +50 -0
  78. package/.roo/skills/test-generator/SKILL.md +65 -0
  79. package/.roo/skills/vercel-react-best-practices/SKILL.md +109 -0
  80. package/.roo/skills/verify-hardened-docker-skill/SKILL.md +442 -0
  81. package/.roo/skills/verify-hardened-docker-skill/scripts/verify-docker-hardening.sh +439 -0
  82. package/README.md +2 -1
  83. package/lib/agents.js +23 -0
  84. package/package.json +4 -3
  85. package/test/roo-code-agent.test.js +166 -0
  86. package/test/roo-code-injection.test.js +172 -0
@@ -0,0 +1,43 @@
1
+ #!/bin/bash
2
+ # generate-cert.sh - Part of ma-agents self-signed-cert skill
3
+
4
+ TYPE=$1
5
+ NAME=${2:-"server"}
6
+ DNS=${3:-"localhost"}
7
+
8
+ if [ "$TYPE" == "root" ]; then
9
+ echo "Generating Root CA..."
10
+ openssl genrsa -out "${NAME}_rootCA.key" 4096
11
+ openssl req -x509 -new -nodes -key "${NAME}_rootCA.key" -sha256 -days 3650 -out "${NAME}_rootCA.crt" \
12
+ -subj "/CN=${NAME}-Root-CA/O=MA-Agents/C=US"
13
+ chmod 600 "${NAME}_rootCA.key"
14
+ echo "Root CA created: ${NAME}_rootCA.crt"
15
+
16
+ elif [ "$TYPE" == "cert" ]; then
17
+ CA_KEY=$4
18
+ CA_CRT=$5
19
+
20
+ if [ -z "$CA_KEY" ] || [ -z "$CA_CRT" ]; then
21
+ echo "Generating standalone self-signed certificate..."
22
+ openssl req -x509 -newnodes -days 365 -newkey rsa:2048 \
23
+ -keyout "${NAME}.key" -out "${NAME}.crt" \
24
+ -subj "/CN=${DNS}/O=MA-Agents" \
25
+ -addext "subjectAltName = DNS:${DNS}"
26
+ else
27
+ echo "Generating certificate signed by CA..."
28
+ openssl genrsa -out "${NAME}.key" 2048
29
+ openssl req -new -key "${NAME}.key" -out "${NAME}.csr" -subj "/CN=${DNS}/O=MA-Agents"
30
+
31
+ # Extension file for SAN
32
+ echo "subjectAltName = DNS:${DNS}" > "${NAME}.ext"
33
+
34
+ openssl x509 -req -in "${NAME}.csr" -CA "$CA_CRT" -CAkey "$CA_KEY" -CAcreateserial \
35
+ -out "${NAME}.crt" -days 365 -sha256 -extfile "${NAME}.ext"
36
+ rm "${NAME}.csr" "${NAME}.ext"
37
+ fi
38
+ chmod 600 "${NAME}.key"
39
+ echo "Certificate created: ${NAME}.crt"
40
+ else
41
+ echo "Usage: $0 [root|cert] [name] [dns] [ca_key] [ca_crt]"
42
+ exit 1
43
+ fi
@@ -0,0 +1,196 @@
1
+ ---
2
+ name: Skill Creator
3
+ description: Guide for creating effective skills that extend Claude's capabilities with specialized knowledge, workflows, and tool integrations
4
+ ---
5
+ # Skill Creator
6
+
7
+ This skill provides guidance for creating effective skills.
8
+
9
+ ## About Skills
10
+
11
+ Skills are modular, self-contained packages that extend Claude's capabilities by providing
12
+ specialized knowledge, workflows, and tools. Think of them as "onboarding guides" for specific
13
+ domains or tasks—they transform Claude from a general-purpose agent into a specialized agent
14
+ equipped with procedural knowledge that no model can fully possess.
15
+
16
+ ### What Skills Provide
17
+
18
+ 1. Specialized workflows - Multi-step procedures for specific domains
19
+ 2. Tool integrations - Instructions for working with specific file formats or APIs
20
+ 3. Domain expertise - Company-specific knowledge, schemas, business logic
21
+ 4. Bundled resources - Scripts, references, and assets for complex and repetitive tasks
22
+
23
+ ## Core Principles
24
+
25
+ ### Concise is Key
26
+
27
+ The context window is a public good. Skills share the context window with everything else Claude needs: system prompt, conversation history, other Skills' metadata, and the actual user request.
28
+
29
+ **Default assumption: Claude is already very smart.** Only add context Claude doesn't already have. Challenge each piece of information: "Does Claude really need this explanation?" and "Does this paragraph justify its token cost?"
30
+
31
+ Prefer concise examples over verbose explanations.
32
+
33
+ ### Set Appropriate Degrees of Freedom
34
+
35
+ Match the level of specificity to the task's fragility and variability:
36
+
37
+ **High freedom (text-based instructions)**: Use when multiple approaches are valid, decisions depend on context, or heuristics guide the approach.
38
+
39
+ **Medium freedom (pseudocode or scripts with parameters)**: Use when a preferred pattern exists, some variation is acceptable, or configuration affects behavior.
40
+
41
+ **Low freedom (specific scripts, few parameters)**: Use when operations are fragile and error-prone, consistency is critical, or a specific sequence must be followed.
42
+
43
+ ### Anatomy of a Skill
44
+
45
+ Every skill consists of a required SKILL.md file and optional bundled resources:
46
+
47
+ ```
48
+ skill-name/
49
+ ├── SKILL.md (required)
50
+ │ ├── YAML frontmatter metadata (required)
51
+ │ │ ├── name: (required)
52
+ │ │ ├── description: (required)
53
+ │ │ └── compatibility: (optional, rarely needed)
54
+ │ └── Markdown instructions (required)
55
+ └── Bundled Resources (optional)
56
+ ├── scripts/ - Executable code (Python/Bash/etc.)
57
+ ├── references/ - Documentation intended to be loaded into context as needed
58
+ └── assets/ - Files used in output (templates, icons, fonts, etc.)
59
+ ```
60
+
61
+ #### SKILL.md (required)
62
+
63
+ - **Frontmatter** (YAML): Contains `name` and `description` fields (required), plus optional fields like `license`, `metadata`, and `compatibility`. Only `name` and `description` are read by Claude to determine when the skill triggers.
64
+ - **Body** (Markdown): Instructions and guidance for using the skill. Only loaded AFTER the skill triggers.
65
+
66
+ #### Bundled Resources (optional)
67
+
68
+ ##### Scripts (`scripts/`)
69
+
70
+ Executable code for tasks that require deterministic reliability or are repeatedly rewritten.
71
+
72
+ - **When to include**: When the same code is being rewritten repeatedly or deterministic reliability is needed
73
+ - **Benefits**: Token efficient, deterministic, may be executed without loading into context
74
+
75
+ ##### References (`references/`)
76
+
77
+ Documentation intended to be loaded as needed into context.
78
+
79
+ - **When to include**: For documentation that Claude should reference while working
80
+ - **Use cases**: Database schemas, API documentation, domain knowledge, company policies
81
+ - **Best practice**: If files are large (>10k words), include grep search patterns in SKILL.md
82
+ - **Avoid duplication**: Information lives in either SKILL.md or references files, not both
83
+
84
+ ##### Assets (`assets/`)
85
+
86
+ Files not intended to be loaded into context, but used within the output Claude produces.
87
+
88
+ - **When to include**: When the skill needs files for final output
89
+ - **Use cases**: Templates, images, icons, boilerplate code, fonts, sample documents
90
+
91
+ #### What NOT to Include
92
+
93
+ Do NOT create: README.md, INSTALLATION_GUIDE.md, QUICK_REFERENCE.md, CHANGELOG.md, or other auxiliary documentation. The skill should only contain information needed for an AI agent to execute tasks.
94
+
95
+ ### Progressive Disclosure Design Principle
96
+
97
+ Three-level loading system:
98
+
99
+ 1. **Metadata (name + description)** - Always in context (~100 words)
100
+ 2. **SKILL.md body** - When skill triggers (<5k words)
101
+ 3. **Bundled resources** - As needed by Claude (Unlimited)
102
+
103
+ Keep SKILL.md body under 500 lines. Split content into separate files when approaching this limit.
104
+
105
+ **Pattern 1: High-level guide with references**
106
+
107
+ ```markdown
108
+ # PDF Processing
109
+ ## Quick start
110
+ Extract text with pdfplumber: [code example]
111
+ ## Advanced features
112
+ - **Form filling**: See [FORMS.md](FORMS.md) for complete guide
113
+ - **API reference**: See [REFERENCE.md](REFERENCE.md) for all methods
114
+ ```
115
+
116
+ **Pattern 2: Domain-specific organization**
117
+
118
+ ```
119
+ bigquery-skill/
120
+ ├── SKILL.md (overview and navigation)
121
+ └── references/
122
+ ├── finance.md (revenue, billing metrics)
123
+ ├── sales.md (opportunities, pipeline)
124
+ └── product.md (API usage, features)
125
+ ```
126
+
127
+ **Pattern 3: Conditional details**
128
+
129
+ ```markdown
130
+ # DOCX Processing
131
+ ## Creating documents
132
+ Use docx-js for new documents. See [DOCX-JS.md](DOCX-JS.md).
133
+ ## Editing documents
134
+ For simple edits, modify the XML directly.
135
+ **For tracked changes**: See [REDLINING.md](REDLINING.md)
136
+ ```
137
+
138
+ ## Skill Creation Process
139
+
140
+ 1. Understand the skill with concrete examples
141
+ 2. Plan reusable skill contents (scripts, references, assets)
142
+ 3. Initialize the skill (run scripts/init_skill.py)
143
+ 4. Edit the skill (implement resources and write SKILL.md)
144
+ 5. Package the skill (run scripts/package_skill.py)
145
+ 6. Iterate based on real usage
146
+
147
+ ### Step 1: Understanding the Skill with Concrete Examples
148
+
149
+ Gather concrete examples of how the skill will be used. Ask users clarifying questions about functionality and triggers. Conclude when there's clear understanding of supported functionality.
150
+
151
+ ### Step 2: Planning the Reusable Skill Contents
152
+
153
+ Analyze each concrete example:
154
+ 1. Consider how to execute the example from scratch
155
+ 2. Identify what scripts, references, and assets would be helpful for repeated execution
156
+
157
+ ### Step 3: Initializing the Skill
158
+
159
+ ```bash
160
+ scripts/init_skill.py <skill-name> --path <output-directory>
161
+ ```
162
+
163
+ Creates skill directory with SKILL.md template, example resource directories, and placeholder files.
164
+
165
+ ### Step 4: Edit the Skill
166
+
167
+ **Writing guideline:** Always use imperative/infinitive form.
168
+
169
+ **Update Frontmatter:**
170
+ - `name`: The skill name
171
+ - `description`: Include both what the skill does AND specific triggers/contexts for when to use it
172
+
173
+ **Update Body:**
174
+ - Write instructions for using the skill and bundled resources
175
+ - For multi-step processes: See references/workflows.md
176
+ - For specific output formats: See references/output-patterns.md
177
+
178
+ **Start with Reusable Skill Contents:**
179
+ - Implement scripts, references, and assets first
180
+ - Test scripts by running them
181
+ - Delete example files not needed for the skill
182
+
183
+ ### Step 5: Packaging a Skill
184
+
185
+ ```bash
186
+ scripts/package_skill.py <path/to/skill-folder> [output-directory]
187
+ ```
188
+
189
+ Validates and packages the skill into a distributable .skill file (zip format).
190
+
191
+ ### Step 6: Iterate
192
+
193
+ 1. Use the skill on real tasks
194
+ 2. Notice struggles or inefficiencies
195
+ 3. Identify how SKILL.md or bundled resources should be updated
196
+ 4. Implement changes and test again
@@ -0,0 +1,82 @@
1
+ # Output Patterns
2
+
3
+ Use these patterns when skills need to produce consistent, high-quality output.
4
+
5
+ ## Template Pattern
6
+
7
+ Provide templates for output format. Match the level of strictness to your needs.
8
+
9
+ **For strict requirements (like API responses or data formats):**
10
+
11
+ ```markdown
12
+ ## Report structure
13
+
14
+ ALWAYS use this exact template structure:
15
+
16
+ # [Analysis Title]
17
+
18
+ ## Executive summary
19
+ [One-paragraph overview of key findings]
20
+
21
+ ## Key findings
22
+ - Finding 1 with supporting data
23
+ - Finding 2 with supporting data
24
+ - Finding 3 with supporting data
25
+
26
+ ## Recommendations
27
+ 1. Specific actionable recommendation
28
+ 2. Specific actionable recommendation
29
+ ```
30
+
31
+ **For flexible guidance (when adaptation is useful):**
32
+
33
+ ```markdown
34
+ ## Report structure
35
+
36
+ Here is a sensible default format, but use your best judgment:
37
+
38
+ # [Analysis Title]
39
+
40
+ ## Executive summary
41
+ [Overview]
42
+
43
+ ## Key findings
44
+ [Adapt sections based on what you discover]
45
+
46
+ ## Recommendations
47
+ [Tailor to the specific context]
48
+
49
+ Adjust sections as needed for the specific analysis type.
50
+ ```
51
+
52
+ ## Examples Pattern
53
+
54
+ For skills where output quality depends on seeing examples, provide input/output pairs:
55
+
56
+ ````markdown
57
+ ## Commit message format
58
+
59
+ Generate commit messages following these examples:
60
+
61
+ **Example 1:**
62
+ Input: Added user authentication with JWT tokens
63
+ Output:
64
+ ```
65
+ feat(auth): implement JWT-based authentication
66
+
67
+ Add login endpoint and token validation middleware
68
+ ```
69
+
70
+ **Example 2:**
71
+ Input: Fixed bug where dates displayed incorrectly in reports
72
+ Output:
73
+ ```
74
+ fix(reports): correct date formatting in timezone conversion
75
+
76
+ Use UTC timestamps consistently across report generation
77
+ ```
78
+
79
+ Follow this style: type(scope): brief description, then detailed explanation.
80
+ ````
81
+
82
+ Examples help Claude understand the desired style and level of detail more clearly than descriptions alone.
@@ -0,0 +1,28 @@
1
+ # Workflow Patterns
2
+
3
+ ## Sequential Workflows
4
+
5
+ For complex tasks, break operations into clear, sequential steps. It is often helpful to give Claude an overview of the process towards the beginning of SKILL.md:
6
+
7
+ ```markdown
8
+ Filling a PDF form involves these steps:
9
+
10
+ 1. Analyze the form (run analyze_form.py)
11
+ 2. Create field mapping (edit fields.json)
12
+ 3. Validate mapping (run validate_fields.py)
13
+ 4. Fill the form (run fill_form.py)
14
+ 5. Verify output (run verify_output.py)
15
+ ```
16
+
17
+ ## Conditional Workflows
18
+
19
+ For tasks with branching logic, guide Claude through decision points:
20
+
21
+ ```markdown
22
+ 1. Determine the modification type:
23
+ **Creating new content?** → Follow "Creation workflow" below
24
+ **Editing existing content?** → Follow "Editing workflow" below
25
+
26
+ 2. Creation workflow: [steps]
27
+ 3. Editing workflow: [steps]
28
+ ```
@@ -0,0 +1,208 @@
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
+ from pathlib import Path
16
+
17
+
18
+ SKILL_TEMPLATE = """---
19
+ name: {skill_name}
20
+ 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.]
21
+ ---
22
+
23
+ # {skill_title}
24
+
25
+ ## Overview
26
+
27
+ [TODO: 1-2 sentences explaining what this skill enables]
28
+
29
+ ## Structuring This Skill
30
+
31
+ [TODO: Choose the structure that best fits this skill's purpose. Common patterns:
32
+
33
+ **1. Workflow-Based** (best for sequential processes)
34
+ - Works well when there are clear step-by-step procedures
35
+ - Structure: ## Overview -> ## Workflow Decision Tree -> ## Step 1 -> ## Step 2...
36
+
37
+ **2. Task-Based** (best for tool collections)
38
+ - Works well when the skill offers different operations/capabilities
39
+ - Structure: ## Overview -> ## Quick Start -> ## Task Category 1 -> ## Task Category 2...
40
+
41
+ **3. Reference/Guidelines** (best for standards or specifications)
42
+ - Works well for brand guidelines, coding standards, or requirements
43
+ - Structure: ## Overview -> ## Guidelines -> ## Specifications -> ## Usage...
44
+
45
+ **4. Capabilities-Based** (best for integrated systems)
46
+ - Works well when the skill provides multiple interrelated features
47
+ - Structure: ## Overview -> ## Core Capabilities -> ### 1. Feature -> ### 2. Feature...
48
+
49
+ Patterns can be mixed and matched as needed.
50
+
51
+ Delete this entire "Structuring This Skill" section when done - it's just guidance.]
52
+
53
+ ## [TODO: Replace with the first main section based on chosen structure]
54
+
55
+ [TODO: Add content here]
56
+
57
+ ## Resources
58
+
59
+ ### scripts/
60
+ Executable code (Python/Bash/etc.) that can be run directly.
61
+
62
+ ### references/
63
+ Documentation and reference material intended to be loaded into context as needed.
64
+
65
+ ### assets/
66
+ Files not intended to be loaded into context, but used within output Claude produces.
67
+
68
+ ---
69
+ **Any unneeded directories can be deleted.** Not every skill requires all three types of resources.
70
+ """
71
+
72
+ EXAMPLE_SCRIPT = '''#!/usr/bin/env python3
73
+ """
74
+ Example helper script for {skill_name}
75
+
76
+ This is a placeholder script. Replace with actual implementation or delete if not needed.
77
+ """
78
+
79
+ def main():
80
+ print("This is an example script for {skill_name}")
81
+ # TODO: Add actual script logic here
82
+
83
+ if __name__ == "__main__":
84
+ main()
85
+ '''
86
+
87
+ EXAMPLE_REFERENCE = """# Reference Documentation for {skill_title}
88
+
89
+ This is a placeholder for detailed reference documentation.
90
+ Replace with actual reference content or delete if not needed.
91
+
92
+ ## When Reference Docs Are Useful
93
+
94
+ - Comprehensive API documentation
95
+ - Detailed workflow guides
96
+ - Complex multi-step processes
97
+ - Information too lengthy for main SKILL.md
98
+ - Content that's only needed for specific use cases
99
+ """
100
+
101
+ EXAMPLE_ASSET = """# Example Asset File
102
+
103
+ This placeholder represents where asset files would be stored.
104
+ Replace with actual asset files (templates, images, fonts, etc.) or delete if not needed.
105
+
106
+ Asset files are NOT intended to be loaded into context, but rather used within
107
+ the output Claude produces.
108
+ """
109
+
110
+
111
+ def title_case_skill_name(skill_name):
112
+ """Convert hyphenated skill name to Title Case for display."""
113
+ return ' '.join(word.capitalize() for word in skill_name.split('-'))
114
+
115
+
116
+ def init_skill(skill_name, path):
117
+ """
118
+ Initialize a new skill directory with template SKILL.md.
119
+
120
+ Args:
121
+ skill_name: Name of the skill
122
+ path: Path where the skill directory should be created
123
+
124
+ Returns:
125
+ Path to created skill directory, or None if error
126
+ """
127
+ skill_dir = Path(path).resolve() / skill_name
128
+
129
+ if skill_dir.exists():
130
+ print(f"Error: Skill directory already exists: {skill_dir}")
131
+ return None
132
+
133
+ try:
134
+ skill_dir.mkdir(parents=True, exist_ok=False)
135
+ print(f"Created skill directory: {skill_dir}")
136
+ except Exception as e:
137
+ print(f"Error creating directory: {e}")
138
+ return None
139
+
140
+ skill_title = title_case_skill_name(skill_name)
141
+ skill_content = SKILL_TEMPLATE.format(
142
+ skill_name=skill_name,
143
+ skill_title=skill_title
144
+ )
145
+
146
+ skill_md_path = skill_dir / 'SKILL.md'
147
+ try:
148
+ skill_md_path.write_text(skill_content)
149
+ print("Created SKILL.md")
150
+ except Exception as e:
151
+ print(f"Error creating SKILL.md: {e}")
152
+ return None
153
+
154
+ try:
155
+ scripts_dir = skill_dir / 'scripts'
156
+ scripts_dir.mkdir(exist_ok=True)
157
+ example_script = scripts_dir / 'example.py'
158
+ example_script.write_text(EXAMPLE_SCRIPT.format(skill_name=skill_name))
159
+ print("Created scripts/example.py")
160
+
161
+ references_dir = skill_dir / 'references'
162
+ references_dir.mkdir(exist_ok=True)
163
+ example_reference = references_dir / 'api_reference.md'
164
+ example_reference.write_text(EXAMPLE_REFERENCE.format(skill_title=skill_title))
165
+ print("Created references/api_reference.md")
166
+
167
+ assets_dir = skill_dir / 'assets'
168
+ assets_dir.mkdir(exist_ok=True)
169
+ example_asset = assets_dir / 'example_asset.txt'
170
+ example_asset.write_text(EXAMPLE_ASSET)
171
+ print("Created assets/example_asset.txt")
172
+ except Exception as e:
173
+ print(f"Error creating resource directories: {e}")
174
+ return None
175
+
176
+ print(f"\nSkill '{skill_name}' initialized successfully at {skill_dir}")
177
+ print("\nNext steps:")
178
+ print("1. Edit SKILL.md to complete the TODO items and update the description")
179
+ print("2. Customize or delete the example files in scripts/, references/, and assets/")
180
+ print("3. Run the validator when ready to check the skill structure")
181
+
182
+ return skill_dir
183
+
184
+
185
+ def main():
186
+ if len(sys.argv) < 4 or sys.argv[2] != '--path':
187
+ print("Usage: init_skill.py <skill-name> --path <path>")
188
+ print("\nSkill name requirements:")
189
+ print(" - Kebab-case identifier (e.g., 'my-data-analyzer')")
190
+ print(" - Lowercase letters, digits, and hyphens only")
191
+ print(" - Max 64 characters")
192
+ print("\nExamples:")
193
+ print(" init_skill.py my-new-skill --path skills/public")
194
+ print(" init_skill.py my-api-helper --path skills/private")
195
+ sys.exit(1)
196
+
197
+ skill_name = sys.argv[1]
198
+ path = sys.argv[3]
199
+
200
+ print(f"Initializing skill: {skill_name}")
201
+ print(f" Location: {path}\n")
202
+
203
+ result = init_skill(skill_name, path)
204
+ sys.exit(0 if result else 1)
205
+
206
+
207
+ if __name__ == "__main__":
208
+ main()
@@ -0,0 +1,99 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Skill Packager - Creates a distributable .skill file of a skill folder
4
+
5
+ Usage:
6
+ python package_skill.py <path/to/skill-folder> [output-directory]
7
+
8
+ Example:
9
+ python package_skill.py skills/public/my-skill
10
+ python package_skill.py skills/public/my-skill ./dist
11
+ """
12
+
13
+ import sys
14
+ import zipfile
15
+ from pathlib import Path
16
+ from quick_validate import validate_skill
17
+
18
+
19
+ def package_skill(skill_path, output_dir=None):
20
+ """
21
+ Package a skill folder into a .skill file.
22
+
23
+ Args:
24
+ skill_path: Path to the skill folder
25
+ output_dir: Optional output directory for the .skill file
26
+
27
+ Returns:
28
+ Path to the created .skill file, or None if error
29
+ """
30
+ skill_path = Path(skill_path).resolve()
31
+
32
+ if not skill_path.exists():
33
+ print(f"Error: Skill folder not found: {skill_path}")
34
+ return None
35
+
36
+ if not skill_path.is_dir():
37
+ print(f"Error: Path is not a directory: {skill_path}")
38
+ return None
39
+
40
+ skill_md = skill_path / "SKILL.md"
41
+ if not skill_md.exists():
42
+ print(f"Error: SKILL.md not found in {skill_path}")
43
+ return None
44
+
45
+ print("Validating skill...")
46
+ valid, message = validate_skill(skill_path)
47
+ if not valid:
48
+ print(f"Validation failed: {message}")
49
+ print(" Please fix the validation errors before packaging.")
50
+ return None
51
+ print(f"{message}\n")
52
+
53
+ skill_name = skill_path.name
54
+ if output_dir:
55
+ output_path = Path(output_dir).resolve()
56
+ output_path.mkdir(parents=True, exist_ok=True)
57
+ else:
58
+ output_path = Path.cwd()
59
+
60
+ skill_filename = output_path / f"{skill_name}.skill"
61
+
62
+ try:
63
+ with zipfile.ZipFile(skill_filename, 'w', zipfile.ZIP_DEFLATED) as zipf:
64
+ for file_path in skill_path.rglob('*'):
65
+ if file_path.is_file():
66
+ arcname = file_path.relative_to(skill_path.parent)
67
+ zipf.write(file_path, arcname)
68
+ print(f" Added: {arcname}")
69
+
70
+ print(f"\nSuccessfully packaged skill to: {skill_filename}")
71
+ return skill_filename
72
+
73
+ except Exception as e:
74
+ print(f"Error creating .skill file: {e}")
75
+ return None
76
+
77
+
78
+ def main():
79
+ if len(sys.argv) < 2:
80
+ print("Usage: python package_skill.py <path/to/skill-folder> [output-directory]")
81
+ print("\nExample:")
82
+ print(" python package_skill.py skills/public/my-skill")
83
+ print(" python package_skill.py skills/public/my-skill ./dist")
84
+ sys.exit(1)
85
+
86
+ skill_path = sys.argv[1]
87
+ output_dir = sys.argv[2] if len(sys.argv) > 2 else None
88
+
89
+ print(f"Packaging skill: {skill_path}")
90
+ if output_dir:
91
+ print(f" Output directory: {output_dir}")
92
+ print()
93
+
94
+ result = package_skill(skill_path, output_dir)
95
+ sys.exit(0 if result else 1)
96
+
97
+
98
+ if __name__ == "__main__":
99
+ main()