SuperAPI AI Directory

bugfix-workflow

Coding & development

View repository

Updated 10-16 01:16

About this skill

BUG Fix Workflow

Project Context Protocol - CRITICAL

Please strictly comply with the mandatory project context protocol:specs/PROJECT-CONTEXT.md Before executing this Skill, project awareness must first be established.

Goal: generally adapt to all types of BUGs, and enforce "reproduce first, then fix".

Quick Start

  1. Collect information: problem description, occurrence location, expected result, actual result, environment/version, logs/screenshots.
  2. Reproduce: reproduce strictly according to the user's steps; if it fails, immediately ask follow-up questions and do not proceed to fixing.
  3. Locate: narrow the scope and find the root cause or the smallest suspicious range.
  4. Fix: minimal changes; prioritize reusing existing modules/code.
  5. Unit testing: write an automated test script for this BUG to verify the effectiveness of the fix and prevent regression.
  6. Verification: must include "detailed manual operation steps", explained step by step.
  7. Generate report: copy the template to docs/BUG修复文档/, and complete the content.

Mandatory Constraints

  • Not reproduced → code must not be modified.
  • Reproduction unsuccessful → provide a "list of additional reproduction information needed" and wait for the user to supplement it.
  • Fix completed → manual verification steps must be provided (step by step, down to clicks/input).
  • Impacts documentation → update the relevant documentation to avoid inconsistency with the code.
  • If any hard condition is not met → must stop and explain the reason, and must not continue to the next step.
  • Reproduction threshold: if "clear and executable reproduction steps + expected/actual" are not provided → must stop.
  • Verification threshold: if step-by-step manual verification steps are not output → must not end.
  • Testing threshold: a unit test script must be written/updated to cover this BUG; if it cannot be written (such as a pure UI style issue or lack of environment), the reason must be explained in detail in the report.
  • Report threshold: if a fix report is not generated → it is not considered complete.

Reproduction Information Checklist (ask first if insufficient)

  • Page/feature location where it occurs
  • Expected result vs actual result
  • Reproducible steps (as detailed as possible down to buttons/input fields)
  • Provide minimal reproducible steps as much as possible
  • Device/system/version/configuration
  • Logs/screenshots/error messages

Guided Follow-up Questions (use when the description is incomplete)

Ask follow-up questions in a "small amounts, multiple times" manner, starting with the three most critical points:

  1. Where does it occur (page/feature)?
  2. What operations did you perform (as detailed as possible for each step)?
  3. Expected result vs actual result?

If it still cannot be reproduced, continue asking:

  • Trigger frequency (always/occasionally) and time of first occurrence
  • Whether it is related to account/role/permissions
  • Device/system/version/configuration details
  • Are there screenshots/logs/error messages?

Location Suggestions (use as needed)

  • Narrow the scope: functional module → component/service → key function
  • Compare "expected vs actual" to find the logic branch point
  • Prioritize checking reused modules and common utilities

Fix recommendations (general)

  • Minimal changes, clear reasons, avoid side effects
  • Follow existing code conventions and structure
  • Have a clear basis for the severity level (scope of impact/whether it blocks/whether it can be bypassed)
  • The fix plan includes risk points and a rollback approach

Verification output requirements

  1. Automated testing:

    • Write a new test file or add a test case to the existing tests.
    • Ensure the test case can reproduce the BUG (fails before the fix) and verify the fix (passes after the fix).
    • Show the test run results in the conversation (PASS/FAIL).
  2. Manual verification: You must output "manual verification steps", in the format of step-by-step items (example):

  1. Open the application and go to the XXX page
  2. Click the XXX button
  3. Enter XXX in the XXX input box
  4. Observe whether XXX meets expectations

Report template

  1. Check whether the docs/BUG修复文档/ directory exists; if it does not exist, create it automatically.
  2. Copy assets/bugfix-report-template.md to that directory, suggested naming: YYYYMMDD-HHMM-问题简述.md

After filling it in, state the report path in the reply.