Agent skill

TiDB Bazel Prepare Gate

by pingcap in pingcap/tidb

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.

Apache-2.0Auto-check passedDevelopment

Install TiDB Bazel Prepare Gate

skills CLI
$ npx skills add pingcap/tidb --skill tidb-bazel-prepare-gate -a claude-code

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

GitHub CLI
$ gh skill install pingcap/tidb tidb-bazel-prepare-gate --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-bazel-prepare-gate .claude/skills/tidb-bazel-prepare-gate && 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-bazel-prepare-gate
GitHub stars
41k
Token cost
~408 tokens
SKILL.md length
165 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
Apache-2.0

At a glance

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.

  • Unsure whether make bazel_prepare is required before building or testing TiDB
  • SKILL.md covers Overview, Inspect Local Changes and Decision Rules
  • Calls git and make
  • After adding a test function to an existing Go test file

What it does

This skill answers one question in the TiDB repository: does make bazel_prepare need to run before the next build or test? From the repository root it inspects local changes with git status and git diff, both unstaged and cached, and compares them with the trigger conditions defined in the repo's AGENTS.md under Build Flow. In normal coding loops the agent skips the check unless a trigger is likely.

Two checks are spelled out. An added top-level test function in an existing _test.go file, which shows up as a new func TestXxx line in the diff, requires the step, and so does any added or removed import line in existing Go files. If any condition matches, the agent runs make bazel_prepare. If none do, it carries on without it and reports the evidence.

When your agent uses it

  • Unsure whether make bazel_prepare is required before building or testing TiDB
  • After adding a test function to an existing Go test file
  • After adding or removing imports in Go files

Example prompts

  • “I added imports to the planner package. Do I need to run bazel_prepare before the tests?”
  • “Check my local changes and tell me whether make bazel_prepare is required.”
  • “I added a new test function to executor_test.go. Run the gate check.”

Requirements

  • A TiDB repository checkout, with git and make

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:

    • git
    • make

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

  • Network

    No URLs in SKILL.md. Its commands use git, 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 Bazel Prepare Gate loads about 408 tokens when it runs. Until then it costs about 37 tokens; SKILL.md has 165 words of instructions outside code blocks.

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

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). 165 words, ~408 tokens.

Download SKILL.mdSave it as .claude/skills/tidb-bazel-prepare-gate/SKILL.md (or your agent's skills folder).
name
tidb-bazel-prepare-gate
description
Use when deciding whether make bazel_prepare is required before build or test commands based on local file changes in TiDB.

TiDB Bazel Prepare Gate

Overview

Use this skill before build/test commands when you are unsure whether make bazel_prepare is required. Policy source: AGENTS.md -> Build Flow -> When make bazel_prepare is required. In normal coding loops, skip this skill unless one of the decision-rule triggers is likely present.

Inspect Local Changes

Run from repository root:

bash
git status --short
git diff --name-status
git diff --name-status --cached
git ls-files --others --exclude-standard
git diff -U0 -- '*.go'
git diff -U0 --cached -- '*.go'

Decision Rules

Trigger conditions are defined in AGENTS.md -> Build Flow -> When make bazel_prepare is required. Compare the output from the commands above against those conditions.

For the top-level test-function trigger in existing *_test.go files, inspect added lines in git diff -U0 -- '*.go' and git diff -U0 --cached -- '*.go' output for patterns like:

diff
+func TestXxx(t *testing.T) {

and treat that as requiring make bazel_prepare.

For import-section changes in existing Go files, inspect git diff -U0 -- '*.go' and git diff -U0 --cached -- '*.go' for added/removed import lines, for example:

diff
+import (
-import "fmt"
+	"context"

and treat those changes as requiring make bazel_prepare.

If any condition matches, run make bazel_prepare. If none of the rules match, continue without make bazel_prepare and report the evidence.

© 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-bazel-prepare-gate of pingcap/tidb.

Open the folder on GitHubat commit e7178de

Compare with similar skills

TiDB Bazel Prepare Gate 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 Bazel Prepare Gate compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
TiDB Bazel Prepare Gate this skillpingcap/tidb41k—~408Automated safety check: PassApache-2.0
Requesting Code ReviewHezaoHezao/poirot2495 repos~1.6kAutomated safety check: PassMIT
Pre-PR Reviewyuga-hashimoto/and-code123—~710Automated safety check: PassMIT
Procoder Commit Gateazrtydxb/procoder211—~3.7kAutomated safety check: PassApache-2.0
Pre-Commit Check GateZeroDeng01/sublinkPro1.7k—~2.9kAutomated safety check: NotesMIT
Commithyperlane-xyz/hyperlane-explorer102—~726Automated safety check: NotesCustom licence

Similar skills

  • Requesting Code Review

    HezaoHezao/poirot

    Pre-commit review: security scan, quality gates, auto-fix. An agent skill from HezaoHezao/poirot.

    249 GitHub starsUsed in 5 repos~1.6k tokens
    DevelopmentAuto-check passed
  • Pre-PR Review

    yuga-hashimoto/and-code

    Runs local checks and a repo-reviewer subagent over the whole branch diff before a pull request is opened, then records the approval in the PR description.

    123 GitHub stars~710 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Procoder Commit Gate

    azrtydxb/procoder

    Applies Procoder's senior-developer discipline in a repository: run the commit gate, format through the binary and work through specs, plans and todos.

    211 GitHub stars~3.7k tokensUpdated 11 days ago
    DevelopmentAuto-check passed
  • Pre-Commit Check Gate

    ZeroDeng01/sublinkPro

    Blocking checklist that runs formatting, lint and test commands for changed Go and frontend files before any git add, commit or pull request.

    1.7k GitHub stars~2.9k tokensUpdated today
    DevelopmentAuto-check: notes
  • Commit

    hyperlane-xyz/hyperlane-explorer

    Commit changes following project quality gates and best practices.

    102 GitHub stars~726 tokensUpdated yesterday
    DevelopmentAuto-check: notes
  • Gstack Pre-Landing Review

    LING71671/Open-ClaudeCode

    Runs a staff-engineer style review over the current diff before merging, listing findings by severity with file, impact and a suggested fix.

    962 GitHub stars~316 tokensUpdated 2 mo ago
    DevelopmentAuto-check: notes

More from pingcap/tidb

All 9 skills in this repo
  • 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
  • Keeps TiDB GitHub issues consistent by following the issue templates, writing reproducible reports, checking for duplicates and applying labels explicitly.

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

Works with

Categories

Questions about TiDB Bazel Prepare Gate

What does TiDB Bazel Prepare Gate do?

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. This skill answers one question in the TiDB repository: does make bazel_prepare need to run before the next build or test?md under Build Flow.

When should I use TiDB Bazel Prepare Gate?

TiDB Bazel Prepare Gate fits situations like: unsure whether make bazel_prepare is required before building or testing TiDB; after adding a test function to an existing Go test file; after adding or removing imports in Go files.

How do I install TiDB Bazel Prepare Gate in Claude Code?

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

How do I install TiDB Bazel Prepare Gate in Codex?

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

Can I use TiDB Bazel Prepare Gate 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-bazel-prepare-gate -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-bazel-prepare-gate, .gemini/skills/tidb-bazel-prepare-gate, .github/skills/tidb-bazel-prepare-gate and .opencode/skills/tidb-bazel-prepare-gate in your project.

What does TiDB Bazel Prepare Gate need to run?

Going by SKILL.md and its folder, TiDB Bazel Prepare Gate needs the command-line tools its instructions call (git and make). Our summary lists: A TiDB repository checkout, with git and make.

Does TiDB Bazel Prepare Gate access the network?

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

Is TiDB Bazel Prepare Gate 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 Bazel Prepare Gate use?

TiDB Bazel Prepare Gate 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 Bazel Prepare Gate use?

About 408 tokens (SKILL.md is roughly 1.6k 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 Bazel Prepare Gate?

Skills that share tags, products or a category with TiDB Bazel Prepare Gate: Requesting Code Review (HezaoHezao/poirot, 249 stars), Pre-PR Review (yuga-hashimoto/and-code, 123 stars), Procoder Commit Gate (azrtydxb/procoder, 211 stars) and Pre-Commit Check Gate (ZeroDeng01/sublinkPro, 1.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains TiDB Bazel Prepare Gate?

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.