Lesson 2 - Designing a Skill Artifact

Translate your charter into a concrete folder structure, master SKILL.md frontmatter, and understand how progressive disclosure keeps skills fast and maintainable.

Duration: 1.5-2 hours

Learning Objectives

By the end of this lesson, you will be able to:

  • Create a correctly named skill directory with a valid SKILL.md file.
  • Author compliant YAML frontmatter with name and description (required) plus optional governance fields.
  • Structure the instruction body with scannable sections that map to the four-part hierarchy.
  • Decide when to add scripts/, references/, and assets/ without bloating SKILL.md.

Videos

From Charter to Folder

Live-build the minimum viable skill folder, validate naming conventions, and watch the AI tool recognize it instantly.

Duration: 7 minutes

Video coming soon

SKILL.md Frontmatter Deep Dive

Walk through every field, explain why descriptions must be scenario-specific, and show what makes the AI activate your skill.

Duration: 10 minutes

Video coming soon

Instruction Body and Supporting Directories

Structure the markdown body with placeholder sections and learn when to offload content into supporting directories.

Duration: 8 minutes

Video coming soon

Key Concepts

Canonical Skill Layout

Here's the complete anatomy of a skill: ``` deploy-checklist/ # Folder name = skill name (kebab-case) ├── SKILL.md # Required — frontmatter + instructions ├── references/ # Optional — templates, examples, style guides │ ├── template.md │ └── example-good.md ├── scripts/ # Optional — automation scripts │ └── run-sanity-check.sh └── assets/ # Optional — data files, configs, images └── release-matrix.json ``` **Only SKILL.md is required.** Everything else is optional. Start minimal, add directories when you need them.

Complete SKILL.md Example: deploy-checklist

Here is the running example skill we'll build across this course: ```markdown --- name: deploy-checklist description: Run pre-deploy validations before shipping backend services to production. Checks migrations, tests, environment variables, and team notifications. --- # Deploy Checklist ## Trigger Activate when the user is about to deploy backend services to production or staging. Do NOT activate for frontend-only changes or documentation updates. ## Workflow 1. Check for pending database migrations — list any unapplied migrations. 2. Run the test suite — report pass/fail with summary. 3. Verify environment variables — confirm all required vars are set for the target environment. 4. Check for uncommitted changes — warn if the working directory is dirty. 5. Generate a deployment summary for the team notification. ## Constraints - Never run destructive commands (DROP, DELETE, rm -rf) during validation. - Do not proceed if tests fail — stop and report the failures. - Do not modify any source files — this skill only validates and reports. ## Output Return a markdown checklist: ### Deploy Readiness Report - [ ] Migrations: [status] - [ ] Tests: [pass/fail count] - [ ] Env vars: [status] - [ ] Clean working directory: [yes/no] - [ ] Summary: [one-line description of what's being deployed] ``` This is a complete, working skill. We'll refine it over the next five lessons.

Frontmatter Field Reference

**Required fields (open standard):** | Field | Rules | Example | |-------|-------|---------| | `name` | Lowercase + hyphens, max 64 chars, must match folder name | `deploy-checklist` | | `description` | Max 1024 chars, explains WHEN to use the skill | `Run pre-deploy validations before shipping backend services` | **Optional fields (open standard):** | Field | Purpose | Example | |-------|---------|--------| | `license` | License for sharing | `MIT` | | `compatibility` | Platforms tested + requirements | `Tested on Claude Code, Copilot` | | `metadata` | Arbitrary key-value pairs | `author: Jane Doe` | **Note:** Some platforms add extra fields (Lesson 6 covers these). Always use the standard fields first.

Progressive Disclosure: How AI Loads Skills

Your AI doesn't read every skill fully at startup — that would be slow. Instead, it uses **three-stage loading**: **Stage 1 — Metadata (~100 tokens):** At startup, the AI reads only `name` and `description` from frontmatter. This is how it knows what skills exist. **Stage 2 — Instructions (<5,000 tokens):** When a task matches a skill's description, the AI loads the full SKILL.md body. Now it has detailed instructions. **Stage 3 — Resources (on demand):** Only when referenced by the instructions, the AI reads files from `scripts/`, `references/`, or `assets/`. This is why a great `description` matters so much — it's the gateway to everything else.

Supporting Directory Decision Tree

Ask these questions before adding a directory: | Question | If Yes → | Example | |----------|---------|--------| | Am I pasting the same template into SKILL.md? | Move it to `references/` | Output template, style guide | | Do I need repeatable automation? | Create a `scripts/` file | Lint checker, test runner | | Does the AI need static data to do its job? | Store it in `assets/` | JSON config, CSV data | | Is SKILL.md over 400 lines? | Split content into supporting files | Long examples → references/ | **Default answer: not yet.** Start with just SKILL.md. Add directories when you feel the pain.

Common Mistakes & Pitfalls

Folder name doesn't match the name field

If your folder is 'code-review/', the name field MUST be 'code-review'. Any mismatch makes the skill invisible to your AI tool.

Writing a vague description

'A helpful deployment skill' tells the AI nothing. Write: 'Run pre-deploy validations before shipping backend services to production.' The AI uses the description to decide WHEN to activate.

Adding directories before you need them

An empty scripts/ folder adds complexity without value. Start with just SKILL.md. Add scripts/ when you actually have a script to put there.

Using uppercase, spaces, or underscores in the skill name

Skill names must be lowercase with hyphens: 'deploy-checklist' not 'Deploy_Checklist' or 'deploy checklist'.

Putting everything in one massive SKILL.md

If SKILL.md exceeds 500 lines, it becomes hard to scan and maintain. Move templates to references/, data to assets/, and automation to scripts/.

Exercises

Exercise 1: Build Your Skill Skeleton

15 minutes

Create the folder for your chartered workflow. Add SKILL.md with valid frontmatter and the four placeholder sections (Trigger, Workflow, Constraints, Output).

Expected Output:

A folder with SKILL.md containing frontmatter + placeholder section headings.

Success Criteria:

  • Folder name is lowercase kebab-case, under 64 characters.
  • SKILL.md frontmatter has name (matching folder) and a scenario-specific description.
  • Four placeholder sections (Trigger, Workflow, Constraints, Output) are present.
  • Committed to git with a descriptive commit message.

Exercise 2: Description Stress Test

20 minutes

Write three different descriptions for your skill. Test each by asking: 'Would the AI activate this skill for the right task and NOT activate it for the wrong task?'

Expected Output:

Three candidate descriptions with notes on which is most precise.

Success Criteria:

  • Three descriptions that differ meaningfully, not just in wording.
  • Evaluated each against a 'should activate' scenario and a 'should NOT activate' scenario.
  • Selected the strongest description and updated SKILL.md.

Exercise 3: Reverse-Engineer an Existing Skill

15 minutes

Find a community skill (github.com/anthropics/skills or similar). Map each file to the canonical layout diagram. Note how they use frontmatter and supporting files.

Expected Output:

Annotated breakdown of another team's skill structure.

Success Criteria:

  • Identified every frontmatter field in the reference skill.
  • Documented how the instruction body links to supporting files.
  • Listed one idea to adopt and one thing you'd do differently.

Lesson Reflection

Take a moment to reflect on what you've learned:

  • 1. Look at the complete deploy-checklist example. Which section is clearest? Which would you write differently?
  • 2. For your chartered workflow, is SKILL.md alone enough, or do you already know you'll need supporting files?
  • 3. How would you describe your skill in one sentence so the AI knows EXACTLY when to activate it?
  • 4. What's the difference between a description that says what the skill does vs. when to use it?