Rensei docs

Arch

show/browse/synthesize/assess.

rensei arch is the native architectural intelligence browser: it surfaces what the platform has inferred about your project's structure - patterns, conventions, architectural decisions, and active drift alerts - and lets you export that understanding as markdown, Mermaid, or JSON for onboarding, code review, or compliance.

rensei arch is a platform-native surface. The platform's architectural-intelligence read path is implemented directly over graph_nodes (no OSS SDK) - see the Arch query layer. The OSS architectural-intelligence contracts are documented at donmai.dev/docs/architectural-intelligence.

The command group has four verbs: show (summary counts), browse (drill-down by node kind), synthesize (export as a document), and assess (drift alerts).


Commands

arch show

Print a count summary of all inferred architectural nodes for a project: patterns, conventions, decisions, and active drift alert count.

rensei arch show [<project-slug>]
rensei arch show
rensei arch show my-fintech-app

If no slug is provided, the active project (set via rensei setup) is used.

Example output:

─── Architectural Intelligence ───────────────────

Patterns:    14
Conventions: 9
Decisions:   6
Drift:       2 active

Total nodes: 31
As of:       2026-06-02T13:45:00Z

Each count reflects nodes the platform's analysis pipeline has inferred from your codebase. Drift shows the number of active deviation alerts - use arch assess to see their details, or arch browse --kind drift to drill into them.


arch browse

List inferred architectural nodes grouped by kind, optionally filtered to one kind. Each entry includes a title, description, the paths that informed the inference, and a confidence score.

rensei arch browse [<project-slug>] [--kind <kind>]
FlagDescription
--kindFilter to a specific kind: patterns, conventions, decisions, or drift
rensei arch browse
rensei arch browse my-fintech-app
rensei arch browse --kind drift
rensei arch browse my-fintech-app --kind decisions

Example output (unfiltered, truncated):

─── Patterns (14): ───────────────────────────────
  Repository pattern
    All DB access is mediated through typed repository classes; no
    raw SQL outside platform/src/lib/db/repositories/.
    paths: platform/src/lib/db/repositories/
    confidence: 94%

  Middleware-first auth
    Auth is enforced at Next.js middleware layer; individual routes
    never re-check session validity.
    paths: platform/src/middleware.ts, platform/src/app/api/
    confidence: 88%

─── Conventions (9): ─────────────────────────────
  Drizzle for ORM
    Drizzle ORM chosen over Prisma (ADR-2024-11-07). Migrations
    managed via drizzle-kit.
    paths: platform/src/lib/db/schema/, platform/drizzle.config.ts
    confidence: 99%

─── Decisions (6): ───────────────────────────────
  WorkOS for identity
    WorkOS provides org management, SSO, and CLI Auth device flow.
    Switching requires ADR + WorkOS data export.
    paths: platform/src/lib/workos/
    confidence: 97%

─── Drift / Deviations (2): ──────────────────────
  RENSEI_ prefix on env vars [high]
    Provider env vars must never carry the RENSEI_ prefix; that
    namespace is reserved for daemon internals.
    detected: 2026-06-01T09:14:00Z

  Missing git-root .env.local permission [medium]
    .env.local is world-readable; recommend chmod 600.
    detected: 2026-05-30T11:00:00Z

Each entry in the drift section is a deviation alert. Pass --kind drift to focus on alerts only (same output as arch assess but without the time-bound filter).


arch synthesize

Export the inferred architectural graph as a structured document. Useful for generating onboarding docs, architecture reviews, or machine-readable graph exports.

rensei arch synthesize [<project-slug>] [--format markdown|mermaid|json] [-o <file>]
FlagDefaultDescription
--formatmarkdownOutput format: markdown, mermaid, or json
-o, --outputstdoutWrite output to a file instead of printing to stdout
# Print markdown to stdout
rensei arch synthesize

# Write to a file
rensei arch synthesize --format markdown -o ARCHITECTURE.md

# Mermaid graph for embedding in a diagram tool
rensei arch synthesize --format mermaid

# Full JSON graph for tooling / API use
rensei arch synthesize --format json -o arch-export.json
rensei arch synthesize my-fintech-app --format markdown

When -o is provided, the command prints a confirmation line instead of the document:

✓ Wrote 31-node architecture to ARCHITECTURE.md

Mermaid output (excerpt):

graph TD
  P1[Repository pattern] --> C1[Drizzle for ORM]
  P1 --> C2[postgres-js for raw queries]
  D1[WorkOS for identity] --> P2[Middleware-first auth]
  D2[Redis for session state] --> P2

JSON output shape:

{
  "projectId": "proj_xyz",
  "asOf": "2026-06-02T13:45:00Z",
  "nodeCount": 31,
  "patterns": [
    {
      "title": "Repository pattern",
      "description": "All DB access is mediated through typed repository classes...",
      "confidence": 0.94,
      "paths": ["platform/src/lib/db/repositories/"]
    }
  ],
  "conventions": [...],
  "decisions": [...],
  "drift": [...]
}

arch assess

List active drift/deviation alerts detected within a time window. Drift alerts flag codebase changes that diverge from established conventions or decisions inferred by the pipeline.

rensei arch assess [<project-slug>] [--since <ISO-8601>]
FlagDescription
--sinceISO-8601 lower bound for the drift window. Default: 30 days ago.
rensei arch assess
rensei arch assess my-fintech-app
rensei arch assess --since 2026-01-01T00:00:00Z

Example output:

─── Drift Alerts (2): ────────────────────────────

  High:   2
  Medium: 1
  Low:    0

  RENSEI_ prefix on env vars [high]
    Provider env vars must never carry the RENSEI_ prefix; that
    namespace is reserved for daemon internals.
    detected: 2026-06-01T09:14:00Z

  Missing git-root .env.local permission [medium]
    .env.local is world-readable; recommend chmod 600.
    detected: 2026-05-30T11:00:00Z

Since: 2026-05-03T00:00:00Z

Drift severities are high, medium, and low. arch assess is useful before code review, before proposing architectural changes, and during onboarding when validating a design against existing decisions.

arch assess and arch browse --kind drift show the same underlying alerts. assess adds the time-window filter; browse --kind drift integrates with the full node-by-kind view.


Node kinds reference

Each architectural node belongs to one of four kinds:

KindWhat it representsExample
patternsRecurring structural patterns inferred from the codebase"Repository pattern - all DB access through typed repositories"
conventionsCoding conventions the team follows consistently"Drizzle ORM for all schema definitions"
decisionsArchitectural choices with rationale (equivalent to ADRs)"WorkOS for identity - switching requires ADR + data export"
driftDeviations from established patterns or conventions"RENSEI_ prefix on provider env vars - reserved for daemon internals"

Confidence scores (0-100%) reflect how consistently the platform observed the pattern or convention across the codebase. Decisions inferred from explicit ADR documents typically show 95-99% confidence.


Architecture corpus

rensei arch reads the inferred architecture of your project - nodes derived from the codebase by the platform's continuous analysis pipeline. This is distinct from the static architecture documents (ADRs, design docs), which are accessed via separate internal tooling.

The platform has access to two corpora:

CorpusVisibilityContents
donmai-architectureOSS-canonicalShared architecture contracts, provider interfaces, workflow grammar, kit manifest, A2A protocol
rensei-architecturePlatform-privatePlatform-specific ADRs, credential family design, BFSI compliance extensions, workspace layout

When a document appears in both corpora, the rensei-architecture version takes precedence. If a proposed change conflicts with a corpus document, open an ADR in the appropriate corpus before proceeding - the corpora win on conflict.


On this page