Comprehensive quality automation for JavaScript/React, Python, and PHP projects
Intelligent auto-fix, risk-based testing enforcement, unified quality pipelines, and AI-powered PR descriptions that eliminate manual code review bottlenecks while maintaining high standards.
bash setup-quality-automation.shThis will:
- π Detect JavaScript, Python, PHP, and React languages
- π§© Copy
.eslintrc.*,.prettierrc, and other required configs - π Install pre-commit hooks
- π€ Set up GitHub Actions workflows
- π§ Configure AI-powered PR analysis
To enable automatic PR descriptions and AI code review:
- Get OpenAI API Key: Visit OpenAI API
- Add to Repository Secrets:
- Go to:
SettingsβSecrets and variablesβActions - Add secret:
OPENAI_API_KEYwith your API key
- Go to:
- That's it! PR Agent will automatically generate descriptions for new PRs
VS Code:
- π Install: ESLint, Prettier, GitLens
- βοΈ Enable: Format on save, auto-fix on save
PhpStorm/WebStorm:
- β Enable: ESLint, Prettier, auto-format
- π Configure: Save actions for formatting
- Setup Script (
setup-quality-automation.sh) - Intelligent language detection and configuration - GitHub Workflows - Main quality pipeline, auto-fix, test enforcement, and AI PR analysis
- Pre-commit Hooks - Local validation before code reaches remote
- Development Scripts - Quality check and auto-fix utilities
- IDE Configurations - VS Code and JetBrains setup
- π§ AI PR Agent - Automatic PR descriptions, code review, and suggestions
- Triggers: Every new PR automatically gets a comprehensive description
- Content: Summary, walkthrough, type classification, and labels
- Smart: Preserves original user content while enhancing with AI insights
- AI Review: Intelligent code analysis with security and best practice suggestions
- Code Improvements: Automated suggestions for performance and readability
- Chat Interface: Ask questions about your code with
/ask <question>
Use these commands in PR comments to trigger AI analysis:
/describe # Generate/regenerate PR description
/review # Comprehensive AI code review
/improve # Code improvement suggestions
/ask # Ask questions about the code
/test # Test generation assistance
/help # Show available commands- Tools: ESLint, Prettier, TypeScript
- Auto-fixes: Quote consistency, import sorting, formatting
- Never touches: Variable declarations, function parameters, JSX logic
- Tools: Black, isort, flake8, pytest
- Auto-fixes: Line length, import organization, PEP8 formatting
- Never touches: Function signatures, type hints, algorithm logic
- Tools: PHP CS Fixer, PHPStan, PHPUnit
- Auto-fixes: PSR12 compliance, spacing, array formatting
- Never touches: Variable types, method signatures, business logic
Paths: auth/, payment/, security/, admin/
Requirements: Comprehensive testing including unit, integration, and security tests
Paths: api/, components/, services/, models/
Requirements: Standard testing with unit and integration tests
Paths: Documentation, configuration, README changes
Requirements: Testing optional but recommended
# Preview auto-fixes without applying
npm run auto-fix:preview # JavaScript/TypeScript
./scripts/auto-fix.sh # All languages
# Apply safe formatting fixes
npm run auto-fix:apply # JavaScript/TypeScript
black . && isort . # Python
php-cs-fixer fix # PHP
# Run comprehensive quality checks
npm run quality:check # JavaScript/TypeScript
./scripts/quality-check.sh # All languages
# Test coverage
npm run test:coverage # JavaScript/TypeScript
pytest --cov=src # Python
phpunit --coverage-html coverage # PHP
# AI PR Commands (use in PR comments)
/describe # Generate PR description
/review # AI code review
/improve # Code suggestions
/ask "How does this work?" # Ask AI about code# Temporarily disable
git config AUTO_FIX_DISABLED true
# Re-enable
git config AUTO_FIX_DISABLED false
# In PR description, add:
# @testException - Docs only changes
# @autoFixDisabled - Manual formatting required- What: Automatically fixes safe formatting issues
- How: Pre-commit hooks + GitHub Actions validation
- Safety: Triple validation, automatic rollback on failure
- Scope: Only cosmetic changes, never business logic
- What: Determines testing requirements based on code changes
- How: Analyzes file paths and change patterns
- Flexibility: Configurable rules with escape hatches
- Guidance: Clear explanations for testing requirements
- What: Single, fast pipeline for all quality checks
- How: Parallel execution with smart dependency management
- Integration: Works with SonarCloud, coverage tools, security scanners
- Feedback: Comprehensive PR comments and status checks
- What: OpenAI-powered code analysis and description generation
- How: Analyzes code changes and generates human-readable insights
- Features: Auto-descriptions, code review, improvement suggestions
- Customization: Configurable via
.pr_agent.tomlfor your team's needs
Target Improvements:
- 60% reduction in code review time
- 25% faster PR cycle time
- 95% consistency in code formatting
- 40% reduction in style-related technical debt
- π 80% improvement in PR description quality
Quality Indicators:
- β Green checkmarks in PR status checks
- π€ Auto-fix bot commits with emoji
- π Fewer style comments in code reviews
- π’ Coverage reports show green percentages
- π§ AI-generated PR descriptions and reviews
| Issue | Solution |
|---|---|
| β Auto-fix validation failed | Run npm run auto-fix:preview to see changes |
| β Tests required but missing | Check tier classification, add appropriate tests |
| β Pipeline taking too long | Verify workflows run in parallel, contact DevOps |
| β Manual style fixes needed | Check if auto-fix is disabled, run local scripts |
| π€ AI not generating descriptions | Check OPENAI_API_KEY secret is set correctly |
| π€ AI commands not working | Ensure PR Agent workflow has proper permissions |
- π Comprehensive Guide
- π¬ #code-quality Slack channel
- π₯ Pair programming sessions
- π Share this template in PR comments
- π€ Use
/helpcommand in any PR for AI assistance
- Code Safety: Only touches formatting, never business logic
- Access Control: Minimal GitHub bot permissions
- Audit Trail: Complete git history of all changes
- Security Scanning: Automatic vulnerability detection
- Manual Override: Always available for edge cases
- π AI Privacy: OpenAI processes code temporarily, no permanent storage
- Fork or download this repository
- Copy files to your project:
# Copy core files cp setup-quality-automation.sh your-project/ cp -r .github/workflows your-project/.github/ cp -r scripts your-project/ cp QUALITY_AUTOMATION.md your-project/ cp .pr_agent.toml your-project/ # AI configuration
- Add OpenAI API Key to repository secrets
- Run setup:
cd your-project bash setup-quality-automation.sh - Customize configurations for your specific needs
- Modify
.eslintrc.js,.prettierrc,pyproject.toml,.php-cs-fixer.php - Adjust tier classification in
.github/workflows/test-enforcement.yml - Update excluded paths in workflow files
- Add language-specific tools as needed
- π€ Customize AI behavior in
.pr_agent.toml
- π Infrastructure setup
- π₯ Team preparation
- π Pilot project selection
- π€ AI PR Agent setup and testing
- π§ͺ Limited deployment (3-5 repositories)
- π Performance monitoring
- πΊοΈ Feedback collection and iteration
- π AI description quality assessment
- π Team-by-team expansion
- π All remaining repositories
- πΉ Metrics monitoring
- π― AI prompt optimization
- π€ Advanced features
- π Custom analytics
- π Additional tool integrations
- π§ Advanced AI features and fine-tuning
- Quality Automation Guide - Comprehensive developer guide
- Setup Script - Automated configuration
- Workflow Files - GitHub Actions implementation
- Development Scripts - Local development utilities
- AI Configuration - PR Agent customization
Example for team of 10 developers:
Current: 5 hours/week/developer on style issues = 50 hours/week
After automation: 2 hours/week/developer = 20 hours/week
AI PR descriptions save: 0.5 hours/week/developer = 5 hours/week
Total savings: 35 hours/week Γ $100/hour = $3,500/week = $182,000/year
Implementation cost: ~$20,000 (3 weeks Γ developer cost)
OpenAI API cost: ~$100/month = $1,200/year
ROI: 800%+ annual return
- GitHub Repository: Quality Automation Template
- Issues & Feedback: GitHub Issues
- Discussions: GitHub Discussions
- PR Agent Documentation: Codium-ai/pr-agent
β
Eliminate style discussions in code reviews
β
Reduce review time by 60%
β
Ensure consistent quality across all repositories
β
Accelerate feature delivery
β
Scale quality standards as teams grow
β
Focus developers on business logic, not formatting
β
π§ Generate professional PR descriptions automatically
β
π Get AI-powered code review insights
Ready to transform your development workflow with AI?
# 1. Add OpenAI API key to repository secrets
# 2. Run setup
bash setup-quality-automation.sh
# 3. Create a PR and watch the magic happen! πKeep it simple. Keep it visual. Keep it actionable. Keep it intelligent!