arch-audit

Analyze Python source structure to identify module splitting and refactoring candidates.

317|40|Updated Jan 21, 2025
One-click install
npx skills add https://github.com/benchflow-ai/benchflow --skill arch-audit-benchflow-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: arch-audit
Source: https://github.com/benchflow-ai/benchflow/tree/main/.agents/skills/arch-audit
Command: npx skills add https://github.com/benchflow-ai/benchflow --skill arch-audit-benchflow-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill identifies structural inefficiencies in a codebase, such as vague module boundaries, orphan files, and stability-mixed merges, preventing technical debt accumulation.

Core Features & Use Cases

  • Structural Analysis: Detects files that violate cohesion rules, such as modules with too many disparate responsibilities or tiny files that should be inlined.
  • Change Impact Assessment: Evaluates the stability of modules using churn ratios to prevent risky merges between high-churn and low-churn code.
  • Use Case: Run this audit before a major refactor to identify which files are candidates for splitting or merging based on actual import graphs and co-edit patterns.

Quick Start

Invoke the arch-audit skill to perform a full structural sweep of the src/benchflow directory.

Frequently Asked Questions about arch-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I identify which Python modules to split or merge during a refactoring task?

Python module splitting and merging candidates are identified by analyzing import graphs, AST-based symbol analysis, and git churn metrics to rank files violating cohesion rules or requiring boundary consolidation.

What is structural code analysis and how does it prevent technical debt accumulation?

Structural code analysis detects vague module boundaries, orphan files, and stability-mixed merges by evaluating codebase cohesion and churn ratios, preventing technical debt accumulation before major refactoring efforts.

How do I assess change impact and module stability before merging high-churn code?

Change impact assessment evaluates module stability using git churn ratios to prevent risky merges between high-churn and low-churn code areas, ensuring refactoring candidates maintain structural health.

Do I need Python 3.12 and git to run deterministic structural audits on my codebase?

Deterministic structural audits require Python 3.12+ and standard git tooling to execute AST-based symbol analysis and evaluate import graphs across the repository for refactoring candidates.

Can static analysis detect orphan files and inlining opportunities in Python source code?

Static analysis detects orphan files and inlining opportunities by operating on import graphs and AST-based symbol analysis to identify tiny files that should be inlined or consolidated.

When should I run a structural health audit to find reorg opportunities in my codebase?

Run a structural health audit before a major refactor to identify reorg opportunities, including module splitting, file inlining, and boundary consolidation based on actual import graphs and co-edit patterns.