feat(ai): update skills for phases 2, 3, 5#6208
Conversation
|
| @@ -39,4 +39,9 @@ Also read the migration plan at `CONTRIBUTOR-DOCS/03_project-planning/03_compone | |||
|
|
|||
There was a problem hiding this comment.
Phase 5 - accessibility
| @@ -13,6 +13,25 @@ You are defining a contract, not writing logic. Every property and type you plac | |||
|
|
|||
There was a problem hiding this comment.
Phase 3 - API / Typescript
|
|
||
| Read the migration plan at `CONTRIBUTOR-DOCS/03_project-planning/03_components/[component]/migration-plan.md` when available and use it as the planning baseline for names, deprecations, breaking changes, and consumer migration paths. If it is missing, stale, or intentionally incomplete, derive the needed context from source material and call out the missing plan as a risk. See also [`migration-plan-contract`](../migration-prep/references/migration-plan-contract.md). | ||
|
|
||
| The plan's architectural sections also govern **where each property and type lands**. If Phase 2 established that certain properties belong on the SWC class rather than the base (e.g. for shared-reuse reasons), that decision holds in Phase 3 — do not move those properties to the base class during API migration even if a checklist item implies otherwise. If a checklist item and an architectural section conflict, the architectural section governs; update the checklist and note the reason. |
There was a problem hiding this comment.
If a checklist item and an architectural section conflict, the architectural section governs;
Very nice!
| @@ -11,7 +11,15 @@ description: Phase 2 of 1st-gen to 2nd-gen component migration. Use to create th | |||
|
|
|||
There was a problem hiding this comment.
Phase 2 - File structure / Setup exports / Scaffold component
| * governing permissions and limitations under the License. | ||
| */ | ||
|
|
||
| type ElementLocalName = string; |
There was a problem hiding this comment.
I was getting a local lint error for __swc - Claude found and copied this from 1st-gen
There was a problem hiding this comment.
I got the same suggestion when I looked into the linting error as well.
📚 Branch Preview Links🔍 First Generation Visual Regression Test ResultsWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
Deployed to Azure Blob Storage: If the changes are expected, update the |
| } | ||
| ``` | ||
|
|
||
| ## Deprecation warnings |
There was a problem hiding this comment.
Originally added in Illustrated Message, notified @miwha-adobe I would be including in this work to get merged in sooner
|
|
||
| **Deferred items are out of scope.** The plan may explicitly defer features to follow-up tickets (e.g. form-associated behavior, cross-root ARIA). Do not implement deferred items in Phase 3 even if they appear in the API section of the plan — mark them as skipped and note the tracking ticket. | ||
|
|
||
| **1st-gen changes are limited to deprecation notices only.** When adding deprecation notices to 1st-gen, restrict changes to: (1) `@deprecated` JSDoc on exported types, consts, and properties; and (2) `window.__swc.warn()` calls added inside already-existing setters or other existing code paths. Do not refactor 1st-gen code structure — no new backing types, no converting simple properties to getter/setter patterns, no new private fields. TypeScript TS6385 hints that arise from deprecated types referencing each other internally are an accepted side effect and do not require structural fixes. |
There was a problem hiding this comment.
Question: Could this also be a good place to point to debug-validation.md?
| - Do not add new class statics to 1st-gen just to provide this alternative — that is a refactor and out of scope. | ||
| - For **renames**, note the new name in the JSDoc: "...will be replaced by `newName` in a future release." | ||
|
|
||
| For the `window.__swc.warn()` call format and the `{ level: 'deprecation' }` option, follow the **Deprecation warnings** section of [`CONTRIBUTOR-DOCS/02_style-guide/02_typescript/17_debug-validation.md`](../../../CONTRIBUTOR-DOCS/02_style-guide/02_typescript/17_debug-validation.md). Key rules from that guide: |
| - Use them for: **runtime validation** (e.g. in `update()` or setters—check value is in the list), **Storybook** `argTypes` `options`, and **tests** (assert against the same source of truth). | ||
| - See `2nd-gen/packages/core/components/badge/Badge.base.ts` and `2nd-gen/packages/swc/components/badge/Badge.ts`. | ||
|
|
||
| > **When to skip class statics:** If the concrete class is a leaf that is not intended to be subclassed with different valid values, adding `static readonly VARIANTS = BUTTON_VARIANTS` to the class would simply re-point a module-level constant. In that case, referencing the module constant directly in debug/validation code is simpler — and avoids the `(this.constructor as typeof Base).VARIANTS` cast entirely. See `swc-button` (`Button.ts`) as an example: its `update()` references `BUTTON_VARIANTS` and `BUTTON_FILL_STYLES` directly rather than hoisting them as statics. |
There was a problem hiding this comment.
I don't know a lot about this, but it was in response to seeing Claude create these class statics for things like the size and variant consts when they weren't further modified, which seemed odd. Let me know if there's a reason we should keep that pattern!
There was a problem hiding this comment.
I recall when I was building out Illustrated Message, that there was a level of abstraction that was unnecessary. I received a similar suggestion to simplify things by removing the cast.
There was a problem hiding this comment.
Basically, since the values provided by the base variants weren't being extended or modified, the cast was unnecessary abstraction. It only makes sense to subclass with different values if you're adding to them, otherwise referencing the module constant directly is simpler. I think thats a reasonable addition into the skills instructions.
| }; | ||
| type BrandedSWCWarningID = `${ElementLocalName}:${WarningType}:${WarningLevel}`; | ||
|
|
||
| interface Window { |
There was a problem hiding this comment.
Praise: Thanks for adding this! Was getting linting errors as well
caseyisonit
left a comment
There was a problem hiding this comment.
love this! miwha called out the things i saw but seems like everything is GROOVY
Description
Updates washing machine related AI Skills for the following phases:
migration-setup- emphasize looking to migration plan for architectural and structural decisionsmigration-api- retains Phase 2 decisions; keeps deferred items out-of-scope; limits 1st-gen changes to deprecation notices and clarifies deprecation handlingmigration-a11y- documents behavior for addingdelegatesFocusand accessible name forwardingAlso adds global typing related to
Window.__swcdebugging messages, as copied from 1st-gen.Motivation and context
Updates made per results in using these skills against the Button migration plan and the need to prioritize the migration plan decisions, as well as make the skill more robust in handling common scenarios and team norms/utilities.
Related issue(s)
Manual review test cases
Validate the updated skills, and ensure they read as generic/worthy of being global considerations across component migrations.