skill-creator-yashu

Original🇨🇳 Chinese
Translated
4 scriptsChecked / no sensitive code detected

Create a new skill. When to use: When the user says "create skill", "new skill", "add skill", "initialize skill".

3installs
Added on

NPX Install

npx skill4agent add steelan9199/wechat-publisher skill-creator-yashu

SKILL.md Content (Chinese)

View Translation Comparison →

🎯 Trigger Mapping

User Input Trigger PhrasesAI Action to Perform
"create skill" / "new skill" / "add skill" / "initialize skill"Execute in [Creation Mode]

Creation Mode

Execution Steps

StepActionSpecific Command/Operation
1Ask for RequirementsRun
AskUserQuestion
to inquire about the skill's function, usage scenarios and trigger conditions
2Initialize DirectoryRun
RunCommand
to execute
python scripts/init_skill.py <skill-name> --path <output-dir>
3Read and Edit SKILLRun
Read
to read the generated SKILL.md, then run
SearchReplace
to fill in the function description and trigger conditions
4Validate StructureRun
RunCommand
to execute
python scripts/quick_validate.py <skill-directory>

Output Results

Example Output on Success:
✅ Skill '{skill-name}' created successfully

📁 Directory Structure:
.trae/skills/{skill-name}/
├── SKILL.md          # Skill documentation (template filled)
├── scripts/          # Script directory
│   └── example.py    # Sample script
└── references/       # Reference documentation directory
    └── README.md     # Reference instructions

📝 Next Steps:
Run `Read` to open SKILL.md, then edit the function description and trigger conditions based on user requirements
Example Output on Failure:
❌ Skill creation failed

Error Reason: {specific error message}
Suggested Solution: {targeted solution}

Error Handling

Error ScenarioError ManifestationHandling Method
Directory Already Exists
mkdir
reports directory exists error
Run
LS
to check directory content; proceed if empty, ask user whether to overwrite if there is content
Script Execution FailurePython returns non-zero exit codeCheck Python version and dependency installation, retry execution
Insufficient PermissionsFile write access deniedCheck directory permissions, suggest user to change output directory
Invalid Skill NameContains uppercase letters or special charactersPrompt user to modify to kebab-case format (e.g.,
my-skill
)

Core Principles

Concise is Key

The context window is a shared resource. Skills share the context window with system prompts, conversation history, metadata of other skills, and user requests.
Default Assumption: AI is already intelligent. Only add information that the AI doesn't have. Question every piece of information: "Does the AI really need this explanation?" "Is this text worth its token cost?"
Prioritize concise examples over lengthy explanations.

Set Appropriate Flexibility

Match the level of detail to the fragility and variability of the task:
Flexibility LevelApplicable ScenariosForm
High FlexibilityMultiple valid approaches exist, decisions depend on context, heuristic guidance is neededText-based instructions
Medium FlexibilityPreferred patterns exist, some variations are allowed, configurations affect behaviorPseudocode or scripts with parameters
Low FlexibilityOperations are fragile and error-prone, consistency is critical, specific sequences must be followedSpecific scripts with few parameters

AI-Friendly

Skills are for AI use - ensure that AI can accurately understand and execute them. Created skills must meet the following AI-friendly standards:
Check ItemRequirementDescription
Clear descriptionMandatoryThe description in frontmatter must include function and trigger conditions
Clear InstructionsMandatoryUse imperative sentences (run, execute, call, etc.) instead of vague suggestions
Specific ExamplesMandatoryProvide code examples or user request examples, AI needs to know how to do it specifically
Decision LogicRecommendedFor complex tasks, provide conditional judgments or decision trees to help AI make correct choices
Output FormatMandatoryClearly specify what content the skill should output
Error HandlingRecommendedExplain abnormal situations and boundary handling
Avoid Long ParagraphsRecommendedParagraphs over 500 characters make it difficult to extract key information; use lists or tables
File Reference ExplanationMandatoryReferenced files must have Markdown link descriptions
Optimization Tips:
  • Imagine you are the AI; after reading the skill, can you answer: When to use it? How to use it? What to output?
  • Use specific rather than abstract vocabulary
  • Provide clear operation steps instead of vague guidance
  • Provide decision processes for complex scenarios

Key Specifications for Agent Skills

Directory Structure

skill-name/
├── SKILL.md          # Required: Skill documentation
├── scripts/          # Optional: Executable code
├── references/       # Optional: Reference documentation
└── assets/           # Optional: Templates, resources
Files that should not be included: Auxiliary documents such as README.md, INSTALLATION_GUIDE.md, CHANGELOG.md.

SKILL.md Format

Required Frontmatter Metadata:
yaml
---
name: skill-name
description: Function description. When to use: When the user says/needs/encounters...
---

Rules for name Field

  • 1-64 characters, can only contain lowercase letters, numbers and hyphens
  • Cannot start or end with a hyphen, cannot contain consecutive hyphens
    --
  • Must match the parent directory name

Rules for description Field

  • 1-1024 characters
  • Must include two parts separated by
    When to use:
    :
    1. Function Description - What this skill does
    2. When to Use - What the user says to trigger this skill
  • All trigger condition information should be placed in the description - Do not put it in the main body
Good Example:
yaml
description: Analyze and optimize documentation quality issues of other Skills, including checks for frontmatter format, progressive disclosure structure, etc. When to use: When the user says "optimize this skill", "check skill quality", "review skill".
Bad Examples:
yaml
# ❌ Missing "When to use" section
description: Analyze and optimize documentation quality issues of Skills

# ❌ Uses "Trigger Conditions" instead of "When to use"
description: Analyze Skill quality issues. Trigger Conditions: When the user says to optimize skill

Progressive Disclosure Design

Skills use a three-level loading system to efficiently manage context:
  1. Metadata (name + description) - Always in context (approx. 100 words)
  2. SKILL.md Main Body - Loaded when the skill is triggered (recommended < 5000 words, < 500 lines)
  3. Bundled Resources - Loaded by AI on demand
Key Principle: When a skill supports multiple variants, frameworks or options, only retain the core workflow and selection guidance in SKILL.md. Move variant-specific details to separate reference files.

Progressive Disclosure Patterns

Pattern 1: Advanced Guide + References
markdown
## Quick Start

[Core Code Example]

## Advanced Features

- **Form Filling**: See complete guide in [FORMS.md](references/FORMS.md)
- **API Reference**: See [REFERENCE.md](references/REFERENCE.md)
Pattern 2: Organized by Domain
skill-name/
├── SKILL.md (Overview and Navigation)
└── references/
    ├── finance.md
    ├── sales.md
    └── product.md
Important Guidelines:
  • Avoid deeply nested references; keep reference files in the first-level subdirectory of SKILL.md
  • Avoid duplication: Information should exist only in SKILL.md or reference files, not both

SKILL.md Structure Patterns

Choose the structure that best fits the skill's purpose:
PatternApplicable ScenariosStructure
Workflow-BasedSequential processes
## Overview
## Workflow Decision Tree
## Step 1
...
Task-BasedTool collections
## Overview
## Quick Start
## Task Category 1
...
Reference/GuideStandards or specifications
## Overview
## Guide
## Specifications
Capability-BasedIntegrated systems
## Overview
## Core Capabilities
### 1. Feature
...
Patterns can be mixed and matched.

Skill Creation Process

Execute the following steps in order:

Skill Creation Process

Execute the following steps in order:
StepActionSpecific Command/Operation
1Ask for Functional RequirementsRun
AskUserQuestion
to inquire about skill function, usage examples and trigger conditions
2Plan Reusable ResourcesAnalyze requirements, determine required scripts, references, assets
3Initialize Skill DirectoryRun
RunCommand
to execute
python scripts/init_skill.py <skill-name> --path <output-directory>
4Read SKILL.mdRun
Read
to read the generated
.trae/skills/{skill-name}/SKILL.md
5Edit Function DescriptionRun
SearchReplace
to fill in description, trigger conditions and execution steps
6Create ScriptsIf scripts are needed, run
Write
to create them in the
scripts/
directory
7Create Reference DocumentsIf reference documents are needed, run
Write
to create them in the
references/
directory
8Validate StructureRun
RunCommand
to execute
python scripts/quick_validate.py <skill-directory>
9Test and IterateBased on validation results, run
SearchReplace
to fix issues

Workflow Patterns

Detailed workflow patterns (sequence, condition, decision tree, loop, error handling) can be found in Workflow Patterns Documentation.

Output Patterns

Detailed output patterns (templates, examples, checklists) can be found in Output Patterns Documentation.

Bundled Resources

scripts/

Executable code (Python/Bash/etc.) used for tasks requiring deterministic reliability or repeated rewriting.
  • When to include: When the same code is repeatedly rewritten or requires deterministic reliability
  • Benefits: Token-efficient, deterministic, can be executed without loading into context
  • AI-Friendly Principles: The input and output of the code should be AI-friendly
    • Input: Support command-line parameters, environment variables or structured data (JSON/YAML), avoid interactive prompts
    • Output: Use structured formats (JSON/YAML/table), include clear field names, avoid natural language descriptions that need parsing
    • Error Handling: Return standard exit codes, output error messages to stderr, output successful results to stdout

references/

Documents and reference materials designed to be loaded into context on demand.
  • When to include: Detailed documents that AI should reference when working
  • Benefits: Keep SKILL.md concise, only load when needed

assets/

Files not intended to be loaded into context, but used in the output generated by AI.
  • When to include: Files that the skill needs to use in the final output (templates, images, etc.)
  • Benefits: Separate output resources from documentation

Utility Scripts

ScriptPurposeCommand
init_skill.pyInitialize new skill
python scripts/init_skill.py <skill-name> --path <output-dir>
skill_templates.pyTemplate definition moduleCalled by init_skill.py, contains templates for SKILL.md and sample files
quick_validate.pyQuick validation
python scripts/quick_validate.py <skill-directory>
create-skill.pyCreate complete skill
python scripts/create-skill.py <skill-name>

Creation Example

User Input: "Create a skill to process PDFs"
Execution Steps:
StepActionSpecific Command/Operation
1Ask for ScenariosRun
AskUserQuestion
to inquire about specific usage scenarios (text extraction, form filling, merging, etc.)
2Plan ContentAnalyze requirements, determine that Python scripts are needed to process PDFs
3Initialize DirectoryRun
RunCommand
to execute
python scripts/init_skill.py pdf-processor --path ./skills
4Read SKILL.mdRun
Read
to read
./skills/pdf-processor/SKILL.md
5Edit DescriptionRun
SearchReplace
to fill in description as "Process PDF files. When to use: When the user says to process PDFs"
6Create Processing ScriptRun
Write
to create
scripts/pdf_extractor.py
7Validate StructureRun
RunCommand
to execute
python scripts/quick_validate.py ./skills/pdf-processor