Agent Mentor Learn
Claude Code Skills: Build Your Own AI Workflows · Lesson 4 of 6

Lesson 4: Testing and Debugging: Making Sure Your Skill Behaves

Learning goals:

  • Learn the basic ways to test a Skill
  • Diagnose the failures you'll actually hit
  • Understand the iteration loop
  • Know how to check whether a Skill is genuinely worth keeping

Prerequisites: << Lesson 3 | Next: Lesson 5 >>

Your first Skill won't be right

You wrote your first Skill, ran it, and noticed things like:

  • Some tasks weren't recognized at all
  • Priorities came out wrong
  • The output format was a mess
  • Or Claude never loaded the Skill in the first place

That's normal.

Skills are like code: getting it to run once is the starting line, not the finish. Every Skill that's actually useful got there through several rounds of revision.1

This lesson gives you a repeatable way to find and fix those problems.

Testing method 1: Invoke it directly

The simplest test is a direct invocation: call it once with /skill-name and watch what comes out.2

Prepare your test cases

Before you invoke anything, write down three to five inputs.

Normal cases:

Finish the quarterly reportReview PR #234, before FridayFix the login bug tomorrow

Edge cases:

(empty input)

Garbage cases:

This is a paragraph of completely unrelated prose with no tasks in itasldfkjasldfj!@#$%

Run the tests

In Claude Code, feed them in one at a time:

/task-organizer
Finish the quarterly reportReview PR #234, before FridayFix the login bug tomorrow

Watch three things:

  1. Did Claude load the Skill at all? (If not, the problem is in the description.)
  2. Is the output format correct? (If it's messy, the problem is in your output-format section.)
  3. Is the content what you expected? (If the categories are wrong, the problem is in your processing steps.)

Write down what happened

A small table is enough:

InputExpectedActualProblem
"Finish the quarterly report\nFix the bug tomorrow"2 tasks; the bug is urgentOnly 1 task foundNewlines aren't being treated as separators

Testing method 2: Watch the loading behavior

Sometimes the problem isn't in the instructions at all — it's in the frontmatter.

Problem: Claude doesn't load the Skill on its own

What you see: you say "help me organize these tasks" and Claude ignores your task-organizer Skill.

Likely causes:

  1. The description is too generic

    Fix: put the trigger words in.

  2. The description doesn't contain the words you actually say

    If you say "help me sort out these to-dos" but "to-do" appears nowhere in the description, Claude may never think of the Skill.3

    Fix: write the words a user would plausibly say into the description.

Problem: Claude loads the wrong Skill

What you see: you wanted task-organizer, but Claude picked up something else.

Likely cause: the other Skill's description matches your input more closely.

Fix: force the call with /task-organizer, or sharpen your description so it's more specific than the competitor's.

Diagnosing common failures

Problem 1: The output format is wrong

What you see: the Skill runs, but the formatting is off.

Example:

Urgent: Fix the login bug - tomorrowImportant: Review PR #234 - Friday

You wanted grouped sections with emoji and headings; Claude gave you a flat text list.

Cause: the output-format section isn't specific enough, or it has no example.

Fix: put a complete example in the "Output format" section of your SKILL.md:

Say "must follow this format exactly," then show the whole thing.

Problem 2: Recognition is inaccurate

What you see: some tasks get missed, or they land in the wrong category.

Example:

Input:

Need to fix that bug tomorrowGet the demo ready before Friday

Output:

### ⚪ Normal- Need to fix that bug tomorrow - no stated deadline- Get the demo ready before Friday - no stated deadline

Both have a clear deadline, and both were marked as having none.

Cause: the time-recognition rules in your processing steps don't cover enough cases.

Fix: fill them in.

The point: spell out every phrasing you can think of.

Problem 3: Edge cases fall through

What you see: normal input is fine, but unusual input makes the Skill behave strangely.

Example:

Input: an empty string

Output: Claude stalls, or produces a pile of meaningless text.

Cause: your "Notes" section never said what to do with empty input.

Fix:

The iteration loop

Good Skills aren't written once. They come out of a test-fix-test loop:1

1. Write the first version (core behavior only)2. Run it against 3-5 test cases3. Write down what went wrong4. Edit SKILL.md5. Test again6. Repeat 3-5 until every test case passes7. Use it for real for a week8. Find new problems9. Go back to step 4

Don't expect version one to be right. Make it run, then make it correct, then make it good.

Is the Skill actually useful?

Once it runs correctly, there's a bigger question left: is this Skill actually saving you time?1

A/B it

The comparison is simple: run the same task several times with and without the Skill, and time both.

Without the Skill:

Time it. You explain the process by hand, Claude executes — how long does that take on average?

With the Skill:

Time it. You invoke the Skill, Claude executes — how long on average?

If the Skill version isn't faster, or the quality is worse, the Skill still needs work.

Use it for a week

The real test is real use.4

Track these numbers:

  • How many times you invoked it
  • How many times the result was usable as-is, with no manual edits
  • How many times you had to re-run it or fix the output by hand
  • How much time it saved

If you invoked it fewer than three times in a week, the task probably isn't repetitive enough to justify a Skill.

Debugging cheat sheet

When a Skill won't work, start with a loading-failure check — walk the table below and rule out the file path, the frontmatter format, and the trigger keywords in that order.

ProblemHow to diagnoseWhere to fix
Claude doesn't auto-load the SkillCheck whether the description contains the words you actually saidAdd trigger words, spell out the use case
Output format is messyCheck whether you gave a complete output exampleAdd the example, add "must follow this format exactly"
Recognition is inaccurateCheck whether the processing steps enumerate every caseAdd rules, add more decision criteria
Edge cases misbehaveCheck whether "Notes" covers that caseAdd explicit handling for the special case
The Skill exists but won't invokeCheck the file path, check the frontmatter formatConfirm the --- markers are in the right place and the YAML indentation is valid

Recap

  • Your first Skill won't be right — it takes a test-fix-test loop to get there
  • Testing methods: invoke it directly, watch the loading behavior, prepare test cases up front
  • Common failures: description too generic, output format under-specified, recognition rules incomplete, edge cases unhandled
  • Debugging flow: record expected vs. actual, diagnose, edit SKILL.md, re-test
  • Proving it's worth it: compare time, quality, and consistency with and against no Skill, then use it for a week and count the invocations

In the next lesson we'll walk through a complete code review Skill and see how to handle a more involved workflow.

>> Lesson 5: Case Study: Building a Code Review Skill

Footnotes

  1. Claude Code skills: .NET workflows and reusable prompts — https://codewithmukesh.com/blog/skills-claude-code/ 2 3

  2. Claude Code official docs: Extend Claude Code with skills — https://code.claude.com/docs/en/skills

  3. Building skills for Claude, hands-on: YAML frontmatter and testing — https://sjramblings.io/building-skills-for-claude-part-2/

  4. Claude skills as self-documenting runbooks — https://zackproser.com/blog/claude-skills-internal-training

Exercises

01

Take the Skill you built in Lesson 3 and run it through a full test pass:

Level 1: Debug your own Skill
  1. Prepare 3 test cases (one normal, one edge, one garbage)
  2. Record the expected and actual output for each
  3. Find at least one concrete problem
  4. Edit SKILL.md
  5. Re-test and confirm the problem is gone
Done criteria · checked locally
02

Do the same task twice: once with your Skill, once by just describing what you want to Claude directly. Then compare:

Level 2: Compare against no Skill
  1. Which was faster
  2. Which produced better results
  3. Which was more consistent (same output shape across repeated runs)
Done criteria · checked locally