ARC
Initializing system000
ARC
Install SDK
ARC TypeScript SDK

Architecture review you can automate.

ARC combines provider-backed reasoning with deterministic validation, eight-dimension scoring, dependency analysis, and Mermaid generation behind one strongly typed API.

Runtime

Node.js 20+

Modules

ESM + CommonJS

Package

@arcinfra/sdk

01

Installation

Install the package in a server-rendered Node.js application. The default provider requires an API key or a custom provider implementation.

npm install @arcinfra/sdk
Server boundary: Never expose provider API keys in browser bundles or React client components.
02

Quick start

Review a repository with operational context, then score the structured result.

import "dotenv/config";
import { Arc } from "@arcinfra/sdk";

const arc = new Arc({
  provider: "openai",
  apiKey: process.env.OPENAI_API_KEY,
});

const review = await arc.architecture.review({
  repository: process.cwd(),
  context: {
    productionTrafficRps: 2_500,
    availabilityTarget: "99.95%",
    constraints: ["SOC 2", "zero-downtime deployments"],
  },
});

console.log(review.summary);
console.table(arc.architecture.score(review));
03

How ARC works

ARC separates deterministic analysis from provider-backed reasoning. Local rules stay fast and repeatable; deeper reviews remain structured and schema-validated.

01

Collect

Bound repository files, specs, manifests, and operational context.

02

Inspect

Run policy rules, build the dependency graph, and detect cycles locally.

03

Reason

Send sanitized, bounded context through the configured AI provider.

04

Validate

Parse the response with Zod and return typed findings and plans.

Architecture inputsARC analysis engineTyped review output
04

Supported inputs

Review one source or combine multiple signals for a richer understanding of the production system.

repository

Local source and architecture-relevant files

architecture

Narrative, components, constraints, and flows

openapi

Serialized OpenAPI contract

terraform

Infrastructure definitions

kubernetes

Deployments, services, policies, and scaling

dockerCompose

Local service topology

mermaid

Existing architecture diagram source

context

Traffic, availability, compliance, cost, and team constraints

05

Provider configuration

OpenAI is the default. Select a provider explicitly for xAI, Gemini, or Claude, or implement AIProvider for an internal gateway.

ProviderIDDefault modelAPI key
OpenAIopenaigpt-5-miniOPENAI_API_KEY
xAIxaigrok-4XAI_API_KEY
Google Geminigeminigemini-2.5-proGEMINI_API_KEY
Anthropic Claudeclaudeclaude-sonnet-4ANTHROPIC_API_KEY
06

Core APIs

architecture.review()

Return structured findings, recommendations, a migration plan, and architecture diagram.

architecture.score()

Calculate eight normalized scoring dimensions without a provider call.

architecture.compare()

Compare strengths, weaknesses, tradeoffs, recommendations, and risk delta.

architecture.optimize()

Improve cost, deployment, performance, security, and scaling.

architecture.explain()

Generate a developer, architect, or executive explanation.

generateDependencyGraph()

Build typed nodes and edges and detect circular dependencies locally.

07

Deterministic validation

Use validateArchitecture() for repeatable operational and design controls without credentials. Deterministic utilities can be imported directly without constructing an ARC client.

Errors

−15

Warnings

−5

Suggestions

−2

Score

0–100

08

Architecture scoring

Scoring is deterministic and normalized across eight dimensions. Use it to establish a baseline, compare revisions, and expose where a high overall number may hide a weak subsystem.

Example review

89/100

Scores are planning signals. They do not replace security, compliance, capacity, or production-readiness review.

Reliability
94
Security
91
Scalability
86
Maintainability
92
Observability
84
Performance
88
Cost efficiency
81
Deployment
90
const review = await arc.architecture.review(input);
const score = arc.architecture.score(review);

console.table(score.dimensions);
console.log(score.overall);
09

Diagram generation

Diagram generation is deterministic and never sends the design to a provider. Choose Mermaid text or a JSON graph.

architecturedeploymentsequencedependencyservice-map
10

Compare, optimize, and explain

A review is the starting point. Use ARC to test alternatives, produce targeted improvements, and translate the same system for different audiences.

architecture.compare()

Strengths, weaknesses, tradeoffs, recommendation, and risk delta.

architecture.optimize()

Cost, deployment, performance, security, scaling, and reliability improvements.

architecture.explain()

Developer, architect, or executive narratives grounded in the review.

const comparison = await arc.architecture.compare({
  left: currentReview,
  right: proposedReview,
  context: "Choose the safer migration path",
});

const optimized = await arc.architecture.optimize({
  review: currentReview,
  priorities: ["security", "deployment", "cost"],
});

const executiveBrief = await arc.architecture.explain({
  review: optimized,
  audience: "executive",
});
11

Configuration reference

apiKeyRequired unless provider is supplied
modelgpt-5-mini
timeoutMs30000
maxRetries2
baseUrlOpenAI default
provideropenai | xai | gemini | claude
12

Reliability and error handling

ARC exposes a typed error hierarchy so applications can distinguish configuration, schema, authentication, rate-limit, timeout, and provider failures.

ConfigurationError

Invalid credentials or client options

ValidationError

Provider output failed Zod validation

AuthenticationError

Provider returned 401 or 403

RateLimitError

Rate limiting survived configured retries

TimeoutError

Attempt exceeded timeoutMs

ResponseError

Invalid JSON or response shape

Retry policy

Network failures and 408, 429, 500, 502, 503, and 504 responses retry with capped exponential backoff from 250 ms to 2 seconds.

Cancellation and logging

Provider-backed operations accept an AbortSignal. The default logger is silent; custom loggers receive metadata without prompts, keys, headers, or response bodies.

13

Security and runtime boundaries

Server only

Arc client construction, OpenAIProvider, API credentials, provider calls, and private application context.

Browser-safe core

Exported Zod schemas, deterministic validation, diagram generation, and public utility types.

14

Runtime and module compatibility

Node.js

20 or newer

Module formats

ESM + CommonJS

TypeScript

Declarations included

Provider requests use the native Node.js fetch implementation. Keep repository access and provider-backed client construction on a trusted server. Import deterministic utilities directly when no provider call is required.