# Anatomy of a chart

> A chart is a folder: chart.json and the files it names. What each section of chart.json is for, and which ones each kind needs.

A chart is a folder named after its `id`: `chart.json` and the files it names (an agent's `SOUL.md`, an automation's message, a module's scripts). It never holds code the game runs. This is a full agent chart, a morning brief that writes to its owner on Telegram:

```json [morning-brief/chart.json]
{
  "schema": "alta.chart/0.1",
  "id": "morning-brief",
  "version": "0.3.0",
  "kind": "agent",
  "title": { "en": "Morning brief", "fr": "Point du matin" },
  "summary": {
    "en": "An agent that writes to you every morning.",
    "fr": "Un agent qui t'écrit chaque matin."
  },
  "author": "someone",
  "license": "MIT",
  "publisher": {
    "id": "example-author",
    "name": "Example Author",
    "url": "https://example.com"
  },
  "homepage": "https://example.com/morning-brief",
  "keywords": ["morning", "brief", "telegram"],
  "categories": ["assistant"],
  "price": "free",
  "origin": "community",
  "source": {
    "git": "https://git.example.org/someone/morning-brief",
    "commit": "0123456789abcdef0123456789abcdef01234567",
    "sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
  },
  "locality": "cloud",
  "support": {
    "platforms": [{ "os": "macos" }, { "os": "linux" }],
    "hosted": "ok"
  },
  "resources": { "cpu": 1, "memory": "2Gi", "disk": "1Gi" },
  "requires": { "charts": [{ "id": "alta-os", "version": ">=0.1.0 <1.0.0" }] },
  "capabilities": ["ask", "install"],
  "needs": { "mind": {}, "channel": { "features": ["push"] } },
  "values": {
    "hour": {
      "kind": "text",
      "label": {
        "en": "At what time?",
        "fr": "À quelle heure ?"
      },
      "default": "07:30",
      "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
    }
  },
  "agents": [
    {
      "id": "brief",
      "name": { "en": "Brief", "fr": "Brief" },
      "files": ["SOUL.md", "IDENTITY.md", "AGENTS.md"],
      "model": "need:mind",
      "channel": "need:channel",
      "permissions": {
        "tools": {
          "allow": [
            "message",
            "gbrain__recall"
          ],
          "deny": [
            "write",
            "edit",
            "exec",
            "browser"
          ]
        },
        "channels": ["need:channel"]
      },
      "wake": ["morning-brief"]
    }
  ],
  "automations": [
    {
      "key": "morning-brief",
      "title": {
        "en": "Morning brief",
        "fr": "Point du matin"
      },
      "agent": "brief",
      "schedule": { "daily": "$hour" },
      "message": "automations/morning-brief.message.md",
      "spends": "model"
    }
  ],
  "parts": [
    {
      "id": "agent",
      "do": "agent.create",
      "args": { "agent": "brief" },
      "requires": ["need:mind", "need:channel"],
      "undo": "archive",
      "proof": [{ "type": "agent", "id": "brief" }]
    },
    {
      "id": "schedule",
      "do": "automation.enable",
      "args": { "key": "morning-brief" },
      "requires": ["agent"],
      "undo": "auto",
      "proof": [
        {
          "type": "automation",
          "key": "morning-brief",
          "enabled": true
        }
      ]
    }
  ],
  "proofs": {
    "installed": [{ "type": "agent", "id": "brief" }],
    "ready": [
      { "type": "need", "id": "channel" },
      {
        "type": "automation",
        "key": "morning-brief",
        "enabled": true
      }
    ],
    "alive": [
      {
        "id": "ran",
        "check": {
          "type": "automation",
          "key": "morning-brief",
          "ranWithinHours": 26
        },
        "every": "1h",
        "repair": ["rerun"]
      }
    ]
  },
  "repairs": [
    {
      "id": "rerun",
      "kind": "automation.rerun",
      "args": { "key": "morning-brief" }
    }
  ]
}
```

## The sections

| Section | What it says | Page |
|---|---|---|
| `schema`, `id`, `version`, `kind` | Which standard, which chart, which version (semver), which kind | below |
| `title`, `summary`, `author`, `license`, `price` | What the owner reads before anything else, in English and French | [trust](https://docs.altasystem.ai/charts/concepts/trust) |
| `origin`, `source` | Who made it, and the commit and digest it is pinned to | [trust](https://docs.altasystem.ai/charts/concepts/trust) |
| `support`, `resources` | The systems it runs on, and the smallest machine it needs | below |
| `requires` | The charts it builds on, with version ranges | [dependencies](https://docs.altasystem.ai/charts/concepts/dependencies) |
| `capabilities` | What the owner's server must allow (`install`, `setup`, `ask`) | [trust](https://docs.altasystem.ai/charts/concepts/trust) |
| `values` | What the owner chooses | [values](https://docs.altasystem.ai/charts/concepts/values) |
| `signins` | The accounts to connect | [sign-ins](https://docs.altasystem.ai/charts/concepts/sign-ins) |
| `agents`, `skills`, `automations`, `services`, `hooks` | What the chart adds | [field reference](https://docs.altasystem.ai/reference/standards/chart) |
| `parts` | The changes, in order, each with its undo and its proof | [parts](https://docs.altasystem.ai/charts/concepts/parts) |
| `proofs` | How the machine shows it is installed, ready and still alive | [proofs](https://docs.altasystem.ai/charts/concepts/proofs) |
| `repairs` | Fixes the owner may allow in advance | [repairs](https://docs.altasystem.ai/charts/concepts/repairs) |

## Kinds

`agent`, `team`, `module`, `package`, `skill` and `system` add something to the machine through their parts. `quest-pack`, `universe` and `cosmetic` are data only: their parts only add content to the game, and they need no capability.

## Support and resources

`support.platforms` lists the systems the author has really run it on; anything else is a note, not a promise. `resources` asks for cores, memory, disk or a GPU. The owner's machine is measured, never guessed: a choice too big for it is greyed, with the reason.

```json [chart.json: resources]
{ "cpu": 1, "memory": "2Gi", "disk": "1Gi" }
```

**Next:**

- [Values](https://docs.altasystem.ai/charts/concepts/values)
- [Every field of chart.json](https://docs.altasystem.ai/reference/standards/chart)
