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/3clauses 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
- LiveView modules
- Default callback order:
mount/3,handle_params/3,handle_event/3,handle_info/2,handle_async/3, then other handlers, thenrender/1
- Default callback order:
Related skills
More from jasonharmongit/jh-skills
doctor
Runs pre-PR formatting, checking and testing.
30organize-elixir-functions
Organize functions in a file or across a branch.
30walkthrough-process
Writes a deep markdown walkthrough for code understanding - how a function, module, or process fits into the system. Also supports branch-change walkthroughs when the user explicitly asks about PR/branch diffs.
24create-skill
>-
23solutionize
Plan-only workflow with a human partner; no implementation while this skill governs the turn
22implement-next-phase
Prepare to implement the next pending todo phase from a solutionize sketch plan (frontmatter todos); implementation only after explicit user approval.
8