/uni:unifrom uni
Write idiomatic Scala 3 code with Uni — a unified library for object wiring, logging, JSON/MessagePack, HTTP, RPC, MCP, CLI, and testing on JVM, Scala.js, and Scala Native. Replaces Airframe.
Ships in uni. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Uni is one Scala 3 library (org.wvlet.uni) for object wiring, logging, JSON/MessagePack,
Rx, HTTP (with SSE and WebSocket), RPC, MCP servers, CLI tools, and testing, and
the same code runs on JVM, Scala.js, and Scala Native. It replaces Airframe; the package root is wvlet.uni.*.
// build.sbt — use the latest version from
// https://repo.wvlet.org/maven2/org/wvlet/uni/uni_3/maven-metadata.xml (or the one already in the build)
resolvers += "wvlet" at "https://repo.wvlet.org/maven2"
libraryDependencies ++= Seq(
"org.wvlet.uni" %% "uni" % "<version>",
"org.wvlet.uni" %% "uni-test" % "<version>" % Test
)
testFrameworks += new TestFramework("wvlet.uni.test.Framework")
// Optional, JVM only: serve Http.server on Netty instead of the built-in server
libraryDependencies += "org.wvlet.uni" %% "uni-netty" % "<version>"
On sbt 2.x use %% for all platforms. On sbt 1.x use %%% for Scala.js and
Scala Native.
Every release is on https://repo.wvlet.org/maven2; only some reach Maven
Central, so an application keeps the wvlet resolver above. A library published to
Maven Central should depend on a Central version and not add that resolver.
| Task | Import | Entry point |
|---|---|---|
| Object wiring | wvlet.uni.design.Design | Design.newDesign.bindSingleton[A].build[A] { a => ... } |
| Logging | wvlet.uni.log.LogSupport | class A extends LogSupport then info(...), debug(...) |
| JSON / MessagePack codec | wvlet.uni.weaver.Weaver | case class P(...) derives Weaver, Weaver.toJson(p), Weaver.fromJson[P](json); Instant, LocalDate, LocalTime (ISO strings), UUID built in |
| JSON tree | wvlet.uni.json.JSON | JSON.parse(text) |
| YAML config / frontmatter | wvlet.uni.text.yaml.{YAML, Frontmatter} | YAML.fromYaml[P](text), YAML.parse(text), Frontmatter.parse(md).as[P], YAML.parseDocument(text).set(path, v).toYaml (keeps comments), YAML.parseDocuments/YAML.writeStream for --- streams; see references/core.md |
| Markdown to HTML | wvlet.uni.text.markdown.{Markdown, MarkdownConfig} | Markdown.toHtml(md) (raw HTML escaped by default), Markdown.parse(md), .frontmatterAs[P], .toMarkdown (lossless); see references/core.md |
| Cron schedules | wvlet.uni.text.cron.{Cron, UtcOffset} | Cron.parse(expr).next(instant), .nextN(instant, n), .describe; UTC or a fixed UtcOffset only; see references/core.md |
| CSV / TSV | wvlet.uni.text.csv.{CSV, TSV, CSVReader} | CSV.read[P](text), CSV.parse(text), CSV.readFile[P](path) (streams; close if you stop early), CSV.write(values); TSV uses backslash escapes and \N, TSV.quoted for spreadsheet TSV; see references/core.md |
| Parquet files, Iceberg and Delta tables | wvlet.uni.cloud.parquet.{Parquet, ParquetReadOptions, ParquetFilter, ParquetWriteOptions, ParquetDatasetWriteOptions, ParquetSchema, ParquetType} | Parquet.readAs[A](path), Parquet.readRows(path) for Map[String, Any] rows, Parquet.readJson(path), Parquet.open(path).readRowGroup(i) for column vectors, Parquet.openUrl(url) over HTTP Range requests, Parquet.openS3("s3://bucket/key", config) from S3/R2/MinIO, Parquet.openGcs("gs://bucket/key") from Google Cloud Storage, Parquet.openAzure("az://container/key") from Azure Blob, Parquet.dataset("s3://bucket/prefix/" or a local dir or a glob such as s3://b/t/dt=2026-11-*/, or a Seq of files) for a folder of files with key=value partition columns and file skipping; Parquet.writeDataset(root, rows, ParquetDatasetWriteOptions.default.withPartitionBy("dt")) or Parquet.newDatasetWriter[A](root, options) writes one back (modes ErrorIfExists, Append, Overwrite, OverwritePartitions); Parquet.write(path, rows), Parquet.newWriter[A](path), Parquet.newRecordWriter(path, schema) for writing, Parquet.newBatchWriter(path, schema) for ColumnBatches; wvlet.uni.cloud.arrow.Arrow.newStreamWriter(out, schema) / Arrow.toStreamBytes(schema, batches) deliver those batches as Arrow IPC to pyarrow, polars, and Arrow JS; withTableFormat(ParquetTableFormat.Iceberg) writes Iceberg tables, and wvlet.uni.cloud.iceberg.Iceberg.{deleteRows, updateRows, compactTable, alterTable} change them; wvlet.uni.cloud.plazma.MPC1.newWriter() / MPC1.open(path).readRows(Seq(cols*)) write and read MPC1 (column-oriented MessagePack) files; pure Scala on every platform; see references/parquet.md |
| LLM vendor APIs | wvlet.uni.ai.anthropic.*, wvlet.uni.ai.openai.*, wvlet.uni.ai.gemini.*, wvlet.uni.ai.* | AnthropicClient(AnthropicConfig.fromEnv).messages(req) / .stream(req), OpenAIClient(...).responses / .streamResponses / .chatCompletions / .streamChatCompletions, GeminiClient(...).generateContent(model, req); Bedrock via AnthropicHost.Bedrock(region) and OpenAIConfig.bedrock(region); convert vendors with AnthropicConverter.toLlmRequest and XxxConverter.fromLlmRequest / StreamDecoder / StreamEncoder; see references/llm.md |
| S3 / R2 / MinIO / Google Cloud Storage / Azure Blob objects | wvlet.uni.cloud.storage.{ObjectStore, ObjectUri, S3Config, GcsConfig, AzureConfig, StorageException}, wvlet.uni.cloud.{AwsCredentialsProvider, GoogleCredentialsProvider, AzureCredentialsProvider, CloudException} | ObjectStore.s3(config), ObjectStore.gcs(config) (Google Application Default Credentials), or ObjectStore.azure(config) (az://container/blob) then get, getRange, head, put, list, delete, newOutputStream (multipart; abort() on error), presign; ...Async variants for browsers; S3Config.r2(accountId), S3Config.gcs (HMAC), S3Config.minio(url); AzureConfig().withSharedKey(account, key), .withSasToken(token), AzureConfig.fromConnectionString(s), AzureConfig.azurite(); see references/storage.md |
| Reactive streams | wvlet.uni.rx.Rx | Rx.variable(v), Rx.single(v), .map, .flatMap, .scan(init)(f), items.split(_.id) (one Rx per key); see references/rx.md |
| Concurrent blocking code (JVM, Native) | wvlet.uni.control.Fiber | Fiber { f() }.join(), Fiber.parMap(items, maxConcurrency = 16)(f), Fiber.par(a, b), Fiber.race(a, b), Fiber.scope { s => s.fork(...) }; virtual threads on JDK 24+; not on Scala.js (use RxFiber); see references/rx.md |
| Persisted settings | wvlet.uni.util.settings.SettingStore | SettingStore.of[A].withAppName(app).withXXX(...).load(fileName); see references/core.md |
| HTTP client | wvlet.uni.http.{Http, Request} | Http.client.newSyncClient.send(Request.get(url)) |
| HTTP server (all platforms) | wvlet.uni.http.Http | Http.server.withPort(8080).withRxHandler(handler).start() with uni alone; on the JVM a built-in server (JDK 24+), or Netty when uni-netty is on the classpath; JVM-only projects can use Netty.server (wvlet.uni.http.netty.Netty); see references/http-server.md |
| REST router (all platforms) | wvlet.uni.http.router.{Router, RouterHandler} | references/http-server.md |
| Tracing and metrics (all platforms) | wvlet.uni.telemetry.Telemetry, wvlet.uni.telemetry.otlp.OtlpConfig, wvlet.uni.http.TelemetryFilter | Telemetry().withServiceName(n).withOtlp(OtlpConfig()), Http.server.withFilter(TelemetryFilter(t)), Http.client.withTelemetry(t); W3C traceparent; MCP.server.withTelemetry(t), MCP.client.withTelemetry(t), and LLM clients given Http.client.noRetry.withTelemetry(t).newAsyncClient add MCP and GenAI spans; see references/http-server.md |
| Typed RPC | wvlet.uni.http.rpc.RPCRouter, wvlet.uni.http.rpc.RPCHandler | references/rpc.md |
| MCP server (stdio) | wvlet.uni.ai.mcp.MCP, wvlet.uni.surface.description | MCP.server.withName(n).withTools[T](impl).serveStdio() |
| MCP client (HTTP) | wvlet.uni.ai.mcp.MCP | MCP.client.withName(n).connect(url) returns Rx[MCPClient] |
| Off-heap memory | wvlet.uni.canvas.{Canvas, OffHeapMemoryAllocator} | Canvas.newOffHeapCanvas(size) (Long offsets, beyond 2 GB), readInt/writeLong (little-endian; *BigEndian variants), close() frees it now; JVM needs Java 22+; see references/core.md |
| Retry | wvlet.uni.control.Retry | Retry.withBackOff().run { ... } |
| CLI arguments | wvlet.uni.cli.launcher.* | Launcher.execute[A](args) on a case class with @option fields |
| Terminal emulator | wvlet.uni.cli.term.TerminalEmulator, wvlet.uni.dom.TerminalView (Scala.js) | term.write(output), term.screen.text; TerminalView(term) draws it in the DOM; PosixPty.spawn (JVM, Native) or NodePty.spawn (Scala.js) runs a shell in a PTY; see references/cli.md |
Browser UI (Scala.js; uni-ui artifact for components) | wvlet.uni.dom.all.*, wvlet.uni.ui.* | class V extends RxElement: def render = div(...), V().renderTo("app"); Button("Send").primary.onClick(() => send()), Input(textVar), Menu(openVar, trigger = element, entries = Seq(MenuItem("Copy").onSelect(f))), Dialog(openVar, content = element), VirtualList(itemsRx, rowHeight = 24, key = _.id, render = a => node), Dock(layoutVar, label = "Dock", panels = Seq(DockPanel(id, title = "...", content = element))); render lists with itemsRx.each(_.id)(render); .onChange(d => if ... then d.cancel()) sees and can refuse each change a component makes; UiAgent.install() lets an AI agent snapshot and operate the UI, UiTelemetry.install(UiTelemetrySink.relay()) records which components people use, and UiHistory.record() undoes its changes (undoSource(ChangeSource.Agent), stage(label)) without overwriting later edits; load uni-ui.css and restyle with --uni-* variables; see references/ui.md |
| Unit tests | wvlet.uni.test.* | class T extends UniTest: test("...") { x shouldBe y } |
| Error-path tests | wvlet.uni.test.* | val logs = captureLogs { ... }; logs.warnings shouldContain "..." |
| Fuzz tests | wvlet.uni.test.fuzz.FuzzConfig | fuzz("target", FuzzConfig().withSeedBytes(...).withExpectedCases { case _: MyError => }) { bytes => parse(bytes) } |
The Scala Toolkit (sttp, uPickle, os-lib, MUnit) is a good fit for scripts, teaching, Scala 2.13 or Scala 3 before 3.9, and running subprocesses (os-lib). Uni fits Scala 3.9+ applications and services that need object wiring, logging, an HTTP server, RPC, MCP servers, or the same code on Scala.js and Scala Native. They work in one build: keep the Toolkit libraries a project already uses, and use Weaver for types that Uni's server or RPC encodes. See https://wvlet.org/uni/guide/uni-vs-scala-toolkit.
given/using,
enum, derives. Omit new for classes (StringBuilder()).(x >= 1) shouldBe true, not
x should be >= 1. For type checks, v shouldMatch { case _: T => } instead of
asInstanceOf. Use shouldNotBe, shouldContain, intercept[E] { ... }.Logger.of[X].suppressWarnings. In tests, wrap the
code in captureLogs { ... } and assert on logs.warnings; see
references/testing.md.UniTest. Use import wvlet.uni.test.*; shouldBe defined
and shouldBe empty need the matcher objects from that package.isSuccessful after send. The HTTP client throws on non-2xx:
HttpException for most 4xx, HttpMaxRetryException (not a subclass) after
retrying 5xx/429. RPC client calls fail the same way. Report server errors
with ServiceStatus.NOT_FOUND_U5.newException("...") (wvlet.uni.http) from
RPC, Router, or any Http.server handler: the response gets its HTTP
status. RPCStatus is its deprecated old name.derives Weaver to the case class.uni-netty just to serve HTTP or RPC. Http.server, RouterHandler
(wvlet.uni.http.router), and RPCHandler (wvlet.uni.http.rpc) are in uni on
every platform, and limits and timeouts (withMaxHeaderSize, withIdleTimeoutMillis,
noRequestDecompression, ...) are set on Http.server for every backend. Add
uni-netty only for Netty's own options (native transport, handler executor threads)
or a JDK before 24.Weaver for types that Uni's server or RPC encodes.wvlet.airframe.*, wvlet.log.*, and wvlet.airspec.*
are the old library. Map them with references/airframe-migration.md.addDesign / addTestDesign in a trait that extends UniTest, and take them as test
arguments: test("ping") { (client: HttpSyncClient) => ... }. A self-type fixture
(trait F { this: UniTest => }) compiles, but only the last one's hooks run. See
references/testing.md.Design build them; bind interfaces with bindImpl[A, B] and values with
bindInstance[A](v).Read the reference for the task before writing code:
| Task | Reference |
|---|---|
| Object wiring, logging, JSON, YAML, Markdown, cron, CSV/TSV, persisted settings, off-heap memory, retry, MCP server | references/core.md |
| Typed RPC service, server, generated client, and streaming results | references/rpc.md |
| HTTP client | references/http-client.md |
Reading Parquet files, partitioned datasets, Delta Lake tables, or Apache Iceberg tables (local, bytes, HTTP, S3, GCS, Azure Blob) into case classes, Map[String, Any] rows, JSON, or column vectors, and writing files or partitioned datasets from case classes, maps, JSON, or column batches | references/parquet.md |
| Calling Anthropic, OpenAI, or Gemini LLM APIs (also Claude and OpenAI models on Bedrock) (streaming and not), and converting requests and streams between vendors | references/llm.md |
| Reading and writing objects in S3, Cloudflare R2, MinIO, Google Cloud Storage, or Azure Blob Storage; AWS, Google, and Azure credentials; presigned, signed, and SAS URLs | references/storage.md |
| HTTP server, REST controllers, filters, CORS | references/http-server.md |
| Unit, HTTP, RPC, property, and uni-dom UI tests; test tags | references/testing.md |
Rx operators, RxRef/RxDeferred/RxSemaphore, fibers (RxFiber and direct-style Fiber), parallelism | references/rx.md |
| Server-sent events and WebSocket (server and client) | references/streaming.md |
| OpenAPI document from REST routers | references/openapi.md |
| Browser UI: RxElement, uni-ui components, styling, DOM tests (Scala.js) | references/ui.md |
| Electron desktop app (RPC over IPC, Scala.js) | references/electron.md |
| CLI options and sub-commands, colors, progress bars, terminal emulator | references/cli.md |
| Migrating from Airframe | references/airframe-migration.md |
<page>.md)references/airframe-migration.md (opens in a new tab)references/cli.md (opens in a new tab)references/core.md (opens in a new tab)references/electron.md (opens in a new tab)references/http-client.md (opens in a new tab)references/http-server.md (opens in a new tab)references/llm.md (opens in a new tab)references/openapi.md (opens in a new tab)references/parquet.md (opens in a new tab)references/rpc.md (opens in a new tab)references/rx.md (opens in a new tab)references/storage.md (opens in a new tab)references/streaming.md (opens in a new tab)references/testing.md (opens in a new tab)references/ui.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub wvlet/uni --plugin uniOther plugins' skills for the same job