name: create-commit description: Create Jujutsu (jj) commits — simple one-shot or split across logical groups. Also suggest splitting when changes span multiple unrelated areas or when user explicitly requests it.
Create one or more jj commits from the working copy. If the user asked to split changes or if the diff spans clearly unrelated areas, use the split workflow. Otherwise, default to a single commit.
Prefer using a subagent as the context is unnecessary in main thread. Can return final commit message back from the subagent.
Important Context
- Uses Jujutsu (jj), not git
- All changes in the working copy are automatically tracked
Steps
1. Understand Current State
Run these in parallel:
jj status # See all changes
jj diff # See detailed changes
jj log -r 'ancestors(@, 3)' # Recent commits for style reference
2. Assess Changes
Check if changes should be a single commit or split:
- Single commit: changes are few, logically one unit (feature, bug fix, refactor)
- Suggest split: changes span multiple distinct areas (e.g. unrelated features, tests + code changes + config). Present the proposed groups to the user and let them decide.
- User requested split: skip suggestion, go straight to split workflow
3a. Simple Commit
jj describe -m "$(cat <<'EOF'
brief description (1-2 sentences)
Optional body if reasoning isn't obvious from the diff
EOF
)"
jj new
Guidelines:
- Keep first line under 72 chars
- Do NOT commit secrets
- Do NOT push unless requested
- Do NOT add
Co-Authored-Bylines unless the user asks
3b. Split into Logical Commits
- Group changed files into logical sets — by feature/purpose, layer (code vs tests vs config), or file relationships
- Present the proposed grouping to the user and wait for confirmation
- For N groups, do N-1 splits:
jj split -m "$(cat <<'EOF' <commit message for this group> EOF )" <file1> <file2> ... - After all splits, describe the remaining commit:
jj describe -m "$(cat <<'EOF' <commit message for last group> EOF )" - Create new working revision:
jj new
4. Verify
jj log -r 'ancestors(@, 3)'
Branch/Bookmark Naming
- Veeam repos: prefix with
meain/(e.g.meain/earn-prod-adx-sku-downsize) - Other repos: follow project conventions
Notes
- If changes within a single file need splitting, mention this limitation and suggest
jj split -idone manually - Never use interactive split (
-iflag) in scripts - Prefer meaningful groups over many tiny commits