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
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/sdkQuick 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));How ARC works
ARC separates deterministic analysis from provider-backed reasoning. Local rules stay fast and repeatable; deeper reviews remain structured and schema-validated.
Collect
Bound repository files, specs, manifests, and operational context.
Inspect
Run policy rules, build the dependency graph, and detect cycles locally.
Reason
Send sanitized, bounded context through the configured AI provider.
Validate
Parse the response with Zod and return typed findings and plans.
Supported inputs
Review one source or combine multiple signals for a richer understanding of the production system.
repositoryLocal source and architecture-relevant files
architectureNarrative, components, constraints, and flows
openapiSerialized OpenAPI contract
terraformInfrastructure definitions
kubernetesDeployments, services, policies, and scaling
dockerComposeLocal service topology
mermaidExisting architecture diagram source
contextTraffic, availability, compliance, cost, and team constraints
Provider configuration
OpenAI is the default. Select a provider explicitly for xAI, Gemini, or Claude, or implement AIProvider for an internal gateway.
openaigpt-5-miniOPENAI_API_KEYxaigrok-4XAI_API_KEYgeminigemini-2.5-proGEMINI_API_KEYclaudeclaude-sonnet-4ANTHROPIC_API_KEYCore 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.
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
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.
const review = await arc.architecture.review(input);
const score = arc.architecture.score(review);
console.table(score.dimensions);
console.log(score.overall);Diagram generation
Diagram generation is deterministic and never sends the design to a provider. Choose Mermaid text or a JSON graph.
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",
});Configuration reference
apiKeyRequired unless provider is suppliedmodelgpt-5-minitimeoutMs30000maxRetries2baseUrlOpenAI defaultprovideropenai | xai | gemini | claudeReliability and error handling
ARC exposes a typed error hierarchy so applications can distinguish configuration, schema, authentication, rate-limit, timeout, and provider failures.
ConfigurationErrorInvalid credentials or client options
ValidationErrorProvider output failed Zod validation
AuthenticationErrorProvider returned 401 or 403
RateLimitErrorRate limiting survived configured retries
TimeoutErrorAttempt exceeded timeoutMs
ResponseErrorInvalid 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.
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.
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.
