| name | composewebview-code-review |
| description | Performs code quality checks and reviews for ComposeWebView. Validates expect/actual implementations, KDoc coverage, Spotless formatting, and multiplatform patterns. Use when reviewing PRs, checking code quality, or validating new features. |
ComposeWebView Code Review & Quality
This skill automates code quality checks and assists with pull request reviews for the ComposeWebView multiplatform library.
Quick Review
Run complete review workflow:
bash .agent/skills/code-review/scripts/review_checklist.sh
This executes all quality checks: formatting, expect/actual validation, KDoc coverage, and tests.
Review Categories
1. Code Formatting
Check formatting (non-destructive):
./gradlew spotlessCheck
Auto-fix formatting:
./gradlew spotlessApply
Spotless enforces ktlint rules. REQUIRED before all commits.
2. Multiplatform Completeness
Check expect/actual pairs:
bash .agent/skills/code-review/scripts/check_expect_actual.sh
Verifies:
- Every
expectdeclaration has correspondingactualimplementations - All platforms (Android, iOS, Desktop, Web) are covered
- No orphaned
actualdeclarations
3. Documentation Coverage
Verify KDoc:
bash .agent/skills/code-review/scripts/verify_kdoc.sh
Checks:
- All
publicAPIs have KDoc comments - KDoc includes
@paramand@returnwhere applicable - No placeholder documentation (e.g., "TODO")
4. Testing Coverage
Ensure tests exist for:
- Common functionality in
commonTest - Platform-specific features in platform test sources
- Critical paths (WebView loading, JS bridge, state management)
Run tests:
bash .agent/skills/development/scripts/test_all.sh
5. Architecture Compliance
Verify adherence to project patterns:
- State management via
WebViewState(see.agent/knowledge/architecture.md) - Controller separation via
WebViewController - Proper platform abstraction (expect/actual)
See reference/common_patterns.md for patterns.
Review Checklists
Feature Implementation
Copy and work through: checklists/feature_checklist.md
Quick checklist:
- [ ] Defined in commonMain with expect
- [ ] Implemented in all 4 platforms (actual)
- [ ] Public APIs have KDoc with @param/@return
- [ ] Tests added in commonTest and platform tests
- [ ] Spotless formatting applied
- [ ] Updated relevant documentation
- [ ] Follows existing patterns (State/Controller)
- [ ] Platform constraints considered
Pull Request Review
Copy and work through: checklists/pr_checklist.md
Essential checks:
- Code quality (formatting, naming, structure)
- Multiplatform completeness
- Test coverage
- Documentation updates
- Breaking change assessment
Multiplatform Validation
For complex platform work: checklists/multiplatform_checklist.md
Platform-specific considerations:
- Android: WebView API usage, permissions
- iOS: WKWebView constraints, message handlers
- Desktop: CEF initialization, threading
- Web: IFrame limitations, postMessage bridge
Automated Checks
Complete Review Script
bash .agent/skills/code-review/scripts/review_checklist.sh
Checks performed:
- ✅ Code formatting (Spotless)
- ✅ Expect/actual completeness
- ⚠️ KDoc coverage (warning only)
- ✅ All tests passing
Exit codes:
0- All checks passed1- Critical issues found (formatting, tests, expect/actual)
Individual Checks
Expect/Actual:
bash .agent/skills/code-review/scripts/check_expect_actual.sh
KDoc Coverage:
bash .agent/skills/code-review/scripts/verify_kdoc.sh
Formatting:
bash .agent/skills/development/scripts/format_check.sh
Common Issues & Solutions
See reference/review_guidelines.md for:
- Common multiplatform pitfalls
- Platform-specific gotchas (WKWebView, CEF)
- Performance considerations
- Breaking change checklist
Quick Fixes
Formatting issues:
./gradlew spotlessApply
Missing actual implementation:
- Identify the
expectdeclaration - Add
actualto all platform source sets - Verify:
bash .agent/skills/code-review/scripts/check_expect_actual.sh
Missing KDoc:
/**
* Brief description of what this does.
*
* @param param Description of parameter
* @return Description of return value
*/
fun publicFunction(param: String): Result
Review Workflow
Before Submitting PR
Format code:
./gradlew spotlessApplyRun full review:
bash .agent/skills/code-review/scripts/review_checklist.shFix any issues reported
Run tests:
bash .agent/skills/development/scripts/test_all.shCommit and push
During Code Review
Check PR against checklist:
- Use pr_checklist.md
Verify multiplatform completeness:
bash .agent/skills/code-review/scripts/check_expect_actual.shReview architectural patterns:
- Refer to common_patterns.md
- Check
.agent/knowledge/architecture.md
Test locally:
git checkout pr-branch bash .agent/skills/development/scripts/test_all.sh
Best Practices
Code Quality
Consistent naming: Follow Kotlin conventions
- Classes:
PascalCase - Functions/properties:
camelCase - Constants:
UPPER_SNAKE_CASE
- Classes:
Visibility modifiers:
public- External APIinternal- Internal implementationsprivate- Encapsulated logic
Immutability: Prefer
valovervarNull safety: Avoid
!!, use safe calls?.or?:
Multiplatform
- Keep common code platform-agnostic
- Use expect/actual for platform specifics
- Document platform constraints
- Test on all platforms
Documentation
- All public APIs must have KDoc
- Include examples in documentation
- Document platform differences
- Keep docs up-to-date with code
CI/CD Integration
These checks can be integrated into GitHub Actions:
- name: Code Review Checks
run: bash .agent/skills/code-review/scripts/review_checklist.sh
Scripts Reference
review_checklist.sh
Comprehensive review running all checks. Returns non-zero exit code if critical issues found.
check_expect_actual.sh
Validates that all expect declarations have actual implementations on all platforms.
verify_kdoc.sh
Checks KDoc coverage for public APIs. Warning-level (doesn't fail build).
Related Resources
- Development: Development Skill
- Architecture:
.agent/knowledge/architecture.md - Code Style:
.agent/knowledge/code_style.md - Workflows:
.agent/knowledge/commands.md
Troubleshooting
Review Script Fails
Check output for specific failure:
- Formatting → Run
./gradlew spotlessApply - Tests → Fix failing tests
- Expect/actual → Implement missing actuals
False Positives
Expect/actual check counts declarations - may show warnings for:
- Internal implementations
- Platform-specific extensions
Review build errors for actual issues.
KDoc Warnings
Not all public APIs require extensive KDoc (e.g., simple getters). Use judgment, but prefer documentation.
Use this skill to maintain high code quality and consistent patterns across the ComposeWebView codebase.