Logo van Ring:Opening Pull Requests

Ring:Opening Pull Requests

Organisatie
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.

Add to TypingMind

Overzicht

UitgeverLerianStudio
Repositoryring
Skillnaamring:opening-pull-requests
Sterren
215
Forks
28
Meegeleverde bestanden
Alleen instructies
LicentieApache-2.0
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Compleet zonder extra bestanden

    Alles wat het model nodig heeft, staat in de instructies — geen extra bestanden om te synchroniseren.

  • Open source

    Gepubliceerd door LerianStudio op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Ring:Opening Pull Requests in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/LerianStudio/ring/tree/main/default/skills/opening-pull-requests
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

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
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Ring:Opening Pull Requests in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Ring:Opening Pull Requests automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Ring:Opening Pull Requests niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

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

Veelgestelde vragen

Wat doet de AI-skill 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.

Waarom Ring:Opening Pull Requests gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Ring:Opening Pull Requests bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Ring:Opening Pull Requests in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/LerianStudio/ring/tree/main/default/skills/opening-pull-requests. TypingMind leest het bestand SKILL.md en installeert het als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Ring:Opening Pull Requests gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Ring:Opening Pull Requests gebruiken?

Zoveel als je wilt. Je kunt Ring:Opening Pull Requests gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Ring:Opening Pull Requests gratis?

Ja. Deze skill is door LerianStudio op GitHub gepubliceerd onder de licentie Apache-2.0. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇