figura-cli 0.10.1 → 0.10.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.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # figura-cli
2
2
 
3
3
  Command-line client for the **Figura** visualization SaaS. Talks to the Figura
4
- `/api/v1` HTTP API with a Bearer `fig_` token.
4
+ `/v1` HTTP API (base `https://api.figura.so`) with a Bearer `fig_` token.
5
5
 
6
6
  ## Install
7
7
 
@@ -49,7 +49,7 @@ Resolution precedence:
49
49
  | Value | Order |
50
50
  | ------ | ------------------------------------------------------ |
51
51
  | token | `FIGURA_TOKEN` env → `--token` flag → project `.figura/config.json` → global `~/.figura/config.json` |
52
- | apiUrl | `FIGURA_API_URL` env → `--api-url` flag → project config → global config → default `https://figura.so` |
52
+ | apiUrl | `FIGURA_API_URL` env → `--api-url` flag → project config → global config → default `https://api.figura.so` |
53
53
 
54
54
  ### Multiple teams — one per project
55
55
 
@@ -205,6 +205,6 @@ Every command accepts `--help`. Add `--json` where noted to get machine-readable
205
205
  ```bash
206
206
  bun install
207
207
  bun run dev -- --help # run from source with bun
208
- bun run build # bundle + minify src -> dist/index.js (single file)
208
+ bun run build # bundle skills + minify src -> dist/index.js AND dist/mcp.js
209
209
  node dist/index.js --help
210
210
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "figura-cli",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "description": "Command-line client for the Figura visualization SaaS",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -24,6 +24,28 @@ from your brand. To change the brand, use the `figura-brand` skill, not this one
24
24
  - Before any visual / layout / state change — a wrong fig costs seconds; a wrong
25
25
  build costs a recompile-and-screenshot loop.
26
26
 
27
+ ## Existing-first — never mock a redesign blind
28
+
29
+ **Before building, find out whether this screen already exists.** A fig that
30
+ proposes a redesign without showing what it replaces is how you "improve"
31
+ something in a vacuum — and end up rebuilding what already ships. So every time,
32
+ *first*:
33
+
34
+ - **Search the codebase** for the screen/flow you're about to mock — Grep/Glob for
35
+ the route, component, or page (an `onboarding/`, `settings/brand/` dir, a
36
+ matching route). If a real implementation exists, **Read it** and treat it as the
37
+ baseline you must show.
38
+ - **Check the team's figs** — `figura fig list --area <area>` (or
39
+ `figura_list_figs`). If a fig of this screen already exists, **`fig revise` it**
40
+ (a new version in the same chain), never a fresh duplicate.
41
+
42
+ If any prior design exists → build in **`mode: compare`** and render it as
43
+ **existing (as-is) → proposed**, grounded in the real current state. Even when the
44
+ proposal is better, it must be argued against what's there — that's the whole
45
+ point. Only build a standalone `single` fig when the screen is genuinely net-new.
46
+ Unsure whether a version already exists? **Ask the user** rather than assume
47
+ greenfield.
48
+
27
49
  ## How to fig
28
50
 
29
51
  1. **Check auth** — call **`figura_whoami`** to confirm you're connected to a
@@ -36,7 +58,8 @@ from your brand. To change the brand, use the `figura-brand` skill, not this one
36
58
  system — `bunx figura-cli brand --json` — and hand-build the fig's HTML against
37
59
  it, then land it with **`figura_create_fig`** (`publish: true`), setting
38
60
  `area`, `orientation` (`portrait` / `landscape` / `both`), `mode` (`single` /
39
- `compare` / `variations`), `title`, and a real description. This uses the
61
+ `compare` / `variations` default to `compare` when Existing-first turned up a
62
+ baseline), `title`, and a real description. This uses the
40
63
  caller's own Claude (the model running this skill) — no extra cost, full control
41
64
  for precise broken-vs-proposed diptychs — and applies the team's brand from the
42
65
  fetched design system. **Follow that design system verbatim; never invent brand
@@ -52,6 +75,42 @@ from your brand. To change the brand, use the `figura-brand` skill, not this one
52
75
 
53
76
  4. **Review** the returned link, share it, move on.
54
77
 
78
+ ## Presenting a redesign — overview ⇄ focus
79
+
80
+ When a fig argues a change against a current state (a shipped baseline, or
81
+ several candidate directions), build one fig with **two switchable views** —
82
+ CSS-only radio tabs, since figs carry no `<script>`:
83
+
84
+ - **Overview — side by side.** Every state at once: the honest current state
85
+ first, then each variation, as scaled-down frames in a grid. Under each: a
86
+ status chip and ONE condensed context line (`+ / –`). This view is for
87
+ scanning and picking a direction, not for reading detail. The grid must
88
+ wrap to one column before it can overflow — **a fig never scrolls
89
+ horizontally**, at any viewport.
90
+ - **Focus — full frame.** One state at a time behind state pills (Today / A /
91
+ B / …), each state framed identically so flipping states in place reads as
92
+ spot-the-difference. This is where the context lives, pinned on the frame
93
+ as annotation chips: what's broken today, what each variation improves,
94
+ what it trades away.
95
+ - **In both views:** render the current state honestly from the shipped
96
+ implementation; color-code chips by function (broken / improved /
97
+ trade-off / detail) using the team's status colors from the fetched design
98
+ system; mark the recommended variation and close with a short "my read"
99
+ arguing the pick against the others. Keep the chrome around the frames
100
+ minimal — the frames are the content; no legends (chips label themselves),
101
+ no repeated context, fluid `max-width` layout throughout.
102
+ - **Verify before publishing.** Render the fig headless at a few viewport
103
+ widths: `document.scrollWidth` must equal the viewport in every view and
104
+ state (sideways scroll = broken — beware CSS `zoom`, which leaks unzoomed
105
+ width into scrollable overflow; scale minis with `transform` in
106
+ fixed-aspect wrappers instead), and screenshot each state to check no
107
+ annotation chip covers the content it annotates.
108
+
109
+ A **wipe-slider** stays the narrow tool for exactly two states of the same
110
+ layout with pixel-level tweaks. Never ship a squeezed side-by-side as the
111
+ *only* view of desktop frames, and never a full-frame toggle as the only
112
+ view of many variations — each is one half of the pair above.
113
+
55
114
  ## Notes
56
115
 
57
116
  - **MCP unavailable** (headless / cron, or no interactive auth): fall back to the