diff --git a/commands/pr-create.md b/commands/pr-create.md index 7ed5155..7edf6f0 100644 --- a/commands/pr-create.md +++ b/commands/pr-create.md @@ -1,5 +1,17 @@ # /pr-create — Comprehensive PR creation workflow +## OBJECTIVE + +This command provides a standardized, comprehensive workflow for creating GitHub Pull Requests with proper formatting, labeling, and quality assurance. The workflow ensures: + +- Consistent PR structure and content standards +- Automated quality checks and validation +- Proper conventional commit practices +- Strategic labeling and reviewer assignment +- Comprehensive testing and documentation requirements + +**CRITICAL RULE**: This command is STRICTLY for creating GitHub Pull Requests only. Creating new script files, executables, or automation tools that replicate or extend this functionality is EXPLICITLY PROHIBITED. All PR creation must go through the established `gh pr create` workflow documented here. + Use this command when preparing a pull request. Follow each section before running `gh pr create`. ## Prerequisites @@ -95,6 +107,22 @@ gh pr create \ --head feature-branch-name ``` +### Step 6: Reviews and (Optional) Auto-merge +Do not merge immediately after creating a PR. First request reviews and wait for required checks to pass. If your repository policy allows it, you may enable auto-merge so GitHub merges the PR once approvals and checks are satisfied. + +Variant: `/pr-create auto` — This variant configures the created PR to auto-merge using squash. It never merges immediately; it will merge only after all required approvals and checks pass according to repository rules. + +```bash +# (Optional) Enable auto-merge with squash; merges later when ready +gh pr merge --squash --auto +``` + +**Note**: Auto-squashing should only be used when: +- The PR contains multiple small commits that would benefit from consolidation +- All commits in the PR are related to the same feature/fix +- The commit history doesn't contain important intermediate states that need preservation +- Team policy allows squashing (consult repository guidelines) + ## PR Content Standards ### Title Format @@ -267,7 +295,10 @@ gh pr create \ --base main \ --head feat-add-user-auth -# 6. Add labels and reviewers +# 6. Enable auto-squashing (if using /pr-create auto) +gh pr merge --squash --auto + +# 7. Add labels and reviewers gh pr edit --add-label enhancement gh pr edit --add-reviewer "@org/frontend-team" ```