rshow 0.0.0-stage → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -2
  3. package/dist/main.js +8500 -0
  4. package/package.json +48 -4
  5. package/skills/rshow/SKILL.md +144 -0
  6. package/skills/rshow/reference/cli.md +263 -0
  7. package/skills/rshow/reference/dashboard.md +122 -0
  8. package/skills/rshow/reference/mockups.md +113 -0
  9. package/skills/rshow/reference/page-contract.md +83 -0
  10. package/skills/rshow/reference/pages.md +174 -0
  11. package/skills/rshow/reference/poster.md +137 -0
  12. package/skills/rshow/reference/project-page.md +132 -0
  13. package/skills/rshow/reference/reports.md +158 -0
  14. package/skills/rshow/reference/sketch.md +78 -0
  15. package/skills/rshow/reference/terminal.md +148 -0
  16. package/skills/rshow/reference/themes.md +139 -0
  17. package/skills/rshow-implement/SKILL.md +112 -0
  18. package/skills/rshow-implement/reference/compare.md +156 -0
  19. package/skills/rshow-implement/reference/handoff.md +125 -0
  20. package/skills/rshow-implement/reference/map.md +151 -0
  21. package/skills/rshow-slides/SKILL.md +136 -0
  22. package/skills/rshow-slides/reference/layouts.md +251 -0
  23. package/themes/default/dashboard.css +521 -0
  24. package/themes/default/dashboard.js +1390 -0
  25. package/themes/default/deck.css +586 -0
  26. package/themes/default/deck.js +741 -0
  27. package/themes/default/example/capture.ans +1 -0
  28. package/themes/default/example/dashboard.html +106 -0
  29. package/themes/default/example/demo.cast +14 -0
  30. package/themes/default/example/drawing.excalidraw +377 -0
  31. package/themes/default/example/index.html +311 -0
  32. package/themes/default/example/mockup-desktop.html +331 -0
  33. package/themes/default/example/mockup-platforms.html +742 -0
  34. package/themes/default/example/mockup.html +416 -0
  35. package/themes/default/example/page.html +153 -0
  36. package/themes/default/example/poster-figure.svg +58 -0
  37. package/themes/default/example/poster.html +181 -0
  38. package/themes/default/example/project.html +229 -0
  39. package/themes/default/example/report.html +404 -0
  40. package/themes/default/example/results.csv +61 -0
  41. package/themes/default/example/sketch.html +178 -0
  42. package/themes/default/example/teaser.svg +66 -0
  43. package/themes/default/example/terminal.html +231 -0
  44. package/themes/default/example/tui.html +223 -0
  45. package/themes/default/fonts/IBMPlexMono-Regular-Latin1.woff2 +0 -0
  46. package/themes/default/fonts/IBMPlexSans-Light-Latin1.woff2 +0 -0
  47. package/themes/default/fonts/IBMPlexSans-Regular-Latin1.woff2 +0 -0
  48. package/themes/default/fonts/IBMPlexSans-SemiBold-Latin1.woff2 +0 -0
  49. package/themes/default/fonts/OFL.txt +93 -0
  50. package/themes/default/fonts.css +63 -0
  51. package/themes/default/index.html +573 -0
  52. package/themes/default/mockup.css +1078 -0
  53. package/themes/default/mockup.js +1433 -0
  54. package/themes/default/mode.js +242 -0
  55. package/themes/default/page.css +320 -0
  56. package/themes/default/poster.css +480 -0
  57. package/themes/default/poster.js +223 -0
  58. package/themes/default/project.css +482 -0
  59. package/themes/default/project.js +116 -0
  60. package/themes/default/report.css +776 -0
  61. package/themes/default/report.js +427 -0
  62. package/themes/default/sketch.css +166 -0
  63. package/themes/default/sketch.js +681 -0
  64. package/themes/default/skins/adwaita.css +669 -0
  65. package/themes/default/skins/custom.css +596 -0
  66. package/themes/default/skins/egui.css +639 -0
  67. package/themes/default/skins/fluent.css +1093 -0
  68. package/themes/default/skins/fluent.js +458 -0
  69. package/themes/default/skins/mac.css +647 -0
  70. package/themes/default/skins/material.css +692 -0
  71. package/themes/default/skins/sketch.css +436 -0
  72. package/themes/default/skins/sketch.js +494 -0
  73. package/themes/default/skins/wire.css +561 -0
  74. package/themes/default/terminal.css +292 -0
  75. package/themes/default/terminal.js +433 -0
  76. package/themes/default/theme.json +149 -0
  77. package/themes/default/tokens.css +255 -0
  78. package/themes/default/tui.css +703 -0
  79. package/themes/default/tui.js +472 -0
  80. package/worker/index.js +6918 -0
  81. package/worker/migrations/0001_init.sql +52 -0
  82. package/worker/migrations/0002_blobs.sql +5 -0
  83. package/worker/migrations/0003_projects.sql +31 -0
  84. package/worker/migrations/0004_page_data_blob.sql +19 -0
package/package.json CHANGED
@@ -1,6 +1,50 @@
1
1
  {
2
2
  "name": "rshow",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.2",
4
+ "description": "Publish static artifacts to rshow",
5
+ "license": "MIT",
6
+ "homepage": "https://rslib.github.io/rshow",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/rslib/rshow.git",
10
+ "directory": "packages/cli"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/rslib/rshow/issues"
14
+ },
15
+ "keywords": [
16
+ "rshow",
17
+ "cli",
18
+ "publish",
19
+ "static",
20
+ "artifacts"
21
+ ],
22
+ "type": "module",
23
+ "engines": {
24
+ "node": ">=22"
25
+ },
26
+ "bin": {
27
+ "rshow": "dist/main.js"
28
+ },
29
+ "files": [
30
+ "dist",
31
+ "worker",
32
+ "skills",
33
+ "themes",
34
+ "README.md",
35
+ "LICENSE"
36
+ ],
37
+ "scripts": {
38
+ "test": "node --test test/",
39
+ "build": "node scripts/build.mjs",
40
+ "typecheck": "tsc --noEmit",
41
+ "prepack": "node scripts/assemble.mjs",
42
+ "sea": "node scripts/sea.mjs"
43
+ },
44
+ "devDependencies": {
45
+ "@types/node": "^26.6.6",
46
+ "esbuild": "0.28.2",
47
+ "rshow-shared": "*",
48
+ "typescript": "^5.9.3"
49
+ }
50
+ }
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: rshow
3
+ description: Load before you write, fix, share or publish a page, report, printed or web poster, paper landing page or status dashboard behind an rshow link, such as an art.<domain>/<name> URL. Load it even for a quick question about one or for one accent or theme shared by many pages, one link that gathers a paper's page, deck and figures for co-authors, a CSV you can filter and sort, wireframes or mockups of a web, desktop, mobile or terminal app, TUI layouts and ratatui panes, a rough hand sketch of boxes and arrows, an asciinema capture on a page, grouping artifacts into a project, sending a link not an attachment, a rollback or a publish error. Slide decks belong to rshow-slides, code from a design belongs to rshow-implement, an editable .pptx belongs to slides, a claude.ai Artifact belongs to the Artifact tool, visual design direction belongs to frontend-design.
4
+ ---
5
+
6
+ # rshow
7
+
8
+ rshow serves a folder of static files at a stable link on `https://art.example.com/<slug>/`.
9
+ Every publish of the same slug adds an immutable version, and the link keeps working.
10
+ A theme is a published artifact of its own, and a page links one at a version.
11
+ One theme ships, `default`: IBM Carbon on IBM Plex, in two modes, white and g100, following the system by default.
12
+ A report, a poster, a project page, a dashboard, a mockup, a sketch and a terminal page are the other shapes this skill writes.
13
+ Every one of them uses the same theme.
14
+ A talk deck is the one shape this skill hands off, and building the app is the other.
15
+ Read `rshow-slides` and `rshow-implement` for those two and come back here to publish.
16
+
17
+ ## Workflow
18
+
19
+ Copy this checklist into the reply and tick it as you go.
20
+
21
+ ```text
22
+ - [ ] shape picked and outline or headings agreed
23
+ - [ ] page written, theme linked at a pinned version
24
+ - [ ] rshow check <dir> exits 0
25
+ - [ ] rshow preview <dir> looked at 360px wide and at desktop width
26
+ - [ ] audience confirmed with the person
27
+ - [ ] project and tags passed as --project and --tag
28
+ - [ ] rshow publish <dir> printed a live-url
29
+ - [ ] live-url and audience reported
30
+ ```
31
+
32
+ 1. Pick the shape and say it back in one sentence, such as a page, a report, a poster, a project page, a dashboard, a mockup, a sketch, a terminal page or a prerendered Astro or Vite site.
33
+ 2. Write `index.html` in its own folder, link the theme at a pinned version and keep every other path relative.
34
+ 3. Run `rshow check <dir>`.
35
+ 4. Fix every error, then run `rshow check` again until it exits 0.
36
+ 5. Run `rshow preview <dir>` and open the printed `http://127.0.0.1:4321` link.
37
+ Look at it at 360px and at desktop width.
38
+ 6. Confirm the audience with the person before any `people` or `public` change.
39
+ 7. Run `rshow publish <dir> --slug <slug> --label "<what changed>"`.
40
+ Add `--project <slug> --tag <tag>` when the artifact belongs to a project or carries a tag.
41
+ 8. Report the printed `live-url` and say who can see it, and say which project holds it.
42
+
43
+ ## Page rules
44
+
45
+ - One `index.html` at the root of what you publish.
46
+ - Every path inside the artifact is relative, with no leading slash.
47
+ The only exceptions are `/_themes/...` and `/_data/...`.
48
+ - Link the theme, never copy it.
49
+ The stylesheet links and `mode.js` in the head all carry the same `<name>@<n>` version.
50
+ - Override tokens in one `:root` block, five declarations at most.
51
+ No selectors, no rules, no `!important`.
52
+ - Keep the script and the styles inline.
53
+ Add a framework only when the page needs one.
54
+ - `connect-src` is `'self'`.
55
+ Bake data in as a literal and fetch nothing from a third party.
56
+ - Pin an exact version in every CDN URL, such as `chart.js@4.4.1`.
57
+ Never write `latest`.
58
+ - A report links `report.css` and `report.js` in place of `page.css`, and `mode.js` still goes in the head.
59
+ Read [reports](reference/reports.md) before you write one.
60
+ - The page reads at 360px wide.
61
+ Tables go inside `<div class="table">`.
62
+ - Nothing secret in a page, because anyone who holds the link can read the HTML source.
63
+ - Never invent a number.
64
+ Print `[PLACEHOLDER]` and say so in the footer.
65
+ - The look is IBM Carbon on IBM Plex, and every colour has one job.
66
+ `themes/DESIGN.md` in the rshow repo holds the system, the type scale and the layout set.
67
+ - Fixed templates carry decks, reports, posters, project pages and dashboards, so the sections are set and the content is the work.
68
+ - Guided kits carry mockups, sketches and TUIs, so the kit gives you a frame, a floor and a checklist and the drawing is the work.
69
+ Starting a kit at its highest fidelity is the same mistake as decorating a fixed template.
70
+
71
+ ## Audience
72
+
73
+ - `private` is the owner plus the editors.
74
+ Keep it while the page is still being built.
75
+ - `people` is the owner plus every share, viewer or editor.
76
+ - `public` is anyone who holds the link, with no sign in.
77
+
78
+ Always confirm the audience with the person before you set `people` or `public`.
79
+ Name the artifact and say who will be able to read it.
80
+ Then say that a public link means anyone who receives it can read the page.
81
+ Also confirm before `--remove` and before `delete`.
82
+ Never widen access to make a demo easier.
83
+
84
+ Editors can publish and pin.
85
+ Only the owner can share, rename or delete.
86
+
87
+ ## Exit codes
88
+
89
+ | code | meaning | what to do |
90
+ |---|---|---|
91
+ | 0 | success | read the printed lines and report the `live-url` |
92
+ | 2 | usage | a flag, an argument, a slug or the token is wrong, or no token is set. Read `rshow --help` and fix the command |
93
+ | 4 | auth | the token is expired, revoked or under-scoped. Ask the person to set a token that fits |
94
+ | 5 | api | the host refused the request. Read the message, fix the input, retry once |
95
+ | 6 | check | `rshow check` or `rshow doctor` found an error. Read each finding and fix the page or the config |
96
+
97
+ On 2, fix the command and do not retry the same line.
98
+ On a config error (`no server configured`, no token, or a config file that will not load), run `rshow doctor` and show its output to the person.
99
+ On 4, or on exit 2 with `no token`, never ask for a token in chat. Tell the person to run `rshow login` in their own terminal, which saves the token in the Keychain.
100
+ On 5, retry once and then report the message verbatim.
101
+ On 6, fix the page, never `--no-check` past it.
102
+
103
+ ## Reference files
104
+
105
+ - [page contract](reference/page-contract.md) holds the CSP, the allowed CDNs, the data store and the phone width rule.
106
+ Read it before you write or review any HTML that goes to the host.
107
+ - [pages](reference/pages.md) holds the page skeleton, the token override block, diagrams and prerendered Astro or Vite sites.
108
+ Read it when the page is more than a few paragraphs.
109
+ - [themes](reference/themes.md) holds the shipped theme, its two modes, token files, the preview page, contrast and version bumps.
110
+ Read it when a token override is not enough and the look has to change.
111
+ - [reports](reference/reports.md) holds the report layout: sections, figures, tables, cross-references, notes, citations and print.
112
+ Read it when the artifact is a report or a paper rather than a page or a deck.
113
+ - [project page](reference/project-page.md) is the landing page of a paper, with its title block, teaser, key results and BibTeX entry.
114
+ - [poster](reference/poster.md) is the conference poster, with one sheet size, columns, a QR code and a print that is one page.
115
+ - [dashboard](reference/dashboard.md) is the results explorer, with a CSV in the folder, a filter bar, a summary, small multiples and a table.
116
+ - [mockups](reference/mockups.md) is the guided kit for UI drawings, with frames, skins, flows, states, annotations and comments.
117
+ - [sketch](reference/sketch.md) is an Excalidraw drawing read in the page and edited in place, saved to the store or downloaded.
118
+ - [terminal](reference/terminal.md) is the terminal viewer, the TUI kit and a real ratatui app built with Ratzilla.
119
+ - [cli](reference/cli.md) holds every command, every flag, the projects and tags that group artifacts and both config files.
120
+ Read it when a flag is not obvious, a publish failed or an artifact has to join a project.
121
+
122
+ ## Never in the look
123
+
124
+ - Never write an eyebrow, a kicker or a small caps label with wide tracking above a heading.
125
+ - Never set a label in mono or in capitals and never write a meta string such as `A / B / C` above a title.
126
+ - Never number a slide or a card 01, 02, 03 and never ship three equal cards with a coloured top rule.
127
+ - Never build an identity from cream and terracotta, from beige and brass or from near black plus one bright accent.
128
+ - Never put a coloured bar on an edge or a rule down the side of a quote, and never use a hairline rule as decoration.
129
+ - Never use Inter, Space Grotesk, Geist, Fraunces or Instrument Serif as the gesture.
130
+ - Never use gradient text, glass, a large shadow or an emoji.
131
+ - Never decorate what carries no information.
132
+ A chart is labelled at the end of the line, a table keeps its rules and nothing else does.
133
+
134
+ The short list above is a hard rule.
135
+ `themes/DESIGN.md` holds the rest: the palette roles, the type scale and the twelve layouts.
136
+
137
+ ## Never
138
+
139
+ - Never publish a folder that holds `.env`, a key, a credential or customer data.
140
+ - Never publish a source tree, `node_modules` or a `dist` folder that still holds a draft.
141
+ - Never write the token into a page, a script, a log line, a commit or a chat message.
142
+ - Never create a second artifact with a `-v2` slug.
143
+ Publish the same slug again.
144
+ - Never delete an artifact or drop a share without a yes from the person.
@@ -0,0 +1,263 @@
1
+ # CLI
2
+
3
+ ## Contents
4
+
5
+ - Every command
6
+ - check
7
+ - preview
8
+ - publish
9
+ - share and pin
10
+ - projects
11
+ - tags and list
12
+ - theme, show, delete
13
+ - skills
14
+ - handoff and compare
15
+ - Config files
16
+ - Exit codes
17
+
18
+ `rshow` is one binary and one file of flags.
19
+ This file is the whole surface, both config files and the exit codes.
20
+
21
+ ## Every command
22
+
23
+ | Command | What it does |
24
+ |---|---|
25
+ | `rshow check <file-or-dir>` | apply the page contract to the files a publish would upload |
26
+ | `rshow preview <dir>` | serve a folder on `127.0.0.1` for a look, offline |
27
+ | `rshow publish <file-or-dir>` | upload a folder, or one file as `index.html`, as a new version |
28
+ | `rshow config [dir] [--offline]` | print the merged config as JSON, with `theme` resolved to its current version, such as `default@3` |
29
+ | `rshow init --url <admin-url> --art <viewer-url>` | write the global config file, with `--theme` and `--force` |
30
+ | `rshow doctor [dir]` | check node, config, token, api, art, theme and skills, one `ok\|warn\|fail` line each |
31
+ | `rshow list` | list artifacts you own or that are shared with you, with `--project`, `--tag` and `--q` filters |
32
+ | `rshow show <slug>` | print the artifact, its versions, its shares, its project and its tags |
33
+ | `rshow share <slug>` | set the mode, or add and remove shares |
34
+ | `rshow pin <slug> <n\|live>` | serve version `n`, or `live` for the newest |
35
+ | `rshow project <cmd>` | create, list, show, share or delete a project |
36
+ | `rshow tag <slug>` | add or remove tags on an artifact |
37
+ | `rshow handoff <slug>@v<n>` | write a design handoff folder from a published design |
38
+ | `rshow compare --against <dir>` | compare an implementation with that handoff folder |
39
+ | `rshow delete <slug> --yes` | delete an artifact |
40
+ | `rshow theme new <name>` | write a preset folder that extends a built-in theme |
41
+ | `rshow theme check <dir>` | check a theme or preset folder against the token contract |
42
+ | `rshow theme preview <dir>` | build the theme, then serve its preview page on `127.0.0.1` |
43
+ | `rshow theme publish <dir>` | publish a theme folder as `theme-<name>` and set it public |
44
+ | `rshow theme list` | list theme artifacts and the version each one serves |
45
+ | `rshow skills install [target ...]` | link or copy the three skills into `~/.claude/skills`, `~/.pi/agent/skills` or `~/.codex/skills` |
46
+ | `rshow skills uninstall [target ...]` | remove the skill links and copies rshow made |
47
+ | `rshow skills status [target ...]` | print `link`, `copy v<version>`, `missing` or `foreign` per target and skill |
48
+ | `rshow login` | read a token from the terminal with no echo, check it and save it in the macOS Keychain. The person runs it, never the agent |
49
+ | `rshow logout` | remove the saved token |
50
+
51
+ `--help` on its own prints the general usage, and `--help` after a command prints that command.
52
+ `--json` is global and makes stdout the API reply, which is how a script reads a version number.
53
+
54
+ Every flag takes `--flag value` or `--flag=value`.
55
+ `--add`, `--editor`, `--remove` and `--tag` accept several values in a row after one flag.
56
+
57
+ ## check
58
+
59
+ ```bash
60
+ rshow check <file-or-dir> [--offline]
61
+ ```
62
+
63
+ It reads the same files a publish would upload, including `<dir>/<out>` when `rshow.json` names a build or an out folder.
64
+ Each finding is one line in the form `path:line: error|warning: msg`.
65
+ The exit code is 6 when there is at least one error and 0 otherwise.
66
+ Warnings do not fail the run, and they are still worth fixing when the fix is one line.
67
+
68
+ A warning is one of these:
69
+
70
+ - `index.html` with no viewport meta, or with no `title`.
71
+ - An `img` with no `alt`.
72
+ - A deck that links `deck.js` and holds no `<section class="slide">`.
73
+ - A style warning, such as an eyebrow label, three elements numbered `01`, `02`, `03`, gradient text, one of the trend fonts, a font nothing loads, cream next to terracotta, an emoji in visible text, glass or a heavy shadow and a purple to blue gradient.
74
+
75
+ The style warnings read every `.html` and `.css` file in the folder and skip anything under `fonts/` and any vendored `*.min.css` or `*.min.js`.
76
+ They are never errors, because a person may have a reason.
77
+ `--no-style` skips all of them, and `--json` prints the findings as data.
78
+
79
+ `--offline` skips every request the check would make, so it works on a plane and it never waits on the host.
80
+ A published page that links `/_themes/<name>@<n>/` needs the network to confirm that version exists, so a `--offline` run reports those links as unchecked rather than as a pass.
81
+
82
+ `rshow publish` runs the check first and stops while there is an error, so a page that fails the contract does not go live.
83
+ `--no-check` skips that step.
84
+ Use it only when you just ran `rshow check` yourself and the tree has not moved since.
85
+
86
+ ## preview
87
+
88
+ ```bash
89
+ rshow preview <dir> [--theme <dir>] [--offline] [--no-reload] [--port 4321]
90
+ ```
91
+
92
+ It serves `<dir>` on `127.0.0.1`, prints `http://127.0.0.1:<port>` and keeps running until you stop it.
93
+ It works offline: `/_themes/<name>@<n>/` comes from `--theme` when that folder is the theme, then from the built-in theme on disk, and only then from the art URL in the config, which `--offline` turns off.
94
+ A page that uses `<artifact>/_data/<key>` gets a local store for the session, and the page reloads by itself when a file changes, which `--no-reload` turns off.
95
+
96
+ ## publish
97
+
98
+ ```bash
99
+ rshow publish <file-or-dir> [--slug s] [--title t] [--label l] [--project p] [--tag t ...] [--build cmd] [--no-check] [--force]
100
+ ```
101
+
102
+ | Flag | Effect |
103
+ |---|---|
104
+ | `--slug` | the artifact name, `[a-z0-9][a-z0-9-]{0,62}`, default is the folder name made lowercase |
105
+ | `--title` | the human title, default keeps the current one |
106
+ | `--label` | a note on this version, such as "first draft" |
107
+ | `--build` | run this command in `<dir>` first, then publish `<dir>/<out>` |
108
+ | `--project` | move the artifact into a project |
109
+ | `--tag` | set its tags, and the flag repeats or takes several values |
110
+ | `--no-check` | skip the check and upload whatever is in the folder |
111
+ | `--force` | publish a new version even when the folder did not change |
112
+
113
+ A folder needs an `index.html` at its root.
114
+ A single file is published as `index.html`.
115
+ Publishing the same slug again adds a version and changes the live page, so a fix is a second publish and never a new slug.
116
+ A folder that did not change adds no version and prints `unchanged: <slug> is already v<n>`, and `theme publish` does the same for an unchanged theme.
117
+ It prints `slug`, `version`, `files`, `uploaded`, `skipped`, `label`, `version-url` and `live-url`.
118
+ Report `live-url` to the person, because that is the link that follows the newest version.
119
+
120
+ ## share and pin
121
+
122
+ ```bash
123
+ rshow share <slug> [--mode private|people|public] [--add a@b] [--editor a@b] [--remove a@b]
124
+ rshow pin <slug> <n|live>
125
+ ```
126
+
127
+ `--add` shares as viewer and `--editor` shares as editor.
128
+ `--remove` drops the share.
129
+ `pin <slug> <n>` serves an old version at the live link while the newest one stays latest, and `pin <slug> live` follows the newest again.
130
+ Pin before a talk, so a half finished publish cannot reach the room.
131
+
132
+ ## projects
133
+
134
+ ```bash
135
+ rshow project create <slug> [--title t] [--description d]
136
+ rshow project list
137
+ rshow project show <slug>
138
+ rshow project share <slug> [--add a@b] [--editor a@b] [--remove a@b]
139
+ rshow project delete <slug> --yes
140
+ ```
141
+
142
+ A project groups artifacts and shares them at once, and the URLs of the artifacts do not change.
143
+ A project has a slug in its own namespace, a title and a description of at most 500 characters.
144
+ `--add` adds a member as viewer and `--editor` adds one as editor, so a project share is the cheapest way to let a co-author see five artifacts.
145
+
146
+ The group page is at `https://art.example.com/_p/<project>/`, and the host renders it in the theme's look.
147
+ It lists the artifacts of the project that the viewer may see, with the title, the mode and the date.
148
+ It 404s when the viewer may see none of them and is not a member.
149
+ Copy that link from `rshow project show <slug>`, which prints it as `url`.
150
+ Send it when the person asks for everything at once.
151
+
152
+ An artifact belongs to at most one project, and moving one in needs its owner plus the owner or an editor of the project.
153
+ The effective role on an artifact is the higher of its own share role and the project member role.
154
+ The mode rules stay per artifact: `private` is the owner plus the editors, `people` adds every project member and `public` is everyone.
155
+ Deleting a project keeps its artifacts and clears their project.
156
+
157
+ ## tags and list
158
+
159
+ ```bash
160
+ rshow tag <slug> [--add t ...] [--remove t ...]
161
+ rshow list [--project p] [--tag t] [--q text]
162
+ ```
163
+
164
+ A tag is `[a-z0-9][a-z0-9-]{0,31}`, stored lowercase, at most ten per artifact.
165
+ A tag is a filter and never an audience, so it grants nothing and it hides nothing.
166
+ `rshow tag` prints the tags after the change, and an empty list prints `-`.
167
+ `rshow list` prints `slug mode served title` per artifact.
168
+ The three filters combine with AND.
169
+ `--q` matches the slug and the title.
170
+ Set the tags and the project in `rshow.json` when they are a fact about the folder rather than a one off, and the flag still wins.
171
+
172
+ ## theme, show, delete
173
+
174
+ `rshow theme publish <dir> [--label l] [--build cmd]` needs a `theme.json` with a `name`, publishes the folder as `theme-<name>`, sets it public and prints `/_themes/<name>@<n>/`.
175
+ `rshow theme list` prints the theme artifacts and the version each one serves.
176
+ `rshow show <slug>` prints the artifact, its versions, its shares, its pin and its URLs.
177
+ `rshow delete <slug> --yes` deletes the artifact and every version.
178
+ It needs `--yes`, and it needs a yes from the person.
179
+
180
+ A preset is a small folder whose `theme.json` carries `"extends": "default"` and only token and font overrides.
181
+ `rshow theme new <name> [--dir <parent>] [--from default]` writes it with both modes pre-filled with the base values of `--bg`, `--fg`, `--muted`, `--accent` and `--layer-01`, and prints the path plus `next: rshow theme check <dir>`.
182
+
183
+ ```bash
184
+ rshow theme new acme --dir ./themes
185
+ rshow theme check ./themes/acme
186
+ rshow theme preview ./themes/acme --port 4321
187
+ rshow theme publish ./themes/acme
188
+ ```
189
+
190
+ `theme check` prints `theme.json:<line>: error|warning: <message>` per finding and a summary line, and exits 6 on any error.
191
+ It names an unknown token, a colour value that is not `#hex`, `rgb()` or `var(--known-token)`, text under 4.5:1 in light, in dark or in print, a missing font file and a name that breaks the theme rules.
192
+ `theme preview` builds the preset on its base in a temporary folder and serves it on `127.0.0.1`, with the same offline theme lookup, local `_data` store and live reload as `rshow preview`, and prints the URL of `index.html`; the temporary folder goes when the server stops.
193
+ `theme publish` runs the check first on a preset, then publishes the built folder, so `--no-check` skips both.
194
+
195
+ ## skills
196
+
197
+ ```bash
198
+ rshow skills install [target ...] [--link|--copy] [--dry-run]
199
+ rshow skills uninstall [target ...] [--dry-run]
200
+ rshow skills status [target ...] [--json]
201
+ ```
202
+
203
+ The three skills, `rshow`, `rshow-slides` and `rshow-implement`, teach an agent to publish; `rshow skills install` puts them where claude, pi and codex read them.
204
+ A target is `claude` (`~/.claude/skills`), `pi` (`~/.pi/agent/skills`) or `codex` (`~/.codex/skills`), and with no target every one whose parent folder exists is used.
205
+ The default is a symlink to the skills folder rshow reads from; `--copy` copies it and writes a `.rshow-skill` marker with the version, which a link does not need.
206
+ The default copies in an npx cache, because npm may delete that folder under a live link.
207
+ Each skill prints `ok`, `installed`, `updated` or `removed`, then a summary line.
208
+ A folder, a file or a link that rshow did not make is left alone, with `skip <dst>: exists and is not from rshow` on stderr and exit 6 on the run.
209
+ `rshow skills uninstall` removes only what rshow made: a link into a skills folder that holds rshow skills, or a copy with the marker.
210
+ `rshow doctor` reports the skills on one `skills` line, which warns and never fails.
211
+
212
+ ## handoff and compare
213
+
214
+ ```bash
215
+ rshow handoff <slug>@v<n> [--out dir] [--widths 1440,390] [--modes light,dark]
216
+ rshow compare --against <handoff-dir> [--map rshow.map.json] [--threshold 0.1] [--max-diff-ratio 0.02] [--tui-colors] [--publish]
217
+ ```
218
+
219
+ `handoff` freezes a published design into a folder of `tokens.json`, `spec.json`, `HANDOFF.md` and `baseline/`, so a builder works from a copy that cannot move.
220
+ `compare` opens that folder's screens next to the app and fails with exit 7 when a screen drifts.
221
+ Both belong to `rshow-implement`, which owns the map, the three checks and the whole loop, so read that skill before you run either one.
222
+ This skill publishes the mockup and hands the link over, and it never builds the app.
223
+
224
+ The one exception is a tmux target, such as `tmux:mysession:0.1`, which is how a terminal app is compared cell by cell.
225
+
226
+ ## Config files
227
+
228
+ Later files win, and the environment beats both.
229
+
230
+ | File | Fields |
231
+ |---|---|
232
+ | `~/.config/rshow/config.json` | `url`, `art`, `theme`, `tokens` |
233
+ | `<dir>/rshow.json` | `slug`, `title`, `theme`, `tokens`, `project`, `tags`, `build`, `out` |
234
+
235
+ | Field | Meaning |
236
+ |---|---|
237
+ | `url` | the API base, set by `rshow init` or `RSHOW_URL`; a command that needs the API fails without it |
238
+ | `art` | the art base the preview proxies `/_themes/` to, set by `rshow init` or `RSHOW_ART`; without it a theme lookup is skipped with a warning |
239
+ | `slug` | the artifact to publish to, overridden by `--slug` |
240
+ | `title` | the human title, overridden by `--title` |
241
+ | `theme` | the theme a page should link: `<name>`, `<name>@latest` or a fixed `<name>@<n>`. `rshow config` prints it as `<name>@<n>` and you apply it by hand |
242
+ | `tokens` | token overrides recorded and printed by `rshow config`. No command writes them into a page, so apply them by hand |
243
+ | `build` | the command `publish` runs in the folder first |
244
+ | `out` | the folder under `<dir>` to publish, default `dist` |
245
+ | `project` | the project slug the artifact belongs to, overridden by `--project` |
246
+ | `tags` | the tags to set, overridden by `--tag` |
247
+
248
+ `RSHOW_URL` overrides `url` and `RSHOW_ART` overrides `art`.
249
+ `rshow init --url <admin-url> --art <viewer-url>` writes the global file with both, keeps its other fields, and prints the next step, `rshow login`.
250
+ `rshow doctor [dir]` checks node, both config files, the token, the API, the art host, the theme and the skills, one line each, and exits 6 when a check failed. Run it on a config error and show its output to the person.
251
+ The token comes from `RSHOW_TOKEN`, else from the macOS Keychain, where `rshow login` saves it. It is never read from a file or from a flag.
252
+ `XDG_CONFIG_HOME` moves the global config file away from `~/.config`.
253
+
254
+ ## Exit codes
255
+
256
+ | Code | Meaning |
257
+ |---|---|
258
+ | 0 | it worked |
259
+ | 2 | usage, which covers a bad flag, a bad slug, a missing `index.html` and a missing token |
260
+ | 4 | auth, which covers an expired token, a revoked token and a token without the scope the command needs |
261
+ | 5 | api or a failed build, which covers a taken slug, a refused request and a build command that exited non-zero |
262
+ | 6 | `rshow check` found an error in the page, or a skill folder in the way is not from rshow |
263
+ | 7 | `rshow compare` found a screen that drifted from the handoff |
@@ -0,0 +1,122 @@
1
+ # Dashboard
2
+
3
+ ## Contents
4
+
5
+ - What it is for
6
+ - Skeleton
7
+ - Where the data comes from
8
+ - Which column does what
9
+ - The four blocks
10
+ - State in the link
11
+ - Checks
12
+
13
+ A results dashboard is the page a reader works in rather than reads: a filter bar, a summary, small multiples and the table of rows behind them.
14
+ It is a fixed template, so the four blocks are set and the data is the work.
15
+ `dashboard.css` sets the look and `dashboard.js` reads the data, draws the chart and keeps the view in the link.
16
+
17
+ ## What it is for
18
+
19
+ Use it when somebody asks the same question of the same table every week, such as what the last run did or which configuration was slowest.
20
+ Use a report when the answer is a sentence.
21
+ Use a deck when the answer is a room.
22
+ A dashboard that nobody filters is a report with extra steps.
23
+
24
+ ## Skeleton
25
+
26
+ ```html
27
+ <!doctype html>
28
+ <html lang="en">
29
+ <head>
30
+ <meta charset="utf-8">
31
+ <meta name="viewport" content="width=device-width, initial-scale=1">
32
+ <title>Write-ahead log, results per run</title>
33
+ <link rel="stylesheet" href="/_themes/default@3/fonts.css">
34
+ <link rel="stylesheet" href="/_themes/default@3/tokens.css">
35
+ <link rel="stylesheet" href="/_themes/default@3/dashboard.css">
36
+ <script src="/_themes/default@3/mode.js"></script>
37
+ <script defer src="/_themes/default@3/dashboard.js"></script>
38
+ </head>
39
+ <body>
40
+ <div class="dashboard" data-src="results.csv" data-facet="workload"
41
+ data-x="nodes" data-series="system" data-metric="throughput"
42
+ data-unit="publishes/s" data-filters="system,workload,nodes">
43
+
44
+ <header class="dash-head">
45
+ <h1>Write-ahead log, results per run</h1>
46
+ <p class="dash-lede">One line that says what this page answers.</p>
47
+ <p class="dash-meta" data-dashboard-source></p>
48
+ </header>
49
+
50
+ <form class="dash-filters" data-dashboard-filters></form>
51
+ <p class="dash-status" data-dashboard-status aria-live="polite"></p>
52
+
53
+ <section class="dash-section">
54
+ <h2>Summary</h2>
55
+ <div class="dash-box" data-dashboard-summary></div>
56
+ </section>
57
+
58
+ <section class="dash-section">
59
+ <h2>Throughput by node count</h2>
60
+ <figure class="dash-figure">
61
+ <div data-dashboard-facets></div>
62
+ <figcaption data-dashboard-caption></figcaption>
63
+ </figure>
64
+ </section>
65
+
66
+ <section class="dash-section">
67
+ <h2>Runs</h2>
68
+ <div class="dash-toolbar" data-dashboard-toolbar></div>
69
+ <div class="dash-box" data-dashboard-table></div>
70
+ </section>
71
+
72
+ </div>
73
+ </body>
74
+ </html>
75
+ ```
76
+
77
+ ## Where the data comes from
78
+
79
+ The data is a file in the folder, such as `results.csv`, named by `data-src`.
80
+ A `.json` path reads as an array of rows or as `{"rows": [...]}`, and anything else reads as CSV with quoted fields.
81
+ A `<script type="application/json" id="data">` block wins over `data-src`, which is how a small table travels inside the one file.
82
+
83
+ The content policy allows `connect-src 'self'` and nothing else, so a page never fetches from a third party.
84
+ Publish the CSV with the page and say in the footer where the rows came from, such as the commit and the date of the run.
85
+ Keep the CSV plain, with a header row, one row per run and one column per fact.
86
+
87
+ ## Which column does what
88
+
89
+ Which column does what is a page decision, so it is an attribute and never a guess.
90
+
91
+ | Attribute | Meaning |
92
+ |---|---|
93
+ | `data-facet` | the column that groups the panels and the summary |
94
+ | `data-x` | the column on the axis |
95
+ | `data-series` | the column that splits a panel into lines, one to eight |
96
+ | `data-metric` | the number the summary and the chart read |
97
+ | `data-unit` | the unit printed after a value, such as `publishes/s` |
98
+ | `data-filters` | the columns that get a control, one select per text column and a from and to pair per number column |
99
+
100
+ ## The four blocks
101
+
102
+ - The summary is runs, median and p95 of the metric, and it names the filter it was computed under.
103
+ - The small multiples are one panel per facet value, on a shared scale, so a reader compares shapes and not axes.
104
+ - The table holds the rows behind the chart, sorted by a click on a header, with numbers right aligned in tabular figures.
105
+ - The status line says how many rows of how many are showing, and it is the only place a count of hidden rows appears.
106
+
107
+ A chart is labelled at the end of the line and the palette is `--chart-1` to `--chart-8`, so no legend box is needed.
108
+ The script reads those tokens at draw time, which is why a mode change redraws the chart instead of restyling it.
109
+
110
+ ## State in the link
111
+
112
+ The filters and the sort live in the URL hash, so a link reproduces the view.
113
+ Send the person the link with the filters set, because a screenshot of a filtered view is a claim nobody can check.
114
+ The reset control returns to the whole table, and the address without a hash is the whole table.
115
+
116
+ ## Checks
117
+
118
+ - `rshow check <dir>` exits 0, and it holds no unpinned script and no absolute request.
119
+ - `rshow preview <dir>`, then filter, sort and reload: the view comes back from the link.
120
+ - Look at it at desktop width and at 360px, in both modes.
121
+ Check that the table scrolls inside its own box.
122
+ - Every number on the page is in the CSV, and the footer says where the CSV came from.