# How Flisk works

> Screens, scenes, ops and agents: the few ideas everything else is built on.

Flisk puts things on screens and changes them as they run: a TV in the lounge, a Mac in the study, a browser on any
computer, an Apple TV, a phone. Every screen runs the same engine.

## Screens

A **screen** is one device showing Flisk, signed in to a person's account. It has a name ("Lounge TV"), a platform,
and is on or off. A screen that's off keeps what it was showing and gets it back when it comes on.

## Scenes

What a screen shows is a **scene**: a list of entities, as JSON.

```json
{
  "theme": "flisk",
  "entities": [
    {"id": "cam", "kind": "camera"},
    {"id": "hello", "kind": "text", "text": "Hello, Flisk!"}
  ]
}
```

Each entity has an `id`, a `kind` (camera, light, shape, text, panel, character, emitter, sky, image, media and
more) and its properties. The `reference` tool (or `flisk reference`) says every kind and property, for the engine
that's live today.

## Ops

**Ops** are small changes to what's showing: create, set, tween (move smoothly) and delete, each by entity id. A
screen applies them within a second, without starting again, so a scene can be built up and changed while
someone watches.

## Templates, prefabs and themes

- A **template** is a starting scene (a 3D room, a 2D canvas, a dashboard, an arcade game, a walkabout, first and
  third person, and more). New things start from one.
- A **prefab** is a reusable piece: a clock, a ticker, a card.
- A **theme** names colours, fonts and sizes (`"theme.accent"`), and can change live.

## Saved scenes and the wall

Something to keep is a **saved scene**, with a script and data if it needs them. It shows full screen, or in a
slot of a screen's **wall**. Something passing is just shown.

## Scripts

A scene's behaviour beyond its entities is a **script**: a small subset of JavaScript that runs identically on every
screen, with handlers such as `on start`, `on tick`, `every 0.5`, `on press "action"` and `on swipe "up"`.
`flisk explain scripts` covers them.

## Agents

Things are made and changed by **agents**, always acting as one person and only on their screens:

- **Flisk's own agent**, in the Flisk app and on the web page.
- **Your agents**, from anywhere, over [MCP](/docs/mcp) or the [command line](/docs/cli), with the same tools as
  Flisk's own.
