# robotparts.dev analyses: the file format

An analysis is a report about parts, written as one Markdown file in your robotparts folder:

    ~/robotparts/analyses/<slug>.md       ->  https://robotparts.dev/analysis/<slug>/

`<slug>` is lowercase letters, digits and dashes (`^[a-z0-9][a-z0-9-]{0,62}$`). The folder syncs with folder-sync
(`folder-sync login --server https://robotparts.dev`, `folder-sync init --project robotparts`); an open page shows a
new or edited file within about ten seconds. It is private to you unless you publish your folder. There is no API:
write the file. The design is docs/peps/0002-analyses.md in the robotparts repository.

## Frontmatter

    ---
    type: analysis
    title: Shoulder actuator for a 1-DOF arm          # required
    question: Which actuator drives the shoulder?     # required: what the analysis decides
    status: decided                                   # draft | open | decided | superseded (default draft)
    parts: [aifitlab-8541438771336, jmc-60asm400-5-1024c]   # robotparts ids considered
    decision: aifitlab-8541438771336                  # one id from parts, or leave it out
    author: Your Name
    date: 2026-10-26                                  # YYYY-MM-DD
    visibility: private                               # private (default) | public: shown as a reminder to publish
    tags: [actuator, arm]
    supersedes: an-older-slug                         # optional
    ---

Part ids are the last segment of a part's URL (`/actuator/aifitlab-8541438771336/`) and the `id` field of
`/search/index.json` and `/analysis/parts.json`.

## Body

- **Markdown:** headings, paragraphs, lists, block quotes, fenced code, pipe tables, **bold**, *italic*, `code`,
  [links](https://robotparts.dev). Raw HTML is shown as text.
- **Part links:** `[[<part-id>]]` or `[[<part-id>|label]]`; inside a table write `[[<part-id>\|label]]`.
  `[[<slug>]]` links another of your analyses.
- **A live view inline:** a fenced block whose language is `base`, holding a data-ui / Obsidian Bases `.base`
  document. `data:` starting with `/` is the public catalog (`/search/views/actuator.json`, `camera.json`,
  `psu.json`, `/search/views/userdata/<part-id>.json` for a part's published measurements); a relative path is a file
  beside your analysis in your folder (your own measurements, e.g. `data/bench.json`, a JSON list of rows or
  `{"rows": [...]}`).
- **`this`:** inside a view's filters, `this.<key>` is your analysis's frontmatter, as in Obsidian.
  `filters: 'this.parts.contains(id)'` keeps the catalog rows of the parts you named.
- **An embedded view file:** `![[name.base]]` or `![[name.base#View name]]` on its own line, looked for beside your
  analysis, then in `~/robotparts/views/`, then among the catalog's presets (`![[actuator.base#Ashby · torque vs mass]]`).
- **A dashboard** (a panel grid) is a `.base` with `layout:`, `datasets:` and optional `links:` (data-ui PEP 0004),
  embedded the same way.
- **Callouts:** `> [!decision] Chosen: [[<part-id>|Name]]` then `>` lines saying why; this is the report's verdict.
  `> [!illustrative] …` marks anything that is assumed rather than measured. `[!note]`, `[!example]`, `[!warning]`
  are plain callouts; `[!type]-` folds one.

## Check a file

    python3 build/site_analysis.py check ~/robotparts/analyses/<slug>.md

It names each problem with its line: a missing title or question, a status outside the four, an id not in the
catalog, a decision not among the parts, a `.base` that does not parse, data that is not there, or a property the
data does not have. The page shows the same problems above the report.

## Examples

`/analysis/examples/shoulder-actuator.md` (with its dashboard `shoulder-actuator.base`) and
`/analysis/examples/bin-picking-camera.md`. Copy one into `~/robotparts/analyses/` with the same name and your copy
replaces the example at its URL, for you.
