organize-changes
Installation
SKILL.md
Preconditions
- Ordering law: Read
skills/organize-file/SKILL.mdbefore moving code; placement always defers to it (including LiveView lifecycle,describe/testclustering, and do not reorder clauses when that would change pattern match order). - Single path: If the user gives one file path, only that file is in scope; merge-base comparison still applies.
Orchestrator edit policy (non-negotiable)
- The agent running this skill as orchestrator performs triage, git inspection, and launching workers only. It must not edit any
*.ex/*.exsfile (or otherwise apply reorders) in its own turn. - Every path that needs organize work—including exactly one path—must be handled by a subagent (e.g. Cursor
TaskwithgeneralPurposeor equivalent). There is no “small enough to do inline” exception. - If triage yields zero paths, the orchestrator still does not edit sources; it finishes and replies to the user with exactly
complete(see step 6). - If a subagent cannot be spawned (tool unavailable, policy block, etc.), the orchestrator stops, replies with one line stating that blocker only, and does not substitute by editing files itself. (That reply is not
complete.)
Global placement (workers — read before moving)
- Merge-base /
git diffshows what changed, not where definitions belong. Never place or keep candidates together because they were added in one PR, sit next to each other in the patch, or call each other. That is wrong. - Each candidate’s target location is its proper place in the whole file per organize-file: build the ordered list of every
def/defp/defmacro(and everydescribe/testin tests) in that module, then put each candidate in the slot that list dictates—global order, same as if you were organizing the entire module from scratch. - Candidates may land far apart. Example: several new
defps belong in different alphabetical (or lifecycle) positions; do not leave them stacked aboveinterpolate_variables(or any unrelated neighbor) just so “branch changes stay together.” - Plain modules (
defp) — mechanical merge, not a “candidate stack”: Per organize-file, private functions are last and alphabetically by function name. Take everydefpname already in the file (including non-candidates), add each new/changed candidate name, then sort that whole set of names lexicographically (string order on the function atom). The file order ofdefpunits must match that merged sorted list. If nameinterpolate_variablessorts betweencheck_campaign_limitandlock_account_and_check_campaign_limit, then theinterpolate_variablesdefinition (non-candidate) must sit between those two in the source—never placelock_…andput_…directly undercheck_…and skip over names that belong in between. Same rule for any other gap in the sorted list. - Call graph does not override sort order.
put_campaign_limit_checkcallinglock_account…does not mean those two may be adjacent if otherdefpnames sort between them.
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