1.9 KiB
1.9 KiB
name, description
| name | description |
|---|---|
| fix-compile | Diagnose and fix compilation errors systematically. Use when `mvn compile` or `npm run build:dev` fails. |
Systematically diagnose and fix compilation errors following the 4-stage debugging process:
Stage 1: Root cause investigation
- Read the FULL error message (stack trace, line numbers, error codes)
- Identify the error type:
- Java: syntax, type mismatch, missing import, duplicate method, signature conflict
- Vue/JS: syntax, import error, TypeScript type, SCSS bracket mismatch
- Check recent changes:
git diff HEAD~5to see what changed - For Java errors: check if the method/class already exists elsewhere (Iron Law 9)
- For Vue errors: check SCSS bracket closure (Iron Law 30)
Stage 2: Pattern analysis
- Search for similar working code:
rg "similar_pattern" --type java --type vue - Compare with working examples in the same codebase
- Check if dependencies are correctly imported
Stage 3: Hypothesis and test
- Form ONE hypothesis: "I believe X is the root cause because Y"
- Make the MINIMAL change to test it
- If it works → Stage 4
- If not → new hypothesis (max 3 attempts before asking user)
Stage 4: Implement fix
- Apply the fix
- Run the verification command again:
- Backend:
mvn clean compile -DskipTests - Frontend:
npm run build:dev
- Backend:
- Confirm zero errors before declaring success
Common error patterns in this codebase:
- Duplicate method: Check all Service implementations for the same method
- Missing import: Verify package structure matches
com.healthlink.his.web.{module} - Type mismatch: Check DTO field types (Iron Law: DTO field type defense)
- SCSS bracket: Count
{and}in<style lang="scss" scoped>blocks - Flyway conflict: Check migration version numbers in
healthlink-his-application/src/main/resources/db/migration/
After fixing:
Run /verify to ensure the fix didn't break anything else.