# Quickstart: the map in your repo

> Write the first case files, check them, and run the check in CI. No account needed.

Applies to: the Sypnia engine (open source, self-hosted).  
Source: https://cases.docs.sypnia.com/start/quickstart-repo/

For agents: Repo quickstart: `npx @sypnia/cases init` creates cases/map.yaml, cases/navigation.yaml and an example case; edit cases/<area>/<id>.case.yaml (starts, where, outcomes, failures) and cases/navigation.yaml; `npx @sypnia/cases check` validates against the JSON Schema and, with Sypnorm, compares with the code; add the check to CI (exit code 1 on scope errors).

### 1. Create the map

```bash
npx @sypnia/cases init
```

It creates `cases/map.yaml` with your app's name, `cases/navigation.yaml` with a first root, and one example case.

### 2. Write a use case

`cases/orders/place-order.case.yaml`

```yaml
id: place-order
title: Order for today
actor: customer
goal: Get fresh bread reserved for pick-up today
starts: in_app
where: shop.order-for-today
steps:
  - The customer picks products and quantities
  - The system checks what is left and reserves it
  - The customer gets a pick-up code
outcomes:
  OrderPlaced: { order_id: uuid, pickup_code: string }
failures:
  OutOfStock:
    when: a product sold out while ordering
    tell: «This one just ran out. The rest of your order is kept.»
data:
  reads: [product]
  writes: [order, order_item]
allowed: [customer]
```

### 3. Check it

```bash
npx @sypnia/cases check
```

It validates every file against the [JSON Schema](https://cases.docs.sypnia.com/format/json-schema), checks that the case has a start and ends in declared outcomes, and that its place exists in `cases/navigation.yaml` (`init` wrote one with a root `shop`; add the place `shop.order-for-today` there, or let `npx @sypnia/cases nav --from-code` propose it from your screens). If your code uses Sypnorm, it also compares the code's use cases with the map ([The check](https://cases.docs.sypnia.com/contract/the-check)).

### 4. Run the check in CI

`.github/workflows/cases.yml`

```yaml
- run: npx @sypnia/cases check --ci
```

A scope error fails the build. The message says which code has no case, or which case is missing in the code.
