Open a Pull Request
When to Use
Use this skill only when the user explicitly requests to open a pull request (e.g. "open a pull request", "open an pull request", "create a pull request"). Do not run git commit, push, or gh pr create for any other request.
Preconditions
- Working tree: Confirm that current changes (staged or unstaged) are what the user wants to commit. If the state is unclear or already on a feature branch with unpushed commits, ask before proceeding.
- GitHub CLI: Require
gh installed and authenticated. Run gh auth status; if not OK, instruct the user to install GitHub CLI and run gh auth login, then stop.
Workflow
1. Create a new branch
- Create a new branch from current HEAD:
git checkout -b <branch-name>.
- Branch name: Use user-provided name if given. Otherwise derive from the commit message: e.g.
feat/scope-short-desc, fix/short-desc, enhance/improve-x, ci/update-workflow, or (deps)/go-mod (slug from the first line of the conventional commit). These patterns align with .github/labeler.yml so the labeler auto-applies PR labels (feature, bug, enhancement, github-actions, dependencies). For breaking changes, include ! in the branch name to get the breaking-change label. Prefer lowercase, hyphens; avoid spaces.
2. Stage and commit
- Run
git add .
- Commit message: Use conventional style per project (e.g.
feat(scope): description, fix(scope): description). If the user provided a message, use it; otherwise generate from git status and git diff (or git diff --staged after add).
- Run
git commit -s -m "<message>" so the commit includes a Signed-off-by line (DCO). Do not add a Made-with: Cursor or similar trailer to the commit message. The repo has the DCO bot enabled; PRs must have all commits signed off.
3. Push and create PR
- Push:
git push -u origin <branch-name>
- Create PR:
gh pr create using the repository’s pull request template. Populate all sections (see PR body below). The neptune label is applied automatically; do not add it manually.
4. Safety
- Do not run
git push, git commit, or gh pr create unless the user has explicitly requested to open a pull request.
- If the repo is in an unexpected state (e.g. already on a feature branch with unpushed commits, or detached HEAD), ask the user before creating a new branch or pushing.
PR body (repo template)
The repo uses .github/pull_request_template.md. When creating the PR (e.g. gh pr create --body-file - or by filling the template), populate:
- What is this feature? – Short description; correlates with issues.
- Why do we need this feature? – Problem or context (from commit/conversation).
- Who is this feature for? – Target user or use case.
- Related issues – e.g.
Fixes #123 or Relates to #456 if applicable.
- Notes for reviewers – Optional; call out design decisions or areas to focus on.
- Checklist – Mark as appropriate: breaking changes (Yes/No/N/A), docs updated, tests added/updated.
- AI Summary – For AI reviewers; fill from changed files and context:
- Scope: e.g.
lambda (config, webhooks, main), docs, AGENTS.md
- Type:
feat | fix | docs | refactor
- Key files/areas: paths from
git diff --name-only or conversation (e.g. lambda/pkg/config/config.go, docs/github-app-and-lambda.md)
Generate the body from the commit message and git diff --name-only (or equivalent) so the template sections are filled accurately.
1---2name: open-pull-request3description: Commits current changes and opens a pull request via GitHub CLI (gh). Use only when the user explicitly says "open a pull request", "open an pull request", or "create a pull request". Do not run this workflow for other requests.4---5
6# Open a Pull Request
7
8## When to Use
9
10Use this skill **only** when the user explicitly requests to open a pull request (e.g. "open a pull request", "open an pull request", "create a pull request"). Do not run git commit, push, or `gh pr create` for any other request.
11
12## Preconditions
13
141. **Working tree**: Confirm that current changes (staged or unstaged) are what the user wants to commit. If the state is unclear or already on a feature branch with unpushed commits, ask before proceeding.
152. **GitHub CLI**: Require `gh` installed and authenticated. Run `gh auth status`; if not OK, instruct the user to install [GitHub CLI](https://cli.github.com/) and run `gh auth login`, then stop.
16
17## Workflow
18
19### 1. Create a new branch
20
21- Create a new branch from current HEAD: `git checkout -b <branch-name>`.
22- **Branch name**: Use user-provided name if given. Otherwise derive from the commit message: e.g. `feat/scope-short-desc`, `fix/short-desc`, `enhance/improve-x`, `ci/update-workflow`, or `(deps)/go-mod` (slug from the first line of the conventional commit). These patterns align with [.github/labeler.yml](.github/labeler.yml) so the labeler auto-applies PR labels (feature, bug, enhancement, github-actions, dependencies). For breaking changes, include `!` in the branch name to get the `breaking-change` label. Prefer lowercase, hyphens; avoid spaces.
23
24### 2. Stage and commit
25
26- Run `git add .`
27- **Commit message**: Use conventional style per project (e.g. `feat(scope): description`, `fix(scope): description`). If the user provided a message, use it; otherwise generate from `git status` and `git diff` (or `git diff --staged` after add).
28- Run `git commit -s -m "<message>"` so the commit includes a Signed-off-by line (DCO). Do not add a `Made-with: Cursor` or similar trailer to the commit message. The repo has the [DCO bot](https://github.com/apps/dco) enabled; PRs must have all commits signed off.
29
30### 3. Push and create PR
31
32- Push: `git push -u origin <branch-name>`
33- Create PR: `gh pr create` using the repository’s [pull request template](.github/pull_request_template.md). Populate all sections (see **PR body** below). The `neptune` label is applied automatically; do not add it manually.
34
35### 4. Safety
36
37- Do not run `git push`, `git commit`, or `gh pr create` unless the user has explicitly requested to open a pull request.
38- If the repo is in an unexpected state (e.g. already on a feature branch with unpushed commits, or detached HEAD), ask the user before creating a new branch or pushing.
39
40## PR body (repo template)
41
42The repo uses [.github/pull_request_template.md](.github/pull_request_template.md). When creating the PR (e.g. `gh pr create --body-file -` or by filling the template), populate:
43
44- **What is this feature?** – Short description; correlates with issues.
45- **Why do we need this feature?** – Problem or context (from commit/conversation).
46- **Who is this feature for?** – Target user or use case.
47- **Related issues** – e.g. `Fixes #123` or `Relates to #456` if applicable.
48- **Notes for reviewers** – Optional; call out design decisions or areas to focus on.
49- **Checklist** – Mark as appropriate: breaking changes (Yes/No/N/A), docs updated, tests added/updated.
50- **AI Summary** – For AI reviewers; fill from changed files and context:
51 - **Scope:** e.g. `lambda (config, webhooks, main)`, `docs`, `AGENTS.md`
52 - **Type:** `feat` | `fix` | `docs` | `refactor`
53 - **Key files/areas:** paths from `git diff --name-only` or conversation (e.g. `lambda/pkg/config/config.go`, `docs/github-app-and-lambda.md`)
54
55Generate the body from the commit message and `git diff --name-only` (or equivalent) so the template sections are filled accurately.