Ce code quality auditor

From Moffran/calibrated_explanations · View interactive version

Ce code quality auditor is an AI agent skill from the GitHub repository Moffran/calibrated_explanations. Audit source and tests for ADR-030 anti-patterns, determinism failures, API-boundary violations, and test-helper leakage with Option A/B/C handling from the Test Quality Method.

How to use this skill

Skill file

CE Code Quality Auditor

This skill combines the Code Quality Auditor and Anti-Pattern Auditor

roles from ADR-030.

Required references

Use this skill when

Focus option handling

source-quality checks only when they explain test failures.

dead/private helper audits.

then combine results into one ranked proposal.

Core principles

  1. Determinism first: no unsilenced random, time, or network dependencies.
  2. Public-contract tests only: private-member access requires explicit allowlist.
  3. Assertion strength: favor behavioral assertions over shape/type-only checks.
  4. Marker/layer hygiene: test markers and suite placement must match behavior.
  5. No production test-helper exports from src/.

Audit workflow

  1. Confirm the selected focus option (A, B, or C).
  2. Run anti-pattern detection:
python scripts/anti-pattern-analysis/detect_test_anti_patterns.py
python scripts/anti-pattern-analysis/scan_private_usage.py --check
python scripts/quality/check_no_test_helper_exports.py
  1. Run source-quality checks:
python scripts/quality/check_import_graph.py
python scripts/quality/check_docstring_coverage.py
python scripts/anti-pattern-analysis/analyze_private_methods.py
  1. Validate deprecation compliance:
$env:CE_DEPRECATIONS='error'
pytest tests/unit -m "not viz" -q
  1. Classify each finding:

Output contract

Report findings in this order:

  1. Blockers (must-fix now).
  2. High-risk defects.
  3. Medium/low hygiene improvements.

For each finding include:

Constraints

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.