İçeriğe geç
Kurulum

local-web-app-dev-loop

Yerel web uygulaması arayüzünü tarayıcı testiyle yineleyerek geliştirir.

HamaratLabsMITv1.0.0

KURULUM

hermes skills install well-known:https://skills.hamaratlabs.com/.well-known/skills/local-web-app-dev-loop

Ham dosyaSKILL.md önizlemesi

2 GERÇEK ÖRNEK

Ne istendi, ne çıktı

NE İSTENDİ · 27 EKİM 2026

WingWire web mockup C3 ('Telegram Desktop oranları') yazılı şartnameye birebir kurulsun; tüm rotalar çalışsın, 1440x900 ve 1920x1080 ekran görüntüleri görsel olarak doğrulansın.

default
NE ÇIKTI

Tek dosyalık HTML mockup kuruldu; 20 rota için 1440 ve 1920 genişlikte ekran görüntüleri alınıp tek tek kontrol edildi, sonuç JSON olarak teslim edildi.

NE İSTENDİ · 25 EKİM 2026

Düşen Top oyununun uygulama ikonunu yeniden tasarla; önceki simetrik sürüm canavar yüzü gibi okunuyordu.

default
NE ÇIKTI

Asimetrik yeni ikon AppIcon.jsx'e eklendi, yerelde render edilip kontrol edildi, ayrı dalda commit (push yok).

KAYNAK VE LİSANS

Tür
HamaratLabs yazdı
Yazan
HamaratLabs
Lisans
MIT
Ham dosya
SKILL.md

DEĞERLENDİRME

  • 1ajan profilinde kullanıldı
  • 156kayıtlı yükleme
  • 2belgelenmiş örnekyalnız metin

Sayılar ajan kayıtlarından gelir. Puanlama henüz yok.

SÜRÜM

Sürüm
v1.0.0
Siteye ilk yayın
1 Aralık 2026
Oluşturma
17 Ekim 2026
Son kullanım
5 Kasım 2026
Paket
5 dosya · SKILL.md 146 satır

YORUMLAR

Yorumlar yakında

Bu skill hakkındaki yorumlar ve puanlar burada görünecek. Bölüm henüz açılmadı.

SKILL.MDÖnizleme146 SATIR

AJAN AÇIKLAMASI Use when iterating a local web app UI with browser testing.

Local Web App Dev Loop

Procedure for iterating on a local web app's UI/behavior with real verification, not assumption. Covers Gradio, Flask, FastAPI, or any Python server with a browser-rendered front end.

When to Use

  • Building or redesigning a local web app's UI (Gradio, Flask, FastAPI, or similar) and verifying changes with a headless browser.
  • A visual/behavioral test result seems inconsistent with the code just written (classic symptom: a stale server still on the port).
  • The user wants to preview a local dev server from another device.
  • A CSS override isn't applying despite !important, or injected <script> content never runs.

1. Before trusting ANY test result, confirm what's actually serving the port

A stale server process from an earlier iteration silently keeps old code live while a new launch fails quietly ("Cannot find empty port" in its own log, which nobody reads until later). Every iteration that edits server-side code must:

  1. Kill the old process by PID (not just by guessing it exited): lsof -i :PORT -sTCP:LISTEN to find who really holds the port.
  2. Confirm the port is empty before relaunching.
  3. After relaunching, confirm the NEW code is live before screenshotting/clicking anything - curl a known-fresh string (a label, CSS value, or /config JSON field you just changed) rather than just checking the server responds at all. A 200 response proves a server answered, not your server.

Skipping step 3 produces a convincing but wrong test: a "visual bug" that was already fixed, or a "fix confirmed" that never ran the new code. This was the single most time-costly mistake pattern in iterative local-server testing - it recurred multiple times in one session before the habit was fixed.

The mirror-image mistake is building INTO a directory a server is already serving: a production build (npm run build for next start, and any framework that hashes its output chunks) rewrites the .next/dist the running process is reading, so every JS/CSS chunk 500s until that process is restarted - the HTML still returns 200, so a shallow check misses it. Never build in the folder of a server the user (or an outside tester) is on right now: build in a separate worktree, or stop the server, build, restart. After ANY rebuild+restart, verify a hashed asset and not just the page: j=$(curl -s $URL/ | grep -oE '/_next/static/[^"]+\.js' | head -1); curl -s -o /dev/null -w '%{http_code}' $URL$j.

The PID you captured when you launched the server is not always the PID actually holding the port: a npm run dev/next dev-style wrapper spawns a separate next-server (or equivalent) child that keeps listening after you kill the wrapper PID - the port looks free for a moment, then a fresh launch attempt fails with "port in use" pointing at a PID you never saw. Always re-run lsof -i :PORT -sTCP:LISTEN (or ps aux | grep -i next-server) AFTER killing and before relaunching, and kill whatever PID that actually shows, not just the one your own launch command returned.

2. Playwright visual verification loop

  • Launch the server in the background (notify=true), wait for it to bind, then drive a headless Chromium instance via node -e "..." with playwright (chromium.launch(), page.goto(url, {waitUntil:'load'}) - NOT 'networkidle', which never resolves on an app holding an open WebSocket/SSE connection, e.g. Gradio's queue).
  • Screenshot to a file, then load that file with the vision tool and ask a specific, falsifiable question ("is the button black or orange", "does the progress text overlap") rather than a vague "does this look right" - specific questions catch specific regressions.
  • When a Playwright locator must disambiguate (getByText matching a tab button AND its substring inside another label, e.g. "Üret" matching "Üretimi"), use { exact: true } or getByRole('button'/'tab', { name: ... }) instead of a bare substring getByText.
  • For a feature whose real duration is minutes (model loads, large inference), don't poll with a tight loop of narrated short sleeps - state once why the wait is happening, batch it into one longer background wait, and report the final screenshot/result. Repeated "checking again..." messages during a long known-duration wait read as stalling to the user even when the underlying work is legitimate.

3. Exposing a local dev server to another device

macOS's Application Firewall blocks a fresh non-loopback inbound connection to a Python process by default, and granting the exception needs sudo - which needs the user's own password and must never be requested or run on their behalf. Do not bind to 0.0.0.0 and assume the LAN/Tailscale IP will work; test it first.

The clean fix, when Tailscale is already installed: tailscale serve --bg <port> proxies https://<device>.<tailnet>.ts.net/ to http://127.0.0.1:<port> through Tailscale's own process, so the app stays bound to loopback and is reachable only from the user's private tailnet, with no sudo and no firewall change. Ask the user before exposing anything beyond localhost, and keep it tailnet-only (never funnel/public). Verify with curl against the https://...ts.net/ URL (not the bare Tailscale IP) before sending the link. Tear down later with tailscale serve --https=443 off if asked.

Run tailscale serve status first: :443 and other ports may already map to other apps, and serving on them replaces those mappings. Give a new app its own HTTPS port (tailscale serve --bg --https=8443 http://127.0.0.1:<port>).

Permanent tailnet access for a Vite app with its own guards

For a standing "open it from my other laptop" setup (not a one-off screenshot - see §8):

  1. Probe before exposing: curl -H 'Host: <device>.<tailnet>.ts.net:8443' http://127.0.0.1:<port>/. Vite answers 403 "Blocked request. This host is not allowed" - the proxy keeps the tailnet Host header. Feed server.allowedHosts (and preview.allowedHosts) from an env list (strip :port), and add the https://<host>:8443 Origin to the app's own Origin/Host guard env. A remote-socket switch is not needed: tailscaled connects over loopback.
  2. Keep the app bound to 127.0.0.1; only tailscale serve (tailnet only, never Funnel) reaches it.
  3. Verify through the tailnet URL: page 200, API 200 with the tailnet Origin, a foreign Origin 403, a real UI flow in the browser.
  4. Persistence: write a launcher script that exports the env and exec npm run dev, plus a LaunchAgent plist in ~/Library/LaunchAgents (RunAtLoad, KeepAlive, ThrottleInterval). From inside the ajan gateway launchctl bootstrap is refused - do not bypass it; the plist loads by itself at the next login. Meanwhile run the launcher as a persist_on_release background process, and mkdir -p the log directory BEFORE launching with a redirect into it (a missing directory makes bash fail before the script runs; the tailnet URL then shows 502).
  5. Tell the user the machine must not sleep for remote access, and which device names tailscale status actually lists.
  6. Supervise the backend the app proxies to, not only the app. If the app needs a second local service (e.g. a ajan dashboard on its own port), a launcher that starts it once leaves the UI showing "server unreachable" the first time that service dies. Run it in a small loop (while true; do lsof -iTCP:<port> -sTCP:LISTEN || <start-cmd>; sleep 30; done) and verify through the tailnet URL afterwards. A restarted auth-protected backend can invalidate existing logins: the UI then shows its login screen; the user logs in once (never type their password, never remove the auth gate to save them the step - the panel can drive agents for anyone on the tailnet). Meanwhile ?backend=fake-style demo modes, if the app has one, let them look at screens without logging in.

Once a tailscale serve mapping already exists for a port, RESTARTING the local dev server behind it (e.g. after an env-var change) can fail to bind that port with no owning process visible in lsof/ps at all - not even as root. tailscaled itself is holding the port as part of serving the existing mapping, and that is invisible to normal process inspection. Confirm this specific cause with a raw bind test (python3 -c "import socket; s=socket.socket(); s.bind(('0.0.0.0', PORT))" - Address already in use with zero matching lsof/ps output is the signature), then tailscale serve --https=PORT off, start the dev server, and only then re-run tailscale serve --bg --https=PORT http://127.0.0.1:PORT to restore the mapping - re-adding the serve mapping after the backend is already up does not fail the same way.

Public sharing with outside testers

When friends/testers outside the tailnet must reach a local app (public subdomain, access code, daily model quota), follow references/public-tunnel-share.md: app gate first, API-created Cloudflare Tunnel with one ingress rule, security review with an external post-launch check, and the rule never to rebuild inside a running next start folder (it 500s every JS chunk until restarted).

4. CSS specificity against a component framework's own classes

When a custom elem_classes/class override doesn't visually apply (e.g. a button stays the framework's default color despite !important):

  1. Don't guess the selector - inspect the live DOM via Playwright (page.evaluate walking el.className/getComputedStyle) to see which element actually carries your class and what competing classes/specificity it has.
  2. A framework often puts your custom class directly ON the interactive element (not on a wrapper), so a descendant selector like .my-class button silently matches nothing - use button.my-class instead.
  3. The framework's own semantic class (.primary, .secondary, .selected) frequently carries equal-or-higher specificity and can win a cascade tie by source order even against your !important. Combine both classes in the selector (button.primary.my-class) and set the specific sub-properties (background-color as well as background) rather than relying on shorthand alone.

5. <script> injected via an HTML-insertion component does not execute

Content inserted through innerHTML-style APIs (a framework's HTML/raw-markup component, .innerHTML =, Svelte {@html}) is parsed as markup, not executed - a <script> tag inside it is permanently inert. This is a browser-level restriction, not a bug in the framework. If client-side JS must actually run on page load (a DOM-cleanup observer, a one-time init), use the framework's real script-injection entry point (e.g. Gradio's Blocks(...).launch(js="() => {...}"), which truly executes) - never a <script> tag pasted into an HTML/markdown component.

6. Never disturb a server the user is live-testing

When the user is clicking through the app on its main port, a delegated edit must not restart, kill or rebind it; code edits only show after a restart, so say so and let the user choose the moment. Verify on a second port instead. If the app hard-codes server_port in its __main__ block (so the port env var is ignored), write a throwaway launcher in the scratch dir that imports the app module and calls build_app().launch(server_port=<other>, ...) with the same launch arguments (css/theme/js), run it in the background, screenshot, then kill that exact PID and confirm the main port still answers. Put these constraints (do not touch the main port, do not press the generate button, no model load) into the worker's brief; heavy local models make a busy machine fragile.

7. Verifying a one-time intro animation

Build it as CSS-only @keyframes on transform/opacity with animation-fill-mode: backwards and no explicit end keyframe, so the final frame is the existing static style and nothing keeps running; add @media (prefers-reduced-motion: reduce) { animation: none }. Prove it with Playwright: (a) screenshots at about 0.3 / 0.8 / 1.5 / 3.0 s (pause and seek via document.getAnimations() currentTime, or sleep) at desktop and a 390 px mobile width; (b) pixel-diff each against a no-animation baseline - early frames must differ, the 3 s frame must differ by exactly 0 pixels; (c) with reduced-motion emulation even t=0 equals the baseline; (d) document.getAnimations() is empty after the end and switching tabs does not replay it; (e) key element positions are identical during and after (no layout shift). Then open an early and a final frame with vision yourself.

8. When the browser_exec tool refuses a localhost URL

ajan' own browser-automation tool (new_tab/goto_url) rejects localhost/127.0.0.1/private-IP targets outright ("Blocked: URL targets a private or internal address") - this is a deliberate security restriction, not a misconfiguration; do not try to get around it by retrying, rephrasing the URL or pointing the tool elsewhere. The alternatives below are only for checking the user's OWN local app that you are building for them, within the task they approved. If an isolated Chrome DevTools CLI/MCP tool is installed in your setup, prefer it over the raw headless-flag approach below: it gives a real new_page/take_screenshot/evaluate_script loop against a long-lived isolated browser instead of a single static capture, so it isn't blind to interactivity the way a one-shot --screenshot flag is. Otherwise use a separate headless browser binary: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome --headless --disable-gpu --screenshot=/path/out.png --window-size=W,H --virtual-time-budget=MS http://localhost:PORT.

This fallback has its own real limit worth knowing up front: it does NOT reliably render WebGL/<canvas>-driven content (a physics-animated card, a shader background, a particle effect) even with a generous --virtual-time-budget - the screenshot comes back small and visually blank (static DOM/CSS content still renders fine; it is specifically the WebGL context that stays empty in this basic headless mode). Don't burn repeated attempts raising the budget hoping the canvas appears. One blank/suspiciously-small screenshot on a WebGL page is the signal to stop immediately, not retry with a different port/profile/flag - a second or third attempt (fresh port, --headless=new, a clean --user-data-dir) reliably returns the same blank result, since the cause is the headless GPU context, not server/profile state; each retry costs a full page-load wait for zero new information. For a trivial, low-risk change on a WebGL page (a numeric prop tweak, a single CSS value) where the diff is small enough to read and verify by eye in the source, skip the screenshot attempt entirely and say so - don't spend the verification budget on a check this environment cannot perform. For a page with WebGL content, verify what you actually can prove this way (build succeeds, static layout/text/images render, no visible breakage in the non-WebGL regions) and say explicitly that the WebGL element itself (the animation, the shader, the interactive card) needs the user's own browser or a real Playwright+GPU environment to confirm - do not present a blank or static-only screenshot as if it proved the animated element works.

Before reaching for this Chrome-headless fallback at all, check whether the coding agent already produced its own verification screenshots while implementing the feature - ask it (in the brief) to deliver those screenshots with its report, at a path it names. Do not search other agents' or profiles' private directories for them. A dispatched specialist worker that did real browser-based QA as part of its own loop typically has these; reading the delivered file with the vision tool is strictly better than re-driving a browser yourself, and for canvas/WebGL content (a p5.js game, a shader, a physics demo) it is the ONLY reliable way to visually verify from this environment at all, since the fallback above cannot render that content - finding and reusing the implementer's own screenshots isn't a shortcut here, it's the only path that actually works.

When the actual task was swapping one component for another (not tweaking a visible value), the strongest check this sandbox CAN do is grepping the production build output, not the dev server: npm run build then grep -c "<old-component-css-class>" dist/assets/index-*.js (expect 0, proves the old one was tree-shaken out of the main chunk) alongside grep "<new-component-distinctive-string, e.g. its color hex or a CSS class unique to it>" dist/assets/index-*.js (expect a hit). This proves the wiring actually compiled and shipped even though no screenshot can show the rendered pixels - state it exactly that way ("bundle confirms the swap compiled; pixel appearance needs your own look") rather than implying visual confirmation happened.

A vite preview server also blocks this path indirectly: proxying it (e.g. through tailscale serve) returns 403 by default because Vite's own Host-header allowlist rejects the proxy's Host, even with --host 0.0.0.0 on the preview process - fixing that needs a preview.allowedHosts entry in vite.config.js. For a one-off verification check, don't make that config change just to get a screenshot; it's scope creep on the actual task. Fall back to the bundle-grep check above instead.

9. Screenshotting content gated behind scroll-triggered (IntersectionObserver) animations

A --headless=new --screenshot=... --window-size=W,H full-page capture renders the DOM once at initial load and never scrolls, so any content that only becomes visible via a scroll-triggered animation library (Framer Motion whileInView, a custom IntersectionObserver reveal) stays at its initial hidden/opacity-0 state for the ENTIRE capture, even when the window height is set taller than the content - this produces a convincingly "successful" but blank/near-blank screenshot (small file size is the tell). Raising --virtual-time-budget does not fix it; the page needs an actual scroll event, not more wall-clock time.

Fix: drive the page over raw CDP instead of the static --screenshot flag. Launch headless Chrome with --remote-debugging-port=N --remote-allow-origins=* (the origin flag is required or the websocket handshake returns 403 even for a same-machine script), connect with Python's websocket-client, then in order: Page.enable → Emulation.setEmulatedMedia with prefers-reduced-motion: reduce (freezes scroll-reveal animations at their final visible state instead of mid-transition) → Page.navigate → wait for load → Runtime.evaluate to scroll (window.scrollTo(0, document.body.scrollHeight) or scroll the specific section into view) → wait briefly for the observer to fire → Page.captureScreenshot. This reliably reveals scroll-gated content that the static CLI flag cannot.

If the machine's physical display might be locked/asleep (an unattended or remote session), do not rely on opening a real browser window and using the OS-level screencapture command as a fallback - it silently returns a black image when the screen is locked, which looks like a valid file (nonzero size) until you actually inspect it. Go straight to the headless CDP route above.

10. requestAnimationFrame never fires in this automation sandbox

Across multiple unrelated pages/agents in this environment, requestAnimationFrame consistently never fires inside the headless/CDP-driven browser session (not a bug in the page's code - the same page works fine in a real browser). This silently breaks any verification that waits on an animation loop or a canvas/game's own draw()/update() tick to advance state.

Workaround that actually verifies real logic: instead of waiting for rAF, call the loop function directly and repeatedly via Runtime.evaluate/page.evaluate (e.g. a p5.js sketch's draw(), or any exposed update function), stepping it frame-by-frame in a loop, and assert on the resulting state after each manual step (position, score, game-over flag) rather than on visual appearance. This proved out real control input (dispatch a real keydown, then check keyIsDown(...) and the resulting state change), win/loss transitions, and restart logic without ever needing rAF to fire - treat animation smoothness/juice as something only the user's own browser can confirm, but treat state-machine correctness as fully verifiable this way.

11. A "modal that won't close" may be a library's own dev-mode overlay, not your page

When a user reports an unexpected box/dialog/panel blocking content and you cannot screenshot the live page yourself (localhost blocked, see §8), do not spend more than one round of blind CSS guessing on your own layout before asking for a screenshot - a mobile viewport bug and a library's own injected overlay look identical from a text description ("huge modal", "won't close") but need opposite fixes. Before assuming the bug is in code you wrote, grep node_modules for the exact visible heading text or for devtools/inspect/debug package names: many component frameworks (OpenUI, and others with a similar dev-tooling pattern) auto-mount their own floating debug/inspector widget in development builds only, controllable via an explicit enabled={false} prop on a manually-rendered instance of that widget (check the package's exported props - look for an enabled/disabled prop documented as "defaults to on outside production"). Fixing your own CSS will never remove a widget injected by a dependency.

Separately, for genuine mobile viewport-height bugs: prefer 100dvh over 100vh for any full-screen flex/app-shell container - 100vh on a mobile browser includes the area the address bar can cover, so portrait view (bar visible) clips content that landscape (bar auto-hidden) does not; this asymmetry is the signature ("works rotated, not upright"), not a flex/overflow bug. When a fixed-size sibling (e.g. a side panel capped at max-height: 45vh in a stacked mobile layout) competes with a flexible content pane, don't leave height: 100% on the flexible pane in the same breakpoint - it fights the flex algorithm for space already claimed by the sibling; use height: auto; flex: 1 1 0; min-height: 0 so it actually yields the space, and keep that pane's own overflow axis split (overflow-x: hidden to stop a 100vw-wide child from bleeding past the layout, overflow-y: auto so its own content, including a composer pinned at its bottom, stays reachable by scroll instead of being hard-clipped when space is tight).

12. Receiving a file from another device when Taildrop isn't set up

When the user needs to send a file (e.g. a downloaded installer) from a phone/another machine to this one and a messaging channel's size limit blocks it (e.g. Telegram's ~20MB bot upload cap), don't require Tailscale's native Taildrop CLI on the sending device - it may not be installed there. Instead, with the user's approval, start a tiny stdlib http.server-based upload receiver here (BaseHTTPRequestHandler.do_POST, write the body to the target folder, no dependencies) with these guards: bind it to 127.0.0.1 only and expose it to the tailnet with tailscale serve (never 0.0.0.0, never public); require a random one-time token in the URL path and reject requests without it; enforce a size limit; accept a single upload, then stop the server and remove the tailscale serve mapping as soon as the file arrives. Give the user this command to run on the OTHER device, filled in with the tailnet HTTPS address, the token and the real local filename:

curl -F "file=@<filename>" https://<this-device-tailnet-address>:<port>/<one-time-token>

This works from any OS with curl - no app install needed on the sending side. One gotcha: on Windows, a bare curl inside PowerShell is an alias for Invoke-WebRequest, which has no -F flag and fails with "A parameter cannot be found that matches parameter name 'F'" - tell a Windows user to call curl.exe explicitly (ships with modern Windows in System32) to reach the real curl binary and bypass the alias.

13. Port collisions across many dev servers

When agents/worktrees keep colliding on ports, read references/local-port-routing.md: named .localhost URLs via portless with its own Node 24, a no-sudo/no-trust-store setup, the six-step acceptance test (incl. HMR through the proxy), and how to review a tool comparison.

14. Brand-themed live demos

For an app that will be presented live in a client's brand look (class demo, pitch), read references/client-demo-apps.md: demo constraints that remove subsystems, brand-token extraction from the official CSS, OpenUI generative-UI wiring on your own endpoint (numbers computed in code, localized formats), presentation mode with recorded real answers and a first-chunk timeout, the three assistant modes, live-mode latency (per-request reasoning effort) and the "ask it anything" jury test, the phased deadline build including the "app-like on the phone" phase (top bar + full-screen hamburger, no bottom tab bar under a chat) and its mobile UX traps (scaled down to one phone size for demos that never ship), the redesign recipe (freeze v1 with a tag, research-first single direction, font-glyph and contrast checks), the assistant UX/motion review (streaming scroll anchor, indicator gap, slider throttle + fixed axis, motion tokens, focus), landing-page rules (real answer, real screenshots, no invented social proof), aligning the app with the team's written concept, and renaming/mascot work right before a demo (visible names first, storage keys untouched).

When the next phase depends on a running worker's branch, chain it in one background job instead of polling: wait on the worker PID, skip if its branch has no new commits, git merge --no-ff (on conflict git merge --abort and stop), commit the next brief, then launch the next worker; notify=true reports the outcome.

Run independent features (a new page, a latency fix) in parallel worktrees, one worker each; the coordinator merges them into main, rebuilds, re-measures and restarts the user's test server itself.

15. UX gate before showing a UI to the user

Never present a new or redesigned UI (screens, a demo, a mixed design) to the user straight from the implementing worker. Run an independent UX review first: a separate reviewer (a delegate_task child loading dogfood, not the worker that built it, since self-review misses its own blind spots) uses the running production build in a real browser at the target viewport and writes a P0/P1/P2 report with screenshots and smallest fixes. Fix the P0s, verify yourself, then send screenshots plus a short recording; the user's own detailed feedback comes after that, as a separate round. Brief and report shape: references/client-demo-apps.md section 5.

Gradio-specific quirks

See references/gradio-quirks.md for: track_tqdm leaking raw library progress text into the UI, and the manual-ticker pattern for a clean estimated-progress bar instead.

WEB VE GELİŞTİRME

İlişkili skill'ler

dogfood

Web uygulamalarında keşif odaklı QA yapar, hata, kanıt ve rapor üretir.

Uyarlandı2 ÖRNEK

headless-cdp-qa

browser_exec ekran görüntüleri zaman aşımına uğradığında standart kütüphaneyle CDP QA yapar.

HamaratLabs2 ÖRNEK

taslak-secenek-png

2-3 statik arayüz taslağını PNG olarak teslim eder ve QA yapar.

HamaratLabs2 ÖRNEK

wingwire-ux-mock-analiz

WingWire UX analizi yapar ve hızlı render edilen HTML maketler üretir.

HamaratLabs1 ÖRNEK