# Help
-How-tos for the d2 prototype. Each one is a short list of steps; pick the task you want to do.
+Short how-tos, each a few steps. Pick what you want to do; the guides below go deeper.
-Guides, one topic each: [[Help:Projects]] (creating one, members, roles and permissions), [[Help:SystemView]] (the system view on hero and creator projects: each feature, what you asked for, and whether it's built and checked), [[Help:SystemViewPro]] (the full view on pro and master: spec, design, implementation and tests side by side), [[Help:Expressions]] (the expression language by example, and every core function), [[Help:Pipeline]] (the list of work, by role), [[Help:Agents]] (running AI agents by role, watching them, guardians), [[AgentHints]] (the quirks of this build an AI agent should know), [[ExampleAiPrompts]] (prompts to give your AI and what came back, by kind of user), [[Help:Permissions]] (what your AI may do on its own, and what waits for you), [[Help:Vault]] (secrets for your AI agents), [[Help:ObsidianSync]] (keeping notes in an Obsidian vault and topics on d2 in step), [[Help:Init]] (the init page: what it is, the lifecycle messages it handles, declaring crons, examples), [[Help:LifecycleMessages]] (what d2 tells your project as things happen), [[Help:InitExample]] (an init page that uses them), [[Help:Work]] (the Work page: to-dos and pipeline items side by side, by feature), [[Help:Settings]] (everything you can set, on one page, with a search), [[Help:DevSync]] (pages that follow changes while you work) and [[Help:ESP]] (ESP, or Mind Meld: letting your AI take you to the page you're talking about). All help topics: [Help](/topics?category=Help).
+```cards
+🤖 | Your AI agents | [[Help:Agents]] | Running agents by role, watching them, guardians
+🔐 | Permissions | [[Help:Permissions]] | What your AI may do on its own, and what waits for you
+🗝️ | Vault | [[Help:Vault]] | Secrets for your AI agents
+📋 | Pipeline | [[Help:Pipeline]] | The list of work, by role
+🗂️ | Projects | [[Help:Projects]] | Creating one, members, roles and permissions
+🧭 | System view | [[Help:SystemView]] | Each feature you asked for: built and checked
+🔬 | System view (pro) | [[Help:SystemViewPro]] | Spec, design, implementation and tests side by side
+🧮 | Expressions | [[Help:Expressions]] | The expression language by example
+⚙️ | Settings | [[Help:Settings]] | Everything you can set, on one page
+🔄 | Dev-sync | [[Help:DevSync]] | Pages that follow changes while you work
+🧠 | ESP (Mind Meld) | [[Help:ESP]] | Your AI takes you to the page you're talking about
+✅ | Work | [[Help:Work]] | To-dos and pipeline items side by side
+🚀 | Init | [[Help:Init]] | The init page, lifecycle messages, crons
+📝 | Obsidian | [[Help:ObsidianSync]] | Keep an Obsidian vault and d2 in step
+💡 | Example prompts | [[ExampleAiPrompts]] | What to ask your AI, and what came back
+🛠️ | Agent hints | [[AgentHints]] | Quirks of this build an AI agent should know
+```
-## Connect your AI
+All help topics: [Help](/topics?category=Help).
-Your AI assistant can read and write this wiki, your memories, the domain and the objects through the API. New here? Make your first project: its home walks you through connecting your AI. You never copy a token.
+## Connect your AI {#connect-your-ai}
-1. **Let your AI reach d2.** Allow `aiheroapps.com` (or `*.aiheroapps.com`) in your AI's network or web-access settings. In Claude, that's the list of allowed domains for code execution in your settings or your project.
-2. **Get your line.** On your project's home, under **Connect your AI**, press **Done** once step 1 is done. d2 shows one line holding a one-time link; press **Copy**. It works for 10 minutes and only once.
-3. **Paste the line into your AI chat.** Your AI reads a short skill from the link, connects itself and keeps its access somewhere private. The card on your home turns to *connected*. Using Claude Code or Claude Desktop? You can install d2-connect instead: on the [AI tokens](/ai/tokens) tab press **Download d2-connect** and add the file to your AI as a skill.
-4. **Try it.** Ask your AI to *"list the topics in my d2 project"*. It should come back with Home and the rest of your project's topics. Its first job is usually *"remove the onboarding section from my home page"*.
-5. **Let it remember.** Ask it to *"remember in d2 that I follow copper producers"*. A new entry appears under [ai:memories](/topics?category=Memory), where you can read and correct it.
-6. **After the first 7 days:** [renew your token safely](#renew-your-token-safely). A new chat that can't find its access? Press **New AI invite** on your project's home and paste the new line.
+Your AI reads and writes your project for you: the wiki, your memories, the data and its model. You never copy a token.
-If the line has run out or was already used, press **New AI invite** for a fresh one. If something else goes wrong, see [When things go wrong](#when-things-go-wrong).
+1. **Let your AI reach d2.** Allow your d2 address in your AI's network settings: the domain your project is on, with `*.` in front (for example `*.ai-putty.com`). In Claude: the allowed domains for code execution, in your settings or your project.
+2. **Get your line.** On your project's home, under **Onboard your AI**, press **Done**, then **Copy**. The line works once, for 10 minutes.
+3. **Paste it into your AI chat.** Your AI connects itself and keeps its access somewhere private. The card on your home turns green: *Your AI is connected*.
+4. **Try it.** Ask *"list the topics in my d2 project"*. Its first job is usually *"remove the onboarding section from my home page"*.
+5. **Let it remember.** Ask *"remember in d2 that I follow copper producers"*: it appears under [memories](/topics?category=Memory), where you can correct it.
-## Renew your token safely
+- **The line ran out, or was used?** Press **New AI invite** for a fresh one.
+- **Using Claude Code or Claude Desktop?** You can install d2-connect instead: on [AI tokens](/ai/tokens), press **Download d2-connect** and add it to your AI as a skill.
+- **After the first 7 days:** [renew your token safely](#renew-your-token-safely).
-Your AI's access lasts 7 days at first, then 30 days at a time. A couple of days before it ends, your AI tells you. To renew:
+## Renew your token safely {#renew-your-token-safely}
-1. Open **AI tokens** from the notice d2 sends you (or user menu → **Settings** → **AI permissions** → **AI tokens**, or `/ai/tokens`) on your project and press **Give my AI a new token**.
-2. **Tell your AI: "get your new d2 token".** It fetches the new token from d2 itself, switches over, and says so; the old one stops working at that moment.
+Your AI's access lasts **7 days** at first, then **30 days** at a time. A couple of days before it ends, your AI tells you.
-If your AI's token has already ended, or it can't fetch the new one, open the fold under the button instead: **copy the line** it shows and paste it into your AI chat within 10 minutes.
+1. **Open AI tokens:** from the notice d2 sends you, or user menu → **Settings** → **AI permissions** → **AI tokens** ([/ai/tokens](/ai/tokens)). Press **Give my AI a new token**.
+2. **Tell your AI: *"get your new d2 token"*.** It fetches the new one itself and switches over; the old one stops working at that moment.
-You never copy a token, and a link in your chat is useless once it's been used. **Where your AI keeps it:** in its project settings, or its memory if it has nothing better, so it doesn't need a new invite every chat. If it has neither, press **New AI invite** on your project's home for each new chat. Your AI's own tokens are listed under yours on AI tokens, each with a **Revoke**; revoking yours ends all of them at once, so one press is enough when you want an AI to stop.
+**Already ended, or your AI can't fetch it?** Open the fold under the button, copy the line it shows and paste it into your AI chat within 10 minutes.
-## If you don't want your AI to access or edit things
+- **Where your AI keeps it:** in its project settings, or its memory, so it doesn't need a new invite every chat. With neither, press **New AI invite** on your project's home for each new chat.
+- **To stop an AI:** your AI's tokens are listed under yours on AI tokens, each with **Revoke**. Revoking yours ends all of them at once.
-Add one line to the top of the topic, with the other properties: `ai-access: no` hides the topic from AI tokens completely (they can't read it, change it, or even see that it exists, in lists, search or the system view); `ai-access: read` lets your AI read it but not change it. Without the line, your AI can read and edit the topic as usual. The setting only limits AI tokens: you and the other people on the project see and edit the topic as before, and only a person can add, change or remove the line.
+## Keep your AI away from a page {#if-you-dont-want-your-ai-to-access-or-edit-things}
-## Keep work in the pipeline
+Add one line to the top of the topic, with its other properties:
-The **Pipeline** (on your Home, and in the Toolbox) lists the work waiting to be done on the project: ideas you parked, questions for you, and work passed between you and your AI agents. Say *"park it"* to your AI about an idea and it becomes an item. How it works, with a diagram: [[Help:Pipeline]].
+- `ai-access: no`: hidden from AI tokens completely (not readable, not changeable, not even listed or found in search).
+- `ai-access: read`: your AI can read it but not change it.
-## See what your AI agents are doing
+It only limits AI tokens: people on the project see and edit it as before, and only a person can add, change or remove the line.
-If you run several AI agents on a project, each posts what it's doing to **Agents** (in the Toolbox): its state (up, idle, working, waiting, done, stuck, gone), what it's on, what it changed, and a graph of what each one waits on and sends to the others. You get a notice when one is stuck, keeps hitting its limits, or goes quiet. Your agents only talk to each other, never to another person's; they write a memory only when you tell them to, and a change to a skill waits in your Drafts for you to publish. When an agent needs your OK and you're not in the conversation, it leaves an approval in the Pipeline for you to Approve or Refuse.
+## Keep work in the pipeline {#keep-work-in-the-pipeline}
-## Create a project
+The **Pipeline** (on your Home, and in the Toolbox) lists work waiting on the project: ideas you parked, questions for you, work passed between you and your AI agents. Say *"park it"* to your AI about an idea and it becomes an item. More: [[Help:Pipeline]].
-1. Log in. Your first time, you land on the welcome page: type a name under **Make your first project**. After that, use **My projects** in your user menu, then **New project**. Names are lower-case letters, digits and dashes; it becomes the address, `<name>.aiheroapps.com`.
-2. Pick what kind of project it is: **Hero** (your own app, no code), **Creator** (you model and build) or **Pro** (the full kit: fiddle, flows, API). It sets the menu and the home page you start with; you can change it later in the project's **Settings**.
-3. You're its owner and admin, and it opens on its home page. Its public page (the landing) is what visitors see.
-4. **Who can join:** open **Settings** in your user menu, then **Project** (under *This project*), and choose **request** (the default: people ask, an admin approves), **open** (anyone can join) or **invite** (members only: visitors see at most the landing page, and only people an admin adds get in). **Invite someone** by email on **Settings → Members**; the invite works whatever the setting.
-5. **Bring your AI:** on the project's home, **Connect your AI** gives you one line to paste into your AI chat; see [Connect your AI](#connect-your-ai).
+## See what your AI agents are doing {#see-what-your-ai-agents-are-doing}
-## Write a wiki topic
+Running several AI agents on a project? Each posts to **Agents** (in the Toolbox):
-1. Open the [Wiki](/topics) and press **New topic**. Names are letters, digits, `-` and `_`, with no spaces.
-2. Write markdown on the left; the preview on the right updates as you type.
-3. Link a topic with `[[Frostline]]` and an object with `[[Company:FLR]]`. A link to a topic that doesn't exist yet shows in red; click it to create that topic. Link a section of a topic with `[[Frostline#Drilling plan]]`, or one on the same page with `[[#Drilling plan]]`; every heading has a ¶ you can copy its address from. Add `{#name}` at the end of a heading to give it an address that stays put when you rename it. When an AI is working on your pages, turn on dev-sync (the circling arrows in the top bar): a topic or app you're looking at then shows your newest draft of it and reloads itself within two seconds of any change; the editor never reloads.
-4. Press **Save** (or ⌘/Ctrl + S). Saving needs you logged in; if you aren't, the page takes you to **Log in** and back.
-5. To change one section, press the faint **✎ edit** beside its heading, or press `e` while you read it: the editor opens at that line, highlighted, with the cursor there. **Save** or **Cancel** takes you back to the same section, which flashes.
-6. To delete a topic, open it, press **Edit**, then **Delete**. It goes to the trash for 30 days, with its history: open **Settings → Trash** and press **Revive** to bring it back.
-7. **Reports** are one-off answers written as pages (a guardian's run, or a summary your AI wrote when you asked): they stay out of search and the wiki; open one from its link, or from the **Reports** chip on the [Wiki](/topics?category=Report). A page tagged `#ephemeral` keeps no history and has **Dismiss**, which deletes it for good (not to the trash).
+- **its state:** up, idle, working, waiting, done, stuck, gone;
+- **what it's on and what it changed;**
+- **a graph** of what each waits on and sends to the others.
-## Add a class to the domain
+You get a notice when one is stuck, keeps hitting its limits, or goes quiet. Agents only talk to each other, never to another person's; they write a memory only when you tell them to; a change to a skill waits in your Drafts. When one needs your OK, it leaves an approval in the Pipeline to **Approve** or **Refuse**.
-1. Open [[mining-domain]] and press **Edit**, or write a Spec topic of your own.
+## Create a project {#create-a-project}
+
+1. **Name it.** Your first time, type a name under **Make your first project**. After that: user menu → **My projects** → **New project**. Lower-case letters, digits and dashes; it becomes the address, `<name>.<your d2 domain>`.
+2. **Pick its kind:** **Hero** (your own app, no code), **Creator** (you model and build) or **Pro** (the full kit: fiddle, flows, API). You can change it later in **Settings**.
+3. **It's yours:** you're its owner and admin. Visitors see its landing page.
+4. **Who can join:** **Settings** → **Project**: **request** (people ask, an admin approves; the default), **open** (anyone) or **invite** (only people an admin adds). Invite someone by email on **Settings → Members**.
+5. **Bring your AI:** see [Connect your AI](#connect-your-ai).
+
+## Write a wiki topic {#write-a-wiki-topic}
+
+1. **Start it:** open the [Wiki](/topics) and press **New topic**. Names are letters, digits, `-` and `_`, no spaces.
+2. **Write markdown** on the left; the preview on the right follows as you type.
+3. **Save** (or ⌘/Ctrl + S). You need to be logged in; if you aren't, you're taken to **Log in** and back.
+
+- **Links:** `[[Frostline]]` for a topic, `[[Company:FLR]]` for an object, `[[Frostline#Drilling plan]]` for a section (or `[[#Drilling plan]]` on the same page). A link to a missing topic shows red: click it to create it. Every heading has a ¶ to copy its address; add `{#name}` to a heading to keep its address when you rename it.
+- **Edit one section:** press the faint **✎ edit** by its heading, or `e` while you read it. **Save** or **Cancel** brings you back there.
+- **Watching your AI work?** Turn on dev-sync (the circling arrows in the top bar): the page shows your newest draft and reloads itself on any change.
+- **Delete:** open it, **Edit** → **Delete**. It stays in **Settings → Trash** for 30 days; **Revive** brings it back.
+- **Reports** are one-off answers written as pages: out of search and the wiki, found from their link or the **Reports** chip. A page tagged `#ephemeral` keeps no history and has **Dismiss** (gone for good).
+
+## Add a class to the domain {#add-a-class-to-the-domain}
+
+1. Open [[mining-domain]] and press **Edit**, or write a `Spec:` topic of your own.
2. Add a line such as `$class Drone (@key id: String, @label name: String, owner: <>Company)`.
-3. Save. The class appears in the [model graph](/domain/overview) and the [object browser](/dom).
-4. If the save shows problems, fix them; the object browser's home page also lists the model checks. [[Skill:domain-modelling]] has the rules.
+3. **Save.** The class appears in the [model graph](/domain/overview) and the [object browser](/dom).
+4. **Problems?** The save lists them, and so does the object browser's home. Rules: [[Skill:domain-modelling]].
-## Add or edit an object
+## Add or edit an object {#add-or-edit-an-object}
1. Open the class in the [object browser](/dom), for example [Company](/dom/val/Company).
2. Press **New Company**, or open an object and press **Edit**.
-3. Fill in the form, press **Review changes**, then **Save**. Required fields must have a value; a field marked `?` in the class can stay empty.
+3. Fill in the form, press **Review changes**, then **Save**. Fields marked `?` in the class can stay empty.
-## Add an image or a file
+## Add an image or a file {#add-an-image-or-a-file}
-1. Open **Files** in the menu and pick one or more files: images (png, jpg, gif, webp), pdf, or text (txt, md, csv, json, yaml and other text files), up to 5 MB each.
-2. Add a few tags (they're how you find files again). **Members only** is ticked to start with: untick it for a file anyone may see, like a logo on a public page.
+1. **Pick files:** open **Files** in the menu. Images (png, jpg, gif, webp), pdf, or text (txt, md, csv, json, yaml…), up to 5 MB each.
+2. **Tag them** (that's how you find them again). **Members only** starts ticked: untick it for a file anyone may see, like a logo.
3. Press **Upload**, then **Copy markdown** on the file and paste it into a topic.
-How many files a project can have depends on its owner's plan: on the free plan, 20 files and 5 MB in all; the Files page shows how much is used.
-
-Files are served from `cdn.aidieselapps.com`, a separate address, so an uploaded file can never act as a page of your project. Your AI can upload them too (the skill explains how).
+- **Limits:** set by the owner's plan (free: 20 files, 5 MB in all); the Files page shows what's used.
+- **Safe by design:** files are served from `cdn.aidieselapps.com`, a separate address, so a file can never act as a page of your project. Your AI can upload them too.
-## Try an expression
+## Try an expression {#try-an-expression}
1. Open the [Fiddle](/fiddle).
-2. Type one expression per line, for example `[1, 2, 3] map (x => x * 2)`, or `name = value` to use it on later lines.
-3. Results show on the right. Pick **Load an example** to see what the language can do.
+2. Type one expression per line, e.g. `[1, 2, 3] map (x => x * 2)`, or `name = value` to use it on later lines.
+3. Results show on the right. **Load an example** shows what the language can do.
-## Write a rule and run it
+## Write a rule and run it {#write-a-rule-and-run-it}
-1. Open the [Fiddle](/fiddle?tab=specs&topic=Spec:hello) and pick the **Specs** tab. [[Spec:hello]] is open: a rule that answers the message `hello.greet`.
-2. Change the greeting, for example `"Hi, ${name}!"`. The right side checks it as you type. Press **Save**.
-3. Pick the **Stories** tab and [[Story:hello]]. It sends the message and runs its `$expect` lines; the one you just broke shows ✗ with what it got.
-4. Fix the story's `$expect` to match, and it runs again as you type. Save it too.
-5. For more, pick [[Story:order]] (guards, a discount, a rejected order) or [[Story:alerts]] (lists, notifications, shared flow values). Runs never change your data.
+1. **Open the rule:** the [Fiddle](/fiddle?tab=specs&topic=Spec:hello), **Specs** tab: [[Spec:hello]] answers the message `hello.greet`.
+2. **Change it,** e.g. the greeting to `"Hi, ${name}!"`. It's checked as you type. **Save**.
+3. **Run its story:** **Stories** tab, [[Story:hello]]. It sends the message and checks its `$expect` lines; the one you just broke shows ✗ with what it got.
+4. **Fix the `$expect`** to match; it runs again as you type. Save it too.
-## Show data in a table
+More: [[Story:order]] (guards, a discount, a rejected order) and [[Story:alerts]] (lists, notifications, shared values). Runs never change your data.
-1. Edit any topic (a home page, a notes page) and add a block:
+## Show data in a table {#show-data-in-a-table}
+
+1. Edit any topic and add a block:
````
```table
…
```
````
-2. Save. The table is drawn with the page: it shows the objects as they are when the page loads (reload for new data); each row opens its form, and **+ Add** makes a new one.
-3. Columns can follow a reference (`company.price`) and computed fields work like any other (`@calc` in the class, see [[Skill:d2-maker]]).
+2. **Save.** The table shows the objects as the page loads (reload for new data); each row opens its form, **+ Add** makes a new one.
-## Make an app
+Columns can follow a reference (`company.price`); computed fields (`@calc` in the class) work like any other. More: [[Skill:d2-maker]].
-An app is a page with a free hand: your own HTML, CSS and scripts, reading and writing the project's data.
+## Make an app {#make-an-app}
-1. Open the [Wiki](/topics?category=App) under **apps** and press **New**, or ask your AI to *"make an app that shows …"*. An app is an `App:` topic holding a whole HTML page.
-2. In its script, get and save data with `d2.api`, as whoever is looking at it:
+An app is a page with a free hand: your own HTML, CSS and scripts, reading and writing the project's data. The easy way: ask your AI *"make an app that shows …"*.
+
+1. **Make it:** in the [Wiki](/topics?category=App) under **apps**, press **New**. An app is an `App:` topic holding a whole HTML page.
+2. **Use your data** in its script with `d2.api`, as whoever is looking at it:
```
const list = await d2.api("GET", "/api/v2/dom/Holding")
await d2.api("POST", "/api/v2/diesel/run", { story: "$send market.refresh", scratch: false })
```
-3. Save, and open it at `/app/<name>` (the topic has an **Open the app** button). Link it from your home page with a card: `📈 | My app | /app/<name> | what it does`.
-4. **Framed or full page:** by default an app opens under the top bar and scrolls inside it. Add `layout: full` to its frontmatter to give it the whole window (a console, something for your phone's home screen); a small ⌂ button leads back.
-5. For now a full-page app runs as whoever opens it, with their login: only let people you trust edit one.
+3. **Open it** at `/app/<name>` (the topic has **Open the app**), and link it from your home with a card: `📈 | My app | /app/<name> | what it does`.
-## Add a live widget
+- **Framed or full page:** it opens under the top bar by default. `layout: full` in its frontmatter gives it the whole window, with a small ⌂ home.
+- **Safety:** an app runs sandboxed and reaches the project only through `d2.api`. A full-page app runs with the viewer's login: only let people you trust edit one.
-For a small live piece inside a page (prices from the web, a chart), put HTML and a script in an ` ```embedhtml ` block. It runs in a sandbox, takes the page's colours and fonts, and sizes itself; it can fetch from sources that allow any site. d2portfolio's market cards are one.
+## Add a live widget {#add-a-live-widget}
-## Make your own stylesheet
+For a small live piece inside a page (prices from the web, a chart), put HTML and a script in an ` ```embedhtml ` block. It runs in a sandbox, takes the page's colours and fonts, sizes itself, and can fetch from sources that allow any site. d2portfolio's market cards are one.
-Don't like the built-in looks? Your AI can make you a new one. A stylesheet is just a Style topic, so all it needs is [Connect your AI](#connect-your-ai).
+## Make your own stylesheet {#make-your-own-stylesheet}
-1. **Ask your AI.** For example: *"In d2, make me a stylesheet called yahoo: the logo in the top bar says YAHOO, the background is dark green and the fonts are magenta."*
-2. **Let it check its work.** It saves a topic `Style:yahoo`. If d2 reports problems with it, the AI fixes them and saves again.
-3. **Pick it.** Open [Styles](/styles), find it under **Style topics** and press **Use this stylesheet**. Every page switches, the logo text included.
-4. **Tweak it.** Ask for changes (*"make the links yellow"*), or open the topic and edit its `style` block yourself. Reload a page to see the result.
-5. **Go back** any time: press **Use this stylesheet** on stylesheet-orange1, the default.
+Your AI can make you a new look; a stylesheet is just a `Style:` topic.
-## Start over
+1. **Ask:** *"In d2, make me a stylesheet called yahoo: the logo says YAHOO, the background is dark green and the fonts are magenta."*
+2. **It checks its work:** it saves `Style:yahoo` and fixes anything d2 reports.
+3. **Pick it:** [Styles](/styles) → **Style topics** → **Use this stylesheet**.
+4. **Tweak it:** ask (*"make the links yellow"*) or edit its `style` block; reload to see it.
+5. **Go back:** **Use this stylesheet** on stylesheet-orange1, the default.
-1. Go to [Home](/home) and press the red **Reset all** button.
-2. Confirm. The demo domain, its objects and every wiki topic go back to how they started, and everything you added is gone, your Style topics included.
+## Start over {#start-over}
-## When things go wrong
+1. Go to [Home](/home) and press the red **Reset all**.
+2. Confirm. The demo data and every wiki topic go back to how they started; everything you added is gone, your Style topics included.
-- **"write needs a bearer token" or E_AUTH:** the token is missing or wrong. In a browser, the page asks again; for your AI, give it the token again.
-- **Your AI says it can't make its token, expired or revoked:** your starter or d2-maker token has ended; see [Renew your token safely](#renew-your-token-safely).
-- **Your AI says the connection is blocked:** `aiheroapps.com` isn't allowed in its network settings yet (step 1 of [Connect your AI](#connect-your-ai)).
-- **E_VALIDATION when saving an object:** the message names each field that doesn't fit the class. Fix those fields and save again.
-- **A stylesheet shows "Has errors" on [Styles](/styles):** the list under it says which lines are wrong. Fix the topic, or ask your AI to.
-- **Your changes vanished:** the demo projects go back to how they started on every deploy and on **Reset all**. Keep your own work in a project of your own.
-- **Something else:** every page has a twin in the API; add `/api/v2` in front of the path to see the raw JSON, for example [/api/v2/dom/val/Company:FLR](/api/v2/dom/val/Company:FLR).
+## When things go wrong {#when-things-go-wrong}
+- **"write needs a bearer token" or `E_AUTH`:** the token is missing or wrong. In a browser the page asks again; for your AI, see [Renew your token safely](#renew-your-token-safely).
+- **Your AI says its token ended, expired or revoked:** [Renew your token safely](#renew-your-token-safely).
+- **Your AI says the connection is blocked:** your d2 address isn't allowed in its network settings yet (step 1 of [Connect your AI](#connect-your-ai)).
+- **`E_VALIDATION` saving an object:** the message names each field that doesn't fit; fix those and save again.
+- **A stylesheet shows "Has errors"** on [Styles](/styles): the list under it says which lines; fix them, or ask your AI.
+- **Your changes vanished:** demo projects reset on every deploy and on **Reset all**. Keep your work in a project of your own.
+- **Something else:** every page has a twin in the API: put `/api/v2` in front of the path to see the raw data, e.g. [/api/v2/dom/val/Company:FLR](/api/v2/dom/val/Company:FLR).
+