Task Goal
- This Skill is used to: create a complete Skill from a configuration file or requirement description, including tool configuration, workflow orchestration, and code generation
- Capabilities include: configuration validation, file generation, template rendering, and skill packaging
- Trigger conditions: the user describes skill requirements, provides a skill configuration JSON, or designs a workflow structure
Prerequisites
- Dependency description: the dependency packages and versions required by the scripts
jsonschema>=4.0.0 - Non-standard file/folder preparation: none
Operation Steps
-
Standard process:
- Requirement Analysis
- Based on the user's description, the agent understands the skill's core capabilities, trigger scenarios, and tool requirements
- Refer to references/config-reference.md to determine the configuration structure
- Configuration Generation
- Based on the analysis results, generate the skill configuration JSON file
- The configuration includes: metadata, tool list, workflow nodes, and script definitions
- Schema Validation
- Call
scripts/validate_schema.py --config <config_path>to validate the configuration format - If validation fails, correct the configuration based on the error message
- Call
- File Generation
- Call
scripts/generate_skill.py --config <config_path> --output <output_dir>to generate the skill files - The script automatically creates the SKILL.md, scripts/, references/, and assets/ structure
- Call
- Packaging and Testing
- Use the
package_skill(skill_dir_name=<skill_name>)tool to package the skill - Verify that the .skill file is generated successfully and its content is complete
- Use the
- Requirement Analysis
-
Optional branches:
- When the user provides a configuration JSON: skip directly to step 3 for validation
- When only a workflow design needs to be generated: refer to references/workflow-guide.md, and the agent generates the workflow diagram and node definitions
- When only tool integration needs to be configured: refer to references/tool-reference.md, and the agent generates the tool configuration
Resource Index
- Required scripts:
- scripts/validate_schema.py (purpose and parameters: validate whether the skill configuration JSON conforms to the Schema, parameters: --config)
- scripts/generate_skill.py (purpose and parameters: generate complete skill files based on the configuration, parameters: --config, --output)
- Domain references:
- references/config-reference.md (when to read: when generating or validating the configuration)
- references/workflow-guide.md (when to read: when designing the workflow)
- references/tool-reference.md (when to read: when configuring tools)
- Output assets:
- assets/templates/skill-template.md (used directly to generate SKILL.md)
- assets/templates/python-script.py (used directly to generate Python scripts)
- assets/templates/schema.json (used to validate the configuration format)
Notes
- The configuration JSON must conform to the Schema defined by assets/templates/schema.json Defined Schema
- The generated skill name must use lowercase letters and hyphens; the -skill suffix is prohibited
- The connections between workflow nodes must maintain a directed acyclic graph structure
- Make full use of the agent's natural language understanding capabilities, and call scripts only when structured output is needed
Usage Examples
Example 1: Create a skill from a requirement description
- Function Description: The user describes "needs a skill to handle image compression"
- Execution method: The agent analyzes requirements → generates configuration → script verification → generates files → packaging
- Key parameters: skill name image-compressor, description, tool list
- Configuration example:
{ "name": "image-compressor", "description": "压缩图片文件大小", "tools": [ { "name": "compress", "type": "python", "parameters": [{"name": "quality", "type": "integer"}] } ] }
Example 2: Generate a skill from a configuration file
- Function description: The user has provided the skill-config.json configuration file
- Execution method: script verification → script generation → packaging
- Key parameters:--config skill-config.json, --output ./my-skill
- Command:
python scripts/generate_skill.py --config skill-config.json --output ./my-skill
Example 3: Design a workflow
- Function description: The user needs to create a skill workflow containing branching logic
- Execution method: The agent reads the workflow guide → designs nodes → generates configuration → generates the skill
- Key parameters: node types, connection relationships, conditional expressions
- Workflow example:
[开始] → [条件判断] → [分支A: API调用] → [结束] ↘ [分支B: 本地处理] → [结束]