$npx -y skills add CoreyLyn/harmonyos-skills --skill harmonyos-reviewHarmonyOS code review skill for auditing ArkTS projects against official Huawei development guidelines and security best practices. Use when reviewing HarmonyOS applications for: (1) Security compliance (hardcoded credentials, encryption, input validation), (2) ArkTS language sta
| 1 | # HarmonyOS Code Review |
| 2 | |
| 3 | Audit HarmonyOS ArkTS projects against official Huawei guidelines. Generate prioritized fix reports. |
| 4 | |
| 5 | ## Review Process |
| 6 | |
| 7 | ### 1. Quick Scan |
| 8 | |
| 9 | Run in parallel to identify critical issues: |
| 10 | |
| 11 | ```bash |
| 12 | # Hardcoded credentials |
| 13 | grep -r "password\|secret\|key\|token" --include="*.json5" --include="*.ets" |
| 14 | |
| 15 | # console instead of hilog |
| 16 | grep -r "console\." --include="*.ets" | grep -v "hilog" |
| 17 | |
| 18 | # async forEach anti-pattern |
| 19 | grep -r "forEach.*await" --include="*.ets" |
| 20 | |
| 21 | # API version check |
| 22 | grep -r "compileSdkVersion\|targetSdkVersion" --include="*.json5" |
| 23 | |
| 24 | # Deprecated API usage |
| 25 | grep -r "@Deprecated\|deprecated" --include="*.ets" |
| 26 | ``` |
| 27 | |
| 28 | ### 2. Deep Analysis |
| 29 | |
| 30 | Apply checklist from [references/checklist.md](references/checklist.md) per category. |
| 31 | |
| 32 | ### 3. Generate Report |
| 33 | |
| 34 | Use [references/report-template.md](references/report-template.md) as base structure. Include: |
| 35 | - Executive summary (issue counts by priority) |
| 36 | - Detailed findings with `file:line` references |
| 37 | - Prioritized fix recommendations |
| 38 | - Overall grade (A-F) |
| 39 | |
| 40 | ## References |
| 41 | |
| 42 | - **Review checklist**: [references/checklist.md](references/checklist.md) - All review criteria by category |
| 43 | - **Official docs**: [references/official-docs.md](references/official-docs.md) - Huawei guidelines, Kit usage, API patterns |
| 44 | - **Report template**: [references/report-template.md](references/report-template.md) - Output format |
| 45 | |
| 46 | ## Issue Priority |
| 47 | |
| 48 | - **Critical**: Blocks release, fix immediately |
| 49 | - **High**: Fix soon, affects quality |
| 50 | - **Medium**: Technical debt, consider fixing |
| 51 | - **Low**: Optional optimization |
| 52 | |
| 53 | ## Exit Criteria |
| 54 | |
| 55 | - All checklist categories reviewed |
| 56 | - Report generated at `docs/YYYY-MM-DD-review.md` |
| 57 | - Critical/high issues have fix suggestions with `file:line` references |