figura-cli 0.5.0 → 0.7.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "figura-cli",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "Command-line client for the Figura visualization SaaS",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: figura-brand
3
+ description: "Introduce a repo to Figura — scan the codebase for its design system (design tokens, brand docs, app name) and set the team's Figura brand profile so generated figs are on-brand. Use when asked to import or sync a brand, set up Figura for a project, or 'introduce my repo to Figura'."
4
+ argument-hint: '[path to the repo or design-system directory]'
5
+ allowed-tools: 'Read, Grep, Glob, Bash(figura *), Bash(bunx figura-cli *)'
6
+ ---
7
+
8
+ # Figura Brand — introduce a repo to Figura
9
+
10
+ Scan THIS repository for its design system and set the user's Figura **brand
11
+ profile** from it, so every fig the `/fig` skill / generator produces is on-brand.
12
+ You (Claude) do the synthesis — read the code and docs, then push the result. No
13
+ figura.so UI.
14
+
15
+ `$ARGUMENTS` is an optional path to focus on (a repo root or a design-system
16
+ directory). Default to the current repo.
17
+
18
+ ## Prerequisites
19
+
20
+ The user needs the `figura` CLI authenticated once (`figura login`) — the brand is
21
+ written to the team that token belongs to. If a `figura` **MCP server** is
22
+ connected, prefer its `figura_set_brand` tool over the CLI. If neither the CLI nor
23
+ `bunx figura-cli` is available, tell the user to install it
24
+ (`curl -fsSL https://figura.so/install.sh | bash`) and stop.
25
+
26
+ Confirm the target team first: `figura whoami` (or the `figura_whoami` tool). The
27
+ brand is **team-wide and overwrites** the current one — never push without showing
28
+ the user what you're about to set and getting an explicit OK.
29
+
30
+ ## Workflow
31
+
32
+ ### 1. Scan the repo for design signals
33
+
34
+ Hunt across whatever stack this repo uses — do not assume one framework:
35
+
36
+ - **Design tokens** — colors, type, spacing, radii, gradients. Look for:
37
+ - iOS/Swift: `Color(hex: 0x…)`, `UIColor`, `Font.custom(…)`, asset catalogs (`*.xcassets/*.colorset`), files like `Colors.swift` / `DesignTokens.swift` / a `design-system/` dir.
38
+ - Web: CSS custom properties (`--color-…`, `:root{}`), Tailwind theme (`tailwind.config.*`), `tokens.ts|json`, styled/emotion themes, SCSS `$vars`.
39
+ - Android: `colors.xml`, `themes.xml`.
40
+ - A generated/single-source tokens file (e.g. a `tokens.generated.*`) — prefer it; it's the source of truth.
41
+ - **Brand voice + positioning** — `BRAND.md`, `STRATEGY.md`, design-system READMEs, marketing copy, the landing page hero. Capture the tone and any explicit voice lines / taglines.
42
+ - **Identity** — app/brand name + one-line description: `package.json` (name/description), `Info.plist` (`CFBundleName`), app-store copy, the README's first paragraph.
43
+ - **Role/usage notes** — inline comments next to tokens often state the role
44
+ (e.g. `// primary brand accent; record button`). Carry those into the tokens block.
45
+
46
+ Use `Glob`/`Grep` to locate, `Read` to extract real values. Use the REAL hexes,
47
+ fonts, and sizes from the repo — never invent them.
48
+
49
+ ### 2. Synthesize the brand profile
50
+
51
+ Produce three fields (see `reference/brand-format.md` for the exact tokensBlock shape):
52
+
53
+ - **name** — the product/brand name.
54
+ - **appDescription** — one clause: what it is + who it's for.
55
+ - **tokensBlock** — freeform plain text the fig generator reads verbatim:
56
+ - **Colors** — the real palette, each `#HEX — name — role` (role from the repo's comments/usage).
57
+ - **Brand gradient** — if the repo defines one, state it exactly (`linear-gradient(…)`).
58
+ - **Type** — display / body / mono faces (real font names + fallbacks) and the size scale.
59
+ - **Spacing / radius** — the base unit + scale.
60
+ - **Icon language** — SF Symbols / inline SVG / icon set the product uses; ban emoji if the brand does.
61
+ - **Voice** — 3–5 short brand voice lines + a one-line tone rule, inferred from the docs/copy.
62
+ - **Conventions** — any hard rules you found ("never use X", aspect ratios, chrome shape).
63
+
64
+ This synthesis IS the value — enrich the raw tokens with the roles, voice, and
65
+ conventions you read from the repo. Keep it grounded in what's actually there.
66
+
67
+ ### 3. Confirm, then push
68
+
69
+ Show the user the synthesized `name`, `appDescription`, and the full `tokensBlock`,
70
+ and confirm the target team (`figura whoami`). On approval:
71
+
72
+ - **MCP (preferred):** call `figura_set_brand` with `{ name, appDescription, tokensBlock }`.
73
+ - **CLI fallback:** pipe the block over stdin —
74
+ ```bash
75
+ cat <<'TOKENS' | figura brand set --name "<name>" --description "<one clause>" --tokens -
76
+ … the tokensBlock …
77
+ TOKENS
78
+ ```
79
+ (Use `bunx figura-cli` in place of `figura` if it isn't on PATH.)
80
+
81
+ ### 4. Verify
82
+
83
+ `figura brand --json` (or the `figura_whoami` → `figura brand` read) → confirm
84
+ `isCustom: true` and that the saved tokens match. Then tell the user the brand is
85
+ set and suggest trying `/fig <a screen>` to see it render on-brand.
86
+
87
+ ## Output
88
+
89
+ Report the brand you set (name + a one-line summary of the palette/type/voice you
90
+ captured) and confirm it's live for the team. Don't paste the entire tokensBlock
91
+ again unless asked.
@@ -0,0 +1,81 @@
1
+ # tokensBlock format
2
+
3
+ The brand profile's `tokensBlock` is **freeform plain text** injected verbatim
4
+ into the fig-generation prompt. It is NOT JSON, NOT markdown — just clear,
5
+ sectioned plain text with concrete values. Lead with hard rules; be terse.
6
+
7
+ Aim for these sections (skip any the repo genuinely doesn't have; never invent
8
+ values):
9
+
10
+ ```
11
+ <NAME> BRAND GROUND-TRUTH (locked — these are NOT suggestions):
12
+
13
+ WHAT <NAME> IS
14
+ - One or two lines: what the product is, the platform, the core metaphor.
15
+ - The pitch / tagline if there is one.
16
+
17
+ COLORS (use ONLY these — never invent hues)
18
+ - <#HEX> <Name> — <role/usage, from the repo's comments or how it's used>.
19
+ - … one line per color. Note any opacity variants used over media.
20
+
21
+ THE BRAND GRADIENT (only if the repo defines one)
22
+ - EXACTLY one: linear-gradient(<deg>, <#HEX>, <#HEX>). Where it's allowed.
23
+
24
+ TYPE
25
+ - Display: <Font> — stack '<Font>', <fallbacks>. Where it's used + weight rule.
26
+ - Body: <Font> — stack <fallbacks>. UI text.
27
+ - Mono: <Font> — stack <fallbacks>. Numerics / code.
28
+ - Scale: <the real size ramp, e.g. 12 / 14 / 16 / 20 / 24 / 36 / 48>.
29
+
30
+ SPACING / RADIUS
31
+ - Base unit + scale (e.g. 4-based: 4 8 12 16 24 32 …). Radius tokens (sm/md/lg/full).
32
+
33
+ ICON LANGUAGE
34
+ - The icon set the product uses (SF Symbols names / inline stroke SVG / a named set).
35
+ - Ban emoji if the brand bans it.
36
+
37
+ VOICE (3–5 lines, the brand's register)
38
+ - Short example lines in the brand's actual tone (pull/adapt from brand docs/copy).
39
+ - One tone rule (e.g. "terse, confident, never salesy").
40
+
41
+ CONVENTIONS (hard rules found in the repo)
42
+ - e.g. aspect ratios, chrome shape (pill/capsule), "never use <X>", dark-first, etc.
43
+ ```
44
+
45
+ ## Worked example (Pano — abridged)
46
+
47
+ ```
48
+ PANO BRAND GROUND-TRUTH (locked):
49
+
50
+ WHAT PANO IS
51
+ - A landscape creator-cinema iOS app. Films are always landscape, 2:1, never portrait.
52
+ - Voice, not text. Tagline: "Go wide."
53
+
54
+ COLORS (use ONLY these)
55
+ - #DD5325 Vermillion — primary brand accent; record/active state; gradient start.
56
+ - #2A6F84 Teal — secondary accent; pro/expert affordances; gradient end.
57
+ - #E2E2DC Paper — foreground text + light surfaces (a cool gray; never warm cream).
58
+ - #0A0A0A Ground — near-black base background.
59
+
60
+ THE BRAND GRADIENT
61
+ - EXACTLY one: linear-gradient(90deg, #DD5325, #2A6F84). Wordmark/hero accents only.
62
+
63
+ TYPE
64
+ - Display: Clash Display — stack 'Clash Display', system-ui, sans-serif. Medium at display size.
65
+ - Body: Inter — stack Inter, -apple-system, 'SF Pro Text', system-ui, sans-serif.
66
+ - Mono: JetBrains Mono — hex values, timecode, numerics.
67
+ - Scale: 12 / 14 / 16 / 18 / 20 / 24 / 30 / 36 / 48.
68
+
69
+ SPACING / RADIUS
70
+ - 4-based scale: 4 8 12 16 20 24 32 40 48 64. Radius: sm 4, md 8, lg 12, full 999.
71
+
72
+ ICON LANGUAGE
73
+ - SF Symbols by name (mic.fill, waveform, play.fill, chevron.right). Inline stroke SVG. NEVER emoji.
74
+
75
+ VOICE
76
+ - "Vertical was a phase." "Stories went sideways." "Turn your phone." "Go sideways."
77
+ - Terse, sideways, confident — never salesy.
78
+
79
+ CONVENTIONS
80
+ - Films always 2:1 landscape. Chrome is pill/capsule (border-radius 999). Dark-first. Never iOS "Liquid Glass".
81
+ ```