> ## Documentation Index
> Fetch the complete documentation index at: https://docs.skia.money/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture

> How the Skia repo maps onto docs.skia.money, sdk.skia.money, api.skia.money and mcp.skia.money — the surfaces, the runtime, and the developer journey.

# Architecture

GitHub is the **source of truth**. Four surfaces are fed from it — two
documentation sites, one API runtime, and one MCP server — all in front of a
Cloudflare zone you already own.

| Host | Serves | Built from | Wiring |
| - | - | - | - |
| `skia.money` | Landing page | operator site | Cloudflare zone (live) |
| `docs.skia.money` | General developer docs (this site) | `docs/` (Mintlify) | GitHub ↔ Mintlify ↔ Cloudflare DNS |
| `sdk.skia.money` | SDK-specific docs | `sdk-docs/` (Docusaurus) | GitHub ↔ Pages build ↔ Cloudflare DNS |
| `api.skia.money` | The API runtime | repo root (Next.js standalone) | GitHub ↔ Fly.io |
| `mcp.skia.money` | MCP server | `mini-services/mcp-server/` (port 3020) | same host as the API |

The split between the two doc sites is deliberate:

* **Mintlify** (`docs.skia.money`) = protocol + API. Concepts, the golden
  path, and the API Reference generated from the spec of record.
* **Docusaurus** (`sdk.skia.money`) = package-level SDK reference.
  Installation, configuration, authentication, error taxonomy, advanced usage,
  migration guides for `@skia-money/sdk`.

Each cross-links to the other; neither duplicates the other's content.

## What lives in the repo

```
├── docs/                     # Mintlify root (this site) + the spec of record + release notes + ops runbooks
│   └── mvp-spec-v0.4.7.yaml  # OpenAPI 3.1.0 — the contract everything renders from
├── sdk-docs/                 # Docusaurus root (the SDK site)
├── packages/skia-sdk/        # @skia-money/sdk — the hardened TypeScript client
├── mini-services/mcp-server/ # the MCP server (Streamable HTTP, JSON-RPC 2.0)
├── contracts/                # seven CREATE2-verified contracts (SwapERC20, SkiaAccount, SkiaPaymaster, ...)
├── deployments/              # canonical deployment pins per lane (*.json)
└── src/
    ├── app/api/              # the 23 /api settlement-primitive paths
    ├── app/v1/               # the 8 /v1 invoice-ledger paths
    └── lib/server/           # the fold, ledger, payment-intent service, issuance gate, error registry
```

## The runtime model

* **Engine**: Next.js standalone + Prisma/SQLite. Quote, commit, reveal,
  wallets, smart accounts, tiering, and the whole invoice ledger live here.
* **Rail**: the existing `swap()` lane on `SwapERC20` — invoice payments
  resolve into the same commit/reveal Order flow, byte-identical wire.
* **Sponsorship**: ERC-4337 smart accounts (`SkiaAccount` + factory),
  `SkiaPaymaster`, and policy contracts (`SkiaDefaultPolicy` / `ISponsorPolicy`).
* **Keys**: role keys live in `.env` on the origin machine only — never in any
  Cloudflare-side surface. The key ceremony for mainnet is a separate ritual.
* **MCP**: the hosted mini-service is a thin honest proxy — the MCP surface
  never forks settlement logic; it forwards to the same REST handlers.

## The journey, end to end

**Step 1**

Discover at `skia.money` (landing).

**Step 2**

Read concepts at `docs.skia.money` (this site).

**Step 3**

Integrate the SDK — the guide here links to `sdk.skia.money` for the full package reference.

**Step 4**

Check exact wire detail in the generated API Reference here.

**Step 5**

Call `api.skia.money` — or drive everything through `mcp.skia.money`.

> [!NOTE]
>
> Operational wiring details — Mintlify root-directory setup, the Docusaurus
> build commands, Fly.io, DNS records, and the Cloudflare Tunnel fallback — are
> in the repo runbook `docs/README.md`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.