Agent skill

TiDB PR Metadata Guard

by pingcap in pingcap/tidb

Creates and edits TiDB pull request titles and descriptions without breaking the PR template, and diagnoses bot labels that stay on because of template changes.

Apache-2.0Auto-check passedDevelopment

Install TiDB PR Metadata Guard

skills CLI
$ npx skills add pingcap/tidb --skill tidb-pr-metadata-guard -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install pingcap/tidb tidb-pr-metadata-guard --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/pingcap/tidb.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/tidb-pr-metadata-guard .claude/skills/tidb-pr-metadata-guard && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tidb-pr-metadata-guard
GitHub stars
41k
Token cost
~703 tokens
SKILL.md length
377 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
Apache-2.0

At a glance

Creates and edits TiDB pull request titles and descriptions without breaking the PR template, and diagnoses bot labels that stay on because of template changes.

  • Works in 7 steps: Write PR titles and descriptions in… → For a new PR, start from… → For an existing PR, update only the… → …
  • Opening a pull request against the TiDB repo
  • SKILL.md covers Overview, Workflow and Quick Checks
  • Calls gh

What it does

The skill keeps TiDB GitHub PRs compliant with `.github/pull_request_template.md`. New PRs start from the template with `gh pr create -T`, filled in a Markdown file first, and use a title like `pkg [, pkg2, pkg3]: what is changed` or `*: what is changed`, where the scope names a TiDB module area such as `planner` rather than a Go package path like `pkg/planner/core`. Titles and descriptions are written in English.

For an existing PR the agent edits only the mutable sections: the issue number, problem summary, the what-changed section, test checkboxes and commands, and the release-note block. Headings and order stay as they are, and hidden HTML comments are preserved exactly. After any body update it re-reads the PR and checks whether the bot labels `do-not-merge/needs-linked-issue` and `do-not-merge/needs-tests-checked` changed as expected, diffing against the template if one stays. A new linked issue is handled first through `tidb-issue-metadata-guard`.

When your agent uses it

  • Opening a pull request against the TiDB repo
  • Editing a TiDB PR description without losing template sections
  • Working out why a do-not-merge bot label is still on a PR

Example prompts

  • “Open a PR for the planner fix using the TiDB PR template and a correctly scoped title.”
  • “Update the Problem Summary and release note on my TiDB PR without touching the rest of the template.”
  • “The do-not-merge/needs-linked-issue label won't go away on my PR. Find out why.”

Requirements

  • GitHub CLI (`gh`) with access to the TiDB repository

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Write PR titles and descriptions in English.
  2. For a new PR, start from .github/pull_request_template.md instead of writing the body from scratch.
  3. For an existing PR, update only the mutable sections.
  4. Preserve hidden HTML comments exactly.
  5. If a PR needs a new linked issue, use tidb-issue-metadata-guard to create or identify the issue first, then patch only the Issue Number…
  6. Prefer file-based edits for GitHub metadata.
  7. After any PR body update, re-read the PR and check whether bot-gated labels changed as expected.

What it can do on your machine

Read from SKILL.md and the folder at commit e7178de. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • gh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use gh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

TiDB PR Metadata Guard loads about 703 tokens when it runs. Until then it costs about 36 tokens; SKILL.md has 377 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~36
When it runs · the whole SKILL.md, loaded when a task matches
~703

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from pingcap/tidb at commit e7178de, republished under its Apache-2.0 licence (© pingcap). 377 words, ~703 tokens.

Download SKILL.mdSave it as .claude/skills/tidb-pr-metadata-guard/SKILL.md (or your agent's skills folder).
name
tidb-pr-metadata-guard
description
Create or edit TiDB PR metadata, or diagnose template-related bot labels; preserve required fields and hidden comments.

TiDB PR Metadata Guard

Overview

Use this skill for TiDB GitHub pull request metadata updates. The goal is to preserve repository-required PR structure while editing only the mutable fields.

Before changing a PR body, read .github/pull_request_template.md.

Workflow

  1. Write PR titles and descriptions in English.
  2. For a new PR, start from .github/pull_request_template.md instead of writing the body from scratch.
    • Use a title in the form pkg [, pkg2, pkg3]: what is changed or *: what is changed.
    • In that title format, pkg means the TiDB module area, not a literal Go package path. For example, changes under pkg/planner/core usually map to planner, not pkg/planner/core.
    • Use gh pr create -T .github/pull_request_template.md.
    • Fill in the template in a Markdown file first, then submit it.
  3. For an existing PR, update only the mutable sections.
    • Safe targets: Issue Number:, Problem Summary:, the content under ### What changed and how does it work?, test checkbox states and concrete commands, and the release-note block.
    • Do not rename headings, reorder checklist sections, or rewrite the template wholesale.
  4. Preserve hidden HTML comments exactly.
    • Keep Tests <!-- At least one of them must be included. --> unchanged.
    • Keep the No need to test nested block and its HTML comment unchanged.
    • Do not delete or rewrite template comments that explain issue linking or release-note behavior.
  5. If a PR needs a new linked issue, use tidb-issue-metadata-guard to create or identify the issue first, then patch only the Issue Number: line in the PR body.
  6. Prefer file-based edits for GitHub metadata.
    • Materialize the intended issue body or PR body into a local Markdown file.
    • Review that file against the PR template before calling gh.
  7. After any PR body update, re-read the PR and check whether bot-gated labels changed as expected.
    • do-not-merge/needs-linked-issue
    • do-not-merge/needs-tests-checked
    • If a label remains unexpectedly, diff the current body against .github/pull_request_template.md before changing anything else.
Show full SKILL.md (79 more words)Show less

Quick Checks

  • The PR body still contains an Issue Number: line, and that line can reference one or more related issues with full keyword syntax such as close #<id> and ref #<id>.
  • The PR title uses module-oriented scope names such as planner, executor, or *:, not raw Go package paths such as pkg/planner/core.
  • The Tests line still includes the template HTML comment verbatim.
  • At least one test checkbox is checked, or No need to test is checked with a reason.

© pingcap, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/tidb-pr-metadata-guard of pingcap/tidb.

Open the folder on GitHubat commit e7178de

Compare with similar skills

TiDB PR Metadata Guard next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

TiDB PR Metadata Guard compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
TiDB PR Metadata Guard this skillpingcap/tidb41k—~703Automated safety check: PassApache-2.0
Docs PR Metadata Guardpingcap/docs615—~1.9kAutomated safety check: PassCustom licence
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Check PRonyx-dot-app/onyx32k2 repos~2.3kAutomated safety check: PassMIT
Contributor-First PR MergeHKUDS/OpenHarness16k1 repos~847Automated safety check: PassMIT
Create Pull Requestcline/cline70k1 repos~1.6kAutomated safety check: PassApache-2.0

Similar skills

  • A skill your agent uses when creating or editing pull requests in pingcap/docs so the PR template sections, version checkboxes, related-link fields, HTML comments, and description structure stay…

    615 GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check passed
  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Check PR

    onyx-dot-app/onyx

    Checks a GitHub, GitLab, or Perforce (p4) pull request (or merge request, or shelved changelist) for unresolved review comments, failing status checks, and incomplete PR descriptions.

    32k GitHub starsUsed in 2 repos~2.3k tokens
    DevelopmentAuto-check passed
  • Merges external GitHub pull requests while keeping the original author credited, and fixes conflicts after the merge instead of rewriting the contribution.

    16k GitHub starsUsed in 1 repo~847 tokens
    DevelopmentAuto-check passed
  • Opens a GitHub pull request from your current branch with the gh CLI, after reviewing the commits and diff and gathering the details the PR needs.

    70k GitHub starsUsed in 1 repo~1.6k tokens
    DevelopmentAuto-check passed
  • Pull Request Title and Body Writer

    openinterpreter/openinterpreter

    Rewrites the title and body of one or more pull requests with gh, leading with why the change was made, then what changed, and describing only the net result.

    69k GitHub starsUsed in 2 repos~1.1k tokens
    DevelopmentAuto-check passed

More from pingcap/tidb

All 9 skills in this repo
  • Decides from local git changes whether make bazel_prepare must run in TiDB before build or test commands, and reports the evidence for the decision.

    41k GitHub stars~408 tokensUpdated today
    Auto-check passed
  • Investigates TiDB plan or test-result diffs that the change does not explain, ruling out failpoint setup and merge effects before expected outputs are updated.

    41k GitHub stars~498 tokensUpdated today
    Auto-check passed
  • Use when running TiDB package tests and deciding whether failpoint enable/disable is required before and after the test command.

    41k GitHub stars~256 tokensUpdated today
    Auto-check passed
  • Use when recording TiDB integration tests under tests/integrationtest and verifying regenerated result files stay minimal and correct.

    41k GitHub stars~260 tokensUpdated today
    Auto-check passed
  • Use when running tests under tests/realtikvtest that require a local TiUP playground lifecycle with strict startup, readiness checks, and cleanup.

    41k GitHub stars~250 tokensUpdated today
    Auto-check passed
  • Checks a fix proposed by a user or reviewer for intent, correctness and compatibility before the agent implements it in the TiDB codebase.

    41k GitHub stars~523 tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about TiDB PR Metadata Guard

What does TiDB PR Metadata Guard do?

Creates and edits TiDB pull request titles and descriptions without breaking the PR template, and diagnoses bot labels that stay on because of template changes. md`. New PRs start from the template with `gh pr create -T`, filled in a Markdown file first, and use a title like `pkg [, pkg2, pkg3]: what is changed` or `*: what is changed`, where the scope names a TiDB module area such as `planner` rather than a Go package path like `pkg/planner/core`.

When should I use TiDB PR Metadata Guard?

TiDB PR Metadata Guard fits situations like: opening a pull request against the TiDB repo; editing a TiDB PR description without losing template sections; working out why a do-not-merge bot label is still on a PR.

How do I install TiDB PR Metadata Guard in Claude Code?

Run `npx skills add pingcap/tidb --skill tidb-pr-metadata-guard -a claude-code`. Or copy the skill folder (.agents/skills/tidb-pr-metadata-guard in pingcap/tidb) into .claude/skills/tidb-pr-metadata-guard in your project. Claude Code loads it when a task matches its description.

How do I install TiDB PR Metadata Guard in Codex?

Run `npx skills add pingcap/tidb --skill tidb-pr-metadata-guard -a codex`. Or copy the skill folder (.agents/skills/tidb-pr-metadata-guard in pingcap/tidb) into .agents/skills/tidb-pr-metadata-guard in your project. Codex loads it when a task matches its description.

Can I use TiDB PR Metadata Guard in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add pingcap/tidb --skill tidb-pr-metadata-guard -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tidb-pr-metadata-guard, .gemini/skills/tidb-pr-metadata-guard, .github/skills/tidb-pr-metadata-guard and .opencode/skills/tidb-pr-metadata-guard in your project.

What does TiDB PR Metadata Guard need to run?

Going by SKILL.md and its folder, TiDB PR Metadata Guard needs the command-line tools its instructions call (gh). Our summary lists: GitHub CLI (`gh`) with access to the TiDB repository.

Does TiDB PR Metadata Guard access the network?

SKILL.md contains no URLs. Its commands use gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is TiDB PR Metadata Guard safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does TiDB PR Metadata Guard use?

TiDB PR Metadata Guard is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does TiDB PR Metadata Guard use?

About 703 tokens (SKILL.md is roughly 2.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to TiDB PR Metadata Guard?

Skills that share tags, products or a category with TiDB PR Metadata Guard: Docs PR Metadata Guard (pingcap/docs, 615 stars), PR Babysitter (openinterpreter/openinterpreter, 69k stars), Check PR (onyx-dot-app/onyx, 32k stars) and Contributor-First PR Merge (HKUDS/OpenHarness, 16k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains TiDB PR Metadata Guard?

pingcap (a GitHub organization) maintains it in pingcap/tidb, which has 40,633 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on October 9, 2026.

Source: pingcap/tidb on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.