Skip to content

Commit dc2b2d7

Browse files
committed
agents: add issue edit workflow
1 parent ffc0a3d commit dc2b2d7

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

  • .agents/skills/tidb-issue-metadata-guard

.agents/skills/tidb-issue-metadata-guard/SKILL.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ description: Use when creating or editing TiDB GitHub issues so issue templates,
1010
Use this skill for TiDB GitHub issue metadata updates.
1111
The goal is to preserve issue-template structure, label hygiene, and searchable issue descriptions.
1212

13-
Before creating an issue, read the matching file under `.github/ISSUE_TEMPLATE/`.
13+
Before creating or editing an issue, read the matching file under `.github/ISSUE_TEMPLATE/`.
1414

1515
## Workflow
1616

1717
1. Write issue titles and descriptions in English.
1818
2. Search existing issues and PRs first when the task is bug reporting or tracking an existing change.
19-
3. Start from the matching issue template instead of writing the body from scratch.
19+
3. When creating a new issue, start from the matching issue template instead of writing the body from scratch.
2020
- Follow the template and fill the required sections.
2121
- For bug reports, include minimal reproduction, expected behavior, actual behavior, and TiDB version information when available.
2222
- Fill issue fields with concrete values from the available artifacts instead of generic placeholders.
@@ -28,7 +28,13 @@ Before creating an issue, read the matching file under `.github/ISSUE_TEMPLATE/`
2828
- When adding an analysis section, keep it short and evidence-backed:
2929
- 1–3 likely causes at most
3030
- prefer evidence from SQL shape, plans, errors, or result diffs
31-
4. If you create an issue with `gh issue create`, add labels explicitly when the GitHub UI would normally auto-apply them.
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.
3238
- Add at least one `component/*` label.
3339
- For bug or regression issues, add `severity/*` and affected-version labels when appropriate.
3440
- Severity labeling rule:
@@ -37,13 +43,15 @@ Before creating an issue, read the matching file under `.github/ISSUE_TEMPLATE/`
3743
- Complex-query or compatibility issues that are not confirmed wrong-result and are not execution-blocking: use `severity/moderate`.
3844
- If label permissions are missing, first add labels by commenting `/label <label name>`.
3945
- If label comments still do not work, add a separate comment with `Suggested labels: ...`.
40-
5. Prefer file-based edits for GitHub metadata.
46+
6. Prefer file-based edits for GitHub metadata.
4147
- Materialize the intended issue body in a local Markdown file.
42-
- Review that file against the matching issue template before calling `gh`.
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`.
4350

4451
## Quick Checks
4552

4653
- The issue title and body are in English.
4754
- The issue still follows the matching template structure.
4855
- 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.
4957
- 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

Comments
 (0)