/quality-unified

Quality L3 Production high usage

/quality-unified

Overview

/quality-unified is a production command in the Quality category of the Prismatic Platform. It serves as the single entry point for all quality assessment operations, unifying the platform's 13 quality domains under one command with multiple execution modes optimized for different contexts. Instead of remembering and running separate commands for compilation checks, Credo analysis, Dialyzer verification, test execution, and pattern verification, developers invoke /quality-unified with the appropriate mode and receive a comprehensive quality report.

This command operates under the L3 authority level and is executed by the quality-unified-supreme agent. It is part of the platform's 216-command slash command registry, built on the AIAD (Autonomous Intelligence Agent Design) standard. The quality-unified-supreme agent coordinates with domain-specific quality agents to execute checks in parallel where possible, minimizing total execution time.

The unified approach eliminates the common problem of partial quality checking. When quality is fragmented across multiple commands, developers tend to run only the checks relevant to their immediate concern, missing cross-domain regressions. /quality-unified ensures comprehensive coverage every time, with mode-based optimization to keep execution times practical for each development context.

Architecture

The unified quality system orchestrates all domain-specific quality tools through a central dispatcher.

Dispatcher Architecture

             /quality-unified
                    |
            Mode Selector
                    |
    +-------+-------+-------+-------+
    |       |       |       |       |
  Quick    Full  Pre-Commit   CI
  Mode     Mode    Mode      Mode
    |       |       |       |
    v       v       v       v
  Domain Dispatcher (parallel execution)
    |
    +---+---+---+---+---+---+---+
    | D | C | G | M | T | P | R |  ... (13 domains)
    +---+---+---+---+---+---+---+
                    |
           Result Aggregator
                    |
           Quality Report
           (Score: 0-100)

Execution Modes

ModeDomains CheckedParallelTypical DurationUse Case
QuickCompilation, Credo (fast), Critical patternsYes15-30sAfter every file change
FullAll 13 domains, full depthYes2-5 minBefore merge request
Pre-CommitCompilation, Credo, Patterns, Memory SafetyYes30-60sGit pre-commit hook
CIAll 13 domains, performance benchmarksYes3-8 minCI/CD pipeline
CustomUser-selected domainsConfigurableVariesSpecific investigation

Domain Execution Order

Domains execute in dependency order to enable early termination:

  1. Compilation (blocking) -- Must pass before any other check
  2. Parallel Group A: Credo, Guard Functions, DateTime, Timing, TODO
  3. Parallel Group B: Dialyzer, Typespec, @impl, Memory Safety
  4. Sequential: Tests, Performance
  5. Meta: Quality Score, Quality DNA

If compilation fails, all subsequent groups are skipped and the command reports the compilation failure immediately.

Usage

# Quick quality check (default mode)
/quality-unified

# Full comprehensive check
/quality-unified --mode full

# Pre-commit hook mode
/quality-unified --mode pre-commit

# CI pipeline mode
/quality-unified --mode ci

# Quick check for specific app
/quality-unified --app prismatic_web

# Custom domain selection
/quality-unified --domains compilation,credo,dialyzer

# Quality status overview (no checks, just scores)
/quality-unified --status

# Generate quality report
/quality-unified --mode full --report ./quality-report.md

# Auto-fix mode (fix what can be fixed automatically)
/quality-unified --fix

# Verbose with per-file details
/quality-unified --verbose

Practical Examples

# Quick check after editing a LiveView module
/quality-unified --app prismatic_web --verbose

# Full validation before submitting merge request
/quality-unified --mode full --report ./mr-quality-report.md

# CI pipeline integration with JSON output
/quality-unified --mode ci --format json --exit-code

# Check and auto-fix Credo and typespec issues
/quality-unified --domains credo,typespec --fix

# Compare quality against baseline
/quality-unified --mode full --compare-baseline

Options

OptionTypeDefaultDescription
--modeenumquickExecution mode: quick, full, pre-commit, ci, custom
--appstringallSpecific application to check
--domainsstringmode-dependentComma-separated domain list for custom mode
--formatenumtextOutput format: text, json, markdown
--verboseflagfalsePer-file and per-check details
--fixflagfalseAuto-fix violations where possible
--statusflagfalseShow scores without running checks
--reportpathnoneExport quality report
--exit-codeflagtrueNon-zero exit on failure
--compare-baselineflagfalseCompare against quality baseline
--parallelflagtrueEnable parallel domain execution
--timeoutdurationmode-dependentMaximum execution time
--skip-domainstringnoneSkip specific domain (requires justification)

Execution Flow

Phase 1: Mode Resolution

The command resolves the execution mode and determines which domains, parallelism settings, and timeout values to use. Custom mode uses explicitly provided domains; named modes use predefined configurations.

Phase 2: Prerequisite Checks

Before running quality checks, the system verifies prerequisites:

  • Dependencies are compiled
  • Required tools are available (Credo, Dialyzer PLTs)
  • Sufficient disk space for temporary artifacts

Phase 3: Domain Dispatch

Domains are dispatched to their respective checking tools. Independent domains run in parallel, while dependent domains wait for prerequisites. Each domain reports its results through a standardized interface.

Phase 4: Result Collection

As domain checks complete, results are collected and normalized:

Result FieldDescription
domainQuality domain name
statusPASS, FAIL, WARN, SKIP
violationsCount of violations found
detailsPer-violation location and description
durationCheck execution time
fixableCount of auto-fixable violations

Phase 5: Score Computation

The composite quality score is computed from individual domain scores:

Quality Score = sum(domain_weight[i] * domain_score[i]) / sum(domain_weight[i])

Each domain has equal weight in the default configuration, resulting in a score from 0 to 100.

Phase 6: Report Generation

The final report includes: overall score, per-domain scores, violation details, recommended actions, and comparison with baseline (if requested).

Integration Points

ComponentIntegration TypeDescription
/quality-gatesDelegationUnified delegates to gate infrastructure
/quality-evolveConsumerEvolution uses unified scores as fitness metrics
/quality-hbfsPeerHBFS rankings inform unified priority display
/regression-checkComponentRegression checks run as part of unified pipeline
/verify-patternsComponentPattern verification is a unified domain
Pre-commit HookCallerHook invokes --mode pre-commit
CI/CD PipelineCallerPipeline invokes --mode ci
TelemetryMonitoringQuality metrics and execution timing
Quality DNAStateCross-session quality continuity

Best Practices

Mode Selection Guide

Use the right mode for the right context. Running --mode full after every file change wastes time; running --mode quick before a merge request misses issues.

Auto-Fix Usage

The --fix flag can automatically resolve approximately 60-70% of Credo violations, 40% of typespec gaps, and 80% of formatting issues. Always review auto-fixes before committing, especially for Credo complexity refactors.

Baseline Comparison

Enable --compare-baseline when preparing merge requests. This shows the exact quality delta introduced by your changes, making it easy to verify that you have not introduced regressions.

Domain Skip Policy

The --skip-domain option exists for exceptional circumstances (e.g., a domain checker has a known bug). Every skip requires a text justification that is logged. Skips should be temporary and tracked.

Error Handling

Error CodeDescriptionResolution
MODE_INVALIDUnknown execution mode specifiedUse: quick, full, pre-commit, ci, custom
COMPILATION_BLOCKEDCompilation failed, blocking all checksFix compilation errors first
DOMAIN_TIMEOUTIndividual domain check exceeded timeoutCheck for infinite loops or increase timeout
PARALLEL_FAILUREParallel execution crashedRetry with --no-parallel; report bug if consistent
PLT_MISSINGDialyzer PLT not builtRun mix dialyzer --plt first
QUALITY_REGRESSIONScore decreased from baselineInvestigate violations introduced by recent changes

Advanced Usage

Quality Trend Reporting

Track quality over time with periodic full checks:

/quality-unified --mode full --format json --report ./quality/$(date +%Y-%m-%d).json

Integration with Editor

Configure editor integration for real-time quality feedback:

# Run on file save (editor hook)
/quality-unified --app prismatic_web --domains compilation,credo --timeout 15s

Multi-App Comparison

Compare quality scores across umbrella applications:

/quality-unified --mode full --per-app --format json

Doctrine Compliance

All commands operate under the NO MERCY, NO DOUBTS doctrine:

  • NO MERCY: Zero tolerance for incomplete execution or quality violations. Every mode runs its full domain set without shortcuts.
  • NO DOUBTS: Full investigation before action, evidence-based results. Scores are computed from objective tool outputs, not estimates.
  • /quality-gates - Enforce quality gate checkpoints with zero-warning compilation validation
  • /quality-evolve - Quality-focused evolution targeting specific quality domains
  • /quality-hbfs - Hottest-bug-first search for quality assessment prioritization
  • /quality-enforce - Mandatory progressive quality debt elimination with AIAD enforcement
  • /regression-check - Execute 25 custom Credo regression checks preventing 700+ violations
  • /verify-patterns - Pattern matching audit for file, module or entire codebase
  • /code - Core coding implementation and feature development
  • /refactor - Safe refactoring with zero-regression guarantee

Connect & Contribute

Created by Tomáš Korcak (korczis) | Open Source under GHL