You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .cursor/flows/ds-refactoring-flow/01-find-violations.mdc
+21-20Lines changed: 21 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -6,28 +6,32 @@ alwaysApply: false
6
6
You are an AI assistant tasked with helping a developer identify and plan refactoring for legacy component usage. Follow these instructions carefully to complete the task in two main steps.
7
7
8
8
First, I will provide you with the following information:
Copy file name to clipboardExpand all lines: .cursor/flows/ds-refactoring-flow/02-plan-refactoring.mdc
+7-51Lines changed: 7 additions & 51 deletions
Original file line number
Diff line number
Diff line change
@@ -6,21 +6,20 @@ alwaysApply: false
6
6
You are an AI assistant tasked with helping a development team migrate legacy components to a new design system. Your goal is to analyze the current codebase, identify areas that need updating, and provide a detailed plan for the migration process. This task will be completed in three phases: a comprehensive analysis, a detailed plan creation, and a checklist creation.
7
7
8
8
You will be working with the following inputs:
9
-
<component_name>{{COMPONENT_NAME}}</component_name>: The name of the target design-system component
10
9
<folder_path>{{FOLDER_PATH}}</folder_path>: The path to the folder containing the legacy components
11
-
<component_docs>{{COMPONENT_DOCS}}</component_docs>: The official documentation for the target design-system component
12
-
<component_code>{{COMPONENT_CODE}}</component_code>: The source files of the target design-system component
13
-
<usage_graph>{{USAGE_GRAPH}}</usage_graph>: A graph showing the usage of the legacy component in the specified folder
10
+
<component_docs>{{COMPONENT_DOCS}}</component_docs>: The official documentation for the target design-system components
11
+
<component_code>{{COMPONENT_CODE}}</component_code>: The source files of the target design-system components
12
+
<usage_graph>{{USAGE_GRAPH}}</usage_graph>: A graph showing the usage of the legacy components in the specified folder
14
13
<library_data>{{LIBRARY_DATA}}</library_data>: Information about library type
15
14
16
15
# Phase 1: Comprehensive Analysis
17
16
18
17
1. Review all provided inputs: COMPONENT_DOCS, COMPONENT_CODE, USAGE_GRAPH, and LIBRARY_DATA.
19
18
20
19
2. Analyze the current codebase, focusing on:
21
-
a. The approved markup and API for the target component
22
-
b. The actual implementation of the design-system component
23
-
c. All files (templates, TS, styles, specs, NgModules) that reference the legacy component
20
+
a. The approved markup and API for the target components
21
+
b. The actual implementation of the design-system components
22
+
c. All files (templates, TS, styles, specs, NgModules) that reference the legacy components
24
23
d. Dependencies and library information
25
24
26
25
3. Create a comprehensive summary of the analysis, including:
@@ -35,47 +34,4 @@ Write your comprehensive analysis in <comprehensive_analysis> tags.
35
34
36
35
# Phase 2: Detailed Plan Creation
37
36
38
-
Please think about this problem thoroughly and in great detail. Consider multiple approaches and show your complete reasoning. Please perform a thourough and Based on your comprehensive analysis, create a detailed migration plan:
39
-
40
-
1. For each affected file:
41
-
a. Compare the old markup against the design-system exemplar from the COMPONENT_DOCS.
42
-
b. Classify the migration effort as:
43
-
- Simple swap (straight replacement with no loss of behavior, styling, responsive rules, animation, click/test-ID, or accessibility attributes)
44
-
- Requires restructure (minor code or CSS tweaks needed to preserve behaviors or visuals that the design-system component lacks)
45
-
- Non-viable (needs manual rethink)
46
-
c. Assign a complexity score on a scale of 1-10, adding:
47
-
- +1 per removed animation or breakpoint
48
-
- +2 per business variant that needs to be rebuilt
49
-
50
-
2. Create an actionable plan ordered by effort, including:
51
-
a. File path & type
52
-
b. Refactor classification
53
-
c. Concrete edits needed (template, TS, styles, NgModule, spec)
54
-
d. Verification notes (2-3 static checks that can be performed by reading files only)
55
-
e. Complexity score
56
-
57
-
3. If any items are classified as non-viable, explicitly highlight these in a separate section of your plan.
58
-
59
-
4. Review your detailed plan against the COMPONENT_DOCS to ensure all recommendations align with the official documentation.
60
-
61
-
5. Identify any ambiguities in your plan that could be interpreted multiple ways and list these in a separate section.
62
-
63
-
Write your detailed migration plan in <migration_plan> tags.
64
-
65
-
# Phase 3: Checklist Creation
66
-
67
-
After the user approves the plan and clarifies any ambiguities:
68
-
69
-
1. Create a checklist that lists only actual changes as checkboxes.
70
-
2. Create a "check" phase where all verifications (2-3 static checks that can be performed by reading files only) are listed as checkboxes.
71
-
3. Ensure the checklist is comprehensive and follows directly from the approved migration plan.
72
-
73
-
Write your checklist in <checklist> tags.
74
-
75
-
Your final output should include only the following:
76
-
1. The <comprehensive_analysis> block
77
-
2. The <migration_plan> block
78
-
3. The following approval request: "🛠️ Approve this plan or specify adjustments?"
79
-
4. If applicable, an ambiguity safeguard: "❓ The plan contains ambiguities: [short description]. Please clarify."
80
-
81
-
After the user approves the plan and clarifies any ambiguities, provide only the <checklist> block in your response. Also, remember to save the checklist in a file at .cursor/tmp/refactoring-checklis-{{FOLDER_PATH}}.md.
Copy file name to clipboardExpand all lines: .cursor/rules/01-find-violations.mdc
+21-20Lines changed: 21 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -6,28 +6,32 @@ alwaysApply: false
6
6
You are an AI assistant tasked with helping a developer identify and plan refactoring for legacy component usage. Follow these instructions carefully to complete the task in two main steps.
7
7
8
8
First, I will provide you with the following information:
Copy file name to clipboardExpand all lines: .cursor/rules/02-plan-refactoring.mdc
+7-51Lines changed: 7 additions & 51 deletions
Original file line number
Diff line number
Diff line change
@@ -6,21 +6,20 @@ alwaysApply: false
6
6
You are an AI assistant tasked with helping a development team migrate legacy components to a new design system. Your goal is to analyze the current codebase, identify areas that need updating, and provide a detailed plan for the migration process. This task will be completed in three phases: a comprehensive analysis, a detailed plan creation, and a checklist creation.
7
7
8
8
You will be working with the following inputs:
9
-
<component_name>{{COMPONENT_NAME}}</component_name>: The name of the target design-system component
10
9
<folder_path>{{FOLDER_PATH}}</folder_path>: The path to the folder containing the legacy components
11
-
<component_docs>{{COMPONENT_DOCS}}</component_docs>: The official documentation for the target design-system component
12
-
<component_code>{{COMPONENT_CODE}}</component_code>: The source files of the target design-system component
13
-
<usage_graph>{{USAGE_GRAPH}}</usage_graph>: A graph showing the usage of the legacy component in the specified folder
10
+
<component_docs>{{COMPONENT_DOCS}}</component_docs>: The official documentation for the target design-system components
11
+
<component_code>{{COMPONENT_CODE}}</component_code>: The source files of the target design-system components
12
+
<usage_graph>{{USAGE_GRAPH}}</usage_graph>: A graph showing the usage of the legacy components in the specified folder
14
13
<library_data>{{LIBRARY_DATA}}</library_data>: Information about library type
15
14
16
15
# Phase 1: Comprehensive Analysis
17
16
18
17
1. Review all provided inputs: COMPONENT_DOCS, COMPONENT_CODE, USAGE_GRAPH, and LIBRARY_DATA.
19
18
20
19
2. Analyze the current codebase, focusing on:
21
-
a. The approved markup and API for the target component
22
-
b. The actual implementation of the design-system component
23
-
c. All files (templates, TS, styles, specs, NgModules) that reference the legacy component
20
+
a. The approved markup and API for the target components
21
+
b. The actual implementation of the design-system components
22
+
c. All files (templates, TS, styles, specs, NgModules) that reference the legacy components
24
23
d. Dependencies and library information
25
24
26
25
3. Create a comprehensive summary of the analysis, including:
@@ -35,47 +34,4 @@ Write your comprehensive analysis in <comprehensive_analysis> tags.
35
34
36
35
# Phase 2: Detailed Plan Creation
37
36
38
-
Please think about this problem thoroughly and in great detail. Consider multiple approaches and show your complete reasoning. Please perform a thourough and Based on your comprehensive analysis, create a detailed migration plan:
39
-
40
-
1. For each affected file:
41
-
a. Compare the old markup against the design-system exemplar from the COMPONENT_DOCS.
42
-
b. Classify the migration effort as:
43
-
- Simple swap (straight replacement with no loss of behavior, styling, responsive rules, animation, click/test-ID, or accessibility attributes)
44
-
- Requires restructure (minor code or CSS tweaks needed to preserve behaviors or visuals that the design-system component lacks)
45
-
- Non-viable (needs manual rethink)
46
-
c. Assign a complexity score on a scale of 1-10, adding:
47
-
- +1 per removed animation or breakpoint
48
-
- +2 per business variant that needs to be rebuilt
49
-
50
-
2. Create an actionable plan ordered by effort, including:
51
-
a. File path & type
52
-
b. Refactor classification
53
-
c. Concrete edits needed (template, TS, styles, NgModule, spec)
54
-
d. Verification notes (2-3 static checks that can be performed by reading files only)
55
-
e. Complexity score
56
-
57
-
3. If any items are classified as non-viable, explicitly highlight these in a separate section of your plan.
58
-
59
-
4. Review your detailed plan against the COMPONENT_DOCS to ensure all recommendations align with the official documentation.
60
-
61
-
5. Identify any ambiguities in your plan that could be interpreted multiple ways and list these in a separate section.
62
-
63
-
Write your detailed migration plan in <migration_plan> tags.
64
-
65
-
# Phase 3: Checklist Creation
66
-
67
-
After the user approves the plan and clarifies any ambiguities:
68
-
69
-
1. Create a checklist that lists only actual changes as checkboxes.
70
-
2. Create a "check" phase where all verifications (2-3 static checks that can be performed by reading files only) are listed as checkboxes.
71
-
3. Ensure the checklist is comprehensive and follows directly from the approved migration plan.
72
-
73
-
Write your checklist in <checklist> tags.
74
-
75
-
Your final output should include only the following:
76
-
1. The <comprehensive_analysis> block
77
-
2. The <migration_plan> block
78
-
3. The following approval request: "🛠️ Approve this plan or specify adjustments?"
79
-
4. If applicable, an ambiguity safeguard: "❓ The plan contains ambiguities: [short description]. Please clarify."
80
-
81
-
After the user approves the plan and clarifies any ambiguities, provide only the <checklist> block in your response. Also, remember to save the checklist in a file at .cursor/tmp/refactoring-checklis-{{FOLDER_PATH}}.md.
0 commit comments