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
| Metric | Description |
|---|---|
| Raw boto3 calls | boto3.client( and boto3.Session( occurrences in non-comment lines |
| Factory imports | from runbooks.common.aws_client_factory import or AWSClientFactory references |
| Migration % | factory_imports / (factory_imports + raw_boto3) * 100 |
| Per-module breakdown | File-by-file counts sorted by raw boto3 usage descending |
Benefits
- Identifies modules still using raw boto3 that bypass the factory's retry config, session caching, and LRU eviction
- Produces a migration priority queue — highest raw boto3 usage modules first
- Enables sprint-level tracking of AWSClientFactory adoption as a quality gate
When to Use
| Attribute | Detail |
|---|---|
| Persona | CloudOps Engineer |
| Trigger | AWS 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 Value | AWSClientFactory 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 |
| Frequency | Sprint |
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.