# Recipes: building with an AI helper

Step-by-step plans for common jobs. Officers can paste the **Ask** line into their helper; helpers can follow the
**Steps**.

## Set up a new group

**Ask**: "Set up our group for a cozy farming-games crowd: welcome, rules, a look, and a few fun bots."

**Steps** (the officer first makes the community in the app and picks a starter kit: channels and roles come from it):

1. `get_community`: its name, channels and what its design may use.
2. `reference("design", "welcome")`, then `set_design` with `welcome { show, title, words, rules }` and `accent`, `font`.
3. `effect` (snow, petals, fireflies, leaves, stars, bubbles, confetti) and a wallpaper (`upload_link`, then
   its hash in the design).
4. `ranks` with the group's own names, colours and badges.
5. Scripts: write a greeter or a `!command`, `try_script` on `join` or `command`, then `save_script`.

## Open a community store

**Ask**: "Make us a store for horror games: shelves, labels, a page."

**Steps** (the officer first makes it a store: **Start selling…**, or picks Store when making it):

1. `get_community`, `get_store`.
2. `search_games("horror")`, and more words, to find games.
3. `set_design` with `labels` (for example *Jump scares*, *Slow burn*, *Co-op*) and `rating` (paws, stars, hearts,
   stamps, numbers).
4. `save_shelf` for each shelf (up to 20, 40 games each), with a style.
5. `mark_game` with labels and a score for the best ones.
6. Write the page (below).

> [!NOTE]
> A community store never picks its own officers' games.

## Write the store's page

1. `reference("page")` for the seal and the `GC` bridge.
2. `list_files`: what's there, the limits.
3. `write_file("index.html", …)` (the Home channel's front) and `write_file("store.html", …)` (the Store channel), and
   their CSS and JavaScript files. Read the store with `GC.store()` and `GC.games()`; open games with `GC.open(ident)`.
4. Pictures and fonts: `upload_link(page: "img/hero.webp")`, then `curl -T`.
5. Change files with `edit_file`.
6. `publish_page` once the officer is happy.

A ready-made site (React, Vue, Svelte, anything): build it, zip the built folder, `upload_link(page: "/")`, `curl -T`
the zip, then `publish_page`.

## Style the channels

**Ask**: "Make our chat look like a neon arcade."

1. `reference("channels")`: the classes and rules.
2. `set_design({ channelsCss: "…" })`, or `channelsCssAppend` for small additions.
3. Later changes with `edit_text("channelsCss", old, new)`.

## A season or a sale takeover

1. `reference("design", "seasons")`.
2. `set_design({ seasons: [...] })`: from and to as `MM-DD`, with the season's accent, effect or scene. A one-off
   takeover for a sale lasts up to 60 days.

## A points game with a scoreboard

**Ask**: "Give members a point for each message and show the top ten on our page."

1. Script: `on('message', …)` with `memberData.add(e.member.id, 'points', 1)`, and `command('top', …)` with
   `memberData.top('points', 10)`.
2. Keep the top ten in `data.set('public.top', …)` so the page can read it, and `live('top', …)` to update open pages.
3. `try_script` on `message` and `command`, then `save_script`.
4. On the page: `GC.data("public.top")` to draw it, `GC.on("top", …)` to update it.

## A widget activity for voice

1. `reference("widgets")`.
2. Write the widget's HTML; use `GC.room(name)` to share the game's state and `GC.show` for GC's own pieces.
3. Mark it an Activity in Design, with how many players.

## A live card

1. A script with `cards.set('board', { type: 'AdaptiveCard', version: '1.6', body: [...], actions: [...] })`.
2. `post('general', 'Tonight', { card: 'board' })` once; `cards.set` again later changes every message showing it.
3. `widget(verb)` handles its `Action.Execute` buttons.

## Check before you finish

- `get_script(name, runs)`: the last runs, their errors.
- `list_files`: does the draft differ from what shows? Publish it.
- `get_design`: is what the cleaner left out what you meant?
