|
| 1 | +--- |
| 2 | +description: |
| 3 | +globs: |
| 4 | +alwaysApply: false |
| 5 | +--- |
| 6 | +You are a design system migration specialist executing a non-migratable component workflow. Follow this systematic process: |
| 7 | + |
| 8 | +## PHASE 1: IDENTIFICATION & DISCOVERY |
| 9 | +**Step 1:** Identify and output the target component class name from previous conversation context |
| 10 | +- Output: <target_component>[CLASS_NAME]</target_component> |
| 11 | + |
| 12 | +**Step 2:** Run CSS discovery in parallel using report-deprecated-css tool: |
| 13 | +- **Global Styles Directory:** [USER_PROVIDED_INPUT] (if not provided, request from user) |
| 14 | +- **Styles Overrides Directory:** [USER_PROVIDED_INPUT] (if not provided, request from user) |
| 15 | +- **Fallback behavior:** If only one directory provided, run tool for that directory only |
| 16 | +- **Error handling:** If neither directory provided, ask user for at least one input |
| 17 | +- Component: [IDENTIFIED_CLASS_NAME] |
| 18 | + |
| 19 | +**Step 3:** Create implementation checklist |
| 20 | +- Count total violations found across both directories |
| 21 | +- Generate checklist item for each violation location |
| 22 | +- **Validation Check:** Verify checklist item count = total violation count |
| 23 | +- **Save checklist to:** `.cursor/tmp/css-cleanup/[class-name]-[scope]-non-viable-migration-checklist.md` |
| 24 | +- **DO NOT output checklist content in chat** - only reference checklist file location |
| 25 | +- Output format: |
| 26 | +<checklist_summary> |
| 27 | +<total_violations>[NUMBER]</total_violations> |
| 28 | +<total_checklist_items>[NUMBER]</total_checklist_items> |
| 29 | +<validation_check>Items match violations: [TRUE/FALSE]</validation_check> |
| 30 | +<checklist_file>`.cursor/tmp/css-cleanup/[class-name]-[scope]-non-viable-migration-checklist.md`</checklist_file> |
| 31 | +</checklist_summary> |
| 32 | + |
| 33 | +## PHASE 2: IMPLEMENTATION |
| 34 | +**Work from checklist file** - reference saved checklist and update it as you progress through each item. |
| 35 | + |
| 36 | +Execute each checklist item systematically in this exact order: |
| 37 | + |
| 38 | +**Step 1: HTML Template Updates (FIRST PRIORITY)** |
| 39 | +- Replace original component classes with "after-migration-[ORIGINAL_CLASS]" in HTML files/templates |
| 40 | +- This must be done BEFORE any CSS changes |
| 41 | +- Update all instances found in the violation reports |
| 42 | +- **Update checklist:** Mark HTML items as complete |
| 43 | + |
| 44 | +**Step 2: CSS Selector Duplication (NOT REPLACEMENT)** |
| 45 | +- DUPLICATE CSS selectors, do NOT replace them |
| 46 | +- Transform: `.custom-radio {}` → `.custom-radio, .after-migration-custom-radio {}` |
| 47 | +- Keep original selector intact alongside new prefixed selector |
| 48 | +- This ensures both old and new classes work with identical styling |
| 49 | +- Maintain visual parity between original and prefixed versions |
| 50 | +- **Update checklist:** Mark CSS items as complete |
| 51 | + |
| 52 | +## PHASE 3: VALIDATION (Success Criteria) - MANDATORY EXECUTION |
| 53 | +**CRITICAL:** Execute validation steps from checklist using actual tools, not just manual verification. |
| 54 | + |
| 55 | +**Validation 1 - CSS Count Consistency:** |
| 56 | +- **TOOL REQUIRED:** Re-run report-deprecated-css tool on both original directories |
| 57 | +- Compare counts with original baseline |
| 58 | +- **Update checklist:** Mark validation item as complete |
| 59 | +- Output: <validation_1> |
| 60 | + <original_count>[NUMBER]</original_count> |
| 61 | + <new_count>[NUMBER]</new_count> |
| 62 | + <status>PASS/FAIL</status> |
| 63 | + <criteria>Deprecated class count remains identical to original</criteria> |
| 64 | +</validation_1> |
| 65 | + |
| 66 | +**Validation 2 - Violation Reduction:** |
| 67 | +- **TOOL REQUIRED:** Run report-violations tool against modified component scope |
| 68 | +- Compare with original violation count |
| 69 | +- **Update checklist:** Mark validation item as complete |
| 70 | +- Output: <validation_2> |
| 71 | + <original_violations>[NUMBER]</original_violations> |
| 72 | + <new_violations>[NUMBER]</new_violations> |
| 73 | + <replacements_made>[NUMBER]</replacements_made> |
| 74 | + <expected_reduction>[NUMBER]</expected_reduction> |
| 75 | + <status>PASS/FAIL</status> |
| 76 | + <criteria>0 violations OR exactly X fewer violations (where X = number of replacements made)</criteria> |
| 77 | +</validation_2> |
| 78 | + |
| 79 | +**Final Step:** Update saved checklist file with validation results and mark all items complete. |
| 80 | + |
| 81 | +## OUTPUT REQUIREMENTS |
| 82 | +- Start with identified class name in <target_component> tags |
| 83 | +- Show violation counts and checklist summary in <checklist_summary> tags (NO detailed checklist content) |
| 84 | +- Reference checklist file location only |
| 85 | +- Provide step-by-step implementation status with checklist updates |
| 86 | +- Report validation results in <validation_1> and <validation_2> tags with clear pass/fail status |
| 87 | +- **Throughout process:** Update checklist file, don't repeat content in chat |
| 88 | + |
| 89 | +Execute each phase completely before proceeding to the next. Request confirmation if validation criteria are not met. |
| 90 | + |
| 91 | +## USAGE |
| 92 | +To invoke this workflow, user can say: |
| 93 | +- "Execute non-viable handling for [component]" |
| 94 | +- "Run the non-migratable component workflow" |
| 95 | +- "Handle non-viable component migration" |
| 96 | +- Or simply reference this rule: @non-viable-handling |
| 97 | +description: |
| 98 | +globs: |
| 99 | +alwaysApply: false |
| 100 | +--- |
0 commit comments