trdr-ds-install 1.2.5 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trdr-ds-install",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Installs the TRDR Design System skill for Claude Code",
|
|
5
5
|
"bin": {
|
|
6
6
|
"trdr-ds-install": "./bin/install.js"
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"sync-components": "node scripts/sync-components.js",
|
|
10
10
|
"sync-tokens": "node scripts/sync-tokens.js",
|
|
11
11
|
"sync": "node scripts/sync-tokens.js && node scripts/sync-components.js",
|
|
12
|
-
"sync:local": "node scripts/sync-tokens.js --local ../trdr-design-hub && node scripts/sync-components.js --local ../trdr-design-hub"
|
|
12
|
+
"sync:local": "node scripts/sync-tokens.js --local ../trdr-design-hub && node scripts/sync-components.js --local ../trdr-design-hub",
|
|
13
|
+
"postpublish": "node bin/install.js"
|
|
13
14
|
},
|
|
14
15
|
"files": [
|
|
15
16
|
"bin/",
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: trdr-ds
|
|
3
|
-
description: Applies the TRDR Design System to any project. Runs a two-phase workflow - first analyzes the project and presents a migration plan for approval, then executes the full implementation (tokens, components, CLAUDE.md, violation fixes). Trigger when developer mentions "apply design system", "implement TRDR DS", "add TRDR tokens", "design system setup", "migrar design system", "aplicar design system", or invokes /trdr-ds.
|
|
3
|
+
description: Applies the TRDR Design System to any project. Runs a two-phase workflow - first analyzes the project and presents a migration plan for approval, then executes the full implementation (tokens, components, CLAUDE.md, violation fixes). For large projects (50+ violations), execution is batched by folder with progress saved to DS_PROGRESS.md and resumable at any time. Trigger when developer mentions "apply design system", "implement TRDR DS", "add TRDR tokens", "design system setup", "migrar design system", "aplicar design system", or invokes /trdr-ds.
|
|
4
4
|
user-invocable: true
|
|
5
|
-
argument-hint: "[analyze|apply|sync]"
|
|
5
|
+
argument-hint: "[analyze|apply|resume|status|sync|batch N]"
|
|
6
6
|
allowed-tools: [Read, Glob, Grep, Edit, Write, Bash, WebFetch]
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
**Skill version:** 1.3.0
|
|
10
|
+
**npm package:** trdr-ds-install
|
|
11
|
+
|
|
9
12
|
You are implementing the **TRDR Design System** in a developer's project. The Design Hub is the single source of truth and lives at **https://trdr.mrocontent.com.br**.
|
|
10
13
|
|
|
11
14
|
This skill ships with two **offline-first snapshots** of the Hub:
|
|
@@ -25,6 +28,9 @@ Execute in two clearly separated phases: **PHASE 1: ANALYZE → PHASE 2: EXECUTE
|
|
|
25
28
|
|-----|-----------|
|
|
26
29
|
| `analyze` *(default when none given)* | Run Phase 1 only — produce a migration plan, do not modify any project file |
|
|
27
30
|
| `apply` | Run Phase 1 + Phase 2 |
|
|
31
|
+
| `resume` | Read `DS_PROGRESS.md` from the project root and continue from the last checkpoint (Phase 2 batching only) |
|
|
32
|
+
| `status` | Read `DS_PROGRESS.md` and display a progress summary table — no files modified |
|
|
33
|
+
| `batch [N]` | Override default batch size for Phase 2 (default: 25 files/batch) |
|
|
28
34
|
| `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. |
|
|
29
35
|
| `--latest` *(modifier on `analyze` or `apply`)* | Same as `sync` first, then continue normally |
|
|
30
36
|
|
|
@@ -34,6 +40,58 @@ Execute in two clearly separated phases: **PHASE 1: ANALYZE → PHASE 2: EXECUTE
|
|
|
34
40
|
|
|
35
41
|
Scan the project and produce a structured migration plan. Do NOT modify any project files yet.
|
|
36
42
|
|
|
43
|
+
### Step 0 — Check for skill updates, then detect previous progress
|
|
44
|
+
|
|
45
|
+
**Version check (runs on every invocation):**
|
|
46
|
+
|
|
47
|
+
Run this command silently via Bash:
|
|
48
|
+
```bash
|
|
49
|
+
npm show trdr-ds-install version 2>/dev/null
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Compare the result with the **Skill version** constant at the top of this file (`1.3.0`).
|
|
53
|
+
|
|
54
|
+
- If the command fails or returns empty (no internet / npm unavailable): skip silently, continue.
|
|
55
|
+
- If registry version == local version: skip silently, continue.
|
|
56
|
+
- If registry version > local version:
|
|
57
|
+
```
|
|
58
|
+
🔄 Nova versão da skill disponível: trdr-ds-install@[registry-version] (instalada: 1.3.0)
|
|
59
|
+
|
|
60
|
+
Responda:
|
|
61
|
+
- `"atualizar"` / `"update"` — instalar a nova versão agora (requer reiniciar /trdr-ds após)
|
|
62
|
+
- `"continuar"` / `"skip"` — usar a versão atual desta sessão
|
|
63
|
+
```
|
|
64
|
+
**STOP.** Wait for reply.
|
|
65
|
+
|
|
66
|
+
If reply is `"atualizar"` / `"update"`:
|
|
67
|
+
- Run Bash: `npx trdr-ds-install@latest`
|
|
68
|
+
- Output:
|
|
69
|
+
```
|
|
70
|
+
✅ Skill atualizada para trdr-ds-install@[registry-version].
|
|
71
|
+
Use /trdr-ds novamente para continuar com a versão mais recente.
|
|
72
|
+
```
|
|
73
|
+
- STOP. Do not continue with the current (old) instructions.
|
|
74
|
+
|
|
75
|
+
**After version check, detect previous progress:**
|
|
76
|
+
|
|
77
|
+
Check if `DS_PROGRESS.md` exists at the project root.
|
|
78
|
+
|
|
79
|
+
**If found AND `Status:` line is NOT `COMPLETE`:**
|
|
80
|
+
```
|
|
81
|
+
⚠️ Previous TRDR DS migration found (status: [IN_PROGRESS/PAUSED]).
|
|
82
|
+
|
|
83
|
+
Reply with:
|
|
84
|
+
- `"resume"` — continue from last checkpoint (Batch [N])
|
|
85
|
+
- `"restart"` — discard progress and run a fresh analysis
|
|
86
|
+
- `"status"` — see a progress summary without modifying anything
|
|
87
|
+
```
|
|
88
|
+
**STOP HERE. Wait for the developer's reply.**
|
|
89
|
+
|
|
90
|
+
**If found AND `Status: COMPLETE`:**
|
|
91
|
+
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.
|
|
92
|
+
|
|
93
|
+
**If not found:** Continue normally to Step 1.
|
|
94
|
+
|
|
37
95
|
### Step 1 — Detect framework
|
|
38
96
|
|
|
39
97
|
Read `package.json` at the project root. Identify:
|
|
@@ -89,6 +147,11 @@ Flag any gradient that doesn't reference a TRDR gradient token (`var(--gradient-
|
|
|
89
147
|
**H — Hardcoded font-size in px** (should use .trdr-h* / .trdr-body-* text style classes):
|
|
90
148
|
Search: `font-size:\s*\d+px` in CSS/SCSS files (skip tokens.css itself)
|
|
91
149
|
|
|
150
|
+
Track:
|
|
151
|
+
- `total_violations` = sum of all A–H occurrences
|
|
152
|
+
- `total_files_with_violations` = count of unique files with ≥ 1 violation
|
|
153
|
+
- `violations_by_folder` = map of `{ folder: string, files: string[], count: number }[]` grouped by first-level folder inside `src/` (or project root if no `src/`)
|
|
154
|
+
|
|
92
155
|
### Step 3.5 — Detect component replacement candidates
|
|
93
156
|
|
|
94
157
|
Scan the project for UI patterns that indicate elements replaceable by TRDR implemented components.
|
|
@@ -176,7 +239,11 @@ Use the loaded data throughout the rest of the workflow. Track:
|
|
|
176
239
|
|
|
177
240
|
### Step 5 — Present the migration plan and STOP
|
|
178
241
|
|
|
179
|
-
Output the following report and **do not proceed** until the developer explicitly approves
|
|
242
|
+
Output the following report and **do not proceed** until the developer explicitly approves.
|
|
243
|
+
|
|
244
|
+
Determine execution mode based on thresholds:
|
|
245
|
+
- **Small project** (`total_violations <= 50` AND `total_files_with_violations <= 30`): standard monolithic execution — no batching, no DS_PROGRESS.md
|
|
246
|
+
- **Large project** (`total_violations > 50` OR `total_files_with_violations > 30`): batched execution — include the large project warning below
|
|
180
247
|
|
|
181
248
|
```markdown
|
|
182
249
|
## TRDR Design System — Migration Plan
|
|
@@ -230,11 +297,21 @@ Output the following report and **do not proceed** until the developer explicitl
|
|
|
230
297
|
|
|
231
298
|
> **Implementados:** o CSS já estará em `components.css` após a Fase 2 — o dev só precisa trocar as classes.
|
|
232
299
|
> **Stubs:** receberão banner comment com tokens recomendados + entrada em `MISSING_COMPONENTS.md`.
|
|
233
|
-
> **Não listados aqui:** componentes específicos da TRDR (boleta, janela) — verificar manualmente se o projeto os usa.
|
|
234
300
|
|
|
235
301
|
### SCOPE ESTIMATE: [Small / Medium / Large]
|
|
236
302
|
Small = <10 violations | Medium = 10–50 | Large = 50+
|
|
237
303
|
|
|
304
|
+
[ONLY for large projects — include this block:]
|
|
305
|
+
### ⚠️ LARGE PROJECT DETECTED
|
|
306
|
+
[total_violations] violations across [total_files_with_violations] files.
|
|
307
|
+
Phase 2 will run in **BATCHES BY FOLDER** to prevent context overflow and allow resuming.
|
|
308
|
+
|
|
309
|
+
Default batch: 25 files/batch → ~[ceil(total_files_with_violations/25)] batches estimated
|
|
310
|
+
Progress saved to `DS_PROGRESS.md` — resumable anytime with `/trdr-ds resume`.
|
|
311
|
+
|
|
312
|
+
To change batch size: reply with `"Apply, batch 15"` or `"Apply, batch 40"`.
|
|
313
|
+
[END large project block]
|
|
314
|
+
|
|
238
315
|
### WHAT WILL NOT BE TOUCHED:
|
|
239
316
|
- Images, SVGs, fonts files
|
|
240
317
|
- node_modules/, .next/, dist/, build/, out/
|
|
@@ -245,6 +322,7 @@ Small = <10 violations | Medium = 10–50 | Large = 50+
|
|
|
245
322
|
|
|
246
323
|
**Reply with one of:**
|
|
247
324
|
- `"Apply"` or `"Executar"` — proceed with everything above
|
|
325
|
+
- `"Apply, batch [N]"` — proceed with custom batch size (large projects only)
|
|
248
326
|
- `"Apply, skip [file or directory]"` — proceed but exclude specific paths
|
|
249
327
|
- `"Only tokens"` — only create tokens.css, components.css, and CLAUDE.md (no violation fixes)
|
|
250
328
|
- `"Change [detail]"` — adjust a specific part of the plan before executing
|
|
@@ -257,7 +335,55 @@ Small = <10 violations | Medium = 10–50 | Large = 50+
|
|
|
257
335
|
|
|
258
336
|
## PHASE 2: EXECUTION (only after explicit approval)
|
|
259
337
|
|
|
260
|
-
|
|
338
|
+
Parse the developer's reply:
|
|
339
|
+
- Extract batch size override from `"Apply, batch N"` → use N; otherwise default to 25.
|
|
340
|
+
- Extract skip paths from `"Apply, skip [path]"` → exclude those from violation processing.
|
|
341
|
+
- `"Only tokens"` → skip Steps 5 and 6 (no violation fixes, no component banners).
|
|
342
|
+
|
|
343
|
+
Report progress after each major step.
|
|
344
|
+
|
|
345
|
+
### Step 0 — Initialize checkpoint
|
|
346
|
+
|
|
347
|
+
**Determine execution mode:**
|
|
348
|
+
```
|
|
349
|
+
if total_violations <= 50 AND total_files_with_violations <= 30:
|
|
350
|
+
mode = MONOLITHIC (no DS_PROGRESS.md created — skip to Step 1)
|
|
351
|
+
else:
|
|
352
|
+
mode = BATCHED (create DS_PROGRESS.md, execute in batches)
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
**For BATCHED mode — create `DS_PROGRESS.md` at the project root:**
|
|
356
|
+
|
|
357
|
+
```markdown
|
|
358
|
+
# TRDR DS Migration — Progress
|
|
359
|
+
Started: [ISO datetime]
|
|
360
|
+
Project: [project name from package.json]
|
|
361
|
+
Batch size: [N]
|
|
362
|
+
Status: IN_PROGRESS
|
|
363
|
+
|
|
364
|
+
## Foundation
|
|
365
|
+
- [ ] tokens.css
|
|
366
|
+
- [ ] components.css
|
|
367
|
+
- [ ] CLAUDE.md
|
|
368
|
+
- [ ] @import no CSS global
|
|
369
|
+
|
|
370
|
+
## Lotes de Violações
|
|
371
|
+
Total de arquivos com violações: [total_files_with_violations]
|
|
372
|
+
Total de violações: [total_violations]
|
|
373
|
+
Total de lotes: [N]
|
|
374
|
+
|
|
375
|
+
[For each folder in violations_by_folder, sorted alphabetically.
|
|
376
|
+
If a folder has more files than batch_size, split into sub-batches labeled "1a", "1b", etc.
|
|
377
|
+
Files at the project root (not inside src/) go in a final "raiz" batch.]
|
|
378
|
+
|
|
379
|
+
### Lote 1 — [folder/] ([N] arquivos) — PENDING
|
|
380
|
+
### Lote 2 — [folder/] ([N] arquivos) — PENDING
|
|
381
|
+
...
|
|
382
|
+
### Lote [n] — raiz ([N] arquivos) — PENDING
|
|
383
|
+
|
|
384
|
+
## Padrões Sem Token (revisão manual)
|
|
385
|
+
[empty — filled during execution]
|
|
386
|
+
```
|
|
261
387
|
|
|
262
388
|
### Step 1 — Create tokens.css
|
|
263
389
|
|
|
@@ -274,6 +400,11 @@ If `references/tokens.css` is missing in the skill directory:
|
|
|
274
400
|
1. Try `WebFetch: https://trdr.mrocontent.com.br/tokens.css`, save it to the skill dir, then proceed.
|
|
275
401
|
2. If the Hub is also unreachable → STOP with error message asking the maintainer to run `npm run sync`.
|
|
276
402
|
|
|
403
|
+
**For BATCHED mode:** After writing tokens.css, update `DS_PROGRESS.md`:
|
|
404
|
+
```
|
|
405
|
+
- [x] tokens.css — [path]/tokens.css
|
|
406
|
+
```
|
|
407
|
+
|
|
277
408
|
### Step 2 — Create components.css
|
|
278
409
|
|
|
279
410
|
Build `components.css` by concatenating the `.code.css` block of every implemented component plus the typography utility classes.
|
|
@@ -312,6 +443,11 @@ After all component CSS blocks, append the text style utility classes:
|
|
|
312
443
|
.trdr-label-l3 { font-family: var(--font-secondary); font-size: 14px; font-weight: 600; line-height: 1.4; }
|
|
313
444
|
```
|
|
314
445
|
|
|
446
|
+
**For BATCHED mode:** Update `DS_PROGRESS.md`:
|
|
447
|
+
```
|
|
448
|
+
- [x] components.css — [path]/components.css
|
|
449
|
+
```
|
|
450
|
+
|
|
315
451
|
### Step 3 — Update global CSS
|
|
316
452
|
|
|
317
453
|
Find the main global CSS file (globals.css, main.css, index.css, app.css) and add at the very top:
|
|
@@ -325,6 +461,11 @@ Adjust the relative path if tokens.css is in a subdirectory.
|
|
|
325
461
|
|
|
326
462
|
If the project already imports a different design system's variables and there are naming conflicts, warn the developer before proceeding.
|
|
327
463
|
|
|
464
|
+
**For BATCHED mode:** Update `DS_PROGRESS.md`:
|
|
465
|
+
```
|
|
466
|
+
- [x] @import — [global-css-file]
|
|
467
|
+
```
|
|
468
|
+
|
|
328
469
|
### Step 4 — Create CLAUDE.md
|
|
329
470
|
|
|
330
471
|
Create `CLAUDE.md` at the project root, populated dynamically from the catalog:
|
|
@@ -383,9 +524,62 @@ bg.primary (base) → bg.secondary/tertiary (content areas) → surface.* (cards
|
|
|
383
524
|
→ interactive components → overlays/modals/tooltips
|
|
384
525
|
```
|
|
385
526
|
|
|
527
|
+
**For BATCHED mode:** Update `DS_PROGRESS.md`:
|
|
528
|
+
```
|
|
529
|
+
- [x] CLAUDE.md — CLAUDE.md
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
Then output:
|
|
533
|
+
```
|
|
534
|
+
✅ Foundation complete — tokens.css, components.css, CLAUDE.md, @import all done.
|
|
535
|
+
Starting violation processing in [N] batches of up to [batch_size] files each.
|
|
536
|
+
```
|
|
537
|
+
|
|
386
538
|
### Step 5 — Migrate violations
|
|
387
539
|
|
|
388
|
-
|
|
540
|
+
**MONOLITHIC mode:** Process all files with violations in one pass. Apply all replacements below. Continue to Step 6.
|
|
541
|
+
|
|
542
|
+
**BATCHED mode:** Process one batch at a time, with a STOP between batches.
|
|
543
|
+
|
|
544
|
+
For each batch listed as PENDING in `DS_PROGRESS.md`:
|
|
545
|
+
|
|
546
|
+
1. Update `DS_PROGRESS.md` — change batch status to `IN_PROGRESS`
|
|
547
|
+
2. For each file in the batch:
|
|
548
|
+
- Apply all applicable violation fixes (see mapping tables below)
|
|
549
|
+
- Count violations fixed
|
|
550
|
+
3. Update `DS_PROGRESS.md` — change batch status to `COMPLETED`:
|
|
551
|
+
```
|
|
552
|
+
### Lote [N] — [folder/] ([N] arquivos) — COMPLETED
|
|
553
|
+
Violações corrigidas: [N] | Arquivos: [N]/[N]
|
|
554
|
+
```
|
|
555
|
+
Add any unfixable patterns to the "Padrões Sem Token" section of `DS_PROGRESS.md`.
|
|
556
|
+
4. Output batch summary:
|
|
557
|
+
```
|
|
558
|
+
✅ Lote [N] concluído — [folder/] ([N] arquivos, [N] violações corrigidas)
|
|
559
|
+
Progresso geral: [done]/[total] lotes | [total_fixed] violações corrigidas
|
|
560
|
+
```
|
|
561
|
+
5. If more batches are PENDING:
|
|
562
|
+
|
|
563
|
+
**STOP HERE.** Output:
|
|
564
|
+
```
|
|
565
|
+
Próximo: **Lote [N+1] — [folder/]** ([N] arquivos)
|
|
566
|
+
Responda:
|
|
567
|
+
- "continuar" / "continue" — processar próximo lote
|
|
568
|
+
- "pular [pasta]" — skip this folder and go to the next batch
|
|
569
|
+
- "parar" / "stop" — save progress and stop here (resume later with `/trdr-ds resume`)
|
|
570
|
+
- "tudo" / "all" — process all remaining batches without pausing
|
|
571
|
+
```
|
|
572
|
+
**Wait for developer reply.**
|
|
573
|
+
|
|
574
|
+
If reply is `"tudo"` / `"all"`: process all remaining batches without pausing (update DS_PROGRESS.md after each).
|
|
575
|
+
If reply is `"pular [pasta]"`: mark that batch as SKIPPED in DS_PROGRESS.md and move to the next.
|
|
576
|
+
If reply is `"parar"`: set `Status: PAUSED` in DS_PROGRESS.md. STOP. Do not proceed to Step 6 or 7.
|
|
577
|
+
|
|
578
|
+
6. After ALL batches are COMPLETED (or skipped): continue to Step 6.
|
|
579
|
+
|
|
580
|
+
---
|
|
581
|
+
|
|
582
|
+
**Violation mapping tables (used in Steps 5 for both modes):**
|
|
389
583
|
|
|
390
584
|
**Color mapping (hardcoded → semantic):**
|
|
391
585
|
| Hardcoded value | Context | Replace with |
|
|
@@ -430,17 +624,17 @@ For each violation found in Phase 1, apply the semantic token replacement.
|
|
|
430
624
|
**rgba() mapping:**
|
|
431
625
|
| Hardcoded pattern | Context | Replace with |
|
|
432
626
|
|-------------------|---------|-------------|
|
|
433
|
-
| `rgba(0,0,0,*)` | box-shadow | No TRDR shadow token exists → flag in DS_MIGRATION.md as "Missing shadow token" |
|
|
627
|
+
| `rgba(0,0,0,*)` | box-shadow | No TRDR shadow token exists → flag in DS_PROGRESS.md / DS_MIGRATION.md as "Missing shadow token" |
|
|
434
628
|
| `rgba(255,255,255,.29)` approx | overlay/backdrop | `var(--bg-overlay)` |
|
|
435
|
-
| `rgba(255,255,255,*)` other | overlay | flag
|
|
629
|
+
| `rgba(255,255,255,*)` other | overlay | flag |
|
|
436
630
|
| Any other `rgba(N,N,N,*)` | various | Map to nearest semantic alpha token (--surface-brand, --surface-info, --action-*-alpha, etc.) or flag |
|
|
437
631
|
|
|
438
632
|
**Gradient mapping:**
|
|
439
633
|
| Pattern | Replace with |
|
|
440
634
|
|---------|-------------|
|
|
441
635
|
| `linear-gradient(...)` using only TRDR brand colors | `var(--gradient-text-brand)`, `var(--gradient-bg-hero)`, or `var(--gradient-bg-fade)` as appropriate |
|
|
442
|
-
| `linear-gradient(...)` using any non-DS colors | Flag
|
|
443
|
-
| Gradient inside SVG data URI embedded in CSS | Flag
|
|
636
|
+
| `linear-gradient(...)` using any non-DS colors | Flag — developer must decide: remove, replace with TRDR gradient token, or add new token to Hub |
|
|
637
|
+
| Gradient inside SVG data URI embedded in CSS | Flag |
|
|
444
638
|
|
|
445
639
|
**Font-size mapping:**
|
|
446
640
|
| Hardcoded value | Replace with |
|
|
@@ -457,14 +651,14 @@ For each violation found in Phase 1, apply the semantic token replacement.
|
|
|
457
651
|
| `font-size: 14px` | `.trdr-body-b3` or `.trdr-label-l3` (check weight context) |
|
|
458
652
|
| `font-size: 12px` | `.trdr-body-b4` or `.trdr-body-aux` (check letter-spacing) |
|
|
459
653
|
| `font-size: 10px` | `.trdr-body-b5` class |
|
|
460
|
-
| `font-size: [other px]` | Nearest text style class — flag
|
|
654
|
+
| `font-size: [other px]` | Nearest text style class — flag if no match |
|
|
461
655
|
|
|
462
656
|
**Do NOT replace:**
|
|
463
657
|
- Hex values inside binary image files (PNG, JPG, GIF)
|
|
464
|
-
- SVG external files — flag them
|
|
658
|
+
- SVG external files — flag them but do not auto-edit
|
|
465
659
|
- Values in commented-out code
|
|
466
660
|
|
|
467
|
-
**All other values MUST be replaced or flagged.**
|
|
661
|
+
**All other values MUST be replaced or flagged.** No exceptions for "decorative" gradients, shadows, or overlays.
|
|
468
662
|
|
|
469
663
|
### Step 6 — Apply component code (smart fallback)
|
|
470
664
|
|
|
@@ -490,7 +684,7 @@ Use the `replacementCandidates[]` list built in Phase 1 Step 3.5. For each entry
|
|
|
490
684
|
- Status: ⚠️ stub — code blocks pending
|
|
491
685
|
```
|
|
492
686
|
4. **If no slug matches** the detected pattern:
|
|
493
|
-
- Flag the pattern in `MISSING_COMPONENTS.md` under "Unmapped patterns" with the file location and a one-line description of the UI need.
|
|
687
|
+
- Flag the pattern in `MISSING_COMPONENTS.md` under "Unmapped patterns" with the file location and a one-line description of the UI need.
|
|
494
688
|
|
|
495
689
|
### Step 7 — Generate DS_MIGRATION.md
|
|
496
690
|
|
|
@@ -509,6 +703,7 @@ Hub: https://trdr.mrocontent.com.br
|
|
|
509
703
|
- ✅ [N] violations fixed in [M] files
|
|
510
704
|
- ✅ [global-css] updated with @import
|
|
511
705
|
- ⚠️ [S] stub components flagged in MISSING_COMPONENTS.md (if any)
|
|
706
|
+
[If batched: - ✅ Migrated in [N] batches — see DS_PROGRESS.md for batch-level detail]
|
|
512
707
|
|
|
513
708
|
## Files modified
|
|
514
709
|
[List each file and what changed]
|
|
@@ -522,11 +717,10 @@ Hub: https://trdr.mrocontent.com.br
|
|
|
522
717
|
- Others: add Google Fonts `<link>` in HTML head
|
|
523
718
|
- [ ] **Dark/light mode**: tokens.css uses [data-theme="light"] for overrides — add `data-theme="light"` to `<html>` to activate light mode
|
|
524
719
|
- [ ] **Trading UI**: If this project has price/position displays, verify context.trading.* tokens are applied (see Hub: /tokens/semanticos)
|
|
525
|
-
- [ ] **Stubs**: Review MISSING_COMPONENTS.md and decide whether to wait for canonical implementation in the Hub or hand-roll
|
|
720
|
+
- [ ] **Stubs**: Review MISSING_COMPONENTS.md and decide whether to wait for canonical implementation in the Hub or hand-roll using the listed tokens
|
|
526
721
|
- [ ] **Skipped files**: [list any files excluded from migration]
|
|
527
722
|
|
|
528
723
|
## Missing DS tokens (flagged — no semantic token available)
|
|
529
|
-
[List patterns found in the project that have no TRDR token yet — request these in the Hub]
|
|
530
724
|
| Pattern | File | Suggestion |
|
|
531
725
|
|---------|------|-----------|
|
|
532
726
|
| `box-shadow: rgba(0,0,0,*)` | [file:line] | Request shadow token in Hub |
|
|
@@ -543,6 +737,12 @@ Hub: https://trdr.mrocontent.com.br
|
|
|
543
737
|
- Rules: https://trdr.mrocontent.com.br/para-ia
|
|
544
738
|
```
|
|
545
739
|
|
|
740
|
+
**For BATCHED mode:** After writing DS_MIGRATION.md, update `DS_PROGRESS.md`:
|
|
741
|
+
```
|
|
742
|
+
Status: COMPLETE
|
|
743
|
+
Completed: [ISO datetime]
|
|
744
|
+
```
|
|
745
|
+
|
|
546
746
|
---
|
|
547
747
|
|
|
548
748
|
## EXECUTION SUMMARY
|
|
@@ -558,6 +758,7 @@ Created:
|
|
|
558
758
|
• CLAUDE.md (design system context for Claude Code)
|
|
559
759
|
• DS_MIGRATION.md (migration log + manual checklist)
|
|
560
760
|
• MISSING_COMPONENTS.md ([S] stubs flagged) — only if applicable
|
|
761
|
+
[If batched: • DS_PROGRESS.md (migration log — status: COMPLETE)]
|
|
561
762
|
|
|
562
763
|
Modified:
|
|
563
764
|
• [global-css] — @import added
|
|
@@ -571,6 +772,63 @@ Hub: https://trdr.mrocontent.com.br
|
|
|
571
772
|
|
|
572
773
|
---
|
|
573
774
|
|
|
775
|
+
## RESUME MODE (when invoked with `resume` argument)
|
|
776
|
+
|
|
777
|
+
1. Look for `DS_PROGRESS.md` at the project root.
|
|
778
|
+
- If not found: output `❌ No previous migration found. Run /trdr-ds to start a new one.`
|
|
779
|
+
- If `Status: COMPLETE`: output `✅ Migration already complete (finished [date]). Run /trdr-ds to check for new violations.`
|
|
780
|
+
|
|
781
|
+
2. Read `DS_PROGRESS.md`. Find the first batch with status `IN_PROGRESS` or `PENDING`.
|
|
782
|
+
|
|
783
|
+
3. Output a resume summary:
|
|
784
|
+
```
|
|
785
|
+
Resuming TRDR DS migration — [project name]
|
|
786
|
+
Foundation: ✅ complete
|
|
787
|
+
Batches completed: [done]/[total] | Violations fixed so far: [N]
|
|
788
|
+
Resuming at: **Lote [N] — [folder/]** ([N] files)
|
|
789
|
+
```
|
|
790
|
+
|
|
791
|
+
4. Continue Phase 2 Step 5 from that batch. Follow the same STOP-between-batches flow.
|
|
792
|
+
|
|
793
|
+
5. After all batches finish: run Steps 6 and 7 (component banners + DS_MIGRATION.md).
|
|
794
|
+
|
|
795
|
+
---
|
|
796
|
+
|
|
797
|
+
## STATUS MODE (when invoked with `status` argument)
|
|
798
|
+
|
|
799
|
+
1. Look for `DS_PROGRESS.md` at the project root.
|
|
800
|
+
- If not found: output `No migration in progress. Run /trdr-ds to start.`
|
|
801
|
+
|
|
802
|
+
2. Read `DS_PROGRESS.md` and output a progress table — do NOT modify any files:
|
|
803
|
+
|
|
804
|
+
```
|
|
805
|
+
## TRDR DS — Migration Status
|
|
806
|
+
|
|
807
|
+
Project: [name] | Started: [date] | Status: [IN_PROGRESS/PAUSED/COMPLETE]
|
|
808
|
+
|
|
809
|
+
### Foundation
|
|
810
|
+
| Step | File | Status |
|
|
811
|
+
|------|------|--------|
|
|
812
|
+
| tokens.css | [path] | ✅ / ⏳ |
|
|
813
|
+
| components.css | [path] | ✅ / ⏳ |
|
|
814
|
+
| CLAUDE.md | CLAUDE.md | ✅ / ⏳ |
|
|
815
|
+
| @import | [global-css] | ✅ / ⏳ |
|
|
816
|
+
|
|
817
|
+
### Violation Batches
|
|
818
|
+
| Lote | Pasta | Arquivos | Violações | Status |
|
|
819
|
+
|------|-------|----------|-----------|--------|
|
|
820
|
+
| 1 | src/components/ | 12 | 34 | ✅ COMPLETED |
|
|
821
|
+
| 2 | src/pages/ | 8 | 12 | 🔄 IN_PROGRESS |
|
|
822
|
+
| 3 | src/app/ | 15 | — | ⏳ PENDING |
|
|
823
|
+
| 4 | src/styles/ | 6 | — | ⏳ PENDING |
|
|
824
|
+
|
|
825
|
+
Progress: [N]% ([done]/[total] batches — [violations_fixed]/[total_violations] violations fixed)
|
|
826
|
+
|
|
827
|
+
To continue: `/trdr-ds resume`
|
|
828
|
+
```
|
|
829
|
+
|
|
830
|
+
---
|
|
831
|
+
|
|
574
832
|
## SYNC MODE (when invoked as `/trdr-ds sync`)
|
|
575
833
|
|
|
576
834
|
1. WebFetch `https://trdr.mrocontent.com.br/components.json` → save as `<skill-dir>/data/components.json`
|
|
@@ -581,7 +839,7 @@ Hub: https://trdr.mrocontent.com.br
|
|
|
581
839
|
- Removed: [list slugs no longer in catalog]
|
|
582
840
|
4. No project files are touched.
|
|
583
841
|
|
|
584
|
-
If either fetch fails, report which one and exit
|
|
842
|
+
If either fetch fails, report which one and exit. Do NOT touch the snapshot if the response is malformed (e.g., missing `components` array).
|
|
585
843
|
|
|
586
844
|
---
|
|
587
845
|
|