|
| 1 | +--- |
| 2 | +name: tidb-issue-metadata-guard |
| 3 | +description: Use when creating or editing TiDB GitHub issues so issue templates, labels, issue titles, and issue descriptions stay consistent with repository workflow. Trigger on tasks involving issue creation, bug reports, enhancement tracking issues, label selection, or searching for existing issues and PRs before filing a new one. |
| 4 | +--- |
| 5 | + |
| 6 | +# TiDB Issue Metadata Guard |
| 7 | + |
| 8 | +## Overview |
| 9 | + |
| 10 | +Use this skill for TiDB GitHub issue metadata updates. |
| 11 | +The goal is to preserve issue-template structure, label hygiene, and searchable issue descriptions. |
| 12 | + |
| 13 | +Before creating or editing an issue, read the matching file under `.github/ISSUE_TEMPLATE/`. |
| 14 | + |
| 15 | +## Workflow |
| 16 | + |
| 17 | +1. Write issue titles and descriptions in English. |
| 18 | +2. Search existing issues and PRs first when the task is bug reporting or tracking an existing change. |
| 19 | +3. When creating a new issue, start from the matching issue template instead of writing the body from scratch. |
| 20 | + - Follow the template and fill the required sections. |
| 21 | + - For bug reports, include minimal reproduction, expected behavior, actual behavior, and TiDB version information when available. |
| 22 | + - Fill issue fields with concrete values from the available artifacts instead of generic placeholders. |
| 23 | + - Keep the first screen readable: show the top-level repro summary, expected result, actual result, and version directly in the section body. |
| 24 | + - If a field is long, keep a short visible summary and put the full content in a `<details>` block. |
| 25 | + - Good candidates: full repro SQL, full schema, long logs, checksum diffs, execution plans, and plan replayer notes. |
| 26 | + - Do not hide the only reproduction steps or the top-level expected/actual conclusion inside `<details>`. |
| 27 | + - If supporting artifacts exist, mention them explicitly in the repro steps or attachments summary. |
| 28 | + - When adding an analysis section, keep it short and evidence-backed: |
| 29 | + - 1–3 likely causes at most |
| 30 | + - prefer evidence from SQL shape, plans, errors, or result diffs |
| 31 | +4. When editing an existing issue, start from the current issue body instead of rewriting it from scratch. |
| 32 | + - Fetch the current title, body, and labels first. |
| 33 | + - Patch only the intended template sections and preserve untouched sections, metadata, and still-valid context. |
| 34 | + - Re-apply the same content rules used for new issues: concrete values, visible top-level summary, `<details>` for long raw artifacts, and short evidence-backed analysis when needed. |
| 35 | +5. When applying labels, do it explicitly instead of assuming the UI or template will fill them in. |
| 36 | + - For new issues created with `gh issue create`, add labels explicitly when the GitHub UI would normally auto-apply them. |
| 37 | + - For existing issues, prefer `gh issue edit` so labels reflect the current state after the body update. |
| 38 | + - Add at least one `component/*` label. |
| 39 | + - For bug or regression issues, add `severity/*` and affected-version labels when appropriate. |
| 40 | + - Severity labeling rule: |
| 41 | + - Wrong-result bugs: use `severity/major`. |
| 42 | + - Query fails to execute on valid SQL, for example an internal planner or runtime error: use `severity/major`. |
| 43 | + - Complex-query or compatibility issues that are not confirmed wrong-result and are not execution-blocking: use `severity/moderate`. |
| 44 | + - If label permissions are missing, first add labels by commenting `/label <label name>`. |
| 45 | + - If label comments still do not work, add a separate comment with `Suggested labels: ...`. |
| 46 | +6. Prefer file-based edits for GitHub metadata. |
| 47 | + - Materialize the intended issue body in a local Markdown file. |
| 48 | + - For new issues, review that file against the matching issue template before calling `gh`. |
| 49 | + - For existing issues, diff the patched body against the current issue body before calling `gh`. |
| 50 | + |
| 51 | +## Quick Checks |
| 52 | + |
| 53 | +- The issue title and body are in English. |
| 54 | +- The issue still follows the matching template structure. |
| 55 | +- Long raw artifacts are folded with `<details>` when needed, while the top-level summary remains visible. |
| 56 | +- Existing issue edits preserve untouched sections and metadata outside the intended patch. |
| 57 | +- The issue carries the expected labels, or a follow-up label comment / `Suggested labels: ...` comment is present when label permissions are missing. |
0 commit comments