Ring:Opening Pull Requests logo

Ring:Opening Pull Requests

Organization
LerianStudio
ring:opening-pull-requests

Open a GitHub Pull Request with automatic base branch detection, scope allowlist enforcement, PR template filling, and post-create base verification. Replaces ring:generating-pr-descriptions. Use after pushing a branch when ready to open a PR. Skip if the branch is not yet pushed or there are uncommitted changes — commit first with ring:committing-changes.

Overview

PublisherLerianStudio
Repositoryring
Skill namering:opening-pull-requests
Stars
215
Forks
28
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by LerianStudio on GitHub. Read the source before you install it.

Installation

Install the Ring:Opening Pull Requests AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/LerianStudio/ring.git /tmp/ring
mkdir -p .claude/skills
cp -r /tmp/ring/default/skills/opening-pull-requests .claude/skills/lerianstudio-ring-opening-pull-requests
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Ring:Opening Pull Requests in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Ring:Opening Pull Requests on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Ring:Opening Pull Requests is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Open a GitHub Pull Request against the correct base branch, with a title that will pass scope validation and a body that fills the repo's PR template. Verifies the base after creation and corrects it automatically if GitHub defaulted to the wrong target.

⛔ HARD STOP — DO NOT CALL gh pr create BEFORE COMPLETING STEPS 1–6

Skipping detection steps is how PRs end up targeting main when the repo expects develop, or how PRs fail validation due to a missing or invalid scope. MUST complete every step in order.


Step 1 — Detect Base Branch

NEVER assume the base. Run all three probes first, then apply the precedence rules below.

Probes (run in parallel)

bash
# Probe A — GitHub API default
gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'
# Fallback if gh unavailable: git remote show origin | grep 'HEAD branch' | awk '{print $NF}'

# Probe B — PR template hint
# Read .github/pull_request_template.md — note any explicit branch name mentioned

# Probe C — develop branch existence
git ls-remote --heads origin develop

Precedence (apply in order — first match wins)

PrioritySourceRule
1 — highestPR templateIf .github/pull_request_template.md explicitly names a target branch, use it. Overrides everything.
2develop exists + user confirmsIf Probe C finds develop AND it differs from Probe A, show both options and ask the user to confirm. Use the user's choice.
3 — fallbackGitHub API defaultUse the value from Probe A.
4Neither detectedSTOP — ask the user which branch to target.

State the resolved $BASE and which source determined it before proceeding.


Step 2 — Detect Scope Policy

MUST detect the allowlist before proposing the PR title. A title with a wrong or missing scope will fail PR validation and block the merge.

2.1 — Locate the policy file

Check in this order:

  1. .github/workflows/pr-validation.yml (primary)
  2. .github/workflows/pr-title.yml
  3. .github/workflows/commitlint.yml
  4. .github/workflows/semantic-pull-request.yml
  5. Root configs: commitlint.config.{js,cjs,mjs,ts}, .commitlintrc*

2.2 — Extract allowed scopes and types

FormExample
scopes: block (one per line)Under amannn/action-semantic-pull-request
scopes: a,b,c inlineComma-separated on one line
scope-enum ruleIn commitlint config arrays

Also extract any type restrictions — some repos limit allowed types beyond the default Conventional Commits set.

2.3 — Apply the policy

SituationRequired Action
Policy found, scope is clearUse only scopes from the allowlist
Policy found, scope is ambiguousSTOP and ask the user which allowed scope to use
No policy file foundInfer a candidate scope from recent merged PRs first: gh pr list --state merged --limit 15 --json title --jq '.[].title'. Present the inferred scope to the user for confirmation; if no clear pattern emerges, ask the user for a scope.

NEVER omit the scope. NEVER invent a scope not in the allowlist.

State the policy source and chosen scope before proceeding.


Step 3 — Verify Preconditions

bash
git status --porcelain                                  # check for uncommitted changes
git branch --show-current                               # confirm current branch name (empty in detached HEAD)
git fetch origin <current-branch> --quiet               # refresh remote ref before checking push state
git ls-remote --heads origin <current-branch>           # confirm branch exists on remote
git rev-list origin/<current-branch>..HEAD --count      # confirm no local commits ahead
ConditionDetectionRequired Action
Uncommitted changes existgit status --porcelain returns outputSTOP — ask user to commit first with ring:committing-changes
Detached HEAD / no branchgit branch --show-current returns empty outputSTOP — ask user to checkout or create a named branch first
Branch not on remotegit ls-remote returns no SHA for the branchSTOP — push first: git push -u origin <branch>
Local commits ahead of remotegit rev-list origin/<branch>..HEAD --count returns non-zeroSTOP — push pending commits first: git push

Fail closed. Check in this order: uncommitted changes → detached HEAD → branch on remote → no local commits ahead. Only continue when all four checks pass. Do NOT interpolate an empty branch name into git ls-remote or git rev-list.


Step 4 — Read PR Template

bash
cat .github/pull_request_template.md 2>/dev/null

If the template exists, use it as the body structure and fill in every section. If no template exists, use this default structure:

markdown
## Summary

<!-- What does this PR do and why? -->

## Type of Change

- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update

## Breaking Changes

None.

## Testing

- [ ] Unit tests pass
- [ ] Manually tested

## Related Issues

<!-- Closes #issue -->

Step 5 — Gather Diff Context

bash
git log origin/$BASE..HEAD --oneline
git diff origin/$BASE...HEAD --stat

Use this output to fill the PR body accurately.


Step 6 — Draft PR Title and Body

Title

<type>(<scope>): <description>

Requirements:

  • Under 70 characters
  • Lowercase, no period at the end
  • Scope MUST come from the allowlist (Step 2)
  • Type MUST be allowed per policy (Step 2)

Examples:

  • feat(auth): add OAuth2 refresh token support
  • fix(api): handle null response in user endpoint
  • chore(deps): update authentication dependencies

Body

Fill the PR template completely:

SectionInstructions
Description/SummarySummarize what the PR does and why
Type of ChangeCheck boxes matching the commit type
Breaking ChangesDescribe if applicable; otherwise "None."
TestingCheck applicable boxes; add CI run link if available
Related IssuesFill only if user mentioned an issue; leave blank otherwise

Step 7 — Show Full Draft for Approval

Present the complete draft to the user:

PR Draft — waiting for your approval
─────────────────────────────────────
Base branch:  develop   (from: git ls-remote)
Scope policy: .github/workflows/pr-validation.yml → scopes: [api, auth, docs, ci]
Chosen scope: auth

Title:
  feat(auth): add OAuth2 refresh token support

Body:
  ## Summary
  Adds automatic token refresh when access token expires...
  ...

Command that will run:
  gh pr create --title "feat(auth): add OAuth2 refresh token support" \
               --body "..." \
               --base develop

Approve and create? [Yes / Edit title / Edit body / Cancel]

MUST wait for explicit user approval before executing gh pr create.


Step 8 — Create the PR

bash
gh pr create \
  --title "<title>" \
  --body "<body>" \
  --base $BASE

Capture the PR number from the output.


Step 9 — Verify Base Branch

MUST verify the PR was opened against the expected base before reporting success. GitHub sometimes defaults to a different base.

bash
gh pr view <number> --json baseRefName --jq '.baseRefName'
ResultAction
Equals $BASEProceed — report success
Does NOT equal $BASEImmediately retarget: gh pr edit <number> --base $BASE

After retargeting, verify again:

bash
gh pr view <number> --json baseRefName --jq '.baseRefName'

Only report success after the base is confirmed correct.


Step 10 — Return PR URL

bash
gh pr view <number> --json url --jq '.url'

Return the PR URL to the user.


Anti-Patterns (FORBIDDEN)

  • Do NOT call gh pr create before completing Steps 1–7 — bypassing detection causes PRs targeting the wrong base
  • Do NOT hardcode --base develop or --base main — always pass --base $BASE resolved in Step 1
  • Do NOT skip Step 9 (post-create verification) — GitHub may default to the wrong base
  • Do NOT invent scopes — a scope not in the allowlist fails PR validation
  • Do NOT omit the scope — every PR title MUST carry type(scope): description, never type: description

Anti-Rationalization Table

RationalizationWhy It's WRONGRequired Action
"The repo always uses develop, I can hardcode it"Any repo could be different. Detection takes 2 seconds.MUST detect with git ls-remote
"I'll skip the post-create verification"GitHub defaults to wrong bases frequently. The PR ends up merging into the wrong branch.MUST verify with gh pr view --json baseRefName
"Scope is optional, nobody will notice"PR validation workflow will block it and waste everyone's time.MUST include scope from allowlist
"I'll guess the scope, it looks right"Guessing breaks validation. Ask the user if ambiguous.MUST use only allowlist scopes
"No PR template? I'll skip the body"A minimal body is always better than an empty one.MUST use default structure if no template
"Already opened PR, base looks fine"GitHub silently defaults to wrong base. Verify explicitly.MUST run gh pr view --json baseRefName

Frequently asked questions

What does the Ring:Opening Pull Requests AI skill do?

Open a GitHub Pull Request with automatic base branch detection, scope allowlist enforcement, PR template filling, and post-create base verification. Replaces ring:generating-pr-descriptions. Use after pushing a branch when ready to open a PR. Skip if the branch is not yet pushed or there are uncommitted changes — commit first with ring:committing-changes.

Why use Ring:Opening Pull Requests on TypingMind?

Because you install it once and use it with any model. Ring:Opening Pull Requests is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Ring:Opening Pull Requests in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/LerianStudio/ring/tree/main/default/skills/opening-pull-requests. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Ring:Opening Pull Requests?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Ring:Opening Pull Requests?

As many as you like. As long as a model supports skills, you can use Ring:Opening Pull Requests with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Ring:Opening Pull Requests AI skill free?

Yes. It is published on GitHub by LerianStudio under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇