Create Skill Command

VerifiedCaution

Workflow to create production-ready Claude Code skills with validation, testing, and optimization.

Sby Skills Guide Bot
DevelopmentIntermediate
8/13/2026
Claude Code
#skill-authoring#validation#testing#markdown#token-optimization

Recommended for

Automated summary

This skill guides the creation of production-ready Claude Code skills, covering scaffolding, resource planning, writing, token optimization, and automated validation.

Strengths

  • Clear five-step workflow: requirements gathering, initialization, resource planning, content writing, optimization
  • Explicit validation checklist covering YAML frontmatter, shebangs, relative paths, markdown linting, and token count
  • Concrete test templates for syntax checks, script execution, and diffing output against expected fixtures
  • Delegates compression and markdown hygiene to companion skills (skill-creator, token-formatter, md)

Limitations

  • Assumes the skill-creator, token-formatter, and md skills plus init_skill.py and package_skill.py already exist under .claude/skills
  • Tightly coupled to the .claude/skills directory layout, so it does not transfer cleanly to other agent tools
  • The testing sections are truncated and need to be completed by the user before use
When to use it

Use it when building or hardening a Claude Code skill that ships scripts, references, and a validated test suite.

When not to use it

Skip it for a small wording edit to an existing skill, or in environments that do not follow the .claude/skills layout.

Security analysis

Caution
Quality score70/100

The skill provides a legitimate workflow for creating and testing AI skills using local scripts and shell commands. It does not include destructive actions, network calls, secret exfiltration, obfuscated payloads, or attempts to disable safety. The only minor concern is that it directs the agent to execute local scripts and bash commands, which is normal for this type of meta-skill but warrants a 'caution' rating under the provided guidance.

Findings
  • •Instructs running local Python and Bash commands (e.g., py_compile, bash -n, node --check, diff) for skill creation and testing; commands are benign and local, but execution is required.
  • •Skill instructs the agent to execute local Python scripts (scripts/init_skill.py, scripts/package_skill.py, count_tokens.py) and run shell commands, despite declaring no allowed-tools — execution surface is broader than the manifest implies
  • •Hard dependency on sibling skill paths (.claude/skills/skill-creator, token-formatter, document-skills/md) that must be trusted; a compromised sibling skill would be pulled into every creation workflow
  • •No destructive, exfiltration, obfuscation, or safety-disabling behavior found; no prompt-injection or role-override attempts in the content
How this analysis is made

Examples

New scripted skill
Create a skill called csv-to-parquet that converts CSV files to Parquet with schema validation, and include scripts plus tests.
Harden an existing skill
Review .claude/skills/my-skill, add the required YAML frontmatter, token-optimize SKILL.md, and write tests for every script in it.
Validate before shipping
Run the validation checklist on this skill folder and package it, reporting any failing checks.

Create Skill Command

Goal: Create production-ready skills w/ validation, testing & optimization.

1. Required Skills

Use these skills during creation:

| Skill | Path | Purpose | |-------|------|---------| | skill-creator | .claude/skills/skill-creator/ | Core creation workflow | | token-formatter | .claude/skills/token-formatter/ | Compress SKILL.md content | | md | .claude/skills/document-skills/md/ | Clean markdown w/o errors |

2. Creation Flow

Step 1: Understand Requirements

Ask user:

  1. "What should this skill do?"
  2. "Example usage scenarios?"
  3. "Any scripts/assets needed?"

Step 2: Init Skill

python scripts/init_skill.py <skill-name> --path .claude/skills/<skill-name>

Creates:

skill-name/
├── SKILL.md
├── scripts/
├── references/
└── assets/

Step 3: Plan Resources

Analyze examples → identify:

| Resource | When | |----------|------| | scripts/ | Repeated code, deterministic tasks | | references/ | Docs, schemas, API specs | | assets/ | Templates, images, fonts |

Step 4: Write Content

SKILL.md rules:

  • YAML frontmatter: name & description (req)
  • Imperative form ("To do X" not "You should")
  • Keep lean → move details to references/
  • Apply token-formatter compression

Writing style:

# Skill Name

Brief purpose (1-2 sentences).

## When to Use

Invoke when:
- Condition 1
- Condition 2

## Process

1. Step one
2. Step two

Step 5: Optimize

Apply token-formatter:

  • Abbreviations: fn, str, num, config, auth, db, etc.
  • Remove filler words
  • Compress tables & lists
  • Use symbols: →, |, &, w/, w/o

Apply md skill:

  • Proper fence nesting (use ```` for outer)
  • Match opening/closing fences
  • Escape | in tables
  • Consistent list indentation
  • Blank lines around code blocks

3. Testing (REQUIRED)

Test Location

tests/<skill-name>/
├── test_*.py          # Python tests
├── test_*.sh          # Bash tests
├── fixtures/          # Test data
└── expected/          # Expected outputs

Script Testing

For EVERY script in scripts/:

  1. Syntax check:
# Python
python -m py_compile scripts/<script>.py

# Bash
bash -n scripts/<script>.sh

# Node
node --check scripts/<script>.js
  1. Execution test:
# Run w/ test fixtures
python scripts/<script>.py tests/<skill>/fixtures/input.txt
  1. Output validation:
# Compare output to expected
diff output.txt tests/<skill>/expected/output.txt

Validation Checklist

Before completion, verify:

  • [ ] SKILL.md has valid YAML frontmatter
  • [ ] name & description present in frontmatter
  • [ ] All scripts execute w/o errors
  • [ ] All scripts have proper shebang
  • [ ] References files are valid markdown
  • [ ] No hardcoded paths (use relative)
  • [ ] Token-optimized (check w/ count_tokens.py)
  • [ ] No markdown linting errors

Automated Validation

# Package & validate skill
python scripts/package_skill.py .claude/skills/<skill-name>

Checks:

  • YAML frontmatter format
  • Required fields present
  • Directory structure
  • File organization

4. Test Script Template

Create tests/<skill>/test_skill.py:

#!/usr/bin/env python3
"""Tests for <skill-name> skill."""

import subprocess
import os
from pathlib import Path

SKILL_DIR = Path(__file__).parent.parent.parent / ".claude/skills/<skill>"
FIXTURES = Path(__file__).parent / "fixtures"
EXPECTED = Path(__file__).parent / "expected"

def test_script_syntax():
    """Verify all scripts have valid syntax."""
    for script in (SKILL_DIR / "scripts").glob("*.py"):
        result = subprocess.run(
            ["python", "-m", "py_compile", str(script)],
            capture_output=True
        )
        assert result.returncode == 0, f"Syntax error: {script}"

def test_script_execution():
    """Verify scripts run w/o errors."""
    # Add script-specific tests
    pass

def test_skill_md_valid():
    """Verify SKILL.md has valid frontmatter."""
    skill_md = SKILL_DIR / "SKILL.md"
    content = skill_md.read_text()
    assert content.startswith("---"), "Missing YAML frontmatter"
    assert "name:" in content, "Missing name field"
    assert "description:" in content, "Missing description field"

if __name__ == "__main__":
    test_script_syntax()
    test_skill_md_valid()
    print("All tests passed!")

5. Execution Summary

1. Understand     → Ask user, clarify scope
2. Init           → Run init_skill.py
3. Plan           → Identify scripts/refs/assets
4. Write          → SKILL.md + resources
5. Optimize       → token-formatter + md skill
6. Test           → Create tests, run validation
7. Package        → package_skill.py
8. Iterate        → Fix issues, re-test

6. Quick Reference

Abbreviations (token-formatter)

fn=function  str=string  num=number  bool=boolean
arr=array    obj=object  param=parameter
config=configuration     env=environment
auth=authentication      db=database
req=required opt=optional def=default
w/=with      w/o=without  &=and  |=or

Frontmatter Template

---

name: skill-name
description: Brief desc. Use third-person ("This skill should be used when...")
license: Complete terms in LICENSE.txt
---

Directory Structure

.claude/skills/<skill>/
├── SKILL.md              # Core instructions (req)
├── scripts/              # Executable code (opt)
├── references/           # Docs to load as needed (opt)
└── assets/               # Output files (opt)

tests/<skill>/
├── test_*.py             # Test scripts
├── fixtures/             # Test inputs
└── expected/             # Expected outputs

Ref: .claude/skills/skill-creator/SKILL.md, .claude/skills/token-formatter/SKILL.md, .claude/skills/document-skills/md/SKILL.md

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/create-skill-command-msr1u8au/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/create-skill-command-msr1u8au' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/create-skill-command-msr1u8au/download' --output '.skill-downloads/create-skill-command-msr1u8au/SKILL.md.part' && mv '.skill-downloads/create-skill-command-msr1u8au/SKILL.md.part' '.skill-downloads/create-skill-command-msr1u8au/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

This file does not provide a usable name/description header for this native procedure. It remains available to download and inspect; use the manual method below.

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/create-skill-command-msr1u8au/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills