Some Assembly Required · Level 1 of 5

One File, One Job

In this level, you'll create a skill called tidy-imports: a single-file skill that takes some basic arguments.

Colour key: 1.1 A Folder and a SKILL.md 1.2 An Argument 1.3 Run It

Scroll and the sheet below builds the files one step at a time, pinning each step's notes. One scroll moves one step; the step buttons, the arrow keys or j and k do the same.

Step 1.1: A Folder and a SKILL.md

Specimen tidy-imports/SKILL.md after step 1.1

Each skill lives in its own folder, as a file called SKILL.md. Make the folder inside your project, at .claude/skills/tidy-imports/; anyone who clones the repository then gets the skill too. The file starts with YAML frontmatter between two --- lines; everything after that is the instructions Claude follows 1.1c when the skill runs.

The files after step 1.1

.claude/skills/tidy-imports/SKILL.md

---name: tidy-importsdescription: Sort the import statements at the top of a file---Sort the import statements at the top of the filealphabetically, one per line. Leave everything belowthe imports exactly as it was.
  1. 1.1a The folder name is the command you'll type, /tidy-imports, and name is what the / menu shows. Keep the two the same. A different name still works from the menu, but typed out it's an unknown command.

  2. 1.1b description: is the line Claude reads to decide whether this skill fits what you asked for, so it says what the skill does in plain words.

  3. 1.1c Everything under the frontmatter is what Claude follows: here, three lines on how to sort the imports.

Terminal

mkdir -p .claude/skills/tidy-imports

Next, tell the skill which file to tidy. arguments: [path] gives the first word after the command a name 1.2a, path; wherever $path appears in the body, Claude Code swaps in that word 1.2c before Claude reads it. argument-hint is the reminder you see while typing the command 1.2b.

The files after step 1.2

.claude/skills/tidy-imports/SKILL.md

---name: tidy-importsdescription: Sort the import statements at the top of a filearguments: [path]argument-hint: "[file]"---Tidy the imports in $path.Sort the import statements at the top of the filealphabetically, one per line. Leave everything belowthe imports exactly as it was.
  1. 1.2a arguments: [path] maps names to positions in order, so path is the first argument and a second name would be the second.

  2. 1.2b argument-hint: "[file]" appears beside the command in autocomplete and changes nothing about how the skill runs.

  3. 1.2c $path in Tidy the imports in $path. is swapped for the file you typed, and becomes an empty string when you type none.

Start Claude Code in your project and run the command with a file. If .claude/skills/ didn't exist when the session started, run /reload-skills first, because Claude Code only watches skill folders it found at startup. You can also just ask Claude to sort a file's imports: the description sits in its context, so it can load the skill without the command.

src/app.ts before the run

import { serve } from './server';import { readFileSync } from 'node:fs';import express from 'express';const app = express();

The files after step 1.3

src/app.ts

import express from 'express';import { readFileSync } from 'node:fs';import { serve } from './server';const app = express();
  1. 1.3b const app = express(); stays where it was: that's what Leave everything below the imports exactly as it was is for.

.claude/skills/tidy-imports/SKILL.md

---name: tidy-importsdescription: Sort the import statements at the top of a filearguments: [path]argument-hint: "[file]"---Tidy the imports in $path.Sort the import statements at the top of the filealphabetically, one per line. Leave everything belowthe imports exactly as it was.
  1. 1.3a /tidy-imports src/app.ts puts src/app.ts in place of $path, so the body's first line reaches Claude as Tidy the imports in src/app.ts.

Claude Code

/tidy-imports src/app.ts