UNPKG

prprompts-flutter-generator

Version:

AI-powered Flutter development with full automation + official extension support - Generate 32 security-audited guides & auto-implement in 2-3 hours. NEW v5.1: Official Claude Code plugin with hooks, Gemini TOML commands, Qwen MCP settings. Features: Comp

410 lines (319 loc) β€’ 13.2 kB
--- name: qa-check description: "[prprompts] Comprehensive compliance audit - generates QA_REPORT.md with score" category: Automation version: 4.0.0 tags: [prprompts, qa, compliance, audit, security] badge: NEW --- # /qa-check - Comprehensive Compliance Audit πŸ” **v4.0 Automation** - Complete quality assurance and compliance audit. Generates detailed `QA_REPORT.md` with scores, findings, and recommendations. ## Usage ```bash /qa-check ``` Or with specific compliance framework: ```bash /qa-check --framework hipaa /qa-check --framework pci-dss /qa-check --framework gdpr ``` ## What It Does Performs comprehensive audit across 8 categories: ### 1. Architecture Compliance (15%) - Clean Architecture structure - Feature separation - Dependency flow (presentation β†’ domain β†’ data) - Layer isolation ### 2. Code Quality (15%) - Static analysis (flutter analyze) - Linting rules - Code formatting - Complexity metrics - Duplicate code detection ### 3. Testing (20%) - Test coverage (β‰₯85%) - Unit test quality - Widget test coverage - Integration test coverage - Test naming conventions ### 4. Security (20%) - Dependency vulnerabilities - Hardcoded secrets - Encryption implementation - Authentication flows - Authorization checks - Input validation - Secure storage usage ### 5. Compliance (15%) - HIPAA rules (if applicable) - PCI-DSS rules (if applicable) - GDPR rules (if applicable) - Custom compliance rules - Audit logging - Data retention policies ### 6. Performance (5%) - App startup time - Frame rendering (60fps) - Memory usage - Network efficiency - Build size ### 7. Accessibility (5%) - Semantic labels - Screen reader support - Color contrast - Font scaling - Keyboard navigation ### 8. Documentation (5%) - Code comments - README completeness - API documentation - Architecture diagrams - Deployment guides ## Example Session ``` /qa-check πŸ” Starting Comprehensive QA Audit... Project: HealthTracker Pro Compliance Frameworks: HIPAA, GDPR Date: 2025-01-15 14:23:45 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1. Architecture Compliance (15%) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ βœ“ Clean Architecture structure βœ“ Feature modules properly separated βœ“ Dependency flow correct (presentation β†’ domain β†’ data) βœ“ No circular dependencies βœ“ Repository pattern implemented βœ“ Use case single responsibility ⚠ Minor: 2 presentation files importing data layer directly Score: 14/15 (93%) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2. Code Quality (15%) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Running flutter analyze... βœ“ 0 errors βœ“ 2 warnings (acceptable) βœ“ All files formatted (dart format) βœ“ Cyclomatic complexity avg: 4.2 (max: 8, target: <10) βœ“ No duplicate code detected βœ“ Naming conventions followed Warnings: lib/features/auth/presentation/pages/login_page.dart:47 - Prefer const constructors Score: 14/15 (93%) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3. Testing (20%) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Running tests... βœ“ Unit tests: 247 passed, 0 failed βœ“ Widget tests: 83 passed, 0 failed βœ“ Integration tests: 23 passed, 0 failed Coverage Analysis: βœ“ Overall: 87.3% (target: 85%) - lib/core/: 91.2% - lib/features/auth/: 89.4% - lib/features/appointments/: 87.1% - lib/features/messaging/: 85.3% - lib/features/records/: 82.7% ⚠ Below target βœ“ Test naming conventions βœ“ Arrange-Act-Assert pattern βœ“ Mock usage appropriate Issues: - Medical records feature below 85% coverage Score: 18/20 (90%) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4. Security (20%) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Dependency Scan: βœ“ 0 critical vulnerabilities βœ“ 0 high vulnerabilities βœ“ 2 medium vulnerabilities (non-blocking) Code Security Scan: βœ“ No hardcoded secrets βœ“ No hardcoded passwords/API keys βœ“ PHI encrypted with AES-256-GCM βœ“ Tokens stored in secure_storage βœ“ JWT RS256 implementation correct βœ“ Certificate pinning configured βœ“ Biometric auth secured βœ“ Input validation on all forms βœ“ SQL injection prevention (parameterized queries) βœ“ XSS prevention (HTML sanitization) Authentication & Authorization: βœ“ JWT token expiry: 15 min (acceptable) βœ“ Refresh token rotation implemented βœ“ Role-based access control (RBAC) βœ“ Multi-factor authentication (MFA) supported Issues: - 2 medium vulnerabilities in dependencies: 1. http 0.13.5 (update to 1.1.0) 2. intl 0.17.0 (update to 0.18.0) Score: 18/20 (90%) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5. Compliance - HIPAA (15%) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Technical Safeguards: βœ“ Access Controls (Β§164.312(a)(1)) - Unique user identification - Emergency access procedure - Automatic logoff (15 min) - Encryption and decryption βœ“ Audit Controls (Β§164.312(b)) - All PHI access logged - Audit logs encrypted - Log retention: 6 years βœ“ Integrity Controls (Β§164.312(c)(1)) - Mechanism to authenticate PHI - Digital signatures on records βœ“ Transmission Security (Β§164.312(e)(1)) - TLS 1.3 for data in transit - End-to-end encryption for messaging Physical Safeguards: βœ“ Device and Media Controls (Β§164.310(d)(1)) - Data disposal (secure deletion) - Media re-use (data wiping) Administrative Safeguards: ⚠ Security Management Process (Β§164.308(a)(1)) - Risk analysis documented βœ“ - Risk management plan βœ“ - Sanction policy ⚠ Missing - Information system activity review βœ“ Issues: - Missing sanction policy documentation Score: 14/15 (93%) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6. Performance (5%) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ βœ“ Cold start time: 1.8s (target: <2s) βœ“ Frame rate: 60fps (no jank detected) βœ“ Memory usage: 147MB avg (acceptable for healthcare app) βœ“ Network efficiency: Request caching implemented βœ“ App size: 23.4MB (Android APK) βœ“ Build time: 42s (release build) Score: 5/5 (100%) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7. Accessibility (5%) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ βœ“ Semantic labels on all interactive widgets βœ“ Screen reader tested (TalkBack/VoiceOver) βœ“ Color contrast ratio β‰₯4.5:1 βœ“ Font scaling supported (up to 200%) ⚠ Keyboard navigation incomplete (2 screens missing) Score: 4/5 (80%) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8. Documentation (5%) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ βœ“ README.md comprehensive βœ“ API documentation (35% of public APIs) βœ“ Architecture diagram exists βœ“ Deployment guide exists ⚠ Code comment coverage: 67% (target: 80%) Score: 4/5 (80%) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🎯 Overall QA Score: 91/100 (91%) Grade: A ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ πŸ“Š Category Breakdown: 1. Architecture Compliance: 93% [β–“β–“β–“β–“β–“β–“β–“β–“β–“β–‘] 2. Code Quality: 93% [β–“β–“β–“β–“β–“β–“β–“β–“β–“β–‘] 3. Testing: 90% [β–“β–“β–“β–“β–“β–“β–“β–“β–“β–‘] 4. Security: 90% [β–“β–“β–“β–“β–“β–“β–“β–“β–“β–‘] 5. Compliance (HIPAA): 93% [β–“β–“β–“β–“β–“β–“β–“β–“β–“β–‘] 6. Performance: 100% [β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“] 7. Accessibility: 80% [β–“β–“β–“β–“β–“β–“β–“β–“β–‘β–‘] 8. Documentation: 80% [β–“β–“β–“β–“β–“β–“β–“β–“β–‘β–‘] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ πŸ”΄ Critical Issues (0): None 🟑 Warnings (5): 1. 2 presentation files importing data layer directly 2. Medical records feature test coverage: 82.7% (target: 85%) 3. 2 medium dependency vulnerabilities 4. Missing HIPAA sanction policy documentation 5. Code comment coverage: 67% (target: 80%) βœ… Recommendations: 1. Fix layer violations in presentation files 2. Add tests to medical records feature (need 2.3% more) 3. Update dependencies: http, intl 4. Document sanction policy in docs/COMPLIANCE.md 5. Add code comments to public APIs 6. Complete keyboard navigation for 2 screens ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ πŸ“ Report saved to: QA_REPORT.md ✨ Great work! Your app is production-ready with minor improvements needed. Next Steps: 1. Review QA_REPORT.md 2. Fix warnings (estimated: 2 hours) 3. Re-run /qa-check to verify fixes 4. Deploy to staging environment ``` ## Generated Report Creates `QA_REPORT.md` with: - **Executive Summary:** Overall score and grade - **Category Scores:** Detailed breakdown with progress bars - **Critical Issues:** Must-fix items - **Warnings:** Should-fix items - **Recommendations:** Best practice improvements - **Detailed Findings:** Per-category analysis - **Compliance Matrices:** Framework-specific checklists - **Trend Analysis:** Comparison with previous audits - **Action Items:** Prioritized TODO list ## Grading Scale | Score | Grade | Status | |-------|-------|--------| | 95-100% | A+ | Excellent - Production ready | | 90-94% | A | Great - Minor improvements | | 85-89% | B+ | Good - Some work needed | | 80-84% | B | Acceptable - Several issues | | 75-79% | C+ | Fair - Significant work needed | | 70-74% | C | Passing - Major improvements required | | <70% | F | Failing - Not production ready | ## Compliance Frameworks ### HIPAA (Healthcare) - Technical safeguards - Physical safeguards - Administrative safeguards - Breach notification - Business associate agreements ### PCI-DSS (Payment Cards) - Build and maintain secure network - Protect cardholder data - Maintain vulnerability management - Implement strong access controls - Monitor and test networks - Maintain information security policy ### GDPR (Privacy) - Lawfulness, fairness, transparency - Purpose limitation - Data minimization - Accuracy - Storage limitation - Integrity and confidentiality - Accountability ## Options | Option | Description | |--------|-------------| | `--framework <name>` | Focus on specific compliance framework | | `--category <name>` | Audit specific category only | | `--verbose` | Include detailed explanations | | `--fix-suggestions` | Generate code fixes for issues | | `--compare <tag>` | Compare with previous audit | ## Requirements - **Flutter SDK:** Installed - **Project:** Must be a Flutter project - **Tests:** Test infrastructure recommended ## Related Commands - `/review-and-commit` - Pre-commit validation - `/implement-next` - Implement features - `/full-cycle` - Auto-implement multiple features - `/bootstrap-from-prprompts` - Initial setup ## Automation Integration Use in CI/CD: ```yaml - name: QA Check run: gemini qa-check --ci --min-score 85 ``` Fails build if score < 85%. --- **Powered by PRPROMPTS v4.0** | **Quality Assurance** | [Docs](https://github.com/Kandil7/prprompts-flutter-generator#readme)