Repository navigation
Skill: platform-agnostic v5 agent skill (react, angular, shadcn) with fewer tool calls and no node_modules lookups - #1524
Conversation
…ences Imports the multi-file skill used in the firebase-ui-evals skill study (invertase/firebase-ui-evals@skill-eval, 90e1fc9), unchanged.
sendSignInLinkToEmail takes no actionCodeSettings and completeEmailLinkSignIn requires currentUrl in 7.1.0. Adds short email link, emulator firebase.ts, guest upgrade, and Button/Card snippets so agents do not read node_modules for them.
In the reeval transcripts every read of references/react.md (11.5 KB in v2, 14.8 KB in v3) is recorded with empty content, while text files up to about 11 KB are recorded whole. Move the multi-factor screens, email link recipe, headless forms, hooks and recipes into references/react-recipes.md and point SKILL.md at both files, so each skill file is under the size where reads were recorded empty.
…modules In every recorded composer run the first two tool calls were glob **/* and glob src/**/* at the project root. Cursor's glob prepends **/ to patterns, so both match node_modules and return 160k+ characters with none of the app's own files. Put the shortest rule in the description (visible before SKILL.md is read) and the full rule at the top of SKILL.md.
… 7.1.0 generateTotpQrCode returns a string, not a Promise. signInWithEmailAndPassword, createUserWithEmailAndPassword, signInWithProvider, signInWithCredential and confirmPhoneNumber return Promise<UserCredential | void>. onUpgrade takes (ui, oldUserId, credential) and onUpgradeFailure takes one context object. formatFirebaseError is not exported; handleFirebaseError is. autoAnonymousLogin runs once at init, not on every null auth state. Checked against the published d.ts and packages/core/src, plus a tsc run in a scratch app.
…ing note dist.min.css only sets padding-inline, font size, colour and hover on .fui-form__action, so without Tailwind's Preflight the Forgot password and Sign up links render with the native button background and an outset border (measured in a Vite app on 7.1.0: rgb(239, 239, 239) and 2px outset). With this rule they compute to a transparent background, no border and the package's own 4px inline padding.
Drop the per-layer lists and the reset-styles bullet that react.md already covers, shorten the initializeUI snippet, add a phone row and point the anonymous and email link rows at the recipes. SKILL.md goes from 9.5 KB to 7.8 KB; every snippet in SKILL.md, react.md and react-recipes.md typechecks against @firebase-oss/ui-react and ui-core 7.1.0 in a scratch Vite app.
SKILL.md is now a platform-agnostic router: it detects React, shadcn/ui or Angular and sends the agent to that stack's two reference files plus core.md. Search rules are scoped to src (glob with targetDirectory src, never `**/*` from the project root), and the skill states every prop, selector and signature the agent needs so it never looks in node_modules. References are split per platform and each stays under 10 KB: core.md (signatures), react.md, react-recipes.md, angular.md, angular-recipes.md, shadcn.md, shadcn-recipes.md. Fixes folded in from the evals: core.md signatures, shadcn ui-styles removal and registry type fix, Angular provideAuth, styles path and reset, and React auth-state recipes.
There was a problem hiding this comment.
Code Review
This pull request restructures the FirebaseUI Web getting started skill documentation, introducing comprehensive reference and recipe guides for Angular, React, shadcn/ui, and the core library. The feedback highlights two issues in the Angular reference file: an incorrect reference to the unreleased Angular 20 and @angular/fire@20 instead of version 19, and an invalid template binding syntax [variant]="'primary' | 'secondary'" which evaluates as a bitwise OR operation at runtime and fails strict template type checking.
| @@ -0,0 +1,190 @@ | |||
| # FirebaseUI Web: Angular Reference (`@firebase-oss/ui-angular`) | |||
|
|
|||
| Standalone components for Angular 19+ (written against `@firebase-oss/ui-angular@7.1.0`, `@angular/fire@20`). Read this file first. Email link, anonymous upgrade, MFA, the Auth emulator and headless forms are in [`angular-recipes.md`](angular-recipes.md). Core actions are in [`core.md`](core.md). | |||
|
|
||
| ## 5. Layout pieces and helpers | ||
|
|
||
| - `<button fui-button [variant]="'primary' | 'secondary'">`, `<fui-card>`, `<fui-card-header>`, `<fui-card-title>`, `<fui-card-subtitle>`, `<fui-card-content>`, `<fui-divider [label]>`, `<fui-policies>`, `<fui-redirect-error>`, `<fui-country-selector [(value)]>` (classes `ButtonComponent`, `CardComponent`, `CardHeaderComponent`, `CardTitleComponent`, `CardSubtitleComponent`, `CardContentComponent`, `DividerComponent`, `PoliciesComponent`, `RedirectErrorComponent`, `CountrySelectorComponent`). Wrap a hand-made card in `<div class="fui-screen">` to match the screens' width and centring. |
There was a problem hiding this comment.
In Angular templates, writing [variant]="'primary' | 'secondary'" will be evaluated as a bitwise OR operation at runtime (resulting in 0), which will fail strict template type checking. It should be documented as variant="primary" or variant="secondary" (or explained that it accepts 'primary' | 'secondary').
Replaces the FirebaseUI Web getting-started agent skill with the platform-agnostic v5 version. In my evals it cuts tool calls by about 75% and removes
node_moduleslookups entirely on React, Angular and shadcn/ui, with no drop in pass rate.Summary
SKILL.mdis one platform-agnostic router (5.5 KB). It detects React, shadcn/ui or Angular, points the agent at that stack's two reference files pluscore.md, and carries the search rules: glob withtargetDirectoryset tosrc, never**/*orsrc/**/*from the project root, never look innode_modules.core.md,react.md,react-recipes.md,angular.md,angular-recipes.md,shadcn.md,shadcn-recipes.md. They hold every prop, selector and signature the agent needs, so it has no reason to read the installed packages.core.md: signatures corrected against@firebase-oss/ui-core7.1.0.ui-stylesstep and fixed the registry type issue.provideAuthwiring, the styles path, and the.fui-form__actionreset.RequireAuthrecipes.main, an agent still spends most of its tool calls globbing the whole project and greppingnode_modulesto work out prop names. Putting the signatures in the skill and telling it where not to look removes that work.Only
.agents/skills/firebaseui-web-getting-started/changes. Nothing else in the repo references the skill's files.How it was tested
Evals live in invertase/firebase-ui-evals (branch
russell/skill-v5-all-platforms, recorded runs underevals/.history/). They run on reeval with Cursorcomposer-2.5only, which is deliberately the weaker model. Each attempt gets a fresh Docker sandbox, builds a full auth app from the skill, and is scored by:typesafe-ai/jev-1.13.0, score threshold 0.8),google/gemini-3.8-flash).A
node_modulescall is a tool call whose input mentionsnode_modules, counted from the attempt transcripts. All numbers below are per-attempt means with n=4 attempts per arm. Rounds are groups of consecutive tool calls with no text between them.Study 1 (Oct 22, reeval 0.12.0, React only, 12 attempts, 13.9 min wall)
Input tokens in study 1 follow the 0.12.0 counting, which included cache reads and differs from the Cursor dashboard. reeval fixed this in 0.13.0 (invertase/reeval#487), so tokens are only comparable within a study.
No-skill was the slowest and used the most tokens and tool calls, so I dropped it from every later run. The data shows the skill matters.
Study 2 (Oct 23, reeval 0.13.0, React + Angular + shadcn, 28 attempts, 22m20s wall at concurrency 8)
Total tokens = uncached input + cache read + output.
v5 vs shipped, change in per-attempt mean:
Pooled absolute values, shipped to v5: tool calls 62.1 to 15.8, node_modules calls 32.1 to 0, agent time 167 s to 64 s, rounds 27.5 to 5.5.
Pass counts: 26 of 28 attempts passed. v5 passed 12 of 12, shipped 11 of 12 (one Angular email-link flow score of 0.72 against the 0.8 threshold), and React v4 3 of 4 (an
/anonymousscreenshot timeout caused by the agent's page signing in on mount). Moving from v4 to v5 did not regress React: tool calls +3%, agent time +7%, rounds unchanged. v5 won the v4 vs v5 compare judge 6-0 on fit and 5-1 on adjustability.Caveats
composer-2.5only, and n=4 per arm. Small differences (for example React v4 vs v5) are within the noise..cursorignoreor a Cursor-side fix would.+93inui-angular7.1.0.UserCredential | void) against the 7.1.0 packages. Worth an upstream fix.Reviewer checklist
SKILL.mdand every file underreferences/is under 10,000 bytes (wc -c).SKILL.mdnames exactly the reference files that exist, and the old files that no longer exist are gone.core.mdmatch@firebase-oss/ui-core7.1.0.targetDirectorysrc, no root**/*, nonode_modules.npm run eval:studyininvertase/firebase-ui-evals.