trdr-ds-install 1.11.0 → 2.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/package.json +1 -1
- package/plugins/trdr-design-system/skills/trdr-ds/SKILL.md +165 -3228
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/abas.json +36 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/badge.json +139 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/boleta.json +121 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/button.json +166 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/card.json +55 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/checkbox.json +82 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/combo-input.json +79 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/copy-button.json +88 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/dropdown.json +94 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/floating-menu.json +151 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/header.json +141 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/janela.json +245 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/news-card.json +124 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/radio-button.json +97 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/search-input.json +69 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/segmented-control.json +60 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/sidebar.json +109 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/stat-card.json +90 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/sub-menu-item.json +45 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/switch.json +89 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/tabela-cotacoes.json +91 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/tabela-ordens.json +81 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/table.json +119 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/text-input.json +159 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/components/tooltip.json +88 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/index.json +262 -0
- package/plugins/trdr-design-system/skills/trdr-ds/data/mappings.json +183 -0
- package/plugins/trdr-design-system/skills/trdr-ds/modes/report.md +139 -0
- package/plugins/trdr-design-system/skills/trdr-ds/modes/resume.md +46 -0
- package/plugins/trdr-design-system/skills/trdr-ds/modes/rollback.md +55 -0
- package/plugins/trdr-design-system/skills/trdr-ds/modes/status.md +37 -0
- package/plugins/trdr-design-system/skills/trdr-ds/modes/sync.md +48 -0
- package/plugins/trdr-design-system/skills/trdr-ds/phases/analyze.md +305 -0
- package/plugins/trdr-design-system/skills/trdr-ds/phases/components.md +204 -0
- package/plugins/trdr-design-system/skills/trdr-ds/phases/final.md +209 -0
- package/plugins/trdr-design-system/skills/trdr-ds/phases/foundation.md +195 -0
- package/plugins/trdr-design-system/skills/trdr-ds/phases/violations.md +183 -0
- package/plugins/trdr-design-system/skills/trdr-ds/templates/claude-md.md +88 -0
- package/plugins/trdr-design-system/skills/trdr-ds/templates/ds-analysis.md +88 -0
- package/plugins/trdr-design-system/skills/trdr-ds/templates/ds-migration.md +59 -0
- package/plugins/trdr-design-system/skills/trdr-ds/templates/ds-progress.md +57 -0
- package/plugins/trdr-design-system/skills/trdr-ds/templates/sprint-plan.md +68 -0
|
@@ -6,3314 +6,253 @@ argument-hint: "[analyze|apply|foundation|violations|components|final|resume|sta
|
|
|
6
6
|
allowed-tools: [Read, Glob, Grep, Edit, Write, Bash, WebFetch]
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
**Skill version:**
|
|
9
|
+
**Skill version:** 2.0.0
|
|
10
10
|
**npm package:** trdr-ds-install
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
# TRDR Design System — Skill Router
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
You are implementing the **TRDR Design System** in a developer's project. The Design Hub is the single source of truth: **https://trdr.mrocontent.com.br**.
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
- `data/components.json` — full component catalog (implemented + stubs), with code blocks for everything `implemented: true` and `dependencies` array listing sub-component slugs used by compound components
|
|
16
|
+
## Architecture — Progressive Loading
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
This skill is split into multiple files to prevent context overload. **NEVER read all files at once.** Load ONLY the file needed for the current step.
|
|
20
19
|
|
|
21
|
-
Execute in multiple checkpointed phases: **PHASE 1: ANALYZE (saves DS_ANALYSIS.md) → PHASE 2: EXECUTE in 4 sub-phases (only after approval)**. Each sub-phase reads from saved files and stops for confirmation — preventing context overload and hallucinations.
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Argument behaviour
|
|
26
|
-
|
|
27
|
-
| Arg | Behaviour |
|
|
28
|
-
|-----|-----------|
|
|
29
|
-
| `analyze` *(default when none given)* | Run Phase 1 only — scan project, save `DS_ANALYSIS.md` + `SPRINT_PLAN.md`, present plan. Do not modify any project file |
|
|
30
|
-
| `apply` | Run Phase 1 + Phase 2 (all 4 sub-phases, with STOP between each) |
|
|
31
|
-
| `foundation` | Run Sub-fase A only — create tokens.css, components.css, CLAUDE.md, @imports. Requires DS_ANALYSIS.md |
|
|
32
|
-
| `violations` | Run Sub-fase B only — process next pending violation batch. Requires DS_ANALYSIS.md + DS_PROGRESS.md |
|
|
33
|
-
| `components` | Run Sub-fase C only — apply DS component classes. Requires DS_ANALYSIS.md + DS_PROGRESS.md |
|
|
34
|
-
| `final` | Run Sub-fase D only — fix logos + generate DS_MIGRATION.md. Requires DS_PROGRESS.md |
|
|
35
|
-
| `resume` | Read `SPRINT_PLAN.md` + `DS_PROGRESS.md`, find the next pending sprint, and execute it. Designed for use after `/clear` or in a new conversation — each sprint is self-contained |
|
|
36
|
-
| `status` | Read `SPRINT_PLAN.md` + `DS_PROGRESS.md` and display sprint progress table — no files modified |
|
|
37
|
-
| `batch [N]` | Override default violation batch size (default: 5 files/batch) |
|
|
38
|
-
| `sync` | Re-fetch `https://trdr.mrocontent.com.br/components.json` and `https://trdr.mrocontent.com.br/tokens.css`, overwrite `data/components.json` and `references/tokens.css` in the skill directory, report the diff. No project changes. |
|
|
39
|
-
| `rollback` | Read `DS_PROGRESS.md` to find the backup branch, reset working branch to that state, remove DS artifacts. Requires `DS_PROGRESS.md` with a `Backup branch:` entry |
|
|
40
|
-
| `report` | Generate a bug report (DS_BUG_REPORT.md) with project context, errors encountered, and current migration state. Sends via email to the skill maintainer (mrocontent@gmail.com). Can also be triggered automatically when a sub-phase encounters critical failures |
|
|
41
|
-
| `--latest` *(modifier on `analyze` or `apply`)* | Same as `sync` first, then continue normally |
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## PHASE 1: ANALYSIS (default behaviour on invocation)
|
|
46
|
-
|
|
47
|
-
Scan the project and produce a structured migration plan. Do NOT modify any project files yet.
|
|
48
|
-
|
|
49
|
-
### Step 0 — Check for skill updates, then detect previous progress
|
|
50
|
-
|
|
51
|
-
**Version check (runs on every invocation):**
|
|
52
|
-
|
|
53
|
-
Run this command silently via Bash:
|
|
54
|
-
```bash
|
|
55
|
-
npm show trdr-ds-install version 2>/dev/null
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Compare the result with the **Skill version** constant at the top of this file.
|
|
59
|
-
|
|
60
|
-
- If the command fails or returns empty (no internet / npm unavailable): skip silently, continue.
|
|
61
|
-
- If registry version == local version: skip silently, continue.
|
|
62
|
-
- If registry version > local version:
|
|
63
|
-
```
|
|
64
|
-
🔄 Nova versão da skill disponível: trdr-ds-install@[registry-version] (instalada: 1.11.0)
|
|
65
|
-
|
|
66
|
-
Responda:
|
|
67
|
-
- `"atualizar"` / `"update"` — instalar a nova versão agora (requer reiniciar /trdr-ds após)
|
|
68
|
-
- `"continuar"` / `"skip"` — usar a versão atual desta sessão
|
|
69
|
-
```
|
|
70
|
-
**STOP.** Wait for reply.
|
|
71
|
-
|
|
72
|
-
If reply is `"atualizar"` / `"update"`:
|
|
73
|
-
- Run Bash: `npx trdr-ds-install@latest`
|
|
74
|
-
- Output:
|
|
75
|
-
```
|
|
76
|
-
✅ Skill atualizada para trdr-ds-install@[registry-version].
|
|
77
|
-
Use /trdr-ds novamente para continuar com a versão mais recente.
|
|
78
|
-
```
|
|
79
|
-
- STOP. Do not continue with the current (old) instructions.
|
|
80
|
-
|
|
81
|
-
**After version check, detect previous progress:**
|
|
82
|
-
|
|
83
|
-
Check if `DS_PROGRESS.md` exists at the project root.
|
|
84
|
-
|
|
85
|
-
**If found AND `Status:` line is NOT `COMPLETE`:**
|
|
86
|
-
```
|
|
87
|
-
⚠️ Previous TRDR DS migration found (status: [IN_PROGRESS/PAUSED]).
|
|
88
|
-
|
|
89
|
-
Reply with:
|
|
90
|
-
- `"resume"` — continue from last checkpoint (Batch [N])
|
|
91
|
-
- `"restart"` — discard progress and run a fresh analysis
|
|
92
|
-
- `"status"` — see a progress summary without modifying anything
|
|
93
|
-
```
|
|
94
|
-
**STOP HERE. Wait for the developer's reply.**
|
|
95
|
-
|
|
96
|
-
**If found AND `Status: COMPLETE`:**
|
|
97
|
-
Inform the dev that a previous migration was already completed (show date). Offer to re-run analysis to detect new files added since then. Continue only if the dev explicitly says so.
|
|
98
|
-
|
|
99
|
-
**If not found:** Continue normally to Step 1.
|
|
100
|
-
|
|
101
|
-
### Step 1 — Detect framework and styling mode
|
|
102
|
-
|
|
103
|
-
Read `package.json` at the project root. Identify:
|
|
104
|
-
- Framework: Next.js (version), React (CRA/Vite), Vue/Nuxt, plain HTML, other
|
|
105
|
-
- Language: TypeScript or JavaScript
|
|
106
|
-
- Styling: CSS Modules, Tailwind, CSS-in-JS, plain CSS, SCSS
|
|
107
|
-
|
|
108
|
-
**Determine `stylingMode`** — used in Steps 5, 6, 6.6 and 6.7 to generate the correct syntax for each framework:
|
|
109
|
-
|
|
110
|
-
| stylingMode | Detection | How DS classes are applied |
|
|
111
|
-
|-------------|-----------|---------------------------|
|
|
112
|
-
| `plain-css` | No `tailwind.config.*`, no `*.module.css`, no CSS-in-JS dep | `class="trdr-btn"` in HTML attributes |
|
|
113
|
-
| `css-modules` | `*.module.css` files present | `composes: trdr-btn from global` in module file, `className={styles.btn}` in JSX |
|
|
114
|
-
| `tailwind` | `tailwind.config.*` present | `className="trdr-btn"` alongside Tailwind utilities |
|
|
115
|
-
| `css-in-js` | `styled-components` or `@emotion/*` in package.json (WITHOUT `@mui/material`) | Insert token vars inside template literals / `theme` objects |
|
|
116
|
-
| `mui` | `@mui/material` in package.json (v5+) | Theme-level integration: `createTheme()` palette/typography/shape use `var(--token)`, component `styleOverrides` use DS tokens, `sx` props migrated to token values |
|
|
117
|
-
|
|
118
|
-
Save `stylingMode` — it must be referenced throughout Phase 2 wherever the output format differs by framework.
|
|
119
|
-
|
|
120
|
-
**MUI detection priority:**
|
|
121
|
-
If `package.json` contains `@mui/material` (any version >= 5):
|
|
122
|
-
- Set `stylingMode: 'mui'` — do NOT fall through to `css-in-js` even if `@emotion/react` or `@emotion/styled` are present (they are MUI transitive dependencies, not direct CSS-in-JS usage)
|
|
123
|
-
- Record `muiVersion` from package.json (e.g., `7.3.9`)
|
|
124
|
-
- Detect MUI theme file: Glob for `**/theme.ts`, `**/theme.js`, `**/theme/index.ts`, `**/theme/index.js`, `**/theme/*.ts`, `**/createTheme*`, `**/muiTheme*` (exclude node_modules)
|
|
125
|
-
- Record `themeFilePath` — the primary theme entry point (the file containing `createTheme()`)
|
|
126
|
-
- Detect if project uses `ThemeProvider` in the app root: Grep for `<ThemeProvider` or `<MuiThemeProvider` in layout/app entry files
|
|
127
|
-
- Record `hasThemeProvider: boolean`
|
|
128
|
-
|
|
129
|
-
**MUI + Tailwind simultaneously:**
|
|
130
|
-
If `package.json` contains BOTH `@mui/material` AND `tailwindcss`:
|
|
131
|
-
- Set `stylingMode: 'mui'` (MUI dominant for component styling)
|
|
132
|
-
- Set `hasTailwind: true` — Tailwind utilities may coexist for layout
|
|
133
|
-
- In Step 3, scan BOTH theme files AND `tailwind.config.*` for violations
|
|
134
|
-
|
|
135
|
-
**Dual stylingMode — tailwind + styled-components simultaneously:**
|
|
136
|
-
If `package.json` contains BOTH `tailwindcss` AND `styled-components` (or `@emotion/*`):
|
|
137
|
-
- Set `stylingMode: 'tailwind'` (dominant — utility classes in className)
|
|
138
|
-
- Set `hasStyledComponents: true` to activate additional scan
|
|
139
|
-
- In Step 3, add a styled-components scan alongside the normal CSS scan:
|
|
140
|
-
- Pattern in `*.tsx, *.ts, *.jsx, *.js`: `` styled\.\w+`[^`]*(?:#[0-9A-Fa-f]{3,8}|font-family|rgba\()[^`]*` ``
|
|
141
|
-
- For each template literal matched: run A, B, F violation checks against its content (even though it's not a `.css` file)
|
|
142
|
-
- Fix: replace hardcoded values inside template literals with CSS var tokens:
|
|
143
|
-
`background: #00A8CC` → `background: var(--action-brand-default);`
|
|
144
|
-
`font-family: 'Inter'` → `font-family: var(--font-secondary);`
|
|
145
|
-
- Document in `CLAUDE.md` of the project: "This project uses styled-components AND Tailwind. New components: prefer Tailwind + DS classes. Existing styled-components: use DS tokens via CSS vars in template literals."
|
|
146
|
-
|
|
147
|
-
### Step 2 — Map style structure
|
|
148
|
-
|
|
149
|
-
Search for all style files:
|
|
150
|
-
```
|
|
151
|
-
Glob: ["**/*.css", "**/*.scss"] — exclude node_modules, .next, dist, build, out
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
Identify:
|
|
155
|
-
- Main global CSS file (globals.css, main.css, index.css, app.css, styles.css)
|
|
156
|
-
- Whether CSS custom properties already exist (look for `:root {`)
|
|
157
|
-
- Potential conflicts with TRDR prefixes: `--bg-`, `--content-`, `--action-`, `--surface-`, `--border-`, `--spacing-`, `--radius-`
|
|
158
|
-
- Whether fonts (JetBrains Mono, Inter, Roboto Mono) are already loaded
|
|
159
|
-
|
|
160
|
-
Determine the best directory for new CSS files:
|
|
161
|
-
- Next.js with `src/`: → `src/styles/`
|
|
162
|
-
- Next.js without `src/`: → `styles/`
|
|
163
|
-
- React CRA/Vite with `src/`: → `src/styles/` or `src/assets/`
|
|
164
|
-
- Plain HTML: → `css/` or `styles/`
|
|
165
|
-
|
|
166
|
-
**For `tailwind` stylingMode — additional scan:**
|
|
167
|
-
Read `tailwind.config.js` (or `tailwind.config.ts`) and check `theme.colors` and `theme.extend.colors`:
|
|
168
|
-
- If any color value is a hardcoded `#hex` that matches a TRDR DS token, flag it
|
|
169
|
-
- Add `tailwind.config.js` to "FILES TO MODIFY" in the plan
|
|
170
|
-
- Fix during Sub-fase B: replace each `'#hex'` with `'var(--semantic-token)'`
|
|
171
|
-
- Example: `brand: '#00A8CC'` → `brand: 'var(--content-brand)'`
|
|
172
|
-
- This allows Tailwind classes like `text-brand` to use the DS token automatically
|
|
173
|
-
|
|
174
|
-
**For `mui` stylingMode — additional scan:**
|
|
175
|
-
Read all theme files found during detection. Identify:
|
|
176
|
-
- `createTheme()` call location and structure
|
|
177
|
-
- `palette` object: list all hardcoded `#hex` values and their semantic role (primary, secondary, error, warning, success, info, background, text)
|
|
178
|
-
- `typography` object: list all hardcoded `font-family`, `fontSize`, `fontWeight` values
|
|
179
|
-
- `shape` object: list all hardcoded `borderRadius` values
|
|
180
|
-
- `components` object: list all component `styleOverrides` with hardcoded values
|
|
181
|
-
- Whether `cssVariables: true` is already passed to `createTheme()` (MUI v6+ CSS variables mode)
|
|
182
|
-
- Whether project uses MUI's `sx` prop extensively: Grep for `sx=\{\{` in `*.tsx, *.jsx` — count distinct files
|
|
183
|
-
- `styled(MuiComponent)` calls: Grep for `styled\([A-Z]\w+\)` in `*.tsx, *.ts, *.jsx, *.js` — count distinct files
|
|
184
|
-
- Custom theme augmentation: `declare module '@mui/material/styles'` in `*.d.ts` files
|
|
185
|
-
|
|
186
|
-
Add theme files and all files with `sx` / `styled(Mui*)` to "FILES TO MODIFY" in the plan.
|
|
187
|
-
|
|
188
|
-
### Step 3 — Find violations
|
|
189
|
-
|
|
190
|
-
Search for TRDR rule violations across all source files (*.css, *.scss, *.tsx, *.jsx, *.ts, *.js, *.vue, *.html):
|
|
191
|
-
|
|
192
|
-
**A — Hardcoded colors** (should be CSS vars):
|
|
193
|
-
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.
|
|
194
|
-
|
|
195
|
-
**Special case — SVG attribute colors** (`stroke=`, `fill=`, `stop-color=` in HTML/JSX/Vue):
|
|
196
|
-
When `#hex` is found inside an SVG attribute (not a CSS property), the fix is different — CSS variables do NOT work in SVG attributes. Instead:
|
|
197
|
-
- If the SVG is a simple icon with a single solid color → replace with `stroke="currentColor"` / `fill="currentColor"` and control color via a CSS class (e.g., `.icon-brand { color: var(--content-brand); }`)
|
|
198
|
-
- If the SVG has multiple distinct colors (multi-tone icon) → it should be replaced as a Category J violation (inline SVG → icon library)
|
|
199
|
-
- Do NOT write `stroke="var(--token)"` — it is invalid in HTML SVG attributes
|
|
200
|
-
|
|
201
|
-
Track SVG attribute color violations separately as **A\*** in DS_ANALYSIS.md with the note "SVG attribute — requires currentColor + CSS class approach, not var()."
|
|
202
|
-
|
|
203
|
-
**B — Hardcoded font-family** (should be var(--font-primary/secondary/mono)):
|
|
204
|
-
Search: `font-family.*Inter|font-family.*JetBrains Mono|font-family.*Space Grotesk|font-family.*Roboto Mono`
|
|
205
|
-
|
|
206
|
-
**Note — JSX camelCase:** In React/Next.js files, font-family appears as `fontFamily` inside `style={{}}` objects. These are NOT detected by Category B (which scans CSS). They are captured by Category I (inline styles with `font` keyword). Do NOT double-count them in Category B; address them in Category I fix instead.
|
|
207
|
-
|
|
208
|
-
**C — Hardcoded px spacing** (should be var(--spacing-*)):
|
|
209
|
-
Search: `(margin|padding|gap):\s*\d+px` in CSS/SCSS
|
|
210
|
-
|
|
211
|
-
**D — Primitive token usage** (should be semantic):
|
|
212
|
-
Search: `var\(--color-|var\(--space-` in CSS/SCSS/component files
|
|
213
|
-
|
|
214
|
-
Also search for **custom CSS variable definitions with primitive naming** in `:root {}` blocks:
|
|
215
|
-
- Pattern: `--color-[a-z]|--space-[0-9]|--font-size-[0-9]` inside `:root {`
|
|
216
|
-
- Flag as: "Custom CSS variable using primitive-style name: `--color-brand`. This duplicates DS token naming. Remove and replace all `var(--color-brand)` usages with the appropriate semantic token."
|
|
217
|
-
- Do NOT auto-remove — flag for manual review in DS_MIGRATION.md
|
|
218
|
-
|
|
219
|
-
**E — Missing tokens.css**:
|
|
220
|
-
Check if `tokens.css` already exists in the project and if it's imported in the global CSS.
|
|
221
|
-
|
|
222
|
-
**F — Hardcoded rgba colors** (should use DS semantic tokens or be flagged):
|
|
223
|
-
Search: `rgba\(` in CSS/SCSS/HTML files (excluding node_modules, vendor)
|
|
224
|
-
|
|
225
|
-
**G — Custom gradients (non-TRDR)** (should use var(--gradient-*) tokens):
|
|
226
|
-
Search: `linear-gradient|radial-gradient` in CSS/SCSS/HTML files
|
|
227
|
-
Flag any gradient that doesn't reference a TRDR gradient token (`var(--gradient-*)`)
|
|
228
|
-
|
|
229
|
-
**Gradients with hex stops:** Compare against TRDR gradient token approximate values:
|
|
230
|
-
- `--gradient-bg-hero` ≈ `linear-gradient(180deg, #0E0E0E 0%, #141519 100%)`
|
|
231
|
-
- `--gradient-bg-surface` ≈ `linear-gradient(180deg, #141519 0%, #0E0E0E 100%)`
|
|
232
|
-
- `--gradient-brand` ≈ `linear-gradient(90deg, #00A8CC 0%, #00D4FF 100%)`
|
|
233
|
-
If a gradient closely matches one of these: replace with `var(--gradient-name)`.
|
|
234
|
-
If no match: flag in DS_MIGRATION.md as "Custom gradient — no DS token available."
|
|
235
|
-
Non-DS colors in gradient stops (e.g. `#0a1520`) are also A violations — flag separately.
|
|
236
|
-
|
|
237
|
-
**Gradients with rgba stops:** When gradient stops use `rgba()` instead of hex:
|
|
238
|
-
1. Extract the base color from each rgba stop and identify it in the TRDR color mapping table.
|
|
239
|
-
2. If the base color has a DS token: recommend `rgba(var(--token-rgb), opacity)` if the DS exposes RGB variables, otherwise flag in DS_MIGRATION.md.
|
|
240
|
-
3. **Fade-to-transparent** pattern (e.g. `rgba(0,212,255,0.04) 0%, transparent 100%`):
|
|
241
|
-
- This is a glow/haze effect. Very unlikely to have a DS token.
|
|
242
|
-
- Flag as: "Glow effect gradient — no DS token. Consider converting to `box-shadow: 0 0 Xpx var(--token)` or remove if purely decorative."
|
|
243
|
-
4. **Overlay gradient** (e.g. `rgba(255,204,64,0.1) 0%, rgba(255,204,64,0.05) 100%`):
|
|
244
|
-
- Flag as: "Tinted overlay gradient — no DS equivalent. Map rgba base color to token; keep gradient as-is or convert to a solid rgba with semantic token."
|
|
245
|
-
|
|
246
|
-
**H — Hardcoded font-size in px** (should use .trdr-h* / .trdr-body-* text style classes):
|
|
247
|
-
Search: `font-size:\s*\d+px` in CSS/SCSS files (skip tokens.css itself)
|
|
248
|
-
|
|
249
|
-
**I — Inline styles with design properties** (should be CSS classes with tokens):
|
|
250
|
-
|
|
251
|
-
**I.1 — JSX/HTML style attribute** (standard inline styles):
|
|
252
|
-
Search in `*.html, *.tsx, *.jsx, *.vue, *.svelte`:
|
|
253
|
-
- HTML/Vue: `style="[^"]*(?:color|background|font|padding|margin|gap|border)[^"]*"`
|
|
254
|
-
- React/JSX: `style=\{\{[^}]*(?:color|background|font|padding|margin|gap|border)[^}]*\}\}`
|
|
255
|
-
- Vue binding: `:style="\{[^}]*(?:color|background|font|padding|margin|gap|border)[^}]*\}"`
|
|
256
|
-
|
|
257
|
-
Do NOT flag (these are acceptable exceptions):
|
|
258
|
-
- `background-image: url(...)` — dynamic image URL from data
|
|
259
|
-
- `style="--custom-prop: value"` — CSS custom property passing a dynamic value to CSS (e.g. `style="--card-delay:0.1s"`)
|
|
260
|
-
- `style={{ '--custom-prop': value }}` — same in JSX
|
|
261
|
-
|
|
262
|
-
**I.2 — Dynamic DOM style assignment** (imperative JS manipulation, NOT covered by I.1):
|
|
263
|
-
Search in `*.tsx, *.jsx, *.js, *.ts`:
|
|
264
|
-
- Pattern: `\.style\.[a-zA-Z]+\s*=\s*['"]`
|
|
265
|
-
- Example: `e.currentTarget.style.background = 'rgba(255,255,255,0.03)'`
|
|
266
|
-
- Example: `ref.current.style.color = '#00D4FF'`
|
|
267
|
-
|
|
268
|
-
This pattern is common in hover handlers (`onMouseEnter/onMouseLeave`) and imperative animations. The assigned value is a hardcoded design value that must be replaced.
|
|
269
|
-
|
|
270
|
-
**I.2 fix procedure:**
|
|
271
|
-
|
|
272
|
-
*CASE 1 — onMouseEnter/onMouseLeave hover effect:*
|
|
273
|
-
This is the most common case. Convert to a CSS `:hover` rule:
|
|
274
|
-
```css
|
|
275
|
-
/* Before: onMouseEnter sets background imperatively */
|
|
276
|
-
.item { transition: background 0.15s; }
|
|
277
|
-
.item:hover { background: var(--surface-hover); }
|
|
278
|
-
```
|
|
279
|
-
Remove the `onMouseEnter` and `onMouseLeave` handlers. Add `className="item"` to the element.
|
|
280
|
-
|
|
281
|
-
*CASE 2 — State-driven imperative style (non-hover):*
|
|
282
|
-
If the DOM assignment is driven by JS logic beyond simple hover, replace the hardcoded value only:
|
|
283
|
-
```tsx
|
|
284
|
-
// Before
|
|
285
|
-
el.style.background = 'rgba(255,255,255,0.03)';
|
|
286
|
-
// After
|
|
287
|
-
el.style.background = 'var(--surface-hover)';
|
|
288
|
-
```
|
|
289
|
-
Document in DS_PROGRESS.md as "I.2 fix — dynamic style value replaced with token."
|
|
290
|
-
|
|
291
|
-
PRIORITY: Always prefer CASE 1 (CSS pseudo-class) — it's more performant and idiomatic than CASE 2.
|
|
292
|
-
|
|
293
|
-
**J — SVG icons inline** (should use an icon library):
|
|
294
|
-
Search in `*.html, *.tsx, *.jsx, *.vue`:
|
|
295
|
-
- Pattern: `<svg` in source files (NOT in logo files, NOT in `node_modules/`, `references/`, `assets/icons/`)
|
|
296
|
-
- Do NOT flag: `<svg` in known logo files (those with the official TRDR fingerprint)
|
|
297
|
-
- Count distinct files with inline SVGs, not total occurrences
|
|
298
|
-
|
|
299
|
-
**Severity sub-classification:**
|
|
300
|
-
- **J.high**: `<svg>` with hardcoded `stroke="#hex"` or `fill="#hex"` — both a J and A* violation; replace with icon library ASAP
|
|
301
|
-
- **J.medium**: `<svg>` with dynamic JSX fill/stroke expression (e.g. `fill={isActive ? 'currentColor' : 'none'}`) — no hex hardcoded, but state-driven SVG attribute that must be preserved during migration; replace with icon library using conditional CSS class
|
|
302
|
-
- **J.low**: `<svg>` using ONLY `currentColor` / `inherit` (no hardcoded colors) — still prefer icon library, but lower priority; note in plan: "SVG uses currentColor (color is CSS-controlled). Migration to Material Icons recommended but non-urgent."
|
|
303
|
-
|
|
304
|
-
**J.medium fix procedure — dynamic SVG attributes:**
|
|
305
|
-
When an SVG has `fill={condition ? 'currentColor' : 'none'}` or `stroke={value}` (JSX expression):
|
|
306
|
-
1. Identify the two visual states (filled/outlined, active/inactive)
|
|
307
|
-
2. Create CSS classes for each state:
|
|
308
|
-
```css
|
|
309
|
-
.icon-star { color: var(--content-tertiary); }
|
|
310
|
-
.icon-star.active { color: var(--context-trading-signal); }
|
|
311
|
-
```
|
|
312
|
-
3. Replace the SVG with a Material Icon (or equivalent DS icon) using a conditional className:
|
|
313
|
-
```tsx
|
|
314
|
-
<span className={`material-icons icon-star ${isWatching ? 'active' : ''}`}>star</span>
|
|
315
|
-
```
|
|
316
|
-
4. The `fill`/`stroke` logic is handled entirely by CSS — never pass state to icon attributes.
|
|
317
|
-
|
|
318
|
-
**K — Logo missing or incorrect in HTML/JSX** (should use official logo-trdr.svg):
|
|
319
|
-
Search in `*.html, *.tsx, *.jsx, *.vue` using **two separate Grep calls** (the combined pattern is unreliable in ripgrep):
|
|
320
|
-
|
|
321
|
-
Call 1 — Non-official img logo (HTML):
|
|
322
|
-
- Pattern: `src="[^"]*logo(?!-trdr)[^"]*"` — img/Image with logo in the src value itself (covers JSX where src is first attribute)
|
|
323
|
-
- Secondary: `<img[^>]*(?:logo|brand|mark)[^>]*src="(?!.*logo-trdr)[^"]*"` — catches cases where logo/brand/mark appears in alt= or class= before src=
|
|
324
|
-
|
|
325
|
-
Call 1b — Next.js `<Image>` component (Next.js projects only):
|
|
326
|
-
- Pattern: `<Image[^>]*src="[^"]*logo(?!-trdr)[^"]*"` — next/image component with non-official logo
|
|
327
|
-
- Also flag `<Image[^>]*src=\{[^}]*logo(?!Trdr)[^}]*\}` for dynamic src with variable name not matching logoTrdr
|
|
328
|
-
|
|
329
|
-
Call 2 — Text span as logo (use this pattern, NOT the combined version):
|
|
330
|
-
- Pattern: `>\s*TRDR\s*<` — finds any element with text content "TRDR"
|
|
331
|
-
- Then check if the surrounding element is `<span>` or `<div>` (not `<img alt="TRDR">`)
|
|
332
|
-
- Simpler alternative: `class="[^"]*logo[^"]*"` + check if no `<img` tag on the same line
|
|
333
|
-
|
|
334
|
-
Call 3 — Wrong logo import:
|
|
335
|
-
- Pattern: `import\s+\w+\s+from\s+['"][^'"]*logo(?!-trdr)[^'"]*['"]` — logo import that isn't logo-trdr
|
|
336
|
-
|
|
337
|
-
Do NOT flag: `logo-trdr.svg` references — those are correct.
|
|
338
|
-
|
|
339
|
-
**Note:** The pattern `<span[^>]*>[^<]*TRDR[^<]*</span>` is known to fail in ripgrep — do NOT use it.
|
|
340
|
-
|
|
341
|
-
**L — Hardcoded values in MUI theme** (only when `stylingMode === 'mui'`):
|
|
342
|
-
Search in theme files (`**/theme/**/*.ts`, `**/theme/**/*.js`, `**/theme.ts`, `**/theme.js`, `**/createTheme*`, `**/muiTheme*`):
|
|
343
|
-
|
|
344
|
-
L.1 — palette hardcoded colors:
|
|
345
|
-
- Pattern: `(?:main|light|dark|contrastText|paper|default):\s*['"]#[0-9A-Fa-f]{3,8}['"]`
|
|
346
|
-
- Also: `primary:|secondary:|error:|warning:|success:|info:|background:|text:` objects with nested hex values
|
|
347
|
-
- Fix: replace with `'var(--semantic-token)'` using the color mapping table
|
|
348
|
-
|
|
349
|
-
L.2 — typography hardcoded values:
|
|
350
|
-
- Pattern: `fontFamily:\s*['"][^'"]*Inter|fontFamily:\s*['"][^'"]*JetBrains|fontSize:\s*\d+` inside typography object
|
|
351
|
-
- Fix: replace with `'var(--font-*)'` tokens
|
|
352
|
-
|
|
353
|
-
L.3 — shape hardcoded radius:
|
|
354
|
-
- Pattern: `borderRadius:\s*\d+` inside shape object or component styleOverrides
|
|
355
|
-
- Fix: replace with numeric value from DS radius mapping
|
|
356
|
-
|
|
357
|
-
L.4 — component styleOverrides hardcoded values:
|
|
358
|
-
- Search inside `components:` > `Mui*` > `styleOverrides` for any `#hex`, `Npx` (spacing/radius), `font-family`
|
|
359
|
-
- Fix: replace with appropriate `var(--token)`
|
|
360
|
-
|
|
361
|
-
**M — Hardcoded values in MUI sx props** (only when `stylingMode === 'mui'`):
|
|
362
|
-
Search in all component files (`*.tsx, *.jsx`):
|
|
363
|
-
- Pattern: `sx=\{\{` then scan content for `#[0-9A-Fa-f]{3,8}`, `(?:padding|margin|gap):\s*['"]?\d+(?:px)?`, `fontFamily:`, `fontSize:\s*\d+`, `borderRadius:\s*\d+`
|
|
364
|
-
- Also detect hardcoded values inside nested pseudo-selectors (`'&:hover'`, `'& .MuiXxx'`)
|
|
365
|
-
- Fix: replace hardcoded values with `'var(--token)'`
|
|
366
|
-
|
|
367
|
-
**N — Hardcoded values in styled(MuiComponent) calls** (only when `stylingMode === 'mui'`):
|
|
368
|
-
Search in all component files (`*.tsx, *.jsx, *.ts, *.js`):
|
|
369
|
-
- Pattern: `styled\([A-Z]\w+\)` — then scan the styled block for `#hex`, hardcoded `fontFamily`, `fontSize`, `borderRadius`, spacing px values
|
|
370
|
-
- Fix: replace hardcoded values with `'var(--token)'`
|
|
371
|
-
|
|
372
|
-
**MUI violation categories L, M, N are ONLY scanned when `stylingMode === 'mui'`** — they do not apply to other modes.
|
|
373
|
-
|
|
374
|
-
Track:
|
|
375
|
-
- `total_violations` = sum of all A–K occurrences (+ L, M, N when MUI)
|
|
376
|
-
- `total_files_with_violations` = count of unique files with ≥ 1 violation
|
|
377
|
-
- `violations_by_folder` = map of `{ folder: string, files: string[], count: number }[]` grouped by first-level folder inside `src/` (or project root if no `src/`)
|
|
378
|
-
|
|
379
|
-
### Step 3.5 — Detect component replacement candidates
|
|
380
|
-
|
|
381
|
-
Scan the project for UI patterns that indicate elements replaceable by TRDR implemented components.
|
|
382
|
-
|
|
383
|
-
**Scope:** `*.tsx, *.jsx, *.ts, *.js, *.html, *.vue` — exclude `node_modules/, .next/, dist/, build/, out/`.
|
|
384
|
-
|
|
385
|
-
Use Grep (not Bash grep) to search for the patterns below. Group patterns from the same slug into a single call.
|
|
386
|
-
|
|
387
|
-
**Pattern table per TRDR implemented component:**
|
|
388
|
-
|
|
389
|
-
| Slug | Search patterns |
|
|
390
|
-
|------|----------------|
|
|
391
|
-
| `button` | `<button`, `<Button`, `type="submit"`, `type="button"`, `role="button"` |
|
|
392
|
-
| `text-input` | `<input`, `<TextInput`, `<textarea`, `type="text"`, `type="email"`, `type="password"`, `type="search"` |
|
|
393
|
-
| `checkbox` | `type="checkbox"`, `<Checkbox`, `\.checkbox` |
|
|
394
|
-
| `radio-button` | `type="radio"`, `<RadioButton`, `<Radio[^B]` |
|
|
395
|
-
| `switch` | `<Switch`, `role="switch"`, `\.toggle`, `\.switch` |
|
|
396
|
-
| `dropdown` | `<select`, `<Select`, `<Dropdown`, `role="listbox"`, `role="combobox"` |
|
|
397
|
-
| `combo-input` | `<ComboInput`, `combo.{0,10}input` |
|
|
398
|
-
| `tooltip` | `<Tooltip`, `role="tooltip"`, `data-tooltip` |
|
|
399
|
-
| `abas` | `<Tabs`, `role="tablist"`, `role="tab"`, `\.tabs` |
|
|
400
|
-
| `segmented-control` | `<SegmentedControl`, `\.segmented`, `segment.{0,15}control` |
|
|
401
|
-
| `sub-menu-item` | `<MenuItem`, `<SubMenu`, `\.menu-item`, `\.submenu` |
|
|
402
|
-
| `card` | `<Card`, `\.card`, `<article` |
|
|
403
|
-
| `boleta` | `<Boleta`, `boleta` |
|
|
404
|
-
| `janela` | `<Janela`, `trading.{0,10}window` |
|
|
405
|
-
| `tabela-cotacoes` | `<TabelaCotacoes`, `.quotes-table`, `.price-list`, `<table` with price/ticker/cotacao columns |
|
|
406
|
-
| `tabela-ordens` | `<TabelaOrdens`, `.orders-table`, `.order-list`, `<table` with order/position columns |
|
|
407
|
-
| `floating-menu` | `<FloatingMenu`, `.floating-menu`, `position:absolute` + `z-index` + list pattern |
|
|
408
|
-
| `news-card` | `<NewsCard`, `.news-card`, `.article-card`, `<article` with image + title + date pattern |
|
|
409
|
-
| `header` | `<Header`, `<header`, `.header`, `.navbar`, `<nav` at top-level page position |
|
|
410
|
-
| `badge` | `<Badge`, `.badge`, `.tag`, `.chip`, `.label-status`, `<span` with short status-like text |
|
|
411
|
-
|
|
412
|
-
**Rules:**
|
|
413
|
-
- For each slug, count the distinct files that matched (not total lines) — one file counts as one occurrence.
|
|
414
|
-
- Discard matches in test files (`*.test.*`, `*.spec.*`) — those don't count as UI usage.
|
|
415
|
-
- Store results as a list of `{ slug, files: ["path:line", ...] }` — used in Step 5 and Phase 2 Step 6.
|
|
416
|
-
- If a slug has zero matches, omit it from the replacement candidates list.
|
|
417
|
-
- `title=""` attribute is too noisy — do NOT use it for tooltip detection; prefer `<Tooltip` / `role="tooltip"` / `data-tooltip`.
|
|
418
|
-
|
|
419
|
-
**Also scan for CSS custom classes that re-implement DS components** (common in plain-HTML projects):
|
|
420
|
-
|
|
421
|
-
| DS Component | CSS pattern to detect | Signal |
|
|
422
|
-
|---|---|---|
|
|
423
|
-
| Button | `.btn`, `.button`, `[class*="btn"]`, `[class*="button"]` in CSS with `cursor:pointer` | Likely button reimplementation |
|
|
424
|
-
| Text Input | `.input`, `.text-field`, `.search-bar` in CSS with `border` + `padding` | Likely input reimplementation |
|
|
425
|
-
| Segment Control | `.tab`, `.segment`, `.lang-selector` in CSS with `display:flex` + `border-radius` | Likely segmented reimplementation |
|
|
426
|
-
|
|
427
|
-
For each match, add to `replacementCandidates[]` with a `customCssClass` field noting the project's class name, so Phase 2 Step 6 can add DS classes to those elements.
|
|
428
|
-
|
|
429
|
-
**MUI component detection (only when `stylingMode === 'mui'`):**
|
|
430
|
-
|
|
431
|
-
When `stylingMode === 'mui'`, the component candidate scan shifts focus. Instead of searching for HTML tags to replace with DS classes, search for MUI components that need theme-level DS token integration:
|
|
432
|
-
|
|
433
|
-
| DS Slug | MUI Component patterns |
|
|
434
|
-
|---------|----------------------|
|
|
435
|
-
| `button` | `<Button`, `<IconButton`, `<LoadingButton`, `<Fab` |
|
|
436
|
-
| `text-input` | `<TextField`, `<Input`, `<OutlinedInput`, `<FilledInput` |
|
|
437
|
-
| `checkbox` | `<Checkbox`, `<FormControlLabel` with checkbox |
|
|
438
|
-
| `radio-button` | `<Radio`, `<RadioGroup` |
|
|
439
|
-
| `switch` | `<Switch` (MUI) |
|
|
440
|
-
| `dropdown` | `<Select`, `<Autocomplete`, `<NativeSelect` |
|
|
441
|
-
| `tooltip` | `<Tooltip` (MUI) |
|
|
442
|
-
| `abas` | `<Tabs`, `<Tab` (MUI) |
|
|
443
|
-
| `card` | `<Card`, `<CardContent`, `<CardActions`, `<CardMedia` |
|
|
444
|
-
| `badge` | `<Badge`, `<Chip` (MUI) |
|
|
445
|
-
| `header` | `<AppBar`, `<Toolbar` |
|
|
446
|
-
| `modal` | `<Dialog`, `<Modal`, `<DialogTitle`, `<DialogContent` |
|
|
447
|
-
|
|
448
|
-
For MUI projects, the purpose of detecting these components is NOT to replace them (they stay as MUI components), but to know WHICH MUI theme `components.MuiXxx.styleOverrides` entries to generate in Sub-fase C.
|
|
449
|
-
|
|
450
|
-
Store results in the same `replacementCandidates[]` structure — the `slug` and `files` fields are used, but classification follows MUI-specific rules (see Step 3.5b).
|
|
451
|
-
|
|
452
|
-
**Output:** `replacementCandidates[]` — passed to Step 3.5b, Step 5 template and Phase 2 Step 6.
|
|
453
|
-
|
|
454
|
-
### Step 3.5b — Capture structural context for each candidate
|
|
455
|
-
|
|
456
|
-
For each file:line match found in Step 3.5, read the surrounding context (10 lines before and after the match) and classify the replacement complexity:
|
|
457
|
-
|
|
458
|
-
| Classification | Criteria | Phase 2 action |
|
|
459
|
-
|---|---|---|
|
|
460
|
-
| `simple` | Element has only text content. No event handlers (`onClick`, `onChange`, etc.), no conditional rendering (`{condition && ...}`, ternary), no dynamic props beyond basic HTML attributes (`id`, `name`, `class`, `placeholder`, `type`) | Full DS component replacement — swap the element entirely with the DS component structure, adapting content |
|
|
461
|
-
| `complex-preservable` | Element has event handlers, data bindings (`value={state}`, `checked={state}`), refs, or conditional rendering, BUT the DOM structure maps cleanly to a DS component | Apply DS structure + classes, preserving ALL handlers, bindings, and conditional logic |
|
|
462
|
-
| `complex-manual` | Element has deeply nested custom logic, multiple conditional branches affecting structure, dynamically generated children, or domain-specific behavior that doesn't map to any DS component pattern | Flag for manual review in DS_MIGRATION.md — do NOT auto-modify |
|
|
463
|
-
|
|
464
|
-
**MUI classification rules (only when `stylingMode === 'mui'`):**
|
|
465
|
-
|
|
466
|
-
When `stylingMode === 'mui'`, use these classifications instead of the table above:
|
|
467
|
-
|
|
468
|
-
| Classification | Criteria | Phase 2 action |
|
|
469
|
-
|---|---|---|
|
|
470
|
-
| `theme-override` | Standard MUI component usage — the component should receive DS tokens via theme `components.MuiXxx.styleOverrides` | Generate/update styleOverrides in theme file (Sub-fase C) |
|
|
471
|
-
| `sx-migration` | Component has `sx={{...}}` with hardcoded design values (colors, fonts, radius) | Replace hardcoded sx values with `'var(--token)'` (Sub-fase B/C) |
|
|
472
|
-
| `styled-migration` | Component uses `styled(MuiComponent)` with hardcoded values | Replace values inside styled() call with `'var(--token)'` (Sub-fase B/C) |
|
|
473
|
-
| `complex-manual` | Deeply customized MUI component with renderProp, slots API, complex theme augmentation, or `sx` with dynamic calculations | Flag for manual review in DS_MIGRATION.md |
|
|
474
|
-
|
|
475
|
-
All detected MUI components default to `theme-override`. Add `sx-migration` or `styled-migration` only for individual instances that also have inline hardcoded values.
|
|
476
|
-
|
|
477
|
-
**For each candidate, store:**
|
|
478
|
-
```json
|
|
479
|
-
{
|
|
480
|
-
"slug": "button",
|
|
481
|
-
"file": "src/components/Hero.tsx",
|
|
482
|
-
"line": 42,
|
|
483
|
-
"classification": "simple",
|
|
484
|
-
"existingContent": "Get Started",
|
|
485
|
-
"existingHandlers": [],
|
|
486
|
-
"existingClasses": "btn-primary hero-cta",
|
|
487
|
-
"existingProps": [],
|
|
488
|
-
"suggestedDsVariant": "trdr-btn-primary"
|
|
489
|
-
}
|
|
490
|
-
```
|
|
491
|
-
|
|
492
|
-
**Variant detection rules (by signals in existing code):**
|
|
493
|
-
|
|
494
|
-
| Existing pattern signals | Suggested DS variant |
|
|
495
|
-
|---|---|
|
|
496
|
-
| `.btn-primary`, `.cta`, `type="submit"`, prominent/brand color (cyan, blue) | `trdr-btn-primary` |
|
|
497
|
-
| `.btn-secondary`, `.btn-cancel`, muted/gray color | `trdr-btn-secondary` |
|
|
498
|
-
| `.btn-outline`, `.btn-ghost`, transparent background + border | `trdr-btn-ghost` |
|
|
499
|
-
| `.btn-danger`, `.btn-delete`, red/orange/destructive color | `trdr-btn-destructive` |
|
|
500
|
-
| `.btn-link`, `<a>` styled as button, no border/bg | `trdr-btn-link` |
|
|
501
|
-
| `type="text"`, `type="email"`, `type="password"`, `type="search"`, `<textarea>` | `trdr-text-input` |
|
|
502
|
-
| `type="checkbox"` | `trdr-checkbox` |
|
|
503
|
-
| `type="radio"` | `trdr-radio-button` |
|
|
504
|
-
| `role="switch"`, `.toggle`, `.switch` | `trdr-switch` |
|
|
505
|
-
| `<select>`, `role="listbox"` | `trdr-dropdown` |
|
|
506
|
-
| `role="tablist"`, `.tabs` | `trdr-abas` or `trdr-segment-control` |
|
|
507
|
-
| `.badge` + green/success color | `trdr-badge-success` |
|
|
508
|
-
| `.badge` + blue/brand color | `trdr-badge-brand` |
|
|
509
|
-
| `.badge` + yellow/warning color | `trdr-badge-warning` |
|
|
510
|
-
| `.badge` + neutral/gray color | `trdr-badge-neutral` |
|
|
511
|
-
| `<Tooltip>`, `role="tooltip"`, `data-tooltip` | `trdr-tooltip` |
|
|
512
|
-
|
|
513
|
-
**Output:** Updated `replacementCandidates[]` — each entry now includes `classification`, `existingContent`, `existingHandlers`, `existingProps`, and `suggestedDsVariant`.
|
|
514
|
-
|
|
515
|
-
### Step 3.6 — Logo audit
|
|
516
|
-
|
|
517
|
-
Glob for logo files across the project:
|
|
518
|
-
|
|
519
|
-
```
|
|
520
|
-
Patterns: ["**/logo*.svg", "**/*trdr*.svg", "**/brand*.svg", "**/icon-trdr*.svg"]
|
|
521
|
-
Exclude: node_modules/, .next/, dist/, build/, out/, references/
|
|
522
|
-
```
|
|
523
|
-
|
|
524
|
-
The official TRDR logo fingerprint (both must be present):
|
|
525
|
-
- `viewBox="0 0 105 41"` — exact dimensions of the reference logo
|
|
526
|
-
- `fill="#00D4FF"` — brand cyan used in the symbol paths
|
|
527
|
-
|
|
528
|
-
For each found SVG file:
|
|
529
|
-
1. Read its content.
|
|
530
|
-
2. Check for both fingerprint markers.
|
|
531
|
-
3. Classify:
|
|
532
|
-
- ✅ **CORRECT** — contains both markers → already the official logo
|
|
533
|
-
- ❌ **WRONG** — SVG file exists but doesn't match (different viewBox, colors, or both)
|
|
534
|
-
- ⚠️ **UNKNOWN** — binary or unusually formatted SVG, can't determine
|
|
535
|
-
|
|
536
|
-
Store result as `logoAudit = { correct: string[], wrong: string[], unknown: string[] }`.
|
|
537
|
-
|
|
538
|
-
If no logo files are found at all, check if a `public/` directory exists at the project root — flag it as a suggested location to add the logo.
|
|
539
|
-
|
|
540
|
-
Include logo findings in the migration plan (Step 5 below).
|
|
541
|
-
|
|
542
|
-
### Step 4 — Load component catalog (offline-first)
|
|
543
|
-
|
|
544
|
-
Read the local snapshot from the skill directory:
|
|
545
|
-
|
|
546
|
-
```
|
|
547
|
-
Read: <skill-dir>/data/components.json
|
|
548
|
-
```
|
|
549
|
-
|
|
550
|
-
Where `<skill-dir>` is either `~/.claude/skills/trdr-ds/` or `<project>/.claude/skills/trdr-ds/`. Try both.
|
|
551
|
-
|
|
552
|
-
Expected JSON shape:
|
|
553
|
-
```json
|
|
554
|
-
{
|
|
555
|
-
"version": "1.0",
|
|
556
|
-
"generatedAt": "2026-05-08T...",
|
|
557
|
-
"total": 60,
|
|
558
|
-
"implemented": 13,
|
|
559
|
-
"categories": { "formulario": "Formulário / Controles", ... },
|
|
560
|
-
"components": [
|
|
561
|
-
{
|
|
562
|
-
"slug": "button", "name": "Button", "figmaId": "1318:749",
|
|
563
|
-
"category": "formulario", "description": "...",
|
|
564
|
-
"implemented": true,
|
|
565
|
-
"props": [...], "dimensions": [...], "tokens": [...],
|
|
566
|
-
"code": { "html": "...", "css": "...", "react": "...", "prompt": "..." }
|
|
567
|
-
},
|
|
568
|
-
{
|
|
569
|
-
"slug": "modal", "name": "Modal", "figmaId": "...",
|
|
570
|
-
"category": "modal", "description": "...",
|
|
571
|
-
"implemented": false,
|
|
572
|
-
"tokens": [{ "property": "background", "token": "--surface-secondary", "value": "#222" }, ...]
|
|
573
|
-
}
|
|
574
|
-
]
|
|
575
|
-
}
|
|
576
|
-
```
|
|
577
|
-
|
|
578
|
-
If `--latest` was passed (or argument is `sync`), first fetch the canonical JSON:
|
|
579
|
-
```
|
|
580
|
-
WebFetch: https://trdr.mrocontent.com.br/components.json
|
|
581
|
-
```
|
|
582
|
-
And overwrite `data/components.json` in the skill directory before continuing.
|
|
583
|
-
|
|
584
|
-
If both the local snapshot and the Hub fail → STOP with:
|
|
585
|
-
> ❌ Could not load TRDR component catalog (local snapshot missing AND Hub unreachable). Aborting. Run `npm run sync` in the trdr-plugins repo to refresh the snapshot.
|
|
586
|
-
|
|
587
|
-
Use the loaded data throughout the rest of the workflow. Track:
|
|
588
|
-
- `implementedSlugs` = list of `c.slug` where `c.implemented === true`
|
|
589
|
-
- `stubSlugs` = list of `c.slug` where `c.implemented !== true`
|
|
590
|
-
|
|
591
|
-
### Step 5 — Present the migration plan and STOP
|
|
592
|
-
|
|
593
|
-
Output the following report and **do not proceed** until the developer explicitly approves.
|
|
594
|
-
|
|
595
|
-
All projects use the same checkpointed 4-sub-phase execution regardless of size. This prevents context overload and hallucinations for any project, small or large.
|
|
596
|
-
|
|
597
|
-
```markdown
|
|
598
|
-
## TRDR Design System — Migration Plan
|
|
599
|
-
|
|
600
|
-
### Project: [framework] | [language] | [styling approach]
|
|
601
|
-
### Catalog: TRDR DS v[version] (generated [generatedAt])
|
|
602
|
-
### Coverage: [implemented]/[total] components implemented
|
|
603
|
-
|
|
604
|
-
---
|
|
605
|
-
|
|
606
|
-
### Conformance score: [X]% compliant
|
|
607
|
-
(Percentage of style files with zero hardcoded violations)
|
|
608
|
-
|
|
609
|
-
---
|
|
610
|
-
|
|
611
|
-
### FILES TO CREATE:
|
|
612
|
-
- [ ] `[detected-styles-dir]/tokens.css` — TRDR CSS custom properties (dark + light mode)
|
|
613
|
-
- [ ] `[detected-styles-dir]/components.css` — TRDR utility classes (.trdr-btn, .trdr-card, etc.)
|
|
614
|
-
- [ ] `CLAUDE.md` (project root) — design system rules for Claude Code
|
|
615
|
-
- [ ] `MISSING_COMPONENTS.md` (only if stubs are referenced) — pending implementations
|
|
616
|
-
|
|
617
|
-
### FILES TO MODIFY:
|
|
618
|
-
- [ ] `[global-css-file]` — add @import for tokens.css and components.css
|
|
619
|
-
[list each file with violations, e.g.:]
|
|
620
|
-
- [ ] `src/components/Button.css` — 3 violations (hardcoded colors: #00A8CC, #0E0E0E, #FFFFFF)
|
|
621
|
-
- [ ] `src/app/globals.css` — 2 violations (font-family: Inter)
|
|
622
|
-
|
|
623
|
-
### VIOLATIONS FOUND:
|
|
624
|
-
| Category | Count | Example |
|
|
625
|
-
|----------|-------|---------|
|
|
626
|
-
| A — Hardcoded colors | N | `color: #00A8CC` in Button.css:14 |
|
|
627
|
-
| B — Hardcoded fonts | N | `font-family: Inter` in globals.css:8 |
|
|
628
|
-
| C — Hardcoded spacing | N | `padding: 16px` in Card.css:22 |
|
|
629
|
-
| D — Primitive token use | N | `var(--color-blue-600)` in Badge.css:31 |
|
|
630
|
-
| E — Missing tokens.css | N | not imported in globals.css |
|
|
631
|
-
| F — Hardcoded rgba | N | `background: rgba(0,0,0,.3)` in card.css:88 |
|
|
632
|
-
| G — Custom gradients | N | `linear-gradient(135deg, #FF6B6B...)` in header:24 |
|
|
633
|
-
| H — Hardcoded font-size | N | `font-size: 22px` in card.css:99 |
|
|
634
|
-
| I — Inline styles | N | `style="color:#00D4FF"` in index.html:312 |
|
|
635
|
-
| J — SVG icons inline | N | `<svg>` in index.html (search, close, play icons) |
|
|
636
|
-
| K — Logo incorrect/missing | N | `<span>TRDR</span>` used as logo in index.html:45 |
|
|
637
|
-
|
|
638
|
-
### TRDR COMPONENTS — IMPLEMENTATION PLAN:
|
|
639
|
-
(Candidatos detectados no Step 3.5 — com classificação de complexidade)
|
|
640
|
-
|
|
641
|
-
#### Simple swaps (substituição completa pelo componente DS):
|
|
642
|
-
| Componente | Variante DS | Arquivo | Conteúdo atual |
|
|
643
|
-
|------------|------------|---------|----------------|
|
|
644
|
-
[For each candidate where classification === 'simple':]
|
|
645
|
-
| [c.name] | [suggestedDsVariant] | [file:line] | "[existingContent]" |
|
|
646
|
-
|
|
647
|
-
#### Complex-preservable (estrutura DS + lógica preservada):
|
|
648
|
-
| Componente | Arquivo | Handlers/Props preservados |
|
|
649
|
-
|------------|---------|----------------------------|
|
|
650
|
-
[For each candidate where classification === 'complex-preservable':]
|
|
651
|
-
| [c.name] | [file:line] | [existingHandlers], [existingProps] |
|
|
652
|
-
|
|
653
|
-
#### Manual review (complexidade alta — sem modificação automática):
|
|
654
|
-
| Componente | Arquivo | Motivo |
|
|
655
|
-
|------------|---------|--------|
|
|
656
|
-
[For each candidate where classification === 'complex-manual':]
|
|
657
|
-
| [c.name] | [file:line] | [reason] |
|
|
658
|
-
|
|
659
|
-
> **Simple:** substituição completa, conteúdo adaptado do projeto.
|
|
660
|
-
> **Complex-preservable:** estrutura DS aplicada, toda lógica (handlers, bindings, conditionals) preservada.
|
|
661
|
-
> **Manual:** flagged em DS_MIGRATION.md para revisão pelo desenvolvedor.
|
|
662
|
-
|
|
663
|
-
#### Stubs e catálogo:
|
|
664
|
-
| Componente | Status no catálogo | Arquivos detectados |
|
|
665
|
-
|------------|--------------------|---------------------|
|
|
666
|
-
[For each entry in replacementCandidates[], look up the slug in the loaded catalog:]
|
|
667
|
-
[If c.implemented === true:]
|
|
668
|
-
| [c.name] | ✅ implementado | [list of file:line from Step 3.5] |
|
|
669
|
-
[If c.implemented === false:]
|
|
670
|
-
| [c.name] | ⚠️ stub (figmaId [c.figmaId]) | [list of file:line] — receberá banner comment |
|
|
671
|
-
[If replacementCandidates is empty:]
|
|
672
|
-
| — | Nenhum candidato detectado | — |
|
|
673
|
-
|
|
674
|
-
> **Implementados:** o CSS estará em `components.css` após a Fase 2, **E** as classes DS serão aplicadas diretamente nos elementos HTML/JSX/Vue durante o Step 6 — não é necessária nenhuma ação manual.
|
|
675
|
-
> **Stubs:** receberão banner comment com tokens recomendados + entrada em `MISSING_COMPONENTS.md`.
|
|
676
|
-
|
|
677
|
-
[If `stylingMode === 'mui'`:]
|
|
678
|
-
|
|
679
|
-
### MUI THEME INTEGRATION PLAN:
|
|
680
|
-
| Area | Current state | Action |
|
|
681
|
-
|------|--------------|--------|
|
|
682
|
-
| palette | [N] hardcoded hex values | Replace with `var(--token)` references |
|
|
683
|
-
| typography | [N] hardcoded font values | Map to DS font tokens |
|
|
684
|
-
| shape | borderRadius: [value] | Map to DS radius token |
|
|
685
|
-
| components | [N] MUI components detected | Generate/update styleOverrides with DS tokens |
|
|
686
|
-
| sx props | [N] files with hardcoded sx values | Migrate to token references |
|
|
687
|
-
| styled() | [N] styled(MuiComponent) calls | Migrate to token references |
|
|
688
|
-
|
|
689
|
-
**Theme file:** `[themeFilePath]`
|
|
690
|
-
**MUI version:** [muiVersion]
|
|
691
|
-
**CSS Variables mode:** [yes/no — if no, will be recommended for MUI v6+]
|
|
692
|
-
**ThemeProvider:** [found at file:line / not found — will need manual setup]
|
|
693
|
-
|
|
694
|
-
> **Note:** MUI projects receive DS tokens via the theme object. Sub-fase A creates `tokens.css` AND updates the MUI theme to reference those tokens via `var()`. Sub-fase C generates `styleOverrides` for each detected MUI component instead of swapping HTML tags.
|
|
695
|
-
|
|
696
|
-
### SCOPE ESTIMATE: [Small / Medium / Large]
|
|
697
|
-
Small = <10 violations | Medium = 10–50 | Large = 50+
|
|
698
|
-
|
|
699
|
-
### ⚙️ EXECUTION MODE
|
|
700
|
-
Phase 2 runs in **4 sub-phases with checkpoints** — always, regardless of project size.
|
|
701
|
-
Sub-fase B (violations) processes **5 files/batch** to prevent context overload.
|
|
702
|
-
|
|
703
|
-
~[ceil(total_files_with_violations/5)] violation batches estimated.
|
|
704
|
-
Progress saved to `DS_PROGRESS.md` — resumable anytime with `/trdr-ds resume`.
|
|
705
|
-
|
|
706
|
-
To change batch size: reply with `"Apply, batch 10"` or `"Apply, batch 3"`.
|
|
707
|
-
|
|
708
|
-
### LOGOS:
|
|
709
|
-
[If logoAudit.correct.length > 0:]
|
|
710
|
-
| ✅ [file] | Official TRDR logo — no action needed |
|
|
711
|
-
|
|
712
|
-
[If logoAudit.wrong.length > 0:]
|
|
713
|
-
| ❌ [file] | Wrong logo — will be replaced with the official TRDR logo |
|
|
714
|
-
|
|
715
|
-
[If logoAudit.unknown.length > 0:]
|
|
716
|
-
| ⚠️ [file] | Could not verify — manual check recommended |
|
|
717
|
-
|
|
718
|
-
[If no logo files found AND public/ exists:]
|
|
719
|
-
> ℹ️ No logo file detected. The official TRDR logo will be copied to `public/logo-trdr.svg`.
|
|
720
|
-
|
|
721
|
-
[If no logo files found AND no public/ exists:]
|
|
722
|
-
> ℹ️ No logo file detected. Specify a path to add the official TRDR logo, or skip.
|
|
723
|
-
|
|
724
|
-
### WHAT WILL NOT BE TOUCHED:
|
|
725
|
-
- Correct TRDR logo files (already match the official reference)
|
|
726
|
-
- Images, fonts, non-SVG assets
|
|
727
|
-
- node_modules/, .next/, dist/, build/, out/
|
|
728
|
-
- Third-party library files
|
|
729
|
-
- Any file you explicitly exclude
|
|
730
|
-
|
|
731
|
-
---
|
|
732
|
-
|
|
733
|
-
**Reply with one of:**
|
|
734
|
-
- `"Apply"` or `"Executar"` — proceed with everything above
|
|
735
|
-
- `"Apply, batch [N]"` — proceed with custom violation batch size (default: 5)
|
|
736
|
-
- `"Apply, skip [file or directory]"` — proceed but exclude specific paths
|
|
737
|
-
- `"Only tokens"` — only create tokens.css, components.css, and CLAUDE.md (no violation fixes)
|
|
738
|
-
- `"Change [detail]"` — adjust a specific part of the plan before executing
|
|
739
|
-
- `"Sync first"` — pull the latest catalog from the Hub before applying
|
|
740
|
-
```
|
|
741
|
-
|
|
742
|
-
### Step 5.5 — Write DS_ANALYSIS.md (MANDATORY before stopping)
|
|
743
|
-
|
|
744
|
-
Before presenting the plan to the developer and before any STOP, write `DS_ANALYSIS.md` to the **project root** with the complete analysis captured in Steps 1–4. This file is the context anchor for all Phase 2 sub-phases — they will read it instead of relying on conversation history.
|
|
745
|
-
|
|
746
|
-
```markdown
|
|
747
|
-
# TRDR DS — Analysis
|
|
748
|
-
Generated: [ISO datetime]
|
|
749
|
-
Skill version: [X.Y.Z]
|
|
750
|
-
|
|
751
|
-
## Project
|
|
752
|
-
Framework: [next.js|react|vue|html]
|
|
753
|
-
Language: [ts|js]
|
|
754
|
-
Styling: [css-modules|tailwind|plain-css|css-in-js|mui]
|
|
755
|
-
Global CSS file: [path]
|
|
756
|
-
Styles dir: [detected-styles-dir]
|
|
757
|
-
[If stylingMode === 'mui':]
|
|
758
|
-
MUI version: [muiVersion]
|
|
759
|
-
Theme file: [themeFilePath]
|
|
760
|
-
Has ThemeProvider: [yes/no]
|
|
761
|
-
MUI CSS Variables mode: [yes/no]
|
|
762
|
-
Files with sx props: [count]
|
|
763
|
-
Files with styled(Mui*): [count]
|
|
764
|
-
|
|
765
|
-
## Violations Summary
|
|
766
|
-
Total violations: [total_violations]
|
|
767
|
-
Total files with violations: [total_files_with_violations]
|
|
768
|
-
|
|
769
|
-
### By Category
|
|
770
|
-
| Cat | Type | Count | Files |
|
|
771
|
-
|-----|------|-------|-------|
|
|
772
|
-
| A | Hardcoded colors | N | file1.css, file2.jsx |
|
|
773
|
-
| B | Hardcoded font-family | N | ... |
|
|
774
|
-
| C | Hardcoded px spacing | N | ... |
|
|
775
|
-
| D | Primitive token use | N | ... |
|
|
776
|
-
| E | Missing tokens.css | N | ... |
|
|
777
|
-
| F | Hardcoded rgba | N | ... |
|
|
778
|
-
| G | Custom gradients | N | ... |
|
|
779
|
-
| H | Hardcoded font-size | N | ... |
|
|
780
|
-
| I | Inline styles | N | ... |
|
|
781
|
-
| J | SVG icons inline | N | ... |
|
|
782
|
-
| K | Logo incorrect/missing | N | ... |
|
|
783
|
-
[If stylingMode === 'mui':]
|
|
784
|
-
| L | MUI theme hardcoded values | N | theme.ts |
|
|
785
|
-
| M | MUI sx prop hardcoded values | N | Component1.tsx, Component2.tsx |
|
|
786
|
-
| N | styled(MuiComponent) hardcoded values | N | StyledButton.tsx |
|
|
787
|
-
|
|
788
|
-
### By File
|
|
789
|
-
[For each file with violations:]
|
|
790
|
-
#### [file path]
|
|
791
|
-
- A: [value] (line [N]), [value] (line [N])
|
|
792
|
-
- C: [value] (line [N])
|
|
793
|
-
- I: [value] (line [N])
|
|
794
|
-
[list all violations with line numbers]
|
|
795
|
-
|
|
796
|
-
## Component Replacement Candidates
|
|
797
|
-
|
|
798
|
-
### Simple swaps (full DS component replacement)
|
|
799
|
-
[For each candidate where classification === 'simple':]
|
|
800
|
-
| Component | DS Variant | File | Existing Content |
|
|
801
|
-
|-----------|-----------|------|------------------|
|
|
802
|
-
| [c.name] | [suggestedDsVariant] | [file:line] | "[existingContent]" |
|
|
803
|
-
|
|
804
|
-
### Complex-preservable (DS structure + preserved logic)
|
|
805
|
-
[For each candidate where classification === 'complex-preservable':]
|
|
806
|
-
| Component | File | Handlers/Props Preserved |
|
|
807
|
-
|-----------|------|--------------------------|
|
|
808
|
-
| [c.name] | [file:line] | [existingHandlers], [existingProps] |
|
|
809
|
-
|
|
810
|
-
### Manual review required
|
|
811
|
-
[For each candidate where classification === 'complex-manual':]
|
|
812
|
-
| Component | File | Reason |
|
|
813
|
-
|-----------|------|--------|
|
|
814
|
-
| [c.name] | [file:line] | [brief description of why it's complex] |
|
|
815
|
-
|
|
816
|
-
### Stubs (not yet implemented in DS)
|
|
817
|
-
[For each candidate where c.implemented === false:]
|
|
818
|
-
- [slug]: [file:line] — ⚠️ stub (figmaId: [c.figmaId])
|
|
819
|
-
|
|
820
|
-
### Dependency Graph
|
|
821
|
-
[For each candidate with non-empty dependencies in components.json:]
|
|
822
|
-
| Compound Component | Dependencies (install first) |
|
|
823
|
-
|--------------------|----------------------------|
|
|
824
|
-
| [c.name] | [c.dependencies.join(', ')] |
|
|
825
|
-
|
|
826
|
-
[If no compound components among candidates:]
|
|
827
|
-
> All candidates are atomic — no dependency ordering needed.
|
|
828
|
-
|
|
829
|
-
## Logo Audit
|
|
830
|
-
[For each file in logoAudit.correct:] - [path] — ✅ CORRECT
|
|
831
|
-
[For each file in logoAudit.wrong:] - [path] — ❌ WRONG (will be replaced)
|
|
832
|
-
[For each file in logoAudit.unknown:] - [path] — ⚠️ UNKNOWN
|
|
833
|
-
|
|
834
|
-
## Execution Plan
|
|
835
|
-
Batch size: [N] (default 5)
|
|
836
|
-
[Group files by folder, max batch_size files per batch:]
|
|
837
|
-
### Batch 1 — [folder/] ([N] files)
|
|
838
|
-
- [file1]
|
|
839
|
-
- [file2]
|
|
840
|
-
### Batch 2 — [folder/] ([N] files)
|
|
841
|
-
- ...
|
|
842
|
-
```
|
|
843
|
-
|
|
844
|
-
### Step 5.6 — Generate SPRINT_PLAN.md
|
|
845
|
-
|
|
846
|
-
After writing `DS_ANALYSIS.md`, generate `SPRINT_PLAN.md` at the project root. This file breaks the entire migration into **self-contained sprints** — each sprint can be executed in an independent conversation with a clean context window.
|
|
847
|
-
|
|
848
|
-
**Sprint sizing rules:**
|
|
849
|
-
- Each sprint should process at most **15 files** (keeps context comfortable even for complex files)
|
|
850
|
-
- Group files by **folder** (natural boundary — violations in the same folder share CSS patterns)
|
|
851
|
-
- If a folder has >15 files, split into sub-sprints (e.g., `Sprint 3a`, `Sprint 3b`)
|
|
852
|
-
- Foundation, Components, and Final are each their own sprint (regardless of file count)
|
|
853
|
-
|
|
854
|
-
**Generate the plan:**
|
|
855
|
-
|
|
856
|
-
```markdown
|
|
857
|
-
# TRDR DS — Sprint Plan
|
|
858
|
-
Generated: [ISO datetime]
|
|
859
|
-
Project: [project name]
|
|
860
|
-
Total sprints: [N]
|
|
861
|
-
Estimated context windows: [N] (one per sprint + one for this analysis)
|
|
862
|
-
|
|
863
|
-
> Cada sprint é independente. Entre sprints, você pode limpar o contexto (`/clear`) ou iniciar uma nova conversa.
|
|
864
|
-
> Para continuar: `/trdr-ds resume`
|
|
865
|
-
|
|
866
|
-
---
|
|
867
|
-
|
|
868
|
-
## Sprint 1 — Foundation
|
|
869
|
-
[If stylingMode !== 'mui':]
|
|
870
|
-
**Scope:** Create tokens.css, components.css, CLAUDE.md, @import in global CSS
|
|
871
|
-
[If stylingMode === 'mui':]
|
|
872
|
-
**Scope:** Create tokens.css, components.css, CLAUDE.md, @import in global CSS, AND generate/update MUI theme with DS token references (palette, typography, shape)
|
|
873
|
-
**Sub-fase:** A
|
|
874
|
-
**Files to create:** 3 (tokens.css, components.css, CLAUDE.md)
|
|
875
|
-
[If stylingMode === 'mui':]
|
|
876
|
-
**Files to modify:** 2 (global CSS, [themeFilePath])
|
|
877
|
-
[else:]
|
|
878
|
-
**Files to modify:** 1 (global CSS)
|
|
879
|
-
**Status:** PENDING
|
|
880
|
-
|
|
881
|
-
---
|
|
882
|
-
|
|
883
|
-
## Sprint 2 — Violations: [first-folder/]
|
|
884
|
-
**Scope:** Fix [N] violations in [M] files
|
|
885
|
-
**Sub-fase:** B
|
|
886
|
-
**Files:** [list each file path]
|
|
887
|
-
**Violation count:** [N] (A:[n], B:[n], C:[n], ...)
|
|
888
|
-
**Status:** PENDING
|
|
889
|
-
|
|
890
|
-
---
|
|
891
|
-
|
|
892
|
-
## Sprint 3 — Violations: [second-folder/]
|
|
893
|
-
**Scope:** Fix [N] violations in [M] files
|
|
894
|
-
**Sub-fase:** B
|
|
895
|
-
**Files:** [list each file path]
|
|
896
|
-
**Violation count:** [N]
|
|
897
|
-
**Status:** PENDING
|
|
898
|
-
|
|
899
|
-
---
|
|
900
|
-
|
|
901
|
-
[... repeat for each folder/batch ...]
|
|
902
|
-
|
|
903
|
-
---
|
|
904
|
-
|
|
905
|
-
## Sprint [N-1] — Components
|
|
906
|
-
[If stylingMode !== 'mui':]
|
|
907
|
-
**Scope:** Implement DS components ([S] simple, [P] complex-preservable, [M] manual review)
|
|
908
|
-
**Candidates:** [total]
|
|
909
|
-
**Install order:** [topological order from dependency graph — atomics first, then compounds]
|
|
910
|
-
[If stylingMode === 'mui':]
|
|
911
|
-
**Scope:** Generate MUI theme component styleOverrides for [N] detected MUI components, migrate [M] sx prop violations
|
|
912
|
-
**Candidates:** [total MUI components]
|
|
913
|
-
**Sub-fase:** C
|
|
914
|
-
**Status:** PENDING
|
|
915
|
-
|
|
916
|
-
---
|
|
917
|
-
|
|
918
|
-
## Sprint [N] — Final
|
|
919
|
-
**Scope:** Replace logos, replace SVG icons with Material Icons (size-preserved), generate DS_MIGRATION.md
|
|
920
|
-
**Sub-fase:** D
|
|
921
|
-
**Status:** PENDING
|
|
922
|
-
```
|
|
923
|
-
|
|
924
|
-
**Sprint naming convention:**
|
|
925
|
-
- Foundation sprints: `Sprint 1 — Foundation`
|
|
926
|
-
- Violation sprints: `Sprint N — Violations: [folder/]`
|
|
927
|
-
- If folder split: `Sprint Na — Violations: [folder/] (part 1 of 2)`
|
|
928
|
-
- Component sprint: `Sprint N — Components`
|
|
929
|
-
- Final sprint: `Sprint N — Final`
|
|
930
|
-
|
|
931
|
-
After writing `SPRINT_PLAN.md`, update the output to include the sprint summary:
|
|
932
|
-
|
|
933
|
-
```
|
|
934
|
-
✅ DS_ANALYSIS.md e SPRINT_PLAN.md salvos.
|
|
935
|
-
|
|
936
|
-
📋 Sprint Plan: [N] sprints planejados
|
|
937
|
-
Sprint 1: Foundation (4 arquivos)
|
|
938
|
-
Sprint 2-[M]: Violations ([total_files] arquivos em [folders] pastas)
|
|
939
|
-
Sprint [M+1]: Components ([candidates] candidatos)
|
|
940
|
-
Sprint [N]: Final (logos + ícones + DS_MIGRATION.md)
|
|
941
|
-
|
|
942
|
-
Cada sprint é independente — entre sprints, limpe o contexto com /clear.
|
|
943
|
-
Para continuar de qualquer ponto: /trdr-ds resume
|
|
944
|
-
|
|
945
|
-
Responda 'Apply' para iniciar o Sprint 1.
|
|
946
|
-
```
|
|
947
|
-
|
|
948
|
-
**STOP HERE. Wait for explicit developer approval before Phase 2.**
|
|
949
|
-
|
|
950
|
-
---
|
|
951
|
-
|
|
952
|
-
## PHASE 2: EXECUTION (only after explicit approval)
|
|
953
|
-
|
|
954
|
-
Parse the developer's reply:
|
|
955
|
-
- Extract batch size override from `"Apply, batch N"` → use N; otherwise default to **5**.
|
|
956
|
-
- Extract skip paths from `"Apply, skip [path]"` → exclude those from violation processing.
|
|
957
|
-
- `"Only tokens"` → skip Sub-fases B and C (no violation fixes, no component banners).
|
|
958
|
-
|
|
959
|
-
### Sprint execution model
|
|
960
|
-
|
|
961
|
-
Each sprint is a **self-contained unit of work** designed to fit comfortably in a single context window. The developer can `/clear` or start a new conversation between sprints and resume with `/trdr-ds resume`.
|
|
962
|
-
|
|
963
|
-
**Context rule (critical):** At the start of EVERY sprint, before doing anything else:
|
|
964
|
-
1. Read `SPRINT_PLAN.md` from the project root — find the current sprint (first with `Status: PENDING` or `Status: IN_PROGRESS`)
|
|
965
|
-
2. Read `DS_ANALYSIS.md` from the project root — but ONLY the sections relevant to the current sprint's scope (e.g., for a violation sprint, only read the `§ By File` entries for the files listed in that sprint)
|
|
966
|
-
3. Read `DS_PROGRESS.md` from the project root — this is the canonical source of progress state
|
|
967
|
-
|
|
968
|
-
**Never read the entire DS_ANALYSIS.md at once for large projects.** Only read the sections needed for the current sprint. This prevents context overflow.
|
|
969
|
-
|
|
970
|
-
Never rely on conversation memory for violation counts, file paths, batch assignments, or framework detection. Always re-read from files.
|
|
971
|
-
|
|
972
|
-
**Sprint lifecycle:**
|
|
973
|
-
1. Read state files (SPRINT_PLAN.md + relevant sections of DS_ANALYSIS.md + DS_PROGRESS.md)
|
|
974
|
-
2. Update SPRINT_PLAN.md: set current sprint `Status: IN_PROGRESS`
|
|
975
|
-
3. Execute the sprint's scope (Foundation / Violations for specific files / Components / Final)
|
|
976
|
-
4. Update DS_PROGRESS.md with results
|
|
977
|
-
5. Update SPRINT_PLAN.md: set current sprint `Status: ✅ COMPLETE`
|
|
978
|
-
6. Output sprint summary with next sprint info
|
|
979
|
-
7. **STOP** — wait for developer to continue or `/clear` + `/trdr-ds resume`
|
|
980
|
-
|
|
981
|
-
**End-of-sprint output (MANDATORY after every sprint):**
|
|
982
|
-
```
|
|
983
|
-
✅ Sprint [N] completo — [sprint name]
|
|
984
|
-
[Brief summary of what was done: files modified, violations fixed, components applied, etc.]
|
|
985
|
-
|
|
986
|
-
📋 Progresso: [done]/[total] sprints ([percentage]%)
|
|
987
|
-
Próximo: Sprint [N+1] — [next sprint name]
|
|
988
|
-
|
|
989
|
-
→ Você pode limpar o contexto agora: /clear
|
|
990
|
-
→ Para continuar: /trdr-ds resume
|
|
991
|
-
→ Para ver status completo: /trdr-ds status
|
|
992
|
-
```
|
|
993
|
-
|
|
994
|
-
Report progress after each major step within a sprint.
|
|
995
|
-
|
|
996
|
-
### Step 0 — Initialize checkpoint
|
|
997
|
-
|
|
998
|
-
**Create `DS_PROGRESS.md` at the project root** (always — no size threshold):
|
|
999
|
-
|
|
1000
|
-
```markdown
|
|
1001
|
-
# TRDR DS Migration — Progress
|
|
1002
|
-
Started: [ISO datetime]
|
|
1003
|
-
Project: [project name from package.json]
|
|
1004
|
-
Batch size: [N]
|
|
1005
|
-
Status: IN_PROGRESS
|
|
1006
|
-
Backup branch: [branch-name or NONE]
|
|
1007
|
-
Original branch: [branch-name]
|
|
1008
|
-
Sprint plan: SPRINT_PLAN.md
|
|
1009
|
-
Current sprint: 1
|
|
1010
|
-
|
|
1011
|
-
## Sub-fase A: Foundation — PENDING
|
|
1012
|
-
- [ ] tokens.css
|
|
1013
|
-
- [ ] components.css
|
|
1014
|
-
- [ ] CLAUDE.md
|
|
1015
|
-
- [ ] @import no CSS global
|
|
1016
|
-
|
|
1017
|
-
## Sub-fase B: Violations — PENDING
|
|
1018
|
-
Total de arquivos com violações: [total_files_with_violations]
|
|
1019
|
-
Total de violações: [total_violations]
|
|
1020
|
-
Total de lotes: [N]
|
|
1021
|
-
|
|
1022
|
-
[For each batch from DS_ANALYSIS.md § Execution Plan:]
|
|
1023
|
-
### Lote 1 — [folder/] ([N] arquivos) — PENDING
|
|
1024
|
-
### Lote 2 — [folder/] ([N] arquivos) — PENDING
|
|
1025
|
-
...
|
|
1026
|
-
### Lote [n] — raiz ([N] arquivos) — PENDING
|
|
1027
|
-
|
|
1028
|
-
## Sub-fase C: Components — PENDING
|
|
1029
|
-
Install order: [topological — atomics first, then compounds by dependency]
|
|
1030
|
-
[list component replacement candidates from DS_ANALYSIS.md]
|
|
1031
|
-
|
|
1032
|
-
## Sub-fase D: Final — PENDING
|
|
1033
|
-
- [ ] logos incorretos substituídos
|
|
1034
|
-
- [ ] DS_MIGRATION.md gerado
|
|
1035
|
-
|
|
1036
|
-
## Padrões Sem Token (revisão manual)
|
|
1037
|
-
[empty — filled during execution]
|
|
1038
|
-
|
|
1039
|
-
## Execution Log
|
|
1040
|
-
[Each action appends a row here — this is the canonical audit trail for the report]
|
|
1041
|
-
```
|
|
1042
|
-
|
|
1043
|
-
**Execution Log rule (applies to ALL sub-phases):**
|
|
1044
|
-
|
|
1045
|
-
After every file creation or modification by the skill, append a row to the `## Execution Log` section of `DS_PROGRESS.md`:
|
|
1046
|
-
|
|
1047
|
-
```
|
|
1048
|
-
| [ISO datetime] | [sub-phase] | [action] | [file path] | [details] |
|
|
1049
|
-
```
|
|
1050
|
-
|
|
1051
|
-
Actions: `CREATE`, `MODIFY`, `SKIP`, `FAIL`
|
|
1052
|
-
|
|
1053
|
-
Examples:
|
|
1054
|
-
```
|
|
1055
|
-
| 2026-05-14T10:23:01 | A | CREATE | src/styles/tokens.css | 292 CSS variables (dark+light) |
|
|
1056
|
-
| 2026-05-14T10:23:02 | A | CREATE | src/styles/components.css | 25 component classes + typography |
|
|
1057
|
-
| 2026-05-14T10:23:03 | A | MODIFY | src/styles/globals.css | @import tokens.css + components.css |
|
|
1058
|
-
| 2026-05-14T10:23:04 | A | CREATE | CLAUDE.md | DS context for Claude Code |
|
|
1059
|
-
| 2026-05-14T10:25:11 | B | MODIFY | src/components/Header.tsx | 5 violations fixed: A(3), C(2) |
|
|
1060
|
-
| 2026-05-14T10:25:12 | B | MODIFY | src/components/Card.css | 3 violations fixed: A(1), B(2) |
|
|
1061
|
-
| 2026-05-14T10:25:13 | B | SKIP | src/legacy/old.css | 0 violations — already compliant |
|
|
1062
|
-
| 2026-05-14T10:30:01 | C | MODIFY | src/components/Button.tsx | simple swap → .trdr-btn |
|
|
1063
|
-
| 2026-05-14T10:30:02 | C | FAIL | src/components/Modal.tsx | stub — not yet implemented in DS |
|
|
1064
|
-
| 2026-05-14T10:35:01 | D | MODIFY | public/logo.svg | replaced with logo-trdr.svg |
|
|
1065
|
-
| 2026-05-14T10:35:02 | D | CREATE | DS_MIGRATION.md | manual checklist generated |
|
|
1066
|
-
```
|
|
1067
|
-
|
|
1068
|
-
This log is cumulative — never clear it. Each `/trdr-ds resume` session appends to the existing log.
|
|
1069
|
-
|
|
1070
|
-
### Step 0.5 — Git backup (safety net)
|
|
1071
|
-
|
|
1072
|
-
Before modifying any project file, create a git backup so the entire migration can be rolled back.
|
|
1073
|
-
|
|
1074
|
-
**Step 0.5a — Check git status:**
|
|
1075
|
-
|
|
1076
|
-
Run via Bash:
|
|
1077
|
-
```bash
|
|
1078
|
-
git rev-parse --is-inside-work-tree 2>/dev/null
|
|
1079
|
-
```
|
|
1080
|
-
|
|
1081
|
-
**If NOT a git repo:**
|
|
1082
|
-
```
|
|
1083
|
-
⚠️ Este projeto não tem repositório git. Um backup automático não é possível sem git.
|
|
1084
|
-
|
|
1085
|
-
Responda:
|
|
1086
|
-
- "git init" — inicializar repositório git e criar backup antes de continuar
|
|
1087
|
-
- "continuar sem backup" — prosseguir sem safety net (irreversível)
|
|
1088
|
-
```
|
|
1089
|
-
**STOP. Wait for reply.**
|
|
1090
|
-
|
|
1091
|
-
If reply is `"git init"`:
|
|
1092
|
-
1. Run: `git init`
|
|
1093
|
-
2. Run: `git add -A && git commit -m "Initial commit (before TRDR DS migration)"`
|
|
1094
|
-
3. Continue to Step 0.5b.
|
|
1095
|
-
|
|
1096
|
-
If reply is `"continuar sem backup"`:
|
|
1097
|
-
- Update `DS_PROGRESS.md`: set `Backup branch: NONE (user opted out)`
|
|
1098
|
-
- Skip to Sub-fase A.
|
|
1099
|
-
|
|
1100
|
-
**If IS a git repo:** Continue to Step 0.5b.
|
|
1101
|
-
|
|
1102
|
-
**Step 0.5b — Check for existing backup branch:**
|
|
1103
|
-
|
|
1104
|
-
Run via Bash:
|
|
1105
|
-
```bash
|
|
1106
|
-
git branch --list "trdr-ds/backup-*"
|
|
1107
|
-
```
|
|
1108
|
-
|
|
1109
|
-
If one or more `trdr-ds/backup-*` branches exist:
|
|
1110
|
-
```
|
|
1111
|
-
⚠️ Backup branch(es) encontrado(s) de execução anterior:
|
|
1112
|
-
[list each branch name]
|
|
1113
|
-
|
|
1114
|
-
Responda:
|
|
1115
|
-
- "manter" — criar novo backup com timestamp diferente (mantém os anteriores)
|
|
1116
|
-
- "substituir" — apagar o backup anterior e criar um novo
|
|
1117
|
-
```
|
|
1118
|
-
**STOP. Wait for reply.**
|
|
1119
|
-
|
|
1120
|
-
If `"substituir"`: delete all existing `trdr-ds/backup-*` branches via `git branch -D [name]` for each.
|
|
1121
|
-
|
|
1122
|
-
**Step 0.5c — Create the backup branch:**
|
|
1123
|
-
|
|
1124
|
-
1. Record the current branch name:
|
|
1125
|
-
```bash
|
|
1126
|
-
git branch --show-current
|
|
1127
|
-
```
|
|
1128
|
-
Save as `originalBranch`. If in detached HEAD state (empty output), save the commit hash via `git rev-parse HEAD` instead.
|
|
1129
|
-
|
|
1130
|
-
2. Generate timestamp branch name: `trdr-ds/backup-{YYYY-MM-DD-HHmmss}` (use current local time).
|
|
1131
|
-
|
|
1132
|
-
3. Check for uncommitted changes:
|
|
1133
|
-
```bash
|
|
1134
|
-
git status --porcelain
|
|
1135
|
-
```
|
|
1136
|
-
If output is non-empty (uncommitted changes exist):
|
|
1137
|
-
```bash
|
|
1138
|
-
git stash push -m "trdr-ds-pre-migration-stash"
|
|
1139
|
-
```
|
|
1140
|
-
|
|
1141
|
-
4. Create the backup branch from current HEAD:
|
|
1142
|
-
```bash
|
|
1143
|
-
git branch trdr-ds/backup-{timestamp}
|
|
1144
|
-
```
|
|
1145
|
-
|
|
1146
|
-
5. If stash was created in step 3, pop it back:
|
|
1147
|
-
```bash
|
|
1148
|
-
git stash pop
|
|
1149
|
-
```
|
|
1150
|
-
|
|
1151
|
-
6. Update `DS_PROGRESS.md`:
|
|
1152
|
-
```
|
|
1153
|
-
Backup branch: trdr-ds/backup-{timestamp}
|
|
1154
|
-
Original branch: {originalBranch}
|
|
1155
|
-
```
|
|
1156
|
-
|
|
1157
|
-
7. Output:
|
|
1158
|
-
```
|
|
1159
|
-
✅ Backup criado: branch `trdr-ds/backup-{timestamp}`
|
|
1160
|
-
Para desfazer toda a migração a qualquer momento: `/trdr-ds rollback`
|
|
1161
|
-
```
|
|
1162
|
-
|
|
1163
|
-
---
|
|
1164
|
-
|
|
1165
|
-
## Sub-fase A: Foundation
|
|
1166
|
-
|
|
1167
|
-
> **Before starting:** Read `DS_ANALYSIS.md` and `DS_PROGRESS.md` from the project root.
|
|
1168
|
-
|
|
1169
|
-
Update `DS_PROGRESS.md`: set `Sub-fase A: Foundation — IN_PROGRESS`.
|
|
1170
|
-
|
|
1171
|
-
### Step 1 — Create tokens.css
|
|
1172
|
-
|
|
1173
|
-
Copy the local snapshot verbatim:
|
|
1174
|
-
|
|
1175
|
-
```
|
|
1176
|
-
Read: <skill-dir>/references/tokens.css
|
|
1177
|
-
Write: <project>/<detected-styles-dir>/tokens.css
|
|
1178
|
-
```
|
|
1179
|
-
|
|
1180
|
-
Do NOT regenerate the file. Do NOT inline tokens from any other source. The snapshot is authoritative.
|
|
1181
|
-
|
|
1182
|
-
If `references/tokens.css` is missing in the skill directory:
|
|
1183
|
-
1. Try `WebFetch: https://trdr.mrocontent.com.br/tokens.css`, save it to the skill dir, then proceed.
|
|
1184
|
-
2. If the Hub is also unreachable → STOP with error message asking the maintainer to run `npm run sync`.
|
|
1185
|
-
|
|
1186
|
-
Update `DS_PROGRESS.md`:
|
|
1187
|
-
```
|
|
1188
|
-
- [x] tokens.css — [path]/tokens.css ([ISO datetime])
|
|
1189
|
-
```
|
|
1190
|
-
|
|
1191
|
-
### Step 2 — Create components.css
|
|
1192
|
-
|
|
1193
|
-
Build `components.css` by concatenating the `.code.css` block of every implemented component plus the typography utility classes.
|
|
1194
|
-
|
|
1195
|
-
```
|
|
1196
|
-
For each c in components where c.implemented === true:
|
|
1197
|
-
append c.code.css to components.css (with a "/* === <c.name> === */" header)
|
|
1198
|
-
```
|
|
1199
|
-
|
|
1200
|
-
After all component CSS blocks, append the text style utility classes:
|
|
1201
|
-
|
|
1202
|
-
```css
|
|
1203
|
-
/* ==========================================================================
|
|
1204
|
-
TRDR Design System — Text Style Utility Classes
|
|
1205
|
-
========================================================================== */
|
|
1206
|
-
|
|
1207
|
-
/* Headings — var(--font-primary) = JetBrains Mono */
|
|
1208
|
-
.trdr-h1 { font-family: var(--font-primary); font-size: 80px; font-weight: 500; line-height: 1.1; }
|
|
1209
|
-
.trdr-h2 { font-family: var(--font-primary); font-size: 56px; font-weight: 500; line-height: 1.1; }
|
|
1210
|
-
.trdr-h3 { font-family: var(--font-primary); font-size: 46px; font-weight: 700; line-height: 1.15; }
|
|
1211
|
-
.trdr-h4 { font-family: var(--font-primary); font-size: 38px; font-weight: 500; line-height: 1.15; }
|
|
1212
|
-
.trdr-h5 { font-family: var(--font-primary); font-size: 32px; font-weight: 500; line-height: 1.2; }
|
|
1213
|
-
.trdr-h6 { font-family: var(--font-primary); font-size: 26px; font-weight: 500; line-height: 1.2; }
|
|
1214
|
-
.trdr-h7 { font-family: var(--font-secondary); font-size: 22px; font-weight: 600; line-height: 1.3; }
|
|
1215
|
-
|
|
1216
|
-
/* Body — var(--font-secondary) = Inter */
|
|
1217
|
-
.trdr-body-b1 { font-family: var(--font-secondary); font-size: 18px; font-weight: 400; line-height: 1.6; }
|
|
1218
|
-
.trdr-body-b2 { font-family: var(--font-secondary); font-size: 16px; font-weight: 500; line-height: 1.5; }
|
|
1219
|
-
.trdr-body-b3 { font-family: var(--font-secondary); font-size: 14px; font-weight: 400; line-height: 1.5; }
|
|
1220
|
-
.trdr-body-b4 { font-family: var(--font-secondary); font-size: 12px; font-weight: 500; line-height: 1.4; letter-spacing: 0.2px; }
|
|
1221
|
-
.trdr-body-b5 { font-family: var(--font-secondary); font-size: 10px; font-weight: 400; line-height: 1.4; }
|
|
1222
|
-
.trdr-body-aux { font-family: var(--font-secondary); font-size: 12px; font-weight: 400; line-height: 1.4; letter-spacing: 0.24px; }
|
|
1223
|
-
|
|
1224
|
-
/* Labels — var(--font-secondary) = Inter */
|
|
1225
|
-
.trdr-label-lg { font-family: var(--font-secondary); font-size: 16px; font-weight: 600; line-height: 1.4; }
|
|
1226
|
-
.trdr-label-l2 { font-family: var(--font-secondary); font-size: 16px; font-weight: 600; line-height: 1.4; }
|
|
1227
|
-
.trdr-label-l3 { font-family: var(--font-secondary); font-size: 14px; font-weight: 600; line-height: 1.4; }
|
|
1228
|
-
|
|
1229
|
-
/* Mono — var(--font-mono) = Roboto Mono */
|
|
1230
|
-
.trdr-mono { font-family: var(--font-mono); font-size: 12px; font-weight: 400; line-height: 1.4; letter-spacing: 0.04em; }
|
|
1231
|
-
```
|
|
1232
|
-
|
|
1233
|
-
Update `DS_PROGRESS.md`:
|
|
1234
|
-
```
|
|
1235
|
-
- [x] components.css — [path]/components.css ([ISO datetime])
|
|
1236
|
-
```
|
|
1237
|
-
|
|
1238
|
-
### Step 3 — Update global CSS
|
|
1239
|
-
|
|
1240
|
-
Find the main global CSS file (globals.css, main.css, index.css, app.css) and add at the very top:
|
|
1241
|
-
|
|
1242
|
-
```css
|
|
1243
|
-
@import './tokens.css';
|
|
1244
|
-
@import './components.css';
|
|
1245
|
-
```
|
|
1246
|
-
|
|
1247
|
-
Adjust the relative path if tokens.css is in a subdirectory.
|
|
1248
|
-
|
|
1249
|
-
If the project already imports a different design system's variables and there are naming conflicts, warn the developer before proceeding.
|
|
1250
|
-
|
|
1251
|
-
Update `DS_PROGRESS.md`:
|
|
1252
|
-
```
|
|
1253
|
-
- [x] @import — [global-css-file] ([ISO datetime])
|
|
1254
|
-
```
|
|
1255
|
-
|
|
1256
|
-
### Step 4 — Create CLAUDE.md
|
|
1257
|
-
|
|
1258
|
-
Create `CLAUDE.md` at the project root, populated dynamically from the catalog:
|
|
1259
|
-
|
|
1260
|
-
- The list of "Pre-built component classes" must be generated from the loaded JSON's `implementedSlugs` and their CSS class prefixes (parse the first `.trdr-<prefix>` from each `c.code.css`).
|
|
1261
|
-
- The list of "Pending stubs" should mention the count of stubs and link to MISSING_COMPONENTS.md if generated.
|
|
1262
|
-
|
|
1263
|
-
Template (replace `[…]` with actual values):
|
|
1264
|
-
|
|
1265
|
-
```markdown
|
|
1266
|
-
# [Project Name] — Context for Claude Code
|
|
1267
|
-
|
|
1268
|
-
## Design System
|
|
1269
|
-
This project uses the TRDR Design System.
|
|
1270
|
-
Reference Hub: https://trdr.mrocontent.com.br
|
|
1271
|
-
Local catalog: TRDR DS v[catalog-version] ([implemented]/[total] components)
|
|
1272
|
-
|
|
1273
|
-
## Absolute Rules (never break these)
|
|
1274
|
-
1. NEVER use primitive tokens directly (--color-*, --space-*) — always use semantic tokens
|
|
1275
|
-
2. Backgrounds: --bg-primary (#0E0E0E), --bg-secondary (#141519), --bg-tertiary (#1A1A1A)
|
|
1276
|
-
3. Text: --content-primary (white), --content-secondary (#E8E8E8), --content-tertiary (#A4A4A4)
|
|
1277
|
-
4. Primary CTA: --action-brand-inverse-default (#005266) for filled buttons
|
|
1278
|
-
5. Fonts: --font-primary = JetBrains Mono (headings) | --font-secondary = Inter (body) | --font-mono = Roboto Mono (numbers)
|
|
1279
|
-
6. Spacing: always var(--spacing-xs/sm/md/lg/xl/2xl/3xl) — never hardcoded px
|
|
1280
|
-
7. Border radius: always var(--radius-sm/md/lg/full) — never hardcoded px
|
|
1281
|
-
8. Text styles: use .trdr-h1/.../h7, .trdr-body-b1/.../b5, .trdr-label-l2/l3 — never raw font-size px
|
|
1282
|
-
9. No colors outside the DS anywhere — rgba(), inline gradients, hardcoded hex all require a semantic token. No exceptions.
|
|
1283
|
-
|
|
1284
|
-
## Token files
|
|
1285
|
-
- Tokens: [detected-path]/tokens.css
|
|
1286
|
-
- Components: [detected-path]/components.css
|
|
1287
|
-
|
|
1288
|
-
## Quick reference — most used tokens
|
|
1289
|
-
| Token | CSS Variable | Value |
|
|
1290
|
-
|-------|-------------|-------|
|
|
1291
|
-
| Background | --bg-primary | #0E0E0E |
|
|
1292
|
-
| Surface | --surface-secondary | #222222 |
|
|
1293
|
-
| Text primary | --content-primary | #FFFFFF |
|
|
1294
|
-
| Text secondary | --content-tertiary | #A4A4A4 |
|
|
1295
|
-
| Brand (text/icon) | --content-brand | #00A8CC |
|
|
1296
|
-
| Primary button | --action-brand-inverse-default | #005266 |
|
|
1297
|
-
| Border | --border-default | #4A4A4A |
|
|
1298
|
-
| Focus ring | --border-focus | #00D4FF |
|
|
1299
|
-
| Success | --content-success | #4FE290 |
|
|
1300
|
-
| Error | --content-error | #F34F45 |
|
|
1301
|
-
| Warning | --content-warning | #FFCC40 |
|
|
1302
|
-
|
|
1303
|
-
## Implemented components
|
|
1304
|
-
[Generate from catalog: list each implemented component as a row "slug — figmaId — Hub URL"]
|
|
1305
|
-
|
|
1306
|
-
## Pending components (stubs)
|
|
1307
|
-
[N] components in the catalog have no canonical code yet. When using one of these, the skill applies tokens and a banner comment, then logs the gap in MISSING_COMPONENTS.md. See https://trdr.mrocontent.com.br/componentes for status.
|
|
1308
|
-
|
|
1309
|
-
## Layer hierarchy
|
|
1310
|
-
bg.primary (base) → bg.secondary/tertiary (content areas) → surface.* (cards, panels)
|
|
1311
|
-
→ interactive components → overlays/modals/tooltips
|
|
1312
|
-
|
|
1313
|
-
## Inline Styles
|
|
1314
|
-
- **NUNCA** usar `style=""` ou `style={{}}` com propriedades de design (color, background, font, padding, margin, border)
|
|
1315
|
-
- Exceção aceita: `background-image: url(...)` para URLs de imagem dinâmicas de dados externos
|
|
1316
|
-
- Exceção aceita: `style="--css-var: valor"` para passar valores dinâmicos ao CSS (ex: `style="--card-delay:0.1s"`)
|
|
1317
|
-
- Para `animation-delay` calculado: use `style="--delay: Xs"` + CSS `animation-delay: var(--delay, 0s)`
|
|
1318
|
-
- Todos os outros valores de design devem vir de classes CSS com tokens TRDR
|
|
1319
|
-
|
|
1320
|
-
## Ícones
|
|
1321
|
-
- HTML/Vue: `<span class="material-icons mi-sm">nome</span>` via Google Fonts CDN
|
|
1322
|
-
- React: `<NomeIcon />` via @mui/icons-material
|
|
1323
|
-
- Cor: SEMPRE via classe CSS com token DS (`.icon-brand`, `.icon-success`, `.icon-dim`, etc.)
|
|
1324
|
-
- Tamanho: `.mi-2xs` (12px), `.mi-xs` (14px), `.mi-sm` (16px), default (20px), `.mi-lg` (24px), `.mi-xl` (28px), `.mi-2xl` (32px)
|
|
1325
|
-
- Para tamanhos não padrão: `style="font-size:Npx"` (aceito APENAS para font-size de ícones, nunca para cor)
|
|
1326
|
-
- **NUNCA** usar `<svg>` inline para ícones
|
|
1327
|
-
- **NUNCA** usar `style=""` para cor de ícones
|
|
1328
|
-
|
|
1329
|
-
## Logo
|
|
1330
|
-
- HTML: `<img src="logo-trdr.svg" alt="TRDR" height="24">`
|
|
1331
|
-
- Next.js: `<Image src="/logo-trdr.svg" alt="TRDR" width={105} height={41} />`
|
|
1332
|
-
- Vue: `<img src="/logo-trdr.svg" alt="TRDR" :height="24">`
|
|
1333
|
-
- Inline SVG: usar o conteúdo de `references/logo-trdr.svg` (viewBox="0 0 105 41", fill="#00D4FF")
|
|
1334
|
-
- **NUNCA** usar texto ("TRDR" em `<span>`) como logo
|
|
1335
|
-
- **NUNCA** usar outro arquivo SVG que não seja logo-trdr.svg
|
|
1336
|
-
|
|
1337
|
-
[If `stylingMode === 'mui'`, add this section to CLAUDE.md:]
|
|
1338
|
-
|
|
1339
|
-
## MUI Theme Integration
|
|
1340
|
-
This project uses Material UI with TRDR DS tokens integrated via the theme.
|
|
1341
|
-
|
|
1342
|
-
### Rules
|
|
1343
|
-
1. NEVER hardcode colors in palette, sx props, or styleOverrides — always use `var(--token)`
|
|
1344
|
-
2. Theme file (`[themeFilePath]`) is the single source for MUI component styling — do not override via individual sx props unless necessary for one-off layout adjustments
|
|
1345
|
-
3. When adding new MUI components: check if a styleOverride exists in the theme's `components` section. If not, add one using DS tokens.
|
|
1346
|
-
4. sx props: acceptable for layout (padding, margin, display, flex) using DS spacing tokens. NOT acceptable for colors, fonts, or borders with hardcoded values.
|
|
1347
|
-
5. styled(MuiComponent): use `'var(--token)'` for all design values
|
|
1348
|
-
6. Typography: use MUI variants (h1-h6, body1, body2, etc.) — they are mapped to TRDR DS text styles in the theme
|
|
1349
|
-
7. tokens.css is the source of truth — the MUI theme references tokens via `var(--token)` strings
|
|
1350
|
-
```
|
|
1351
|
-
|
|
1352
|
-
Update `DS_PROGRESS.md`:
|
|
1353
|
-
```
|
|
1354
|
-
- [x] CLAUDE.md — CLAUDE.md ([ISO datetime])
|
|
1355
|
-
```
|
|
1356
|
-
|
|
1357
|
-
### Step 5 — Generate/update MUI theme with DS tokens (only when `stylingMode === 'mui'`)
|
|
1358
|
-
|
|
1359
|
-
This step creates the bridge between `tokens.css` (CSS variables source of truth) and MUI's theme system. MUI components read from the theme object, so tokens must be explicitly referenced there via `var()`.
|
|
1360
|
-
|
|
1361
|
-
**Step 5a — Ensure tokens.css is imported:**
|
|
1362
|
-
The `@import './tokens.css'` added in Step 3 makes CSS variables available to MUI's Emotion runtime. This is sufficient — Emotion styles CAN reference `var(--token)` in string values.
|
|
1363
|
-
|
|
1364
|
-
**Step 5b — Create or update the MUI theme file:**
|
|
1365
|
-
|
|
1366
|
-
If `themeFilePath` exists: READ the entire existing theme file. Preserve all non-DS customizations (breakpoints, transitions, zIndex, custom component logic, defaultProps, variants).
|
|
1367
|
-
|
|
1368
|
-
If `themeFilePath` does NOT exist: Create a new theme file at `src/theme.ts` (or `src/theme/index.ts` if a `theme/` directory exists).
|
|
1369
|
-
|
|
1370
|
-
Generate/update the theme with DS token references:
|
|
1371
|
-
|
|
1372
|
-
```typescript
|
|
1373
|
-
import { createTheme } from '@mui/material/styles';
|
|
1374
|
-
|
|
1375
|
-
const theme = createTheme({
|
|
1376
|
-
// cssVariables: true, — recommended for MUI v6+ (enables native CSS variable support)
|
|
1377
|
-
palette: {
|
|
1378
|
-
mode: 'dark',
|
|
1379
|
-
primary: {
|
|
1380
|
-
main: 'var(--action-brand-default)', // #00D4FF
|
|
1381
|
-
dark: 'var(--action-brand-active)', // #007D99
|
|
1382
|
-
contrastText: 'var(--content-inverse)', // #1A1A1A
|
|
1383
|
-
},
|
|
1384
|
-
secondary: {
|
|
1385
|
-
main: 'var(--action-secondary-default)', // #4A4A4A
|
|
1386
|
-
dark: 'var(--action-secondary-active)', // #A4A4A4
|
|
1387
|
-
contrastText: 'var(--content-primary)', // #FFFFFF
|
|
1388
|
-
},
|
|
1389
|
-
error: {
|
|
1390
|
-
main: 'var(--content-error)', // #F34F45
|
|
1391
|
-
},
|
|
1392
|
-
warning: {
|
|
1393
|
-
main: 'var(--content-warning)', // #FFCC40
|
|
1394
|
-
},
|
|
1395
|
-
success: {
|
|
1396
|
-
main: 'var(--content-success)', // #4FE290
|
|
1397
|
-
},
|
|
1398
|
-
info: {
|
|
1399
|
-
main: 'var(--content-info)', // #CCFDFF
|
|
1400
|
-
},
|
|
1401
|
-
background: {
|
|
1402
|
-
default: 'var(--bg-primary)', // #0E0E0E
|
|
1403
|
-
paper: 'var(--bg-secondary)', // #141519
|
|
1404
|
-
},
|
|
1405
|
-
text: {
|
|
1406
|
-
primary: 'var(--content-primary)', // #FFFFFF
|
|
1407
|
-
secondary: 'var(--content-secondary)', // #E8E8E8
|
|
1408
|
-
disabled: 'var(--content-disabled)', // #4A4A4A
|
|
1409
|
-
},
|
|
1410
|
-
divider: 'var(--border-default)', // #4A4A4A
|
|
1411
|
-
action: {
|
|
1412
|
-
hover: 'var(--surface-hover, rgba(255,255,255,0.08))',
|
|
1413
|
-
selected: 'var(--surface-brand)',
|
|
1414
|
-
disabled: 'var(--content-disabled)',
|
|
1415
|
-
disabledBackground: 'var(--surface-disabled)',
|
|
1416
|
-
},
|
|
1417
|
-
},
|
|
1418
|
-
typography: {
|
|
1419
|
-
fontFamily: 'var(--font-secondary)', // Inter
|
|
1420
|
-
h1: { fontFamily: 'var(--font-primary)', fontSize: 80, fontWeight: 500, lineHeight: 1.1 },
|
|
1421
|
-
h2: { fontFamily: 'var(--font-primary)', fontSize: 56, fontWeight: 500, lineHeight: 1.1 },
|
|
1422
|
-
h3: { fontFamily: 'var(--font-primary)', fontSize: 46, fontWeight: 700, lineHeight: 1.15 },
|
|
1423
|
-
h4: { fontFamily: 'var(--font-primary)', fontSize: 38, fontWeight: 500, lineHeight: 1.15 },
|
|
1424
|
-
h5: { fontFamily: 'var(--font-primary)', fontSize: 32, fontWeight: 500, lineHeight: 1.2 },
|
|
1425
|
-
h6: { fontFamily: 'var(--font-primary)', fontSize: 26, fontWeight: 500, lineHeight: 1.2 },
|
|
1426
|
-
subtitle1: { fontFamily: 'var(--font-secondary)', fontSize: 22, fontWeight: 600, lineHeight: 1.3 },
|
|
1427
|
-
body1: { fontFamily: 'var(--font-secondary)', fontSize: 16, fontWeight: 400, lineHeight: 1.5 },
|
|
1428
|
-
body2: { fontFamily: 'var(--font-secondary)', fontSize: 14, fontWeight: 400, lineHeight: 1.5 },
|
|
1429
|
-
caption: { fontFamily: 'var(--font-secondary)', fontSize: 12, fontWeight: 400, lineHeight: 1.4 },
|
|
1430
|
-
overline: { fontFamily: 'var(--font-secondary)', fontSize: 10, fontWeight: 400, lineHeight: 1.4 },
|
|
1431
|
-
button: { fontFamily: 'var(--font-secondary)', fontWeight: 600, textTransform: 'none' as const },
|
|
1432
|
-
},
|
|
1433
|
-
shape: {
|
|
1434
|
-
borderRadius: 8, // --radius-md = 8px — MUI shape.borderRadius must be numeric
|
|
1435
|
-
},
|
|
1436
|
-
components: {
|
|
1437
|
-
// styleOverrides are generated in Sub-fase C
|
|
1438
|
-
},
|
|
1439
|
-
});
|
|
1440
|
-
|
|
1441
|
-
export default theme;
|
|
1442
|
-
```
|
|
1443
|
-
|
|
1444
|
-
**MUI palette role → DS token mapping table:**
|
|
1445
|
-
|
|
1446
|
-
| MUI palette key | DS token | Hex reference |
|
|
1447
|
-
|---|---|---|
|
|
1448
|
-
| `palette.primary.main` | `var(--action-brand-default)` | #00D4FF |
|
|
1449
|
-
| `palette.primary.dark` | `var(--action-brand-active)` | #007D99 |
|
|
1450
|
-
| `palette.primary.contrastText` | `var(--content-inverse)` | #1A1A1A |
|
|
1451
|
-
| `palette.secondary.main` | `var(--action-secondary-default)` | #4A4A4A |
|
|
1452
|
-
| `palette.secondary.dark` | `var(--action-secondary-active)` | #A4A4A4 |
|
|
1453
|
-
| `palette.error.main` | `var(--content-error)` | #F34F45 |
|
|
1454
|
-
| `palette.warning.main` | `var(--content-warning)` | #FFCC40 |
|
|
1455
|
-
| `palette.success.main` | `var(--content-success)` | #4FE290 |
|
|
1456
|
-
| `palette.info.main` | `var(--content-info)` | #CCFDFF |
|
|
1457
|
-
| `palette.background.default` | `var(--bg-primary)` | #0E0E0E |
|
|
1458
|
-
| `palette.background.paper` | `var(--bg-secondary)` | #141519 |
|
|
1459
|
-
| `palette.text.primary` | `var(--content-primary)` | #FFFFFF |
|
|
1460
|
-
| `palette.text.secondary` | `var(--content-secondary)` | #E8E8E8 |
|
|
1461
|
-
| `palette.text.disabled` | `var(--content-disabled)` | #4A4A4A |
|
|
1462
|
-
| `palette.divider` | `var(--border-default)` | #4A4A4A |
|
|
1463
|
-
|
|
1464
|
-
**MUI typography variant → DS token mapping table:**
|
|
1465
|
-
|
|
1466
|
-
| MUI variant | DS equivalent | Font family token |
|
|
1467
|
-
|---|---|---|
|
|
1468
|
-
| `h1` | `.trdr-h1` | `var(--font-primary)` — 80px/500 |
|
|
1469
|
-
| `h2` | `.trdr-h2` | `var(--font-primary)` — 56px/500 |
|
|
1470
|
-
| `h3` | `.trdr-h3` | `var(--font-primary)` — 46px/700 |
|
|
1471
|
-
| `h4` | `.trdr-h4` | `var(--font-primary)` — 38px/500 |
|
|
1472
|
-
| `h5` | `.trdr-h5` | `var(--font-primary)` — 32px/500 |
|
|
1473
|
-
| `h6` | `.trdr-h6` | `var(--font-primary)` — 26px/500 |
|
|
1474
|
-
| `subtitle1` | `.trdr-h7` | `var(--font-secondary)` — 22px/600 |
|
|
1475
|
-
| `body1` | `.trdr-body-b2` | `var(--font-secondary)` — 16px/500 |
|
|
1476
|
-
| `body2` | `.trdr-body-b3` | `var(--font-secondary)` — 14px/400 |
|
|
1477
|
-
| `caption` | `.trdr-body-b4` | `var(--font-secondary)` — 12px/500 |
|
|
1478
|
-
| `overline` | `.trdr-body-b5` | `var(--font-secondary)` — 10px/400 |
|
|
1479
|
-
| `button` | `.trdr-label-l3` | `var(--font-secondary)` — 14px/600 |
|
|
1480
|
-
|
|
1481
|
-
**MUI shape/radius → DS token mapping table:**
|
|
1482
|
-
|
|
1483
|
-
| Value (px) | DS token (for CSS) | MUI shape (numeric) |
|
|
1484
|
-
|---|---|---|
|
|
1485
|
-
| `0` | `var(--radius-none)` | `0` |
|
|
1486
|
-
| `2` | `var(--radius-xs)` | `2` |
|
|
1487
|
-
| `4` | `var(--radius-sm)` | `4` |
|
|
1488
|
-
| `8` | `var(--radius-md)` | `8` |
|
|
1489
|
-
| `12` | — (no DS token) | `12` |
|
|
1490
|
-
| `16` | `var(--radius-lg)` | `16` |
|
|
1491
|
-
| `20` | `var(--radius-xl)` | `20` |
|
|
1492
|
-
| `9999` | `var(--radius-full)` | `9999` |
|
|
1493
|
-
|
|
1494
|
-
**Important MUI + CSS var() caveat:**
|
|
1495
|
-
MUI accepts string values for palette colors. `'var(--token)'` works for rendering in MUI v5+. However, MUI internally uses `palette.primary.main` for color calculations (alpha, lighten, darken). When `main` is a `var()` string, those calculations produce invalid CSS.
|
|
1496
|
-
|
|
1497
|
-
**Solution by MUI version:**
|
|
1498
|
-
- **MUI v6+**: Add `cssVariables: true` to `createTheme()` — MUI handles CSS variables natively, calculations work
|
|
1499
|
-
- **MUI v5 / v7 without cssVariables mode**: Provide `main`, `light`, `dark`, and `contrastText` ALL explicitly using DS tokens. Do NOT rely on MUI's auto-generated `light`/`dark` variants. Document this caveat in `CLAUDE.md` and `DS_MIGRATION.md`.
|
|
1500
|
-
|
|
1501
|
-
**Step 5c — Update DS_PROGRESS.md:**
|
|
1502
|
-
```
|
|
1503
|
-
- [x] MUI theme — [themeFilePath] (palette, typography, shape with DS tokens)
|
|
1504
|
-
```
|
|
1505
|
-
|
|
1506
|
-
Update `DS_PROGRESS.md`: set `Sub-fase A: Foundation — ✅ COMPLETE`.
|
|
1507
|
-
|
|
1508
|
-
Output:
|
|
1509
|
-
```
|
|
1510
|
-
[If stylingMode === 'mui':]
|
|
1511
|
-
✅ Sub-fase A completa — tokens.css, components.css, CLAUDE.md, @import e MUI theme criados/atualizados.
|
|
1512
|
-
|
|
1513
|
-
[else:]
|
|
1514
|
-
✅ Sub-fase A completa — tokens.css, components.css, CLAUDE.md e @import criados.
|
|
1515
|
-
|
|
1516
|
-
Próximo: Sub-fase B — Violations ([total_files_with_violations] arquivos em [N] lotes de até [batch_size] cada)
|
|
1517
|
-
Responda:
|
|
1518
|
-
- "continuar" / "continue" — iniciar Sub-fase B
|
|
1519
|
-
- "parar" / "stop" — salvar progresso e parar aqui
|
|
1520
|
-
- "não funcionou" / "report" — reportar problema ao maintainer
|
|
1521
|
-
```
|
|
1522
|
-
|
|
1523
|
-
**STOP HERE. Wait for developer reply before starting Sub-fase B.**
|
|
1524
|
-
If the developer indicates the implementation didn't work (see DEVELOPER DISSATISFACTION DETECTION below), trigger REPORT MODE.
|
|
1525
|
-
|
|
1526
|
-
---
|
|
1527
|
-
|
|
1528
|
-
## Sub-fase B: Violations
|
|
1529
|
-
|
|
1530
|
-
> **Before starting:** Read `DS_ANALYSIS.md` (§ By File and § Execution Plan) and `DS_PROGRESS.md` (§ Sub-fase B) from the project root.
|
|
1531
|
-
|
|
1532
|
-
Update `DS_PROGRESS.md`: set `Sub-fase B: Violations — IN_PROGRESS`.
|
|
1533
|
-
|
|
1534
|
-
### Step 5 — Migrate violations
|
|
1535
|
-
|
|
1536
|
-
Process one batch at a time, always with a STOP between batches. Batch assignments come from `DS_ANALYSIS.md` § Execution Plan. Maximum [batch_size] files per batch (default: 5).
|
|
1537
|
-
|
|
1538
|
-
For each batch listed as PENDING in `DS_PROGRESS.md` § Sub-fase B:
|
|
1539
|
-
|
|
1540
|
-
1. Update `DS_PROGRESS.md` — change batch status to `IN_PROGRESS`
|
|
1541
|
-
2. For each file in the batch:
|
|
1542
|
-
- Apply all applicable violation fixes (see mapping tables below)
|
|
1543
|
-
- Count violations fixed
|
|
1544
|
-
3. Update `DS_PROGRESS.md` — change batch status to `COMPLETED` with per-file detail:
|
|
1545
|
-
```
|
|
1546
|
-
### Lote [N] — [folder/] ([N] arquivos) — COMPLETED
|
|
1547
|
-
Completed: [ISO datetime]
|
|
1548
|
-
Violações corrigidas: [N] | Arquivos: [N]/[N]
|
|
1549
|
-
|
|
1550
|
-
| Arquivo | Violações | Categorias | Tokens aplicados |
|
|
1551
|
-
|---------|-----------|------------|------------------|
|
|
1552
|
-
| src/components/Header.tsx | 5 | A(3), C(2) | --content-brand, --spacing-md, --bg-primary |
|
|
1553
|
-
| src/components/Card.css | 3 | A(1), B(2) | --surface-secondary, --font-primary, --font-secondary |
|
|
1554
|
-
```
|
|
1555
|
-
Add any unfixable patterns to the "Padrões Sem Token" section of `DS_PROGRESS.md`.
|
|
1556
|
-
4. Output batch summary:
|
|
1557
|
-
```
|
|
1558
|
-
✅ Lote [N] concluído — [folder/] ([N] arquivos, [N] violações corrigidas)
|
|
1559
|
-
Progresso geral: [done]/[total] lotes | [total_fixed] violações corrigidas
|
|
1560
|
-
```
|
|
1561
|
-
5. If more batches are PENDING:
|
|
1562
|
-
|
|
1563
|
-
**STOP HERE.** Output:
|
|
1564
|
-
```
|
|
1565
|
-
Próximo: **Lote [N+1] — [folder/]** ([N] arquivos)
|
|
1566
|
-
Responda:
|
|
1567
|
-
- "continuar" / "continue" — processar próximo lote
|
|
1568
|
-
- "pular [pasta]" — skip this folder and go to the next batch
|
|
1569
|
-
- "parar" / "stop" — save progress and stop here (resume later with `/trdr-ds resume`)
|
|
1570
|
-
- "tudo" / "all" — process all remaining batches without pausing
|
|
1571
|
-
- "não funcionou" / "report" — reportar problema ao maintainer
|
|
1572
|
-
```
|
|
1573
|
-
**Wait for developer reply.**
|
|
1574
|
-
|
|
1575
|
-
If reply is `"tudo"` / `"all"`: process all remaining batches without pausing (update DS_PROGRESS.md after each).
|
|
1576
|
-
If reply is `"pular [pasta]"`: mark that batch as SKIPPED in DS_PROGRESS.md and move to the next.
|
|
1577
|
-
If reply is `"parar"`: set `Status: PAUSED` in DS_PROGRESS.md. STOP. Do not proceed to Step 6 or 7.
|
|
1578
|
-
If the developer indicates the implementation didn't work (see DEVELOPER DISSATISFACTION DETECTION below), trigger REPORT MODE.
|
|
1579
|
-
|
|
1580
|
-
6. After ALL batches are COMPLETED (or skipped):
|
|
1581
|
-
|
|
1582
|
-
Update `DS_PROGRESS.md`: set `Sub-fase B: Violations — ✅ COMPLETE`.
|
|
1583
|
-
|
|
1584
|
-
Output:
|
|
1585
|
-
```
|
|
1586
|
-
✅ Sub-fase B completa — [total_violations_fixed] violações corrigidas em [total_files_with_violations] arquivos.
|
|
1587
|
-
|
|
1588
|
-
Próximo: Sub-fase C — Components ([N] candidatos a substituição)
|
|
1589
|
-
Responda:
|
|
1590
|
-
- "continuar" / "continue" — iniciar Sub-fase C
|
|
1591
|
-
- "parar" / "stop" — salvar progresso e parar aqui
|
|
1592
|
-
- "não funcionou" / "report" — reportar problema ao maintainer
|
|
1593
|
-
```
|
|
1594
|
-
|
|
1595
|
-
**STOP HERE. Wait for developer reply before starting Sub-fase C.**
|
|
1596
|
-
If the developer indicates the implementation didn't work (see DEVELOPER DISSATISFACTION DETECTION below), trigger REPORT MODE.
|
|
1597
|
-
|
|
1598
|
-
---
|
|
1599
|
-
|
|
1600
|
-
**Violation mapping tables (used in Step 5):**
|
|
1601
|
-
|
|
1602
|
-
**Color mapping (hardcoded → semantic):**
|
|
1603
|
-
| Hardcoded value | Context | Replace with |
|
|
1604
|
-
|----------------|---------|-------------|
|
|
1605
|
-
| `#0E0E0E` | background | `var(--bg-primary)` |
|
|
1606
|
-
| `#141519` | background | `var(--bg-secondary)` |
|
|
1607
|
-
| `#1A1A1A` | background/surface | `var(--bg-tertiary)` or `var(--surface-tertiary)` |
|
|
1608
|
-
| `#222222` | surface/border | `var(--surface-secondary)` or `var(--border-subtle)` |
|
|
1609
|
-
| `#4A4A4A` | surface/border | `var(--surface-primary)` or `var(--border-default)` |
|
|
1610
|
-
| `#FFFFFF` | text/bg | `var(--content-primary)` or `var(--bg-inverse)` |
|
|
1611
|
-
| `#E8E8E8` | text | `var(--content-secondary)` |
|
|
1612
|
-
| `#A4A4A4` | text | `var(--content-tertiary)` |
|
|
1613
|
-
| `#00A8CC` | action/text brand | `var(--action-brand-default)` or `var(--content-brand)` |
|
|
1614
|
-
| `#005266` | button bg CTA | `var(--action-brand-inverse-default)` |
|
|
1615
|
-
| `#00D4FF` | focus/info | `var(--border-focus)` or `var(--content-info)` |
|
|
1616
|
-
| `#F34F45` | error/trading | `var(--content-error)` or `var(--context-trading-down)` |
|
|
1617
|
-
| `#4FE290` | success/trading | `var(--content-success)` or `var(--context-trading-up)` |
|
|
1618
|
-
| `#FFCC40` | warning | `var(--content-warning)` |
|
|
1619
|
-
| `#F57C00` | destructive | `var(--action-destructive-default)` |
|
|
1620
|
-
|
|
1621
|
-
**Font mapping:**
|
|
1622
|
-
| Hardcoded | Replace with |
|
|
1623
|
-
|-----------|-------------|
|
|
1624
|
-
| `font-family: 'Inter'` or `font-family: 'Inter', -apple-system, ...` | `font-family: var(--font-secondary)` |
|
|
1625
|
-
| `font-family: 'JetBrains Mono'` or `font-family: 'JetBrains Mono', monospace` | `font-family: var(--font-primary)` |
|
|
1626
|
-
| `font-family: 'Space Grotesk'` | `font-family: var(--font-primary)` |
|
|
1627
|
-
| `font-family: 'Roboto Mono'` or `font-family: 'Roboto Mono', monospace` | `font-family: var(--font-mono)` |
|
|
1628
|
-
|
|
1629
|
-
**Note:** System font fallbacks (`-apple-system`, `BlinkMacSystemFont`, `sans-serif`) are removed when replacing with a DS token. The token's value in tokens.css already defines the complete font stack including fallbacks — no manual fallback needed.
|
|
1630
|
-
|
|
1631
|
-
**Spacing mapping:**
|
|
1632
|
-
| Hardcoded | Replace with |
|
|
1633
|
-
|-----------|-------------|
|
|
1634
|
-
| `4px` | `var(--spacing-xs)` |
|
|
1635
|
-
| `8px` | `var(--spacing-sm)` |
|
|
1636
|
-
| `12px` | `var(--spacing-md)` |
|
|
1637
|
-
| `16px` | `var(--spacing-lg)` |
|
|
1638
|
-
| `20px` | `var(--spacing-xl)` |
|
|
1639
|
-
| `24px` | `var(--spacing-2xl)` |
|
|
1640
|
-
| `32px` | `var(--spacing-3xl)` |
|
|
1641
|
-
| `0` / `0px` | Keep as `0` (no token needed) |
|
|
1642
|
-
| Any other value (48px, 64px, 96px, etc.) | **Keep the value as-is** — no DS token exists for it. Flag in DS_MIGRATION.md as "Custom spacing value: [Npx] in [file:line] — consider refactoring or proposing a new token in the Hub." Do NOT invent a `--spacing-4xl` or similar that doesn't exist in tokens.css. |
|
|
1643
|
-
|
|
1644
|
-
**Multi-value spacing shorthands** (`padding: 16px 32px`, `margin: 12px 0 8px`):
|
|
1645
|
-
- Replace each value independently using the mapping above
|
|
1646
|
-
- Example: `padding: 16px 32px` → `padding: var(--spacing-lg) var(--spacing-3xl)`
|
|
1647
|
-
- Example: `margin: 12px 0 8px` → `margin: var(--spacing-md) 0 var(--spacing-sm)`
|
|
1648
|
-
- If one value has no token: replace only the mappable ones; keep the others as-is and flag
|
|
1649
|
-
|
|
1650
|
-
**MUI sx spacing shorthand mapping** (only when `stylingMode === 'mui'`):
|
|
1651
|
-
|
|
1652
|
-
When fixing violations in MUI `sx` props, MUI uses a numeric spacing multiplier (default 8px base). Use this mapping:
|
|
1653
|
-
|
|
1654
|
-
| sx prop | MUI value | Pixels | DS token (for string replacement) |
|
|
1655
|
-
|---|---|---|---|
|
|
1656
|
-
| `p`, `m`, `gap`, etc. | `0.5` | 4px | `'var(--spacing-xs)'` |
|
|
1657
|
-
| `p`, `m`, `gap`, etc. | `1` | 8px | `'var(--spacing-sm)'` |
|
|
1658
|
-
| `p`, `m`, `gap`, etc. | `1.5` | 12px | `'var(--spacing-md)'` |
|
|
1659
|
-
| `p`, `m`, `gap`, etc. | `2` | 16px | `'var(--spacing-lg)'` |
|
|
1660
|
-
| `p`, `m`, `gap`, etc. | `2.5` | 20px | `'var(--spacing-xl)'` |
|
|
1661
|
-
| `p`, `m`, `gap`, etc. | `3` | 24px | `'var(--spacing-2xl)'` |
|
|
1662
|
-
| `p`, `m`, `gap`, etc. | `4` | 32px | `'var(--spacing-3xl)'` |
|
|
1663
|
-
|
|
1664
|
-
Prefer keeping MUI numeric scale when the project consistently uses it (`p: 2`, `m: 1`). Only use `'var(--spacing-*)'` string replacement when the sx value uses hardcoded px string (e.g., `padding: '16px'` instead of `p: 2`).
|
|
1665
|
-
|
|
1666
|
-
**MUI-specific violation processing** (only when `stylingMode === 'mui'`):
|
|
1667
|
-
|
|
1668
|
-
In addition to standard A-K violations in CSS/JSX files, process these MUI-specific violations during batch processing:
|
|
1669
|
-
|
|
1670
|
-
- **Category L** (theme file): Read the theme file. For each hardcoded `#hex`, font-family, fontSize, or borderRadius value, look up in the mapping tables and replace with `'var(--token)'`. If no DS token match exists, flag in DS_MIGRATION.md.
|
|
1671
|
-
- **Category M** (sx props): For each file with `sx={{}}` containing hardcoded values, replace colors with `'var(--token)'`, spacing with token or MUI scale, fonts with `'var(--font-*)'`, radius with `'var(--radius-*)'`.
|
|
1672
|
-
- **Category N** (styled() calls): For each `styled(MuiComponent)()` call with hardcoded values, replace with `'var(--token)'` in the style object.
|
|
1673
|
-
|
|
1674
|
-
Theme files (Category L) should be processed in the FIRST violation batch, before component files, so that theme-level tokens are in place before scanning individual components.
|
|
1675
|
-
|
|
1676
|
-
**Ambiguous colors:** Use property context to decide — `background-color` → bg/surface token, `color` → content token, `border-color` → border token, `accent-color` → action token.
|
|
1677
|
-
|
|
1678
|
-
**Tailwind arbitrary value colors** (only when `stylingMode: tailwind`):
|
|
1679
|
-
|
|
1680
|
-
Detect in `*.tsx, *.jsx, *.html, *.vue`:
|
|
1681
|
-
- Pattern: `(?:bg|text|border|ring|from|to|via|outline|fill|stroke)-\[#[0-9A-Fa-f]{3,8}\]`
|
|
1682
|
-
- Also detect `hover:`, `focus:`, `active:`, `dark:` prefixed variants
|
|
1683
|
-
|
|
1684
|
-
Fix strategy — apply in order of preference:
|
|
1685
|
-
|
|
1686
|
-
1. **DS class exists for element role → Opção A (DS class):**
|
|
1687
|
-
Replace the arbitrary Tailwind classes with the DS class, keeping non-color utilities:
|
|
1688
|
-
```jsx
|
|
1689
|
-
// Before
|
|
1690
|
-
className="bg-[#005266] text-white px-4 py-2 rounded cursor-pointer"
|
|
1691
|
-
// After
|
|
1692
|
-
className="trdr-btn trdr-btn-primary px-4 rounded"
|
|
1693
|
-
```
|
|
1694
|
-
|
|
1695
|
-
2. **No DS class, but color maps to DS token → Opção B (CSS var arbitrary):**
|
|
1696
|
-
```jsx
|
|
1697
|
-
// Before
|
|
1698
|
-
className="bg-[#1A1A1A] border border-[#222222]"
|
|
1699
|
-
// After
|
|
1700
|
-
className="bg-[var(--bg-tertiary)] border border-[var(--border-subtle)]"
|
|
1701
|
-
```
|
|
1702
|
-
Token mapping (use same color → semantic table as CSS):
|
|
1703
|
-
- `bg-[#0E0E0E]` → `bg-[var(--bg-primary)]`
|
|
1704
|
-
- `bg-[#141519]` → `bg-[var(--bg-secondary)]`
|
|
1705
|
-
- `bg-[#1A1A1A]` → `bg-[var(--bg-tertiary)]`
|
|
1706
|
-
- `text-[#FFFFFF]` → `text-[var(--content-primary)]`
|
|
1707
|
-
- `text-[#A4A4A4]` → `text-[var(--content-tertiary)]`
|
|
1708
|
-
- `border-[#222222]` → `border-[var(--border-subtle)]`
|
|
1709
|
-
- `border-[#4A4A4A]` → `border-[var(--border-default)]`
|
|
1710
|
-
- `focus:border-[#00D4FF]` → `focus:border-[var(--border-focus)]`
|
|
1711
|
-
- `text-[#4FE290]` → `text-[var(--context-trading-up)]`
|
|
1712
|
-
- `text-[#F34F45]` → `text-[var(--context-trading-down)]`
|
|
1713
|
-
|
|
1714
|
-
3. **Color has no DS token (e.g. `hover:bg-[#3DD980]`, `hover:bg-[#E03D3A]`):**
|
|
1715
|
-
- Flag in DS_MIGRATION.md: "Custom hover color `#hex` — no DS token equivalent"
|
|
1716
|
-
- Suggestion: replace with CSS hover effect: `hover:[filter:brightness(1.15)]` or use a utility class
|
|
1717
|
-
- Do NOT invent a token or leave the hardcoded color silently
|
|
1718
|
-
|
|
1719
|
-
**`accent-color` property:** Controls native checkbox/radio/range styling.
|
|
1720
|
-
- `accent-color: #00A8CC` → `accent-color: var(--action-brand-default)`
|
|
1721
|
-
- `accent-color: #4FE290` → `accent-color: var(--content-success)`
|
|
1722
|
-
|
|
1723
|
-
**rgba() mapping:**
|
|
1724
|
-
| Hardcoded pattern | Context | Replace with |
|
|
1725
|
-
|-------------------|---------|-------------|
|
|
1726
|
-
| `rgba(0,0,0,*)` | box-shadow | No TRDR shadow token exists → flag in DS_PROGRESS.md / DS_MIGRATION.md as "Missing shadow token" |
|
|
1727
|
-
| `rgba(255,255,255,0.03–0.08)` | border / subtle divider | `var(--border-subtle)` if token exists, otherwise flag |
|
|
1728
|
-
| `rgba(255,255,255,0.10–0.20)` | hover/hover overlay | `var(--surface-hover)` if token exists, otherwise flag |
|
|
1729
|
-
| `rgba(255,255,255,.29)` approx | overlay/backdrop | `var(--bg-overlay)` |
|
|
1730
|
-
| `rgba(255,255,255,*)` other | overlay | flag |
|
|
1731
|
-
| `rgba(0,212,255,*)` | focus glow/shadow | No alpha token exists for `--border-focus` → flag as "Missing focus-alpha token" |
|
|
1732
|
-
| `rgba(0,168,204,*)` | brand alpha bg | Use `var(--surface-brand)` if available, otherwise flag |
|
|
1733
|
-
| `rgba(79,226,144,*)` | success alpha bg | Use `var(--surface-success)` if available, otherwise flag |
|
|
1734
|
-
| `rgba(243,79,69,*)` | error alpha bg | Use `var(--surface-error)` if available, otherwise flag |
|
|
1735
|
-
| `rgba(255,204,64,*)` | warning alpha bg | Use `var(--surface-warning)` if available, otherwise flag |
|
|
1736
|
-
| Any other `rgba(N,N,N,*)` | various | Map to nearest semantic alpha token (--surface-brand, --surface-info, --action-*-alpha, etc.) or flag |
|
|
1737
|
-
|
|
1738
|
-
**Gradient mapping:**
|
|
1739
|
-
|
|
1740
|
-
Known TRDR gradient token values (use to match):
|
|
1741
|
-
| Token | Approximate value |
|
|
1742
|
-
|-------|------------------|
|
|
1743
|
-
| `--gradient-text-brand` | `linear-gradient(90deg, var(--content-brand), var(--border-focus))` — cyan to bright-cyan, horizontal |
|
|
1744
|
-
| `--gradient-bg-hero` | `linear-gradient(180deg, var(--bg-secondary), var(--bg-primary))` — dark vertical fade |
|
|
1745
|
-
| `--gradient-bg-fade` | `linear-gradient(180deg, var(--bg-tertiary) 0%, transparent 100%)` — surface to transparent |
|
|
1746
|
-
|
|
1747
|
-
| Pattern | Replace with |
|
|
1748
|
-
|---------|-------------|
|
|
1749
|
-
| Gradient whose colors map to `--content-brand` + `--border-focus` (horizontal) | `var(--gradient-text-brand)` |
|
|
1750
|
-
| Gradient whose colors map to `--bg-secondary` → `--bg-primary` (vertical fade) | `var(--gradient-bg-hero)` |
|
|
1751
|
-
| Gradient whose colors map to `--bg-tertiary` → transparent | `var(--gradient-bg-fade)` |
|
|
1752
|
-
| Gradient using only TRDR bg colors but not matching any token above | Flag — add comment `/* gradient-bg-custom: consider adding to Hub */` |
|
|
1753
|
-
| `linear-gradient(...)` using any non-DS colors | Flag — developer must decide: remove, replace with TRDR gradient token, or add new token to Hub |
|
|
1754
|
-
| Gradient inside SVG data URI embedded in CSS | Flag |
|
|
1755
|
-
|
|
1756
|
-
**Font-size mapping (bidirectional — CSS + HTML/JSX/Vue):**
|
|
1757
|
-
|
|
1758
|
-
**Exception for global selectors:** If `font-size: Npx` is inside a `body {}`, `html {}`, `:root {}`, or `* {}` rule:
|
|
1759
|
-
- **Remove the `font-size` property entirely** — do NOT add a DS class to the element
|
|
1760
|
-
- Document in DS_MIGRATION.md: "Global font-size reset removed — TRDR DS typography classes manage sizes per-element"
|
|
1761
|
-
- Do NOT apply DS text class to `<body>` or `<html>` tags
|
|
1762
|
-
|
|
1763
|
-
When a CSS class has a `font-size` that maps to a DS text style, the fix is **two-part**:
|
|
1764
|
-
|
|
1765
|
-
**Part 1 — In the CSS file**: remove the properties already provided by the DS class:
|
|
1766
|
-
- Remove: `font-family`, `font-size`, `font-weight`, `line-height` (the DS class provides these)
|
|
1767
|
-
- Keep: `color`, `margin`, `padding`, `text-transform`, `letter-spacing` (project-specific overrides)
|
|
1768
|
-
|
|
1769
|
-
**Part 2 — In the HTML/JSX/Vue file**: add the DS class to the element that uses that CSS class:
|
|
1770
|
-
|
|
1771
|
-
| stylingMode | How to add |
|
|
1772
|
-
|-------------|-----------|
|
|
1773
|
-
| `plain-css` / `tailwind` | `<h1 class="hero-title trdr-h2">` |
|
|
1774
|
-
| React/Next.js | `<h1 className="hero-title trdr-h2">` |
|
|
1775
|
-
| Vue | `<h1 class="hero-title trdr-h2">` or `:class="['hero-title', 'trdr-h2']"` |
|
|
1776
|
-
| `css-modules` | Add `composes: trdr-h2 from global;` inside `.hero-title` in the `.module.css` |
|
|
1777
|
-
|
|
1778
|
-
**CSS Modules local composition:** If a class uses `composes: AnotherClass` (without `from global`), it inherits styles from that class within the same file. When fixing:
|
|
1779
|
-
- Add `composes: trdr-X from global` to the **base class** (AnotherClass)
|
|
1780
|
-
- Do NOT add `composes: trdr-X from global` to the **inheriting class** — it inherits the token transitively
|
|
1781
|
-
- Example: `.select { composes: input; }` — add `composes: trdr-text-input from global` only to `.input`, not to `.select`
|
|
1782
|
-
- Adding `composes: trdr-X from global` to both would apply DS styles twice, causing doubled specificity
|
|
1783
|
-
|
|
1784
|
-
**font-size → DS class table:**
|
|
1785
|
-
| font-size | DS Class | Notes |
|
|
1786
|
-
|-----------|----------|-------|
|
|
1787
|
-
| `80px` | `.trdr-h1` | JetBrains Mono 500 |
|
|
1788
|
-
| `56px` | `.trdr-h2` | JetBrains Mono 500 |
|
|
1789
|
-
| `46px` | `.trdr-h3` | JetBrains Mono 700 |
|
|
1790
|
-
| `38px` | `.trdr-h4` | JetBrains Mono 500 |
|
|
1791
|
-
| `32px` | `.trdr-h5` | JetBrains Mono 500 |
|
|
1792
|
-
| `26px` | `.trdr-h6` | JetBrains Mono 500 |
|
|
1793
|
-
| `22px` | `.trdr-h7` | Inter 600 |
|
|
1794
|
-
| `18px` | `.trdr-body-b1` | Inter 400 |
|
|
1795
|
-
| `16px` | `.trdr-body-b2` or `.trdr-label-l2` | check font-weight: 400→b2, 600→l2 |
|
|
1796
|
-
| `14px` | `.trdr-body-b3` or `.trdr-label-l3` | check font-weight: 400→b3, 600→l3 |
|
|
1797
|
-
| `12px` | `.trdr-body-b4` or `.trdr-body-aux` | check letter-spacing: 0.2px→b4, 0.24px→aux |
|
|
1798
|
-
| `10px` | `.trdr-body-b5` | Inter 400 |
|
|
1799
|
-
| other px | nearest DS class below the value | flag in DS_MIGRATION.md |
|
|
1800
|
-
| `font-family: var(--font-mono)` (any size) | `.trdr-mono` | Roboto Mono 400 |
|
|
1801
|
-
|
|
1802
|
-
**IMPORTANT:** Always scan for the HTML element that uses the CSS class and add the DS class there. Do not only fix the CSS — the element in HTML/JSX/Vue must also receive the DS class so the typography takes effect immediately, before any cascading.
|
|
1803
|
-
|
|
1804
|
-
**Do NOT replace:**
|
|
1805
|
-
- Hex values inside binary image files (PNG, JPG, GIF)
|
|
1806
|
-
- SVG external files — flag them but do not auto-edit
|
|
1807
|
-
- Values in commented-out code
|
|
1808
|
-
|
|
1809
|
-
**All other values MUST be replaced or flagged.** No exceptions for "decorative" gradients, shadows, or overlays.
|
|
1810
|
-
|
|
1811
|
-
---
|
|
1812
|
-
|
|
1813
|
-
## Sub-fase C: Components
|
|
1814
|
-
|
|
1815
|
-
> **Before starting:** Read `DS_ANALYSIS.md` (§ Component Replacement Candidates) and `DS_PROGRESS.md` (§ Sub-fase C) from the project root.
|
|
1816
|
-
> Also read `data/components.json` from the skill directory to have all component code blocks available.
|
|
1817
|
-
|
|
1818
|
-
Update `DS_PROGRESS.md`: set `Sub-fase C: Components — IN_PROGRESS`.
|
|
1819
|
-
|
|
1820
|
-
**If `stylingMode === 'mui'`: skip directly to Step 6-MUI below.** MUI projects do NOT use Pass 1/2/3 (HTML tag replacement). All visual changes come from MUI theme styleOverrides + sx prop migration.
|
|
1821
|
-
|
|
1822
|
-
### Step 6-MUI — Generate MUI component styleOverrides (only when `stylingMode === 'mui'`)
|
|
1823
|
-
|
|
1824
|
-
#### Step 6-MUI.0 — DS slug to MUI component mapping
|
|
1825
|
-
|
|
1826
|
-
| DS Component (slug) | MUI Component | Theme key |
|
|
1827
|
-
|---|---|---|
|
|
1828
|
-
| `button` | Button, IconButton, LoadingButton | `MuiButton`, `MuiIconButton`, `MuiLoadingButton` |
|
|
1829
|
-
| `text-input` | TextField, OutlinedInput, FilledInput | `MuiTextField`, `MuiOutlinedInput` |
|
|
1830
|
-
| `checkbox` | Checkbox | `MuiCheckbox` |
|
|
1831
|
-
| `radio-button` | Radio | `MuiRadio` |
|
|
1832
|
-
| `switch` | Switch | `MuiSwitch` |
|
|
1833
|
-
| `dropdown` | Select, Autocomplete | `MuiSelect`, `MuiAutocomplete` |
|
|
1834
|
-
| `tooltip` | Tooltip | `MuiTooltip` |
|
|
1835
|
-
| `abas` | Tabs, Tab | `MuiTabs`, `MuiTab` |
|
|
1836
|
-
| `card` | Card, CardContent, CardActions | `MuiCard`, `MuiCardContent` |
|
|
1837
|
-
| `badge` | Badge, Chip | `MuiBadge`, `MuiChip` |
|
|
1838
|
-
| `header` | AppBar, Toolbar | `MuiAppBar`, `MuiToolbar` |
|
|
1839
|
-
| `modal` | Dialog, DialogTitle, DialogContent | `MuiDialog`, `MuiDialogTitle`, `MuiDialogContent` |
|
|
1840
|
-
|
|
1841
|
-
#### Step 6-MUI.1 — Generate styleOverrides block
|
|
1842
|
-
|
|
1843
|
-
For each MUI component detected in `replacementCandidates[]`:
|
|
1844
|
-
|
|
1845
|
-
1. Read the corresponding DS component from `data/components.json` — look up by slug.
|
|
1846
|
-
2. Extract the visual properties (colors, spacing, typography, border-radius) from its `code.css` block.
|
|
1847
|
-
3. Translate each CSS property into a MUI `styleOverrides` entry using DS tokens.
|
|
1848
|
-
|
|
1849
|
-
**Reference template for common MUI components:**
|
|
1850
|
-
|
|
1851
|
-
```typescript
|
|
1852
|
-
components: {
|
|
1853
|
-
MuiButton: {
|
|
1854
|
-
styleOverrides: {
|
|
1855
|
-
root: {
|
|
1856
|
-
fontFamily: 'var(--font-secondary)',
|
|
1857
|
-
fontWeight: 600,
|
|
1858
|
-
textTransform: 'none' as const,
|
|
1859
|
-
borderRadius: 'var(--radius-sm)',
|
|
1860
|
-
transition: 'all 0.15s ease',
|
|
1861
|
-
'&:focus-visible': {
|
|
1862
|
-
outline: '2px solid var(--border-focus)',
|
|
1863
|
-
outlineOffset: '2px',
|
|
1864
|
-
},
|
|
1865
|
-
},
|
|
1866
|
-
containedPrimary: {
|
|
1867
|
-
backgroundColor: 'var(--action-brand-inverse-default)',
|
|
1868
|
-
color: 'var(--content-primary)',
|
|
1869
|
-
'&:hover': { backgroundColor: 'var(--action-brand-inverse-hover)' },
|
|
1870
|
-
'&:active': { backgroundColor: 'var(--action-brand-inverse-active)' },
|
|
1871
|
-
'&.Mui-disabled': {
|
|
1872
|
-
backgroundColor: 'var(--action-brand-inverse-disabled)',
|
|
1873
|
-
color: 'var(--content-disabled)',
|
|
1874
|
-
},
|
|
1875
|
-
},
|
|
1876
|
-
outlinedPrimary: {
|
|
1877
|
-
borderColor: 'var(--action-brand-default)',
|
|
1878
|
-
color: 'var(--action-brand-default)',
|
|
1879
|
-
'&:hover': {
|
|
1880
|
-
borderColor: 'var(--action-brand-hover)',
|
|
1881
|
-
backgroundColor: 'var(--action-brand-alpha)',
|
|
1882
|
-
},
|
|
1883
|
-
},
|
|
1884
|
-
textPrimary: {
|
|
1885
|
-
color: 'var(--action-brand-default)',
|
|
1886
|
-
'&:hover': { backgroundColor: 'var(--action-brand-alpha)' },
|
|
1887
|
-
},
|
|
1888
|
-
},
|
|
1889
|
-
},
|
|
1890
|
-
MuiTextField: {
|
|
1891
|
-
styleOverrides: {
|
|
1892
|
-
root: {
|
|
1893
|
-
'& .MuiOutlinedInput-root': {
|
|
1894
|
-
fontFamily: 'var(--font-secondary)',
|
|
1895
|
-
fontSize: 14,
|
|
1896
|
-
color: 'var(--content-primary)',
|
|
1897
|
-
'& fieldset': { borderColor: 'var(--border-default)' },
|
|
1898
|
-
'&:hover fieldset': { borderColor: 'var(--border-strong)' },
|
|
1899
|
-
'&.Mui-focused fieldset': { borderColor: 'var(--border-focus)' },
|
|
1900
|
-
'&.Mui-error fieldset': { borderColor: 'var(--content-error)' },
|
|
1901
|
-
},
|
|
1902
|
-
'& .MuiInputLabel-root': {
|
|
1903
|
-
color: 'var(--content-tertiary)',
|
|
1904
|
-
fontFamily: 'var(--font-secondary)',
|
|
1905
|
-
'&.Mui-focused': { color: 'var(--content-brand)' },
|
|
1906
|
-
},
|
|
1907
|
-
},
|
|
1908
|
-
},
|
|
1909
|
-
},
|
|
1910
|
-
MuiCard: {
|
|
1911
|
-
styleOverrides: {
|
|
1912
|
-
root: {
|
|
1913
|
-
backgroundColor: 'var(--bg-secondary)',
|
|
1914
|
-
borderRadius: 'var(--radius-md)',
|
|
1915
|
-
border: '1px solid var(--border-subtle)',
|
|
1916
|
-
},
|
|
1917
|
-
},
|
|
1918
|
-
},
|
|
1919
|
-
MuiTooltip: {
|
|
1920
|
-
styleOverrides: {
|
|
1921
|
-
tooltip: {
|
|
1922
|
-
backgroundColor: 'var(--bg-inverse)',
|
|
1923
|
-
color: 'var(--content-inverse)',
|
|
1924
|
-
fontFamily: 'var(--font-secondary)',
|
|
1925
|
-
fontSize: 12,
|
|
1926
|
-
borderRadius: 'var(--radius-sm)',
|
|
1927
|
-
},
|
|
1928
|
-
arrow: { color: 'var(--bg-inverse)' },
|
|
1929
|
-
},
|
|
1930
|
-
},
|
|
1931
|
-
MuiSwitch: {
|
|
1932
|
-
styleOverrides: {
|
|
1933
|
-
root: { width: 44, height: 24, padding: 0 },
|
|
1934
|
-
switchBase: {
|
|
1935
|
-
padding: 4,
|
|
1936
|
-
'&.Mui-checked': {
|
|
1937
|
-
color: 'var(--content-primary)',
|
|
1938
|
-
'& + .MuiSwitch-track': {
|
|
1939
|
-
backgroundColor: 'var(--action-brand-default)',
|
|
1940
|
-
opacity: 1,
|
|
1941
|
-
},
|
|
1942
|
-
},
|
|
1943
|
-
},
|
|
1944
|
-
track: {
|
|
1945
|
-
borderRadius: 'var(--radius-full)',
|
|
1946
|
-
backgroundColor: 'var(--surface-primary)',
|
|
1947
|
-
opacity: 1,
|
|
1948
|
-
},
|
|
1949
|
-
thumb: { width: 16, height: 16 },
|
|
1950
|
-
},
|
|
1951
|
-
},
|
|
1952
|
-
MuiCheckbox: {
|
|
1953
|
-
styleOverrides: {
|
|
1954
|
-
root: {
|
|
1955
|
-
color: 'var(--border-default)',
|
|
1956
|
-
'&.Mui-checked': { color: 'var(--action-brand-default)' },
|
|
1957
|
-
'&.Mui-disabled': { color: 'var(--content-disabled)' },
|
|
1958
|
-
},
|
|
1959
|
-
},
|
|
1960
|
-
},
|
|
1961
|
-
MuiRadio: {
|
|
1962
|
-
styleOverrides: {
|
|
1963
|
-
root: {
|
|
1964
|
-
color: 'var(--border-default)',
|
|
1965
|
-
'&.Mui-checked': { color: 'var(--action-brand-default)' },
|
|
1966
|
-
},
|
|
1967
|
-
},
|
|
1968
|
-
},
|
|
1969
|
-
MuiTabs: {
|
|
1970
|
-
styleOverrides: {
|
|
1971
|
-
indicator: { backgroundColor: 'var(--action-brand-default)' },
|
|
1972
|
-
},
|
|
1973
|
-
},
|
|
1974
|
-
MuiTab: {
|
|
1975
|
-
styleOverrides: {
|
|
1976
|
-
root: {
|
|
1977
|
-
fontFamily: 'var(--font-secondary)',
|
|
1978
|
-
fontWeight: 600,
|
|
1979
|
-
textTransform: 'none',
|
|
1980
|
-
color: 'var(--content-tertiary)',
|
|
1981
|
-
'&.Mui-selected': { color: 'var(--content-brand)' },
|
|
1982
|
-
},
|
|
1983
|
-
},
|
|
1984
|
-
},
|
|
1985
|
-
MuiChip: {
|
|
1986
|
-
styleOverrides: {
|
|
1987
|
-
root: {
|
|
1988
|
-
fontFamily: 'var(--font-secondary)',
|
|
1989
|
-
borderRadius: 'var(--radius-sm)',
|
|
1990
|
-
},
|
|
1991
|
-
colorPrimary: {
|
|
1992
|
-
backgroundColor: 'var(--surface-brand)',
|
|
1993
|
-
color: 'var(--content-brand)',
|
|
1994
|
-
},
|
|
1995
|
-
colorSuccess: {
|
|
1996
|
-
backgroundColor: 'var(--surface-success)',
|
|
1997
|
-
color: 'var(--content-success)',
|
|
1998
|
-
},
|
|
1999
|
-
colorWarning: {
|
|
2000
|
-
backgroundColor: 'var(--surface-warning)',
|
|
2001
|
-
color: 'var(--content-warning)',
|
|
2002
|
-
},
|
|
2003
|
-
colorError: {
|
|
2004
|
-
backgroundColor: 'var(--surface-error)',
|
|
2005
|
-
color: 'var(--content-error)',
|
|
2006
|
-
},
|
|
2007
|
-
},
|
|
2008
|
-
},
|
|
2009
|
-
MuiDialog: {
|
|
2010
|
-
styleOverrides: {
|
|
2011
|
-
paper: {
|
|
2012
|
-
backgroundColor: 'var(--bg-secondary)',
|
|
2013
|
-
borderRadius: 'var(--radius-md)',
|
|
2014
|
-
border: '1px solid var(--border-subtle)',
|
|
2015
|
-
},
|
|
2016
|
-
},
|
|
2017
|
-
},
|
|
2018
|
-
MuiAppBar: {
|
|
2019
|
-
styleOverrides: {
|
|
2020
|
-
root: {
|
|
2021
|
-
backgroundColor: 'var(--bg-secondary)',
|
|
2022
|
-
borderBottom: '1px solid var(--border-subtle)',
|
|
2023
|
-
boxShadow: 'none',
|
|
2024
|
-
},
|
|
2025
|
-
},
|
|
2026
|
-
},
|
|
2027
|
-
MuiSelect: {
|
|
2028
|
-
styleOverrides: {
|
|
2029
|
-
root: {
|
|
2030
|
-
fontFamily: 'var(--font-secondary)',
|
|
2031
|
-
fontSize: 14,
|
|
2032
|
-
},
|
|
2033
|
-
},
|
|
2034
|
-
},
|
|
2035
|
-
},
|
|
2036
|
-
```
|
|
2037
|
-
|
|
2038
|
-
**IMPORTANT:** This template is a REFERENCE. For each project:
|
|
2039
|
-
1. Only include `MuiXxx` entries for components actually detected in `replacementCandidates[]`
|
|
2040
|
-
2. Read the DS component's `code.css` for accurate token values — the template above covers the most common tokens, but individual components may have specific values
|
|
2041
|
-
3. If the DS component has variants (e.g., button primary/secondary/ghost), map each to the appropriate MUI variant prop or className
|
|
2042
|
-
|
|
2043
|
-
#### Step 6-MUI.2 — Insert styleOverrides into theme file
|
|
2044
|
-
|
|
2045
|
-
Read the existing theme file (`themeFilePath`). Find the `components: {}` block (or create it if absent). Merge the generated styleOverrides:
|
|
2046
|
-
|
|
2047
|
-
- If a `MuiXxx` key already exists in the theme: **MERGE** the DS overrides into the existing overrides, preserving any project-specific customizations that do not conflict with DS tokens
|
|
2048
|
-
- If a `MuiXxx` key does NOT exist: ADD the DS override block
|
|
2049
|
-
- **NEVER** overwrite project-specific `defaultProps`, `variants`, or slot customizations
|
|
2050
|
-
|
|
2051
|
-
#### Step 6-MUI.3 — Process individual sx prop violations
|
|
2052
|
-
|
|
2053
|
-
For components with `sx-migration` classification in `replacementCandidates[]`:
|
|
2054
|
-
|
|
2055
|
-
1. Read each sx prop with hardcoded values
|
|
2056
|
-
2. Replace with token references:
|
|
2057
|
-
```tsx
|
|
2058
|
-
// Before
|
|
2059
|
-
<Box sx={{ backgroundColor: '#141519', padding: '16px', borderRadius: '8px' }}>
|
|
2060
|
-
// After
|
|
2061
|
-
<Box sx={{ backgroundColor: 'var(--bg-secondary)', padding: 'var(--spacing-lg)', borderRadius: 'var(--radius-md)' }}>
|
|
2062
|
-
```
|
|
2063
|
-
3. If the sx prop becomes empty after migration (all values now come from theme), consider removing it
|
|
2064
|
-
4. Preserve all layout-related sx values (display, flex, grid, position) as-is
|
|
2065
|
-
|
|
2066
|
-
#### Step 6-MUI.4 — Process styled(MuiComponent) violations
|
|
2067
|
-
|
|
2068
|
-
For components with `styled-migration` classification:
|
|
2069
|
-
|
|
2070
|
-
1. Replace hardcoded values inside `styled()` calls with `'var(--token)'`
|
|
2071
|
-
2. Preserve all theme-based logic (`theme.breakpoints`, `theme.palette.*` references, `theme.spacing()`)
|
|
2072
|
-
3. If the styled() call uses `({ theme }) =>` destructuring: theme references will now pull from the updated theme with DS tokens — this is correct and expected
|
|
2073
|
-
|
|
2074
|
-
#### Step 6-MUI.5 — Skip HTML tag replacement
|
|
2075
|
-
|
|
2076
|
-
Do NOT run Pass 1/2/3 (HTML tag replacement) for MUI projects. Jump directly to updating DS_PROGRESS.md after completing Steps 6-MUI.1 through 6-MUI.4.
|
|
2077
|
-
|
|
2078
|
-
Document in `DS_PROGRESS.md` each styleOverride generated and each sx prop migrated:
|
|
2079
|
-
```
|
|
2080
|
-
## Sub-fase C: Components — ✅ COMPLETE
|
|
2081
|
-
- [x] MuiButton — styleOverrides (containedPrimary, outlinedPrimary, textPrimary)
|
|
2082
|
-
- [x] MuiTextField — styleOverrides (root, label, fieldset states)
|
|
2083
|
-
- [x] MuiCard — styleOverrides (root)
|
|
2084
|
-
- [x] sx migrations: [N] files, [M] values replaced
|
|
2085
|
-
- [x] styled() migrations: [N] files
|
|
2086
|
-
```
|
|
2087
|
-
|
|
2088
|
-
Output:
|
|
2089
|
-
```
|
|
2090
|
-
✅ Sub-fase C completa — [N] MUI component styleOverrides gerados, [M] sx props migrados.
|
|
2091
|
-
|
|
2092
|
-
Próximo: Sub-fase D — Final (logos, ícones, DS_MIGRATION.md)
|
|
2093
|
-
Responda:
|
|
2094
|
-
- "continuar" / "continue" — iniciar Sub-fase D
|
|
2095
|
-
- "parar" / "stop" — salvar progresso e parar aqui
|
|
2096
|
-
- "não funcionou" / "report" — reportar problema ao maintainer
|
|
2097
|
-
```
|
|
2098
|
-
|
|
2099
|
-
**STOP HERE. Wait for developer reply before starting Sub-fase D.**
|
|
2100
|
-
If the developer indicates the implementation didn't work (see DEVELOPER DISSATISFACTION DETECTION below), trigger REPORT MODE.
|
|
2101
|
-
|
|
2102
|
-
---
|
|
2103
|
-
|
|
2104
|
-
**For non-MUI projects (`stylingMode !== 'mui'`), continue with the standard Step 6 below:**
|
|
2105
|
-
|
|
2106
|
-
### Step 6 — Implement DS components in project files
|
|
2107
|
-
|
|
2108
|
-
#### Step 6.0 — Resolve dependency order
|
|
2109
|
-
|
|
2110
|
-
Components in `data/components.json` may have a `dependencies` array listing slugs of sub-components they use (e.g., `boleta` depends on `["segmented-control", "text-input", "checkbox", "button", "dropdown"]`). Before processing candidates:
|
|
2111
|
-
|
|
2112
|
-
1. Read the `dependencies` field of every candidate component from `data/components.json`.
|
|
2113
|
-
2. Build a topological order: **atomic components** (empty `dependencies`) first, then **compound components** (non-empty `dependencies`) sorted so that each component's dependencies appear before it.
|
|
2114
|
-
3. Process candidates in this order across all three passes below. Within the same pass, respect the topological order.
|
|
2115
|
-
|
|
2116
|
-
This ensures that when a compound component's code block imports a sub-component (e.g., `import Badge from './Badge'`), the sub-component's DS class is already installed in the project.
|
|
2117
|
-
|
|
2118
|
-
If a dependency is NOT in the candidate list (i.e., no existing element in the project matched that atomic component), skip it — the compound component's code block will still reference the DS class, and the sub-component can be added later.
|
|
2119
|
-
|
|
2120
|
-
---
|
|
2121
|
-
|
|
2122
|
-
Process candidates in three passes (respecting the dependency order above):
|
|
2123
|
-
1. **Pass 1** — Simple replacements (full DS component swap)
|
|
2124
|
-
2. **Pass 2** — Complex-preservable (DS structure + logic preservation)
|
|
2125
|
-
3. **Pass 3** — Manual review flagging (no auto-modification)
|
|
2126
|
-
|
|
2127
|
-
---
|
|
2128
|
-
|
|
2129
|
-
#### Step 6 — Pass 1: Simple replacements
|
|
2130
|
-
|
|
2131
|
-
For each candidate classified as `simple` in DS_ANALYSIS.md:
|
|
2132
|
-
|
|
2133
|
-
1. **Load the DS component code** from `data/components.json` — look up the component by slug and read `c.code.html` (for plain-css/tailwind projects) or `c.code.react` (for React/Next.js projects) or adapt for Vue.
|
|
2134
|
-
|
|
2135
|
-
2. **Adapt the content** — the DS component's code block has placeholder content (e.g., "Confirmar", "Badge"). Replace placeholders with the ACTUAL content from the project:
|
|
2136
|
-
- Button text: extract the text content from the existing `<button>` element
|
|
2137
|
-
- Input placeholder: extract the existing `placeholder` attribute
|
|
2138
|
-
- Label text: extract the existing label/text node
|
|
2139
|
-
- Badge text: extract the existing text content
|
|
2140
|
-
- Preserve `id`, `name`, `data-*`, `aria-*` attributes from the original element
|
|
2141
|
-
|
|
2142
|
-
3. **Select the correct variant** using `suggestedDsVariant` from DS_ANALYSIS.md.
|
|
2143
|
-
|
|
2144
|
-
4. **Replace the element in the source file** — examples by component:
|
|
2145
|
-
|
|
2146
|
-
**Buttons (slug: `button`):**
|
|
2147
|
-
```html
|
|
2148
|
-
<!-- BEFORE -->
|
|
2149
|
-
<button class="btn-primary hero-cta">Get Started</button>
|
|
2150
|
-
<!-- AFTER -->
|
|
2151
|
-
<button class="trdr-btn trdr-btn-primary">Get Started</button>
|
|
2152
|
-
```
|
|
2153
|
-
- Remove custom CSS classes that duplicate DS styles (background, padding, height, font, border, border-radius, cursor, transition)
|
|
2154
|
-
- Keep classes used for layout/positioning (margin, width, grid placement)
|
|
2155
|
-
- Keep `id`, `name`, `type`, `data-*`, `aria-*` attributes
|
|
2156
|
-
|
|
2157
|
-
**Text inputs (slug: `text-input`):**
|
|
2158
|
-
```html
|
|
2159
|
-
<!-- BEFORE -->
|
|
2160
|
-
<input type="text" class="search-bar" placeholder="Search...">
|
|
2161
|
-
<!-- AFTER -->
|
|
2162
|
-
<input type="text" class="trdr-text-input" placeholder="Search...">
|
|
2163
|
-
```
|
|
2164
|
-
- If the existing input has a wrapper with icon (search icon + input), restructure to match DS anatomy:
|
|
2165
|
-
```html
|
|
2166
|
-
<div class="trdr-text-input-wrapper">
|
|
2167
|
-
<span class="material-icons mi-sm icon-muted">search</span>
|
|
2168
|
-
<input type="text" class="trdr-text-input" placeholder="Search...">
|
|
2169
|
-
</div>
|
|
2170
|
-
```
|
|
2171
|
-
|
|
2172
|
-
**Checkboxes (slug: `checkbox`):**
|
|
2173
|
-
```html
|
|
2174
|
-
<!-- BEFORE -->
|
|
2175
|
-
<input type="checkbox" id="terms"> <label for="terms">Accept terms</label>
|
|
2176
|
-
<!-- AFTER -->
|
|
2177
|
-
<label class="trdr-checkbox">
|
|
2178
|
-
<input type="checkbox" id="terms" />
|
|
2179
|
-
<span class="trdr-checkbox-box"></span>
|
|
2180
|
-
<span>Accept terms</span>
|
|
2181
|
-
</label>
|
|
2182
|
-
```
|
|
2183
|
-
- DS checkbox requires a specific DOM structure (label > input + box-span + text-span)
|
|
2184
|
-
- Preserve `id`, `name`, `checked`, `disabled` attributes from the original input
|
|
2185
|
-
|
|
2186
|
-
**Radio buttons (slug: `radio-button`):**
|
|
2187
|
-
Similar to checkbox — restructure to DS anatomy while preserving `name`, `value`, `checked`.
|
|
2188
|
-
|
|
2189
|
-
**Switches (slug: `switch`):**
|
|
2190
|
-
```html
|
|
2191
|
-
<!-- BEFORE -->
|
|
2192
|
-
<div class="toggle"><input type="checkbox"></div>
|
|
2193
|
-
<!-- AFTER -->
|
|
2194
|
-
<button class="trdr-switch" role="switch" aria-checked="false">
|
|
2195
|
-
<span class="trdr-switch-track"><span class="trdr-switch-knob"></span></span>
|
|
2196
|
-
<span>Label text</span>
|
|
2197
|
-
</button>
|
|
2198
|
-
```
|
|
2199
|
-
|
|
2200
|
-
**Dropdowns (slug: `dropdown`):**
|
|
2201
|
-
```html
|
|
2202
|
-
<!-- BEFORE -->
|
|
2203
|
-
<select class="lang-selector"><option>PT</option><option>EN</option></select>
|
|
2204
|
-
<!-- AFTER -->
|
|
2205
|
-
<select class="trdr-dropdown"><option>PT</option><option>EN</option></select>
|
|
2206
|
-
```
|
|
2207
|
-
- Preserve all `<option>` children, `name`, `id`, `value` attributes
|
|
2208
|
-
|
|
2209
|
-
**Badges (slug: `badge`):**
|
|
2210
|
-
```html
|
|
2211
|
-
<!-- BEFORE -->
|
|
2212
|
-
<span class="badge badge-success">Active</span>
|
|
2213
|
-
<!-- AFTER -->
|
|
2214
|
-
<span class="trdr-badge trdr-badge-success">Active</span>
|
|
2215
|
-
```
|
|
2216
|
-
- Detect variant from existing color/class: green/success → `trdr-badge-success`, blue/brand → `trdr-badge-brand`, etc.
|
|
2217
|
-
|
|
2218
|
-
**Segmented controls / tabs (slug: `segmented-control`, `abas`):**
|
|
2219
|
-
```html
|
|
2220
|
-
<!-- BEFORE -->
|
|
2221
|
-
<div class="tabs">
|
|
2222
|
-
<button class="tab active">Tab 1</button>
|
|
2223
|
-
<button class="tab">Tab 2</button>
|
|
2224
|
-
</div>
|
|
2225
|
-
<!-- AFTER -->
|
|
2226
|
-
<div class="trdr-segment-control">
|
|
2227
|
-
<button class="trdr-segment trdr-segment-active">Tab 1</button>
|
|
2228
|
-
<button class="trdr-segment trdr-segment-inactive">Tab 2</button>
|
|
2229
|
-
</div>
|
|
2230
|
-
```
|
|
2231
|
-
|
|
2232
|
-
**Tooltips (slug: `tooltip`):**
|
|
2233
|
-
- If `title=""` attribute: remove `title`, add DS tooltip structure around the element
|
|
2234
|
-
- If `data-tooltip=""`: adapt to DS tooltip pattern
|
|
2235
|
-
- Preserve the tooltip content text
|
|
2236
|
-
|
|
2237
|
-
5. **Icons inside replaced components:** When the original element contained an inline SVG icon (e.g., Button with search icon), replace that SVG immediately with a Material Icon `<span>` using the correct size class from Step 6.6c-2 rules. Do NOT leave inline SVGs inside new DS component structures — this is an exception to "SVG replacement happens in Sub-fase D."
|
|
2238
|
-
|
|
2239
|
-
6. **Clean up redundant CSS** — for each replaced element's custom class, remove properties now provided by DS:
|
|
2240
|
-
- Remove: `height`, `padding`, `font-family`, `font-size`, `font-weight`, `border`, `border-radius`, `background`, `color`, `cursor`, `transition`, `display`, `align-items`, `justify-content`
|
|
2241
|
-
- Keep: `width`, `min-width`, `gap`, position-specific props, state overrides, layout props (margin, grid-area)
|
|
2242
|
-
|
|
2243
|
-
7. **Document in DS_PROGRESS.md** each replacement:
|
|
2244
|
-
```
|
|
2245
|
-
- [x] button: src/Hero.tsx:42 — "Get Started" → trdr-btn-primary (simple swap)
|
|
2246
|
-
```
|
|
2247
|
-
|
|
2248
|
-
---
|
|
2249
|
-
|
|
2250
|
-
#### Step 6 — Pass 2: Complex-preservable replacements
|
|
2251
|
-
|
|
2252
|
-
For each candidate classified as `complex-preservable` in DS_ANALYSIS.md:
|
|
2253
|
-
|
|
2254
|
-
1. **Read the full element context** — read the file and identify all:
|
|
2255
|
-
- Event handlers: `onClick`, `onChange`, `onSubmit`, `onKeyDown`, `onFocus`, `onBlur`, etc.
|
|
2256
|
-
- Conditional rendering: ternary expressions, `&&` conditionals
|
|
2257
|
-
- Dynamic props: `className={...}`, `style={...}`, spread props `{...rest}`
|
|
2258
|
-
- Data bindings: `value={state}`, `checked={state}`, `ref={ref}`
|
|
2259
|
-
|
|
2260
|
-
2. **Apply DS structure while preserving all logic, using one of two strategies:**
|
|
2261
|
-
|
|
2262
|
-
**Strategy A — Class addition (when existing DOM structure is compatible with DS):**
|
|
2263
|
-
The element's DOM structure is close enough to the DS component. Add DS classes and remove conflicting custom CSS.
|
|
2264
|
-
```tsx
|
|
2265
|
-
// BEFORE
|
|
2266
|
-
<button
|
|
2267
|
-
className={`btn ${isActive ? 'btn-active' : ''}`}
|
|
2268
|
-
onClick={handleClick}
|
|
2269
|
-
disabled={isLoading}
|
|
2270
|
-
>
|
|
2271
|
-
{isLoading ? 'Loading...' : 'Submit'}
|
|
2272
|
-
</button>
|
|
2273
|
-
|
|
2274
|
-
// AFTER — DS classes added, handlers/bindings preserved
|
|
2275
|
-
<button
|
|
2276
|
-
className={`trdr-btn trdr-btn-primary ${isActive ? 'btn-active' : ''}`}
|
|
2277
|
-
onClick={handleClick}
|
|
2278
|
-
disabled={isLoading}
|
|
2279
|
-
>
|
|
2280
|
-
{isLoading ? 'Loading...' : 'Submit'}
|
|
2281
|
-
</button>
|
|
2282
|
-
```
|
|
2283
|
-
|
|
2284
|
-
**Strategy B — Structure wrap (when DS component requires different DOM structure):**
|
|
2285
|
-
The element needs DS DOM structure but has logic that must stay.
|
|
2286
|
-
```tsx
|
|
2287
|
-
// BEFORE — checkbox with complex state
|
|
2288
|
-
<div className="filter-option">
|
|
2289
|
-
<input
|
|
2290
|
-
type="checkbox"
|
|
2291
|
-
id={`filter-${id}`}
|
|
2292
|
-
checked={filters.includes(id)}
|
|
2293
|
-
onChange={() => toggleFilter(id)}
|
|
2294
|
-
/>
|
|
2295
|
-
<label htmlFor={`filter-${id}`}>{label}</label>
|
|
2296
|
-
</div>
|
|
2297
|
-
|
|
2298
|
-
// AFTER — DS checkbox structure, ALL logic preserved
|
|
2299
|
-
<label className="trdr-checkbox">
|
|
2300
|
-
<input
|
|
2301
|
-
type="checkbox"
|
|
2302
|
-
id={`filter-${id}`}
|
|
2303
|
-
checked={filters.includes(id)}
|
|
2304
|
-
onChange={() => toggleFilter(id)}
|
|
2305
|
-
/>
|
|
2306
|
-
<span className="trdr-checkbox-box"></span>
|
|
2307
|
-
<span>{label}</span>
|
|
2308
|
-
</label>
|
|
2309
|
-
```
|
|
2310
|
-
|
|
2311
|
-
3. **NEVER remove or alter any of the following** (absolute rule):
|
|
2312
|
-
- `onClick`, `onChange`, `onSubmit`, `onKeyDown`, `onFocus`, `onBlur` handlers
|
|
2313
|
-
- `ref=`, `key=` props
|
|
2314
|
-
- `disabled={condition}`, `checked={condition}`, `value={state}` bindings
|
|
2315
|
-
- Conditional rendering (`{condition && ...}`, `{condition ? ... : ...}`)
|
|
2316
|
-
- Spread props (`{...rest}`, `{...props}`)
|
|
2317
|
-
- `id`, `name`, `data-*`, `aria-*` attributes
|
|
2318
|
-
- Custom `className` parts used in JS selectors (`querySelector`, `classList.toggle`)
|
|
2319
|
-
|
|
2320
|
-
4. **For dynamically-toggled classes** (e.g., `classList.toggle('active')`):
|
|
2321
|
-
- Map the custom state class to a DS state class
|
|
2322
|
-
- Update ALL `classList.toggle/add/remove` calls to also toggle the DS class
|
|
2323
|
-
- Example: `el.classList.toggle('active')` → also add `el.classList.toggle('trdr-segment-active')`
|
|
2324
|
-
|
|
2325
|
-
5. **Clean up redundant CSS** — same rules as Pass 1 step 6.
|
|
2326
|
-
|
|
2327
|
-
6. **Document in DS_PROGRESS.md:**
|
|
2328
|
-
```
|
|
2329
|
-
- [x] checkbox: src/Filters.tsx:88 — preserved: onChange, checked binding → trdr-checkbox (complex-preservable, Strategy B)
|
|
2330
|
-
```
|
|
2331
|
-
|
|
2332
|
-
---
|
|
2333
|
-
|
|
2334
|
-
#### Step 6 — Pass 3: Manual review flagging
|
|
2335
|
-
|
|
2336
|
-
For each candidate classified as `complex-manual` in DS_ANALYSIS.md:
|
|
2337
|
-
|
|
2338
|
-
1. **Do NOT modify** the source file's component structure.
|
|
2339
|
-
|
|
2340
|
-
2. **Add a TODO comment** in the source file above the element:
|
|
2341
|
-
```
|
|
2342
|
-
<!-- TODO: TRDR DS — replace with [c.name] component. See DS_MIGRATION.md for details. -->
|
|
2343
|
-
```
|
|
2344
|
-
For React/JSX:
|
|
2345
|
-
```
|
|
2346
|
-
{/* TODO: TRDR DS — replace with [c.name] component. See DS_MIGRATION.md for details. */}
|
|
2347
|
-
```
|
|
2348
|
-
|
|
2349
|
-
3. **Add an entry to `DS_MIGRATION.md`** under `## Manual component review`:
|
|
2350
|
-
```markdown
|
|
2351
|
-
### [file:line] — [c.name]
|
|
2352
|
-
- **Reason:** [brief description of complexity]
|
|
2353
|
-
- **Existing structure:** [brief DOM outline]
|
|
2354
|
-
- **Suggested DS component:** [slug] ([variant])
|
|
2355
|
-
- **Suggested approach:** Strategy A (class addition) / Strategy B (structure wrap) / custom adaptation
|
|
2356
|
-
- **Handlers to preserve:** [list of event handlers found]
|
|
2357
|
-
- **Dynamic props:** [list of dynamic bindings]
|
|
2358
|
-
```
|
|
2359
|
-
|
|
2360
|
-
---
|
|
2361
|
-
|
|
2362
|
-
#### Step 6 — Stubs and unmapped patterns
|
|
2363
|
-
|
|
2364
|
-
**If `c.implemented === false`** (stub — not yet implemented in DS):
|
|
2365
|
-
- Add this banner comment above the affected element in the source file:
|
|
2366
|
-
```
|
|
2367
|
-
/* TRDR DS — <c.name> (figmaId: <c.figmaId>) */
|
|
2368
|
-
/* Implementação canônica pendente. Consulte https://trdr.mrocontent.com.br/componentes/<c.slug> */
|
|
2369
|
-
/* Tokens recomendados: <list c.tokens[].token> */
|
|
2370
|
-
```
|
|
2371
|
-
- Append an entry to `MISSING_COMPONENTS.md`:
|
|
2372
|
-
```markdown
|
|
2373
|
-
## <c.name>
|
|
2374
|
-
- Slug: `<c.slug>` | figmaId: `<c.figmaId>` | Category: `<c.category>`
|
|
2375
|
-
- Found in: <list of file:line>
|
|
2376
|
-
- Description: <c.description>
|
|
2377
|
-
- Recommended tokens: <c.tokens[]>
|
|
2378
|
-
- Status: ⚠️ stub — code blocks pending
|
|
2379
|
-
```
|
|
2380
|
-
|
|
2381
|
-
**If no slug matches** the detected pattern:
|
|
2382
|
-
- Flag the pattern in `MISSING_COMPONENTS.md` under "Unmapped patterns" with the file location and a one-line description of the UI need.
|
|
2383
|
-
|
|
2384
|
-
**Do NOT replace domain-specific components** (course cards, lesson rows, trading panels, etc.) — document them as "sem equivalente DS".
|
|
2385
|
-
|
|
2386
|
-
---
|
|
2387
|
-
|
|
2388
|
-
#### Step 6 — Final: Update progress
|
|
2389
|
-
|
|
2390
|
-
Update `DS_PROGRESS.md`: set `Sub-fase C: Components — ✅ COMPLETE` and add summary:
|
|
2391
20
|
```
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
21
|
+
trdr-ds/
|
|
22
|
+
├── SKILL.md ← YOU ARE HERE (router + sprint orchestration)
|
|
23
|
+
├── phases/
|
|
24
|
+
│ ├── analyze.md ← Phase 1: scan project, find violations, plan sprints
|
|
25
|
+
│ ├── foundation.md ← Sub-fase A: tokens.css, components.css, CLAUDE.md, imports
|
|
26
|
+
│ ├── violations.md ← Sub-fase B: fix violations batch-by-batch
|
|
27
|
+
│ ├── components.md ← Sub-fase C: apply DS component classes
|
|
28
|
+
│ └── final.md ← Sub-fase D: logos, icons, inline styles, DS_MIGRATION.md
|
|
29
|
+
├── modes/
|
|
30
|
+
│ ├── resume.md ← Resume from last checkpoint
|
|
31
|
+
│ ├── status.md ← Show sprint progress
|
|
32
|
+
│ ├── rollback.md ← Undo entire migration
|
|
33
|
+
│ ├── report.md ← Generate & send bug report
|
|
34
|
+
│ └── sync.md ← Re-fetch Hub snapshots
|
|
35
|
+
├── data/
|
|
36
|
+
│ ├── components/ ← One JSON file per component (button.json, checkbox.json, ...)
|
|
37
|
+
│ ├── index.json ← Component catalog index (slugs, names, categories, implemented flag)
|
|
38
|
+
│ └── mappings.json ← Color/font/spacing/rgba/gradient mapping tables
|
|
39
|
+
├── references/
|
|
40
|
+
│ ├── tokens.css ← All TRDR CSS variables (dark + light mode)
|
|
41
|
+
│ ├── rules.md ← 12 absolute rules
|
|
42
|
+
│ └── logo-trdr.svg ← Official TRDR logo
|
|
43
|
+
└── templates/
|
|
44
|
+
├── ds-analysis.md ← Template for DS_ANALYSIS.md
|
|
45
|
+
├── ds-progress.md ← Template for DS_PROGRESS.md
|
|
46
|
+
├── sprint-plan.md ← Template for SPRINT_PLAN.md
|
|
47
|
+
├── claude-md.md ← Template for project CLAUDE.md
|
|
48
|
+
└── ds-migration.md ← Template for DS_MIGRATION.md
|
|
2400
49
|
```
|
|
2401
50
|
|
|
2402
|
-
|
|
2403
|
-
```
|
|
2404
|
-
✅ Sub-fase C completa — [N] componentes DS implementados ([S] simple, [P] complex-preservable), [M] flagged para revisão manual, [T] stubs marcados.
|
|
51
|
+
## Offline-first Snapshots
|
|
2405
52
|
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
-
|
|
2409
|
-
- "parar" / "stop" — salvar progresso e parar aqui
|
|
2410
|
-
- "não funcionou" / "report" — reportar problema ao maintainer
|
|
2411
|
-
```
|
|
53
|
+
- `references/tokens.css` — all TRDR CSS variables, copied from Hub
|
|
54
|
+
- `data/components/` — individual component files with code blocks
|
|
55
|
+
- `data/index.json` — catalog index (lightweight, always loaded)
|
|
2412
56
|
|
|
2413
|
-
|
|
2414
|
-
If the developer indicates the implementation didn't work (see DEVELOPER DISSATISFACTION DETECTION below), trigger REPORT MODE.
|
|
57
|
+
Snapshots synced via `npm run sync` in trdr-plugins repo. **Always prefer local snapshots.** Only fetch from Hub when user passes `--latest` or runs `sync`.
|
|
2415
58
|
|
|
2416
59
|
---
|
|
2417
60
|
|
|
2418
|
-
##
|
|
2419
|
-
|
|
2420
|
-
> **Before starting:** Read `DS_ANALYSIS.md` (§ Logo Audit) and `DS_PROGRESS.md` from the project root.
|
|
2421
|
-
|
|
2422
|
-
Update `DS_PROGRESS.md`: set `Sub-fase D: Final — IN_PROGRESS`.
|
|
2423
|
-
|
|
2424
|
-
### Step 6.5 — Replace wrong logos and fix logo usage in HTML/JSX
|
|
61
|
+
## Argument Routing
|
|
2425
62
|
|
|
2426
|
-
|
|
63
|
+
| Arg | Action | File to Read |
|
|
64
|
+
|-----|--------|-------------|
|
|
65
|
+
| *(none)* / `analyze` | Scan project, generate plan | `phases/analyze.md` |
|
|
66
|
+
| `apply` | Analyze + execute all phases | `phases/analyze.md` → then route per sprint |
|
|
67
|
+
| `foundation` | Sub-fase A only | `phases/foundation.md` |
|
|
68
|
+
| `violations` | Sub-fase B only | `phases/violations.md` |
|
|
69
|
+
| `components` | Sub-fase C only | `phases/components.md` |
|
|
70
|
+
| `final` | Sub-fase D only | `phases/final.md` |
|
|
71
|
+
| `resume` | Continue from checkpoint | `modes/resume.md` |
|
|
72
|
+
| `status` | Show progress table | `modes/status.md` |
|
|
73
|
+
| `sync` | Re-fetch Hub data | `modes/sync.md` |
|
|
74
|
+
| `rollback` | Undo migration | `modes/rollback.md` |
|
|
75
|
+
| `report` | Send bug report | `modes/report.md` |
|
|
76
|
+
| `batch N` | Override batch size | Set batch_size=N, then route as `apply` |
|
|
77
|
+
| `--latest` | Sync first, then continue | Run `modes/sync.md` first, then route normally |
|
|
2427
78
|
|
|
2428
|
-
|
|
2429
|
-
```
|
|
2430
|
-
Read: <skill-dir>/references/logo-trdr.svg
|
|
2431
|
-
```
|
|
2432
|
-
|
|
2433
|
-
Where `<skill-dir>` is `~/.claude/skills/trdr-ds/` or `<project>/.claude/skills/trdr-ds/`. Try both.
|
|
2434
|
-
|
|
2435
|
-
If `references/logo-trdr.svg` is missing from the skill directory → STOP with:
|
|
2436
|
-
> ❌ Logo reference missing. Run `npx trdr-ds-install@latest` to restore it.
|
|
79
|
+
**Routing procedure:**
|
|
2437
80
|
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
- Write the official logo to `public/logo-trdr.svg`.
|
|
2444
|
-
- Report: `✅ Added official TRDR logo → public/logo-trdr.svg`
|
|
2445
|
-
|
|
2446
|
-
If no logo files found AND no `public/` exists:
|
|
2447
|
-
- Log in DS_MIGRATION.md under "Manual steps": "Add logo-trdr.svg to your assets directory. Reference: <skill-dir>/references/logo-trdr.svg"
|
|
2448
|
-
|
|
2449
|
-
**Never modify correct logos** (`logoAudit.correct`) — they already match the official reference.
|
|
81
|
+
1. Parse the argument from the user's invocation
|
|
82
|
+
2. Run the version check (Step 0 below)
|
|
83
|
+
3. Read **ONLY** the file indicated in the table above
|
|
84
|
+
4. Execute the instructions in that file
|
|
85
|
+
5. When a phase completes and the next phase should run, read the NEXT file — never preload
|
|
2450
86
|
|
|
2451
87
|
---
|
|
2452
88
|
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
After the SVG is on disk, scan for incorrect logo usage in HTML/JSX/Vue files and replace by framework:
|
|
2456
|
-
|
|
2457
|
-
**Plain HTML:**
|
|
2458
|
-
- `<span [class]>TRDR</span>` used as logo → `<img src="logo-trdr.svg" alt="TRDR" height="[N]">` (preserve the original height or use 24px default)
|
|
2459
|
-
- `<img src="[any-non-official-logo]">` → update `src` to `"logo-trdr.svg"`
|
|
2460
|
-
- Remove any `style=""` attribute from the logo element after replacement
|
|
2461
|
-
|
|
2462
|
-
**React / Next.js:**
|
|
2463
|
-
- `import Logo from './[non-official-logo]'` → `import LogoTrdr from './logo-trdr.svg'` (or from `@/public/logo-trdr.svg`)
|
|
2464
|
-
- `<Image src="[non-official]" />` → `<Image src="/logo-trdr.svg" alt="TRDR" />`
|
|
2465
|
-
- `<span>TRDR</span>` in a logo context → `<Image src="/logo-trdr.svg" alt="TRDR" height={24} width={105} />`
|
|
2466
|
-
- Remove `style={{...}}` from the logo element after replacement
|
|
2467
|
-
|
|
2468
|
-
**Vue / Nuxt:**
|
|
2469
|
-
- `:src="[non-official-logo-var]"` → update to `"/logo-trdr.svg"` (static string)
|
|
2470
|
-
- `<span>TRDR</span>` → `<img src="/logo-trdr.svg" alt="TRDR" :height="24" />`
|
|
2471
|
-
|
|
2472
|
-
Update `DS_PROGRESS.md`:
|
|
2473
|
-
```
|
|
2474
|
-
- [x] logos incorretos substituídos — [N] SVG replaced, [M] HTML usages fixed, [P] already correct
|
|
2475
|
-
```
|
|
2476
|
-
|
|
2477
|
-
### Step 6.6 — Replace inline SVG icons with icon library (Category J violations)
|
|
2478
|
-
|
|
2479
|
-
If Category J detected inline `<svg>` elements that are not the TRDR logo:
|
|
2480
|
-
|
|
2481
|
-
**Step 6.6a — Detect and install icon library by framework:**
|
|
2482
|
-
|
|
2483
|
-
| Framework | Library | Detection | Action if missing |
|
|
2484
|
-
|-----------|---------|-----------|-------------------|
|
|
2485
|
-
| Plain HTML | Material Icons (CDN) | Check `<link>` in `<head>` for `fonts.googleapis.com/icon` | Add CDN link to `<head>` |
|
|
2486
|
-
| React/Next.js | @mui/icons-material | Check `package.json` | Suggest: `npm install @mui/icons-material` — do not install automatically |
|
|
2487
|
-
| Vue | via CDN or vue-material-icons | Check `<link>` in template/index.html | Add CDN link |
|
|
2488
|
-
|
|
2489
|
-
For plain HTML and Vue (CDN approach), add to `<head>`:
|
|
2490
|
-
```html
|
|
2491
|
-
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
|
2492
|
-
```
|
|
2493
|
-
|
|
2494
|
-
**Step 6.6b — Add icon CSS helpers (plain HTML / Vue CDN only):**
|
|
2495
|
-
|
|
2496
|
-
Add to the project's main CSS:
|
|
2497
|
-
```css
|
|
2498
|
-
/* Material Icons helpers — TRDR DS */
|
|
2499
|
-
.material-icons {
|
|
2500
|
-
font-size: 20px; /* default = mi-md */
|
|
2501
|
-
display: inline-flex;
|
|
2502
|
-
align-items: center;
|
|
2503
|
-
color: inherit;
|
|
2504
|
-
user-select: none;
|
|
2505
|
-
}
|
|
2506
|
-
.mi-2xs { font-size: 12px; } /* very small indicators */
|
|
2507
|
-
.mi-xs { font-size: 14px; } /* compact UI */
|
|
2508
|
-
.mi-sm { font-size: 16px; } /* small icons */
|
|
2509
|
-
/* .mi-md — 20px — default, no class needed */
|
|
2510
|
-
.mi-lg { font-size: 24px; } /* standard Material Design size */
|
|
2511
|
-
.mi-xl { font-size: 28px; } /* larger icons */
|
|
2512
|
-
.mi-2xl { font-size: 32px; } /* hero/feature icons */
|
|
2513
|
-
```
|
|
2514
|
-
|
|
2515
|
-
**Step 6.6c — Add icon color classes** (do NOT use inline style for icon color — create CSS classes instead):
|
|
2516
|
-
```css
|
|
2517
|
-
.icon-brand { color: var(--content-brand); }
|
|
2518
|
-
.icon-success { color: var(--context-trading-up); }
|
|
2519
|
-
.icon-error { color: var(--content-error); }
|
|
2520
|
-
.icon-warning { color: var(--content-warning); }
|
|
2521
|
-
.icon-dim { color: var(--content-disabled); }
|
|
2522
|
-
.icon-muted { color: var(--content-tertiary); }
|
|
2523
|
-
```
|
|
2524
|
-
|
|
2525
|
-
**Step 6.6c-2 — Measure original SVG dimensions before replacement:**
|
|
2526
|
-
|
|
2527
|
-
For EACH inline `<svg>` element that will be replaced, determine the original rendered size:
|
|
2528
|
-
|
|
2529
|
-
1. **Read the SVG's explicit size** — check for `width` and `height` attributes:
|
|
2530
|
-
```html
|
|
2531
|
-
<svg width="24" height="24" ...> → originalSize = 24
|
|
2532
|
-
<svg width="16" height="16" ...> → originalSize = 16
|
|
2533
|
-
```
|
|
2534
|
-
Use the `width` attribute value (icons are typically square). If `width` and `height` differ, use the larger value.
|
|
2535
|
-
|
|
2536
|
-
2. **If no width/height attributes** — check the `viewBox`:
|
|
2537
|
-
```html
|
|
2538
|
-
<svg viewBox="0 0 24 24" ...> → originalSize = 24 (4th value = viewBox height)
|
|
2539
|
-
```
|
|
2540
|
-
|
|
2541
|
-
3. **If no explicit size and no viewBox** — check CSS for the SVG's container:
|
|
2542
|
-
- Look for the SVG's parent element class or the SVG's own class
|
|
2543
|
-
- Search CSS files for `width`, `height`, or `font-size` applied to that selector
|
|
2544
|
-
- Example: `.icon { width: 18px; height: 18px; }` → originalSize = 18
|
|
2545
|
-
|
|
2546
|
-
4. **If still undetermined** — assume 20px (the DS default) and add a comment:
|
|
2547
|
-
```html
|
|
2548
|
-
<!-- TODO: verify icon size — original SVG had no explicit dimensions -->
|
|
2549
|
-
```
|
|
2550
|
-
|
|
2551
|
-
5. **Map originalSize to the correct size class/style:**
|
|
89
|
+
## Step 0 — Version Check (runs on EVERY invocation)
|
|
2552
90
|
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
| 12px | `.mi-2xs` | Very small indicator |
|
|
2556
|
-
| 14px | `.mi-xs` | Compact UI |
|
|
2557
|
-
| 16px | `.mi-sm` | Small icons |
|
|
2558
|
-
| 18px | `style="font-size:18px"` | Between sm and md — no standard class |
|
|
2559
|
-
| 20px | *(none — default)* | No class needed |
|
|
2560
|
-
| 22px | `style="font-size:22px"` | Between md and lg — no standard class |
|
|
2561
|
-
| 24px | `.mi-lg` | Standard Material Design size |
|
|
2562
|
-
| 28px | `.mi-xl` | Larger icons |
|
|
2563
|
-
| 32px | `.mi-2xl` | Hero/feature icons |
|
|
2564
|
-
| Any other Npx | `style="font-size:Npx"` | Exact size preservation |
|
|
2565
|
-
|
|
2566
|
-
**Priority:** Use a size class if one matches exactly. Only use inline `font-size` for non-standard sizes. NEVER use inline `style="color:..."` — color is ALWAYS via CSS class (Rule 11).
|
|
2567
|
-
|
|
2568
|
-
**Step 6.6d — Map SVG content to icon names:**
|
|
2569
|
-
|
|
2570
|
-
Analyze the SVG path/shape content to identify the icon:
|
|
2571
|
-
| SVG shape/content | Material Icon name |
|
|
2572
|
-
|---|---|
|
|
2573
|
-
| Circle + diagonal line (magnifying glass) | `search` |
|
|
2574
|
-
| X / diagonal paths (close) | `close` |
|
|
2575
|
-
| Left arrow / chevron | `chevron_left` or `arrow_back` |
|
|
2576
|
-
| Right arrow / chevron | `chevron_right` or `arrow_forward` |
|
|
2577
|
-
| Triangle play | `play_arrow` |
|
|
2578
|
-
| Square stop | `stop` |
|
|
2579
|
-
| Padlock | `lock` |
|
|
2580
|
-
| Checkmark | `check` |
|
|
2581
|
-
| Star | `star` |
|
|
2582
|
-
| Three horizontal lines (hamburger) | `menu` |
|
|
2583
|
-
| Plus sign | `add` |
|
|
2584
|
-
| Warning triangle | `warning` |
|
|
2585
|
-
| Info circle | `info` |
|
|
2586
|
-
| Bell | `notifications` |
|
|
2587
|
-
| User/person | `person` |
|
|
2588
|
-
| Gear/cog | `settings` |
|
|
2589
|
-
| Trash | `delete` |
|
|
2590
|
-
| Pencil/edit | `edit` |
|
|
2591
|
-
|
|
2592
|
-
For SVG icons that cannot be mapped automatically: leave a `<!-- TODO: replace with Material Icon: [description] -->` comment and document in DS_MIGRATION.md.
|
|
2593
|
-
|
|
2594
|
-
**Step 6.6e — Replace by framework (with size preservation):**
|
|
2595
|
-
|
|
2596
|
-
Use the `originalSize` measured in Step 6.6c-2 to select the correct size class or inline font-size.
|
|
2597
|
-
|
|
2598
|
-
| Framework | Standard size (has class) | Non-standard size (no class) |
|
|
2599
|
-
|-----------|--------------------------|------------------------------|
|
|
2600
|
-
| Plain HTML | `<span class="material-icons {sizeClass}">icon_name</span>` | `<span class="material-icons" style="font-size:{N}px">icon_name</span>` |
|
|
2601
|
-
| React (CDN) | `<span className="material-icons {sizeClass}">icon_name</span>` | `<span className="material-icons" style={{fontSize:{N}}}>icon_name</span>` |
|
|
2602
|
-
| React (@mui) | `<IconName sx={{ fontSize: {originalSize} }} />` (omit `sx` if 24px — @mui default) | Same — @mui always uses `sx.fontSize` |
|
|
2603
|
-
| Vue (CDN) | `<span class="material-icons {sizeClass}">icon_name</span>` | `<span class="material-icons" style="font-size:{N}px">icon_name</span>` |
|
|
2604
|
-
|
|
2605
|
-
**Examples with size + color combined:**
|
|
2606
|
-
```html
|
|
2607
|
-
<!-- Original: 16×16 search icon with brand color -->
|
|
2608
|
-
<svg width="16" height="16"><path d="M..." stroke="#00A8CC"/></svg>
|
|
2609
|
-
<!-- Replacement: class mi-sm (16px) + class icon-brand -->
|
|
2610
|
-
<span class="material-icons mi-sm icon-brand">search</span>
|
|
2611
|
-
|
|
2612
|
-
<!-- Original: 24×24 close icon, neutral color (currentColor) -->
|
|
2613
|
-
<svg width="24" height="24"><path d="M..." stroke="currentColor"/></svg>
|
|
2614
|
-
<!-- Replacement: class mi-lg (24px), no color class (inherits) -->
|
|
2615
|
-
<span class="material-icons mi-lg">close</span>
|
|
2616
|
-
|
|
2617
|
-
<!-- Original: 20×20 icon (default size) -->
|
|
2618
|
-
<svg width="20" height="20" viewBox="0 0 20 20"><path d="M..."/></svg>
|
|
2619
|
-
<!-- Replacement: no size class needed (20px is default) -->
|
|
2620
|
-
<span class="material-icons">settings</span>
|
|
2621
|
-
|
|
2622
|
-
<!-- Original: 18×18 icon (non-standard size) -->
|
|
2623
|
-
<svg width="18" height="18" viewBox="0 0 18 18"><path d="M..."/></svg>
|
|
2624
|
-
<!-- Replacement: inline font-size for non-standard size -->
|
|
2625
|
-
<span class="material-icons" style="font-size:18px">settings</span>
|
|
2626
|
-
|
|
2627
|
-
<!-- React @mui — 16px icon with brand color -->
|
|
2628
|
-
<SearchIcon className="icon-brand" sx={{ fontSize: 16 }} />
|
|
91
|
+
```bash
|
|
92
|
+
npm show trdr-ds-install version 2>/dev/null
|
|
2629
93
|
```
|
|
2630
94
|
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
95
|
+
- If fails or empty: skip silently
|
|
96
|
+
- If registry == local (2.0.0): skip silently
|
|
97
|
+
- If registry > local:
|
|
98
|
+
```
|
|
99
|
+
Nova versao da skill disponivel: trdr-ds-install@[registry] (instalada: 2.0.0)
|
|
100
|
+
|
|
101
|
+
- "atualizar" / "update" — instalar agora (requer reiniciar /trdr-ds)
|
|
102
|
+
- "continuar" / "skip" — usar versao atual
|
|
103
|
+
```
|
|
104
|
+
STOP. Wait for reply.
|
|
105
|
+
If update: run `npx trdr-ds-install@latest`, output success, STOP.
|
|
2638
106
|
|
|
2639
107
|
---
|
|
2640
108
|
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
For each `style=""` / `style={{}}` violation detected in Category I:
|
|
2644
|
-
|
|
2645
|
-
**Decision tree:**
|
|
2646
|
-
|
|
2647
|
-
1. **Dynamic image URL** → keep as-is (acceptable exception):
|
|
2648
|
-
```html
|
|
2649
|
-
style="background-image: url('data/image.jpg')" ✅ keep
|
|
2650
|
-
```
|
|
109
|
+
## Sprint Orchestration (Critical for Context Management)
|
|
2651
110
|
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
style="--card-delay: 0.1s" ✅ keep
|
|
2655
|
-
style={{ '--delay': animDelay }} ✅ keep
|
|
2656
|
-
```
|
|
111
|
+
### The Problem
|
|
112
|
+
Large projects generate hundreds of violations across dozens of files. Processing everything in a single context window causes hallucination, missed mappings, and incomplete work.
|
|
2657
113
|
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
Then add to CSS: `animation-delay: var(--delay, 0s);`
|
|
114
|
+
### The Solution: Sprints
|
|
115
|
+
Every migration is split into **self-contained sprints** (defined in `SPRINT_PLAN.md`). Each sprint:
|
|
116
|
+
- Processes at most **15 files**
|
|
117
|
+
- Has a single clear scope (one phase or one folder of violations)
|
|
118
|
+
- Reads state from files, NEVER from conversation memory
|
|
119
|
+
- Saves all progress to `DS_PROGRESS.md`
|
|
120
|
+
- Ends with a STOP checkpoint
|
|
2666
121
|
|
|
2667
|
-
|
|
2668
|
-
```css
|
|
2669
|
-
/* Add selector that matches elements with background-image inline style */
|
|
2670
|
-
.element[style*="background-image"] { background-size: cover; background-position: center; }
|
|
2671
|
-
```
|
|
122
|
+
### Context Clearing Protocol
|
|
2672
123
|
|
|
2673
|
-
|
|
2674
|
-
| Inline style | Action |
|
|
2675
|
-
|---|---|
|
|
2676
|
-
| `style="color: #hex"` | Create `.text-[name] { color: var(--semantic-token); }` and add class |
|
|
2677
|
-
| `style="background: #hex"` | Create `.bg-[name] { background: var(--semantic-token); }` and add class |
|
|
2678
|
-
| `style="font-family: X"` | Remove (handled by typography DS class from Step 5F) |
|
|
2679
|
-
| `style="padding: Npx"` | Create `.p-[name] { padding: var(--spacing-*); }` or use existing utility |
|
|
124
|
+
**After every sprint, output this block:**
|
|
2680
125
|
|
|
2681
|
-
**By framework:**
|
|
2682
|
-
|
|
2683
|
-
Plain HTML:
|
|
2684
|
-
```html
|
|
2685
|
-
<!-- Before -->
|
|
2686
|
-
<span style="color: var(--teal)">TRDR</span>
|
|
2687
|
-
<!-- After -->
|
|
2688
|
-
<span class="text-brand">TRDR</span>
|
|
2689
|
-
<!-- + CSS: .text-brand { color: var(--content-brand); } -->
|
|
2690
|
-
```
|
|
2691
|
-
|
|
2692
|
-
React/Next.js:
|
|
2693
|
-
```jsx
|
|
2694
|
-
// Before
|
|
2695
|
-
<span style={{ color: '#00D4FF' }}>TRDR</span>
|
|
2696
|
-
// After
|
|
2697
|
-
<span className="text-brand">TRDR</span>
|
|
2698
|
-
// + CSS: .text-brand { color: var(--content-brand); }
|
|
2699
126
|
```
|
|
127
|
+
--- SPRINT [N] COMPLETO ---
|
|
2700
128
|
|
|
2701
|
-
|
|
2702
|
-
```html
|
|
2703
|
-
<!-- Before -->
|
|
2704
|
-
<span :style="{ color: brandColor }">TRDR</span>
|
|
2705
|
-
<!-- After — if value is always the brand token -->
|
|
2706
|
-
<span class="text-brand">TRDR</span>
|
|
2707
|
-
<!-- Keep :style only if the value is truly dynamic (changes at runtime based on data) -->
|
|
2708
|
-
```
|
|
129
|
+
[Brief summary of what was done]
|
|
2709
130
|
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
```jsx
|
|
2713
|
-
// Before — conditional style object
|
|
2714
|
-
style={{
|
|
2715
|
-
background: isActive ? '#4A4A4A' : 'transparent',
|
|
2716
|
-
color: isActive ? '#FFFFFF' : '#A4A4A4',
|
|
2717
|
-
}}
|
|
2718
|
-
// After — state classes
|
|
2719
|
-
className={isActive ? 'tab-active' : 'tab-inactive'}
|
|
2720
|
-
// + CSS:
|
|
2721
|
-
// .tab-active { background: var(--surface-primary); color: var(--content-primary); }
|
|
2722
|
-
// .tab-inactive { background: transparent; color: var(--content-tertiary); }
|
|
2723
|
-
```
|
|
2724
|
-
Steps:
|
|
2725
|
-
1. Identify the boolean condition controlling the state
|
|
2726
|
-
2. Create two CSS classes (active/inactive) with semantic token values
|
|
2727
|
-
3. Replace `style={{...}}` with `className={condition ? 'active-class' : 'inactive-class'}`
|
|
2728
|
-
4. Keep all business logic intact — only change how styles are applied
|
|
2729
|
-
5. Document in DS_PROGRESS.md: "Ternary style at [file:line] converted to state classes"
|
|
131
|
+
Progresso: [done]/[total] sprints ([percentage]%)
|
|
132
|
+
Proximo: Sprint [N+1] — [name]
|
|
2730
133
|
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
.price-up { color: var(--context-trading-up); }
|
|
2735
|
-
.price-down { color: var(--context-trading-down); }
|
|
2736
|
-
/* WRONG: .price-up { color: var(--content-success); } — success is for non-trading contexts */
|
|
2737
|
-
```
|
|
134
|
+
IMPORTANTE: Para melhor resultado no proximo sprint,
|
|
135
|
+
limpe o contexto agora com /clear e depois execute:
|
|
136
|
+
/trdr-ds resume
|
|
2738
137
|
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
```css
|
|
2742
|
-
/* === Project utilities (added by TRDR DS migration) === */
|
|
2743
|
-
.text-brand { color: var(--content-brand); }
|
|
2744
|
-
.icon-brand { color: var(--content-brand); }
|
|
2745
|
-
/* ... */
|
|
138
|
+
Isto libera a janela de contexto e evita alucinacoes.
|
|
139
|
+
Se preferir continuar sem limpar: "continuar"
|
|
2746
140
|
```
|
|
2747
141
|
|
|
2748
|
-
**
|
|
2749
|
-
|
|
2750
|
-
MUI's `sx` prop is the idiomatic way to style MUI components. Unlike inline `style={{}}`, `sx` props should NOT be eliminated — they should be migrated to use DS tokens.
|
|
2751
|
-
|
|
2752
|
-
**Decision tree for MUI `sx` props:**
|
|
2753
|
-
|
|
2754
|
-
1. **Value already uses theme reference** (`theme.palette.primary.main`, `theme.spacing(2)`) → keep as-is (theme was updated with DS tokens in Sub-fase A)
|
|
2755
|
-
|
|
2756
|
-
2. **Hardcoded color** → replace with token:
|
|
2757
|
-
```tsx
|
|
2758
|
-
// Before
|
|
2759
|
-
sx={{ color: '#00A8CC' }}
|
|
2760
|
-
// After
|
|
2761
|
-
sx={{ color: 'var(--content-brand)' }}
|
|
2762
|
-
```
|
|
2763
|
-
|
|
2764
|
-
3. **Hardcoded spacing with string px** → replace with token:
|
|
2765
|
-
```tsx
|
|
2766
|
-
// Before
|
|
2767
|
-
sx={{ padding: '16px', gap: '8px' }}
|
|
2768
|
-
// After
|
|
2769
|
-
sx={{ padding: 'var(--spacing-lg)', gap: 'var(--spacing-sm)' }}
|
|
2770
|
-
```
|
|
2771
|
-
|
|
2772
|
-
4. **Hardcoded fontFamily** → remove (theme typography handles this globally)
|
|
142
|
+
**STOP. Wait for developer reply.**
|
|
2773
143
|
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
// Before
|
|
2777
|
-
sx={{ borderRadius: '12px' }}
|
|
2778
|
-
// After
|
|
2779
|
-
sx={{ borderRadius: 'var(--radius-md)' }}
|
|
2780
|
-
```
|
|
144
|
+
- If developer says "continuar": proceed to next sprint (warn that quality may degrade)
|
|
145
|
+
- If developer clears context and runs `/trdr-ds resume`: the resume mode reads all state from files
|
|
2781
146
|
|
|
2782
|
-
|
|
2783
|
-
```tsx
|
|
2784
|
-
// Before
|
|
2785
|
-
sx={{ color: isActive ? '#00D4FF' : '#A4A4A4' }}
|
|
2786
|
-
// After
|
|
2787
|
-
sx={{ color: isActive ? 'var(--content-brand)' : 'var(--content-tertiary)' }}
|
|
2788
|
-
```
|
|
147
|
+
### Sprint State Files
|
|
2789
148
|
|
|
2790
|
-
|
|
149
|
+
Three files at the project root serve as the "database" for the migration:
|
|
2791
150
|
|
|
2792
|
-
|
|
151
|
+
| File | Purpose | When to Read |
|
|
152
|
+
|------|---------|-------------|
|
|
153
|
+
| `DS_ANALYSIS.md` | Full analysis (violations, candidates, logo audit) | At sprint start — read ONLY the section relevant to current sprint |
|
|
154
|
+
| `SPRINT_PLAN.md` | Sprint definitions and status | At sprint start — find current sprint |
|
|
155
|
+
| `DS_PROGRESS.md` | Execution log, batch status, overall progress | At sprint start and after every action |
|
|
2793
156
|
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
### Step 7 — Generate DS_MIGRATION.md
|
|
2797
|
-
|
|
2798
|
-
Create `DS_MIGRATION.md` at the project root:
|
|
2799
|
-
|
|
2800
|
-
```markdown
|
|
2801
|
-
# TRDR Design System — Migration Log
|
|
2802
|
-
Applied: [date]
|
|
2803
|
-
Catalog: TRDR DS v[catalog-version] ([implemented]/[total] components, generated [generatedAt])
|
|
2804
|
-
Hub: https://trdr.mrocontent.com.br
|
|
2805
|
-
|
|
2806
|
-
## What was applied
|
|
2807
|
-
- ✅ [path]/tokens.css — TRDR CSS custom properties (snapshot v[catalog-version])
|
|
2808
|
-
- ✅ [path]/components.css — [implemented] component utility class blocks + typography
|
|
2809
|
-
- ✅ CLAUDE.md — design system rules for Claude Code
|
|
2810
|
-
- ✅ [N] violations fixed in [M] files
|
|
2811
|
-
- ✅ [global-css] updated with @import
|
|
2812
|
-
- ⚠️ [S] stub components flagged in MISSING_COMPONENTS.md (if any)
|
|
2813
|
-
- ✅ Migrated in [N] batches across 4 sub-phases — see DS_PROGRESS.md for details
|
|
2814
|
-
|
|
2815
|
-
## Files modified
|
|
2816
|
-
[List each file and what changed]
|
|
2817
|
-
|
|
2818
|
-
## Violations fixed
|
|
2819
|
-
[List by category with file:line references]
|
|
2820
|
-
|
|
2821
|
-
## Manual steps required
|
|
2822
|
-
- [ ] **Fonts**: Ensure JetBrains Mono, Inter, and Roboto Mono are loaded
|
|
2823
|
-
- Next.js: use `next/font/google` in layout.tsx (`JetBrains_Mono`, `Inter`, `Roboto_Mono`)
|
|
2824
|
-
- Others: add Google Fonts `<link>` in HTML head
|
|
2825
|
-
- [ ] **Dark/light mode**: tokens.css uses [data-theme="light"] for overrides — add `data-theme="light"` to `<html>` to activate light mode
|
|
2826
|
-
- [ ] **Trading UI**: If this project has price/position displays, verify context.trading.* tokens are applied (see Hub: /tokens/semanticos)
|
|
2827
|
-
- [ ] **Stubs**: Review MISSING_COMPONENTS.md and decide whether to wait for canonical implementation in the Hub or hand-roll using the listed tokens
|
|
2828
|
-
- [ ] **Skipped files**: [list any files excluded from migration]
|
|
157
|
+
**NEVER read the entire DS_ANALYSIS.md at once for large projects.** Only read the section needed for the current sprint.
|
|
2829
158
|
|
|
2830
|
-
|
|
2831
|
-
- [ ] **MUI CSS Variables mode**: If MUI version >= 6, add `cssVariables: true` to `createTheme()` for native CSS variable support. Without it, MUI's internal color calculations (alpha, lighten, darken) may produce invalid CSS when palette values are `var()` strings.
|
|
2832
|
-
- [ ] **MUI palette auto-generation**: Verify that `primary.light`, `primary.dark`, and `primary.contrastText` are all explicitly set with DS tokens. MUI auto-generates these from `main`, which fails when `main` is a `var()` string.
|
|
2833
|
-
- [ ] **MUI theme composition**: If the project composes themes across multiple files (`createTheme()` + `deepmerge`), verify that DS token references are preserved in the final merged theme.
|
|
2834
|
-
- [ ] **MUI component slots**: Complex MUI components (DataGrid, DatePicker, Autocomplete) have many internal slots not covered by the standard styleOverrides. Review these manually if used in the project.
|
|
2835
|
-
- [ ] **sx props audit**: Run a quick grep for `sx=\{\{.*#[0-9A-Fa-f]` to verify no hardcoded hex values remain in sx props.
|
|
159
|
+
### Sprint Lifecycle (EVERY sprint follows this)
|
|
2836
160
|
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
- Hub: https://trdr.mrocontent.com.br
|
|
2848
|
-
- JSON catalog: https://trdr.mrocontent.com.br/components.json
|
|
2849
|
-
- Tokens: https://trdr.mrocontent.com.br/tokens/semanticos
|
|
2850
|
-
- Components: https://trdr.mrocontent.com.br/componentes
|
|
2851
|
-
- Rules: https://trdr.mrocontent.com.br/para-ia
|
|
2852
|
-
```
|
|
2853
|
-
|
|
2854
|
-
After writing DS_MIGRATION.md, update `DS_PROGRESS.md`:
|
|
2855
|
-
```
|
|
2856
|
-
Sub-fase D: Final — ✅ COMPLETE
|
|
2857
|
-
Status: COMPLETE
|
|
2858
|
-
Completed: [ISO datetime]
|
|
2859
|
-
```
|
|
161
|
+
1. Read `SPRINT_PLAN.md` — find current sprint (first PENDING or IN_PROGRESS)
|
|
162
|
+
2. Read relevant section of `DS_ANALYSIS.md`
|
|
163
|
+
3. Read `DS_PROGRESS.md` for current state
|
|
164
|
+
4. Update SPRINT_PLAN.md: set current sprint `Status: IN_PROGRESS`
|
|
165
|
+
5. Read the phase file for this sprint's sub-fase (from `phases/`)
|
|
166
|
+
6. Execute the sprint's scope
|
|
167
|
+
7. Update DS_PROGRESS.md with results
|
|
168
|
+
8. Update SPRINT_PLAN.md: set current sprint `Status: COMPLETE`
|
|
169
|
+
9. Output sprint summary with context clearing protocol
|
|
170
|
+
10. **STOP**
|
|
2860
171
|
|
|
2861
172
|
---
|
|
2862
173
|
|
|
2863
|
-
##
|
|
174
|
+
## Component Loading Protocol
|
|
2864
175
|
|
|
2865
|
-
|
|
176
|
+
Components are stored as individual JSON files in `data/components/`.
|
|
2866
177
|
|
|
178
|
+
**To load a component:**
|
|
2867
179
|
```
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
Created:
|
|
2871
|
-
• [path]/tokens.css (snapshot v[catalog-version], dark + light mode)
|
|
2872
|
-
• [path]/components.css ([implemented] component classes + typography)
|
|
2873
|
-
• CLAUDE.md (design system context for Claude Code)
|
|
2874
|
-
• DS_ANALYSIS.md (analysis snapshot)
|
|
2875
|
-
• DS_PROGRESS.md (migration log — status: COMPLETE)
|
|
2876
|
-
• DS_MIGRATION.md (migration log + manual checklist)
|
|
2877
|
-
• MISSING_COMPONENTS.md ([S] stubs flagged) — only if applicable
|
|
2878
|
-
|
|
2879
|
-
Modified:
|
|
2880
|
-
• [global-css] — @import added
|
|
2881
|
-
• [N] files — [X] violations replaced with semantic tokens
|
|
2882
|
-
|
|
2883
|
-
Catalog: TRDR DS v[catalog-version] ([implemented]/[total] components)
|
|
2884
|
-
Hub: https://trdr.mrocontent.com.br
|
|
2885
|
-
→ Check DS_MIGRATION.md for manual steps
|
|
2886
|
-
→ Stubs not yet canonical: see MISSING_COMPONENTS.md
|
|
2887
|
-
→ Backup branch: `trdr-ds/backup-{timestamp}` — para desfazer: `/trdr-ds rollback`
|
|
2888
|
-
→ Para remover o backup após validar: `git branch -D trdr-ds/backup-{timestamp}`
|
|
2889
|
-
→ Algo deu errado? `/trdr-ds report` para enviar um bug report ao maintainer
|
|
180
|
+
Read: <skill-dir>/data/components/<slug>.json
|
|
2890
181
|
```
|
|
2891
182
|
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
## RESUME MODE (when invoked with `resume` argument)
|
|
2895
|
-
|
|
2896
|
-
This is the primary way to continue a migration across multiple context windows. Each `/trdr-ds resume` picks up the next pending sprint.
|
|
2897
|
-
|
|
2898
|
-
1. Look for `SPRINT_PLAN.md` and `DS_PROGRESS.md` at the project root.
|
|
2899
|
-
- If neither found: output `❌ No previous migration found. Run /trdr-ds to start a new one.`
|
|
2900
|
-
- If `DS_PROGRESS.md` has `Status: COMPLETE`: output `✅ Migration already complete (finished [date]). Run /trdr-ds to check for new violations.`
|
|
2901
|
-
|
|
2902
|
-
2. Read `SPRINT_PLAN.md`. Find the first sprint with `Status: PENDING` or `Status: IN_PROGRESS`.
|
|
2903
|
-
- If all sprints are `✅ COMPLETE`: mark migration as COMPLETE in DS_PROGRESS.md and output summary.
|
|
2904
|
-
|
|
2905
|
-
3. Read `DS_PROGRESS.md` to understand overall state.
|
|
2906
|
-
|
|
2907
|
-
4. Read **only the relevant section** of `DS_ANALYSIS.md` for the current sprint:
|
|
2908
|
-
- Foundation sprint: read `§ Project` section only
|
|
2909
|
-
- Violation sprint: read `§ By File` entries ONLY for the files listed in that sprint's scope
|
|
2910
|
-
- Components sprint: read `§ Component Replacement Candidates`
|
|
2911
|
-
- Final sprint: read `§ Logo Audit`
|
|
2912
|
-
|
|
2913
|
-
5. Output a resume summary:
|
|
2914
|
-
```
|
|
2915
|
-
Resumindo migração TRDR DS — [project name]
|
|
2916
|
-
|
|
2917
|
-
📋 Sprint Plan: [done]/[total] sprints completos ([percentage]%)
|
|
2918
|
-
|
|
2919
|
-
[For each sprint in SPRINT_PLAN.md:]
|
|
2920
|
-
Sprint 1 — Foundation ✅
|
|
2921
|
-
Sprint 2 — Violations: src/components/ ✅
|
|
2922
|
-
Sprint 3 — Violations: src/pages/ 🔄 ← retomando aqui
|
|
2923
|
-
Sprint 4 — Violations: src/app/ ⏳
|
|
2924
|
-
Sprint 5 — Components ⏳
|
|
2925
|
-
Sprint 6 — Final ⏳
|
|
2926
|
-
|
|
2927
|
-
Retomando: **Sprint [N] — [name]**
|
|
2928
|
-
Escopo: [sprint scope description]
|
|
2929
|
-
```
|
|
2930
|
-
|
|
2931
|
-
6. Execute the current sprint following the sprint lifecycle (read → execute → save → STOP).
|
|
2932
|
-
All context is read from `SPRINT_PLAN.md` + `DS_ANALYSIS.md` (relevant section only) + `DS_PROGRESS.md` — never from conversation history.
|
|
2933
|
-
|
|
2934
|
-
---
|
|
2935
|
-
|
|
2936
|
-
## STATUS MODE (when invoked with `status` argument)
|
|
2937
|
-
|
|
2938
|
-
1. Look for `SPRINT_PLAN.md` and `DS_PROGRESS.md` at the project root.
|
|
2939
|
-
- If neither found: output `No migration in progress. Run /trdr-ds to start.`
|
|
2940
|
-
|
|
2941
|
-
2. Read `SPRINT_PLAN.md` and `DS_PROGRESS.md` — do NOT modify any files. Output:
|
|
2942
|
-
|
|
183
|
+
**To get the catalog index (lightweight):**
|
|
2943
184
|
```
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
Project: [name] | Started: [date] | Status: [IN_PROGRESS/PAUSED/COMPLETE]
|
|
2947
|
-
Backup: [branch name or NONE]
|
|
2948
|
-
|
|
2949
|
-
### Sprint Progress
|
|
2950
|
-
| Sprint | Scope | Files | Violations | Status |
|
|
2951
|
-
|--------|-------|-------|------------|--------|
|
|
2952
|
-
| 1 | Foundation | 4 | — | ✅ |
|
|
2953
|
-
| 2 | Violations: src/components/ | 12 | 34 | ✅ |
|
|
2954
|
-
| 3 | Violations: src/pages/ | 8 | 21 | 🔄 IN_PROGRESS |
|
|
2955
|
-
| 4 | Violations: src/app/ | 15 | 45 | ⏳ PENDING |
|
|
2956
|
-
| 5 | Violations: src/styles/ | 6 | 18 | ⏳ PENDING |
|
|
2957
|
-
| 6 | Components | [N] candidates | — | ⏳ PENDING |
|
|
2958
|
-
| 7 | Final | logos + icons | — | ⏳ PENDING |
|
|
2959
|
-
|
|
2960
|
-
### Summary
|
|
2961
|
-
Sprints completos: [done]/[total] ([percentage]%)
|
|
2962
|
-
Violações corrigidas: [fixed]/[total_violations]
|
|
2963
|
-
Componentes aplicados: [applied]/[total_candidates]
|
|
2964
|
-
|
|
2965
|
-
### Next Action
|
|
2966
|
-
→ Sprint [N]: [name] — `/trdr-ds resume`
|
|
2967
|
-
→ Para desfazer tudo: `/trdr-ds rollback`
|
|
185
|
+
Read: <skill-dir>/data/index.json
|
|
2968
186
|
```
|
|
2969
187
|
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
## SYNC MODE (when invoked as `/trdr-ds sync`)
|
|
2973
|
-
|
|
2974
|
-
1. WebFetch `https://trdr.mrocontent.com.br/components.json` → save as `<skill-dir>/data/components.json`
|
|
2975
|
-
2. WebFetch `https://trdr.mrocontent.com.br/tokens.css` → save as `<skill-dir>/references/tokens.css`
|
|
2976
|
-
3. Compare new vs previous (if a previous version exists). Report:
|
|
2977
|
-
- New components: [list slugs]
|
|
2978
|
-
- Newly implemented: [list slugs that flipped from stub → implemented]
|
|
2979
|
-
- Removed: [list slugs no longer in catalog]
|
|
2980
|
-
4. No project files are touched.
|
|
2981
|
-
|
|
2982
|
-
If either fetch fails, report which one and exit. Do NOT touch the snapshot if the response is malformed (e.g., missing `components` array).
|
|
2983
|
-
|
|
2984
|
-
---
|
|
2985
|
-
|
|
2986
|
-
## ROLLBACK MODE (when invoked as `/trdr-ds rollback`)
|
|
2987
|
-
|
|
2988
|
-
1. Look for `DS_PROGRESS.md` at the project root.
|
|
2989
|
-
- If not found: output `❌ Nenhuma migração encontrada. Nada para reverter.` and STOP.
|
|
2990
|
-
- If `Backup branch:` line is `NONE (user opted out)`: output `❌ Nenhum backup foi criado (você optou por continuar sem backup durante a migração). Rollback manual necessário.` and STOP.
|
|
2991
|
-
|
|
2992
|
-
2. Read the `Backup branch:` value from `DS_PROGRESS.md`. Save as `backupBranch`.
|
|
2993
|
-
Read the `Original branch:` value. Save as `originalBranch`.
|
|
188
|
+
The index contains slug, name, category, implemented flag, and dependencies for ALL components — but NO code blocks. Code blocks are loaded on demand from individual files.
|
|
2994
189
|
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
If it doesn't exist: output `❌ Branch de backup \`{backupBranch}\` não encontrado. Pode ter sido apagado manualmente.` and STOP.
|
|
190
|
+
**When building components.css (Sub-fase A):**
|
|
191
|
+
1. Read `data/index.json` to get list of implemented slugs
|
|
192
|
+
2. For EACH implemented slug, read `data/components/<slug>.json` and extract `code.css`
|
|
193
|
+
3. Concatenate all CSS blocks
|
|
3000
194
|
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
Backup branch: {backupBranch}
|
|
3006
|
-
Branch atual: {currentBranch}
|
|
3007
|
-
Status da migração: {status from DS_PROGRESS.md}
|
|
3008
|
-
|
|
3009
|
-
Todos os arquivos modificados pela migração serão restaurados ao estado do backup.
|
|
3010
|
-
Arquivos DS criados (DS_ANALYSIS.md, DS_PROGRESS.md, DS_MIGRATION.md, MISSING_COMPONENTS.md, CLAUDE.md, tokens.css, components.css) serão revertidos ou removidos.
|
|
3011
|
-
|
|
3012
|
-
Responda:
|
|
3013
|
-
- "confirmar" — executar rollback
|
|
3014
|
-
- "cancelar" — abortar
|
|
3015
|
-
```
|
|
3016
|
-
**STOP. Wait for reply.**
|
|
3017
|
-
|
|
3018
|
-
5. If `"cancelar"`: output `Rollback cancelado.` and STOP.
|
|
3019
|
-
|
|
3020
|
-
6. If `"confirmar"`, execute the rollback:
|
|
3021
|
-
|
|
3022
|
-
a. Ensure we're on the original branch:
|
|
3023
|
-
```bash
|
|
3024
|
-
git checkout {originalBranch}
|
|
3025
|
-
```
|
|
3026
|
-
|
|
3027
|
-
b. Reset the working tree to the backup state:
|
|
3028
|
-
```bash
|
|
3029
|
-
git reset --hard {backupBranch}
|
|
3030
|
-
```
|
|
3031
|
-
|
|
3032
|
-
7. Output:
|
|
3033
|
-
```
|
|
3034
|
-
✅ Rollback completo.
|
|
3035
|
-
|
|
3036
|
-
Branch `{originalBranch}` restaurado ao estado de `{backupBranch}`.
|
|
3037
|
-
Todos os arquivos modificados pela migração foram revertidos.
|
|
3038
|
-
|
|
3039
|
-
O backup branch `{backupBranch}` ainda existe. Para removê-lo:
|
|
3040
|
-
git branch -D {backupBranch}
|
|
3041
|
-
```
|
|
195
|
+
**When applying components (Sub-fase C):**
|
|
196
|
+
1. Read `data/index.json` to find candidates
|
|
197
|
+
2. For EACH candidate being processed, read its individual component file
|
|
198
|
+
3. Process ONE component at a time, then move to the next
|
|
3042
199
|
|
|
3043
200
|
---
|
|
3044
201
|
|
|
3045
|
-
##
|
|
3046
|
-
|
|
3047
|
-
This mode generates a structured bug report and sends it to the skill maintainer via email.
|
|
3048
|
-
|
|
3049
|
-
**Maintainer email:** `mrocontent@gmail.com`
|
|
3050
|
-
|
|
3051
|
-
### When it triggers automatically
|
|
3052
|
-
|
|
3053
|
-
After each sub-phase (A, B, C, D) completes — or fails to complete — evaluate these conditions:
|
|
3054
|
-
|
|
3055
|
-
| Condition | Severity | Auto-report? |
|
|
3056
|
-
|-----------|----------|--------------|
|
|
3057
|
-
| Sub-phase crashed or could not complete (e.g., missing files, parse errors, Hub unreachable after local snapshot also missing) | CRITICAL | ✅ Yes |
|
|
3058
|
-
| Build fails after sub-phase changes (if detectable via `npm run build` or framework equivalent) | CRITICAL | ✅ Yes |
|
|
3059
|
-
| More than 30% of violations in a batch could not be mapped to any DS token (flagged as "no match") | HIGH | ✅ Yes |
|
|
3060
|
-
| Component replacement produced malformed JSX/HTML (unclosed tags, syntax errors caught by grep) | CRITICAL | ✅ Yes |
|
|
3061
|
-
| Rollback was invoked (indicates the migration went wrong enough to revert) | HIGH | ✅ Yes |
|
|
3062
|
-
|
|
3063
|
-
When auto-report triggers, inform the developer:
|
|
3064
|
-
```
|
|
3065
|
-
⚠️ A skill detectou problemas críticos nesta migração.
|
|
3066
|
-
Um bug report será gerado e enviado ao maintainer (mrocontent@gmail.com).
|
|
3067
|
-
|
|
3068
|
-
Deseja incluir observações adicionais no report?
|
|
3069
|
-
- Escreva seu comentário e pressione Enter
|
|
3070
|
-
- "pular" / "skip" — enviar sem comentários extras
|
|
3071
|
-
```
|
|
3072
|
-
**Wait for reply.** Save the developer's comment (if any) as `developerNotes` for inclusion in the report.
|
|
3073
|
-
|
|
3074
|
-
### Manual invocation (`/trdr-ds report`)
|
|
3075
|
-
|
|
3076
|
-
When invoked manually, the developer may optionally describe the problem:
|
|
3077
|
-
- `/trdr-ds report` — generates report from current state
|
|
3078
|
-
- `/trdr-ds report Violações não foram aplicadas nos arquivos .vue` — includes the description
|
|
3079
|
-
|
|
3080
|
-
Ask the developer:
|
|
3081
|
-
```
|
|
3082
|
-
📝 Bug report — descreva o problema que encontrou com a skill:
|
|
3083
|
-
(Se já descreveu no comando, pressione Enter para confirmar)
|
|
3084
|
-
```
|
|
3085
|
-
**Wait for reply.** Save as `developerNotes`.
|
|
3086
|
-
|
|
3087
|
-
### Step R1 — Collect project context
|
|
3088
|
-
|
|
3089
|
-
Gather the following data silently (no output to the developer):
|
|
3090
|
-
|
|
3091
|
-
1. **Project info:**
|
|
3092
|
-
- `package.json` → name, framework, framework version, stylingMode detected
|
|
3093
|
-
- Node.js version: `node --version`
|
|
3094
|
-
- OS: read from environment (platform)
|
|
3095
|
-
- Skill version: read from top of this file
|
|
3096
|
-
|
|
3097
|
-
2. **Migration state:**
|
|
3098
|
-
- Read `DS_ANALYSIS.md` (if exists) — extract: total violations, categories breakdown, total files
|
|
3099
|
-
- Read `DS_PROGRESS.md` (if exists) — extract: current status, which sub-phases completed, which pending, and the full `## Execution Log` section (per-file audit trail with timestamps)
|
|
3100
|
-
- Read `SPRINT_PLAN.md` (if exists) — extract: sprint progress
|
|
3101
|
-
- Read `DS_MIGRATION.md` (if exists) — extract: manual items count
|
|
3102
|
-
|
|
3103
|
-
3. **Error context:**
|
|
3104
|
-
- If auto-triggered: capture the specific error/condition that triggered the report
|
|
3105
|
-
- If manual: use `developerNotes`
|
|
3106
|
-
- Last 3 files modified by the skill (from `DS_PROGRESS.md` batch logs)
|
|
3107
|
-
- If build failed: capture the first 50 lines of build error output
|
|
3108
|
-
|
|
3109
|
-
4. **Snapshot versions:**
|
|
3110
|
-
- `data/components.json` → `generatedAt` and count of implemented components
|
|
3111
|
-
- `references/tokens.css` → count of CSS variables (grep `--` in `:root`)
|
|
3112
|
-
|
|
3113
|
-
### Step R2 — Generate DS_BUG_REPORT.md
|
|
3114
|
-
|
|
3115
|
-
Write `DS_BUG_REPORT.md` at the project root:
|
|
202
|
+
## Mapping Tables Protocol
|
|
3116
203
|
|
|
3117
|
-
|
|
3118
|
-
# TRDR DS — Bug Report
|
|
204
|
+
Violation mapping tables (color→token, font→token, spacing→token, etc.) are in `data/mappings.json`.
|
|
3119
205
|
|
|
3120
|
-
**
|
|
3121
|
-
**Skill version:** [version from SKILL.md]
|
|
3122
|
-
**Report type:** [AUTOMATIC | MANUAL]
|
|
3123
|
-
**Severity:** [CRITICAL | HIGH | MEDIUM]
|
|
206
|
+
**Load ONLY during Sub-fase B (violations).** Do NOT preload during analysis or other phases.
|
|
3124
207
|
|
|
3125
208
|
---
|
|
3126
209
|
|
|
3127
|
-
##
|
|
3128
|
-
|
|
3129
|
-
[developerNotes — or auto-trigger condition description]
|
|
3130
|
-
|
|
3131
|
-
## Project Context
|
|
3132
|
-
|
|
3133
|
-
| Field | Value |
|
|
3134
|
-
|-------|-------|
|
|
3135
|
-
| Project | [package.json name] |
|
|
3136
|
-
| Framework | [framework] [version] |
|
|
3137
|
-
| Styling mode | [stylingMode] |
|
|
3138
|
-
| Node.js | [version] |
|
|
3139
|
-
| OS | [platform] |
|
|
3140
|
-
|
|
3141
|
-
## Migration State
|
|
3142
|
-
|
|
3143
|
-
| Sub-phase | Status |
|
|
3144
|
-
|-----------|--------|
|
|
3145
|
-
| Analysis | [✅ COMPLETE / ⏳ PENDING / ❌ FAILED] |
|
|
3146
|
-
| A — Foundation | [status] |
|
|
3147
|
-
| B — Violations | [status — N/M batches done] |
|
|
3148
|
-
| C — Components | [status — N/M candidates done] |
|
|
3149
|
-
| D — Final | [status] |
|
|
3150
|
-
|
|
3151
|
-
**Overall status:** [from DS_PROGRESS.md]
|
|
3152
|
-
**Backup branch:** [branch name or N/A]
|
|
3153
|
-
|
|
3154
|
-
## Violation Summary
|
|
3155
|
-
|
|
3156
|
-
| Category | Found | Fixed | Unfixable |
|
|
3157
|
-
|----------|-------|-------|-----------|
|
|
3158
|
-
| A — Hardcoded colors | [n] | [n] | [n] |
|
|
3159
|
-
| B — Hardcoded fonts | [n] | [n] | [n] |
|
|
3160
|
-
| C — Hardcoded spacing | [n] | [n] | [n] |
|
|
3161
|
-
| ... | ... | ... | ... |
|
|
3162
|
-
|
|
3163
|
-
## Error Details
|
|
3164
|
-
|
|
3165
|
-
[If build failed: first 50 lines of error output]
|
|
3166
|
-
[If unmapped violations: list of values that had no token match]
|
|
3167
|
-
[If component replacement failed: file path + what went wrong]
|
|
3168
|
-
|
|
3169
|
-
## Files Affected
|
|
3170
|
-
|
|
3171
|
-
[List of last files modified by the skill, from DS_PROGRESS.md]
|
|
3172
|
-
|
|
3173
|
-
## Snapshot Info
|
|
3174
|
-
|
|
3175
|
-
- Components catalog: [generatedAt] — [N] implemented / [M] total
|
|
3176
|
-
- Tokens CSS: [N] variables
|
|
3177
|
-
|
|
3178
|
-
## Execution Log
|
|
3179
|
-
|
|
3180
|
-
[Copy the entire `## Execution Log` section from DS_PROGRESS.md here — this is the full audit trail of every file the skill created, modified, skipped, or failed on, with timestamps]
|
|
210
|
+
## Developer Dissatisfaction Detection
|
|
3181
211
|
|
|
3182
|
-
|
|
3183
|
-
|-----------|-------|--------|------|---------|
|
|
3184
|
-
| ... | ... | ... | ... | ... |
|
|
212
|
+
At every STOP checkpoint, if the developer expresses the implementation didn't work, trigger report mode. Match patterns (case-insensitive):
|
|
3185
213
|
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
### Step R3 — Send via email (Resend API)
|
|
3192
|
-
|
|
3193
|
-
Execute via Bash:
|
|
3194
|
-
|
|
3195
|
-
```bash
|
|
3196
|
-
node -e "
|
|
3197
|
-
const https = require('https');
|
|
3198
|
-
|
|
3199
|
-
const report = require('fs').readFileSync('DS_BUG_REPORT.md', 'utf8');
|
|
3200
|
-
const projectName = '[project-name-from-package.json]';
|
|
3201
|
-
const severity = '[CRITICAL|HIGH|MEDIUM]';
|
|
3202
|
-
const skillVersion = '[version]';
|
|
3203
|
-
|
|
3204
|
-
const data = JSON.stringify({
|
|
3205
|
-
from: 'TRDR DS Skill <onboarding@resend.dev>',
|
|
3206
|
-
to: ['mrocontent@gmail.com'],
|
|
3207
|
-
subject: '[TRDR DS ' + severity + '] Bug report — ' + projectName + ' (v' + skillVersion + ')',
|
|
3208
|
-
text: report
|
|
3209
|
-
});
|
|
3210
|
-
|
|
3211
|
-
const req = https.request({
|
|
3212
|
-
hostname: 'api.resend.com',
|
|
3213
|
-
path: '/emails',
|
|
3214
|
-
method: 'POST',
|
|
3215
|
-
headers: {
|
|
3216
|
-
'Authorization': 'Bearer ' + process.env.RESEND_API_KEY,
|
|
3217
|
-
'Content-Type': 'application/json',
|
|
3218
|
-
'Content-Length': Buffer.byteLength(data)
|
|
3219
|
-
}
|
|
3220
|
-
}, (res) => {
|
|
3221
|
-
let body = '';
|
|
3222
|
-
res.on('data', c => body += c);
|
|
3223
|
-
res.on('end', () => {
|
|
3224
|
-
if (res.statusCode >= 200 && res.statusCode < 300) {
|
|
3225
|
-
console.log('OK: ' + body);
|
|
3226
|
-
} else {
|
|
3227
|
-
console.log('FAIL (' + res.statusCode + '): ' + body);
|
|
3228
|
-
}
|
|
3229
|
-
});
|
|
3230
|
-
});
|
|
3231
|
-
req.write(data);
|
|
3232
|
-
req.end();
|
|
3233
|
-
"
|
|
3234
|
-
```
|
|
3235
|
-
|
|
3236
|
-
**If `RESEND_API_KEY` is not set in the environment:**
|
|
3237
|
-
```
|
|
3238
|
-
⚠️ RESEND_API_KEY não encontrada no ambiente.
|
|
3239
|
-
O report foi salvo em DS_BUG_REPORT.md mas não pôde ser enviado por email.
|
|
3240
|
-
|
|
3241
|
-
Para configurar:
|
|
3242
|
-
1. Obtenha sua API key em https://resend.com/api-keys
|
|
3243
|
-
2. Adicione ao ambiente: export RESEND_API_KEY="re_xxxxxxxx"
|
|
3244
|
-
3. Ou adicione no .env do projeto e execute novamente /trdr-ds report
|
|
3245
|
-
```
|
|
3246
|
-
|
|
3247
|
-
**If the email send fails (non-2xx response):**
|
|
3248
|
-
```
|
|
3249
|
-
⚠️ Falha ao enviar email (HTTP [status]): [response body]
|
|
3250
|
-
O report foi salvo localmente em DS_BUG_REPORT.md.
|
|
3251
|
-
Envie manualmente para mrocontent@gmail.com.
|
|
3252
|
-
```
|
|
3253
|
-
|
|
3254
|
-
### Step R4 — Output to developer
|
|
3255
|
-
|
|
3256
|
-
```
|
|
3257
|
-
[If email sent successfully:]
|
|
3258
|
-
✅ Bug report gerado e enviado.
|
|
3259
|
-
|
|
3260
|
-
📄 DS_BUG_REPORT.md (salvo no projeto)
|
|
3261
|
-
📧 Email enviado para mrocontent@gmail.com
|
|
3262
|
-
🏷️ Severidade: [CRITICAL|HIGH|MEDIUM]
|
|
3263
|
-
|
|
3264
|
-
O maintainer será notificado e entrará em contato.
|
|
3265
|
-
|
|
3266
|
-
[If email failed:]
|
|
3267
|
-
📄 Bug report salvo em DS_BUG_REPORT.md
|
|
3268
|
-
⚠️ Email não enviado — veja instruções acima.
|
|
3269
|
-
|
|
3270
|
-
[In both cases:]
|
|
3271
|
-
→ Para continuar a migração: /trdr-ds resume
|
|
3272
|
-
→ Para reverter: /trdr-ds rollback
|
|
3273
|
-
```
|
|
3274
|
-
|
|
3275
|
-
### DEVELOPER DISSATISFACTION DETECTION
|
|
3276
|
-
|
|
3277
|
-
At every STOP checkpoint and at any point during the conversation, if the developer expresses that the implementation didn't work correctly, trigger REPORT MODE automatically. Match any of these patterns (case-insensitive, partial match):
|
|
3278
|
-
|
|
3279
|
-
| Pattern (PT) | Pattern (EN) |
|
|
3280
|
-
|--------------|--------------|
|
|
3281
|
-
| "não funcionou" | "didn't work" |
|
|
3282
|
-
| "não deu certo" | "it's broken" |
|
|
214
|
+
| PT | EN |
|
|
215
|
+
|----|-----|
|
|
216
|
+
| "nao funcionou" | "didn't work" |
|
|
217
|
+
| "nao deu certo" | "it's broken" |
|
|
3283
218
|
| "deu errado" | "went wrong" |
|
|
3284
219
|
| "ficou errado" | "messed up" |
|
|
3285
220
|
| "quebrou" | "broke" |
|
|
3286
|
-
| "
|
|
3287
|
-
| "
|
|
3288
|
-
| "
|
|
221
|
+
| "nao aplicou" | "didn't apply" |
|
|
222
|
+
| "nao ta certo" | "not right" |
|
|
223
|
+
| "ta errado" | "it's wrong" |
|
|
3289
224
|
| "report" | "bug report" |
|
|
3290
225
|
|
|
3291
226
|
When detected:
|
|
3292
|
-
1. Acknowledge
|
|
3293
|
-
2.
|
|
3294
|
-
3.
|
|
3295
|
-
4. After sending the report, offer the developer options to continue:
|
|
3296
|
-
```
|
|
3297
|
-
Responda:
|
|
3298
|
-
- "rollback" — reverter todas as mudanças
|
|
3299
|
-
- "continuar" — tentar prosseguir mesmo assim
|
|
3300
|
-
- "parar" — salvar progresso e parar aqui
|
|
3301
|
-
```
|
|
227
|
+
1. Acknowledge feedback
|
|
228
|
+
2. Read `modes/report.md` and execute report mode
|
|
229
|
+
3. After report, offer: rollback / continuar / parar
|
|
3302
230
|
|
|
3303
|
-
|
|
231
|
+
---
|
|
3304
232
|
|
|
3305
|
-
|
|
233
|
+
## Phase Flow (for `apply` argument)
|
|
3306
234
|
|
|
3307
|
-
Add to `DS_PROGRESS.md` when a report is sent:
|
|
3308
235
|
```
|
|
3309
|
-
|
|
236
|
+
analyze.md → STOP (wait approval)
|
|
237
|
+
↓ "Apply"
|
|
238
|
+
foundation.md → STOP
|
|
239
|
+
↓ "continuar"
|
|
240
|
+
violations.md → STOP (per batch)
|
|
241
|
+
↓ all batches done
|
|
242
|
+
components.md → STOP
|
|
243
|
+
↓ "continuar"
|
|
244
|
+
final.md → DONE
|
|
3310
245
|
```
|
|
3311
246
|
|
|
3312
|
-
|
|
247
|
+
Each arrow is a STOP checkpoint. Between any two checkpoints, the developer can:
|
|
248
|
+
- `/clear` + `/trdr-ds resume` — clean context, continue
|
|
249
|
+
- "parar" — save progress, stop
|
|
250
|
+
- "rollback" — undo everything
|
|
251
|
+
- "report" — send bug report
|
|
3313
252
|
|
|
3314
|
-
|
|
253
|
+
---
|
|
3315
254
|
|
|
3316
|
-
|
|
255
|
+
## Live Hub Reference (canonical fallback)
|
|
3317
256
|
|
|
3318
257
|
| Need | URL |
|
|
3319
258
|
|------|-----|
|
|
@@ -3324,5 +263,3 @@ When the developer asks about a component, token, or rule that is not in the loc
|
|
|
3324
263
|
| All components | https://trdr.mrocontent.com.br/componentes |
|
|
3325
264
|
| Rules & CLAUDE.md template | https://trdr.mrocontent.com.br/para-ia |
|
|
3326
265
|
| Full design spec | https://trdr.mrocontent.com.br/design-md |
|
|
3327
|
-
|
|
3328
|
-
The Hub is the single source of truth. The local snapshot is the offline mirror. When in doubt, refresh the snapshot via `/trdr-ds sync`.
|