Développement de Skills pour Claude Code

VérifiéSûr

Créer, éditer et organiser des skills modulaires pour étendre les capacités de Claude. Gérer la structure SKILL.md, la divulgation progressive et valider les meilleures pratiques.

Spar Skills Guide Bot
DeveloppementIntermédiaire
02/03/2026
Claude Code
#skill-authoring#claude-code#progressive-disclosure#plugins#meta-skill

Recommandé pour

Synthèse automatique

Cette skill guide la création, la modification et la validation de skills Claude Code, avec une structure SKILL.md, un frontmatter YAML et des ressources annexes organisées selon le principe de divulgation progressive.

Points forts

  • Explique clairement l'anatomie d'une skill (SKILL.md obligatoire, puis references/, examples/, scripts/) et les trois niveaux de chargement du contexte
  • Fournit un workflow pas à pas pour créer une skill, en commençant par la validation du besoin et le choix de la complexité
  • Rappelle des règles concrètes de dimensionnement, comme viser 1 500 à 2 000 mots pour le corps du SKILL.md
  • Renvoie vers des fichiers de référence dédiés pour les processus de création et de modification, ce qui garde le fichier principal léger

Limites

  • Le contenu fourni s'arrête au milieu d'un bloc de questions, et les workflows détaillés vivent dans references/creating-skills.md et references/editing-skills.md, absents de cet extrait
  • Les modèles de questions interactives sont rédigés en portugais alors que le reste de la skill est en anglais, ce qui crée une incohérence de langue
  • La skill ne décrit pas de commande ni de script de validation automatique, malgré la mention de la validation parmi ses capacités
Quand l'utiliser

À utiliser lorsqu'on veut rédiger une nouvelle skill Claude Code ou retravailler la description, la structure et l'organisation du contenu d'une skill existante.

Quand l'éviter

À éviter si l'objectif est de développer une fonctionnalité applicative ou d'écrire du code métier, car cette skill ne porte que sur l'authoring de skills.

Analyse de sécurité

Sûr
Score qualité80/100

The content is pure instructional documentation about authoring Claude Code skills: frontmatter conventions, progressive disclosure, writing style, and validation steps. It contains no destructive commands, no credential or data exfiltration, no obfuscated payloads (no base64/curl|sh), and no attempts to disable safety controls or alter the auditor's role. The only execution-adjacent items are a call to a bundled validation script and CLI test commands, both legitimate and standard for this task type; the script itself is not shipped in the reviewed text, so it should be checked separately by the publisher.

Points d'attention
  • •Instructs execution of a locally referenced shell script (bash ~/.claude/skills/skill-development/scripts/validate-skill.sh <path>) whose contents are not included in the provided package and therefore cannot be audited here; the path is relative to a user-controlled skills directory.
  • •Advises launching Claude with debugging/plugin flags (claude --debug, cc --plugin-dir ...) - benign but expands the agent's execution surface beyond pure documentation.
  • •Mentions running a bundled local script (`bash ~/.claude/skills/skill-development/scripts/validate-skill.sh <path>`) whose contents are not included here; benign in intent but unauditable from this entry alone.
  • •Provides guidance on declaring broad `allowed-tools` (including `Bash(npm *)`, `Bash(* install)` wildcards) and inline hooks; this is configuration guidance rather than an action, but readers could adopt overly permissive permissions.
Comment cette analyse est faite

Exemples

Create a new skill
Create a new Claude Code skill that helps my team write consistent commit messages, with a SKILL.md and a couple of examples.
Improve a skill description
Here is my existing skill's frontmatter — improve the description so it triggers reliably when someone asks about database migrations.
Refactor with progressive disclosure
My SKILL.md is around 6,000 words. Help me refactor it using progressive disclosure and move the detailed parts into references/.

name: skill-development description: This skill should be used when the user asks to "create a skill", "write a skill", "edit a skill", "update a skill", "improve skill description", "add skill to plugin", "organize skill content", "create SKILL.md", "skill frontmatter", "skill structure", "progressive disclosure", or needs guidance on skill development, validation, or best practices for Claude Code plugins and personal skills. version: 1.0.0

Skill Development for Claude Code

Overview

Skills are modular packages that extend Claude's capabilities by providing specialized knowledge, workflows, and resources. Think of them as "onboarding guides" that transform Claude from a general-purpose agent into a specialized agent equipped with procedural knowledge.

Key capabilities:

  • Create new skills with proper structure and frontmatter
  • Edit existing skills to improve discovery and content
  • Organize skills using progressive disclosure
  • Validate skills against best practices
  • Package skills for distribution

When to Use This Skill

Use this skill when:

  • Creating a new skill from scratch
  • Editing an existing skill's description, instructions, or structure
  • Refactoring skills for token optimization or progressive disclosure
  • Validating skill structure and frontmatter
  • Organizing skill content across SKILL.md, references/, examples/, scripts/

Skill Anatomy

Every skill consists of a required SKILL.md and optional bundled resources:

skill-name/
├── SKILL.md (required)
│   ├── YAML frontmatter (name, description)
│   └── Markdown body (core instructions)
└── Bundled Resources (optional)
    ├── references/    - Detailed docs loaded as needed
    ├── examples/      - Working code examples
    └── scripts/       - Utility scripts

Progressive Disclosure

Skills use three-level loading to manage context:

| Level | When Loaded | Size Limit | Content | |-------|-------------|------------|---------| | Metadata | Always (startup) | ~100 words | name and description from frontmatter | | Instructions | When triggered | <5k words (~1,500-2,000 words ideal) | SKILL.md body | | Resources | As needed | Unlimited | references/, examples/, scripts/ |

Design principle: Keep SKILL.md lean. Move detailed content to references/.

Quick Start: Create or Edit?

Determine from context whether user wants to create or edit. If unclear, ask:

{
  "questions": [
    {
      "question": "O que você quer fazer?",
      "header": "Ação",
      "multiSelect": false,
      "options": [
        { "label": "Criar nova skill", "description": "Começar do zero" },
        { "label": "Editar skill existente", "description": "Atualizar uma skill que já existe" }
      ]
    }
  ]
}

Then follow the appropriate workflow:

  • Creating: See references/creating-skills.md for detailed creation process
  • Editing: See references/editing-skills.md for detailed editing process

Core Workflow (Creating)

1. Validate Understanding and Gather Requirements

Principle: Don't ask what the user already said. Extract from context first, then ask only what's missing.

Always ask these two questions together:

{
  "questions": [
    {
      "question": "Entendi que você quer uma skill para [RESUMO]. Correto?",
      "header": "Confirmação",
      "multiSelect": false,
      "options": [
        { "label": "Sim, é isso!", "description": "Prosseguir com a criação" },
        { "label": "Quase, mas...", "description": "Vou explicar melhor" }
      ]
    },
    {
      "question": "Qual a complexidade da skill?",
      "header": "Estrutura",
      "multiSelect": false,
      "options": [
        { "label": "Simples", "description": "Só SKILL.md com instruções diretas" },
        { "label": "Média", "description": "SKILL.md + examples ou references" },
        { "label": "Completa", "description": "SKILL.md + references + examples + scripts" }
      ]
    }
  ]
}

Conditional questions (only when needed):

  • Interatividade: Se complexidade >= Média e contexto sugere necessidade
  • Location: Só se não for óbvio (padrão: ~/.claude/skills/)

2. Design Skill Structure

Determine what goes where:

SKILL.md (always loaded when triggered):

  • Core concepts and overview
  • Essential procedures and workflows
  • Quick reference tables
  • Pointers to references/examples/scripts
  • Most common use cases

references/ (loaded as needed):

  • Detailed patterns and advanced techniques
  • Comprehensive API documentation
  • Migration guides
  • Edge cases and troubleshooting
  • Extensive examples and walkthroughs

examples/ (working code):

  • Complete, runnable scripts
  • Configuration files
  • Template files
  • Real-world usage examples

scripts/ (utilities):

  • Validation tools
  • Testing helpers
  • Parsing utilities
  • Automation scripts

3. Write Effective Frontmatter

Required fields:

---
name: skill-name
description: This skill should be used when the user asks to "specific trigger 1", "specific trigger 2", or mentions specific terms. Brief explanation of what it does.
---

Optional fields:

---
name: skill-name
description: Trigger-based description
user-invocable: true          # Show in slash command list (default: true for /skills/)
context: fork                 # Run in isolated context (default: inherit)
agent: swe                    # Specify agent type to execute skill (default: main)
language: portuguese          # Force response language (default: match user's language)
allowed-tools:                # YAML-style list (cleaner than comma-separated)
  - Bash
  - Read
  - Write
  - Edit
hooks:                        # Inline hooks scoped to this skill
  - type: PreToolUse
    once: true               # Run hook only once per session
  - type: PostToolUse
---

When to use optional fields:

  • user-invocable: false: Hide skill from / command list (skill only triggers automatically via description)
  • context: fork: Isolate skill execution from main conversation (useful for experimental or modifying skills)
  • agent: type: Route skill to specialized agent (e.g., swe for code-heavy tasks)
  • language: Force response in specific language regardless of conversation language
  • allowed-tools: Restrict tools skill can use (security/scope control)
  • hooks: Add PreToolUse/PostToolUse/Stop hooks scoped to skill execution only

Naming rules:

  • Lowercase letters, numbers, hyphens only
  • Max 64 characters
  • Use gerund form (verb+ing): analyzing-code, writing-documentation
  • Be specific, not generic

Description requirements:

  • Max 1024 characters
  • Third person: "This skill should be used when..." (NOT "Use this skill when..." or "I help you...")
  • Include BOTH what it does AND when to use it
  • Use specific trigger words users would say
  • Mention file types, operations, and context

Good example:

description: This skill should be used when the user asks to "create a hook", "add a PreToolUse hook", "validate tool use", or mentions hook events (PreToolUse, PostToolUse, Stop). Provides comprehensive hooks API guidance.

Bad examples:

description: Helps with hooks  # Vague, not third person
description: Use this skill for hook development  # Wrong person
description: I can help you create hooks  # First person

4. Write Clear Instructions

Writing style:

  • Use imperative/infinitive form (verb-first instructions)
  • NOT second person ("You should...")
  • Objective, instructional language

Correct:

To create a hook, define the event type.
Configure the MCP server with authentication.
Validate settings before use.

Incorrect:

You should create a hook by defining the event type.
You need to configure the MCP server.

Add interactive patterns when needed:

If the skill helps create/configure something, include AskUserQuestion to gather requirements:

## Instructions

### Step 1: Gather Requirements

Use AskUserQuestion to understand what to create:

\`\`\`json
{
  "questions": [
    {
      "question": "What should this do?",
      "header": "Purpose",
      "options": [...]
    }
  ]
}
\`\`\`

### Step 2: Create Based on Answers

Based on user's selections, create the appropriate structure...

When to add: Skills for creating commands, hooks, configurations, or anything requiring user decisions

See: examples/interactive-workflow-example.md for complete patterns

5. Configure Tool Permissions and Hooks

Tool permissions with YAML lists (recommended):

---
allowed-tools:
  - Bash
  - Read
  - Write
  - Edit
  - Grep
  - Glob
---

Cleaner and less error-prone than comma-separated: allowed-tools: Bash, Read, Write

Bash wildcards for flexible permissions:

---
allowed-tools:
  - Bash(npm *)              # Allow any npm command
  - Bash(git * main)         # Allow git commands with 'main' anywhere
  - Bash(* install)          # Allow any command ending with 'install'
  - Read
  - Write
---

Use wildcards when skill needs variations of commands without listing each one.

Inline hooks for skill-scoped automation:

---
hooks:
  - type: PreToolUse         # Validate before tool execution
    once: true               # Run only once (useful for setup)
  - type: PostToolUse        # React to tool results
  - type: Stop               # Clean up when skill completes
---

Hooks run only when this skill is active. Use for:

  • Validation specific to skill operations
  • Logging/tracking skill actions
  • Setup/teardown within skill lifecycle

See: ../hook-development/ for complete hooks documentation

6. Organize Content

Keep SKILL.md lean (1,500-2,000 words ideal, <5k max):

  • Move detailed content to references/
  • Move examples to examples/
  • Move utilities to scripts/
  • Reference these resources clearly in SKILL.md

Reference resources in SKILL.md:

## Additional Resources

### Reference Files
- **`references/patterns.md`** - Common patterns
- **`references/advanced.md`** - Advanced techniques

### Examples
- **`examples/basic-example.sh`** - Working example

7. Validate the Skill

CRITICAL: Always run automated validation after creating or editing a skill.

Execute the validation script:

bash ~/.claude/skills/skill-development/scripts/validate-skill.sh path/to/skill-name

The script automatically checks:

  • ✓ SKILL.md exists with valid YAML frontmatter
  • ✓ Required fields (name, description) present and valid
  • ✓ Name format (lowercase, hyphens, max 64 chars)
  • ✓ Description format (third person, <1024 chars, specific triggers)
  • ✓ Line count (<500 lines, warns at >400)
  • ✓ Referenced files exist
  • ✓ No second person usage ("you should")

If validation fails:

  1. Fix reported errors
  2. Re-run validation script
  3. Only proceed to testing after passing all checks

Additional manual verification:

  • [ ] Clear instructions in imperative form
  • [ ] Concrete examples provided
  • [ ] Supporting files clearly referenced

8. Test the Skill

For plugin skills:

cc --plugin-dir /path/to/plugin

For personal/project skills:

Skills in ~/.claude/skills/ or .claude/skills/ are hot-reloaded automatically - no restart needed!

  1. Edit the skill file
  2. Try trigger phrases that match the description
  3. Verify skill activates automatically with updated content
  4. Confirm instructions are clear and actionable

Note: Plugin skills still require plugin reload (remove and re-add marketplace)

Debug if needed:

claude --debug  # See skill loading and activation logs

Common Patterns

Minimal Skill (Simple knowledge)

skill-name/
└── SKILL.md

Standard Skill (Recommended)

skill-name/
├── SKILL.md
├── references/
│   └── detailed-guide.md
└── examples/
    └── working-example.sh

Complete Skill (Complex domain)

skill-name/
├── SKILL.md
├── references/
│   ├── patterns.md
│   └── advanced.md
├── examples/
│   ├── example1.sh
│   └── example2.json
└── scripts/
    └── validate.sh

Plugin-Specific Considerations

Skill Location

Plugin skills live in plugin-name/skills/:

my-plugin/
├── .claude-plugin/
│   └── plugin.json
├── commands/
├── agents/
└── skills/
    └── my-skill/
        ├── SKILL.md
        ├── references/
        ├── examples/
        └── scripts/

Auto-Discovery

Claude Code automatically:

  • Scans skills/ directory
  • Finds subdirectories containing SKILL.md
  • Loads skill metadata (name + description) always
  • Loads SKILL.md body when skill triggers
  • Loads references/examples when Claude determines needed

Testing in Plugins

# Test with --plugin-dir
cc --plugin-dir /path/to/plugin

# Verify skill loads and triggers correctly

Best Practices

DO:

  • ✅ Use third-person in description ("This skill should be used when...")
  • ✅ Include specific trigger phrases ("create X", "configure Y")
  • ✅ Keep SKILL.md lean (1,500-2,000 words ideal)
  • ✅ Use progressive disclosure (move details to references/)
  • ✅ Write in imperative/infinitive form
  • ✅ Reference supporting files clearly
  • ✅ Provide working examples
  • ✅ Use gerund naming (analyzing-code not code-analyzer)
  • ✅ Use YAML lists for allowed-tools (cleaner than comma-separated)
  • ✅ Use wildcards in Bash permissions when appropriate (Bash(npm *))
  • ✅ Set user-invocable: false for internal-only skills
  • ✅ Use context: fork for experimental or high-risk operations
  • ✅ Add inline hooks for skill-specific automation

DON'T:

  • ❌ Use second person anywhere
  • ❌ Have vague trigger conditions
  • ❌ Put everything in SKILL.md (>3,000 words without references/)
  • ❌ Leave resources unreferenced
  • ❌ Include broken or incomplete examples
  • ❌ Skip validation
  • ❌ Make all skills user-invocable (some should be auto-trigger only)
  • ❌ Over-restrict with comma-separated allowed-tools when wildcards work better

Additional Resources

Reference Files

For detailed processes and techniques, consult:

  • references/creating-skills.md - Complete skill creation process with AskUserQuestion patterns
  • references/editing-skills.md - Detailed editing workflows and refactoring patterns
  • references/best-practices.md - Validation rules, common mistakes, optimization techniques

Example Skills

Study these skills as templates:

  • ../hook-development/ - Progressive disclosure, utilities, complete structure
  • ../command-development/ - Clear critical concepts, good organization
  • ../sync-claude-md/ - Well-structured analysis skill

Implementation Workflow Summary

To create a skill:

  1. Understand use cases: Ask questions, gather examples
  2. Plan resources: Determine what scripts/references/examples needed
  3. Create structure: mkdir -p skills/skill-name/{references,examples,scripts}
  4. Write SKILL.md:
    • Frontmatter with third-person description and trigger phrases
    • Lean body (1,500-2,000 words) in imperative form
    • Reference supporting files
  5. Add resources: Create references/, examples/, scripts/ as needed
  6. Validate: Check description, writing style, organization
  7. Test: Verify skill loads on expected triggers
  8. Iterate: Improve based on usage

To edit a skill:

  1. Read current skill: Analyze structure, content, line count
  2. Determine edit type: Description, instructions, new section, or refactor
  3. Make changes: Use Edit tool to update specific sections
  4. Validate: Check all requirements still met
  5. Test: Verify skill still activates correctly

Focus on strong trigger descriptions, progressive disclosure, and imperative writing style for effective skills that load when needed and provide targeted guidance.

Du fichier au premier essai

Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.

Consulter la source et ses fichiers annexes

Ce téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.

1. Télécharger le fichier

Télécharger SKILL.md

Depuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/skill-development-for-claude-code-mm8o52q8/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.

Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.

mkdir -p '.skill-downloads/skill-development-for-claude-code-mm8o52q8' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/skill-development-for-claude-code-mm8o52q8/download' --output '.skill-downloads/skill-development-for-claude-code-mm8o52q8/SKILL.md.part' && mv '.skill-downloads/skill-development-for-claude-code-mm8o52q8/SKILL.md.part' '.skill-downloads/skill-development-for-claude-code-mm8o52q8/SKILL.md'

2. Vérifier les prérequis

Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.

Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.

Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.

3. Charger la skill

Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.

Claude Code
test -f '.skill-downloads/skill-development-for-claude-code-mm8o52q8/SKILL.md' && test -s '.skill-downloads/skill-development-for-claude-code-mm8o52q8/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/skill-development' && cp -R '.skill-downloads/skill-development-for-claude-code-mm8o52q8' '.claude/skills/skill-development'

OpenSkills

OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.

Installation officielle d’OpenSkills
openskills install './.skill-downloads/skill-development-for-claude-code-mm8o52q8'

openskills read 'skill-development-for-claude-code-mm8o52q8'

La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.

Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.

openskills sync

Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.

4. Faire un premier essai

Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :

Lis .skill-downloads/skill-development-for-claude-code-mm8o52q8/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.

Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.

Skills similaires