Make a set of things consistent along one dimension: identify the set's members,
pick a canonical form for the dimension the user named, and conform every member
to it without changing what any member means or does.
Target
jj show --git
Arguments: $ARGUMENTS
The arguments name the dimension of consistency (e.g. "error message wording",
"test naming", "heading capitalization") and optionally the files or text that
form the set. Operate on the set named in the arguments if given. Otherwise
operate on the things changed in the current commit shown above. If the
dimension is missing, infer it from the conversation. If you still cannot
determine the set or the dimension, ask the user and stop.
Principles
- One dimension per pass. Conform only the dimension the user named. Other
inconsistencies you notice go in the report, not in the edits. Mixing
dimensions makes the change hard to review and easy to get wrong
- Consistency must preserve meaning. Rewording a message, renaming a test, or
reordering keys must not change behavior or a claim. If conforming a member
would change its meaning, it is a deliberate exception: leave it and say why
- The canonical form comes from the set, not from taste (see "Choosing the
canonical form"). Invent a new form only when no existing member is fit to
copy, and say so in the report
- Membership is a judgment call for borderline things. A thing that
superficially resembles the set but serves a different purpose is not a
member. Conforming it couples unrelated things. When unsure, leave it out and
note it
These aren't exhaustive. Reason from first principles when none fits cleanly.
Workflow
- Determine the dimension and the set from the arguments and conversation (see
"Target"). State both in one sentence before editing, so the user can catch a
wrong guess early
- List every member with its current form. Search beyond the obvious files: a
set defined by purpose (all error messages, all CLI flags, all section
headings) is scattered
- Pick the canonical form (see "Choosing the canonical form"). If two forms are
equally defensible and the choice matters, ask the user which to use and
stop. Otherwise pick and note the choice in the report
- If every member already matches, tell the user and stop. Don't manufacture
edits
- Conform each member to the canonical form:
- In prose, comments, and config, edit the wording or structure in place
- For identifiers, treat each change as a behavior-preserving rename: update
every reference, and never break a name that callers outside the set depend
on
- If any code changed, run the covering tests or a typecheck to confirm
behavior is unchanged. Pure prose edits need no test run
- Report: the dimension and canonical form, each member changed (from what to
what), members left as deliberate exceptions and why, borderline non-members
you excluded, and other inconsistent dimensions you noticed but did not touch
Choosing the canonical form
- Count first. When most members already agree, the majority form is canonical
unless the user said otherwise. Conforming the few to the many is the
smallest, safest change
- On a tie, prefer the form that is clearest on its own terms: the one a
newcomer would understand without seeing the others
- Follow the form the user prescribed even when it is the minority, and report
the scale of the resulting change
- If the best form needs vocabulary the project doesn't use consistently, stop
and suggest
/ubiquitize-language instead of splitting the project's
vocabulary further
Fixing mistakes
- A test or typecheck breaks after a rename: you missed a reference or the name
is used outside the set. Find the other references or restore the original
name
- A conformed member now says something false or does something different: the
member was a borderline non-member or an exception. Revert it and move it to
the exceptions in the report
1---2name: homogenize3description: |4 Make a set of things (code, prose, config, docs) consistent along a dimension5 the user names, by picking a canonical form and conforming every member to it.6argument-hint: '<the dimension of consistency> [files or text to homogenize]'7---89Make a set of things consistent along one dimension: identify the set's members,10pick a canonical form for the dimension the user named, and conform every member11to it without changing what any member means or does.1213# Target1415```!16jj show --git17```1819Arguments: $ARGUMENTS2021The arguments name the dimension of consistency (e.g. "error message wording",22"test naming", "heading capitalization") and optionally the files or text that23form the set. Operate on the set named in the arguments if given. Otherwise24operate on the things changed in the current commit shown above. If the25dimension is missing, infer it from the conversation. If you still cannot26determine the set or the dimension, ask the user and stop.2728# Principles2930- One dimension per pass. Conform only the dimension the user named. Other31 inconsistencies you notice go in the report, not in the edits. Mixing32 dimensions makes the change hard to review and easy to get wrong33- Consistency must preserve meaning. Rewording a message, renaming a test, or34 reordering keys must not change behavior or a claim. If conforming a member35 would change its meaning, it is a deliberate exception: leave it and say why36- The canonical form comes from the set, not from taste (see "Choosing the37 canonical form"). Invent a new form only when no existing member is fit to38 copy, and say so in the report39- Membership is a judgment call for borderline things. A thing that40 superficially resembles the set but serves a different purpose is not a41 member. Conforming it couples unrelated things. When unsure, leave it out and42 note it4344These aren't exhaustive. Reason from first principles when none fits cleanly.4546# Workflow47481. Determine the dimension and the set from the arguments and conversation (see49 "Target"). State both in one sentence before editing, so the user can catch a50 wrong guess early512. List every member with its current form. Search beyond the obvious files: a52 set defined by purpose (all error messages, all CLI flags, all section53 headings) is scattered543. Pick the canonical form (see "Choosing the canonical form"). If two forms are55 equally defensible and the choice matters, ask the user which to use and56 stop. Otherwise pick and note the choice in the report574. If every member already matches, tell the user and stop. Don't manufacture58 edits595. Conform each member to the canonical form:60 - In prose, comments, and config, edit the wording or structure in place61 - For identifiers, treat each change as a behavior-preserving rename: update62 every reference, and never break a name that callers outside the set depend63 on646. If any code changed, run the covering tests or a typecheck to confirm65 behavior is unchanged. Pure prose edits need no test run667. Report: the dimension and canonical form, each member changed (from what to67 what), members left as deliberate exceptions and why, borderline non-members68 you excluded, and other inconsistent dimensions you noticed but did not touch6970# Choosing the canonical form7172- Count first. When most members already agree, the majority form is canonical73 unless the user said otherwise. Conforming the few to the many is the74 smallest, safest change75- On a tie, prefer the form that is clearest on its own terms: the one a76 newcomer would understand without seeing the others77- Follow the form the user prescribed even when it is the minority, and report78 the scale of the resulting change79- If the best form needs vocabulary the project doesn't use consistently, stop80 and suggest `/ubiquitize-language` instead of splitting the project's81 vocabulary further8283# Fixing mistakes8485- A test or typecheck breaks after a rename: you missed a reference or the name86 is used outside the set. Find the other references or restore the original87 name88- A conformed member now says something false or does something different: the89 member was a borderline non-member or an exception. Revert it and move it to90 the exceptions in the report