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
- Collect information: problem description, occurrence location, expected result, actual result, environment/version, logs/screenshots.
- Reproduce: reproduce strictly according to the user's steps; if it fails, immediately ask follow-up questions and do not proceed to fixing.
- Locate: narrow the scope and find the root cause or the smallest suspicious range.
- Fix: minimal changes; prioritize reusing existing modules/code.
- Unit testing: write an automated test script for this BUG to verify the effectiveness of the fix and prevent regression.
- Verification: must include "detailed manual operation steps", explained step by step.
- 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:
- Where does it occur (page/feature)?
- What operations did you perform (as detailed as possible for each step)?
- 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
-
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).
-
Manual verification: You must output "manual verification steps", in the format of step-by-step items (example):
- Open the application and go to the XXX page
- Click the XXX button
- Enter XXX in the XXX input box
- Observe whether XXX meets expectations
Report template
- Check whether the
docs/BUG修复文档/directory exists; if it does not exist, create it automatically. - Copy
assets/bugfix-report-template.mdto that directory, suggested naming:YYYYMMDD-HHMM-问题简述.md
After filling it in, state the report path in the reply.