Skip to content

AUTH-6795: teach skill about WorkOS Widgets - #42

Open
nicknisi wants to merge 2 commits into
mainfrom
bosun/task-msh08vze-pqej
Open

AUTH-6795: teach skill about WorkOS Widgets#42
nicknisi wants to merge 2 commits into
mainfrom
bosun/task-msh08vze-pqej

Conversation

@nicknisi

@nicknisi nicknisi commented Aug 6, 2026

Copy link
Copy Markdown
Member

bosun task: AUTH-6795: teach skill about WorkOS Widgets

Task id: task-msh08vze-pqej
Shape: ship
Project: workos/skills

…gration contexts (AUTH-6795)

The skill had no awareness of WorkOS Widgets, so in a Clerk-vs-WorkOS
bake-off the agent reported WorkOS as lacking pre-built profile/account
UI instead of recommending WorkOS Widgets as the equivalent of Clerk's
<UserButton />.

- workos-migrate-clerk.md: add "Replacing Clerk UI components" mapping
  table (UserButton/UserProfile/OrganizationSwitcher/OrganizationProfile
  -> widgets, hosted AuthKit for SignIn/SignUp), a gotcha banning the
  "no pre-built UI" claim, and widget setup basics (@workos-inc/widgets,
  WorkOsWidgets provider, CORS, authorization tokens/scopes)
- Router SKILL.md: add Widgets + provider-comparison triggers to the
  skill description and a guardrail that WorkOS HAS pre-built
  account/profile UI (route implementation to the workos-widgets skill)
- workos-terms.md: add a WorkOS Widgets terminology row for Rule 0
  lookups
- Add migrate-clerk eval cases covering the comparison and migration
  scenarios so the regression is measurable

Refs: AUTH-6795
@linear-code

linear-code Bot commented Aug 6, 2026

Copy link
Copy Markdown

AUTH-6795

@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown

Greptile Summary

The PR teaches the WorkOS skill to recommend WorkOS Widgets when users seek Clerk-style pre-built account and organization UI.

  • Adds Widgets routing and capability guardrails to the main skill.
  • Documents mappings from Clerk components to WorkOS equivalents and correct token setup.
  • Adds terminology guidance and migration evaluation cases.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
plugins/workos/skills/workos/SKILL.md Routes Widgets implementation requests to the dedicated skill and prevents false claims that WorkOS lacks pre-built account UI.
plugins/workos/skills/workos/references/workos-migrate-clerk.md Adds Clerk-to-Widgets migration mappings and uses the corrected workos.widgets.getToken backend method without a brittle Dashboard click-path.
plugins/workos/skills/workos/references/workos-terms.md Adds WorkOS Widgets terminology, component examples, setup requirements, and the canonical documentation URL.
scripts/eval/cases/migrate-clerk.yaml Adds evaluation coverage for Widgets parity and replacement of Clerk's profile components.

Reviews (2): Last reviewed commit: "fix: use correct widget getToken method ..." | Re-trigger Greptile

Comment thread plugins/workos/skills/workos/references/workos-migrate-clerk.md Outdated
Comment thread plugins/workos/skills/workos/references/workos-migrate-clerk.md Outdated

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 4 potential issues.

Open in Devin Review

| `<OrganizationSwitcher />` | `<OrganizationSwitcher />` widget |
| `<OrganizationProfile />` / member admin UI | `<UsersManagement />` widget (invite/remove members, change roles) |

Setup basics for any widget: install `@workos-inc/widgets`, render the `WorkOsWidgets` provider at the app root, configure your app as an allowed web origin (Dashboard → Applications → Sessions tab) so widget requests pass CORS, and supply each widget an authorization token — the AuthKit access token when using `authkit-js`/`authkit-react`, or a backend-generated token via `workos.widgets.createToken({ userId, organizationId, scopes })` (expires after one hour; the User Management widget requires the `widgets:users-table:manage` scope).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Skill guidance names a token-creation call that does not exist, so generated code fails

The new widget setup guidance tells the assistant to fetch a widget authorization token with a call that does not exist (workos.widgets.createToken(...) at plugins/workos/skills/workos/references/workos-migrate-clerk.md:29), when the supported call is workos.widgets.getToken(...), so code produced from this skill breaks at runtime.
Impact: Users following the migration guidance get non-working backend token code and an invented API name — exactly the hallucination these skill files exist to prevent.

Contradiction with the widgets skill's documented SDK surface

The hand-crafted widgets skill documents the backend token call as workos.widgets.getToken({ userId, organizationId, scopes }) (plugins/workos/skills/workos-widgets/references/token-strategies.md:32-49). The two new references introduce createToken instead:

  • plugins/workos/skills/workos/references/workos-migrate-clerk.md:29
  • plugins/workos/skills/workos/references/workos-terms.md:28

The new eval cases in scripts/eval/cases/migrate-clerk.yaml also do not list createToken as a hallucination, so this will not be caught by the eval gates.

Prompt for agents
The new Widgets guidance added to plugins/workos/skills/workos/references/workos-migrate-clerk.md (line 29) and plugins/workos/skills/workos/references/workos-terms.md (line 28) refers to a backend token call named workos.widgets.createToken. The hand-crafted workos-widgets skill (plugins/workos/skills/workos-widgets/references/token-strategies.md) documents the actual method as workos.widgets.getToken({ userId, organizationId, scopes }). Align both new references with getToken so the router skill does not teach a non-existent SDK method, and consider adding 'createToken' to the hallucinations list of the new eval cases in scripts/eval/cases/migrate-clerk.yaml so regressions are caught.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

| `<OrganizationSwitcher />` | `<OrganizationSwitcher />` widget |
| `<OrganizationProfile />` / member admin UI | `<UsersManagement />` widget (invite/remove members, change roles) |

Setup basics for any widget: install `@workos-inc/widgets`, render the `WorkOsWidgets` provider at the app root, configure your app as an allowed web origin (Dashboard → Applications → Sessions tab) so widget requests pass CORS, and supply each widget an authorization token — the AuthKit access token when using `authkit-js`/`authkit-react`, or a backend-generated token via `workos.widgets.createToken({ userId, organizationId, scopes })` (expires after one hour; the User Management widget requires the `widgets:users-table:manage` scope).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 New guidance hardcodes a Dashboard click-path the router's own guardrail forbids

The setup sentence instructs the agent to configure allowed web origins at "Dashboard → Applications → Sessions tab". The router's guardrail in plugins/workos/skills/workos/SKILL.md:26 explicitly says never to state Dashboard click-paths unless verified against a just-fetched docs page, because the Dashboard reorganizes. Verify this path against https://workos.com/docs/widgets or describe the destination conceptually plus the docs URL.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +21 to +27
| Clerk component | WorkOS equivalent |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `<SignIn />` / `<SignUp />` | AuthKit hosted sign-in page (redirect-based, not an embeddable component); brand it in the Dashboard |
| `<UserButton />` | The account UI behind it maps to the `<UserProfile />` and `<UserSecurity />` widgets; sign-out is handled by AuthKit session helpers |
| `<UserProfile />` | `<UserProfile />`, `<UserSecurity />`, and `<UserSessions />` widgets (profile info, password/MFA, active sessions) |
| `<OrganizationSwitcher />` | `<OrganizationSwitcher />` widget |
| `<OrganizationProfile />` / member admin UI | `<UsersManagement />` widget (invite/remove members, change roles) |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Widget component names in the new mapping are broader than what the widgets skill documents

The mapping table asserts <UserSecurity />, <UserSessions />, <UsersManagement />, and <OrganizationSwitcher /> widgets exist, but the hand-crafted widgets skill only covers four widget targets (user-management, user-profile, admin-portal-sso-connection, admin-portal-domain-verification, see plugins/workos/skills/workos-widgets/SKILL.md:11) and its endpoint tables only expose UserManagement and UserProfile surfaces (plugins/workos/skills/workos-widgets/references/fetching-apis.md:58-87). If the extra component names are correct per current docs, the two skills now disagree on the catalog; if not, they are hallucinated exports. Worth confirming against https://workos.com/docs/widgets.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +20 to +23
antiPatterns:
- build that UI from scratch
- no pre-built UI
- no equivalent

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Eval anti-pattern strings may be neutralized by the negation-aware scorer

antiPatterns entries like "no equivalent" and "no pre-built UI" are matched with isNegated lookback (scripts/eval/scorer.ts:290-310), which treats a preceding "not"/"never"/"don't" within 30 chars as a non-hit. A with-skill answer such as "it's not true that there is no equivalent" would be ignored, but so would many legitimate phrasings — more importantly, an incorrect answer phrased "WorkOS does not have an equivalent" contains "not ... equivalent" and could be suppressed, weakening these two cases' ability to detect the exact failure mode the PR targets.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

…Dashboard click-path

Addresses Greptile review comments on PR #42 (AUTH-6795):
- Replace workos.widgets.createToken with workos.widgets.getToken in
  workos-migrate-clerk.md and workos-terms.md (per token-strategies.md)
- Replace hardcoded Dashboard click-path with conceptual description and
  stable docs URL (https://workos.com/docs/widgets)
- Add workos.widgets.createToken to migrate-clerk eval hallucinations so
  the regression is caught by eval gates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant