AgentSkillsCN

meta-skill

为打造高效的 AI 智能体技能提供指南。当用户希望创建新技能、更新已有技能,或需要技能架构与最佳实践方面的指导时,可使用此技能。 触发条件:“创建技能”“新技能”“制定技能”“技能模板”。

SKILL.md
--- frontmatter
name: meta-skill
description: |
  Guide for creating effective AI agent skills. Use when users want to create a new skill,
  update an existing skill, or need guidance on skill architecture and best practices.
  Triggers: "create a skill", "new skill", "make a skill", "skill template"

Meta-Skill Creator

A meta-skill that helps create new skills for AI agents. This skill provides structured workflows, automation scripts, and quality assurance mechanisms for skill development.

Output Language: All generated skill content (SKILL.md, comments, documentation) will be in English.

Quick Start

Create a New Skill

bash
# Initialize a new skill (using npx/bunx)
npx ts-node scripts/init-skill.ts <skill-name> --path <output-directory>

# Or with Bun
bun scripts/init-skill.ts <skill-name> --path <output-directory>

# Example
bun scripts/init-skill.ts my-awesome-skill --path .claude/skills

Validate and Package

bash
# Validate skill structure
bun scripts/validate-skill.ts <skill-folder>

# Package for distribution
bun scripts/package-skill.ts <skill-folder> [output-dir]

Skill Creation Workflow (6 Phases)

Follow these phases in order. Each phase has specific deliverables and validation criteria.

Phase 1: UNDERSTAND

Goal: Gather concrete examples of how the skill will be used.

Questions to Ask:

  1. "What specific scenarios trigger this skill?"
  2. "Can you provide 3-5 concrete usage examples?"
  3. "What keywords should activate this skill?"
  4. "What inputs does it receive? What outputs does it produce?"

Deliverables:

  • Trigger condition list
  • 3-5 usage scenarios with examples
  • Expected input/output format

Exit Criteria: Clear understanding of skill purpose and usage patterns.

Phase 2: PLAN

Goal: Identify reusable content and structure.

Analysis Checklist:

Content TypeWhen to IncludeExamples
scripts/Repetitive code, deterministic operationsFile processing, API calls, automation
references/Detailed docs, schemas, lengthy guidesAPI docs, database schemas, workflow guides
assets/Output templates, images, fontsHTML templates, config files, boilerplate

Freedom Level Decision:

LevelWhen to UseImplementation
HighMultiple valid approachesText instructions only
MediumPreferred pattern existsPseudocode or parameterized scripts
LowFragile operations, consistency criticalSpecific scripts with minimal parameters

Deliverables:

  • Directory structure design
  • Progressive Disclosure strategy
  • Freedom level for each component

Phase 3: INITIALIZE

Goal: Create skill directory and template files.

Action: Run the initialization script:

bash
bun scripts/init-skill.ts <skill-name> --path <output-directory>

The script creates:

code
skill-name/
├── SKILL.md              # Template with placeholders
├── scripts/
│   └── example.ts        # Example TypeScript script template
├── references/
│   └── guide.md          # Example reference template
└── assets/
    └── .gitkeep          # Placeholder for assets

Deliverables: Initialized skill directory with all templates.

Phase 4: IMPLEMENT

Goal: Write skill content and implement resources.

4.1 Write SKILL.md Frontmatter

yaml
---
name: skill-name           # Required: kebab-case, max 64 chars
description: |             # Required: triggers + purpose
  Describe the skill and when to use it.
  Triggers: "keyword1", "keyword2", "keyword3"
---

4.2 Write SKILL.md Body

Structure options (choose based on skill type):

PatternBest ForStructure
Workflow-BasedSequential processesDecision Tree → Steps
Task-BasedTool collectionsQuick Start → Task Categories
Reference/GuidelinesStandards, specsOverview → Guidelines → Specs
Capabilities-BasedIntegrated systemsCapabilities → Features

4.3 Implement Scripts (TypeScript/JavaScript)

typescript
#!/usr/bin/env node
// scripts/my-script.ts

import { readFileSync, writeFileSync } from 'fs';
import { join } from 'path';

async function main() {
  const args = process.argv.slice(2);
  // Implementation here
  console.log('Script execution complete');
}

main().catch(console.error);
  • Test ALL scripts by actually running them
  • Include helpful error messages
  • Handle edge cases gracefully

4.4 Write References

  • Keep SKILL.md under 500 lines
  • Move detailed content to references/
  • Always link references from SKILL.md

Deliverables: Complete skill implementation.

Phase 5: VALIDATE

Goal: Ensure skill meets quality standards.

Run Validation:

bash
bun scripts/validate-skill.ts <skill-folder>

Validation Checklist:

CategoryCheckRequirement
Frontmattername fieldkebab-case, max 64 chars, matches directory name
Frontmatterdescription fieldIncludes triggers, purpose, when to use
StructureSKILL.md existsRequired
StructureLine count< 500 lines (split to references if exceeded)
ContentNo unresolved placeholdersAll TODO markers resolved
ScriptsExecution testAll scripts run without errors
ReferencesExplicit linksAll references linked from SKILL.md

Exit Criteria: All validation checks pass.

Phase 6: PACKAGE

Goal: Create distributable .skill file.

Action:

bash
bun scripts/package-skill.ts <skill-folder> [output-dir]

Output: <skill-name>.skill file (ZIP format with .skill extension)

Post-Package:

  1. Test the packaged skill
  2. Collect usage feedback
  3. Iterate based on real usage

Progressive Disclosure Patterns

Keep context efficient by loading content progressively:

LevelWhen LoadedSize LimitContent
1Always~100 wordsname + description
2On trigger<5k wordsSKILL.md body
3On demandUnlimitedscripts/, references/, assets/

Pattern 1: High-level Guide with References

markdown
# Main Skill

## Quick Start
[Essential instructions here]

## Advanced Features
- **Feature A**: See [FEATURE_A.md](references/feature_a.md)
- **Feature B**: See [FEATURE_B.md](references/feature_b.md)

Pattern 2: Domain-Specific Organization

code
skill/
├── SKILL.md (overview + navigation)
└── references/
    ├── frontend.md    # Frontend-specific
    ├── backend.md     # Backend-specific
    └── deployment.md  # Deployment-specific

Pattern 3: Conditional Details

markdown
## Basic Usage
[Simple instructions]

## Advanced (when needed)
**For complex scenarios**: See [ADVANCED.md](references/advanced.md)

Anti-Patterns to Avoid

Anti-PatternProblemSolution
Verbose descriptionsWastes context tokensBe concise, focus on triggers
Missing triggersSkill won't activateInclude explicit trigger phrases
SKILL.md > 500 linesContext bloatSplit to references/
Unnecessary filesClutter and confusionOnly include essential files
Untested scriptsRuntime failuresTest all scripts before packaging
Deeply nested refsHard to navigateKeep references 1 level deep
Duplicated contentMaintenance burdenSingle source of truth

Platform Compatibility

This skill generates output compatible with:

PlatformSkill LocationStatus
Claude Code.claude/skills/Full Support
OpenCode.opencode/skills/Full Support

References