system bug fixer
1
总安装量
0
周安装量
#49963
全站排名
安装命令
npx skills add https://github.com/chrysaliscat/designgraduation --skill System Bug Fixer
Skill 文档
System Bug Fixer Skill
1. Objective
To rapidly identify, isolate, and resolve system anomalies such as:
- Service startup failures (Port conflicts, DB connection errors)
- Persistent “Ghost” Data (Menu items that won’t disappear)
- Logic inconsistencies between Frontend and Backend
- Caching issues (Redis, Browser, Vuex)
2. Methodology
Phase 1: The Health Check (Stop & Clear)
Before debugging a weird issue, ensure the environment is clean.
- Kill Zombie Processes:
taskkill /F /IM java.exe - Clear Ports: Check if 8080/6379 are truly free.
- Restart Middleware: Restart Redis/MySQL if data seems “stuck”.
- Flush Logs: Rename
backend.log(e.g.,backend.log.old) to ensure you are reading fresh logs.
Phase 2: Deep Log Analysis
Do not trust the UI. Trust the Logs.
- Enable Debug Logging:
- Add
log.info("DEBUG_TRACE: Variable={}", var)in critical logical paths. - If utilizing MyBatis, inspect the
==> Preparing:SQL output.
- Add
- Result Verification:
- Does
<== Total: 0match your expectation? - Did the code actually reach your
log.info? If not, checktry-catchblocks swallowing exceptions.
- Does
Phase 3: Data Integrity Verification
Code is often correct, but Data is wrong.
- Direct DB Query: Use MySQL CLI/Workbench to query the raw data.
- Example:
SELECT * FROM sys_menu WHERE menu_name LIKE '%Cart%'; - Compare
menu_idin DB vs Code Hardcoding.
- Example:
- Cache vs Source:
- Redis:
FLUSHALL(in Dev) to rule out stale permissions. - User Permissions: Logout and Re-login to refresh
Subjectprincipal.
- Redis:
Phase 4: The “Nuclear” Option (Hardcoding & Isolation)
If logic seems inexplicably skipped:
- Isolate: Create a localized test case (e.g., a specific
ifblock). - Hardcode: Temporarily hardcode IDs to confirm control.
- Example:
if (id == 2021) remove();
- Example:
- Broaden Scope: Use
toLowerCase()and.contains()instead ofequals().
3. Common Fix Patterns (RuoYi Specific)
Menu/Permission Persistence
- Symptom: Menu visible after Role revocation.
- Fix: Check
SysMenuServiceImpl.selectMenuTreeByUserId. EnsuregetChildPermsisn’t caching an old tree. Force backend restart.
Port In Use (8080)
- Symptom: “Web server failed to start”.
- Fix:
netstat -ano | findstr :8080 taskkill /PID <PID> /F
Frontend Not Updating
- Symptom: Code changed, UI stuck.
- Fix:
npm run build:prodmight be needed if not runningdev. Disable Browser Cache (DevTools -> Network -> Disable Cache).
4. Verification
After applying a fix:
- Clean Start: Restart backend.
- Clean Login: Logout -> Clear Browser Cache -> Login.
- Log Confirmation: Verify the specific log entry for the fix appears.