# Your first chart in 5 minutes

> Create an Agent Chart, lint it, package it, and read the plan its install shows. Nothing on your machine is changed.

You will package a small agent. At the end you will have one folder, a clean `alta lint`, an archive with its digest, and the plan the owner sees before anything is installed. Nothing on your machine is changed.

**Before you begin (5 minutes)**

- Node 20 or later.
- The `alta` command: [install the CLI](https://docs.altasystem.ai/start/install).

### Create the chart

`alta chart new` writes one folder: `chart.json`, a README, and the agent's own files under `agents/<id>/`.

```sh [Terminal]
alta chart new morning-brief --kind agent
```

```text [Output]
created morning-brief/chart.json, morning-brief/README.md, morning-brief/agents/helper/SOUL.md, morning-brief/agents/helper/AGENTS.md (chart, id morning-brief)
next: edit the texts, then `alta lint morning-brief`, then `alta template morning-brief`
```

### Read chart.json

```json [morning-brief/chart.json]
{
  "schema": "alta.chart/0.1",
  "id": "morning-brief",
  "version": "0.1.0",
  "kind": "agent",
  "title": {
    "en": "Morning Brief",
    "fr": "Morning Brief"
  },
  "summary": {
    "en": "Replace this summary: what the owner gets, in one sentence.",
    "fr": "Remplace ce résumé : ce que tu obtiens, en une phrase."
  },
  "author": "you",
  "license": "MIT",
  "price": "free",
  "origin": "community",
  "privacy": "personal",
  "source": {
    "git": "https://example.invalid/you/morning-brief",
    "commit": "0000000000000000000000000000000000000000",
    "sha256": "0000000000000000000000000000000000000000000000000000000000000000"
  },
  "support": {
    "platforms": [
      {
        "os": "macos"
      },
      {
        "os": "linux"
      }
    ],
    "hosted": "ok"
  },
  "requires": {
    "charts": [
      {
        "id": "alta-os",
        "version": ">=0.1.0 <1.0.0"
      }
    ]
  },
  "capabilities": [
    "install"
  ],
  "locality": "local-first",
  "needs": {
    "mind": {}
  },
  "agents": [
    {
      "id": "helper",
      "name": {
        "en": "Helper",
        "fr": "Helper"
      },
      "files": [
        "SOUL.md",
        "AGENTS.md"
      ],
      "model": "need:mind",
      "permissions": {
        "tools": {
          "allow": [
            "read",
            "message"
          ],
          "deny": [
            "write",
            "edit",
            "exec",
            "browser"
          ]
        }
      }
    }
  ],
  "parts": [
    {
      "id": "agent",
      "do": "agent.create",
      "args": {
        "agent": "helper"
      },
      "requires": [
        "need:mind"
      ],
      "undo": "archive",
      "proof": [
        {
          "type": "agent",
          "id": "helper"
        }
      ]
    }
  ],
  "proofs": {
    "ready": [
      {
        "type": "agent",
        "id": "helper"
      }
    ],
    "alive": [
      {
        "id": "agent-there",
        "check": {
          "type": "agent",
          "id": "helper"
        },
        "every": "1h"
      }
    ]
  }
}
```

Six things to notice:

- **`needs`** says the agent needs a mind. It does not say which: the owner's own choice (Claude, ChatGPT, a model on the machine) is reused, and the accounts to connect come with it. See [Needs](https://docs.altasystem.ai/charts/concepts/needs).
- **`agents`** says what the agent may do: read and send messages, never write files or run programs.
- **`parts`** are the changes, in order. Each one names an action from a [closed list](https://docs.altasystem.ai/reference/standards/executors), and how it is undone.
- **`"need:mind"`** is a reference to that need. It is the whole string: a chart has no templates.
- **`locality`** says what the agent needs online: `local-first`, because the mind may be on the machine, and the `message` tool may reach the network. See [Locality and online services](https://docs.altasystem.ai/charts/concepts/locality).
- **`"privacy": "personal"`** keeps the agent yours. To share it, set `"shareable"`: see [Share an agent](https://docs.altasystem.ai/charts/guides/share).

### Lint it

`alta lint` runs the same rules as the game. A chart that passes here is a chart the game accepts. The warning is expected: the `source` is filled when you [publish from git](https://docs.altasystem.ai/marketplace/publish).

```sh [Terminal]
alta lint morning-brief
```

```text [Output]
ok   morning-brief (chart)
     warning: source: The source still holds placeholders (zeros). [chart.source-placeholder]
       fix: Replace them with the commit git prints and the digest alta package prints.
       docs: https://docs.altasystem.ai/reference/errors#chart-source-placeholder
1 checked, 0 errors, 1 warning
```

Now break it. In `chart.json`, change `"do": "agent.create"` to `"do": "shell.run"` and lint again:

```text [Output]
FAIL morning-brief (chart)
     error: parts[0].do: A part runs an executor that is not in the closed list. [chart.part-executor]
       detail: parts[0].do: shell.run is not in the closed list of executors (chart.part-executor)
       fix: Use an executor of the closed list in do.
       docs: https://docs.altasystem.ai/reference/errors#chart-part-executor
     error: capabilities: capabilities differs from what the named executors need, or holds forge or pay. [chart.capabilities]
       fix: List exactly the capabilities the message gives.
       docs: https://docs.altasystem.ai/reference/errors#chart-capabilities
     warning: source: The source still holds placeholders (zeros). [chart.source-placeholder]
       fix: Replace them with the commit git prints and the digest alta package prints.
       docs: https://docs.altasystem.ai/reference/errors#chart-source-placeholder
1 checked, 2 errors, 1 warning
```

A chart cannot add an action: it can only name one that ships with Alta System OS ([`chart.part-executor`](https://docs.altasystem.ai/reference/errors#chart-part-executor)). Each problem prints its rule, the fix, and a link. Put the line back.

### See what installing it does

`alta template` reads the chart with the owner's values and prints what an install would do. It needs no server and writes nothing.

```sh [Terminal]
alta template morning-brief
```

```text [Output]
morning-brief 0.1.0 (agent) on local: installable
needs:
  Morning Brief will think with your Claude subscription · change
risk:
  Risk: medium. Read why below before you agree.
  - It installs programs on your machine.
  - It needs you to sign in (Claude).
  - An agent may reach the network where it chooses (message).
  - It talks to online services while it runs (Claude).
network:
  Needs online services to work.
  - Claude: It thinks with your Claude subscription: what you ask goes to Claude. A paid account is needed. What leaves your machine: what you ask.
requires:
  alta-os
sign-ins:
  need-claude          signin.cli
parts:
  agent                agent.create {"agent":"helper","chart":"morning-brief"}   undo: agent.archive
proofs:
  agent helper
repairs (none allowed until you say so):
  need-claude-again    signin.again       (always asked)
```

### Package it

`alta package` lints, then writes a deterministic archive. The tree digest is what a published chart pins in `source.sha256`.

```sh [Terminal]
alta package morning-brief
```

```text [Output]
packaged 4 files into ./morning-brief.alta.tar (7168 bytes)
  archive sha256: 03dd5ac627e993ce42b17db5e1066af5d6798ed22c370517963604d4a4dc73b1
  tree digest (the source.sha256 of a chart): 41ed48cb79cf57bb77603bdfea8319aa34ff8a41096fe668d60a608e327d91bc
  source block (the commit and the address come from `alta publish`):
    {
      "git": "https://<your repository>",
      "commit": "<full commit of the push>",
      "sha256": "41ed48cb79cf57bb77603bdfea8319aa34ff8a41096fe668d60a608e327d91bc"
    }
```

### Install it

On a machine running Alta System OS, `alta install` asks that machine's server for the plan. Without `--yes` it only prints it: the values, the sign-ins, each part with how it is undone, and the proofs. With `--yes`, each part runs as planned, in order, and nothing else.

```sh [Terminal]
alta install morning-brief
```

```text [Output]
morning-brief 0.1.0 (agent) on http://127.0.0.1:8790: installable
needs:
  Morning Brief will think with your Claude subscription · change
risk:
  Risk: medium. Read why below before you agree.
  - It installs programs on your machine.
  - It needs you to sign in (Claude).
  - An agent may reach the network where it chooses (message).
  - It talks to online services while it runs (Claude).
network:
  Needs online services to work.
  - Claude: It thinks with your Claude subscription: what you ask goes to Claude. A paid account is needed. What leaves your machine: what you ask.
sign-ins:
  need-claude          signin.cli
parts:
  agent                agent.create {"agent":"helper","chart":"morning-brief"}   undo: agent.archive
proofs:
  agent helper
repairs (none allowed until you say so):
  need-claude-again    signin.again       (always asked)

Nothing changed. Run it again with --yes to install: each part runs as planned above, nothing else.
```

In the game, the same plan is a quest. Its first step is the owner's yes: a risk level computed from what the chart asks for, with each reason, then which provider each need is bound to, with "change", and what the chart needs online:

```text [The consent step]
Morning Brief asks for: 1 agent(s): Helper; 1 sign-in(s). Each change shows its own card before it runs.

- Morning Brief will think with your Claude subscription · change

Risk: medium. Read why below before you agree.
- It installs programs on your machine.
- It needs you to sign in (Claude).
- An agent may reach the network where it chooses (message).
- It talks to online services while it runs (Claude).

Needs online services to work.
- Claude: It thinks with your Claude subscription: what you ask goes to Claude. A paid account is needed. What leaves your machine: what you ask.
```

`alta status` then lists the releases of the machine, and `alta uninstall` undoes each part in reverse order.

## What you built

- A folder anyone can install, on a Mac or on a server with no screen.
- An install where every change waits for a yes, and every step is proven.

**Next:**

- [Anatomy of a chart](https://docs.altasystem.ai/charts/concepts/anatomy)
- [Package an agent](https://docs.altasystem.ai/charts/guides/agent)
- [Say what your chart needs online](https://docs.altasystem.ai/charts/guides/declare-services)
- [Publish a chart](https://docs.altasystem.ai/marketplace/publish)
