trdr-ds-install 1.0.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/README.md ADDED
@@ -0,0 +1,67 @@
1
+ # trdr-plugins
2
+
3
+ TRDR company plugins for Claude Code.
4
+
5
+ ## Installation (one-time, per developer)
6
+
7
+ ```bash
8
+ npx trdr-ds-install@latest
9
+ ```
10
+
11
+ This installs the `trdr-ds` skill into `~/.claude/skills/` — available in all your projects.
12
+
13
+ For project-scoped install (goes into `.claude/skills/` in the current directory):
14
+
15
+ ```bash
16
+ npx trdr-ds-install@latest --project
17
+ ```
18
+
19
+ After installing, **restart Claude Code** to activate the skill.
20
+
21
+ ## Updating
22
+
23
+ Same command. The `@latest` flag bypasses npm cache and always fetches the newest version:
24
+
25
+ ```bash
26
+ npx trdr-ds-install@latest
27
+ ```
28
+
29
+ ## Available skills
30
+
31
+ ### `/trdr-ds` — TRDR Design System
32
+
33
+ Applies the TRDR Design System to any project in two phases:
34
+
35
+ 1. **Analysis** — scans the project, finds violations, presents a migration plan
36
+ 2. **Execution** — after approval, creates tokens.css, components.css, CLAUDE.md, and fixes violations
37
+
38
+ Component data is always fetched live from the Design Hub at **https://trdr.mrocontent.com.br**, so new components added to the Hub are automatically available.
39
+
40
+ **Usage:** Run `/trdr-ds` in any project after installing.
41
+
42
+ ## For maintainers (Mauro)
43
+
44
+ To push an update to all developers:
45
+
46
+ ```bash
47
+ # 1. Edit the skill
48
+ # plugins/trdr-design-system/skills/trdr-ds/SKILL.md
49
+ # plugins/trdr-design-system/skills/trdr-ds/references/rules.md
50
+
51
+ # 2. Commit and push
52
+ git add . && git commit -m "..." && git push
53
+
54
+ # 3. Publish to npm (bumps patch version automatically)
55
+ npm version patch && npm publish
56
+ ```
57
+
58
+ Developers get the update on their next `npx trdr-ds-install@latest` run.
59
+
60
+ ## Design Hub
61
+
62
+ https://trdr.mrocontent.com.br
63
+
64
+ - Tokens: /tokens/semanticos
65
+ - Components: /componentes
66
+ - Rules: /para-ia
67
+ - Full spec: /design-md
package/bin/install.js ADDED
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+ const os = require('os');
7
+
8
+ const args = process.argv.slice(2);
9
+ const isProject = args.includes('--project');
10
+
11
+ const base = isProject
12
+ ? path.join(process.cwd(), '.claude', 'skills')
13
+ : path.join(os.homedir(), '.claude', 'skills');
14
+
15
+ const dest = path.join(base, 'trdr-ds');
16
+ const src = path.join(__dirname, '..', 'plugins', 'trdr-design-system', 'skills', 'trdr-ds');
17
+
18
+ if (!fs.existsSync(src)) {
19
+ console.error('Erro: arquivos da skill não encontrados em', src);
20
+ process.exit(1);
21
+ }
22
+
23
+ fs.cpSync(src, dest, { recursive: true, force: true });
24
+
25
+ const scope = isProject ? 'project (.claude/skills/)' : 'user (~/.claude/skills/)';
26
+ console.log('');
27
+ console.log('✓ trdr-ds skill instalada com sucesso!');
28
+ console.log(' Escopo: ' + scope);
29
+ console.log(' Local: ' + dest);
30
+ console.log('');
31
+ console.log(' Reinicie o Claude Code para ativar.');
32
+ console.log(' Em qualquer projeto, use /trdr-ds para aplicar o Design System TRDR.');
33
+ console.log('');
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "trdr-ds-install",
3
+ "version": "1.0.0",
4
+ "description": "Installs the TRDR Design System skill for Claude Code",
5
+ "bin": {
6
+ "trdr-ds-install": "./bin/install.js"
7
+ },
8
+ "files": [
9
+ "bin/",
10
+ "plugins/trdr-design-system/skills/"
11
+ ],
12
+ "engines": {
13
+ "node": ">=16"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/mrofernandes/trdr-plugins.git"
18
+ },
19
+ "author": "Mauro Fernandes <mrocontent@gmail.com>",
20
+ "license": "MIT"
21
+ }
@@ -0,0 +1,866 @@
1
+ ---
2
+ name: trdr-ds
3
+ description: Applies the TRDR Design System to any project. Runs a two-phase workflow: first analyzes the project and presents a migration plan for approval, then executes the full implementation (tokens, components, CLAUDE.md, violation fixes). Trigger when developer mentions "apply design system", "implement TRDR DS", "add TRDR tokens", "design system setup", "migrar design system", "aplicar design system", or invokes /trdr-ds.
4
+ user-invocable: true
5
+ argument-hint: "[analyze|apply]"
6
+ allowed-tools: [Read, Glob, Grep, Edit, Write, Bash, WebFetch]
7
+ ---
8
+
9
+ You are implementing the TRDR Design System in a developer's project. The Design Hub is the single source of truth and lives at **https://trdr.mrocontent.com.br**.
10
+
11
+ Execute in two clearly separated phases: **PHASE 1: ANALYZE → PHASE 2: EXECUTE (only after approval)**.
12
+
13
+ ---
14
+
15
+ ## PHASE 1: ANALYSIS (run automatically on invocation)
16
+
17
+ Scan the project and produce a structured migration plan. Do NOT modify any files yet.
18
+
19
+ ### Step 1 — Detect framework
20
+
21
+ Read `package.json` at the project root. Identify:
22
+ - Framework: Next.js (version), React (CRA/Vite), Vue/Nuxt, plain HTML, other
23
+ - Language: TypeScript or JavaScript
24
+ - Styling: CSS Modules, Tailwind, CSS-in-JS, plain CSS, SCSS
25
+
26
+ ### Step 2 — Map style structure
27
+
28
+ Search for all style files:
29
+ ```
30
+ Glob: ["**/*.css", "**/*.scss"] — exclude node_modules, .next, dist, build, out
31
+ ```
32
+
33
+ Identify:
34
+ - Main global CSS file (globals.css, main.css, index.css, app.css, styles.css)
35
+ - Whether CSS custom properties already exist (look for `:root {`)
36
+ - Potential conflicts with TRDR prefixes: `--bg-`, `--content-`, `--action-`, `--surface-`, `--border-`, `--spacing-`, `--radius-`
37
+ - Whether fonts (Space Grotesk, Inter, Roboto Mono) are already loaded
38
+
39
+ Determine the best directory for new CSS files:
40
+ - Next.js with `src/`: → `src/styles/`
41
+ - Next.js without `src/`: → `styles/`
42
+ - React CRA/Vite with `src/`: → `src/styles/` or `src/assets/`
43
+ - Plain HTML: → `css/` or `styles/`
44
+
45
+ ### Step 3 — Find violations
46
+
47
+ Search for TRDR rule violations across all source files (*.css, *.scss, *.tsx, *.jsx, *.ts, *.js, *.vue, *.html):
48
+
49
+ **A — Hardcoded colors** (should be CSS vars):
50
+ Search pattern: `#[0-9A-Fa-f]{3,8}` in CSS/SCSS files; `#[0-9A-Fa-f]{3,8}` in component files within style props or className strings.
51
+
52
+ **B — Hardcoded font-family** (should be var(--font-primary/secondary/mono)):
53
+ Search: `font-family.*Inter|font-family.*Space Grotesk|font-family.*Roboto Mono`
54
+
55
+ **C — Hardcoded px spacing** (should be var(--spacing-*)):
56
+ Search: `(margin|padding|gap):\s*\d+px` in CSS/SCSS
57
+
58
+ **D — Primitive token usage** (should be semantic):
59
+ Search: `var\(--color-|var\(--space-` in CSS/SCSS/component files
60
+
61
+ **E — Missing tokens.css**:
62
+ Check if `tokens.css` already exists in the project and if it's imported in the global CSS.
63
+
64
+ ### Step 4 — Fetch latest component list from Hub
65
+
66
+ Fetch the component catalog to know what's currently available:
67
+ ```
68
+ WebFetch: https://trdr.mrocontent.com.br/componentes
69
+ ```
70
+
71
+ From the page, note which components are marked as "Implementado" (they have code blocks ready to use).
72
+
73
+ ### Step 5 — Present the Migration Plan and STOP
74
+
75
+ Output the following report and **do not proceed** until the developer explicitly approves:
76
+
77
+ ```markdown
78
+ ## TRDR Design System — Migration Plan
79
+
80
+ ### Project: [framework] | [language] | [styling approach]
81
+ ### Hub: https://trdr.mrocontent.com.br
82
+
83
+ ---
84
+
85
+ ### Conformance score: [X]% compliant
86
+ (Percentage of style files with zero hardcoded violations)
87
+
88
+ ---
89
+
90
+ ### FILES TO CREATE:
91
+ - [ ] `[detected-styles-dir]/tokens.css` — 292 TRDR CSS custom properties (dark + light mode)
92
+ - [ ] `[detected-styles-dir]/components.css` — TRDR utility classes (.trdr-btn, .trdr-card, etc.)
93
+ - [ ] `CLAUDE.md` (project root) — design system rules for Claude Code
94
+
95
+ ### FILES TO MODIFY:
96
+ - [ ] `[global-css-file]` — add @import for tokens.css and components.css
97
+ [list each file with violations, e.g.:]
98
+ - [ ] `src/components/Button.css` — 3 violations (hardcoded colors: #3D99FF, #0E0E0E, #FFFFFF)
99
+ - [ ] `src/app/globals.css` — 2 violations (font-family: Inter)
100
+
101
+ ### VIOLATIONS FOUND:
102
+ | Category | Count | Example |
103
+ |----------|-------|---------|
104
+ | Hardcoded colors | N | `color: #3D99FF` in Button.css:14 |
105
+ | Hardcoded fonts | N | `font-family: Inter` in globals.css:8 |
106
+ | Hardcoded spacing | N | `padding: 16px` in Card.css:22 |
107
+ | Primitive token use | N | `var(--color-blue-600)` in Badge.css:31 |
108
+
109
+ ### TRDR COMPONENTS AVAILABLE (from Hub):
110
+ [List implemented components from the Hub catalog — these have ready-to-use code]
111
+ e.g.: Button, TextInput, Switch, Dropdown, Checkbox, RadioButton, ComboInput, Tooltip
112
+
113
+ ### SCOPE ESTIMATE: [Small / Medium / Large]
114
+ Small = <10 violations | Medium = 10–50 | Large = 50+
115
+
116
+ ### WHAT WILL NOT BE TOUCHED:
117
+ - Images, SVGs, fonts files
118
+ - node_modules/, .next/, dist/, build/, out/
119
+ - Third-party library files
120
+ - Any file you explicitly exclude
121
+
122
+ ---
123
+
124
+ **Reply with one of:**
125
+ - `"Apply"` or `"Executar"` — proceed with everything above
126
+ - `"Apply, skip [file or directory]"` — proceed but exclude specific paths
127
+ - `"Only tokens"` — only create tokens.css, components.css, and CLAUDE.md (no violation fixes)
128
+ - `"Change [detail]"` — adjust a specific part of the plan before executing
129
+ ```
130
+
131
+ **STOP HERE. Wait for explicit developer approval before Phase 2.**
132
+
133
+ ---
134
+
135
+ ## PHASE 2: EXECUTION (only after explicit approval)
136
+
137
+ Execute in order. Report progress after each major step.
138
+
139
+ ### Step 1 — Create tokens.css
140
+
141
+ Create `tokens.css` in the detected styles directory with this content:
142
+
143
+ ```css
144
+ /* ==========================================================================
145
+ TRDR Design System — CSS Variables
146
+ Source: designtokens.md v1.4 | https://trdr.mrocontent.com.br
147
+ DO NOT edit manually — update via the TRDR Design Hub
148
+ ========================================================================== */
149
+
150
+ :root {
151
+
152
+ /* =========================================================================
153
+ PRIMITIVES — COLORS (never use directly in UI — use semantic tokens)
154
+ ========================================================================= */
155
+
156
+ /* Blue */
157
+ --color-blue-50: #F0F7FF;
158
+ --color-blue-100: #E0EEFF;
159
+ --color-blue-200: #C1DDFF;
160
+ --color-blue-300: #A2CDFF;
161
+ --color-blue-400: #84BFFF;
162
+ --color-blue-500: #65B0FF;
163
+ --color-blue-600: #3D99FF;
164
+ --color-blue-700: #1E82FF;
165
+ --color-blue-800: #0066FF;
166
+ --color-blue-900: #0052CC;
167
+ --color-blue-alpha-08: #0052CC14;
168
+ --color-blue-alpha-16: #0052CC29;
169
+ --color-blue-alpha-32: #0052CC52;
170
+
171
+ /* Neutral */
172
+ --color-neutral-0: #FFFFFF;
173
+ --color-neutral-50: #FAFAFA;
174
+ --color-neutral-100: #EEEEEE;
175
+ --color-neutral-200: #E8E8E8;
176
+ --color-neutral-300: #D2D2D2;
177
+ --color-neutral-400: #BCBCBC;
178
+ --color-neutral-500: #A4A4A4;
179
+ --color-neutral-600: #777777;
180
+ --color-neutral-700: #4A4A4A;
181
+ --color-neutral-800: #222222;
182
+ --color-neutral-900: #1A1A1A;
183
+ --color-neutral-1000: #141519;
184
+ --color-neutral-1200: #0E0E0E;
185
+
186
+ /* Green */
187
+ --color-green-50: #F0FFF7;
188
+ --color-green-100: #CCFFDF;
189
+ --color-green-200: #99FFBF;
190
+ --color-green-300: #66FFA0;
191
+ --color-green-400: #33FF80;
192
+ --color-green-500: #00FF60;
193
+ --color-green-600: #31DD7E;
194
+ --color-green-700: #00CC4D;
195
+ --color-green-800: #009933;
196
+ --color-green-900: #00661F;
197
+ --color-green-alpha-08: #4FE29014;
198
+ --color-green-alpha-12: #4FE2901F;
199
+ --color-green-alpha-16: #4FE29029;
200
+ --color-green-alpha-32: #4FE29052;
201
+ --color-green-alpha-40: #4FE29066;
202
+ --color-green-alpha-48: #4FE2907A;
203
+ --color-green-alpha-56: #4FE2908F;
204
+
205
+ /* Red */
206
+ --color-red-50: #FFF0F0;
207
+ --color-red-100: #FFCCCC;
208
+ --color-red-200: #FF9999;
209
+ --color-red-300: #FF6666;
210
+ --color-red-400: #FF3333;
211
+ --color-red-500: #FF0000;
212
+ --color-red-600: #F34F45;
213
+ --color-red-700: #CC0000;
214
+ --color-red-800: #990000;
215
+ --color-red-900: #660000;
216
+ --color-red-alpha-08: #F34F4514;
217
+ --color-red-alpha-12: #F34F451F;
218
+ --color-red-alpha-16: #F34F4529;
219
+ --color-red-alpha-32: #F34F4552;
220
+ --color-red-alpha-40: #F34F4566;
221
+ --color-red-alpha-48: #F34F457A;
222
+ --color-red-alpha-56: #F34F458F;
223
+
224
+ /* Yellow */
225
+ --color-yellow-50: #FFFBF0;
226
+ --color-yellow-100: #FFF3CC;
227
+ --color-yellow-200: #FFE799;
228
+ --color-yellow-300: #FFDB66;
229
+ --color-yellow-400: #FFCF33;
230
+ --color-yellow-500: #FFCC40;
231
+ --color-yellow-600: #FFB800;
232
+ --color-yellow-700: #CC9200;
233
+ --color-yellow-800: #996D00;
234
+ --color-yellow-900: #664900;
235
+ --color-yellow-alpha-08: #FFCC4014;
236
+ --color-yellow-alpha-16: #FFCC4029;
237
+ --color-yellow-alpha-32: #FFCC4052;
238
+
239
+ /* Orange */
240
+ --color-orange-50: #FFF5F0;
241
+ --color-orange-100: #FFE0CC;
242
+ --color-orange-200: #FFC199;
243
+ --color-orange-300: #FFA266;
244
+ --color-orange-400: #FF8333;
245
+ --color-orange-500: #FF6400;
246
+ --color-orange-600: #F57C00;
247
+ --color-orange-700: #CC5000;
248
+ --color-orange-800: #993C00;
249
+ --color-orange-900: #662800;
250
+ --color-orange-alpha-08: #FF640014;
251
+ --color-orange-alpha-16: #FF640029;
252
+ --color-orange-alpha-32: #FF640052;
253
+
254
+ /* Purple */
255
+ --color-purple-50: #F5F0FF;
256
+ --color-purple-100: #E0CCFF;
257
+ --color-purple-200: #C199FF;
258
+ --color-purple-300: #A266FF;
259
+ --color-purple-400: #8333FF;
260
+ --color-purple-500: #7C4DFF;
261
+ --color-purple-600: #6200EA;
262
+ --color-purple-700: #5000CC;
263
+ --color-purple-800: #3C0099;
264
+ --color-purple-900: #280066;
265
+ --color-purple-alpha-08: #7C4DFF14;
266
+ --color-purple-alpha-16: #7C4DFF29;
267
+ --color-purple-alpha-32: #7C4DFF52;
268
+
269
+ /* =========================================================================
270
+ PRIMITIVES — SPACING
271
+ ========================================================================= */
272
+ --space-0: 0px;
273
+ --space-50: 4px;
274
+ --space-100: 8px;
275
+ --space-200: 12px;
276
+ --space-300: 16px;
277
+ --space-400: 20px;
278
+ --space-500: 24px;
279
+ --space-600: 32px;
280
+ --space-700: 40px;
281
+ --space-800: 48px;
282
+ --space-900: 56px;
283
+ --space-1000: 64px;
284
+ --space-1200: 80px;
285
+ --space-1400: 96px;
286
+
287
+ /* =========================================================================
288
+ PRIMITIVES — BORDER RADIUS
289
+ ========================================================================= */
290
+ --radius-prim-0: 0px;
291
+ --radius-prim-50: 2px;
292
+ --radius-prim-100: 4px;
293
+ --radius-prim-200: 8px;
294
+ --radius-prim-300: 12px;
295
+ --radius-prim-400: 16px;
296
+ --radius-prim-500: 20px;
297
+ --radius-prim-600: 24px;
298
+ --radius-prim-700: 32px;
299
+ --radius-prim-full: 9999px;
300
+
301
+ /* =========================================================================
302
+ PRIMITIVES — TYPOGRAPHY
303
+ ========================================================================= */
304
+ --font-size-50: 12px;
305
+ --font-size-100: 14px;
306
+ --font-size-200: 16px;
307
+ --font-size-300: 18px;
308
+ --font-size-400: 20px;
309
+ --font-size-500: 24px;
310
+ --font-size-600: 28px;
311
+ --font-size-700: 32px;
312
+ --font-size-800: 40px;
313
+
314
+ /* =========================================================================
315
+ PRIMITIVES — OPACITY
316
+ ========================================================================= */
317
+ --opacity-0: 0;
318
+ --opacity-08: 0.08;
319
+ --opacity-16: 0.16;
320
+ --opacity-32: 0.32;
321
+ --opacity-48: 0.48;
322
+ --opacity-64: 0.64;
323
+ --opacity-80: 0.80;
324
+ --opacity-100: 1;
325
+
326
+ /* =========================================================================
327
+ SEMANTIC — BACKGROUNDS (dark default)
328
+ ========================================================================= */
329
+ --bg-primary: #0E0E0E;
330
+ --bg-secondary: #141519;
331
+ --bg-tertiary: #1A1A1A;
332
+ --bg-inverse: #FFFFFF;
333
+ --bg-overlay: #FFFFFF29;
334
+ --bg-brand: #3D99FF;
335
+ --bg-warning: #FFCC40;
336
+ --bg-danger: #F34F45;
337
+ --bg-success: #31DD7E;
338
+ --bg-base-alpha-0: rgba(14, 14, 14, 0);
339
+
340
+ /* =========================================================================
341
+ SEMANTIC — SURFACES
342
+ ========================================================================= */
343
+ --surface-primary: #4A4A4A;
344
+ --surface-secondary: #222222;
345
+ --surface-tertiary: #1A1A1A;
346
+ --surface-interactive: #0052CC;
347
+ --surface-disabled: #1A1A1A;
348
+ --surface-info: rgba(61, 153, 255, 0.08);
349
+ --surface-error: rgba(243, 79, 69, 0.08);
350
+ --surface-warning: rgba(255, 204, 64, 0.08);
351
+ --surface-success: rgba(79, 226, 144, 0.08);
352
+ --surface-brand: rgba(0, 82, 204, 0.16);
353
+
354
+ /* =========================================================================
355
+ SEMANTIC — CONTENT (TEXT)
356
+ ========================================================================= */
357
+ --content-primary: #FFFFFF;
358
+ --content-secondary: #E8E8E8;
359
+ --content-tertiary: #A4A4A4;
360
+ --content-disabled: #4A4A4A;
361
+ --content-inverse: #1A1A1A;
362
+ --content-info: #65B0FF;
363
+ --content-warning: #FFCC40;
364
+ --content-error: #F34F45;
365
+ --content-success: #4FE290;
366
+ --content-brand: #3D99FF;
367
+ --content-on-brand: #FFFFFF;
368
+
369
+ /* =========================================================================
370
+ SEMANTIC — BORDERS
371
+ ========================================================================= */
372
+ --border-default: #4A4A4A;
373
+ --border-subtle: #222222;
374
+ --border-strong: #A4A4A4;
375
+ --border-focus: #65B0FF;
376
+ --border-disabled: #777777;
377
+
378
+ /* =========================================================================
379
+ SEMANTIC — ACTIONS
380
+ ========================================================================= */
381
+
382
+ /* Brand (Blue — primary) */
383
+ --action-brand-default: #3D99FF;
384
+ --action-brand-hover: #1E82FF;
385
+ --action-brand-active: #0066FF;
386
+ --action-brand-disabled: #0052CC29;
387
+ --action-brand-alpha: rgba(61, 153, 255, 0.16);
388
+
389
+ /* Brand Inverse (solid blue primary button) */
390
+ --action-brand-inverse-default: #0066FF;
391
+ --action-brand-inverse-hover: #1E82FF;
392
+ --action-brand-inverse-active: #0052CC;
393
+
394
+ /* Secondary (Neutral) */
395
+ --action-secondary-default: #4A4A4A;
396
+ --action-secondary-hover: #777777;
397
+ --action-secondary-active: #A4A4A4;
398
+ --action-secondary-disabled: #1A1A1A;
399
+ --action-secondary-alpha: rgba(74, 74, 74, 0.16);
400
+
401
+ /* Tertiary (Purple) */
402
+ --action-tertiary-default: #7C4DFF;
403
+ --action-tertiary-hover: #6200EA;
404
+ --action-tertiary-active: #5000CC;
405
+ --action-tertiary-disabled: #7C4DFF29;
406
+
407
+ /* Destructive (Orange) */
408
+ --action-destructive-default: #F57C00;
409
+ --action-destructive-hover: #FF6400;
410
+ --action-destructive-active: #CC5000;
411
+ --action-destructive-disabled: #FF640014;
412
+
413
+ /* =========================================================================
414
+ SEMANTIC — TRADING CONTEXT
415
+ ========================================================================= */
416
+
417
+ /* Candlesticks */
418
+ --context-chart-up: #31DD7E;
419
+ --context-chart-down: #F34F45;
420
+
421
+ /* Price */
422
+ --context-trading-up: #4FE290;
423
+ --context-trading-down: #F34F45;
424
+
425
+ /* Long (Buy) */
426
+ --context-trading-long-text: #4FE290;
427
+ --context-trading-long-default: rgba(79, 226, 144, 0.08);
428
+ --context-trading-long-hover: rgba(79, 226, 144, 0.12);
429
+ --context-trading-long-active: rgba(79, 226, 144, 0.16);
430
+
431
+ /* Short (Sell) */
432
+ --context-trading-short-text: #F34F45;
433
+ --context-trading-short-default: rgba(243, 79, 69, 0.08);
434
+ --context-trading-short-hover: rgba(243, 79, 69, 0.12);
435
+ --context-trading-short-active: rgba(243, 79, 69, 0.16);
436
+
437
+ /* Stop Loss */
438
+ --context-trading-stop-default: rgba(255, 100, 0, 0.16);
439
+ --context-trading-stop-hover: rgba(255, 100, 0, 0.24);
440
+ --context-trading-stop-active: rgba(255, 100, 0, 0.32);
441
+ --context-trading-stop-alpha: rgba(255, 100, 0, 0.08);
442
+
443
+ /* =========================================================================
444
+ SCALE — RESPONSIVE SPACING (Desktop default)
445
+ ========================================================================= */
446
+ --spacing-xs: 4px;
447
+ --spacing-sm: 8px;
448
+ --spacing-md: 12px;
449
+ --spacing-lg: 16px;
450
+ --spacing-xl: 20px;
451
+ --spacing-2xl: 24px;
452
+ --spacing-3xl: 32px;
453
+ --spacing-3xl-2: 40px;
454
+ --spacing-3xl-3: 48px;
455
+ --spacing-3xl-4: 56px;
456
+ --spacing-3xl-5: 64px;
457
+ --spacing-3xl-6: 80px;
458
+ --spacing-3xl-7: 96px;
459
+
460
+ /* =========================================================================
461
+ SCALE — BORDER RADIUS
462
+ ========================================================================= */
463
+ --radius-none: 0px;
464
+ --radius-xs: 2px;
465
+ --radius-sm: 4px;
466
+ --radius-md: 8px;
467
+ --radius-lg: 16px;
468
+ --radius-xl: 20px;
469
+ --radius-full: 9999px;
470
+
471
+ /* =========================================================================
472
+ FONTS (use Google Fonts or next/font to load these)
473
+ Space Grotesk → headings | Inter → body/labels | Roboto Mono → numbers
474
+ ========================================================================= */
475
+ --font-primary: 'Space Grotesk', sans-serif;
476
+ --font-secondary: 'Inter', sans-serif;
477
+ --font-mono: 'Roboto Mono', monospace;
478
+
479
+ /* =========================================================================
480
+ BRAND GRADIENTS (Site/Marketing)
481
+ ========================================================================= */
482
+ --gradient-text-brand: linear-gradient(90deg, #3D99FF 0%, #FFFFFF 100%);
483
+ --gradient-text-brand-hero: linear-gradient(90deg, #3D99FF 30%, #FFFFFF 100%);
484
+ --gradient-bg-hero: linear-gradient(180deg, #0052CC 0%, #0E0E0E 40%);
485
+ --gradient-bg-fade: linear-gradient(180deg, rgba(14,14,14,0) 0%, #0E0E0E 47%);
486
+ }
487
+
488
+ /* ==========================================================================
489
+ LIGHT MODE — apply [data-theme="light"] to <html> or <body>
490
+ ========================================================================== */
491
+ [data-theme="light"] {
492
+ --bg-primary: #EEEEEE;
493
+ --bg-secondary: #F5F5F5;
494
+ --bg-tertiary: #FAFAFA;
495
+ --bg-inverse: #1A1A1A;
496
+ --bg-overlay: #00000029;
497
+ --surface-primary: #D2D2D2;
498
+ --surface-secondary: #E8E8E8;
499
+ --surface-tertiary: #EEEEEE;
500
+ --surface-interactive: #84BFFF;
501
+ --surface-disabled: #FAFAFA;
502
+ --content-primary: #1A1A1A;
503
+ --content-secondary: #222222;
504
+ --content-tertiary: #4A4A4A;
505
+ --content-disabled: #777777;
506
+ --content-inverse: #FFFFFF;
507
+ --content-brand: #0066FF;
508
+ --border-default: #A4A4A4;
509
+ --border-subtle: #E8E8E8;
510
+ --border-strong: #D2D2D2;
511
+ --border-disabled: #E8E8E8;
512
+ --action-brand-default: #0066FF;
513
+ --action-brand-hover: #1E82FF;
514
+ --action-brand-active: #3D99FF;
515
+ }
516
+ ```
517
+
518
+ ### Step 2 — Create components.css
519
+
520
+ Create `components.css` in the same directory as tokens.css. Fetch the latest version from the Hub:
521
+
522
+ ```
523
+ WebFetch: https://trdr.mrocontent.com.br/design-md
524
+ ```
525
+
526
+ Extract the component utility classes section (`.trdr-*` classes). This fetch always gets the most up-to-date classes, including any new components added to the Hub since the last skill update.
527
+
528
+ If the Hub is unreachable, use this baseline (contains all components as of skill version 1.0):
529
+
530
+ ```css
531
+ /* ==========================================================================
532
+ TRDR Design Hub — Component utility classes
533
+ Always fetch latest from: https://trdr.mrocontent.com.br
534
+ ========================================================================== */
535
+
536
+ /* Card */
537
+ .trdr-card {
538
+ background-color: var(--bg-secondary);
539
+ border: 1px solid var(--border-subtle);
540
+ border-radius: var(--radius-md);
541
+ padding: var(--spacing-2xl);
542
+ }
543
+ .trdr-card-hover {
544
+ background-color: var(--bg-secondary);
545
+ border: 1px solid var(--border-subtle);
546
+ border-radius: var(--radius-md);
547
+ padding: var(--spacing-2xl);
548
+ transition: border-color 0.15s ease, background-color 0.15s ease;
549
+ }
550
+ .trdr-card-hover:hover {
551
+ border-color: var(--border-default);
552
+ background-color: var(--bg-tertiary);
553
+ }
554
+
555
+ /* Gradient text */
556
+ .trdr-gradient-text {
557
+ background: linear-gradient(90deg, var(--action-brand-default) 30%, #FFFFFF 100%);
558
+ -webkit-background-clip: text;
559
+ -webkit-text-fill-color: transparent;
560
+ background-clip: text;
561
+ }
562
+
563
+ /* Buttons */
564
+ .trdr-btn {
565
+ display: inline-flex;
566
+ align-items: center;
567
+ justify-content: center;
568
+ gap: var(--spacing-xs);
569
+ height: 24px;
570
+ padding: 0 var(--spacing-sm);
571
+ border-radius: var(--radius-md);
572
+ font-family: var(--font-secondary);
573
+ font-size: 14px;
574
+ font-weight: 600;
575
+ line-height: 1;
576
+ white-space: nowrap;
577
+ transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
578
+ cursor: pointer;
579
+ border: none;
580
+ text-decoration: none;
581
+ }
582
+ .trdr-btn-lg { height: 32px; padding: 0 var(--spacing-md); font-size: 14px; }
583
+
584
+ .trdr-btn-primary { background-color: var(--action-brand-inverse-default); color: var(--content-primary); border: 0.5px solid var(--action-brand-inverse-default); }
585
+ .trdr-btn-primary:hover { background-color: var(--action-brand-inverse-hover); border-color: var(--action-brand-inverse-hover); }
586
+ .trdr-btn-primary:active { background-color: var(--action-brand-inverse-active); }
587
+ .trdr-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
588
+
589
+ .trdr-btn-secondary { background-color: var(--action-secondary-default); color: var(--content-primary); }
590
+ .trdr-btn-secondary:hover { background-color: var(--action-secondary-hover); }
591
+ .trdr-btn-secondary:active { background-color: var(--action-secondary-active); }
592
+ .trdr-btn-secondary:disabled { background-color: var(--action-secondary-disabled); color: var(--content-disabled); cursor: not-allowed; }
593
+
594
+ .trdr-btn-ghost { background-color: transparent; color: var(--content-secondary); border: 1px solid var(--border-default); }
595
+ .trdr-btn-ghost:hover { background-color: var(--surface-secondary); border-color: var(--border-strong); color: var(--content-primary); }
596
+ .trdr-btn-ghost:active { background-color: var(--surface-primary); }
597
+ .trdr-btn-ghost:disabled { color: var(--content-disabled); border-color: var(--border-disabled); cursor: not-allowed; opacity: 0.5; }
598
+
599
+ .trdr-btn-destructive { background-color: var(--action-destructive-default); color: var(--content-primary); }
600
+ .trdr-btn-destructive:hover { background-color: var(--action-destructive-hover); }
601
+ .trdr-btn-destructive:active { background-color: var(--action-destructive-active); }
602
+
603
+ .trdr-btn-link { background-color: transparent; color: var(--content-brand); padding-left: 0; padding-right: 0; }
604
+ .trdr-btn-link:hover { color: var(--action-brand-hover); text-decoration: underline; }
605
+
606
+ .trdr-btn-long { background-color: var(--context-trading-long-default); color: var(--context-trading-long-text); min-width: 80px; }
607
+ .trdr-btn-long:hover { background-color: var(--context-trading-long-hover); }
608
+ .trdr-btn-long:active { background-color: var(--context-trading-long-active); }
609
+
610
+ .trdr-btn-short { background-color: var(--context-trading-short-default); color: var(--context-trading-short-text); min-width: 80px; }
611
+ .trdr-btn-short:hover { background-color: var(--context-trading-short-hover); }
612
+ .trdr-btn-short:active { background-color: var(--context-trading-short-active); }
613
+
614
+ /* Badge */
615
+ .trdr-badge { display: inline-flex; align-items: center; height: 16px; padding: 0 4px; border-radius: 5px; font-family: var(--font-secondary); font-size: 12px; font-weight: 500; white-space: nowrap; }
616
+ .trdr-badge-brand { background-color: var(--surface-brand); color: var(--content-brand); border: 1px solid var(--border-subtle); }
617
+ .trdr-badge-success { background-color: var(--surface-success); color: var(--content-success); border: 1px solid var(--border-subtle); }
618
+ .trdr-badge-neutral { background-color: var(--surface-secondary); color: var(--content-tertiary); border: 1px solid var(--border-subtle); }
619
+ .trdr-badge-warning { background-color: var(--surface-warning); color: var(--content-warning); }
620
+
621
+ /* Segmented control */
622
+ .trdr-segment-control { display: inline-flex; align-items: center; gap: var(--spacing-sm); flex-wrap: wrap; }
623
+ .trdr-segment { display: inline-flex; align-items: center; justify-content: center; padding: var(--spacing-sm) var(--spacing-md); border-radius: var(--spacing-lg); font-family: var(--font-secondary); font-size: 14px; cursor: pointer; text-decoration: none; transition: background-color 0.15s ease, color 0.15s ease; }
624
+ .trdr-segment-active { background-color: var(--action-brand-inverse-default); color: var(--content-primary); }
625
+ .trdr-segment-inactive { background-color: var(--surface-secondary); color: var(--content-tertiary); }
626
+ .trdr-segment-inactive:hover { color: var(--content-secondary); }
627
+
628
+ /* Input */
629
+ .trdr-input { width: 100%; height: 36px; padding: 0 var(--spacing-md); background-color: var(--bg-tertiary); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); color: var(--content-primary); font-family: var(--font-secondary); font-size: 13px; outline: none; transition: border-color 0.15s ease; }
630
+ .trdr-input::placeholder { color: var(--content-tertiary); }
631
+ .trdr-input:focus { border-color: var(--border-focus); }
632
+
633
+ /* Table */
634
+ .trdr-table { width: 100%; border-collapse: collapse; }
635
+ .trdr-table th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--content-tertiary); padding: var(--spacing-sm) var(--spacing-lg); border-bottom: 1px solid var(--border-subtle); }
636
+ .trdr-table td { padding: var(--spacing-md) var(--spacing-lg); border-bottom: 1px solid var(--border-subtle); font-size: 13px; color: var(--content-secondary); vertical-align: middle; }
637
+ .trdr-table tr:last-child td { border-bottom: none; }
638
+ .trdr-table tr:hover td { background-color: var(--bg-tertiary); }
639
+
640
+ /* Divider */
641
+ .trdr-divider { width: 100%; height: 1px; background-color: var(--border-subtle); margin: var(--spacing-2xl) 0; }
642
+
643
+ /* Section headings */
644
+ .trdr-section-title { font-family: var(--font-primary); font-size: 24px; font-weight: 500; color: var(--content-primary); margin-bottom: var(--spacing-sm); }
645
+ .trdr-section-subtitle { font-size: 14px; color: var(--content-tertiary); margin-bottom: var(--spacing-3xl); line-height: 1.5; }
646
+ ```
647
+
648
+ > **Note for new components:** As new components are added to the Hub, their CSS classes will appear in the Hub's designtokens.md and component pages. Always fetch from the Hub when you need a component that isn't in this baseline.
649
+
650
+ ### Step 3 — Update global CSS
651
+
652
+ Find the main global CSS file (globals.css, main.css, index.css, app.css) and add at the very top:
653
+
654
+ ```css
655
+ @import './tokens.css';
656
+ @import './components.css';
657
+ ```
658
+
659
+ Adjust the relative path if tokens.css is in a subdirectory.
660
+
661
+ If the project already imports a different design system's variables and there are naming conflicts, warn the developer before proceeding.
662
+
663
+ ### Step 4 — Create CLAUDE.md
664
+
665
+ Create `CLAUDE.md` at the project root:
666
+
667
+ ```markdown
668
+ # [Project Name] — Context for Claude Code
669
+
670
+ ## Design System
671
+ This project uses the TRDR Design System.
672
+ Full reference: https://trdr.mrocontent.com.br
673
+
674
+ ## Absolute Rules (never break these)
675
+ 1. NEVER use primitive tokens directly (--color-*, --space-*) — always use semantic tokens
676
+ 2. Backgrounds: --bg-primary (#0E0E0E), --bg-secondary (#141519), --bg-tertiary (#1A1A1A)
677
+ 3. Text: --content-primary (white), --content-secondary (#E8E8E8), --content-tertiary (#A4A4A4)
678
+ 4. Primary CTA: --action-brand-inverse-default (#0066FF) for filled buttons
679
+ 5. Fonts: --font-primary = Space Grotesk (headings) | --font-secondary = Inter (body) | --font-mono = Roboto Mono (numbers)
680
+ 6. Spacing: always var(--spacing-xs/sm/md/lg/xl/2xl/3xl) — never hardcoded px
681
+ 7. Border radius: always var(--radius-sm/md/lg/full) — never hardcoded px
682
+
683
+ ## Token files
684
+ - Tokens: [detected-path]/tokens.css
685
+ - Components: [detected-path]/components.css
686
+
687
+ ## Quick reference — most used tokens
688
+ | Token | CSS Variable | Value |
689
+ |-------|-------------|-------|
690
+ | Background | --bg-primary | #0E0E0E |
691
+ | Surface | --surface-secondary | #222222 |
692
+ | Text primary | --content-primary | #FFFFFF |
693
+ | Text secondary | --content-tertiary | #A4A4A4 |
694
+ | Primary button | --action-brand-inverse-default | #0066FF |
695
+ | Border | --border-default | #4A4A4A |
696
+ | Focus ring | --border-focus | #65B0FF |
697
+ | Success | --content-success | #4FE290 |
698
+ | Error | --content-error | #F34F45 |
699
+ | Warning | --content-warning | #FFCC40 |
700
+
701
+ ## Pre-built component classes
702
+ .trdr-btn, .trdr-btn-primary, .trdr-btn-secondary, .trdr-btn-ghost, .trdr-btn-destructive
703
+ .trdr-btn-long (buy), .trdr-btn-short (sell)
704
+ .trdr-badge, .trdr-badge-brand, .trdr-badge-success, .trdr-badge-neutral
705
+ .trdr-card, .trdr-card-hover
706
+ .trdr-input
707
+ .trdr-table
708
+ .trdr-segment-control, .trdr-segment-active, .trdr-segment-inactive
709
+
710
+ ## Getting component code
711
+ For any component, go to: https://trdr.mrocontent.com.br/componentes/[slug]
712
+ Available: button, text-input, switch, dropdown, checkbox, radio-button, combo-input, tooltip, boleta
713
+ (Check Hub for latest — new components are added regularly)
714
+
715
+ ## Layer hierarchy
716
+ bg.primary (base) → bg.secondary/tertiary (content areas) → surface.* (cards, panels)
717
+ → interactive components → overlays/modals/tooltips
718
+ ```
719
+
720
+ Replace `[Project Name]` with the actual project name detected from package.json.
721
+ Replace `[detected-path]` with the actual relative path to tokens.css.
722
+
723
+ ### Step 5 — Migrate violations
724
+
725
+ For each violation found in Phase 1, apply the semantic token replacement.
726
+
727
+ **Color mapping (hardcoded → semantic):**
728
+ | Hardcoded value | Context | Replace with |
729
+ |----------------|---------|-------------|
730
+ | `#0E0E0E` | background | `var(--bg-primary)` |
731
+ | `#141519` | background | `var(--bg-secondary)` |
732
+ | `#1A1A1A` | background/surface | `var(--bg-tertiary)` or `var(--surface-tertiary)` |
733
+ | `#222222` | surface/border | `var(--surface-secondary)` or `var(--border-subtle)` |
734
+ | `#4A4A4A` | surface/border | `var(--surface-primary)` or `var(--border-default)` |
735
+ | `#FFFFFF` | text/bg | `var(--content-primary)` or `var(--bg-inverse)` |
736
+ | `#E8E8E8` | text | `var(--content-secondary)` |
737
+ | `#A4A4A4` | text | `var(--content-tertiary)` |
738
+ | `#3D99FF` | action/text | `var(--action-brand-default)` or `var(--content-brand)` |
739
+ | `#0066FF` | button bg | `var(--action-brand-inverse-default)` |
740
+ | `#F34F45` | error/trading | `var(--content-error)` or `var(--context-trading-down)` |
741
+ | `#4FE290` | success/trading | `var(--content-success)` or `var(--context-trading-up)` |
742
+ | `#FFCC40` | warning | `var(--content-warning)` |
743
+ | `#65B0FF` | focus/info | `var(--border-focus)` or `var(--content-info)` |
744
+ | `#F57C00` | destructive | `var(--action-destructive-default)` |
745
+
746
+ **Font mapping:**
747
+ | Hardcoded | Replace with |
748
+ |-----------|-------------|
749
+ | `font-family: 'Inter'` | `font-family: var(--font-secondary)` |
750
+ | `font-family: 'Space Grotesk'` | `font-family: var(--font-primary)` |
751
+ | `font-family: 'Roboto Mono'` | `font-family: var(--font-mono)` |
752
+
753
+ **Spacing mapping:**
754
+ | Hardcoded | Replace with |
755
+ |-----------|-------------|
756
+ | `4px` | `var(--spacing-xs)` |
757
+ | `8px` | `var(--spacing-sm)` |
758
+ | `12px` | `var(--spacing-md)` |
759
+ | `16px` | `var(--spacing-lg)` |
760
+ | `20px` | `var(--spacing-xl)` |
761
+ | `24px` | `var(--spacing-2xl)` |
762
+ | `32px` | `var(--spacing-3xl)` |
763
+
764
+ **Ambiguous colors:** Use property context to decide — `background-color` → bg/surface token, `color` → content token, `border-color` → border token.
765
+
766
+ **Do NOT replace:**
767
+ - Hex values inside SVG paths or image files
768
+ - Values in third-party library overrides where the semantic token would break the library layout
769
+ - Values in commented-out code
770
+
771
+ ### Step 6 — Fetch component-specific code (if applicable)
772
+
773
+ If the developer's project has components that match TRDR component patterns (buttons, inputs, dropdowns, etc.), offer to fetch the exact code from the Hub:
774
+
775
+ ```
776
+ WebFetch: https://trdr.mrocontent.com.br/componentes/[slug]
777
+ ```
778
+
779
+ Replace `[slug]` with: `button`, `text-input`, `switch`, `dropdown`, `checkbox`, `radio-button`, `combo-input`, `tooltip`, `boleta`, or any other component visible in the Hub catalog.
780
+
781
+ This fetch always returns the latest code, including any updates made since this skill was last installed.
782
+
783
+ ### Step 7 — Generate DS_MIGRATION.md
784
+
785
+ Create `DS_MIGRATION.md` at the project root:
786
+
787
+ ```markdown
788
+ # TRDR Design System — Migration Log
789
+ Applied: [date]
790
+ Skill version: trdr-ds v1.0 | Hub: https://trdr.mrocontent.com.br
791
+
792
+ ## What was applied
793
+ - ✅ [path]/tokens.css — 292 CSS custom properties
794
+ - ✅ [path]/components.css — TRDR utility classes
795
+ - ✅ CLAUDE.md — design system rules for Claude Code
796
+ - ✅ [N] violations fixed in [M] files
797
+ - ✅ [global-css] updated with @import
798
+
799
+ ## Files modified
800
+ [List each file and what changed]
801
+
802
+ ## Violations fixed
803
+ [List by category with file:line references]
804
+
805
+ ## Manual steps required
806
+ Check these before shipping:
807
+
808
+ - [ ] **Fonts**: Ensure Space Grotesk, Inter, and Roboto Mono are loaded
809
+ - Next.js: use `next/font/google` in layout.tsx
810
+ - Others: add Google Fonts `<link>` in HTML head
811
+
812
+ - [ ] **Dark/light mode**: tokens.css uses [data-theme="light"] for overrides
813
+ Add `data-theme="light"` to `<html>` or `<body>` to activate light mode
814
+
815
+ - [ ] **Trading UI**: If this project has price/position displays, verify
816
+ context.trading.* tokens are applied (see Hub: /tokens/semanticos)
817
+
818
+ - [ ] **Skipped files**: [list any files excluded from migration]
819
+ These still have hardcoded values — migrate manually or run /trdr-ds again
820
+
821
+ ## Design System Reference
822
+ - Hub: https://trdr.mrocontent.com.br
823
+ - Tokens: https://trdr.mrocontent.com.br/tokens/semanticos
824
+ - Components: https://trdr.mrocontent.com.br/componentes
825
+ - Rules: https://trdr.mrocontent.com.br/para-ia
826
+ - Full spec: https://trdr.mrocontent.com.br/design-md
827
+ ```
828
+
829
+ ---
830
+
831
+ ## EXECUTION SUMMARY
832
+
833
+ After all steps are complete, output:
834
+
835
+ ```
836
+ ✅ TRDR Design System applied
837
+
838
+ Created:
839
+ • [path]/tokens.css (292 CSS variables — dark + light mode)
840
+ • [path]/components.css (TRDR component utility classes)
841
+ • CLAUDE.md (design system context for Claude Code)
842
+ • DS_MIGRATION.md (migration log + manual checklist)
843
+
844
+ Modified:
845
+ • [global-css] — @import added
846
+ • [N] files — [X] violations replaced with semantic tokens
847
+
848
+ Hub: https://trdr.mrocontent.com.br
849
+ → Check DS_MIGRATION.md for manual steps
850
+ ```
851
+
852
+ ---
853
+
854
+ ## LIVE HUB REFERENCE
855
+
856
+ When the developer asks about a specific component, token, or rule, fetch from the Hub:
857
+
858
+ | Need | URL |
859
+ |------|-----|
860
+ | All tokens | https://trdr.mrocontent.com.br/tokens/semanticos |
861
+ | Specific component | https://trdr.mrocontent.com.br/componentes/[slug] |
862
+ | All components | https://trdr.mrocontent.com.br/componentes |
863
+ | Rules & CLAUDE.md template | https://trdr.mrocontent.com.br/para-ia |
864
+ | Full design spec | https://trdr.mrocontent.com.br/design-md |
865
+
866
+ The Hub is the single source of truth. When in doubt, fetch from there.
@@ -0,0 +1,73 @@
1
+ # TRDR Design System — 7 Regras Absolutas
2
+
3
+ ## Regras que nunca devem ser violadas
4
+
5
+ ### Regra 1 — Nunca use primitivos diretamente na UI
6
+ Use tokens semânticos, nunca primitivos.
7
+ - ❌ `background: #3D99FF` ou `background: var(--color-blue-600)`
8
+ - ✅ `background: var(--action-brand-default)`
9
+
10
+ ### Regra 2 — Nunca use color.* ou space.* em componentes finais
11
+ Use os equivalentes semânticos: bg.*, surface.*, content.*, scale.spacing.*
12
+ - ❌ `color: var(--color-neutral-500)`
13
+ - ✅ `color: var(--content-tertiary)`
14
+
15
+ ### Regra 3 — Números e dados financeiros → Roboto Mono
16
+ Tabelas de preços, P&L, quantidades, qualquer dado numérico de trading.
17
+ - `font-family: var(--font-mono)`
18
+
19
+ ### Regra 4 — Títulos de página e headings → Space Grotesk
20
+ Space Grotesk é a fonte primária da marca TRDR.
21
+ - `font-family: var(--font-primary)`
22
+
23
+ ### Regra 5 — Todo restante da UI → Inter
24
+ Body text, labels, inputs, nav, tooltips — tudo que não é heading ou número.
25
+ - `font-family: var(--font-secondary)`
26
+
27
+ ### Regra 6 — Espaçamentos → sempre scale.spacing.*
28
+ Os tokens de scale respeitam variações desktop/mobile automaticamente.
29
+ - ❌ `padding: 16px`
30
+ - ✅ `padding: var(--spacing-lg)`
31
+
32
+ ### Regra 7 — Border radius → sempre scale.radius.*
33
+ Sistema padronizado: sm=4px (inputs), md=8px (botões/cards), lg=16px (modais), full=9999px (pills/switches)
34
+ - ❌ `border-radius: 8px`
35
+ - ✅ `border-radius: var(--radius-md)`
36
+
37
+ ---
38
+
39
+ ## Hierarquia de camadas (z-index semântico)
40
+
41
+ ```
42
+ bg.primary (fundo base)
43
+ └── bg.secondary / bg.tertiary (áreas de conteúdo)
44
+ └── surface.primary / secondary / tertiary (cards, painéis)
45
+ └── componentes interativos (inputs, buttons)
46
+ └── overlays / modais / tooltips
47
+ ```
48
+
49
+ ---
50
+
51
+ ## Mapa de tokens por contexto de uso
52
+
53
+ ### Botões de ação
54
+ | Contexto | Token | Exemplo |
55
+ |---------|-------|---------|
56
+ | Primário (CTA) | action.brand-inverse.* | OPERAR, Salvar, Confirmar |
57
+ | Secundário | action.secondary.* | Cancelar, Voltar |
58
+ | Terciário | action.tertiary.* | Ações de anotação |
59
+ | Destrutivo | action.destructive.* | Fechar posição, Excluir |
60
+
61
+ ### Trading
62
+ | Contexto | Token |
63
+ |---------|-------|
64
+ | Preço em alta / Compra | context.trading.up / context.trading.long.* |
65
+ | Preço em baixa / Venda | context.trading.down / context.trading.short.* |
66
+ | Stop Loss | context.trading.stop.* |
67
+ | Candle verde | context.chart.candles.up |
68
+ | Candle vermelho | context.chart.candles.down |
69
+
70
+ ---
71
+
72
+ ## Hub de Referência
73
+ https://trdr.mrocontent.com.br/para-ia