{{command_prefix}}pr-branch
Produces a branch that contains only code changes (under src/) so reviewers are not forced to read through .design/ planning churn.
Steps
- Determine base: Use the argument if provided; otherwise read the current branch's merge base with
mainviagit merge-base HEAD main. - List commits:
git log --oneline <base>..HEADvia Bash. - Classify each commit: For each SHA, run
git show --name-only <sha>and inspect the changed paths:- code-only: all paths under
src/(or other code dirs, not.design//.planning/) → include - design-only: all paths under
.design/or.planning/→ skip - mixed: both kinds → include and log a note
- code-only: all paths under
- Get cycle name: Read
.design/STATE.mdfor the currentcycle:ID (defaultcycle-1). - Create branch:
git checkout -b pr/<cycle>-clean <base>. - Cherry-pick: For every included SHA (in original order), run
git cherry-pick <sha>. On conflict, abort the whole operation with a clear message and reset to the pre-op branch. - Print summary: "PR branch
pr/<cycle>-cleancreated with commits..design/and.planning/commits excluded. Mixed commits flagged: ."
Do Not
- Do not rewrite history on the original branch.
- Do not include
.design/or.planning/paths - if a mixed commit contains them, the cherry-pick carries them through, but reviewers are warned. - Do not push the branch automatically - let
{{command_prefix}}shipor the user push.


