Skip to content

Commit 19a8419

Browse files
committed
Have push skill invoke jj-commit when description missing
1 parent 0eb3665 commit 19a8419

2 files changed

Lines changed: 39 additions & 2 deletions

File tree

.cursor/skills/jj-bookmark-push/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Use jj for version control in this project (not git) when creating branches, upd
99

1010
## Rules
1111

12-
- **Never push without a description.** jj rejects pushing revisions with no commit message. Before push, ensure current revision has a description: `jj describe -m "message"` or `jj describe` (editor). If the working copy is a new empty revision, describe it or move the bookmark to a described revision.
12+
- **Never push without a description.** jj rejects pushing revisions with no commit message. Before push, ensure current revision has a description. If it is missing, apply [jj-commit](.cursor/skills/jj-commit/SKILL.md) to add a proper message, then push. Alternatively move the bookmark to a described rev: `jj bookmark set <name> -r <rev> -B` then push.
1313
- **Never rewrite pushed commits.** No amend/squash of commits already pushed or on a branch with an open PR; that force-pushes and removes GitHub PR comments. Add a new commit for follow-up changes unless the user explicitly requests a force-push.
1414

1515
## Workflow
@@ -24,6 +24,6 @@ Bookmarks are branch-like pointers. Set: `jj bookmark set <name>`. Set to a revi
2424

2525
| Symptom | Fix |
2626
| -------- | --- |
27-
| "has no description" | `jj describe -m "message"` on current rev, then push again. Or move bookmark to a described rev: `jj bookmark set <name> -r <rev> -B` then push. |
27+
| "has no description" | Apply [jj-commit](.cursor/skills/jj-commit/SKILL.md) to add a proper message, then push. Or move bookmark to a described rev: `jj bookmark set <name> -r <rev> -B` then push. |
2828
| "Refusing to move bookmark backwards" | Use `-B`: `jj bookmark set <name> -r <rev> -B`. |
2929
| Remote bookmark moved / conflict | `jj git fetch`; resolve conflict or set bookmark to desired rev with `-B` if needed, then push. |

.cursor/skills/jj-commit/SKILL.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: jj-commit
3+
description: Stages and commits changes in jj (Jujutsu VCS) with a clear, concise commit message. Use when committing changes with jj, setting a revision description, or when the user asks to commit with jj.
4+
---
5+
6+
# jj commit (describe)
7+
8+
Create a commit for the current changes by setting the revision description. In jj there is no staging area; the working copy is the current revision.
9+
10+
## Steps
11+
12+
1. Run `jj status` to see working-copy state and which files changed.
13+
2. Run `jj diff` to see changes in the current revision (working copy vs parent). Use `-r @` to restrict to the current rev if needed.
14+
3. Run `jj log -n 5` to see recent commit style.
15+
4. Write a commit message and run `jj describe -m "message"`.
16+
17+
If the user provides a message hint (e.g. in the request), use it when writing the message.
18+
19+
To start a new change before describing, run `jj new`; then set the description on that revision.
20+
21+
## Commit message rules
22+
23+
- Use the imperative mood ("Add", "Fix", "Remove", not "Added", "Fixes", "Removed").
24+
- Be concise: one short sentence, ideally under 50 characters.
25+
- Do NOT use conventional commit prefixes (no `feat:`, `fix:`, `chore:`, etc.).
26+
- Do NOT add any `Co-Authored-By` or similar trailers.
27+
- Focus on **what** changed and **why**, not how.
28+
- If a second line is needed for context, keep it brief.
29+
30+
## Examples of good messages
31+
32+
- `Prevent discount code from being cleared on edit`
33+
- `Add integration test for offer code persistence`
34+
- `Remove unused legacy export helper`
35+
- `Fix thumbnail missing in upsell insert`
36+
37+
When pushing, use [jj-bookmark-push](.cursor/skills/jj-bookmark-push/SKILL.md); never push without a description.

0 commit comments

Comments
 (0)