Skip to content
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion commands/pr-create.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -95,6 +107,26 @@ gh pr create \
--head feature-branch-name
```

### Step 6: Auto Squashing (Optional)
When using `/pr-create auto`, enable automatic squashing of commits using GitHub CLI:

```bash
# Enable auto-squashing for cleaner commit history (keeps branch)
gh pr merge <pr-number> --squash

# Alternative: Enable auto-merge with squashing
gh pr merge <pr-number> --squash --auto

# To delete branch after merge, add --delete-branch flag
gh pr merge <pr-number> --squash --delete-branch
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: PR Workflow Error: Premature Merge Commands

The PR creation workflow incorrectly includes gh pr merge commands (e.g., --squash, --delete-branch) as Step 6. This instructs users to immediately merge a PR before review and approval, creating an impossible or undesirable workflow. Additionally, the /pr-create auto variant is mentioned without explanation.

Fix in Cursor Fix in Web


**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
Expand Down Expand Up @@ -267,7 +299,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 <pr-number> --squash --auto

# 7. Add labels and reviewers
gh pr edit <pr-number> --add-label enhancement
gh pr edit <pr-number> --add-reviewer "@org/frontend-team"
```
Expand Down