Sveltekit progressive enhancement review
Skill Raishin/vanguard-frontier-agentic/skills/frontend/sveltekit-progressive-enhancement-review
Statically review SvelteKit forms and form actions for functional resilience without JavaScript (native method="POST" fallback) and for use:enhance customization correctness (ActionResult branch handling, cancel() feedback, redirect/invalidation behavior), flagging silent-failure and conversion-risk defects.From its SKILL.md
npx -y skills add Raishin/vanguard-frontier-agentic --skill sveltekit-progressive-enhancement-reviewAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 20 stars20 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
7.9 KB, ~1.7k tokens by cl100k_base, as published. Nobody here has run it
SvelteKit Progressive Enhancement Review
Purpose
Review SvelteKit forms and form actions for progressive-enhancement resilience — whether the form still functions via a native browser POST when JavaScript fails, is blocked, or hasn't finished loading — and for use:enhance customization correctness, without re-litigating server/client load-function placement, component styling, or routing precedence in every response. This skill exists because a form that "works fine" during manual testing with JavaScript enabled can still be a dead end for the measurable share of real users who hit slow/blocked/failed JS on real-world connections, and because a custom use:enhance SubmitFunction that only handles the happy path silently swallows every failure/error/redirect ActionResult, turning a broken submission into a UI that does nothing and tells the user nothing.
When to use
Use this skill when the user asks to:
- review a new or changed
<form>/ form-action implementation before merge, - confirm whether a form "works without JavaScript",
- investigate a report that a form submission silently does nothing (no error, no navigation, no feedback) when it fails,
- audit a custom
use:enhanceSubmitFunctionfor missingActionResultbranches or unexplainedcancel()calls.
Do not use this skill for:
- internal admin tools explicitly scoped as JS-required — progressive enhancement may be intentionally out of scope there; confirm that scoping with the user before flagging anything,
+page.js/+page.server.js/+layout.jsuniversal-vs-serverloadplacement review — usesveltekit-routing-load-reviewinstead,- pure visual/styling review of form markup with no functional or error-handling question in scope.
Context7 Documentation Protocol
- Resolve the library ID with
resolve-library-id(matched result:/sveltejs/kit) before citing any SvelteKit-specific claim about form actions oruse:enhance. - Before asserting what the default, no-argument
use:enhanceprovides, callquery-docsagainst/sveltejs/kitfor "progressive enhancement use:enhance" and quote the precise rule:use:enhanceonly applies to a<form method="POST">that posts to an action defined in+page.server.js; used without arguments it emulates native browser behavior — it updates theformprop and page status on success, resets the form element, callsinvalidateAll(), and handles redirects, error boundaries, and focus management automatically, all without a full-page reload. Do not assume feature parity with a generic SPA form-handling library; this behavior is SvelteKit-specific and documented, not inferred. - Before asserting what a custom
SubmitFunctionmust reimplement, callquery-docsagainst/sveltejs/kitfor "customising use:enhance SubmitFunction ActionResult" and confirm: theSubmitFunctionreceives{ formElement, formData, action, cancel, submitter }before submission, and may return an async callback receiving{ result, update }— whereresultis theActionResult(success|failure|redirect|error) andupdatetriggers the default post-submission logic that would otherwise run. If the callback is supplied at all, none of that default logic runs unless the callback callsupdate()or manually replicates it (e.g. viaapplyAction(result)). - Verify the SvelteKit version installed in the repo (
package.json) before assertinguse:enhanceorActionResultshape details are unchanged from the queried docs — form-action APIs have evolved across SvelteKit majors. - If Context7 is unavailable, fall back to the
official_docsURLs in this skill'smetadata.jsonand label the claimdocumentation-based, unverified against current release. - Never assume
applyActionorinvalidateAllis called inside a custom callback without reading the callback body — their absence is exactly the defect this skill exists to catch.
Lean operating rules
- First classify every
<form>in scope as native-POST-capable (hasmethod="POST"and a real action target resolving to a+page.server.jsexport) or JS-only (driven solely by a click/onclickhandler with no native fallback) — do this by reading the markup, never by assuming. - A native
<form method="POST">with nouse:enhanceat all already works without JavaScript by default; that is the baseline SvelteKit contract, not a defect. Do not flag its absence as a finding on its own. - Bare (no-argument)
use:enhancegets the full documented default behavior (form reset,invalidateAll, redirect/error/focus handling) for free — do not demand the caller reimplement anything for a bareuse:enhanceusage. - Every custom
SubmitFunctioncallback must branch onresult.type. A callback that assumesresultis always a success (e.g., only readsresult.datawith no type check) is a silent-failure defect:failure/error/redirectresults are dropped on the floor and the user sees nothing. - A
cancel()call inside the pre-submissionSubmitFunctionbody must be paired with a clear, user-facing reason (e.g., inline client-side validation message shown to the user) — a silentcancel()with no visible feedback is equivalent to a silent failure. - Do not accept "an error variable exists in component state" as proof that failures are surfaced to the user. Trace whether that variable is actually rendered in the markup and, for accessibility, associated with the form via a status-message pattern (e.g.,
aria-liveregion or equivalent) — an unrendered or unannounced error state is still a silent failure for sighted users tracking visually and a silent failure for screen-reader users regardless. - Treat any custom
SubmitFunctionthat bypasses the form's nativeaction/methodto call a hand-rolledfetch()directly (rather than lettinguse:enhancesubmit natively or using SvelteKit's owndeserialize()/applyAction()pattern) as a security-review flag, not a pure UX nit — it can skip origin-check behavior SvelteKit applies to form-action submissions; do not wave it through as a stylistic preference. - Never execute, build, or run application code as part of this review; this is a static-review skill (Read/Grep/Glob only). "Works without JS" claims must be verified by reading markup for
method="POST"and a resolvable action, never assumed from a component name or comment.
References
Load these only when needed:
- Review workflow and findings contract — use for the step-by-step review procedure, the decision tree for classifying findings, and the required output shape.
- Failure-state and accessibility UX — load only when reviewing how a failed/error/cancelled submission is surfaced to sighted and screen-reader users, not for pure native-fallback presence checks.
Response minimum
Return, at minimum:
- the form(s) and form action(s) in scope,
- evidence level (
repo evidencefrom markup/action code vsinference) and Context7/docs grounding used, - ranked findings (file:line, missing-fallback or unhandled-
ActionResult-branch gap, fix sketch matching documenteduse:enhance/applyActionpatterns), - verdict on whether any public-facing, unauthenticated-reachable form (signup, contact, checkout) lacks a native fallback — this is a hard stop, not advisory,
- open questions (e.g., whether an internal tool is confirmed JS-required by design before exempting it).
What ships with it: 3 files
14.4 KB alongside SKILL.md
references/
- metadata.json1.2 KB