--- name: pr description: Open a pull request from the current branch into the base branch, following the DEV Ground Rule template and checklist. allowed-tools: Bash, Read, Grep, Glob, AskUserQuestion --- # /pr — Create a pull request Automates the PR-creation flow defined in the DEV Ground Rule §B (Generate PR) and §C (PR Template). ## Steps ### 1. Environment 1. Read the current branch (`git rev-parse --abbrev-ref HEAD`). Warn if it looks like a base branch (`main`, `master`, `develop`). 2. Detect the fork remote: - List `git remote -v`. - Pick the remote that is **not** the upstream repo. If detection is ambiguous, ask the user which remote is the fork. 3. Detect the base branch (default: `main`; fall back to `master` if `main` is absent). ### 2. Rebase 1. `git fetch `. 2. `git rebase /`. 3. If conflicts arise, stop and instruct the user how to resolve. ### 3. Commit analysis 1. Collect the commit range: `git log /..HEAD --oneline`. 2. List the changed files: `git diff --name-only /..HEAD`. 3. Draft a short description from the commit messages. ### 4. Checklist (DEV Ground Rule §B) For each item, confirm and record the outcome in the PR body's `Test Plan` section: 1. **Code review** — always check. 2. **Unit tests** — if `qa-unit-test-run.sh` (or equivalent) exists, run it and record the result. 3. **App behavior verification** — ask the user whether the change was verified by running the app. 4. **Docs updated** — check whether `docs/` or `*.md` files changed. 5. **Actionlist** — confirm the commit range includes an `Actionlist.md` update. If not, generate a brief entry summarizing the change and add it as a follow-up commit (`update Actionlist.md`). ### 5. Push Push the branch to the fork remote. Pre-push hooks (if any) will run. ### 6. Create the PR 1. Use `.github/pull_request_template.md` as the PR body skeleton. 2. Fill in the sections from steps 3 and 4. 3. Create the PR with `gh`: ```bash gh pr create \ --repo / \ --base \ --head : \ --title "Summary in English" \ --body "" \ --assignee @me ``` ### 7. Output - Print the PR URL. - Print a one-line summary of the checklist outcomes.