Back to articles
How I Built an Architecture Analyzer with Tree-Sitter AST (and What I Learned About Code Quality Metrics)

How I Built an Architecture Analyzer with Tree-Sitter AST (and What I Learned About Code Quality Metrics)

via Dev.toCamilo

The Problem Every codebase I've worked on in 19 years had the same story: the architecture starts clean, then slowly rots. Someone imports from the wrong layer. A utility class grows into a God Class. Circular dependencies creep in. By the time you notice in code review, refactoring is expensive. I wanted automated architecture checks — like ESLint for structure, not syntax. What Architect Genesis Does Architect Genesis is a CLI tool that analyzes your codebase architecture using Tree-Sitter AST parsing. It works with TypeScript, Python, Go, Java, Rust, Ruby, and PHP. Install and Run bashnpm install -g @girardelli/architect architect analyze ./src That's it. No config needed to start. It infers your stack, framework, and domain automatically. What You Get Architecture Score (0-100) across four weighted dimensions: Dimension Weight What it measures Modularity 40% How well-separated are your modules Coupling 25% Cross-boundary dependency count Cohesion 20% How related are elements within

Continue reading on Dev.to

Opens in a new tab

Read Full Article
2 views

Related Articles