fix(pr): base 分支優先採用呼叫端指定值,不再自行退回 develop

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-25 11:58:11 +08:00
co-authored by Claude Opus 5
parent 99e2e09175
commit e5584bee80
+2 -2
View File
@@ -1,6 +1,6 @@
---
name: pr
description: Commit all changes via jsc-git:commit, create a target branch named from the highest-priority commit type plus a summarized title, push, then open a Gitea PR with the templated description. Branch priority is revert > fix > feat > perf > refactor > test > docs > style > chore. Use when work is ready for review; not for plain commits.
description: Commit all changes via jsc-git:commit, create a target branch named from the highest-priority commit type plus a summarized title, push, then open a Gitea PR with the templated description against the base branch the caller passed in (falling back to develop, main, master only when none was given). Branch priority is revert > fix > feat > perf > refactor > test > docs > style > chore. Use when work is ready for review; not for plain commits.
---
# pr — create a Push Request
@@ -8,7 +8,7 @@ description: Commit all changes via jsc-git:commit, create a target branch named
## Steps
1. Call `jsc-git:commit` to commit every file change first.
2. Pick the base branch: use `develop` when it exists on the remote, else `main`, else `master`.
2. Pick the base branch. **A base branch passed in by the caller wins over everything else** — `jsc-sdlc:implement` passes the analysis page's source branch, and silently retargeting that PR at `develop` would merge a single work package straight past the feature branch it belongs to. Only when no caller supplied one: use `develop` when it exists on the remote, else `main`, else `master`. Verify the chosen base exists on the remote (`git fetch --prune origin` first, then `git branch -r`); it does not exist → report and stop, never fall back silently.
3. Create the target branch from the remote base branch:
1. Take the type with the highest priority across all commits: `revert > fix > feat > perf > refactor > test > docs > style > chore`.
2. Summarize one title from all commit messages.