# One step per system

> Write a quest that plays on macOS and Linux, on the player's own machine or in a hosted world.

You write a quest that plays on more than one system: it says where it runs, shows each player the steps of their own system, and keeps what needs the player's own Mac away from a hosted world.

**Before you begin (10 minutes)**

- A quest pack that passes `alta lint`: the [quickstart](https://docs.altasystem.ai/quickstart) makes one, `my-pack`.

### Say where the quest runs

`support` lists the systems (`macos`, `linux`, `windows`), with a minimum version when it matters. `hosted` says how the quest plays in a hosted world: `ok`, `limited` or `no`; `ok` needs `linux` in the list. `notes` explain a difference to the player, per system.

Without `support`, a quest is for every system. A branch can carry `support` too; its quests inherit it.

```json [my-pack/per-os.json]
{
  "platforms": [{ "os": "macos", "min": "14" }, { "os": "linux" }],
  "hosted": "limited",
  "notes": {
    "linux": {
      "en": "In a hosted world, the folder lives on the server.",
      "fr": "Dans un monde hébergé, le dossier vit sur le serveur."
    }
  }
}
```

### Write one step per system

`os` on a step shows it only on those systems. When a proof differs by system, such as a path, write one step for each: the player sees only theirs.

```json [my-pack/per-os.json]
{
  "id": "folder-mac",
  "kind": "check",
  "os": ["macos"],
  "title": {
    "en": "A Notes folder in Documents",
    "fr": "Un dossier Notes dans Documents"
  },
  "check": { "type": "file", "path": "~/Documents/Notes" }
}
```

```json [my-pack/per-os.json]
{
  "id": "folder-linux",
  "kind": "check",
  "os": ["linux"],
  "title": {
    "en": "A notes folder in your home",
    "fr": "Un dossier notes chez toi"
  },
  "check": { "type": "file", "path": "~/notes" }
}
```

### Or one value per system

`cmd`, `open` and `run` take a table instead of a value: one entry per system. The table names every system the quest supports, no more, no less. A plain value is for every system.

```json [my-pack/per-os.json]
{
  "id": "open",
  "kind": "command",
  "title": { "en": "Open the folder", "fr": "Ouvre le dossier" },
  "cmd": { "macos": "open ~/Documents/Notes", "linux": "xdg-open ~/notes" },
  "optional": true
}
```

### Keep the player's Mac to itself

`host` shows a step only in a world on the player's own machine (`local`) or only in a hosted one (`hosted`). A step that opens an app of the Mac stays `local`.

On a choice, `off` greys an option out in that host and says why; the player sees it but cannot pick it. `resources` does the same where the machine has less than the option needs (`{ "memory": "8Gi" }`), and says what is missing: see [What a step needs of the machine](https://docs.altasystem.ai/guides/quests/resources). Never put "Recommended" on an option that can be greyed: [`choice.recommended`](https://docs.altasystem.ai/reference/errors#choice-recommended).

```json [my-pack/per-os.json]
{
  "id": "show",
  "kind": "action",
  "host": "local",
  "os": ["macos"],
  "title": { "en": "Open OpenClaw", "fr": "Ouvre OpenClaw" },
  "run": { "do": "app.open", "args": { "app": "openclaw" } },
  "optional": true
}
```

```json [my-pack/per-os.json]
{
  "id": "sync",
  "kind": "choice",
  "title": {
    "en": "Keep a copy elsewhere?",
    "fr": "Garder une copie ailleurs ?"
  },
  "choices": [
    {
      "id": "none",
      "label": {
        "en": "No, this machine is enough",
        "fr": "Non, cette machine suffit"
      }
    },
    {
      "id": "disk",
      "label": {
        "en": "On an external disk",
        "fr": "Sur un disque externe"
      },
      "off": {
        "host": "hosted",
        "why": {
          "en": "A hosted world has no disk to plug in.",
          "fr": "Un monde hébergé n'a pas de disque à brancher."
        }
      }
    },
    {
      "id": "search",
      "label": {
        "en": "In a search index on this machine",
        "fr": "Dans un index de recherche sur cette machine"
      },
      "resources": { "memory": "8Gi" }
    }
  ],
  "saves": "answers.notes.sync"
}
```

### Check the pack

Save the complete example as `my-pack/per-os.json` and check the folder. A table that misses a supported system, or an executor that does not run on the step's systems, is refused: [`step.per-os`](https://docs.altasystem.ai/reference/errors#step-per-os), [`step.run-os`](https://docs.altasystem.ai/reference/errors#step-run-os).

```json [my-pack/per-os.json]
{
  "schema": "alta.quests/0.3",
  "branch": "core",
  "quests": [
    {
      "id": "notes-home",
      "uid": "core.notes-home",
      "act": 2,
      "giver": "architect",
      "title": {
        "en": "Give your notes a home",
        "fr": "Donne une maison à tes notes"
      },
      "summary": {
        "en": "One folder for your notes, where your system expects it.",
        "fr": "Un dossier pour tes notes, là où ton système l'attend."
      },
      "reward": { "xp": 40 },
      "support": {
        "platforms": [
          { "os": "macos", "min": "14" },
          { "os": "linux" }
        ],
        "hosted": "limited",
        "notes": {
          "linux": {
            "en": "In a hosted world, the folder lives on the server.",
            "fr": "Dans un monde hébergé, le dossier vit sur le serveur."
          }
        }
      },
      "steps": [
        {
          "id": "folder-mac",
          "kind": "check",
          "os": ["macos"],
          "title": {
            "en": "A Notes folder in Documents",
            "fr": "Un dossier Notes dans Documents"
          },
          "check": {
            "type": "file",
            "path": "~/Documents/Notes"
          }
        },
        {
          "id": "folder-linux",
          "kind": "check",
          "os": ["linux"],
          "title": {
            "en": "A notes folder in your home",
            "fr": "Un dossier notes chez toi"
          },
          "check": { "type": "file", "path": "~/notes" }
        },
        {
          "id": "open",
          "kind": "command",
          "title": {
            "en": "Open the folder",
            "fr": "Ouvre le dossier"
          },
          "cmd": {
            "macos": "open ~/Documents/Notes",
            "linux": "xdg-open ~/notes"
          },
          "optional": true
        },
        {
          "id": "sync",
          "kind": "choice",
          "title": {
            "en": "Keep a copy elsewhere?",
            "fr": "Garder une copie ailleurs ?"
          },
          "choices": [
            {
              "id": "none",
              "label": {
                "en": "No, this machine is enough",
                "fr": "Non, cette machine suffit"
              }
            },
            {
              "id": "disk",
              "label": {
                "en": "On an external disk",
                "fr": "Sur un disque externe"
              },
              "off": {
                "host": "hosted",
                "why": {
                  "en": "A hosted world has no disk to plug in.",
                  "fr": "Un monde hébergé n'a pas de disque à brancher."
                }
              }
            },
            {
              "id": "search",
              "label": {
                "en": "In a search index on this machine",
                "fr": "Dans un index de recherche sur cette machine"
              },
              "resources": { "memory": "8Gi" }
            }
          ],
          "saves": "answers.notes.sync"
        },
        {
          "id": "show",
          "kind": "action",
          "host": "local",
          "os": ["macos"],
          "title": {
            "en": "Open OpenClaw",
            "fr": "Ouvre OpenClaw"
          },
          "run": {
            "do": "app.open",
            "args": { "app": "openclaw" }
          },
          "optional": true
        }
      ]
    }
  ]
}
```

```sh [Terminal]
alta lint my-pack
```

```text [Output]
ok   my-pack/per-os.json (quests)
ok   my-pack/quests.json (quests)
2 checked, 0 errors, 0 warnings
```

**Try it:**

```sh
alta dev my-pack
```

Open the address it prints, press <kbd>L</kbd> for the quests, then open **Give your notes a home**. The demo plays a Mac on its own machine: you see the macOS folder step and the macOS command, not the Linux ones.

## Pitfalls

| Do | Avoid |
|---|---|
| Two steps with `os` when a check differs by system | A `check` written as a per-system table |
| A table that covers every supported system | A table for macOS alone in a quest that supports Linux |
| `host: "local"` on a step that needs the Mac's screen or sound | Showing a hosted player a button that cannot work |
| A note that tells the player what differs | A quest that silently skips steps |

A `check` cannot be a per-system table: it is refused as a check with no type. Most executors run on macOS and Linux, a few on macOS only; the [executors](https://docs.altasystem.ai/reference/standards/executors) page says where each runs and whether it runs in a hosted world.

## Go further

- [Platforms](https://docs.altasystem.ai/concepts/platforms): systems, hosted worlds, what a host has.
- [Quests](https://docs.altasystem.ai/reference/standards/quests): `support`, `os`, `host`, field by field.
- [Executors](https://docs.altasystem.ai/reference/standards/executors): the systems of each action.

**Next:**

- [Make a step that does it](https://docs.altasystem.ai/guides/quests/do-it-step)
- [Platforms](https://docs.altasystem.ai/concepts/platforms)
- [Validate in CI](https://docs.altasystem.ai/guides/tools/validate-ci)
