AgentSkillsCN

fix-bug

分析并修复已认领的GitHub问题中描述的Bug。制定针对性的修复方案,并附上根因说明,开启草稿PR。适用于在认领问题后,将其标记为“Bug”的问题。

SKILL.md
--- frontmatter
name: fix-bug
description: Analyse and fix a bug described in a claimed GitHub issue. Produce a targeted fix and open a draft pull request with root cause description. Use for issues labelled as bugs after claiming them.
tools:
  - fix_bug
  - open_pull_request
user-invokable: false
version: 1.0.0

Fix Bug

Purpose

Diagnose a reported bug, produce a targeted fix, and submit it as a draft pull request with a clear description of the root cause.

Instructions

  1. Read the issue carefully: bug description, reproduction steps, expected vs actual behaviour
  2. If the bug cannot be reproduced or the description is too vague to fix safely:
    • Comment on the issue with specific questions or findings
    • Flag the issue for human developer review
    • Stop — do not produce speculative code
  3. Call fix_bug with the repository, issue number, title, and body
  4. If a branch name is returned:
    • Call open_pull_request with:
      • Title: "fix: <concise bug description> (closes #<issue>)"
      • Body: Root cause analysis + fix description + "Closes #<issue_number>"
      • draft: true
  5. Log the PR number and link

Pull Request Requirements

  • Title MUST follow conventional commit format: fix: <description>
  • Body MUST contain a "Root Cause" section explaining what caused the bug
  • Body MUST contain a "Fix" section explaining what was changed and why
  • Body MUST reference the originating issue with "Closes #<number>"
  • PR MUST be opened as draft

Escalation Criteria

  • Bug requires changes to security, authentication, or authorization logic → always escalate
  • Fix requires modifying more than 5 files → likely too broad, escalate for review
  • Root cause is unclear after analysis → comment findings and escalate

Expected Output

The opened draft pull request with its number, URL, and a brief root cause summary.