Here's SKILL.md at the end of level 3. It does all its work on its own; step 4.1 starts a second skill beside it.
The files at the start
.claude/skills/tidy-imports/SKILL.md
---name: tidy-importsdescription: Sort the import statements at the top of a filewhen_to_use: "After you add or remove imports in a file, or when the user asks to sort or tidy a file's imports."arguments: [path]argument-hint: "[file]"model: sonneteffort: lowdisable-model-invocation: false # Claude may start it after changing a file's imports; the script only reorders import linesallowed-tools: Bash(${CLAUDE_SKILL_DIR}/scripts/sort-imports.sh:*)disallowed-tools: [Edit, Write, NotebookEdit] # the script changes the file; Claude never does---Tidy the imports in $path.Read .claude/tidy-imports.log if it exists. If $path isalready listed there, say so before going on.Run the script on the file, by exactly this path:... lines 20 to 24 left outIt sorts the import block in place. Do not reorder anylines yourself or edit the file after it runs. If thescript exits non-zero, report its message and stop.The script also writes the ledger line. Never write to.claude/tidy-imports.log yourself.