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
Markdown
---
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)