pmat 3.17.0

PMAT - Zero-config AI context generation and code quality toolkit (CLI, MCP, HTTP)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
# CI/CD Integration Guide

This guide shows how to integrate pmat's quality analysis and refactoring commands into your CI/CD pipelines to maintain extreme quality standards automatically.

## Overview

All `pmat analyze` commands now support the `--fail-on-violation` flag, which makes them exit with code 1 when violations exceed configured thresholds. This enables seamless CI/CD integration for quality gates.

## Exit Codes

- **0**: Success - no violations found or within thresholds
- **1**: Failure - violations exceed configured thresholds

## Supported Commands

### Analyze Commands with CI/CD Support
- `pmat analyze complexity --fail-on-violation` - Exit if complexity exceeds thresholds
- `pmat analyze dead-code --fail-on-violation` - Exit if dead code percentage too high
- `pmat analyze satd --fail-on-violation` - Exit if ANY technical debt found
- `pmat quality-gate --fail-on-violation` - Comprehensive quality check

### Configurable Thresholds
- **Complexity**: `--max-cyclomatic` (default: 20), `--max-cognitive` (default: 15)
- **Dead Code**: `--max-percentage` (default: 15.0%)
- **SATD**: Zero tolerance when using `--fail-on-violation`

## GitHub Actions Integration

### Comprehensive Quality Gate

```yaml
name: Code Quality Check
on: [push, pull_request]

jobs:
  quality-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      
      - name: Install pmat
        run: |
          cargo install pmat
          # Or use quick install:
          # curl -sSfL https://raw.githubusercontent.com/paiml/paiml-mcp-agent-toolkit/master/scripts/install.sh | sh
          # echo "$HOME/.local/bin" >> $GITHUB_PATH
          
      - name: Check Code Complexity
        run: |
          pmat analyze complexity \
            --max-cyclomatic 15 \
            --max-cognitive 10 \
            --fail-on-violation \
            --format json > complexity-report.json
            
      - name: Check Technical Debt
        run: |
          pmat analyze satd \
            --strict \
            --fail-on-violation \
            --format json > satd-report.json
            
      - name: Check Dead Code
        run: |
          pmat analyze dead-code \
            --max-percentage 10.0 \
            --fail-on-violation \
            --format json > deadcode-report.json
            
      - name: Run Comprehensive Quality Gate
        run: |
          pmat quality-gate \
            --fail-on-violation \
            --format json > quality-report.json
          
      - name: Upload quality report
        uses: actions/upload-artifact@v3
        with:
          name: quality-report
          path: quality-report.json
          
      - name: Comment PR with quality report
        if: github.event_name == 'pull_request'
        uses: actions/github-script@v6
        with:
          script: |
            const fs = require('fs');
            const report = JSON.parse(fs.readFileSync('quality-report.json', 'utf8'));
            
            const comment = `## 🤖 AI Refactoring Quality Report
            
            **Quality Metrics:**
            - Violations: ${report.quality_metrics.total_violations}
            - Max Complexity: ${report.quality_metrics.max_complexity}
            - Coverage: ${report.quality_metrics.coverage_percent}%
            - SATD Items: ${report.quality_metrics.satd_count}
            
            ${report.quality_metrics.total_violations === 0 ? '✅ All quality standards met!' : '❌ Quality standards not met'}`;
            
            github.rest.issues.createComment({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              body: comment
            });
```

### Matrix Strategy for Multiple Checks

```yaml
name: Quality Matrix
on: [push, pull_request]

jobs:
  quality-matrix:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        check:
          - name: complexity
            cmd: analyze complexity --max-cyclomatic 15 --max-cognitive 10 --fail-on-violation
          - name: dead-code
            cmd: analyze dead-code --max-percentage 10.0 --fail-on-violation
          - name: technical-debt
            cmd: analyze satd --strict --fail-on-violation
    steps:
      - uses: actions/checkout@v3
      - name: Install pmat
        run: cargo install pmat
      - name: Run ${{ matrix.check.name }} check
        run: pmat ${{ matrix.check.cmd }}
```

## GitLab CI Integration

### .gitlab-ci.yml

```yaml
stages:
  - quality
  - test
  - deploy

variables:
  PMAT_VERSION: "latest"

quality-check:
  stage: quality
  image: rust:latest
  script:
    - cargo install pmat
    # Run all quality checks
    - pmat analyze complexity --max-cyclomatic 15 --fail-on-violation
    - pmat analyze satd --strict --fail-on-violation  
    - pmat analyze dead-code --max-percentage 10.0 --fail-on-violation
    - pmat quality-gate --fail-on-violation --format json --output quality-report.json
  artifacts:
    reports:
      codequality: quality-report.json
    paths:
      - quality-report.json
    expire_in: 1 week
  allow_failure: false

# Separate jobs for detailed reporting
complexity-check:
  stage: quality
  image: rust:latest
  script:
    - cargo install pmat
    - pmat analyze complexity --max-cyclomatic 15 --fail-on-violation --format json > complexity.json
  artifacts:
    paths:
      - complexity.json
```

## Jenkins Pipeline Integration

### Jenkinsfile

```groovy
pipeline {
    agent any
    
    environment {
        PMAT_VERSION = 'latest'
    }
    
    stages {
        stage('Install Tools') {
            steps {
                sh '''
                    curl -sSfL https://raw.githubusercontent.com/paiml/paiml-mcp-agent-toolkit/master/scripts/install.sh | sh
                    export PATH="$HOME/.local/bin:$PATH"
                '''
            }
        }
        
        stage('Quality Checks') {
            parallel {
                stage('Complexity') {
                    steps {
                        sh 'pmat analyze complexity --max-cyclomatic 15 --fail-on-violation'
                    }
                }
                stage('Technical Debt') {
                    steps {
                        sh 'pmat analyze satd --strict --fail-on-violation'
                    }
                }
                stage('Dead Code') {
                    steps {
                        sh 'pmat analyze dead-code --max-percentage 10.0 --fail-on-violation'
                    }
                }
            }
        }
        
        stage('Generate Reports') {
            steps {
                sh '''
                    pmat quality-gate --format json > quality-report.json
                    pmat analyze complexity --format sarif > complexity.sarif
                '''
            }
            post {
                always {
                    archiveArtifacts artifacts: '*.json,*.sarif', fingerprint: true
                    publishHTML([
                        allowMissing: false,
                        alwaysLinkToLastBuild: true,
                        keepAll: true,
                        reportDir: '.',
                        reportFiles: 'quality-report.json',
                        reportName: 'Quality Report'
                    ])
                }
            }
        }
    }
    
    post {
        failure {
            emailext(
                subject: "Quality Gate Failed: ${env.JOB_NAME} - ${env.BUILD_NUMBER}",
                body: "Quality checks failed. Please check the build logs.",
                to: "${env.CHANGE_AUTHOR_EMAIL}"
            )
        }
    }
}
```

## CircleCI Integration

### .circleci/config.yml

```yaml
version: 2.1

executors:
  rust-executor:
    docker:
      - image: rust:latest

jobs:
  quality-checks:
    executor: rust-executor
    steps:
      - checkout
      - run:
          name: Install pmat
          command: cargo install pmat
      - run:
          name: Check Complexity
          command: |
            pmat analyze complexity \
              --max-cyclomatic 15 \
              --max-cognitive 10 \
              --fail-on-violation
      - run:
          name: Check Technical Debt
          command: pmat analyze satd --strict --fail-on-violation
      - run:
          name: Check Dead Code  
          command: pmat analyze dead-code --max-percentage 10.0 --fail-on-violation
      - run:
          name: Generate Reports
          command: |
            pmat quality-gate --format json > quality-report.json
          when: always
      - store_artifacts:
          path: quality-report.json
          destination: quality-reports

workflows:
  quality-workflow:
    jobs:
      - quality-checks
```

## Pre-commit Hook Integration

### .pre-commit-config.yaml

```yaml
repos:
  - repo: local
    hooks:
      - id: pmat-complexity
        name: Check code complexity
        entry: pmat analyze complexity --max-cyclomatic 15 --fail-on-violation
        language: system
        pass_filenames: false
        
      - id: pmat-satd
        name: Check for technical debt
        entry: pmat analyze satd --strict --fail-on-violation
        language: system
        pass_filenames: false
        
      - id: pmat-dead-code
        name: Check for dead code
        entry: pmat analyze dead-code --max-percentage 10.0 --fail-on-violation
        language: system
        pass_filenames: false
```

### Git Hook Script

```bash
#!/bin/bash
# .git/hooks/pre-commit

echo "Running quality checks..."

# Check complexity
if ! pmat analyze complexity --max-cyclomatic 15 --fail-on-violation; then
    echo "❌ Complexity check failed. Please refactor complex functions."
    exit 1
fi

# Check for technical debt
if ! pmat analyze satd --strict --fail-on-violation; then
    echo "❌ Technical debt found. Please remove TODO/FIXME comments."
    exit 1
fi

# Check dead code percentage
if ! pmat analyze dead-code --max-percentage 10.0 --fail-on-violation; then
    echo "❌ Too much dead code. Please remove unused code."
    exit 1
fi

echo "✅ All quality checks passed!"
```

### Automated Refactoring Workflow

```yaml
name: Automated Refactoring
on:
  schedule:
    - cron: '0 2 * * 1'  # Weekly on Monday at 2 AM
  workflow_dispatch:     # Manual trigger

jobs:
  auto-refactor:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          
      - name: Install pmat
        run: |
          curl -sSfL https://raw.githubusercontent.com/paiml/paiml-mcp-agent-toolkit/master/scripts/install.sh | sh
          echo "$HOME/.local/bin" >> $GITHUB_PATH
          
      - name: Run automated refactoring
        run: |
          pmat refactor auto --max-iterations 5 --format json > refactor-results.json
          
      - name: Check for changes
        id: changes
        run: |
          if [[ -n $(git status --porcelain) ]]; then
            echo "changes=true" >> $GITHUB_OUTPUT
          else
            echo "changes=false" >> $GITHUB_OUTPUT
          fi
          
      - name: Create Pull Request
        if: steps.changes.outputs.changes == 'true'
        uses: peter-evans/create-pull-request@v5
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          commit-message: |
            🤖 Automated refactoring for quality standards
            
            - Functions refactored to complexity ≤10
            - Test coverage improved to ≥80%
            - SATD items eliminated
            - All lint violations fixed
            
            Generated with pmat refactor auto
          title: "🤖 Automated Quality Refactoring"
          body: |
            ## AI-Powered Automated Refactoring
            
            This PR contains automated refactoring to meet EXTREME quality standards:
            
            ### Quality Standards Enforced
            - ✅ Function complexity ≤ 10
            - ✅ Test coverage ≥ 80%
            - ✅ Zero SATD comments
            - ✅ All lints fixed
            
            ### Generated by
            `pmat refactor auto` - AI-powered automated refactoring
            
            Please review and merge if the changes look correct.
          branch: automated-refactoring
          delete-branch: true
```

## GitLab CI Integration

### .gitlab-ci.yml

```yaml
stages:
  - quality-check
  - refactor

variables:
  PMAT_VERSION: "latest"

quality-gate:
  stage: quality-check
  image: rust:latest
  before_script:
    - curl -sSfL https://raw.githubusercontent.com/paiml/paiml-mcp-agent-toolkit/master/scripts/install.sh | sh
    - export PATH="$HOME/.local/bin:$PATH"
  script:
    - pmat refactor auto --ci-mode --format json
  artifacts:
    reports:
      junit: quality-report.xml
    paths:
      - quality-report.json
    expire_in: 1 week
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

automated-refactor:
  stage: refactor
  image: rust:latest
  before_script:
    - curl -sSfL https://raw.githubusercontent.com/paiml/paiml-mcp-agent-toolkit/master/scripts/install.sh | sh
    - export PATH="$HOME/.local/bin:$PATH"
  script:
    - pmat refactor auto --max-iterations 3 --format detailed
    - |
      if [[ -n $(git status --porcelain) ]]; then
        git config --global user.email "ci@company.com"
        git config --global user.name "CI Automated Refactoring"
        git add .
        git commit -m "🤖 Automated refactoring for quality standards"
        git push origin HEAD:automated-refactoring-$CI_COMMIT_SHORT_SHA
        echo "Created branch: automated-refactoring-$CI_COMMIT_SHORT_SHA"
      fi
  rules:
    - if: $CI_PIPELINE_SOURCE == "schedule"
    - when: manual
```

## Jenkins Integration

### Jenkinsfile

```groovy
pipeline {
    agent any
    
    environment {
        PMAT_HOME = "${env.HOME}/.local/bin"
    }
    
    stages {
        stage('Setup') {
            steps {
                sh '''
                    curl -sSfL https://raw.githubusercontent.com/paiml/paiml-mcp-agent-toolkit/master/scripts/install.sh | sh
                    export PATH="$PMAT_HOME:$PATH"
                    pmat --version
                '''
            }
        }
        
        stage('Quality Check') {
            steps {
                sh '''
                    export PATH="$PMAT_HOME:$PATH"
                    pmat refactor auto --dry-run --format json > quality-report.json
                '''
            }
            post {
                always {
                    archiveArtifacts artifacts: 'quality-report.json', fingerprint: true
                    publishHTML([
                        allowMissing: false,
                        alwaysLinkToLastBuild: true,
                        keepAll: true,
                        reportDir: '.',
                        reportFiles: 'quality-report.json',
                        reportName: 'Quality Report'
                    ])
                }
            }
        }
        
        stage('Automated Refactoring') {
            when {
                anyOf {
                    triggeredBy 'TimerTrigger'
                    triggeredBy cause: 'UserIdCause'
                }
            }
            steps {
                sh '''
                    export PATH="$PMAT_HOME:$PATH"
                    pmat refactor auto --max-iterations 5 --format detailed > refactor-log.txt
                '''
            }
            post {
                always {
                    archiveArtifacts artifacts: 'refactor-log.txt', fingerprint: true
                }
            }
        }
    }
    
    post {
        failure {
            emailext (
                subject: "Quality Gate Failed: ${env.JOB_NAME} - ${env.BUILD_NUMBER}",
                body: "Quality standards not met. Please run 'pmat refactor auto' to fix issues.",
                to: "${env.CHANGE_AUTHOR_EMAIL}"
            )
        }
    }
}
```

## Azure DevOps Integration

### azure-pipelines.yml

```yaml
trigger:
  branches:
    include:
      - main
      - develop

pr:
  branches:
    include:
      - main

schedules:
  - cron: "0 2 * * 1"
    displayName: Weekly automated refactoring
    branches:
      include:
        - main

pool:
  vmImage: 'ubuntu-latest'

stages:
  - stage: QualityCheck
    displayName: 'Quality Gate'
    jobs:
      - job: QualityGate
        displayName: 'Run Quality Gate'
        steps:
          - script: |
              curl -sSfL https://raw.githubusercontent.com/paiml/paiml-mcp-agent-toolkit/master/scripts/install.sh | sh
              echo "##vso[task.prependpath]$HOME/.local/bin"
            displayName: 'Install pmat'
            
          - script: |
              pmat refactor auto --ci-mode --format json > quality-report.json
            displayName: 'Run Quality Check'
            
          - task: PublishBuildArtifacts@1
            inputs:
              pathToPublish: 'quality-report.json'
              artifactName: 'quality-report'
            displayName: 'Publish Quality Report'

  - stage: AutomatedRefactoring
    displayName: 'Automated Refactoring'
    condition: eq(variables['Build.Reason'], 'Schedule')
    jobs:
      - job: Refactor
        displayName: 'Auto Refactor'
        steps:
          - script: |
              curl -sSfL https://raw.githubusercontent.com/paiml/paiml-mcp-agent-toolkit/master/scripts/install.sh | sh
              echo "##vso[task.prependpath]$HOME/.local/bin"
            displayName: 'Install pmat'
            
          - script: |
              pmat refactor auto --max-iterations 3 --format json > refactor-results.json
            displayName: 'Run Automated Refactoring'
            
          - script: |
              if [[ -n $(git status --porcelain) ]]; then
                git config user.email "azure-devops@company.com"
                git config user.name "Azure DevOps Automated Refactoring"
                git checkout -b automated-refactoring-$(Build.BuildNumber)
                git add .
                git commit -m "🤖 Automated refactoring for quality standards"
                git push origin automated-refactoring-$(Build.BuildNumber)
                echo "##vso[task.logissue type=warning]Created branch: automated-refactoring-$(Build.BuildNumber)"
              fi
            displayName: 'Create Refactoring Branch'
            condition: succeeded()
```

## Docker Integration

### Dockerfile for CI

```dockerfile
FROM rust:1.75-slim

# Install pmat
RUN curl -sSfL https://raw.githubusercontent.com/paiml/paiml-mcp-agent-toolkit/master/scripts/install.sh | sh
ENV PATH="/root/.local/bin:${PATH}"

# Set working directory
WORKDIR /app

# Copy source code
COPY . .

# Run quality check
RUN pmat refactor auto --ci-mode --format json > quality-report.json

# Build if quality gates pass
RUN cargo build --release
```

### Docker Compose for Development

```yaml
version: '3.8'

services:
  quality-gate:
    build:
      context: .
      dockerfile: Dockerfile.quality
    volumes:
      - .:/app
      - quality-reports:/app/reports
    command: |
      sh -c "
        pmat refactor auto --dry-run --format json > /app/reports/quality-report.json
        pmat refactor auto --ci-mode
      "
    
  automated-refactor:
    build:
      context: .
      dockerfile: Dockerfile.quality
    volumes:
      - .:/app
    command: |
      sh -c "
        pmat refactor auto --max-iterations 5 --format detailed > refactor-log.txt
        echo 'Refactoring completed. Check refactor-log.txt for details.'
      "

volumes:
  quality-reports:
```

## Pre-commit Hooks

### .pre-commit-config.yaml

```yaml
repos:
  - repo: local
    hooks:
      - id: pmat-quality-check
        name: PMAT Quality Check
        entry: bash -c 'pmat refactor auto --dry-run --ci-mode'
        language: system
        files: '\.(rs|js|ts|py|java|kt|go|cpp|c)$'
        fail_fast: true
        verbose: true
```

### Git Hook Script

```bash
#!/bin/bash
# .git/hooks/pre-commit

echo "🤖 Running AI-powered quality check..."

# Check if pmat is installed
if ! command -v pmat &> /dev/null; then
    echo "❌ pmat not found. Installing..."
    curl -sSfL https://raw.githubusercontent.com/paiml/paiml-mcp-agent-toolkit/master/scripts/install.sh | sh
    export PATH="$HOME/.local/bin:$PATH"
fi

# Run quality check
if ! pmat refactor auto --dry-run --ci-mode --format json > /tmp/quality-check.json; then
    echo "❌ Quality standards not met!"
    echo ""
    echo "Run the following command to fix issues automatically:"
    echo "  pmat refactor auto"
    echo ""
    echo "Or to see what would be changed:"
    echo "  pmat refactor auto --dry-run --format detailed"
    exit 1
fi

echo "✅ Quality check passed! All standards met."
```

## Monitoring and Metrics

### Quality Metrics Dashboard

```bash
#!/bin/bash
# scripts/collect-quality-metrics.sh

# Collect daily quality metrics
pmat refactor auto --dry-run --format json | \
  jq '.quality_metrics + {"timestamp": now}' >> metrics/quality-history.jsonl

# Generate weekly quality report
if [[ $(date +%u) -eq 1 ]]; then
    echo "## Weekly Quality Report" > reports/weekly-$(date +%Y-%W).md
    echo "" >> reports/weekly-$(date +%Y-%W).md
    
    # Calculate trend
    cat metrics/quality-history.jsonl | \
      jq -s 'sort_by(.timestamp) | [first, last] | 
             "Complexity trend: " + (.[1].max_complexity - .[0].max_complexity | tostring)' \
      >> reports/weekly-$(date +%Y-%W).md
fi
```

## Best Practices

### 1. Incremental Integration
Start with dry-run mode to understand what the tool would change:
```bash
pmat refactor auto --dry-run --format detailed
```

### 2. Quality Gate Thresholds
Configure appropriate thresholds for your team:
- Start with current complexity levels and gradually decrease
- Set coverage targets based on existing coverage
- Plan SATD elimination timeline

### 3. Branch Strategy
- Use separate branches for automated refactoring
- Require human review for AI-generated changes
- Test thoroughly before merging

### 4. Monitoring
- Track quality metrics over time
- Monitor refactoring frequency and success rate
- Alert on quality degradation

### 5. Team Training
- Educate team on quality standards enforced
- Provide guidelines for reviewing AI-generated refactorings
- Establish processes for handling refactoring conflicts

This integration guide enables teams to maintain EXTREME quality standards automatically while minimizing manual overhead and ensuring consistent code quality across all projects.