Mastering Claude Code — From Zero to 10x — 3. Your first skill: /post

17 min read min de lecture
Chapter 03

Your first skill: /post

Chapter 3 of 10 · 30%

Chapter objectives

  • Understand what a skill is and where it lives in your project
  • Create a skill by describing your need (without writing the file by hand)
  • Test the pipeline end to end on a single platform

What is a skill?

So far, every request to Claude has been disposable: you write a prompt, you get a result, and next time you retype everything. A skill changes that. It's a slash command you build yourself: you type /post and Claude follows the instructions you defined once and for all. Skills persist across conversations: you build them once, you reuse them forever.

This is the most important concept in the course. The difference between a casual user and a 10x user isn't prompt quality — it's that the 10x user compounds. Every solved problem becomes a permanent tool. Three months in, the casual user is retyping their instructions; the 10x user has a toolbox of fifteen commands encoding all their domain expertise.

For Lea, the /post skill will encode her entire publishing process: where to look for information, how to structure a post, what image format to generate, how to log everything. That know-how, currently in her head, will tomorrow live in a file Claude executes on demand.

Anatomy of a skill

A skill lives in your project as a folder containing a SKILL.md file:

text
.claude/
  skills/
    post/
      SKILL.md      <-- the skill's instructions (required)
      reference.md  <-- (optional) reference doc loaded on demand
      scripts/      <-- (optional) utility scripts for the skill

The SKILL.md file contains a YAML header (the "frontmatter": name and description) followed by free-form Markdown instructions. The folder name becomes the command: .claude/skills/post//post. Here's what the structure looks like:

text
---
name: post
description: Publishes a post to a social network (text + visual + log). Use when the user wants to publish or schedule content.
---

# Role
You are the brand's social media manager...

# Steps
1. Identify the platform and topic provided
2. Research the topic if needed
3. Write the post in the platform's format
...

A detail that matters: the frontmatter description isn't decorative. It's what Claude reads to decide whether the skill is relevant — it can even invoke it on its own when your request matches, without you typing the command. A good description says what the skill does and when to use it. The file's body, on the other hand, is only loaded into context at execution time: that's what lets you have dozens of skills without weighing down every session.

You do NOT write this file by hand. You describe your need, Claude creates the folder and writes SKILL.md. You can always open it, read it, and request changes — but letting Claude write the first version is faster and avoids format mistakes.

Project skills or personal skills?

.claude/skills/ (project)The skill belongs to the project. Versionable in Git, shared with anyone who clones the repo. The right choice for /post: it's tied to Lea's brand.
~/.claude/skills/ (personal)The skill follows you across all your projects. Ideal for your cross-cutting tools: summarizing a meeting, formatting an email, your personal conventions.

The decision rule is simple: if the skill contains project-specific context (Lea's voice, her platforms, her APIs), it goes in the project. If it encodes a habit of yours, independent of the project, it goes in your personal folder.

Building the skill (starting simple)

We start with a single platform to validate the whole pipeline: text generation, the visual, and publishing. We'll go multi-platform later. This discipline — shrinking the scope until a minimal version works end to end — is the number one skill of automation. Paste this prompt into Claude Code:

PROMPT
create a new claude code skill "post" in this folder.

role: AI social media manager for linkedin, instagram, twitter, facebook.
the user provides a platform + any combination of: a topic, a post to adapt, a URL (youtube, article, pdf), or their own images.
infer the intent from what's provided.
maintain a log file of published posts and their URLs.

ask me questions one at a time until you're 95% sure you can complete the task successfully.

The most useful sentence in the course

Notice the last line: "ask me questions one at a time until you're 95% confident." It's one of the most powerful patterns when working with AI, and it deserves a closer look.

The natural reflex is to try to scope everything in your first prompt — and to fail, because nobody thinks of everything in advance. This pattern flips the burden: Claude interrogates you. Its questions reveal the holes in your thinking ("what should happen if the user provides an image AND a URL?", "should the log include unpublished drafts?"), which you fill through dialogue rather than by anticipating everything. Answer one question at a time; when Claude has enough context, it builds the skill.

The "one at a time" matters too: if Claude asks eight questions at once, you'll answer all eight superficially. One at a time, each answer feeds the next question — it becomes a real scoping conversation, like working with a competent freelancer taking your brief.

Testing the skill

Close and reopen a session (new skills are detected at startup). Type /: you should see /post in the list with its description. Run a first test:

text
/post "prompt tips for beginners" twitter

Claude generates a visual, writes the post and publishes it (or schedules it), then logs the result. The goal here isn't volume: it's to validate the complete pipeline before scaling up. If an API key is wrong, an account is misconnected, or an image format gets rejected by the platform, you find out now, on a single test post — not while publishing a week's worth of content.

flowchart LR
  A["/post topic + platform"] --> B["Topic research"]
  B --> C["Text writing"]
  C --> D["Visual generation"]
  D --> E["Publish via API"]
  E --> F["Post log"]
The complete /post pipeline — every link is validated on a single platform first.

Connecting the APIs without pulling your hair out

To actually publish, your skill needs access to the social networks' APIs — either by calling a publishing API directly (most post-scheduling tools offer one), or through an MCP (Model Context Protocol) server, the standard that lets you plug external tools into Claude Code with the claude mcp add command. Good news: you don't need to read the documentation yourself. Give Claude the docs URL and tell it "read this documentation and set up the integration."

For API keys, the clean convention: a .env file at the project root (added to .gitignore!), which commands reference without ever displaying the value. Explicitly ask Claude to follow this convention — and that's exactly the kind of rule we'll carve into CLAUDE.md in chapter 8.

If /post doesn't appear in the list: check that the file is exactly at .claude/skills/post/SKILL.md (a misspelled folder is the classic mistake), that the YAML frontmatter is present, then restart the session.
🛠️ Your turn

Context

Lea wants her first automated post on a single network to verify everything works. She picked Twitter as the testing ground: posts are short, iteration is fast, and a mistake there hurts less than on LinkedIn where her professional clientele follows her. Your goal: a pipeline that runs end to end, from topic to log, even if the result isn't perfect yet.

Instructions

  1. Ask Claude to create the /post skill using the prompt provided in the chapter.
  2. Answer its questions one by one (test platform, tone, length, log format…) — take your time, the scoping is what makes the quality.
  3. Open the generated .claude/skills/post/SKILL.md file and read it: spot the frontmatter and the steps.
  4. Restart the session, type /, and verify that /post appears with its description.
  5. Run /post "launching our organic moisturizing cream" twitter and watch every link in the pipeline.
  6. Check the log file: the post, its URL, and its date should be there.
  7. Ask for an improvement to the skill (for example: "always add a brand hashtag") and rerun to verify it took effect.
Hint — If the skill doesn't appear, check that the file is at .claude/skills/post/SKILL.md and that the session was restarted after creation.

In summary

  • A skill = a reusable slash command, defined in .claude/skills/<name>/SKILL.md.
  • The frontmatter (name + description) tells Claude when to use the skill; the body is only loaded at execution time.
  • Project skills (.claude/skills/, versioned) vs personal skills (~/.claude/skills/, cross-cutting).
  • You describe your need; Claude writes the SKILL.md for you.
  • The phrase "ask me questions one at a time until 95%" surfaces details you'd never have anticipated.
  • Start with a single platform to validate the whole pipeline before scaling up.
  • API keys live in a .env ignored by Git; external integrations go through APIs or an MCP server.

Quiz — check your understanding

1. Where does a skill named "post" live?

The .claude/skills/post/ folder contains SKILL.md, and its name becomes the /post command.

2. Why start with a single platform?

Better to catch a wrong API key on a test than on an entire week of content.

3. What is the description in SKILL.md's frontmatter for?

A good description says what the skill does and when to use it: Claude can even invoke it on its own if the request matches.

4. Why ask for questions "one at a time" rather than all at once?

Eight questions at once produce eight superficial answers; one at a time, the scoping gains depth.

5. What's the right place for a "format my emails" skill you want in all your projects?

A cross-cutting skill, independent of the project, goes in your personal ~/.claude/skills/ folder so it follows you everywhere.

Auteur(s)

R

REHOUMA Haythem

Haythem Rehouma est un ingénieur et architecte IA et cloud, formateur et enseignant technique, avec un profil orienté IA médicale, AWS, MLOps, LLM/RAG et vision par ordinateur.