organize-file

Installation
SKILL.md

Use when reorganizing the whole file (all definitions in that module or test). To reorder only definitions touched on the current branch, use surge/skills/doctor/organize-changes/SKILL.md instead.

Precedence over file conventions

  • These ordering rules override local habits and one-off layout in the file (e.g. clustered helpers, private functions near call sites). Do not preserve layout when it conflicts with General rules or Specific rules below.

General rules

  • Treat all clauses of the same function name and arity as one unit; within that unit, order clauses alphabetically by the distinguishing atom(s) or parameters.
  • Do not reorder clauses when it would change which pattern matches (specificity or catch-all order).
  • Keep callback clause groups contiguous (e.g. all handle_params/3 clauses together).
  • Keep each moved function body unchanged except for location.
  • Preserve module structure, comments, spacing, and non-function code.
  • Private functions (defp) always go last, alphabetically by function name.

Specific rules

Installs
16
First Seen
May 7, 2026
organize-file — jasonharmongit/jh-skills