来源信息
- 仓库
- radius-project/radius
- 最近来源活动
- 2026年10月21日 19:27
- 检测到的 SKILL.md 语言
- 英语
- 星标
- 1,670
- Forks
- 139
安装方式
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
检查来源文件
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
正在显示 SKILL.md
SKILL.md
来源说明 · 只读预览- name
- radius-create-pr
- description
- Automates GitHub pull request creation from the current branch
- disable-model-invocation
- true
# Create GitHub Pull Request
Create a pull request from the current branch following the steps below.
## Determining the Default Branch
When working with forks, the default branch must come from the correct remote:
- If `upstream` exists in `git remote -v`: run `git remote show upstream` and parse the output to find the `HEAD branch`
- Otherwise: run `git remote show origin` and parse the output to find the `HEAD branch`
> [!TIP]
> On Linux or macOS for precise output parsing, consider using: `git remote show <your-remote-name> | grep 'HEAD branch'`
> On Windows with PowerShell, you can use: `git remote show <your-remote-name> | Select-String 'HEAD branch'`
## Steps
### Step 1: Validate Branch State
Stop and inform the user if any of these conditions exist:
- Current branch has no remote tracking branch (`git rev-parse --abbrev-ref --symbolic-full-name "@{u}"`)
- Uncommitted changes exist (`git status --porcelain`)
- Unpushed commits exist (`git rev-list --count "@{u}..HEAD"` returns > 0)
### Step 2: Load PR Template
Check for a PR template at these locations (in order):
- `.github/PULL_REQUEST_TEMPLATE.md`
- `.github/pull_request_template.md`
- `docs/PULL_REQUEST_TEMPLATE.md`
- `PULL_REQUEST_TEMPLATE.md`
Use the first template found to structure the PR description.
### Step 3: Generate PR Content
Analyze the changes using `git diff` and `git log` against the default branch.
**PR Title Requirements:**
- Maximum 80 characters
- Use `<type>[optional scope][!]: <description>` with a lowercase type
- Read the [PR title guide](../../../docs/contributing/contributing-pull-requests/README.md#3-use-a-conventional-commit-pull-request-title) and use its allowed types
- Use noun phrases in the description, for example `feat(api): authentication improvements`
**PR Description:**
- Follow the PR template structure if one exists
- Preserve checkboxes from the template (do not convert to bullets)
- If no template: summarize changes, list modified files, include relevant commit context
### Step 4: Create the Pull Request
Create the PR using the GitHub MCP tool, falling back to `gh pr create` if unavailable.
- **head**: current branch
- **base**: default branch (from Step 1)
### Step 5: Report Result
Display the PR URL:
```text
✅ Pull request created successfully!
🔗 URL: [PR_URL]
```
## Error Handling
Stop immediately on any failure with a clear error message. Common errors:
- Branch not pushed to remote
- Uncommitted or unpushed changes
- PR already exists for this branch
- Insufficient GitHub permissions
在 GitHub 查看