Skip to main content

cloudops.factory-audit

Type: commands | Track: Enterprise

Audit AWSClientFactory adoption across src/runbooks/. Reports raw boto3.client( and boto3.Session( usage versus AWSClientFactory / convenience function imports, and calculates migration percentage.


Quick Start

# Full factory adoption audit (default: src/runbooks/)
/cloudops:factory-audit

# With specific source path
/cloudops:factory-audit src/runbooks/finops/

Report Metrics

MetricDescription
Raw boto3 callsboto3.client( and boto3.Session( occurrences in non-comment lines
Factory importsfrom runbooks.common.aws_client_factory import or AWSClientFactory references
Migration %factory_imports / (factory_imports + raw_boto3) * 100
Per-module breakdownFile-by-file counts sorted by raw boto3 usage descending

Benefits

  1. Identifies modules still using raw boto3 that bypass the factory's retry config, session caching, and LRU eviction
  2. Produces a migration priority queue — highest raw boto3 usage modules first
  3. Enables sprint-level tracking of AWSClientFactory adoption as a quality gate

When to Use

AttributeDetail
PersonaCloudOps Engineer
TriggerAWS client standardization check needed — when a sprint story targets AWSClientFactory adoption, or before a release to verify that new modules are not introducing raw boto3 usage that bypasses the factory's cache_clear() on ExpiredTokenException
Business ValueAWSClientFactory adoption metrics and migration percentage — prevents raw boto3 usage that silently fails on ExpiredTokenException (LRU cache holds stale clients); tracks adoption as an objective sprint quality metric
FrequencySprint

Example: As a CloudOps Engineer, I need to check AWSClientFactory adoption before the sprint review because our quality gate requires all new modules to use the factory pattern, and I need an objective count to report migration progress to the team. I run /cloudops:factory-audit which scans src/runbooks/ for raw boto3.client( calls versus factory imports and produces a per-module migration percentage with a priority queue for the remaining raw-boto3 modules.

Enterprise-only. Contact sales for licensing details.