Write a description for the current jj commit.
Current commit
jj show --git
Recent descriptions
jj log -r 'ancestors(@-, 10)' --no-graph -T 'description'
Recent descriptions for the changed files
jj log -r "latest(::@- & files($(jj diff -r @ --name-only | sed 's/.*/\"&\"/' | paste -sd'|' -)), 10)" --no-graph -T 'description.first_line() ++ "\n"'
Arguments: $ARGUMENTS
Principles
- Explain why the change was made, because the diff already shows what changed
- Write the summary line so it completes the sentence "If applied, this commit
will ...": 50 characters preferred and 72 at most, no trailing period. Name
the fix rather than the problem it fixes. Avoid a filename or a generic phrase
such as "fix bug", "refactor", or "cleanups"
- Match the prefix style, capitalization, and detail of the previous commits to
the same files, falling back to the recent descriptions above where those
commits disagree. Without a consistent convention, write
<topic>: <summary>,
where the topic is the module, directory, or command the change touches
- Add a body only when the summary leaves something unexplained: the status quo
the change corrects, the motivation, how the change works, a rejected
alternative, a known limitation, or a consequence a reader would miss. Wrap it
at 72 columns, separated from the summary by a blank line
- State the status quo in the present tense and without "Currently", because a
description is read against the code before the change: "the parser stops at
the first error"
- Explain how the change works only where the diff leaves it unclear, in plain
words and at the level of the feature rather than the code
- Mention a rejected alternative only when you tried it, rather than only
considered it, and a reader would ask why you didn't take it
- Back a claim about performance or size with the measurements before and after
the change
- Leave out what the diff shows, such as which files and functions changed and
that the tests were updated
- Leave out how the commit came about, such as what was tried first, what it was
rebased onto, and what happened in the session that wrote it
- Describe the commit's own change, not the stack around it
- Keep the description readable on its own. Summarize an issue or a linked page
rather than pointing at it, and name another commit by its change ID and its
summary line rather than the ID alone
Workflow
- Read the diff above. If the commit is empty, tell the user and stop
- Treat any existing description as the author's intent: keep what it states
and extend it to cover the rest of the diff, unless the arguments ask for a
replacement
- Read the descriptions for the changed files above to see which convention
previous commits to these files followed
- Work out why the change was made. Read the surrounding code when the diff
alone doesn't explain it. Prefer the arguments over your own inference
- Run
/humanize on the planned description in a subagent, passing the text
inline and asking for the revision back. Give the subagent nothing else, so
it reads the draft cold
- Take the revision, restoring anything it dropped and rewriting a summary line
it pushed past 72 characters. Set the description with
jj describe -m '<summary>' -m '<body>', passing a second -m only for a
body. Each -m becomes its own paragraph
- Show the result with
jj log -r @ --no-graph -T 'description'
Fixing mistakes
Rerunning jj describe replaces the whole description. To recover the previous
one, find the describe operation with jj op log and revert it with
jj undo <operation>.
1---2name: jj-describe3description: |4 Write a description for the current `jj` commit.5argument-hint: '[extra guidance on the description]'6allowed-tools:7 - Bash(jj describe *)8 - Bash(jj diff *)9 - Bash(jj log *)10 - Bash(jj op log *)11 - Bash(jj undo *)12 - Agent13---1415Write a description for the current `jj` commit.1617# Current commit1819```!20jj show --git21```2223# Recent descriptions2425```!26jj log -r 'ancestors(@-, 10)' --no-graph -T 'description'27```2829# Recent descriptions for the changed files3031```!32jj log -r "latest(::@- & files($(jj diff -r @ --name-only | sed 's/.*/\"&\"/' | paste -sd'|' -)), 10)" --no-graph -T 'description.first_line() ++ "\n"'33```3435Arguments: $ARGUMENTS3637# Principles3839- Explain why the change was made, because the diff already shows what changed40- Write the summary line so it completes the sentence "If applied, this commit41 will ...": 50 characters preferred and 72 at most, no trailing period. Name42 the fix rather than the problem it fixes. Avoid a filename or a generic phrase43 such as "fix bug", "refactor", or "cleanups"44- Match the prefix style, capitalization, and detail of the previous commits to45 the same files, falling back to the recent descriptions above where those46 commits disagree. Without a consistent convention, write `<topic>: <summary>`,47 where the topic is the module, directory, or command the change touches48- Add a body only when the summary leaves something unexplained: the status quo49 the change corrects, the motivation, how the change works, a rejected50 alternative, a known limitation, or a consequence a reader would miss. Wrap it51 at 72 columns, separated from the summary by a blank line52- State the status quo in the present tense and without "Currently", because a53 description is read against the code before the change: "the parser stops at54 the first error"55- Explain how the change works only where the diff leaves it unclear, in plain56 words and at the level of the feature rather than the code57- Mention a rejected alternative only when you tried it, rather than only58 considered it, and a reader would ask why you didn't take it59- Back a claim about performance or size with the measurements before and after60 the change61- Leave out what the diff shows, such as which files and functions changed and62 that the tests were updated63- Leave out how the commit came about, such as what was tried first, what it was64 rebased onto, and what happened in the session that wrote it65- Describe the commit's own change, not the stack around it66- Keep the description readable on its own. Summarize an issue or a linked page67 rather than pointing at it, and name another commit by its change ID and its68 summary line rather than the ID alone6970# Workflow71721. Read the diff above. If the commit is empty, tell the user and stop732. Treat any existing description as the author's intent: keep what it states74 and extend it to cover the rest of the diff, unless the arguments ask for a75 replacement763. Read the descriptions for the changed files above to see which convention77 previous commits to these files followed784. Work out why the change was made. Read the surrounding code when the diff79 alone doesn't explain it. Prefer the arguments over your own inference805. Run `/humanize` on the planned description in a subagent, passing the text81 inline and asking for the revision back. Give the subagent nothing else, so82 it reads the draft cold836. Take the revision, restoring anything it dropped and rewriting a summary line84 it pushed past 72 characters. Set the description with85 `jj describe -m '<summary>' -m '<body>'`, passing a second `-m` only for a86 body. Each `-m` becomes its own paragraph877. Show the result with `jj log -r @ --no-graph -T 'description'`8889# Fixing mistakes9091Rerunning `jj describe` replaces the whole description. To recover the previous92one, find the describe operation with `jj op log` and revert it with93`jj undo <operation>`.