Skip to content
Arxo Arxo

analyze_architecture

Run a comprehensive architecture analysis on your project. This is the primary tool for obtaining metrics such as SCC (cycles), coupling, propagation cost, centrality, and more.

ParameterTypeRequiredDescription
project_pathstringYesAbsolute or relative path to the project root directory
presetstringNoAnalysis preset name (see Presets)
config_pathstringNoPath to a custom arxo.yaml configuration file

Use presets to run a focused analysis instead of all metrics:

PresetMetricsSpeedUse case
quickscc, l1_overview, centralityFast (~seconds)Pre-commit sanity check
ciscc, smells, layer_violations, architecture_budgetingModerateCI/CD pipeline gate
riskricci_curvature, centrality, msr (includes hotspot score), ownership, truck_factor, causal_discovery, semantic_duplicatesModerateDefect and change risk
couplingpropagation_cost, msr (includes hotspot and co-change analysis), coupling_analysis, decoupling_level, clustered_cost_cochange, semantic_duplicatesSlowDeep coupling audit
securitysecurity, sensitive_data_flow, effect_violationsModerateSecurity analysis
runtimecloud_cost, traffic_hotspot, critical_path, centrality, runtime_drift, sensitive_data_flow, test_coverageModerateRuntime/performance analysis (requires telemetry)
aillm_integration, ml_architecture, rag_architecture, finetuning_architecture, agent_architectureModerateLLM/AI integration audit
ragrag_architecture, llm_integrationFastRAG-specific analysis
fullAll 52 metricsVery slowComprehensive review

Returns a JSON summary with computed metrics and any policy violations.

{
"results": [
{
"id": "string", // Metric ID (e.g., "scc", "centrality")
"version": "string", // Metric version (e.g., "1.0.0")
"data": [ // Metric data entries (key + typed value)
{ "key": "string", "value": { "kind": "number", "v": 0.0 } }
],
"findings_count": "number" // Number of findings/evidence items
}
],
"violations": [ // Policy violations (if any)
{
"metric": "string",
"expected": "number",
"actual": "number",
"operator": "string"
}
],
"violations_count": "number"
}

Request:

{
"project_path": ".",
"preset": "quick"
}

Response:

{
"results": [
{
"id": "scc",
"version": "2.0.0",
"data": [
{ "key": "scc.cycle_count", "value": { "kind": "number", "v": 2 } },
{ "key": "scc.max_cycle_size", "value": { "kind": "number", "v": 5 } },
{ "key": "scc.total_nodes_in_cycles", "value": { "kind": "number", "v": 8 } }
],
"findings_count": 2
},
{
"id": "centrality",
"version": "1.0.0",
"data": [
{ "key": "centrality.module.betweenness_max", "value": { "kind": "number", "v": 0.42 } },
{ "key": "centrality.module.max_fan_in", "value": { "kind": "number", "v": 12 } },
{ "key": "centrality.module.max_fan_out", "value": { "kind": "number", "v": 8 } }
],
"findings_count": 3
}
],
"violations": [],
"violations_count": 0
}

Request:

{
"project_path": "/path/to/project",
"preset": "ci"
}

Response:

{
"results": [
{
"id": "scc",
"version": "2.0.0",
"data": [
{ "key": "scc.max_cycle_size", "value": { "kind": "number", "v": 5 } }
],
"findings_count": 1
},
{
"id": "smells",
"version": "2.0.0",
"data": [
{ "key": "smells.hubs.count", "value": { "kind": "number", "v": 2 } },
{ "key": "smells.god_components.count", "value": { "kind": "number", "v": 1 } }
],
"findings_count": 3
}
],
"violations": [
{
"metric": "scc.max_cycle_size",
"expected": 0,
"actual": 5,
"operator": "<="
}
],
"violations_count": 1
}

Request:

{
"project_path": "/path/to/myproject",
"preset": "full",
"config_path": "/path/to/myproject/custom-arxo.yaml"
}
ErrorCauseSolution
missing required parameter: project_pathproject_path not providedInclude project_path in request
No such file or directoryInvalid project pathVerify path exists and is accessible
Unknown preset: xyzInvalid preset nameUse list_presets to see valid options
Failed to load configInvalid YAML in config fileCheck YAML syntax in config_path
Analysis timeoutLarge project or slow metricsUse a faster preset (quick or ci) or increase timeout
  • Caching: Results are cached by (project_path, config_hash, preset). Repeated calls with identical parameters return cached results instantly.
  • Cache TTL: Default 300 seconds (5 minutes). Configure via --cache-ttl server argument.
  • Speed comparison:
    • quick: 1-5 seconds (small projects), 10-30 seconds (large monorepos)
    • ci: 5-15 seconds (small), 30-90 seconds (large)
    • full: 30-120 seconds (small), 2-10 minutes (large)
Terminal window
# Same as analyze_architecture with quick preset
arxo analyze --preset quick
# Same as analyze_architecture with custom config
arxo analyze --config custom-arxo.yaml --preset ci