add squash as you go to jj skill
1 files changed,  +34, -0
M skills/working-with-jj/SKILL.md
+34, -0
 1@@ -44,6 +44,8 @@ jj restore --from <commit-id> <fileset> # Restore from another revision/commit
 2 
 3 jj split -r <rev> <paths> -m "text"   # Split into two revisions
 4 jj absorb                             # Auto-squash changes into ancestor commits
 5+jj squash --into @- --use-destination-message  # Fold @ into parent, keep parent description
 6+jj squash --from <rev> --into <dest>  # Fold specific revision/range into destination (e.g. --from 'y::w')
 7 
 8 jj rebase -s <src> -o <dest>          # Rebase with descendants onto <dest>
 9 jj rebase -r <rev> -o <dest>          # Rebase single revision onto <dest>
10@@ -53,6 +55,38 @@ jj file annotate <path>               # Blame: who changed each line
11 jj bisect run -- <cmd>                # Binary search for bug-introducing commit
12 ```
13 
14+## Feature Workflow: One Commit Per Feature (Squash-As-You-Go)
15+
16+Default for agentic feature work. Prevents 9-10 task/fixup commits per
17+feature with vague descriptions. Result is a single reviewable `feat(<name>)`
18+commit; the user advances the trunk bookmark.
19+
20+```bash
21+jj new <trunk> -m "feat(<name>): <what>"  # F (@)
22+jj new -m "feat(<name>): task 1"           # task child @, F = @-
23+# ... do task 1, run task code review ...
24+jj squash --into @- --use-destination-message  # only after review is green; F absorbs task, @ becomes fresh empty commit
25+# ... do task 2 in fresh @, review ...
26+jj squash --into @- --use-destination-message  # repeat per task
27+jj log -r '<F>::@' -p               # before handing off: should show only F + empty @
28+# ... user reviews F, requests fixups done in new @ ...
29+jj squash --from @ --into <F> --use-destination-message # or: jj absorb (same-line fixups only)
30+```
31+
32+Rules:
33+
34+- One `feat(<name>)` commit per feature. Every task/fixup description uses
35+  the same `feat(<name>):` prefix until squashed, so `jj log` groups related
36+  work even before squashing.
37+- Squash backwards (`--into` parent/destination) only after code review
38+  passes. Never stack a second un-squashed feature on top — late
39+  middle-of-stack squashes rebase descendants and conflict.
40+- `y::w` ranges are inclusive; `y..w` excludes `y`. Prefer per-task
41+  `jj squash --into @-` over manual `y::w` ranges.
42+- Do NOT delineate features with merges (`jj new <trunk> <tip>` on an
43+  ancestor is `(empty)` in jj and not pushable). Do NOT advance, create, or
44+  move trunk bookmarks — leave that to the user.
45+
46 ## Additional Commands
47 
48 ```bash