Skip to content

Commit d77a08e

Browse files
authored
Add /pr command for creating pull requests (#27146)
1 parent 3d4a54b commit d77a08e

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.opencode/command/pr.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
description: Create a pull request for current branch changes
3+
agent: build
4+
subtask: true
5+
---
6+
7+
Create a GitHub pull request for the current branch's changes against the default branch.
8+
9+
## User Context
10+
11+
$ARGUMENTS
12+
13+
## Instructions
14+
15+
1. **Gather context**: Run these commands to understand the changes:
16+
- `git log --oneline production..HEAD` to see commits on this branch
17+
- `git diff production...HEAD --stat` to see files changed
18+
- `git diff production...HEAD` to see the actual changes
19+
20+
2. **Identify the product**: Determine which Cloudflare product(s) the changes relate to. Common products include:
21+
- Workers, KV, R2, D1, Queues, Durable Objects (DO), Hyperdrive, Containers, Pipelines
22+
- Pages, Images, Stream, Calls
23+
- WAF, DDoS, Bot Management, API Shield, Page Shield
24+
- Zero Trust (ZT), Access, Gateway, WARP, Tunnel, CASB, DLP, DEX
25+
- DNS, Registrar, SSL/TLS, Load Balancing, Spectrum
26+
- Analytics, Logs, Notifications
27+
28+
Use short product names where common (DO, KV, ZT, etc.).
29+
30+
3. **Create the PR title**: Use format `{Product}: {short description}`
31+
- Keep description under 50 characters
32+
- Use imperative mood (add, fix, update, remove)
33+
- Examples: `Workers: add streaming response docs`, `KV: fix metadata example`, `ZT: update Gateway policies`
34+
35+
4. **Write the PR body**:
36+
- Start with 1-2 sentences explaining WHY this PR exists (the motivation/context)
37+
- Follow with a short bulleted list of major changes (< 6-7 words per line)
38+
- Do NOT include headers like "## Summary" or "## Changes"
39+
- Do NOT include a line-by-line play-by-play of every file changed
40+
- Do NOT include verbose explanations or implementation details
41+
- Keep the entire body under 10 lines
42+
43+
5. **Create the PR**: Use `gh pr create` with the title and body:
44+
```
45+
gh pr create --title "Product: short description" --body "body content"
46+
```
47+
48+
## Example PR Body
49+
50+
```
51+
Adds documentation for the new streaming response API that enables real-time data processing in Workers.
52+
53+
- Add streaming response guide
54+
- Update fetch handler examples
55+
- Add SSE configuration options
56+
- Fix broken link in overview
57+
```
58+
59+
## Output
60+
61+
Show the PR URL when complete.

0 commit comments

Comments
 (0)