OpenParable
Skip to content
← Back to skills

Tidb Bazel Prepare Gate

DevOps & Security
tidb-bazel-prepare-gate

Tidb Bazel Prepare Gate is an Agent Skill for devops & security published in the pingcap/tidb repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Use when deciding whether make bazel_prepare is required before build or test commands based on local file changes in TiDB.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/pingcap/tidb/blob/HEAD/.agents/skills/tidb-bazel-prepare-gate/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/tidb-bazel-prepare-gate, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

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:

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:

+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:

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