gh-pr

$npx mdskill add fredrikaverpil/dotfiles/gh-pr

Creates GitHub pull requests with structured body and conventions.

  • Solves the need to create consistent, well-formatted PRs quickly.
  • Depends on the GitHub CLI (gh) and a GitHub repository.
  • Uses a template with Why/What/Notes sections and conventional commit titles.
  • Outputs a draft PR command with title, body, assignee, and Jira ticket number.

SKILL.md

.github/skills/gh-prView on GitHub ↗
---
name: gh-pr
description: >-
  This skill should be used when creating a GitHub pull request via `gh pr
  create`. Defines PR body format with Why/What/Notes sections, ensures proper
  assignment, and prompts for Jira ticket number.
---

# GitHub Pull Request Creation

When creating a pull request, use the `gh` CLI with the following format and
conventions.

- Always create draft PRs.
- Keep PR titles, descriptions, and comments concise and clear.
- Include only useful information. Remove redundancy and over-explanation.
- Prefer explicitness and clarity over verbosity.
- Express Why/What/Notes content as concise, to-the-point bullet lists. Avoid
  prose paragraphs.
- Include a small, illustrative code snippet whenever it conveys the change
  faster than prose. This is desired for PRs in general, and especially for bug
  fixes: a minimal example of the triggering case (and what went wrong) makes
  the problem concrete for reviewers. Keep it short — just enough to convey the
  point, not a full reproduction.

## PR title format

Write the title as if the whole PR was squashed into a single commit using
conventional commits.

## PR Body Format

```markdown
# XY-123

## Why?

[Explain the motivation for this change. What problem does it solve?]

## What?

[Describe what was changed. List the key modifications.]

## Notes

[Optional. Additional context, testing notes, or follow-up items.]
```

## Command Template

```bash
gh pr create --draft --assignee @me --title "<title>" --body "$(cat <<'EOF'
## Why?

<motivation>

## What?

<changes>

## Notes

<optional notes>
EOF
)"
```

## Rules

1. Always assign PR to `@me` using `--assignee @me`
2. `# XY-123` - Always ask the user for the Jira ticket number before creating
   the PR. If there is one, include it as an H1 header at the top of the body.
   If there isn't one, omit it.
3. `## Why?` - Required. Explain motivation and problem being solved
4. `## What?` - Required. Describe the changes made
5. `## Notes` - Optional. Omit entirely if no notes are needed
6. Use imperative mood in title (e.g., "Add feature" not "Added feature")
7. Keep title concise and descriptive

## Example

```bash
gh pr create --draft --assignee @me --title "Add user authentication" --body "$(cat <<'EOF'
## Why?

Users need secure access to their accounts. Currently there is no
authentication mechanism in place.

## What?

- Add login/logout endpoints
- Implement JWT token generation
- Add password hashing with bcrypt
- Create auth middleware for protected routes

## Notes

Requires `JWT_SECRET` env variable to be set in production.
EOF
)"
```

More from fredrikaverpil/dotfiles

SkillDescription
aipGoogle API Improvement Proposals (AIP) reference. Use BEFORE designing or reviewing APIs, protobuf definitions, or any work involving Google API design standards. Fetches relevant AIP rules from https://google.aip.dev for the task at hand.
golang-styleTry to follow the proverbs:
neovimInteract with the user's running Neovim instance via RPC. Use this skill when you need to execute Lua or Vimscript inside Neovim, query buffer state, send commands, or interact with the Neovim runtime in any way. Triggers when the user asks about their current Neovim session, wants to run something inside Neovim, or when you need to inspect Neovim state (buffers, windows, options, LSP, etc.). Also use when running inside a Neovim terminal and needing to communicate with the parent editor.
nix-installInstall Nix in the Claude Code web sandbox (the cloud environment) as a general-purpose package installer, then install packages from the Nix binary cache with no GitHub access. Use whenever a web session needs a tool that isn't preinstalled and isn't in a language registry (npm/pypi/crates/go) — Neovim, ripgrep, a compiler, anything in nixpkgs. Installs nix-bin via apt, configures single-user mode, and installs packages via nix-env against the nixpkgs channel tarball. Web-sandbox only.
nvim-config>
nvim-installInstall Neovim and stand up the nvim-fredrik config in the Claude Code web sandbox (the cloud environment), where no Neovim exists. Use this before testing any Neovim config change in a web session, e.g. checking out a PR branch that touches nvim-fredrik and observing its runtime behavior. Installs Neovim via Nix from the binary cache with no GitHub access, wires the repo's config into place, launches Neovim headless with a listen socket, and exports $NVIM so the `neovim` RPC skill can drive it. Web-sandbox only.
nvim-pluginReference: https://neovim.io/doc/user/lua-plugin/
plan-interviewBefore creating a plan, interview the user
pr-style>-
proofProvide proof to your claim(s)