Skip to content
PirefactorWeb2 files · +37 −42

Audit Svelte 5 codebase for best-practice violations

Session from pi-web on Hugging Face by woxQAQ · MIT · condensed by Coders Talk

16msession
0interventions
GOAL

Check whether the current Svelte codebase follows Svelte 5 best practices, then fix any issues found.

  1. Prompt · +0
    Check if current repo's Svelte code follows best practice
  2. Agent did · +0m
    Loaded Svelte best-practice skills, read every component and store file in packages/svelte/src, and attempted to run the Svelte autofixer/MCP tool (which timed out) to check for issues.
  3. Agent did · +3m
    Produced a full audit report concluding the codebase is largely compliant with Svelte 5 runes/event syntax, flagging a couple of remaining issues (window/document listeners in onMount instead of <svelte:window>/<svelte:document>, and an ad-hoc effect timer hack).
  4. Prompt · +12m
    Fix the two issues
  5. Agent did · +13m
    Edited App.svelte to move window resize/keydown listeners into <svelte:window> and replaced the _timerSet mutation hack with a proper Set<string> tracker for notification auto-dismiss.
  6. Agent did · +14m
    Found the same onMount document listener pattern in ChatTranscript.svelte and converted the copy/scroll listeners to declarative Svelte event bindings, verifying handleScroll's signature was compatible.
  7. Agent did · +15m
    Ran pnpm build:web to confirm the project still compiles after the changes; build passed cleanly.
  8. Prompt · +16m
    Commit
  9. Outcome · +16m
    Committed fix as a063394 on main: 2 files changed, 10 insertions(+), 15 deletions(-).
VERDICT

I'd start by asking it to both audit and fix in one pass, since the audit alone took a long time reading every file before finding just two real issues. The build check after the edits was the step that actually mattered — it confirmed the svelte:window and effect-timer refactors didn't break compilation before I committed.

I tried this · 0

Discussion · 0

How Builds work