How to Create Claude Skills: A Zero-to-One Development Guide

Emma Wilson date: 2025-03-18
AI DevelopmentMCPPythonClaude API
Learn how to create your own Claude Skills from scratch. Includes SKILL.md file writing, directory structure design, prompt optimization, testing, and publishing process to make you a skill developer.

Core Concept: Understanding the MCP Protocol

Before creating Claude Skills, you need to understand the Model Context Protocol (MCP). This is an open standard introduced by Anthropic that allows developers to connect data sources and tools in a unified way. Creating a "Skill" essentially means building an MCP Server.

Step 1: Design the Directory Structure

A standardized Claude Skill project requires a clear structure for model understanding and developer maintenance.

my-claude-skill/
├── src/
│   └── server.py       # Core logic: Defines tool functions
├── SKILL.md            # Skill Manual: Instructions for Claude
├── pyproject.toml      # Dependency management
└── README.md           # Project documentation


Step 2: Write SKILL.md (The Skill Manual)

SKILL.md is the "soul" of the skill. It is an extension of the System Prompt for Claude.

  • Role Positioning: Define the expert persona this skill grants Claude.
  • Tool Contract: Describe input parameters (Types) and expected outputs for each function.
  • Usage Boundaries: Inform Claude when not to use this skill.

Step 3: Implement Core Logic (Python Example)

Using the SDK provided by Anthropic, you can easily expose Python functions as Claude Skills.

from mcp.server.fastmcp import FastMCP

mcp = FastMCP("DataAnalyzer")

@mcp.tool()
async def calculate_roi(investment: float, revenue: float) -> str:
    """Calculate Return on Investment (ROI)"""
    roi = ((revenue - investment) / investment) * 100
    return f"The project ROI is {roi:.2f}%"

if __name__ == "__main__":
    mcp.run()


Step 4: Prompt Optimization (Prompt Engineering)

Optimize the Description of your tools:

  1. Start with Verbs: Use "Calculate...", "Retrieve...", "Modify...".
  2. Describe Scenarios: e.g., "Suitable for real-time financial data analysis."
  3. Explain Parameters: Specify units (e.g., price: float - "unit in USD").