Phase 4: Validation & Testing Progress FIXED: - Updated fakemui-registry.ts import paths (99 import errors eliminated) - Upgraded @reduxjs/toolkit to 2.0.0 across all redux workspaces - Created fakemui/package.json with proper workspace exports - Added fakemui to root workspace configuration VERIFIED: - TanStack Query completely removed from dependencies - Redux infrastructure properly configured - Dependency tree now valid (no ELSPROBLEMS) BUILD STATUS: - Fakemui module resolution: FIXED - React-Redux version conflict: FIXED - Missing SCSS modules in fakemui: IDENTIFIED (non-blocking for Phase 4) - Workflow service references: IDENTIFIED (pre-existing, deferred to Phase 5) NEXT STEPS: - Resolve missing SCSS files in fakemui components - Address @metabuilder/workflow package references - Run unit and E2E tests - Generate Phase 4 final report Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
GitHub Workflows Documentation
This directory contains automated workflows for CI/CD, code quality, and comprehensive AI-assisted development throughout the entire SDLC.
🚦 Enterprise Gated Tree Workflow
MetaBuilder uses a Unified Enterprise Gated Pipeline that consolidates all CI/CD, deployment, and development assistance into a single workflow with clear gate visualization.
📖 Complete Guide: Enterprise Gated Workflow Documentation
Quick Overview
All PRs and deployments flow through 6 sequential gates in a single workflow:
- Gate 1: Code Quality - Prisma, TypeScript, Lint, Security (7 atomic steps)
- Gate 2: Testing - Unit, E2E, DBAL Daemon tests (3 atomic steps)
- Gate 3: Build & Package - Application build, quality metrics (2 atomic steps)
- Gate 4: Development Assistance - Architectural feedback, Copilot interaction (PR only)
- Gate 5: Staging Deployment - Automatic deployment to staging (main branch push)
- Gate 6: Production Deployment - Manual approval required (release/workflow_dispatch)
Key Benefits:
- ✅ Single unified workflow - No confusion about which pipeline runs what
- ✅ Sequential gates prevent wasted resources
- ✅ Tree structure for clear visualization of all validation steps
- ✅ Automatic merge after approval
- ✅ Conditional execution based on trigger (PR vs push vs release)
- ✅ Complete audit trail for all deployments
Pipeline Consolidation (Jan 2026)
Consolidated into gated-pipeline.yml:
- ✅
gated-ci.yml(1048 lines) - CI with gates 1-5 - ✅
gated-deployment.yml(617 lines) - Deployment workflows - ✅
development.yml(360 lines) - Development assistance
Result: Single 1287-line workflow with all functionality preserved and no duplication.
Previous Deprecated and Removed (Dec 2025):
- ❌
ci/ci.yml- Replaced by gated workflows - ❌
quality/deployment.yml- Replaced by gated workflows
See Legacy Pipeline Cruft Report for analysis.
🤖 GitHub Copilot Integration
All workflows are designed to work seamlessly with GitHub Copilot to assist throughout the Software Development Lifecycle:
- Planning Phase: Architecture review, PRD alignment, implementation guidance
- Development Phase: Continuous quality feedback, code suggestions, refactoring opportunities
- Testing Phase: Automated code review, security checks, quality validation
- Deployment Phase: Pre-deployment validation, health checks, monitoring
- Maintenance Phase: Issue triage, automated fixes, dependency management
📖 Copilot Instructions: .github/copilot-instructions.md
Workflows Overview
🚦 Enterprise Gated Workflow (Unified)
Enterprise Gated Pipeline (gated-pipeline.yml) 🆕
Triggered on: Push to main/master/develop, Pull requests, Releases, Manual dispatch, Issue comments
Consolidates: All CI/CD, deployment, and development assistance in one workflow
Structure:
- Gate 1: Code Quality - 7 validation steps
- 1.1 Prisma Validation
- 1.2 TypeScript Check (+ strict mode analysis)
- 1.3 ESLint (+ any-type detection + ts-ignore detection)
- 1.4 Security Scan (+ dependency audit)
- 1.5 File Size Check
- 1.6 Code Complexity Analysis
- 1.7 Stub Implementation Detection
- Gate 2: Testing - 3 validation steps
- 2.1 Unit Tests (+ coverage analysis)
- 2.2 E2E Tests
- 2.3 DBAL Daemon Tests
- Gate 3: Build & Package - 2 validation steps
- 3.1 Application Build (+ bundle analysis)
- 3.2 Quality Metrics (PR only)
- Gate 4: Development Assistance (PR only)
- 4.1 Code metrics analysis
- 4.2 Architectural compliance
- 4.3 Refactoring suggestions
- 4.4 Copilot interaction handler
- Gate 5: Staging Deployment (main branch push)
- Automatic deployment to staging environment
- Smoke tests and health checks
- Gate 6: Production Deployment (release/manual)
- Manual approval gate
- Production deployment with health monitoring
- Deployment tracking issue creation
Features:
- Individual validation steps for superior visualization
- Gate artifacts persisted between steps (30-day retention)
- Conditional execution based on trigger type
- Granular failure detection
- Parallel execution within gates
- Complete audit trail with JSON artifacts
- Individual step timing and status
- Sequential gate execution for efficiency
- Clear gate status reporting on PRs
- Summary report with all gate results
🔄 Supporting Workflows
Issue and PR Triage (triage.yml)
Triggered on: Issues (opened/edited/reopened) and Pull Requests (opened/reopened/synchronize/edited)
Purpose: Quickly categorize inbound work so reviewers know what to look at first.
- Auto-applies labels for type (bug/enhancement/docs/security/testing/performance) and area (frontend/backend/database/workflows/documentation)
- Sets a default priority and highlights beginner-friendly issues
- Flags missing information (repro steps, expected/actual results, versions) with a checklist comment
- For PRs, labels areas touched, estimates risk based on change size and critical paths, and prompts for test plans/screenshots/linked issues
- Mentions @copilot to sanity-check the triage with GitHub-native AI
This workflow runs alongside the gated pipeline to provide quick triage feedback.
🗑️ Legacy Workflows (Removed)
CI/CD Workflow (ci/ci.yml) - ❌ REMOVED
Status: Deprecated and removed (Dec 2025)
Reason: 100% functionality superseded by gated pipeline
Jobs: Prisma Check, Lint, Build, E2E Tests, Quality Check
Replacement: Consolidated into gated-pipeline.yml
3. Automated Code Review (pr/code-review.yml)
Triggered on: Pull request opened, synchronized, or reopened
Features:
- Analyzes code changes for security issues (eval, innerHTML, XSS risks)
- Checks for code quality issues (console.log, debugger, any types)
- Provides suggestions for improvements
- Auto-approves PRs if no blocking issues are found
- Adds appropriate labels (needs-changes, ready-for-review, has-warnings)
Review Criteria:
- ✅ Security vulnerabilities
- ✅ Code quality issues
- ✅ Type safety
- ✅ React best practices
- ✅ File size warnings
4. Auto Merge (pr/auto-merge.yml) - Updated for Gated Pipeline
Triggered on: PR approval, CI workflow completion
Features:
- Automatically merges PRs when:
- PR is approved by reviewers
- All gates pass in unified gated pipeline
- No merge conflicts
- PR is not in draft
- Automatically deletes the branch after successful merge
- Uses squash merge strategy
- Posts comments about merge status
- Updated: Now supports unified Enterprise Gated Pipeline checks
5. Issue Triage (issue-triage.yml)
Triggered on: New issues opened, issues labeled
Features:
- Automatically categorizes and labels issues:
- Type: bug, enhancement, documentation, testing, security, performance
- Priority: high, medium, low
- AI-fixable flag for automated fixes
- Posts welcome message with issue summary
- Suggests automated fix attempts for simple issues
- Can create fix branches automatically with
create-prlabel
6. PR Management (pr/pr-management.yml)
Triggered on: PR opened, synchronized, labeled
Features:
- Auto-labels PRs based on changed files:
- workflows, tests, documentation, ui, styling, configuration, dependencies
- Size labels (small/medium/large)
- Type labels from PR title (bug, enhancement, refactor, etc.)
- Validates PR descriptions
- Links related issues automatically
- Posts comments on related issues
7. Merge Conflict Check (pr/merge-conflict-check.yml)
Triggered on: PR opened/synchronized, push to main/master
Features:
- Detects merge conflicts
- Posts comment mentioning @copilot to resolve
- Adds/removes
merge-conflictlabel - Fails CI if conflicts exist
8. Planning & Design (quality/planning.yml) 🆕
Triggered on: Issues opened or labeled with enhancement/feature-request
Features:
- Architecture Review: Analyzes feature requests against architectural principles
- PRD Alignment Check: Ensures new features align with project mission
- Implementation Suggestions: Provides step-by-step implementation guidance
- Validates declarative-first approach
- Checks multi-tenant and permission considerations
- Creates design checklists for feature implementation
- @copilot integration for architecture guidance
SDLC Phase: Planning & Design
9. Code Size Limits (quality/size-limits.yml)
Triggered on: Pull requests, pushes to main (when source files change)
Features:
- Enforces file size limits and posts PR comments on violations
- Uploads a size report artifact
- Monitors
frontends/nextjs/src/**and runsscripts/enforce-size-limits.tsfromfrontends/nextjs
SDLC Coverage
🎯 Complete Lifecycle Support
┌─────────────┐
│ Planning │ ← quality/planning.yml (Architecture Review, PRD Check)
└──────┬──────┘
↓
┌─────────────┐
│ Development │ ← gated-pipeline.yml Gate 4 (Dev Feedback, Copilot)
└──────┬──────┘
↓
┌─────────────┐
│ Testing │ ← ci.yml, code-review.yml (Lint, Build, E2E)
└──────┬──────┘
↓
┌─────────────┐
│ Integration │ ← pr-management.yml, auto-merge.yml
└──────┬──────┘
↓
┌─────────────┐
│ Deployment │ ← deployment.yml (Validation, Health Checks)
└──────┬──────┘
↓
┌─────────────┐
│ Maintenance │ ← issue-triage.yml, dependabot.yml
└─────────────┘
Labels Used
Automated Labels
bug- Bug fixesenhancement- New featuresfeature-request- Proposed new featuresready-to-implement- Features ready for developmentdocumentation- Documentation changestests- Test-related changessecurity- Security issuesperformance- Performance improvementsneeds-changes- PR requires changesready-for-review- PR is ready for reviewhas-warnings- PR has warnings to addresslarge-pr- PR with many changessize: small/medium/large- PR size indicatorsai-fixable- Issues that can be auto-fixedgood first issue- Good for newcomerspriority: high/medium/low- Issue prioritymerge-conflict- PR has merge conflictsauto-fix- Request automated fixcreate-pr- Create fix PR for issuedeployment- Deployment trackingmonitoring- Monitoring and observabilitydependencies- Dependency updatesrefactor- Code refactoringchore- Maintenance tasksworkflows- Workflow changesui- UI/UX changesstyling- CSS/Tailwind changesconfiguration- Config file changes
Configuration
ESLint
The project uses ESLint with TypeScript support and React-specific rules:
- File:
eslint.config.js - Strict type checking (warnings for gradual adoption)
- React hooks validation
- Code quality rules
Playwright E2E Tests
- Configuration:
playwright.config.ts - Tests directory:
e2e/ - Runs on Chromium browser
- Tests include:
- Login functionality
- Navigation
- CRUD operations
- Form interactions
Usage
Working with GitHub Copilot
In Issues:
@copilot implement this issue
@copilot review the architecture
@copilot suggest testing strategy
@copilot help with this
In Pull Requests:
- Automated feedback on every push
- Continuous quality metrics
- Refactoring suggestions
- Architectural compliance checks
In Your IDE:
- Reference
.github/copilot-instructions.mdfor context - Use docs/getting-started/PRD.md for feature context
- Follow existing patterns in
/packages/ - Ask Copilot about architectural decisions
Testing Workflows Locally with Act
Before pushing to GitHub, test workflows locally using act:
# Quick diagnostics (no act required)
./scripts/diagnose-workflows.sh
# Interactive workflow testing
./scripts/test-workflows.sh
# Or use act directly
act -l # List all workflows
act push # Run CI pipeline
act -j lint # Test linting job
act -j build # Test build job
📖 See ACT_TESTING.md for comprehensive act testing guide
Running Locally
# Run linter
bun run lint
# Fix linting issues automatically
bun run lint:fix
# Run e2e tests
bun run test:e2e
# Run e2e tests with UI
bun run test:e2e:ui
# Run e2e tests in headed mode
bun run test:e2e:headed
# Build the project
bun run build
Triggering Workflows
Planning Phase:
- Create issue with
enhancementorfeature-requestlabel - Automated architecture review and PRD alignment check
- Add
ready-to-implementlabel for implementation guidance - Follow suggested step-by-step plan
Development Phase:
- Create feature branch:
git checkout -b feature/issue-X - Push changes - triggers continuous quality feedback
- Get real-time metrics on declarative ratio, component sizes
- Mention
@copilotin commits/PRs for specific help - Review refactoring suggestions
Testing & Review Phase:
- Open PR - automatically reviewed, labeled, and validated
- Address any architectural compliance issues
- Get approval + pass tests
- Automatically merged and branch deleted
Deployment Phase:
- Merge to main - triggers pre-deployment validation
- Create release - generates deployment notes and tracking issue
- Post-deployment health checks run automatically
- Monitor deployment tracking issue for 48 hours
Maintenance Phase:
- Security audits run on every deployment
- Dependabot creates automated dependency PRs
- Issue triage handles new bug reports
- @copilot assists with fixes and improvements
For Issues:
- Create an issue - automatically triaged and labeled
- Add
enhancementlabel - triggers architecture review - Add
ready-to-implementlabel - get implementation guidance - Add
auto-fixlabel to request automated fix - Add
create-prlabel to create a fix branch - Mention
@copilotfor specific assistance
For PRs:
- Open a PR - automatically reviewed, labeled, and validated
- Push changes - triggers CI/CD pipeline and quality feedback
- Get approval + pass tests - automatically merged and branch deleted
- Receive continuous refactoring suggestions
Working with AI Assistance
In Issues & PRs:
- Mention
@copilot implement this- Get implementation guidance - Mention
@copilot review- Request code review - Mention
@copilot architecture- Get architectural guidance - Mention
@copilot test- Get testing help - Mention
@copilot fix this issue- Request automated fix
In Your IDE:
- Use GitHub Copilot extension with context from
.github/copilot-instructions.md - Reference docs/getting-started/PRD.md when prompting for features
- Follow patterns from existing packages
- Ask about architectural decisions before implementing
Automated Copilot Features:
- Architecture review on feature requests
- Continuous quality feedback during development
- Refactoring opportunity detection
- PRD alignment checking
- Implementation step-by-step guidance
Best Practices
For Development
- Follow declarative-first principles - Prefer JSON + Lua over TypeScript
- Keep components under 150 LOC - Break large files into smaller ones
- Use generic renderers - Avoid hardcoded component TSX files
- Store config in database - Use Prisma, not hardcoded values
- Organize as packages - Self-contained features with seed data
For Pull Requests
For Pull Requests
- Write descriptive PR titles - Used for automatic labeling
- Link issues in PR descriptions - Enables automatic issue closing
- Keep PRs focused and small - Easier to review and merge
- Address all review comments - Even warnings should be considered
- Test locally before pushing - Run lint and tests
- Don't commit console.log statements - Will be flagged in review
- Remove debugger statements - Treated as blocking issues
- Review refactoring suggestions - Continuous improvement opportunities
For Issues
- Use clear, descriptive titles - Helps with automatic categorization
- Provide context - Link to docs/getting-started/PRD.md sections, mention permission levels
- Consider architecture - Is this declarative? Package-worthy? Multi-tenant?
- Use labels appropriately - Triggers relevant workflow automation
- Engage with @copilot - Get AI assistance throughout implementation
Troubleshooting
Running Act to Find Workflow Issues
Use act to test workflows locally and identify issues before pushing:
# Run full diagnostics
./scripts/diagnose-workflows.sh
# Test specific failing job
act -j <job-name> -v
# Test entire CI pipeline
./scripts/test-workflows.sh
📖 Complete guide: ACT_TESTING.md
PR Not Auto-Merging
- Check that all CI checks passed
- Verify PR has approval
- Ensure no merge conflicts
- Confirm PR is not in draft mode
Tests Failing
- Run tests locally:
bun run test:e2e - Check test report artifacts in GitHub Actions
- Ensure dev server starts correctly
- Test with act:
act -j test-e2e
Linting Errors
- Run
bun run lint:fixto auto-fix - Review errors:
bun run lint - Check
eslint.config.jsfor rule configuration - Test with act:
act -j lint
Build Failures
- Test locally:
bun run build - Check for TypeScript errors
- Verify all dependencies are installed
- Test with act:
act -j build
Prisma Issues
- Ensure schema exists:
prisma/schema.prisma - Generate client:
bunx prisma generate - Run migrations:
bunx prisma migrate dev - Test with act:
act -j prisma-check
Contributing
When adding new workflows:
- Document the workflow in this README
- Add appropriate error handling
- Test the workflow on a test branch
- Ensure proper permissions are set
- Add labels if needed (they'll be created automatically)
Security
Workflows use GITHUB_TOKEN with minimal required permissions:
contents: read/write- For reading code and merging PRspull-requests: write- For commenting and managing PRsissues: write- For managing issueschecks: read- For reading CI status
No secrets are required for basic functionality.