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

274 lines (205 loc) • 9.31 kB
--- name: review-and-commit description: "[prprompts] Validate and commit changes - PRPROMPTS compliance, security checks, tests" category: Automation version: 4.0.0 tags: [prprompts, automation, git, validation, security] badge: NEW --- # /review-and-commit - Validate & Commit Changes āœ… **v4.0 Automation** - Comprehensive validation and git commit workflow. Validates PRPROMPTS compliance, runs security checks, ensures tests pass, and creates descriptive commit messages. ## Usage ```bash /review-and-commit ``` ## What It Does Runs a comprehensive validation pipeline before committing: ### 1. PRPROMPTS Compliance Check - **Architecture Validation:** Verifies Clean Architecture structure - **Pattern Adherence:** Checks BLoC, Repository, Use Case patterns - **Naming Conventions:** Validates file/class naming standards - **Documentation:** Ensures code comments and README updates ### 2. Security Audit - **Dependency Scan:** Checks for vulnerable packages - **Code Analysis:** Identifies potential security issues - **Sensitive Data:** Scans for hardcoded secrets/API keys - **Encryption:** Validates PHI/PII encryption patterns - **Authentication:** Checks JWT/OAuth2 implementation ### 3. Code Quality - **Static Analysis:** `flutter analyze` with strict rules - **Linting:** Follows analysis_options.yaml rules - **Formatting:** `dart format` compliance - **Code Complexity:** Cyclomatic complexity checks ### 4. Testing - **Unit Tests:** All unit tests must pass - **Widget Tests:** Widget tests must pass - **Integration Tests:** E2E tests must pass (if configured) - **Coverage:** Must meet 85%+ threshold ### 5. Compliance Validation - **HIPAA:** PHI encryption, audit logging, access controls - **PCI-DSS:** Payment data handling, tokenization - **GDPR:** Data privacy, consent management - **Custom:** Project-specific compliance rules ### 6. Git Commit - **Staged Files:** Reviews what will be committed - **Commit Message:** Auto-generates descriptive message - **Conventional Commits:** Follows conventional commit format - **Branch Check:** Warns if committing to main/master ## Example Session ``` /review-and-commit šŸ” Validating changes before commit... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1. PRPROMPTS Compliance Check ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ āœ“ Clean Architecture structure (data/domain/presentation) āœ“ BLoC pattern correctly implemented āœ“ Repository pattern with offline-first āœ“ Use cases follow single responsibility āœ“ File naming conventions āœ“ Code documentation (87% coverage) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2. Security Audit ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ āœ“ Dependency scan (0 vulnerabilities) āœ“ No hardcoded secrets found āœ“ PHI encrypted with AES-256-GCM āœ“ JWT RS256 implementation correct āœ“ Certificate pinning configured āœ“ Biometric auth secured ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3. Code Quality ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ āœ“ flutter analyze (0 issues) āœ“ dart format (all files formatted) āœ“ Cyclomatic complexity (max: 8, avg: 4.2) āœ“ No duplicate code detected ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4. Testing ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Running tests... āœ“ Unit tests: 127 passed, 0 failed āœ“ Widget tests: 43 passed, 0 failed āœ“ Integration tests: 12 passed, 0 failed āœ“ Coverage: 87.3% (target: 85%) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5. Compliance Validation (HIPAA) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ āœ“ PHI encryption at rest (AES-256-GCM) āœ“ PHI encryption in transit (TLS 1.3) āœ“ Audit logging enabled āœ“ Access controls implemented āœ“ Minimum necessary access principle āœ“ User authentication (JWT RS256) āœ“ Session timeout (15 min) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ āœ… All Validation Gates Passed! šŸ“‹ Changes to commit: Modified files: lib/features/appointments/ (23 files) test/features/appointments/ (12 files) IMPLEMENTATION_PLAN.md New files: 35 files (2,847 lines) Deleted files: 0 files ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ šŸ“ Generated Commit Message: feat: implement appointment scheduling feature - Add appointment booking, viewing, canceling, rescheduling - Offline-first sync with Hive local storage - Real-time updates via WebSocket - 87.3% test coverage (182 tests) - HIPAA compliant (PHI encryption, audit logs) - BLoC state management with 4 events, 3 states - Clean Architecture (data/domain/presentation) Security: - PHI encrypted with AES-256-GCM - JWT RS256 authentication required - Role-based access control (RBAC) - Audit logging for all actions Testing: - 127 unit tests - 43 widget tests - 12 integration tests - 87.3% code coverage Fixes: #42 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Accept this commit message? (y/n/edit) > y šŸ“¦ Committing changes... āœ“ git add . āœ“ git commit -m "..." āœ“ Commit created: abc1234 āš ļø You are on branch: feature/appointments To push: git push origin feature/appointments šŸŽ‰ Review and commit complete! Next Steps: 1. Push changes: git push 2. Create PR: gh pr create 3. Continue: /implement-next or /full-cycle ``` ## Validation Gates All gates must pass (or be explicitly overridden): | Gate | Requirement | Override | |------|-------------|----------| | **PRPROMPTS Compliance** | 100% architectural patterns | `--skip-prprompts-check` | | **Security Audit** | 0 vulnerabilities | `--allow-security-warnings` | | **Code Quality** | 0 analysis issues | `--allow-warnings` | | **Tests** | All tests pass | `--skip-tests` (not recommended) | | **Coverage** | ≄85% | `--allow-low-coverage` | | **Compliance** | All rules pass | `--skip-compliance` | ## Commit Message Format Follows [Conventional Commits](https://www.conventionalcommits.org/): ``` <type>(<scope>): <subject> <body> <footer> ``` **Types:** - `feat:` New feature - `fix:` Bug fix - `refactor:` Code refactoring - `test:` Adding/updating tests - `docs:` Documentation - `chore:` Maintenance - `perf:` Performance improvement - `security:` Security fix ## Options | Option | Description | |--------|-------------| | `--skip-tests` | Skip test validation (not recommended) | | `--allow-warnings` | Allow analyzer warnings | | `--skip-compliance` | Skip compliance checks | | `--no-push` | Don't prompt to push after commit | | `--amend` | Amend previous commit | | `--edit` | Edit commit message before committing | ## Security Checks Scans for common security issues: - āŒ Hardcoded API keys/secrets - āŒ Hardcoded passwords - āŒ SQL injection vulnerabilities - āŒ XSS vulnerabilities - āŒ Insecure random number generation - āŒ Weak cryptography - āŒ Unsafe deserialization - āŒ Missing input validation - āŒ Insecure file permissions - āŒ Exposed sensitive logs ## Requirements - **Git:** Repository must be initialized - **Tests:** Test infrastructure must exist - **Flutter:** Flutter SDK installed ## Related Commands - `/implement-next` - Implement next feature - `/full-cycle` - Auto-implement multiple features - `/qa-check` - Comprehensive compliance audit - `/bootstrap-from-prprompts` - Initial setup ## Best Practices 1. **Run Before Every Commit:** Ensure code quality 2. **Don't Override Gates:** Fix issues instead of skipping 3. **Review Message:** Ensure commit message is descriptive 4. **Check Branch:** Don't commit directly to main/master 5. **Push Frequently:** Push after each successful commit --- **Powered by PRPROMPTS v4.0** | **Quality Assurance** | [Docs](https://github.com/Kandil7/prprompts-flutter-generator#readme)