@codyswann/lisa 1.53.9 → 1.54.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/all/merge/.claude/settings.json +3 -2
  2. package/cdk/merge/.claude/settings.json +0 -1
  3. package/expo/merge/.claude/settings.json +1 -0
  4. package/nestjs/merge/.claude/settings.json +0 -1
  5. package/package.json +1 -1
  6. package/rails/merge/.claude/settings.json +0 -1
  7. package/scripts/install-claude-plugins.sh +11 -1
  8. package/scripts/lisa-update-local.sh +45 -12
  9. package/typescript/merge/.claude/settings.json +0 -1
  10. package/plugins/lisa-cdk/skills/skill-creator/LICENSE.txt +0 -202
  11. package/plugins/lisa-cdk/skills/skill-creator/SKILL.md +0 -210
  12. package/plugins/lisa-cdk/skills/skill-creator/scripts/init_skill.py +0 -305
  13. package/plugins/lisa-cdk/skills/skill-creator/scripts/package_skill.py +0 -112
  14. package/plugins/lisa-cdk/skills/skill-creator/scripts/quick_validate.py +0 -67
  15. package/plugins/lisa-expo/skills/skill-creator/LICENSE.txt +0 -202
  16. package/plugins/lisa-expo/skills/skill-creator/SKILL.md +0 -210
  17. package/plugins/lisa-expo/skills/skill-creator/scripts/init_skill.py +0 -305
  18. package/plugins/lisa-expo/skills/skill-creator/scripts/package_skill.py +0 -112
  19. package/plugins/lisa-expo/skills/skill-creator/scripts/quick_validate.py +0 -67
  20. package/plugins/lisa-nestjs/skills/skill-creator/LICENSE.txt +0 -202
  21. package/plugins/lisa-nestjs/skills/skill-creator/SKILL.md +0 -210
  22. package/plugins/lisa-nestjs/skills/skill-creator/scripts/init_skill.py +0 -305
  23. package/plugins/lisa-nestjs/skills/skill-creator/scripts/package_skill.py +0 -112
  24. package/plugins/lisa-nestjs/skills/skill-creator/scripts/quick_validate.py +0 -67
  25. package/plugins/lisa-rails/skills/skill-creator/LICENSE.txt +0 -202
  26. package/plugins/lisa-rails/skills/skill-creator/SKILL.md +0 -210
  27. package/plugins/lisa-rails/skills/skill-creator/scripts/init_skill.py +0 -305
  28. package/plugins/lisa-rails/skills/skill-creator/scripts/package_skill.py +0 -112
  29. package/plugins/lisa-rails/skills/skill-creator/scripts/quick_validate.py +0 -67
  30. package/plugins/lisa-typescript/skills/skill-creator/LICENSE.txt +0 -202
  31. package/plugins/lisa-typescript/skills/skill-creator/SKILL.md +0 -210
  32. package/plugins/lisa-typescript/skills/skill-creator/scripts/init_skill.py +0 -305
  33. package/plugins/lisa-typescript/skills/skill-creator/scripts/package_skill.py +0 -112
  34. package/plugins/lisa-typescript/skills/skill-creator/scripts/quick_validate.py +0 -67
  35. package/plugins/src/base/skills/skill-creator/LICENSE.txt +0 -202
  36. package/plugins/src/base/skills/skill-creator/SKILL.md +0 -210
  37. package/plugins/src/base/skills/skill-creator/scripts/init_skill.py +0 -305
  38. package/plugins/src/base/skills/skill-creator/scripts/package_skill.py +0 -112
  39. package/plugins/src/base/skills/skill-creator/scripts/quick_validate.py +0 -67
@@ -1,210 +0,0 @@
1
- ---
2
- name: skill-creator
3
- description: Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
4
- license: Complete terms in LICENSE.txt
5
- ---
6
-
7
- # Skill Creator
8
-
9
- This skill provides guidance for creating effective skills.
10
-
11
- ## About Skills
12
-
13
- Skills are modular, self-contained packages that extend Claude's capabilities by providing
14
- specialized knowledge, workflows, and tools. Think of them as "onboarding guides" for specific
15
- domains or tasks—they transform Claude from a general-purpose agent into a specialized agent
16
- equipped with procedural knowledge that no model can fully possess.
17
-
18
- ### What Skills Provide
19
-
20
- 1. Specialized workflows - Multi-step procedures for specific domains
21
- 2. Tool integrations - Instructions for working with specific file formats or APIs
22
- 3. Domain expertise - Company-specific knowledge, schemas, business logic
23
- 4. Bundled resources - Scripts, references, and assets for complex and repetitive tasks
24
-
25
- ### Anatomy of a Skill
26
-
27
- Every skill consists of a required SKILL.md file and optional bundled resources:
28
-
29
- ```
30
- skill-name/
31
- ├── SKILL.md (required)
32
- │ ├── YAML frontmatter metadata (required)
33
- │ │ ├── name: (required)
34
- │ │ └── description: (required)
35
- │ └── Markdown instructions (required)
36
- └── Bundled Resources (optional)
37
- ├── scripts/ - Executable code (Python/Bash/etc.)
38
- ├── references/ - Documentation intended to be loaded into context as needed
39
- └── assets/ - Files used in output (templates, icons, fonts, etc.)
40
- ```
41
-
42
- #### SKILL.md (required)
43
-
44
- **Metadata Quality:** The `name` and `description` in YAML frontmatter determine when Claude will use the skill. Be specific about what the skill does and when to use it. Use the third-person (e.g. "This skill should be used when..." instead of "Use this skill when...").
45
-
46
- #### Bundled Resources (optional)
47
-
48
- ##### Scripts (`scripts/`)
49
-
50
- Executable code (Python/Bash/etc.) for tasks that require deterministic reliability or are repeatedly rewritten.
51
-
52
- - **When to include**: When the same code is being rewritten repeatedly or deterministic reliability is needed
53
- - **Example**: `scripts/rotate_pdf.py` for PDF rotation tasks
54
- - **Benefits**: Token efficient, deterministic, may be executed without loading into context
55
- - **Note**: Scripts may still need to be read by Claude for patching or environment-specific adjustments
56
-
57
- ##### References (`references/`)
58
-
59
- Documentation and reference material intended to be loaded as needed into context to inform Claude's process and thinking.
60
-
61
- - **When to include**: For documentation that Claude should reference while working
62
- - **Examples**: `references/finance.md` for financial schemas, `references/mnda.md` for company NDA template, `references/policies.md` for company policies, `references/api_docs.md` for API specifications
63
- - **Use cases**: Database schemas, API documentation, domain knowledge, company policies, detailed workflow guides
64
- - **Benefits**: Keeps SKILL.md lean, loaded only when Claude determines it's needed
65
- - **Best practice**: If files are large (>10k words), include grep search patterns in SKILL.md
66
- - **Avoid duplication**: Information should live in either SKILL.md or references files, not both. Prefer references files for detailed information unless it's truly core to the skill—this keeps SKILL.md lean while making information discoverable without hogging the context window. Keep only essential procedural instructions and workflow guidance in SKILL.md; move detailed reference material, schemas, and examples to references files.
67
-
68
- ##### Assets (`assets/`)
69
-
70
- Files not intended to be loaded into context, but rather used within the output Claude produces.
71
-
72
- - **When to include**: When the skill needs files that will be used in the final output
73
- - **Examples**: `assets/logo.png` for brand assets, `assets/slides.pptx` for PowerPoint templates, `assets/frontend-template/` for HTML/React boilerplate, `assets/font.ttf` for typography
74
- - **Use cases**: Templates, images, icons, boilerplate code, fonts, sample documents that get copied or modified
75
- - **Benefits**: Separates output resources from documentation, enables Claude to use files without loading them into context
76
-
77
- ### Progressive Disclosure Design Principle
78
-
79
- Skills use a three-level loading system to manage context efficiently:
80
-
81
- 1. **Metadata (name + description)** - Always in context (~100 words)
82
- 2. **SKILL.md body** - When skill triggers (<5k words)
83
- 3. **Bundled resources** - As needed by Claude (Unlimited\*)
84
-
85
- \*Unlimited because scripts can be executed without reading into context window.
86
-
87
- ## Skill Creation Process
88
-
89
- To create a skill, follow the "Skill Creation Process" in order, skipping steps only if there is a clear reason why they are not applicable.
90
-
91
- ### Step 1: Understanding the Skill with Concrete Examples
92
-
93
- Skip this step only when the skill's usage patterns are already clearly understood. It remains valuable even when working with an existing skill.
94
-
95
- To create an effective skill, clearly understand concrete examples of how the skill will be used. This understanding can come from either direct user examples or generated examples that are validated with user feedback.
96
-
97
- For example, when building an image-editor skill, relevant questions include:
98
-
99
- - "What functionality should the image-editor skill support? Editing, rotating, anything else?"
100
- - "Can you give some examples of how this skill would be used?"
101
- - "I can imagine users asking for things like 'Remove the red-eye from this image' or 'Rotate this image'. Are there other ways you imagine this skill being used?"
102
- - "What would a user say that should trigger this skill?"
103
-
104
- To avoid overwhelming users, avoid asking too many questions in a single message. Start with the most important questions and follow up as needed for better effectiveness.
105
-
106
- Conclude this step when there is a clear sense of the functionality the skill should support.
107
-
108
- ### Step 2: Planning the Reusable Skill Contents
109
-
110
- To turn concrete examples into an effective skill, analyze each example by:
111
-
112
- 1. Considering how to execute on the example from scratch
113
- 2. Identifying what scripts, references, and assets would be helpful when executing these workflows repeatedly
114
-
115
- Example: When building a `pdf-editor` skill to handle queries like "Help me rotate this PDF," the analysis shows:
116
-
117
- 1. Rotating a PDF requires re-writing the same code each time
118
- 2. A `scripts/rotate_pdf.py` script would be helpful to store in the skill
119
-
120
- Example: When designing a `frontend-webapp-builder` skill for queries like "Build me a todo app" or "Build me a dashboard to track my steps," the analysis shows:
121
-
122
- 1. Writing a frontend webapp requires the same boilerplate HTML/React each time
123
- 2. An `assets/hello-world/` template containing the boilerplate HTML/React project files would be helpful to store in the skill
124
-
125
- Example: When building a `big-query` skill to handle queries like "How many users have logged in today?" the analysis shows:
126
-
127
- 1. Querying BigQuery requires re-discovering the table schemas and relationships each time
128
- 2. A `references/schema.md` file documenting the table schemas would be helpful to store in the skill
129
-
130
- To establish the skill's contents, analyze each concrete example to create a list of the reusable resources to include: scripts, references, and assets.
131
-
132
- ### Step 3: Initializing the Skill
133
-
134
- At this point, it is time to actually create the skill.
135
-
136
- Skip this step only if the skill being developed already exists, and iteration or packaging is needed. In this case, continue to the next step.
137
-
138
- When creating a new skill from scratch, always run the `init_skill.py` script. The script conveniently generates a new template skill directory that automatically includes everything a skill requires, making the skill creation process much more efficient and reliable.
139
-
140
- Usage:
141
-
142
- ```bash
143
- scripts/init_skill.py <skill-name> --path <output-directory>
144
- ```
145
-
146
- The script:
147
-
148
- - Creates the skill directory at the specified path
149
- - Generates a SKILL.md template with proper frontmatter and TODO placeholders
150
- - Creates example resource directories: `scripts/`, `references/`, and `assets/`
151
- - Adds example files in each directory that can be customized or deleted
152
-
153
- After initialization, customize or remove the generated SKILL.md and example files as needed.
154
-
155
- ### Step 4: Edit the Skill
156
-
157
- When editing the (newly-generated or existing) skill, remember that the skill is being created for another instance of Claude to use. Focus on including information that would be beneficial and non-obvious to Claude. Consider what procedural knowledge, domain-specific details, or reusable assets would help another Claude instance execute these tasks more effectively.
158
-
159
- #### Start with Reusable Skill Contents
160
-
161
- To begin implementation, start with the reusable resources identified above: `scripts/`, `references/`, and `assets/` files. Note that this step may require user input. For example, when implementing a `brand-guidelines` skill, the user may need to provide brand assets or templates to store in `assets/`, or documentation to store in `references/`.
162
-
163
- Also, delete any example files and directories not needed for the skill. The initialization script creates example files in `scripts/`, `references/`, and `assets/` to demonstrate structure, but most skills won't need all of them.
164
-
165
- #### Update SKILL.md
166
-
167
- **Writing Style:** Write the entire skill using **imperative/infinitive form** (verb-first instructions), not second person. Use objective, instructional language (e.g., "To accomplish X, do Y" rather than "You should do X" or "If you need to do X"). This maintains consistency and clarity for AI consumption.
168
-
169
- To complete SKILL.md, answer the following questions:
170
-
171
- 1. What is the purpose of the skill, in a few sentences?
172
- 2. When should the skill be used?
173
- 3. In practice, how should Claude use the skill? All reusable skill contents developed above should be referenced so that Claude knows how to use them.
174
-
175
- ### Step 5: Packaging a Skill
176
-
177
- Once the skill is ready, it should be packaged into a distributable zip file that gets shared with the user. The packaging process automatically validates the skill first to ensure it meets all requirements:
178
-
179
- ```bash
180
- scripts/package_skill.py <path/to/skill-folder>
181
- ```
182
-
183
- Optional output directory specification:
184
-
185
- ```bash
186
- scripts/package_skill.py <path/to/skill-folder> ./dist
187
- ```
188
-
189
- The packaging script will:
190
-
191
- 1. **Validate** the skill automatically, checking:
192
- - YAML frontmatter format and required fields
193
- - Skill naming conventions and directory structure
194
- - Description completeness and quality
195
- - File organization and resource references
196
-
197
- 2. **Package** the skill if validation passes, creating a zip file named after the skill (e.g., `my-skill.zip`) that includes all files and maintains the proper directory structure for distribution.
198
-
199
- If validation fails, the script will report the errors and exit without creating a package. Fix any validation errors and run the packaging command again.
200
-
201
- ### Step 6: Iterate
202
-
203
- After testing the skill, users may request improvements. Often this happens right after using the skill, with fresh context of how the skill performed.
204
-
205
- **Iteration workflow:**
206
-
207
- 1. Use the skill on real tasks
208
- 2. Notice struggles or inefficiencies
209
- 3. Identify how SKILL.md or bundled resources should be updated
210
- 4. Implement changes and test again
@@ -1,305 +0,0 @@
1
- #!/usr/bin/env python3
2
- # This file is managed by Lisa.
3
- # Do not edit directly — changes will be overwritten on the next `lisa` run.
4
- """
5
- Skill Initializer - Creates a new skill from template
6
-
7
- Usage:
8
- init_skill.py <skill-name> --path <path>
9
-
10
- Examples:
11
- init_skill.py my-new-skill --path skills/public
12
- init_skill.py my-api-helper --path skills/private
13
- init_skill.py custom-skill --path /custom/location
14
- """
15
-
16
- import sys
17
- from pathlib import Path
18
-
19
-
20
- SKILL_TEMPLATE = """---
21
- name: {skill_name}
22
- 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.]
23
- ---
24
-
25
- # {skill_title}
26
-
27
- ## Overview
28
-
29
- [TODO: 1-2 sentences explaining what this skill enables]
30
-
31
- ## Structuring This Skill
32
-
33
- [TODO: Choose the structure that best fits this skill's purpose. Common patterns:
34
-
35
- **1. Workflow-Based** (best for sequential processes)
36
- - Works well when there are clear step-by-step procedures
37
- - Example: DOCX skill with "Workflow Decision Tree" → "Reading" → "Creating" → "Editing"
38
- - Structure: ## Overview → ## Workflow Decision Tree → ## Step 1 → ## Step 2...
39
-
40
- **2. Task-Based** (best for tool collections)
41
- - Works well when the skill offers different operations/capabilities
42
- - Example: PDF skill with "Quick Start" → "Merge PDFs" → "Split PDFs" → "Extract Text"
43
- - Structure: ## Overview → ## Quick Start → ## Task Category 1 → ## Task Category 2...
44
-
45
- **3. Reference/Guidelines** (best for standards or specifications)
46
- - Works well for brand guidelines, coding standards, or requirements
47
- - Example: Brand styling with "Brand Guidelines" → "Colors" → "Typography" → "Features"
48
- - Structure: ## Overview → ## Guidelines → ## Specifications → ## Usage...
49
-
50
- **4. Capabilities-Based** (best for integrated systems)
51
- - Works well when the skill provides multiple interrelated features
52
- - Example: Product Management with "Core Capabilities" → numbered capability list
53
- - Structure: ## Overview → ## Core Capabilities → ### 1. Feature → ### 2. Feature...
54
-
55
- Patterns can be mixed and matched as needed. Most skills combine patterns (e.g., start with task-based, add workflow for complex operations).
56
-
57
- Delete this entire "Structuring This Skill" section when done - it's just guidance.]
58
-
59
- ## [TODO: Replace with the first main section based on chosen structure]
60
-
61
- [TODO: Add content here. See examples in existing skills:
62
- - Code samples for technical skills
63
- - Decision trees for complex workflows
64
- - Concrete examples with realistic user requests
65
- - References to scripts/templates/references as needed]
66
-
67
- ## Resources
68
-
69
- This skill includes example resource directories that demonstrate how to organize different types of bundled resources:
70
-
71
- ### scripts/
72
- Executable code (Python/Bash/etc.) that can be run directly to perform specific operations.
73
-
74
- **Examples from other skills:**
75
- - PDF skill: `fill_fillable_fields.py`, `extract_form_field_info.py` - utilities for PDF manipulation
76
- - DOCX skill: `document.py`, `utilities.py` - Python modules for document processing
77
-
78
- **Appropriate for:** Python scripts, shell scripts, or any executable code that performs automation, data processing, or specific operations.
79
-
80
- **Note:** Scripts may be executed without loading into context, but can still be read by Claude for patching or environment adjustments.
81
-
82
- ### references/
83
- Documentation and reference material intended to be loaded into context to inform Claude's process and thinking.
84
-
85
- **Examples from other skills:**
86
- - Product management: `communication.md`, `context_building.md` - detailed workflow guides
87
- - BigQuery: API reference documentation and query examples
88
- - Finance: Schema documentation, company policies
89
-
90
- **Appropriate for:** In-depth documentation, API references, database schemas, comprehensive guides, or any detailed information that Claude should reference while working.
91
-
92
- ### assets/
93
- Files not intended to be loaded into context, but rather used within the output Claude produces.
94
-
95
- **Examples from other skills:**
96
- - Brand styling: PowerPoint template files (.pptx), logo files
97
- - Frontend builder: HTML/React boilerplate project directories
98
- - Typography: Font files (.ttf, .woff2)
99
-
100
- **Appropriate for:** Templates, boilerplate code, document templates, images, icons, fonts, or any files meant to be copied or used in the final output.
101
-
102
- ---
103
-
104
- **Any unneeded directories can be deleted.** Not every skill requires all three types of resources.
105
- """
106
-
107
- EXAMPLE_SCRIPT = '''#!/usr/bin/env python3
108
- """
109
- Example helper script for {skill_name}
110
-
111
- This is a placeholder script that can be executed directly.
112
- Replace with actual implementation or delete if not needed.
113
-
114
- Example real scripts from other skills:
115
- - pdf/scripts/fill_fillable_fields.py - Fills PDF form fields
116
- - pdf/scripts/convert_pdf_to_images.py - Converts PDF pages to images
117
- """
118
-
119
- def main():
120
- print("This is an example script for {skill_name}")
121
- # TODO: Add actual script logic here
122
- # This could be data processing, file conversion, API calls, etc.
123
-
124
- if __name__ == "__main__":
125
- main()
126
- '''
127
-
128
- EXAMPLE_REFERENCE = """# Reference Documentation for {skill_title}
129
-
130
- This is a placeholder for detailed reference documentation.
131
- Replace with actual reference content or delete if not needed.
132
-
133
- Example real reference docs from other skills:
134
- - product-management/references/communication.md - Comprehensive guide for status updates
135
- - product-management/references/context_building.md - Deep-dive on gathering context
136
- - bigquery/references/ - API references and query examples
137
-
138
- ## When Reference Docs Are Useful
139
-
140
- Reference docs are ideal for:
141
- - Comprehensive API documentation
142
- - Detailed workflow guides
143
- - Complex multi-step processes
144
- - Information too lengthy for main SKILL.md
145
- - Content that's only needed for specific use cases
146
-
147
- ## Structure Suggestions
148
-
149
- ### API Reference Example
150
- - Overview
151
- - Authentication
152
- - Endpoints with examples
153
- - Error codes
154
- - Rate limits
155
-
156
- ### Workflow Guide Example
157
- - Prerequisites
158
- - Step-by-step instructions
159
- - Common patterns
160
- - Troubleshooting
161
- - Best practices
162
- """
163
-
164
- EXAMPLE_ASSET = """# Example Asset File
165
-
166
- This placeholder represents where asset files would be stored.
167
- Replace with actual asset files (templates, images, fonts, etc.) or delete if not needed.
168
-
169
- Asset files are NOT intended to be loaded into context, but rather used within
170
- the output Claude produces.
171
-
172
- Example asset files from other skills:
173
- - Brand guidelines: logo.png, slides_template.pptx
174
- - Frontend builder: hello-world/ directory with HTML/React boilerplate
175
- - Typography: custom-font.ttf, font-family.woff2
176
- - Data: sample_data.csv, test_dataset.json
177
-
178
- ## Common Asset Types
179
-
180
- - Templates: .pptx, .docx, boilerplate directories
181
- - Images: .png, .jpg, .svg, .gif
182
- - Fonts: .ttf, .otf, .woff, .woff2
183
- - Boilerplate code: Project directories, starter files
184
- - Icons: .ico, .svg
185
- - Data files: .csv, .json, .xml, .yaml
186
-
187
- Note: This is a text placeholder. Actual assets can be any file type.
188
- """
189
-
190
-
191
- def title_case_skill_name(skill_name):
192
- """Convert hyphenated skill name to Title Case for display."""
193
- return ' '.join(word.capitalize() for word in skill_name.split('-'))
194
-
195
-
196
- def init_skill(skill_name, path):
197
- """
198
- Initialize a new skill directory with template SKILL.md.
199
-
200
- Args:
201
- skill_name: Name of the skill
202
- path: Path where the skill directory should be created
203
-
204
- Returns:
205
- Path to created skill directory, or None if error
206
- """
207
- # Determine skill directory path
208
- skill_dir = Path(path).resolve() / skill_name
209
-
210
- # Check if directory already exists
211
- if skill_dir.exists():
212
- print(f"❌ Error: Skill directory already exists: {skill_dir}")
213
- return None
214
-
215
- # Create skill directory
216
- try:
217
- skill_dir.mkdir(parents=True, exist_ok=False)
218
- print(f"✅ Created skill directory: {skill_dir}")
219
- except Exception as e:
220
- print(f"❌ Error creating directory: {e}")
221
- return None
222
-
223
- # Create SKILL.md from template
224
- skill_title = title_case_skill_name(skill_name)
225
- skill_content = SKILL_TEMPLATE.format(
226
- skill_name=skill_name,
227
- skill_title=skill_title
228
- )
229
-
230
- skill_md_path = skill_dir / 'SKILL.md'
231
- try:
232
- skill_md_path.write_text(skill_content)
233
- print("✅ Created SKILL.md")
234
- except Exception as e:
235
- print(f"❌ Error creating SKILL.md: {e}")
236
- return None
237
-
238
- # Create resource directories with example files
239
- try:
240
- # Create scripts/ directory with example script
241
- scripts_dir = skill_dir / 'scripts'
242
- scripts_dir.mkdir(exist_ok=True)
243
- example_script = scripts_dir / 'example.py'
244
- example_script.write_text(EXAMPLE_SCRIPT.format(skill_name=skill_name))
245
- example_script.chmod(0o755)
246
- print("✅ Created scripts/example.py")
247
-
248
- # Create references/ directory with example reference doc
249
- references_dir = skill_dir / 'references'
250
- references_dir.mkdir(exist_ok=True)
251
- example_reference = references_dir / 'api_reference.md'
252
- example_reference.write_text(EXAMPLE_REFERENCE.format(skill_title=skill_title))
253
- print("✅ Created references/api_reference.md")
254
-
255
- # Create assets/ directory with example asset placeholder
256
- assets_dir = skill_dir / 'assets'
257
- assets_dir.mkdir(exist_ok=True)
258
- example_asset = assets_dir / 'example_asset.txt'
259
- example_asset.write_text(EXAMPLE_ASSET)
260
- print("✅ Created assets/example_asset.txt")
261
- except Exception as e:
262
- print(f"❌ Error creating resource directories: {e}")
263
- return None
264
-
265
- # Print next steps
266
- print(f"\n✅ Skill '{skill_name}' initialized successfully at {skill_dir}")
267
- print("\nNext steps:")
268
- print("1. Edit SKILL.md to complete the TODO items and update the description")
269
- print("2. Customize or delete the example files in scripts/, references/, and assets/")
270
- print("3. Run the validator when ready to check the skill structure")
271
-
272
- return skill_dir
273
-
274
-
275
- def main():
276
- if len(sys.argv) < 4 or sys.argv[2] != '--path':
277
- print("Usage: init_skill.py <skill-name> --path <path>")
278
- print("\nSkill name requirements:")
279
- print(" - Hyphen-case identifier (e.g., 'data-analyzer')")
280
- print(" - Lowercase letters, digits, and hyphens only")
281
- print(" - Max 40 characters")
282
- print(" - Must match directory name exactly")
283
- print("\nExamples:")
284
- print(" init_skill.py my-new-skill --path skills/public")
285
- print(" init_skill.py my-api-helper --path skills/private")
286
- print(" init_skill.py custom-skill --path /custom/location")
287
- sys.exit(1)
288
-
289
- skill_name = sys.argv[1]
290
- path = sys.argv[3]
291
-
292
- print(f"🚀 Initializing skill: {skill_name}")
293
- print(f" Location: {path}")
294
- print()
295
-
296
- result = init_skill(skill_name, path)
297
-
298
- if result:
299
- sys.exit(0)
300
- else:
301
- sys.exit(1)
302
-
303
-
304
- if __name__ == "__main__":
305
- main()
@@ -1,112 +0,0 @@
1
- #!/usr/bin/env python3
2
- # This file is managed by Lisa.
3
- # Do not edit directly — changes will be overwritten on the next `lisa` run.
4
- """
5
- Skill Packager - Creates a distributable zip file of a skill folder
6
-
7
- Usage:
8
- python utils/package_skill.py <path/to/skill-folder> [output-directory]
9
-
10
- Example:
11
- python utils/package_skill.py skills/public/my-skill
12
- python utils/package_skill.py skills/public/my-skill ./dist
13
- """
14
-
15
- import sys
16
- import zipfile
17
- from pathlib import Path
18
- from quick_validate import validate_skill
19
-
20
-
21
- def package_skill(skill_path, output_dir=None):
22
- """
23
- Package a skill folder into a zip file.
24
-
25
- Args:
26
- skill_path: Path to the skill folder
27
- output_dir: Optional output directory for the zip file (defaults to current directory)
28
-
29
- Returns:
30
- Path to the created zip file, or None if error
31
- """
32
- skill_path = Path(skill_path).resolve()
33
-
34
- # Validate skill folder exists
35
- if not skill_path.exists():
36
- print(f"❌ Error: Skill folder not found: {skill_path}")
37
- return None
38
-
39
- if not skill_path.is_dir():
40
- print(f"❌ Error: Path is not a directory: {skill_path}")
41
- return None
42
-
43
- # Validate SKILL.md exists
44
- skill_md = skill_path / "SKILL.md"
45
- if not skill_md.exists():
46
- print(f"❌ Error: SKILL.md not found in {skill_path}")
47
- return None
48
-
49
- # Run validation before packaging
50
- print("🔍 Validating skill...")
51
- valid, message = validate_skill(skill_path)
52
- if not valid:
53
- print(f"❌ Validation failed: {message}")
54
- print(" Please fix the validation errors before packaging.")
55
- return None
56
- print(f"✅ {message}\n")
57
-
58
- # Determine output location
59
- skill_name = skill_path.name
60
- if output_dir:
61
- output_path = Path(output_dir).resolve()
62
- output_path.mkdir(parents=True, exist_ok=True)
63
- else:
64
- output_path = Path.cwd()
65
-
66
- zip_filename = output_path / f"{skill_name}.zip"
67
-
68
- # Create the zip file
69
- try:
70
- with zipfile.ZipFile(zip_filename, 'w', zipfile.ZIP_DEFLATED) as zipf:
71
- # Walk through the skill directory
72
- for file_path in skill_path.rglob('*'):
73
- if file_path.is_file():
74
- # Calculate the relative path within the zip
75
- arcname = file_path.relative_to(skill_path.parent)
76
- zipf.write(file_path, arcname)
77
- print(f" Added: {arcname}")
78
-
79
- print(f"\n✅ Successfully packaged skill to: {zip_filename}")
80
- return zip_filename
81
-
82
- except Exception as e:
83
- print(f"❌ Error creating zip file: {e}")
84
- return None
85
-
86
-
87
- def main():
88
- if len(sys.argv) < 2:
89
- print("Usage: python utils/package_skill.py <path/to/skill-folder> [output-directory]")
90
- print("\nExample:")
91
- print(" python utils/package_skill.py skills/public/my-skill")
92
- print(" python utils/package_skill.py skills/public/my-skill ./dist")
93
- sys.exit(1)
94
-
95
- skill_path = sys.argv[1]
96
- output_dir = sys.argv[2] if len(sys.argv) > 2 else None
97
-
98
- print(f"📦 Packaging skill: {skill_path}")
99
- if output_dir:
100
- print(f" Output directory: {output_dir}")
101
- print()
102
-
103
- result = package_skill(skill_path, output_dir)
104
-
105
- if result:
106
- sys.exit(0)
107
- else:
108
- sys.exit(1)
109
-
110
-
111
- if __name__ == "__main__":
112
- main()