Framework-agnostic tool library for software architecture analysis
Project description
arcade-agent
Framework-agnostic tool library for software architecture analysis.
Provides composable tools for parsing source code, recovering architecture, detecting architectural smells, computing quality metrics, and comparing versions. Works standalone or plugs into MCP, LangChain, or Claude SDK.
Install
pip install -e ".[dev]"
# With MCP server support (for AI agent integration)
pip install -e ".[mcp,dev]"
Quick Start
from arcade_agent.tools.ingest import ingest
from arcade_agent.tools.parse import parse
from arcade_agent.tools.recover import recover
from arcade_agent.tools.detect_smells import detect_smells
from arcade_agent.tools.compute_metrics import compute_metrics
from arcade_agent.tools.visualize import visualize
# 1. Ingest a project
repo = ingest("/path/to/java/project")
# 2. Parse dependencies
graph = parse(repo.path, language="java")
# 3. Recover architecture
arch = recover(graph, algorithm="pkg")
# 4. Detect smells
smells = detect_smells(arch, graph)
# 5. Compute metrics
metrics = compute_metrics(arch, graph)
# 6. Generate report
visualize(repo.name, repo.version, graph, arch, smells, output="report.html")
Tools
| Tool | Description |
|---|---|
ingest |
Clone/load source code, detect versions, discover files |
parse |
Parse source → DependencyGraph via tree-sitter |
recover |
Recover architecture (PKG, WCA, ACDC, ARC, LIMBO) |
detect_smells |
Find dependency cycles, concern overload, scattered functionality, link overload (heuristic or LLM-powered) |
compute_metrics |
Calculate RCI, TurboMQ, connectivity metrics |
compare |
A2A architecture comparison across versions |
visualize |
Generate HTML reports, DOT, Mermaid, JSON, RSF |
query |
Explore recovered architecture interactively |
summarize |
Codebase overview with package tree, hotspots, entry points; drill-down via focus |
explain_component |
Component detail: API surface, dependencies, cohesion |
find_relevant |
Find entities relevant to a natural-language query |
Supported Languages
- Java (full support)
- Python (full support)
- C/C++ (full support)
- TypeScript/JavaScript (stub — contributions welcome)
Example: ARCADE Core
ARCADE Core is a Java-based architecture recovery workbench from USC's Software Architecture Research Group. Running arcade-agent against it:
git clone https://github.com/usc-softarch/arcade_core.git
python examples/basic_analysis.py arcade_core --language java
Results (v1.2.0): 170 entities, 470 edges, 13 components recovered, 7 architectural smells detected (including a 7-component dependency cycle and concern overload in the Clustering module).
See examples/arcade_core_report.html for the full interactive report.
Algorithm Comparison
Compare PKG, ACDC, ARC, and LIMBO recovery algorithms side-by-side on the same project:
python examples/compare_algorithms.py arcade_core --language java --use-llm
See examples/comparison_report.html for the full comparison report.
MCP Server (AI Agent Integration)
arcade-agent exposes all tools via the Model Context Protocol so AI agents (Claude Code, Cursor, etc.) can analyze codebases with minimal token usage.
Start the server
arcade-mcp
Configure in Claude Code
Add to your Claude Code MCP settings:
{
"mcpServers": {
"arcade-agent": {
"command": "arcade-mcp"
}
}
}
How it works
- Session store — Tools like
parseandrecoverreturn compact summaries with asession_id. Pass session IDs to downstream tools instead of full data objects. - Token budget — Every tool accepts an optional
max_tokensparameter. Outputs are progressively truncated (entity details → edge summaries → component counts) to fit. - Parse caching — Parsed dependency graphs are cached to
.arcade-cache/keyed by file modification times. Repeated analysis of the same codebase skips re-parsing. - On-demand detail — Call
get_full_result(session_id)to retrieve complete data when the summary isn't enough.
Example agent workflow
Agent: call parse(source_path="/path/to/project")
→ {session_id: "a1b2c3", num_entities: 170, num_edges: 470, ...}
Agent: call recover(dep_graph="a1b2c3", algorithm="pkg")
→ {session_id: "d4e5f6", num_components: 13, components: [...], ...}
Agent: call detect_smells(architecture="d4e5f6", dep_graph="a1b2c3")
→ {num_smells: 7, smells: [...]}
Agent: call get_full_result(session_id="a1b2c3", max_tokens=2000)
→ full graph data, truncated to fit token budget
LLM-Powered Analysis
Pass --use-llm to enable Claude-powered concern detection. Requires the claude CLI installed and authenticated.
python examples/basic_analysis.py arcade_core --language java --use-llm
This replaces heuristic smell detection (entity count thresholds, suffix matching) with semantic analysis that identifies what concerns each component handles and why they are problematic. Set ARCADE_MOCK=1 to skip LLM calls, or ARCADE_MODEL=haiku to use a faster model.
CI/CD Integration
arcade-agent ships with a GitHub Action that detects architecture drift on every PR — like SonarQube for architecture.
How It Works
- On pull request: parses the codebase, recovers architecture (PKG), compares against a stored baseline, and posts a PR comment with a drift report.
- On push to main: updates the baseline (
.arcade/baseline.json) so future PRs compare against the latest merged state.
Setup
Copy .github/workflows/arch-drift.yml into your repository. The workflow auto-detects the language, or you can set it explicitly via the language workflow input.
# .github/workflows/arch-drift.yml is included in the repo — just enable Actions.
The baseline is stored in .arcade/baseline.json and committed to the repo automatically when changes are pushed to main.
Local Usage
Run the drift detection script locally:
# Analyze without a baseline (first run)
python scripts/arch_diff.py --source /path/to/project --language java
# Update the baseline
python scripts/arch_diff.py --source /path/to/project --language java --update-baseline
# Compare against existing baseline
python scripts/arch_diff.py --source /path/to/project --language java
PR Comment Format
The action posts a comment with:
- Drift table — component count, similarity score, RCI, TurboMQ deltas
- Changes — added/removed components, entity movements, splits/merges
- Smells — dependency cycles, concern overload, scattered functionality
The comment is updated on each push to the PR (not duplicated).
Roadmap
arcade-agent ports and extends the capabilities of the original ARCADE Java workbench, and is evolving into a token-efficient codebase understanding layer for AI agents. See ROADMAP.md for the full AI agent integration roadmap.
| Feature | Status | Details |
|---|---|---|
| 5 recovery algorithms (PKG, WCA, ACDC, ARC, LIMBO) | Done | Package-based, weighted clustering, pattern-based, LLM concern-based, information-theoretic |
| 4 smell types (BDC, BCO, SPF, BUO) | Done | Heuristic + LLM-powered detection |
| 6 quality metrics | Done | RCI, TurboMQ, BasicMQ, IntraConnectivity, InterConnectivity, TwoWayPairRatio |
| A2A architecture comparison | Done | Hungarian algorithm on Jaccard similarity |
| Multi-language parsing | Done | Java, Python, C/C++ (full), TypeScript (stub) |
| 5 export formats | Done | HTML, DOT, JSON, RSF, Mermaid |
| LLM concern extraction | Done | Claude CLI for semantic BCO/SPF detection |
| MCP server | Done | Expose tools to AI agents via Model Context Protocol with session store |
| Token-budget truncation | Done | Progressive output reduction to fit agent context windows |
| Parse result caching | Done | Mtime-based cache avoids re-parsing unchanged codebases |
| Codebase summarization | Done | Token-efficient overview with package tree, hotspots, hierarchical drill-down |
| Component explanation | Done | API surface, dependencies, cohesion metrics for recovered components |
| Relevance search | Done | Keyword-based entity search with architecture-aware boosting |
| Multi-version evolution pipeline | Planned | Batch version history analysis, A2A cost trends, CVG over time |
| Flexible stopping criteria | Planned | no_orphans, size_fraction strategies for WCA/ARC/LIMBO |
| Additional similarity measures | Planned | UEMNM (normalized UEM) and InfoLoss |
| Architectural Stability metric | Planned | Fan-in/fan-out ratio |
| MCFP-based comparison | Planned | Minimum Cost Flow for accurate entity movement cost |
| Design decision recovery (RecovAr) | Planned | Link issue trackers to architectural changes |
Comparison with ARCADE Core
arcade-agent is a Python successor to the original ARCADE Core Java workbench. The table below compares capabilities across both projects.
High Value
| Feature | ARCADE Core (Java) | arcade-agent (Python) | Notes |
|---|---|---|---|
| LIMBO algorithm | Full | Done (LLM-powered) | Uses Claude CLI concern vectors + size-weighted JS divergence |
| ARC algorithm | Full (concern-based) | Done (LLM-powered) | Uses Claude CLI concern vectors + JS divergence instead of MALLET topics |
| Topic modeling (MALLET) | Full (50 topics, 250 iterations) | LLM-based | arcade-agent uses Claude CLI instead of MALLET for semantic concern analysis |
| Evolution metrics (A2A cost, CVG) | MCFP-based movement cost, coverage | Basic Jaccard comparison | Core computes actual entity movement costs and bidirectional coverage |
| Multi-version batch analysis | VersionMap, VersionTree, batch processing | Single-pair compare | Core can process entire version histories and track trends |
| Stopping/serialization criteria | 3 stopping + 4 serialization strategies | Hardcoded target cluster count | Flexible termination (no-orphans, size-fraction) would improve clustering |
| Similarity measures | 11 (UEMNM, InfoLoss, WeightedJS, ARC variants) | 3 (JS, UEM, SCM) | More measures = better tuning per project type |
Medium Value
| Feature | ARCADE Core (Java) | arcade-agent (Python) | Notes |
|---|---|---|---|
| Architectural Stability metric | Fan-in/fan-out ratio | Missing | Simple addition to existing 6 metrics |
| Concern-based smell detection | Topic distributions for BCO and SPF | LLM-powered (Claude CLI) | Heuristic fallback also available |
| Cluster matching (MCFP) | Minimum Cost Flow for movement cost | Hungarian algorithm on Jaccard | MCFP gives more accurate evolution cost |
| ODEM input format | XML-based dependency parsing | Missing | Academic interchange format, limited real-world use |
| SmellToIssuesCorrelation | Correlates smells with issue tracker data | Missing | Requires issue tracker integration |
Lower Priority
| Feature | ARCADE Core (Java) | arcade-agent (Python) | Notes |
|---|---|---|---|
| RecovAr (Design Decision Recovery) | Full engine (GitLab issues/commits) | Missing | Large scope research feature |
| Issue tracker integration | JIRA + GitLab REST clients | Missing | Needed for RecovAr or SmellToIssues |
| Swing GUI | Full desktop visualization | HTML reports + CLI | HTML/Mermaid is more modern |
| Classycle bytecode analysis | Java bytecode dependency extraction | tree-sitter source parsing | tree-sitter is arguably better (no compilation needed) |
| Make dependency / Understand CSV | C-specific input formats | Missing | Niche; tree-sitter C parser covers the core need |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file arcade_agent-0.1.0.tar.gz.
File metadata
- Download URL: arcade_agent-0.1.0.tar.gz
- Upload date:
- Size: 84.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
044428013daf92bbc43fd612865a0f1d30c7188680211cc30cd14fedf9b3617e
|
|
| MD5 |
0b36875985dd501d3c5631bd7b37ffd4
|
|
| BLAKE2b-256 |
df102915cc3f9c16e791f649868063d88ece8c00adeb925faef61e1db928a1ab
|
Provenance
The following attestation bundles were made for arcade_agent-0.1.0.tar.gz:
Publisher:
publish.yml on lemduc/arcade-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arcade_agent-0.1.0.tar.gz -
Subject digest:
044428013daf92bbc43fd612865a0f1d30c7188680211cc30cd14fedf9b3617e - Sigstore transparency entry: 1738663654
- Sigstore integration time:
-
Permalink:
lemduc/arcade-agent@be7305e0fceeb1604eefa3601ef1c20c562dec0d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/lemduc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@be7305e0fceeb1604eefa3601ef1c20c562dec0d -
Trigger Event:
release
-
Statement type:
File details
Details for the file arcade_agent-0.1.0-py3-none-any.whl.
File metadata
- Download URL: arcade_agent-0.1.0-py3-none-any.whl
- Upload date:
- Size: 94.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3733598ace4d835eb47798297d107d447c9a303c9c7ffcc98a1d31b82bb7024
|
|
| MD5 |
61137ea0e716da7b06ead9351c2d5114
|
|
| BLAKE2b-256 |
345d3a3dc295fa0ff8bd63772963ac6a1ee49dfdccd75b5c325bbfdf090ad399
|
Provenance
The following attestation bundles were made for arcade_agent-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on lemduc/arcade-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arcade_agent-0.1.0-py3-none-any.whl -
Subject digest:
a3733598ace4d835eb47798297d107d447c9a303c9c7ffcc98a1d31b82bb7024 - Sigstore transparency entry: 1738663673
- Sigstore integration time:
-
Permalink:
lemduc/arcade-agent@be7305e0fceeb1604eefa3601ef1c20c562dec0d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/lemduc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@be7305e0fceeb1604eefa3601ef1c20c562dec0d -
Trigger Event:
release
-
Statement type: