# Package a quest pack

> Package quests as a chart anyone can install: what it adds to a world, on which systems, and how the game proves it arrived. Data only, the simplest chart to share.

You package a quest pack as an Agent Chart, ready for the marketplace: what it is, the systems it supports, what it adds to the player's world and how the game proves it arrived. A chart declares; it never holds code that runs. A quest pack is data only: the simplest kind of chart, and the one anyone can share.

**Before you begin (20 minutes)**

- The `alta` command (see [Install the CLI](https://docs.altasystem.ai/start/install)).
- The [quickstart](https://docs.altasystem.ai/quickstart): the quests of a chart are written the same way.
- Read [Badges](https://docs.altasystem.ai/marketplace/badges) to see what the player is shown before they agree.

### Create the chart

`alta chart new --kind quest-pack` writes a chart folder that holds a quest pack, ready to check. Its `source` holds placeholders until you publish it from your repository.

```sh [Terminal]
alta chart new my-chart --kind quest-pack
```

```text [Output]
created my-chart/chart.json, my-chart/README.md (chart, id my-chart)
next: edit the texts, then `alta lint my-chart`, then `alta template my-chart`
```

### Say what it is

The card is what the marketplace and the game show: `id` (lower case, the folder's name), `version`, `kind` (`agent`, `team`, `module`, `skill`, `quest-pack`, `universe`), a `title` and a `summary` in each language, and `why`, the reason a player would want it. Then `author`, `license` and `price`: `free` or `paid`. The amount is never in the chart; the catalog holds it.

```json [my-chart/chart.json]
{
  "en": "Two small quests to close the day: review, then rest.",
  "fr": "Deux petites quêtes pour finir la journée : le bilan, puis le repos."
}
```

```json [my-chart/chart.json]
{
  "en": "A day that ends cleanly starts the next one well.",
  "fr": "Une journée bien finie fait bien commencer la suivante."
}
```

### Declare the systems

`support` is required: the systems the chart works on, and whether it works in a hosted world (`hosted`: `ok`, `limited` with a note for Linux, or `no`). The game shows it before the player agrees, and a player on another system is told plainly.

```json [my-chart/chart.json]
{ "platforms": [{ "os": "macos" }, { "os": "linux" }] }
```

### Add the quests

`branch` holds the quests. It is either a whole branch, named like the chart, or a fragment that adds quests to a branch of the game. Either way, the `uid` of each quest carries the chart's id, so two charts never collide. Write the first quest so that it gives a first result the machine can prove. The example comes from a complete chart, `evening-pack`, whose quests make a whole branch (`evening-pack.…`); in the chart `alta new` wrote, a fragment that adds to `core`, a quest's `uid` is `core.my-chart.<name>`, as in its first quest.

```json [my-chart/chart.json]
{
  "id": "review",
  "uid": "evening-pack.review",
  "act": 1,
  "giver": "daemon",
  "type": "daily",
  "reset": { "every": "day", "at": "17:00" },
  "title": {
    "en": "Ask for the day's summary",
    "fr": "Demande le résumé de la journée"
  },
  "reward": { "xp": 20 },
  "steps": [
    {
      "id": "ask",
      "kind": "mission",
      "title": {
        "en": "Ask your assistant what happened today",
        "fr": "Demande à ton assistant ce qui s'est passé aujourd'hui"
      },
      "mission": {
        "agent": "daemon",
        "brief": {
          "en": "Summarise my day in five lines.",
          "fr": "Résume ma journée en cinq lignes."
        }
      }
    }
  ]
}
```

### Say how it arrives, and the proof

`package` says what is installed: `data` for quests or a universe, nothing to download. `parts` lists the steps of the plan, each an executor from a closed list (`item.data` adds the quests), run by the game after the player agrees, with how it is undone (`undo`) and the read-only checks that prove it holds (`proof`). `spawn` is the thing that appears on the map.

```json [my-chart/chart.json]
[{ "id": "add", "do": "item.data", "undo": "none", "proof": [] }]
```

```json [my-chart/chart.json]
{
  "entity": {
    "id": "module:evening-pack",
    "kind": "module",
    "name": "evening-pack",
    "role": "daemon"
  }
}
```

### Check it

`alta lint` checks the card, the systems, the parts against the closed list and the quests against the game. The warning stays until you publish: [Publish a chart](https://docs.altasystem.ai/marketplace/publish) fills the source.

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

```text [Output]
ok   my-chart (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
```

**Try it:**

```sh
alta dev my-chart
```

Open the address it prints: the chart's quests are in the journal, as if the player had added it. Nothing runs on your machine.

## Pitfalls

| Do | Avoid |
|---|---|
| `package: data` and parts of `item.data` for quests or a universe | Any other executor in a data chart: refused |
| Parts from the closed list, each with its plan card and its proof | Any command of your own: a chart never runs code |
| A folder named after the chart's `id` | A folder with another name: refused |
| `undo` that the executor can really do | An undo that promises more than the executor can undo: refused |

## Go further

- [Agent Chart](https://docs.altasystem.ai/reference/standards/chart): every field of a chart and of the catalog.
- [Badges](https://docs.altasystem.ai/marketplace/badges): what the player sees and agrees to.
- [Errors](https://docs.altasystem.ai/reference/errors#standard-chart): each rule of `alta lint` for a chart.

**Next:**

- [Publish a chart](https://docs.altasystem.ai/marketplace/publish)
- [A paid business agent, end to end](https://docs.altasystem.ai/charts/guides/business-agent)
- [Agent Chart](https://docs.altasystem.ai/reference/standards/chart)
