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

# Example workspaces

> A guided tour of the runnable example workspaces that ship with rbs.

The rbs source repository ships a set of small, self-contained example workspaces under `examples/`. Each one has its own `WORKSPACE.rbs` and `BUILD.rbs`, downloads any tools it needs automatically, and can be run in place:

```bash theme={null}
cd examples/hello-world
rbs query //...        # see what's defined
rbs run :hello         # run a target
```

* `cd examples/hello-world` — enters the example from the repository root; expect no output on success.
* `rbs query //...` — lists its targets; expect `hello`, `greet`, `create_file` and `show_greeting`.
* `rbs run :hello` — runs the greeting; expect `Hello, World!`.

They are the fastest way to learn a feature: find the example closest to what you're building and read its build files.

## Start here

Work through these four in order — they build on each other.

**1. hello-world**

The basics of `native.task`: run commands, declare `outputs`, and chain targets with `deps`. Three files, two minutes.

**2. file-processing**

File transformations with `native.genrule` — declared inputs and outputs, shell commands, and a tool (`jq`) downloaded and verified automatically.

**3. tool-usage**

Structured tool execution with `native.run_tool`: precise argument lists, environment variables, and tools registered as toolchains.

**4. build-chain**

A complete pipeline that mixes `task`, `genrule`, and `run_tool` into a multi-step workflow producing an HTML report.

Two more round out the fundamentals:

* **filegroup-glob-demo** — collecting sources with `glob()` and grouping them with `native.filegroup`.
* **scaffolding-demo** — code generation from templates with `rbs scaffold`: variable substitution in file names (`__className__.py`) and content (`<%= className %>`), with Python, React, and API templates to copy from.

## Language toolchains

Each of these demonstrates a hermetic toolchain: rbs downloads the pinned compiler or runtime on first build, so no system installation is required.

> [card] go-hello
>
> `go_binary` and `go_library` with an auto-downloaded Go SDK.

> [card] c-hello / cxx-hello
>
> `c_binary`, `cxx_binary`, and `cxx_library` using a Zig-backed hermetic C/C++ toolchain — no system clang or gcc.

> [card] dotnet-hello
>
> `dotnet_binary` with an auto-downloaded .NET 8 SDK, running a real `dotnet publish`.

> [card] kotlin-hello
>
> `kotlin_binary` and `kotlin_library`, plus Kotlin linting with `kt_lint`.

> [card] java-springboot
>
> A Spring Boot web app: `java_binary`, `java_test` with JUnit 5 auto-included, Maven dependencies, and coverage via `rbs coverage`.

> [card] kotlin-springboot
>
> The Spring Boot story in Kotlin — JUnit 5 tests with automatic test dependencies and LCOV coverage.

> [card] django-blog
>
> A full Django application on the managed Python toolchain, with pip dependencies resolved by rbs directly.

> [card] nodejs-express
>
> An Express server on a hermetic Node.js runtime — npm packages fetched from the registry by rbs, with no npm or yarn CLI involved.

> [card] typescript-app
>
> TypeScript compilation with `tsc`, paired with an `infra.rbs` that provisions the app's cloud infrastructure from the same workspace.

> [card] proto
>
> Protocol Buffers and gRPC compilation for Java, Kotlin, and Python services.

## Web development

* **web-vitest** — React component testing with the `vitest_test` rule: real Vitest execution in a jsdom environment with Testing Library.
* **mf-enhanced-ssr** — the `@module-federation/enhanced` runtime with several server-side-rendering options, from automatic SSR to a custom Express server.
* **web-ssr-custom** — developer-controlled SSR where you own the server code, in the style of an Nx monorepo setup.

## Testing and coverage

* **nodejs-test-coverage** — `nodejs_test` with Jest and NYC auto-included, TypeScript test support, and coverage thresholds that fail the target when unmet.
* **python-test-coverage** — `py_test` with pytest and coverage.py auto-included, supporting both pytest and unittest runners, with enforced thresholds.
* **test-examples** — how to test your own custom rules and build-language functions with `rbs rules test`, including assertion examples and a workspace-discovery integration test.

## The whole platform in one workspace

* **platform-demo** — one workspace that replaces four tools: a Python dependency graph (build), `py_test` with coverage floors (test), `py_lint` gates (lint), an `oci_image` built from a `py_binary` (packaging), a `ci_workflow` runnable locally with `rbs ci run` (CI), and an `infra.rbs` (infrastructure). Read this one to see how the layers compose.
* **monorepo-ci** — a three-service monorepo whose `ci.rbs` workflow applies infrastructure, then builds, tests, and pushes an image per service; adding a service extends the pipeline automatically.
* **infrastructure** — the cloud-agnostic infrastructure SDK: declare compute, networking, and load balancers in `.rbs` files and drive them with `rbs infra plan / apply / destroy`.
* **enhanced-define-rule-demo** — writing your own rules with `native.define_rule`: custom attributes, implementations, and the SDK-first extension pattern.
* **stress-parallel** — fifty interdependent targets in three layers, useful for watching the parallel scheduler fan out and fan in.
* **ddp-tutorial-series** — PyTorch training targets: a local `py_binary` run and an `ml_training_job` declaration for cluster submission.

> [!NOTE]
>
> Cluster job submission (`rbs job`, `ml_training_job`) is an evolving area — the local `py_binary` targets in `ddp-tutorial-series` work standalone, but treat the distributed-scheduler flow as experimental.


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