@bovinphang/frontend-craft 2.8.0 → 2.9.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/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +378 -339
- package/CHANGELOG.zh-CN.md +377 -338
- package/CONTRIBUTING.md +371 -361
- package/CONTRIBUTING.zh-CN.md +371 -361
- package/README.md +545 -493
- package/README.openclaw.md +359 -320
- package/README.openclaw.zh-CN.md +359 -320
- package/README.zh-CN.md +545 -493
- package/agents/fec-code-reviewer.md +24 -3
- package/agents/fec-debugger.md +1 -1
- package/agents/fec-doc-updater.md +1 -1
- package/agents/fec-e2e-runner.md +1 -1
- package/agents/fec-figma-implementer.md +1 -1
- package/agents/fec-performance-optimizer.md +1 -1
- package/agents/fec-refactor-cleaner.md +4 -1
- package/agents/fec-refactoring-expert.md +81 -0
- package/agents/fec-security-reviewer.md +17 -1
- package/agents/fec-test-planner.md +1 -1
- package/agents/fec-typescript-reviewer.md +24 -8
- package/agents/fec-ui-checker.md +11 -11
- package/commands/fec-debug.md +1 -1
- package/commands/fec-refactor-plan.md +17 -0
- package/commands/fec-refactor.md +18 -0
- package/commands/fec-review.md +40 -10
- package/commands/fec-scaffold.md +1 -1
- package/commands/fec-smell.md +17 -0
- package/commands/fec-tdd.md +6 -2
- package/dist/bin/frontend-craft.js +190 -38
- package/dist/hooks/fec-run-tests.js +5 -1
- package/dist/hooks/fec-session-start.js +1 -1
- package/docs/example-prompts.md +157 -140
- package/docs/ja-JP/README.md +534 -493
- package/docs/ko-KR/README.md +534 -493
- package/docs/project-structure.md +151 -131
- package/docs/refactoring/README.md +50 -0
- package/docs/refactoring/catalog.md +105 -0
- package/docs/refactoring/smell-refactoring-matrix.md +41 -0
- package/docs/review-and-diagram-workflows.md +39 -0
- package/docs/runtimes/antigravity.md +18 -10
- package/docs/runtimes/augment.md +18 -10
- package/docs/runtimes/claude.md +191 -177
- package/docs/runtimes/claude.zh-CN.md +189 -175
- package/docs/runtimes/cline.md +18 -10
- package/docs/runtimes/codebuddy.md +18 -10
- package/docs/runtimes/codex.md +18 -10
- package/docs/runtimes/compatibility.md +27 -0
- package/docs/runtimes/copilot.md +18 -10
- package/docs/runtimes/cursor.md +18 -10
- package/docs/runtimes/gemini.md +18 -10
- package/docs/runtimes/kilo.md +18 -10
- package/docs/runtimes/openclaw.md +18 -10
- package/docs/runtimes/opencode.md +18 -10
- package/docs/runtimes/qoder.md +18 -19
- package/docs/runtimes/trae.md +18 -10
- package/docs/runtimes/windsurf.md +18 -10
- package/docs/superpowers/plans/2026-09-26-content-integrity.md +145 -0
- package/docs/superpowers/plans/2026-09-26-diagram-quality.md +170 -0
- package/docs/superpowers/specs/2026-09-26-diagram-quality-design.md +77 -0
- package/docs/superpowers/specs/2026-09-26-project-optimization-design.md +95 -0
- package/docs/zh-CN/example-prompts.md +157 -140
- package/docs/zh-CN/project-structure.md +148 -128
- package/docs/zh-CN/review-and-diagram-workflows.md +39 -0
- package/docs/zh-TW/README.md +534 -493
- package/localized/zh-CN/agents/fec-code-reviewer.md +22 -3
- package/localized/zh-CN/agents/fec-refactor-cleaner.md +3 -0
- package/localized/zh-CN/agents/fec-refactoring-expert.md +53 -0
- package/localized/zh-CN/agents/fec-security-reviewer.md +16 -0
- package/localized/zh-CN/agents/fec-typescript-reviewer.md +23 -7
- package/localized/zh-CN/commands/fec-refactor-plan.md +15 -0
- package/localized/zh-CN/commands/fec-refactor.md +14 -0
- package/localized/zh-CN/commands/fec-review.md +40 -9
- package/localized/zh-CN/commands/fec-smell.md +13 -0
- package/localized/zh-CN/commands/fec-tdd.md +4 -0
- package/localized/zh-CN/skills/eval_queries.json +244 -0
- package/localized/zh-CN/skills/fec-code-review/SKILL.md +20 -1
- package/localized/zh-CN/skills/fec-code-review/references/report-template.md +11 -1
- package/localized/zh-CN/skills/fec-code-smells/SKILL.md +33 -0
- package/localized/zh-CN/skills/fec-code-smells/references/detection-guide.md +25 -0
- package/localized/zh-CN/skills/fec-code-smells/references/smell-catalog.md +817 -0
- package/localized/zh-CN/skills/fec-code-smells/references/smell-to-refactoring-map.md +265 -0
- package/localized/zh-CN/skills/fec-image-generation/SKILL.md +31 -1
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/README.md +14 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/architecture.json +121 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/invalid-explicit.json +41 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/sequence.json +53 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/sequence.mmd +21 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/workflow.json +98 -0
- package/localized/zh-CN/skills/fec-image-generation/assets/quality-examples/workflow.mmd +7 -0
- package/localized/zh-CN/skills/fec-image-generation/references/diagram-workflows.md +10 -3
- package/localized/zh-CN/skills/fec-image-generation/references/html-technical-diagrams.md +8 -1
- package/localized/zh-CN/skills/fec-image-generation/references/png-qa-autofix.md +9 -2
- package/localized/zh-CN/skills/fec-image-generation/scripts/diagram-browser.mjs +90 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/diagram-layout.mjs +176 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/export-diagram.mjs +48 -80
- package/localized/zh-CN/skills/fec-image-generation/scripts/mermaid-render.mjs +64 -0
- package/localized/zh-CN/skills/fec-image-generation/scripts/png-qa.mjs +35 -4
- package/localized/zh-CN/skills/fec-image-generation/scripts/tech-diagram-render.mjs +193 -53
- package/localized/zh-CN/skills/fec-refactor-clean/SKILL.md +3 -0
- package/localized/zh-CN/skills/fec-refactoring/SKILL.md +83 -0
- package/localized/zh-CN/skills/fec-refactoring/references/principles.md +43 -0
- package/localized/zh-CN/skills/fec-refactoring/references/refactoring-vs-feature-change.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring/references/when-to-refactor.md +17 -0
- package/localized/zh-CN/skills/fec-refactoring/references/workflow.md +59 -0
- package/localized/zh-CN/skills/fec-refactoring-api/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-api/references/api-refactorings.md +496 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/SKILL.md +21 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/references/catalog-index.md +99 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/references/composition-guide.md +49 -0
- package/localized/zh-CN/skills/fec-refactoring-catalog/references/selection-guide.md +41 -0
- package/localized/zh-CN/skills/fec-refactoring-control/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-control/references/conditional-refactorings.md +299 -0
- package/localized/zh-CN/skills/fec-refactoring-data/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-data/references/data-refactorings.md +248 -0
- package/localized/zh-CN/skills/fec-refactoring-encapsulation/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-encapsulation/references/encapsulation-refactorings.md +452 -0
- package/localized/zh-CN/skills/fec-refactoring-functions/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-functions/references/function-refactorings.md +567 -0
- package/localized/zh-CN/skills/fec-refactoring-inheritance/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-inheritance/references/inheritance-refactorings.md +550 -0
- package/localized/zh-CN/skills/fec-refactoring-move-features/SKILL.md +25 -0
- package/localized/zh-CN/skills/fec-refactoring-move-features/references/moving-refactorings.md +453 -0
- package/localized/zh-CN/skills/fec-refactoring-validation/SKILL.md +52 -0
- package/localized/zh-CN/skills/fec-refactoring-validation/references/behavior-preservation.md +15 -0
- package/localized/zh-CN/skills/fec-refactoring-validation/references/refactoring-test-checklist.md +25 -0
- package/localized/zh-CN/skills/fec-security-review/SKILL.md +16 -0
- package/localized/zh-CN/skills/fec-security-review/references/report-template.md +10 -0
- package/localized/zh-CN/skills/fec-tdd-workflow/SKILL.md +3 -0
- package/localized/zh-CN/skills/metadata.json +408 -50
- package/localized/zh-CN/skills/relations.json +271 -3
- package/localized/zh-CN/templates/shared/rules/fec-agent-workflow.md +1 -0
- package/openclaw.plugin.json +2 -3
- package/package.json +27 -17
- package/skills/eval_queries.json +244 -0
- package/skills/fec-code-review/SKILL.md +20 -1
- package/skills/fec-code-review/references/report-template.md +11 -1
- package/skills/fec-code-smells/SKILL.md +33 -0
- package/skills/fec-code-smells/references/detection-guide.md +25 -0
- package/skills/fec-code-smells/references/smell-catalog.md +861 -0
- package/skills/fec-code-smells/references/smell-to-refactoring-map.md +265 -0
- package/skills/fec-data-fetching/SKILL.md +1 -1
- package/skills/fec-image-generation/SKILL.md +31 -1
- package/skills/fec-image-generation/assets/quality-examples/README.md +14 -0
- package/skills/fec-image-generation/assets/quality-examples/architecture.json +121 -0
- package/skills/fec-image-generation/assets/quality-examples/invalid-explicit.json +41 -0
- package/skills/fec-image-generation/assets/quality-examples/sequence.json +53 -0
- package/skills/fec-image-generation/assets/quality-examples/sequence.mmd +21 -0
- package/skills/fec-image-generation/assets/quality-examples/workflow.json +98 -0
- package/skills/fec-image-generation/assets/quality-examples/workflow.mmd +7 -0
- package/skills/fec-image-generation/references/diagram-workflows.md +10 -3
- package/skills/fec-image-generation/references/html-technical-diagrams.md +8 -1
- package/skills/fec-image-generation/references/png-qa-autofix.md +9 -2
- package/skills/fec-image-generation/scripts/diagram-browser.mjs +90 -0
- package/skills/fec-image-generation/scripts/diagram-layout.mjs +176 -0
- package/skills/fec-image-generation/scripts/export-diagram.mjs +48 -80
- package/skills/fec-image-generation/scripts/mermaid-render.mjs +64 -0
- package/skills/fec-image-generation/scripts/png-qa.mjs +35 -4
- package/skills/fec-image-generation/scripts/tech-diagram-render.mjs +193 -53
- package/skills/fec-legacy-web-standard/SKILL.md +1 -1
- package/skills/fec-refactor-clean/SKILL.md +3 -0
- package/skills/fec-refactoring/SKILL.md +83 -0
- package/skills/fec-refactoring/references/principles.md +60 -0
- package/skills/fec-refactoring/references/refactoring-vs-feature-change.md +27 -0
- package/skills/fec-refactoring/references/when-to-refactor.md +31 -0
- package/skills/fec-refactoring/references/workflow.md +90 -0
- package/skills/fec-refactoring-api/SKILL.md +25 -0
- package/skills/fec-refactoring-api/references/api-refactorings.md +496 -0
- package/skills/fec-refactoring-catalog/SKILL.md +28 -0
- package/skills/fec-refactoring-catalog/references/catalog-index.md +99 -0
- package/skills/fec-refactoring-catalog/references/composition-guide.md +49 -0
- package/skills/fec-refactoring-catalog/references/selection-guide.md +47 -0
- package/skills/fec-refactoring-control/SKILL.md +25 -0
- package/skills/fec-refactoring-control/references/conditional-refactorings.md +299 -0
- package/skills/fec-refactoring-data/SKILL.md +25 -0
- package/skills/fec-refactoring-data/references/data-refactorings.md +248 -0
- package/skills/fec-refactoring-encapsulation/SKILL.md +25 -0
- package/skills/fec-refactoring-encapsulation/references/encapsulation-refactorings.md +452 -0
- package/skills/fec-refactoring-functions/SKILL.md +25 -0
- package/skills/fec-refactoring-functions/references/function-refactorings.md +567 -0
- package/skills/fec-refactoring-inheritance/SKILL.md +25 -0
- package/skills/fec-refactoring-inheritance/references/inheritance-refactorings.md +550 -0
- package/skills/fec-refactoring-move-features/SKILL.md +25 -0
- package/skills/fec-refactoring-move-features/references/moving-refactorings.md +453 -0
- package/skills/fec-refactoring-validation/SKILL.md +59 -0
- package/skills/fec-refactoring-validation/references/behavior-preservation.md +53 -0
- package/skills/fec-refactoring-validation/references/refactoring-test-checklist.md +42 -0
- package/skills/fec-security-review/SKILL.md +16 -0
- package/skills/fec-security-review/references/report-template.md +10 -0
- package/skills/fec-tdd-workflow/SKILL.md +5 -1
- package/skills/metadata.json +434 -71
- package/skills/relations.json +264 -0
- package/templates/shared/rules/fec-agent-workflow.md +1 -0
- package/docs/superpowers/plans/2026-05-29-fec-debug.md +0 -491
- package/docs/superpowers/specs/2026-05-29-fec-debug-design.md +0 -340
|
@@ -0,0 +1,550 @@
|
|
|
1
|
+
# Inheritance Refactorings
|
|
2
|
+
|
|
3
|
+
These cards transform the supplied standard catalog into concise operational guidance for frontend agents. Standard IDs/names are preserved; examples and framework adaptations are original.
|
|
4
|
+
|
|
5
|
+
## RF-PULL-UP-METHOD — Pull Up Method
|
|
6
|
+
|
|
7
|
+
### Intent
|
|
8
|
+
Move equivalent subclass behavior to a superclass when it is truly shared.
|
|
9
|
+
|
|
10
|
+
### Typical Signals
|
|
11
|
+
- Sibling subclasses contain the same behavior or behavior that can be generalized without type checks.
|
|
12
|
+
|
|
13
|
+
### Avoid When
|
|
14
|
+
- Do not pull up code that only looks similar but depends on subtype-specific semantics.
|
|
15
|
+
|
|
16
|
+
### Preconditions
|
|
17
|
+
- Current observable behavior and affected callers are understood.
|
|
18
|
+
- The target scope is inside a declared diff budget and can be verified after this one primary transformation.
|
|
19
|
+
|
|
20
|
+
### Mechanics
|
|
21
|
+
1. Compare implementations and make differences explicit.
|
|
22
|
+
2. Align signatures/fields needed by the shared method.
|
|
23
|
+
3. Move one shared implementation to the superclass.
|
|
24
|
+
4. Remove duplicates and verify substitutability.
|
|
25
|
+
|
|
26
|
+
### Behavior-Preservation Checkpoints
|
|
27
|
+
- Compare inputs, outputs, exceptions, side effects, ordering, and public contracts before/after the step.
|
|
28
|
+
- For frontend code, also check UI state, events, focus, network behavior, lifecycle/state transitions, and relevant identity semantics.
|
|
29
|
+
|
|
30
|
+
### Related Code Smells
|
|
31
|
+
- `SMELL-DUPLICATED-CODE`
|
|
32
|
+
|
|
33
|
+
### Composes Well With
|
|
34
|
+
- `RF-PUSH-DOWN-METHOD` when its preconditions independently hold.
|
|
35
|
+
|
|
36
|
+
### JavaScript Notes
|
|
37
|
+
- Preserve prototype behavior, constructor order, `instanceof`, method binding, and super calls in legacy OO code.
|
|
38
|
+
|
|
39
|
+
### TypeScript Notes
|
|
40
|
+
- Track structural typing, discriminated unions, abstract contracts, visibility, and public subtype APIs.
|
|
41
|
+
|
|
42
|
+
### React Notes
|
|
43
|
+
- React components should normally use composition, hooks, render props, or delegates rather than class inheritance.
|
|
44
|
+
|
|
45
|
+
### Vue Notes
|
|
46
|
+
- Vue components should normally use composition, composables, slots, and delegation rather than inheritance.
|
|
47
|
+
|
|
48
|
+
### Frontend-Craft Adaptation
|
|
49
|
+
- These techniques primarily serve genuine legacy OO JS/TS, domain models, SDKs, and editor engines; translate intent to composition when frontend architecture is composition-first.
|
|
50
|
+
|
|
51
|
+
### Example Transformation
|
|
52
|
+
Before: two legacy editor subclasses implement identical `isDirty()`. After: the base editor owns it if both contracts are truly the same.
|
|
53
|
+
|
|
54
|
+
## RF-PULL-UP-FIELD — Pull Up Field
|
|
55
|
+
|
|
56
|
+
### Intent
|
|
57
|
+
Move duplicated subclass state to a superclass when every relevant subtype owns the same concept.
|
|
58
|
+
|
|
59
|
+
### Typical Signals
|
|
60
|
+
- Sibling subclasses declare the same field with the same meaning.
|
|
61
|
+
|
|
62
|
+
### Avoid When
|
|
63
|
+
- Do not pull up fields that merely share a name but have different invariants or lifecycles.
|
|
64
|
+
|
|
65
|
+
### Preconditions
|
|
66
|
+
- Current observable behavior and affected callers are understood.
|
|
67
|
+
- The target scope is inside a declared diff budget and can be verified after this one primary transformation.
|
|
68
|
+
|
|
69
|
+
### Mechanics
|
|
70
|
+
1. Confirm semantic equivalence and initialization.
|
|
71
|
+
2. Add the field to the superclass.
|
|
72
|
+
3. Redirect subclass initialization/access.
|
|
73
|
+
4. Remove duplicate fields.
|
|
74
|
+
|
|
75
|
+
### Behavior-Preservation Checkpoints
|
|
76
|
+
- Compare inputs, outputs, exceptions, side effects, ordering, and public contracts before/after the step.
|
|
77
|
+
- For frontend code, also check UI state, events, focus, network behavior, lifecycle/state transitions, and relevant identity semantics.
|
|
78
|
+
|
|
79
|
+
### Related Code Smells
|
|
80
|
+
- No single code smell required; select from concrete structural evidence.
|
|
81
|
+
|
|
82
|
+
### Composes Well With
|
|
83
|
+
- `RF-PUSH-DOWN-FIELD` when its preconditions independently hold.
|
|
84
|
+
|
|
85
|
+
### JavaScript Notes
|
|
86
|
+
- Preserve prototype behavior, constructor order, `instanceof`, method binding, and super calls in legacy OO code.
|
|
87
|
+
|
|
88
|
+
### TypeScript Notes
|
|
89
|
+
- Track structural typing, discriminated unions, abstract contracts, visibility, and public subtype APIs.
|
|
90
|
+
|
|
91
|
+
### React Notes
|
|
92
|
+
- React components should normally use composition, hooks, render props, or delegates rather than class inheritance.
|
|
93
|
+
|
|
94
|
+
### Vue Notes
|
|
95
|
+
- Vue components should normally use composition, composables, slots, and delegation rather than inheritance.
|
|
96
|
+
|
|
97
|
+
### Frontend-Craft Adaptation
|
|
98
|
+
- These techniques primarily serve genuine legacy OO JS/TS, domain models, SDKs, and editor engines; translate intent to composition when frontend architecture is composition-first.
|
|
99
|
+
|
|
100
|
+
### Example Transformation
|
|
101
|
+
Before: several legacy transport subclasses keep the same `endpoint` state. After: the common base owns it if semantics match.
|
|
102
|
+
|
|
103
|
+
## RF-PULL-UP-CONSTRUCTOR-BODY — Pull Up Constructor Body
|
|
104
|
+
|
|
105
|
+
### Intent
|
|
106
|
+
Move common subclass initialization into the superclass while leaving variant initialization in subclasses.
|
|
107
|
+
|
|
108
|
+
### Typical Signals
|
|
109
|
+
- Subclass constructors repeat the same base-field setup.
|
|
110
|
+
|
|
111
|
+
### Avoid When
|
|
112
|
+
- Avoid moving initialization that depends on subtype-only state before it is ready.
|
|
113
|
+
|
|
114
|
+
### Preconditions
|
|
115
|
+
- Current observable behavior and affected callers are understood.
|
|
116
|
+
- The target scope is inside a declared diff budget and can be verified after this one primary transformation.
|
|
117
|
+
|
|
118
|
+
### Mechanics
|
|
119
|
+
1. Align common constructor parameters.
|
|
120
|
+
2. Move one common initialization step to `super`/base initialization.
|
|
121
|
+
3. Keep subtype-specific steps after the base is valid.
|
|
122
|
+
4. Verify construction order and overridden-method hazards.
|
|
123
|
+
|
|
124
|
+
### Behavior-Preservation Checkpoints
|
|
125
|
+
- Compare inputs, outputs, exceptions, side effects, ordering, and public contracts before/after the step.
|
|
126
|
+
- For frontend code, also check UI state, events, focus, network behavior, lifecycle/state transitions, and relevant identity semantics.
|
|
127
|
+
|
|
128
|
+
### Related Code Smells
|
|
129
|
+
- No single code smell required; select from concrete structural evidence.
|
|
130
|
+
|
|
131
|
+
### Composes Well With
|
|
132
|
+
- Combine only with a separately justified next transformation; no fixed sequence is required.
|
|
133
|
+
|
|
134
|
+
### JavaScript Notes
|
|
135
|
+
- Preserve prototype behavior, constructor order, `instanceof`, method binding, and super calls in legacy OO code.
|
|
136
|
+
|
|
137
|
+
### TypeScript Notes
|
|
138
|
+
- Track structural typing, discriminated unions, abstract contracts, visibility, and public subtype APIs.
|
|
139
|
+
|
|
140
|
+
### React Notes
|
|
141
|
+
- React components should normally use composition, hooks, render props, or delegates rather than class inheritance.
|
|
142
|
+
|
|
143
|
+
### Vue Notes
|
|
144
|
+
- Vue components should normally use composition, composables, slots, and delegation rather than inheritance.
|
|
145
|
+
|
|
146
|
+
### Frontend-Craft Adaptation
|
|
147
|
+
- These techniques primarily serve genuine legacy OO JS/TS, domain models, SDKs, and editor engines; translate intent to composition when frontend architecture is composition-first.
|
|
148
|
+
|
|
149
|
+
### Example Transformation
|
|
150
|
+
Before: two legacy provider subclasses both initialize id/name before provider-specific config. After: base construction handles common identity.
|
|
151
|
+
|
|
152
|
+
## RF-PUSH-DOWN-METHOD — Push Down Method
|
|
153
|
+
|
|
154
|
+
### Intent
|
|
155
|
+
Move behavior from a superclass to the subclass(es) that actually need it.
|
|
156
|
+
|
|
157
|
+
### Typical Signals
|
|
158
|
+
- A superclass method is meaningful only for a subset of subtypes.
|
|
159
|
+
|
|
160
|
+
### Avoid When
|
|
161
|
+
- Do not push down merely because some subclasses do not call a valid shared method.
|
|
162
|
+
|
|
163
|
+
### Preconditions
|
|
164
|
+
- Current observable behavior and affected callers are understood.
|
|
165
|
+
- The target scope is inside a declared diff budget and can be verified after this one primary transformation.
|
|
166
|
+
|
|
167
|
+
### Mechanics
|
|
168
|
+
1. Identify the true owning subtype set.
|
|
169
|
+
2. Move/copy the method to those subtypes.
|
|
170
|
+
3. Update base contract if necessary.
|
|
171
|
+
4. Verify callers no longer rely on the broad superclass API.
|
|
172
|
+
|
|
173
|
+
### Behavior-Preservation Checkpoints
|
|
174
|
+
- Compare inputs, outputs, exceptions, side effects, ordering, and public contracts before/after the step.
|
|
175
|
+
- For frontend code, also check UI state, events, focus, network behavior, lifecycle/state transitions, and relevant identity semantics.
|
|
176
|
+
|
|
177
|
+
### Related Code Smells
|
|
178
|
+
- `SMELL-REFUSED-BEQUEST`
|
|
179
|
+
|
|
180
|
+
### Composes Well With
|
|
181
|
+
- `RF-PULL-UP-METHOD` when its preconditions independently hold.
|
|
182
|
+
|
|
183
|
+
### JavaScript Notes
|
|
184
|
+
- Preserve prototype behavior, constructor order, `instanceof`, method binding, and super calls in legacy OO code.
|
|
185
|
+
|
|
186
|
+
### TypeScript Notes
|
|
187
|
+
- Track structural typing, discriminated unions, abstract contracts, visibility, and public subtype APIs.
|
|
188
|
+
|
|
189
|
+
### React Notes
|
|
190
|
+
- React components should normally use composition, hooks, render props, or delegates rather than class inheritance.
|
|
191
|
+
|
|
192
|
+
### Vue Notes
|
|
193
|
+
- Vue components should normally use composition, composables, slots, and delegation rather than inheritance.
|
|
194
|
+
|
|
195
|
+
### Frontend-Craft Adaptation
|
|
196
|
+
- These techniques primarily serve genuine legacy OO JS/TS, domain models, SDKs, and editor engines; translate intent to composition when frontend architecture is composition-first.
|
|
197
|
+
|
|
198
|
+
### Example Transformation
|
|
199
|
+
Before: a base editor exposes `exportToPdf()` but only document editors support it. After: move it to the appropriate subtype or capability delegate.
|
|
200
|
+
|
|
201
|
+
## RF-PUSH-DOWN-FIELD — Push Down Field
|
|
202
|
+
|
|
203
|
+
### Intent
|
|
204
|
+
Move state from a superclass to only the subclasses that require it.
|
|
205
|
+
|
|
206
|
+
### Typical Signals
|
|
207
|
+
- A base field is unused or invalid for most subtypes.
|
|
208
|
+
|
|
209
|
+
### Avoid When
|
|
210
|
+
- Do not narrow a field that is part of a valid shared contract even if some subtypes rarely use it.
|
|
211
|
+
|
|
212
|
+
### Preconditions
|
|
213
|
+
- Current observable behavior and affected callers are understood.
|
|
214
|
+
- The target scope is inside a declared diff budget and can be verified after this one primary transformation.
|
|
215
|
+
|
|
216
|
+
### Mechanics
|
|
217
|
+
1. Map field reads/writes by subtype.
|
|
218
|
+
2. Add the field to the real owner subtype.
|
|
219
|
+
3. Move initialization/access.
|
|
220
|
+
4. Remove the base field and verify construction/serialization.
|
|
221
|
+
|
|
222
|
+
### Behavior-Preservation Checkpoints
|
|
223
|
+
- Compare inputs, outputs, exceptions, side effects, ordering, and public contracts before/after the step.
|
|
224
|
+
- For frontend code, also check UI state, events, focus, network behavior, lifecycle/state transitions, and relevant identity semantics.
|
|
225
|
+
|
|
226
|
+
### Related Code Smells
|
|
227
|
+
- `SMELL-REFUSED-BEQUEST`
|
|
228
|
+
|
|
229
|
+
### Composes Well With
|
|
230
|
+
- `RF-PULL-UP-FIELD` when its preconditions independently hold.
|
|
231
|
+
|
|
232
|
+
### JavaScript Notes
|
|
233
|
+
- Preserve prototype behavior, constructor order, `instanceof`, method binding, and super calls in legacy OO code.
|
|
234
|
+
|
|
235
|
+
### TypeScript Notes
|
|
236
|
+
- Track structural typing, discriminated unions, abstract contracts, visibility, and public subtype APIs.
|
|
237
|
+
|
|
238
|
+
### React Notes
|
|
239
|
+
- React components should normally use composition, hooks, render props, or delegates rather than class inheritance.
|
|
240
|
+
|
|
241
|
+
### Vue Notes
|
|
242
|
+
- Vue components should normally use composition, composables, slots, and delegation rather than inheritance.
|
|
243
|
+
|
|
244
|
+
### Frontend-Craft Adaptation
|
|
245
|
+
- These techniques primarily serve genuine legacy OO JS/TS, domain models, SDKs, and editor engines; translate intent to composition when frontend architecture is composition-first.
|
|
246
|
+
|
|
247
|
+
### Example Transformation
|
|
248
|
+
Before: base transport stores `imapFolder` though only IMAP transport uses it. After: the IMAP subtype owns that field.
|
|
249
|
+
|
|
250
|
+
## RF-REPLACE-TYPE-CODE-WITH-SUBCLASSES — Replace Type Code with Subclasses
|
|
251
|
+
|
|
252
|
+
### Intent
|
|
253
|
+
Represent stable variant-specific behavior with subtype-like alternatives instead of repeated type-code branching.
|
|
254
|
+
|
|
255
|
+
### Typical Signals
|
|
256
|
+
- A type code controls substantial behavior and new variants repeatedly change the same branch sets.
|
|
257
|
+
|
|
258
|
+
### Avoid When
|
|
259
|
+
- In modern frontend code, do not force inheritance; discriminated unions, strategy maps, component registries, or delegates may be the better subtype mechanism.
|
|
260
|
+
|
|
261
|
+
### Preconditions
|
|
262
|
+
- Current observable behavior and affected callers are understood.
|
|
263
|
+
- The target scope is inside a declared diff budget and can be verified after this one primary transformation.
|
|
264
|
+
|
|
265
|
+
### Mechanics
|
|
266
|
+
1. Identify the stable type discriminator and variant boundaries.
|
|
267
|
+
2. Introduce one variant representation at a time.
|
|
268
|
+
3. Move type-specific behavior behind variant dispatch.
|
|
269
|
+
4. Remove repeated type-code checks only after exhaustive handling is proven.
|
|
270
|
+
|
|
271
|
+
### Behavior-Preservation Checkpoints
|
|
272
|
+
- Compare inputs, outputs, exceptions, side effects, ordering, and public contracts before/after the step.
|
|
273
|
+
- For frontend code, also check UI state, events, focus, network behavior, lifecycle/state transitions, and relevant identity semantics.
|
|
274
|
+
|
|
275
|
+
### Related Code Smells
|
|
276
|
+
- `SMELL-PRIMITIVE-OBSESSION`
|
|
277
|
+
- `SMELL-LARGE-CLASS`
|
|
278
|
+
|
|
279
|
+
### Composes Well With
|
|
280
|
+
- Replace Conditional with Polymorphism when its preconditions independently hold.
|
|
281
|
+
- `RF-REMOVE-SUBCLASS` when its preconditions independently hold.
|
|
282
|
+
|
|
283
|
+
### JavaScript Notes
|
|
284
|
+
- Preserve prototype behavior, constructor order, `instanceof`, method binding, and super calls in legacy OO code.
|
|
285
|
+
|
|
286
|
+
### TypeScript Notes
|
|
287
|
+
- Track structural typing, discriminated unions, abstract contracts, visibility, and public subtype APIs.
|
|
288
|
+
|
|
289
|
+
### React Notes
|
|
290
|
+
- React components should normally use composition, hooks, render props, or delegates rather than class inheritance.
|
|
291
|
+
|
|
292
|
+
### Vue Notes
|
|
293
|
+
- Vue components should normally use composition, composables, slots, and delegation rather than inheritance.
|
|
294
|
+
|
|
295
|
+
### Frontend-Craft Adaptation
|
|
296
|
+
- These techniques primarily serve genuine legacy OO JS/TS, domain models, SDKs, and editor engines; translate intent to composition when frontend architecture is composition-first.
|
|
297
|
+
|
|
298
|
+
### Example Transformation
|
|
299
|
+
Before: editor mode strings drive repeated switches. After: use a discriminated union + strategy registry, or subclasses only in a genuine OO domain model.
|
|
300
|
+
|
|
301
|
+
## RF-REMOVE-SUBCLASS — Remove Subclass
|
|
302
|
+
|
|
303
|
+
### Intent
|
|
304
|
+
Remove subclasses whose variation no longer warrants separate types, preserving the distinction as data or simpler behavior when needed.
|
|
305
|
+
|
|
306
|
+
### Typical Signals
|
|
307
|
+
- Subclasses differ only trivially or a former behavior distinction has disappeared.
|
|
308
|
+
|
|
309
|
+
### Avoid When
|
|
310
|
+
- Keep subclasses when substitutable behavior remains materially different and the hierarchy is useful.
|
|
311
|
+
|
|
312
|
+
### Preconditions
|
|
313
|
+
- Current observable behavior and affected callers are understood.
|
|
314
|
+
- The target scope is inside a declared diff budget and can be verified after this one primary transformation.
|
|
315
|
+
|
|
316
|
+
### Mechanics
|
|
317
|
+
1. Move unique behavior/state to the superclass or an explicit field/strategy.
|
|
318
|
+
2. Migrate construction to the unified type.
|
|
319
|
+
3. Update callers that inspect subtype identity.
|
|
320
|
+
4. Remove subclass declarations after behavior is covered.
|
|
321
|
+
|
|
322
|
+
### Behavior-Preservation Checkpoints
|
|
323
|
+
- Compare inputs, outputs, exceptions, side effects, ordering, and public contracts before/after the step.
|
|
324
|
+
- For frontend code, also check UI state, events, focus, network behavior, lifecycle/state transitions, and relevant identity semantics.
|
|
325
|
+
|
|
326
|
+
### Related Code Smells
|
|
327
|
+
- No single code smell required; select from concrete structural evidence.
|
|
328
|
+
|
|
329
|
+
### Composes Well With
|
|
330
|
+
- Combine only with a separately justified next transformation; no fixed sequence is required.
|
|
331
|
+
|
|
332
|
+
### JavaScript Notes
|
|
333
|
+
- Preserve prototype behavior, constructor order, `instanceof`, method binding, and super calls in legacy OO code.
|
|
334
|
+
|
|
335
|
+
### TypeScript Notes
|
|
336
|
+
- Track structural typing, discriminated unions, abstract contracts, visibility, and public subtype APIs.
|
|
337
|
+
|
|
338
|
+
### React Notes
|
|
339
|
+
- React components should normally use composition, hooks, render props, or delegates rather than class inheritance.
|
|
340
|
+
|
|
341
|
+
### Vue Notes
|
|
342
|
+
- Vue components should normally use composition, composables, slots, and delegation rather than inheritance.
|
|
343
|
+
|
|
344
|
+
### Frontend-Craft Adaptation
|
|
345
|
+
- These techniques primarily serve genuine legacy OO JS/TS, domain models, SDKs, and editor engines; translate intent to composition when frontend architecture is composition-first.
|
|
346
|
+
|
|
347
|
+
### Example Transformation
|
|
348
|
+
Before: two legacy account subclasses differ only by a display label. After: one account type stores the label/type value when no variant behavior remains.
|
|
349
|
+
|
|
350
|
+
## RF-EXTRACT-SUPERCLASS — Extract Superclass
|
|
351
|
+
|
|
352
|
+
### Intent
|
|
353
|
+
Factor genuinely shared data/behavior from classes into a common abstraction.
|
|
354
|
+
|
|
355
|
+
### Typical Signals
|
|
356
|
+
- Two or more classes independently implement the same concept and substitutability is useful.
|
|
357
|
+
|
|
358
|
+
### Avoid When
|
|
359
|
+
- Do not create inheritance solely to deduplicate a few lines; composition may be clearer.
|
|
360
|
+
|
|
361
|
+
### Preconditions
|
|
362
|
+
- Current observable behavior and affected callers are understood.
|
|
363
|
+
- The target scope is inside a declared diff budget and can be verified after this one primary transformation.
|
|
364
|
+
|
|
365
|
+
### Mechanics
|
|
366
|
+
1. Identify shared responsibilities and compatible contracts.
|
|
367
|
+
2. Introduce the superclass/abstract contract.
|
|
368
|
+
3. Move one shared member at a time.
|
|
369
|
+
4. Verify subtype behavior and external substitution.
|
|
370
|
+
|
|
371
|
+
### Behavior-Preservation Checkpoints
|
|
372
|
+
- Compare inputs, outputs, exceptions, side effects, ordering, and public contracts before/after the step.
|
|
373
|
+
- For frontend code, also check UI state, events, focus, network behavior, lifecycle/state transitions, and relevant identity semantics.
|
|
374
|
+
|
|
375
|
+
### Related Code Smells
|
|
376
|
+
- `SMELL-LARGE-CLASS`
|
|
377
|
+
- `SMELL-ALTERNATIVE-CLASSES-DIFFERENT-INTERFACES`
|
|
378
|
+
|
|
379
|
+
### Composes Well With
|
|
380
|
+
- Combine only with a separately justified next transformation; no fixed sequence is required.
|
|
381
|
+
|
|
382
|
+
### JavaScript Notes
|
|
383
|
+
- Preserve prototype behavior, constructor order, `instanceof`, method binding, and super calls in legacy OO code.
|
|
384
|
+
|
|
385
|
+
### TypeScript Notes
|
|
386
|
+
- Track structural typing, discriminated unions, abstract contracts, visibility, and public subtype APIs.
|
|
387
|
+
|
|
388
|
+
### React Notes
|
|
389
|
+
- React components should normally use composition, hooks, render props, or delegates rather than class inheritance.
|
|
390
|
+
|
|
391
|
+
### Vue Notes
|
|
392
|
+
- Vue components should normally use composition, composables, slots, and delegation rather than inheritance.
|
|
393
|
+
|
|
394
|
+
### Frontend-Craft Adaptation
|
|
395
|
+
- These techniques primarily serve genuine legacy OO JS/TS, domain models, SDKs, and editor engines; translate intent to composition when frontend architecture is composition-first.
|
|
396
|
+
|
|
397
|
+
### Example Transformation
|
|
398
|
+
Before: two legacy parser classes share identity and diagnostics. After: extract a base only if callers benefit from the common contract; otherwise prefer a shared module.
|
|
399
|
+
|
|
400
|
+
## RF-COLLAPSE-HIERARCHY — Collapse Hierarchy
|
|
401
|
+
|
|
402
|
+
### Intent
|
|
403
|
+
Merge a superclass/subclass pair when the distinction no longer carries meaningful behavior or substitution value.
|
|
404
|
+
|
|
405
|
+
### Typical Signals
|
|
406
|
+
- A hierarchy level is empty, nearly empty, or adds only indirection.
|
|
407
|
+
|
|
408
|
+
### Avoid When
|
|
409
|
+
- Do not collapse a public subtype boundary without checking external consumers and serialization/type contracts.
|
|
410
|
+
|
|
411
|
+
### Preconditions
|
|
412
|
+
- Current observable behavior and affected callers are understood.
|
|
413
|
+
- The target scope is inside a declared diff budget and can be verified after this one primary transformation.
|
|
414
|
+
|
|
415
|
+
### Mechanics
|
|
416
|
+
1. Choose the surviving type.
|
|
417
|
+
2. Move fields/methods across the boundary.
|
|
418
|
+
3. Update construction and type checks.
|
|
419
|
+
4. Remove the redundant class after verification.
|
|
420
|
+
|
|
421
|
+
### Behavior-Preservation Checkpoints
|
|
422
|
+
- Compare inputs, outputs, exceptions, side effects, ordering, and public contracts before/after the step.
|
|
423
|
+
- For frontend code, also check UI state, events, focus, network behavior, lifecycle/state transitions, and relevant identity semantics.
|
|
424
|
+
|
|
425
|
+
### Related Code Smells
|
|
426
|
+
- `SMELL-LAZY-ELEMENT`
|
|
427
|
+
- `SMELL-SPECULATIVE-GENERALITY`
|
|
428
|
+
|
|
429
|
+
### Composes Well With
|
|
430
|
+
- Combine only with a separately justified next transformation; no fixed sequence is required.
|
|
431
|
+
|
|
432
|
+
### JavaScript Notes
|
|
433
|
+
- Preserve prototype behavior, constructor order, `instanceof`, method binding, and super calls in legacy OO code.
|
|
434
|
+
|
|
435
|
+
### TypeScript Notes
|
|
436
|
+
- Track structural typing, discriminated unions, abstract contracts, visibility, and public subtype APIs.
|
|
437
|
+
|
|
438
|
+
### React Notes
|
|
439
|
+
- React components should normally use composition, hooks, render props, or delegates rather than class inheritance.
|
|
440
|
+
|
|
441
|
+
### Vue Notes
|
|
442
|
+
- Vue components should normally use composition, composables, slots, and delegation rather than inheritance.
|
|
443
|
+
|
|
444
|
+
### Frontend-Craft Adaptation
|
|
445
|
+
- These techniques primarily serve genuine legacy OO JS/TS, domain models, SDKs, and editor engines; translate intent to composition when frontend architecture is composition-first.
|
|
446
|
+
|
|
447
|
+
### Example Transformation
|
|
448
|
+
Before: an old `SpecialMailbox` subclass has no unique behavior after earlier cleanup. After: merge it into `Mailbox` if no public subtype contract remains.
|
|
449
|
+
|
|
450
|
+
## RF-REPLACE-SUBCLASS-WITH-DELEGATE — Replace Subclass with Delegate
|
|
451
|
+
|
|
452
|
+
### Intent
|
|
453
|
+
Move one axis of variation from inheritance into a delegate so an object can combine behaviors more flexibly.
|
|
454
|
+
|
|
455
|
+
### Typical Signals
|
|
456
|
+
- Subclasses exist for a variation that conflicts with other inheritance needs or multiplies combinations.
|
|
457
|
+
|
|
458
|
+
### Avoid When
|
|
459
|
+
- Avoid delegation when the hierarchy is simple, stable, and accurately models substitutability.
|
|
460
|
+
|
|
461
|
+
### Preconditions
|
|
462
|
+
- Current observable behavior and affected callers are understood.
|
|
463
|
+
- The target scope is inside a declared diff budget and can be verified after this one primary transformation.
|
|
464
|
+
|
|
465
|
+
### Mechanics
|
|
466
|
+
1. Create a delegate/strategy for the varying behavior.
|
|
467
|
+
2. Have the base object forward one behavior to it.
|
|
468
|
+
3. Migrate subtype-specific state/behavior.
|
|
469
|
+
4. Remove subclasses when no unique responsibility remains.
|
|
470
|
+
|
|
471
|
+
### Behavior-Preservation Checkpoints
|
|
472
|
+
- Compare inputs, outputs, exceptions, side effects, ordering, and public contracts before/after the step.
|
|
473
|
+
- For frontend code, also check UI state, events, focus, network behavior, lifecycle/state transitions, and relevant identity semantics.
|
|
474
|
+
|
|
475
|
+
### Related Code Smells
|
|
476
|
+
- `SMELL-MIDDLE-MAN`
|
|
477
|
+
- `SMELL-INSIDER-TRADING`
|
|
478
|
+
- `SMELL-REFUSED-BEQUEST`
|
|
479
|
+
|
|
480
|
+
### Composes Well With
|
|
481
|
+
- `RF-REPLACE-SUPERCLASS-WITH-DELEGATE` when its preconditions independently hold.
|
|
482
|
+
|
|
483
|
+
### JavaScript Notes
|
|
484
|
+
- Preserve prototype behavior, constructor order, `instanceof`, method binding, and super calls in legacy OO code.
|
|
485
|
+
|
|
486
|
+
### TypeScript Notes
|
|
487
|
+
- Track structural typing, discriminated unions, abstract contracts, visibility, and public subtype APIs.
|
|
488
|
+
|
|
489
|
+
### React Notes
|
|
490
|
+
- React components should normally use composition, hooks, render props, or delegates rather than class inheritance.
|
|
491
|
+
|
|
492
|
+
### Vue Notes
|
|
493
|
+
- Vue components should normally use composition, composables, slots, and delegation rather than inheritance.
|
|
494
|
+
|
|
495
|
+
### Frontend-Craft Adaptation
|
|
496
|
+
- These techniques primarily serve genuine legacy OO JS/TS, domain models, SDKs, and editor engines; translate intent to composition when frontend architecture is composition-first.
|
|
497
|
+
|
|
498
|
+
### Example Transformation
|
|
499
|
+
Before: message renderer subclasses differ only by formatting strategy. After: renderer delegates to a format strategy/component map where composition is clearer.
|
|
500
|
+
|
|
501
|
+
## RF-REPLACE-SUPERCLASS-WITH-DELEGATE — Replace Superclass with Delegate
|
|
502
|
+
|
|
503
|
+
### Intent
|
|
504
|
+
Replace an inaccurate inheritance relationship with delegation to the reused capability.
|
|
505
|
+
|
|
506
|
+
### Typical Signals
|
|
507
|
+
- A subclass inherits a broad API only to reuse implementation and is not truly substitutable for the superclass.
|
|
508
|
+
|
|
509
|
+
### Avoid When
|
|
510
|
+
- Keep inheritance when the subtype contract is semantically valid and clients depend on substitution.
|
|
511
|
+
|
|
512
|
+
### Preconditions
|
|
513
|
+
- Current observable behavior and affected callers are understood.
|
|
514
|
+
- The target scope is inside a declared diff budget and can be verified after this one primary transformation.
|
|
515
|
+
|
|
516
|
+
### Mechanics
|
|
517
|
+
1. Create a field holding the former superclass capability.
|
|
518
|
+
2. Forward only the operations the object actually needs.
|
|
519
|
+
3. Remove `extends` and inherited assumptions.
|
|
520
|
+
4. Verify public type compatibility and composition behavior.
|
|
521
|
+
|
|
522
|
+
### Behavior-Preservation Checkpoints
|
|
523
|
+
- Compare inputs, outputs, exceptions, side effects, ordering, and public contracts before/after the step.
|
|
524
|
+
- For frontend code, also check UI state, events, focus, network behavior, lifecycle/state transitions, and relevant identity semantics.
|
|
525
|
+
|
|
526
|
+
### Related Code Smells
|
|
527
|
+
- `SMELL-MIDDLE-MAN`
|
|
528
|
+
- `SMELL-INSIDER-TRADING`
|
|
529
|
+
- `SMELL-REFUSED-BEQUEST`
|
|
530
|
+
|
|
531
|
+
### Composes Well With
|
|
532
|
+
- Combine only with a separately justified next transformation; no fixed sequence is required.
|
|
533
|
+
|
|
534
|
+
### JavaScript Notes
|
|
535
|
+
- Preserve prototype behavior, constructor order, `instanceof`, method binding, and super calls in legacy OO code.
|
|
536
|
+
|
|
537
|
+
### TypeScript Notes
|
|
538
|
+
- Track structural typing, discriminated unions, abstract contracts, visibility, and public subtype APIs.
|
|
539
|
+
|
|
540
|
+
### React Notes
|
|
541
|
+
- React components should normally use composition, hooks, render props, or delegates rather than class inheritance.
|
|
542
|
+
|
|
543
|
+
### Vue Notes
|
|
544
|
+
- Vue components should normally use composition, composables, slots, and delegation rather than inheritance.
|
|
545
|
+
|
|
546
|
+
### Frontend-Craft Adaptation
|
|
547
|
+
- These techniques primarily serve genuine legacy OO JS/TS, domain models, SDKs, and editor engines; translate intent to composition when frontend architecture is composition-first.
|
|
548
|
+
|
|
549
|
+
### Example Transformation
|
|
550
|
+
Before: an editor extends a collection class merely to reuse storage methods. After: the editor owns a collection delegate and exposes only editor-relevant operations.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fec-refactoring-move-features
|
|
3
|
+
description: Use when behavior-preserving frontend refactoring focuses on behavior/data ownership, statement placement, loops, or dead-code knowledge, and the selected technique needs family-specific mechanics, risks, and JavaScript/TypeScript/React/Vue adaptation.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Moving Feature Refactorings
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
Use this family after evidence identifies a fitting structural transformation. Apply one primary technique at a time and verify immediately.
|
|
10
|
+
|
|
11
|
+
## Procedure
|
|
12
|
+
1. Confirm the selected technique and its preconditions in [Moving Feature Refactorings](references/moving-refactorings.md).
|
|
13
|
+
2. Record affected behavior and a diff budget.
|
|
14
|
+
3. Apply only the selected technique's smallest viable step.
|
|
15
|
+
4. Verify the step before composing another transformation.
|
|
16
|
+
5. Stop and reassess when public contracts, lifecycle, state identity, or actual scope exceed expectations.
|
|
17
|
+
|
|
18
|
+
## Quick Reference
|
|
19
|
+
The family reference contains 9 canonical techniques with intent, signals, avoid conditions, mechanics, preservation checkpoints, smell links, composition hints, JavaScript/TypeScript notes, React/Vue notes, adaptation guidance, and original frontend examples.
|
|
20
|
+
|
|
21
|
+
## Common Mistakes
|
|
22
|
+
- Choosing a technique by name without checking its preconditions.
|
|
23
|
+
- Combining several structural intentions in one diff.
|
|
24
|
+
- Assuming a classical class-based form is mandatory in modern frontend code.
|
|
25
|
+
- Treating passing tests as proof when the relevant behavior is not covered.
|