winning-web-speed-hackathon
Skill2 starsChanged 8 months agoMITView on GitHub
Optimizes deliberately slow web applications for maximum Lighthouse scores in Web Speed Hackathon (CyberAgent). Use when participating in WSH or performing aggressive frontend performance optimization on React/Node.js apps with SQLite backends. Covers bundle reduction, image optimization, Core Web Vitals, server tuning, and known competition traps.
In this repository29 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- building-lit-componentsSkill
- building-static-site-rss-feedsSkill
- building-templ-componentsSkill
- checking-wsh-vrtSkill
- committing-codeSkill
- creating-agent-skillsSkill
- creating-test-casesSkill
- deploying-with-isucon-ansibleSkill
- designing-isucon-architectureSkill
- frontend-designSkill
- operating-isucon-servers-via-sshSkill
- planning-wsh-improvementsSkill
- porting-isucon-rust-to-goSkill
- releasing-zig-with-goreleaserSkill
- running-isucon-as-an-agentSkill
- sharing-sockets-with-so-reuseport-in-zigSkill
- tuning-isucon-linux-and-nginxSkill
- using-go-tool-directiveSkill
- using-grafana-mcpSkill
- using-unocss-with-templSkill
- winning-isuconSkill
- writing-feature-specSkill
- writing-implementation-tasksSkill
- writing-isucon-arch-subagent-tasksSkill
- writing-project-constitutionSkill
- writing-technical-designSkill
- writing-zig-cli-toolsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 6 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 42
Fix build mode: Ensure NODE_ENV=production and bundler mode: 'production'
- Very specific: line 43
Remove source maps: Delete devtool: 'inline-source-map' or similar
- Distinctive: line 44
Kill bloated dependencies: Check for and remove/replace:
- Very specific: line 49
Enable tree shaking: Remove @babel/plugin-transform-modules-commonjs
- Distinctive: line 52
Minify everything: Ensure terser/esbuild minification is active
- Very specific: line 73
Remove artificial delays: Search for setTimeout, sleep, delay, jitter in server code
- Distinctive: line 74
Fix N+1 queries: Add JOINs or batch loading.
- Very specific: line 86
Fix CLS sources: Add aspect-ratio, explicit dimensions, font fallback metrics
- Distinctive: line 94
Fix ReDoS: Check regex patterns for catastrophic backtracking (email/password validators)
- Very specific: line 95
Break long tasks: Use scheduler.yield() or setTimeout(0) to yield to main thread
- Very specific: line 98
Replace heavy hover handlers: Use onMouseEnter/onMouseLeave instead of onMouseOver
- Distinctive: line 104
Move to Vite: If stuck with Webpack dev mode, migrate for better DX and build
- Distinctive: line 110
After every major change:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Winning Web Speed Hackathon
Systematic workflow to maximize Lighthouse scores in CyberAgent's Web Speed Hackathon. The competition provides a deliberately de-tuned React + Node.js app; your job is to optimize it while passing VRT and regulation checks.
Use this skill when participating in Web Speed Hackathon, or aggressively optimizing a React/Node.js web app for Lighthouse Performance scores.
Scoring Model
Lighthouse v10 Performance scoring weights per page:
- FCP x10 | SI x10 | LCP x25 | TBT x30 | CLS x25
User flow scoring: TBT x25 + INP x25
LCP and TBT dominate. Prioritize accordingly.
Phase 0: Reconnaissance (First 30 min)
- Clone and run the app locally. Confirm it builds and serves.
- Run Lighthouse locally on all scored pages. Record baseline scores.
- Analyze the bundle:
npx webpack-bundle-analyzer dist/stats.json # if webpack # or check build output sizes - Check Chrome DevTools:
- Network tab: Identify largest transfers, uncompressed assets, no-cache headers
- Coverage tab (Ctrl+Shift+P → "Coverage"): Find unused JS/CSS percentage
- Performance tab: Record page load, identify long tasks and layout shifts
- Scan for known traps — see WSH-KNOWN-TRAPS.md
- Read the regulation/checklist carefully. Know what you cannot break.
- Prioritize fixes by estimated score impact. Work top-down.
Phase 1: Build & Bundle (Highest Impact)
These fixes often yield 50-200+ point gains.
- Fix build mode: Ensure
NODE_ENV=productionand bundlermode: 'production' - Remove source maps: Delete
devtool: 'inline-source-map'or similar - Kill bloated dependencies: Check for and remove/replace:
@iconify/json,@ffmpeg/ffmpeg,zengin-code,moment-timezone→dayjslodash→ native JS orlodash-es(tree-shakeable)canvaskit-wasm,Three.js→ simple HTML/CSS/<img>- Full icon sets → only used icons
- Enable tree shaking: Remove
@babel/plugin-transform-modules-commonjs - Code split routes:
React.lazy()+<Suspense>per route - Target modern browsers: Set browserslist to
last 1 Chrome version - Minify everything: Ensure terser/esbuild minification is active
- Consider Preact: Drop-in replacement, ~3KB vs ~40KB for React
Details: BUNDLE-OPTIMIZATION.md
Phase 2: Images & Fonts (High Impact)
- Convert images to AVIF (best) or WebP. Use Sharp or ImageMagick.
- Resize to actual display dimensions (not 4000px originals)
- Convert animated GIFs to WebM/MP4
<video>elements - Add
loading="lazy"to below-fold images,fetchpriority="high"to LCP image - Add explicit
width/heightto all<img>(prevents CLS) - Subset fonts to used characters only (pyftsubset/glyphhanger)
- Add
font-display: swapand preload critical fonts
Details: IMAGE-AND-FONT-OPTIMIZATION.md
Phase 3: Network & Server (Medium-High Impact)
- Enable compression: gzip/Brotli middleware (e.g.,
@fastify/compress) - Set Cache-Control:
max-age=31536000, immutablefor hashed static assets - Remove artificial delays: Search for
setTimeout,sleep,delay,jitterin server code - Fix N+1 queries: Add JOINs or batch loading. Add DB indexes.
- Add resource hints:
<link rel="preconnect">,<link rel="preload">for critical assets - Remove
no-storecache headers on static resources - Parallelize API calls:
Promise.all()instead of sequential fetches
Details: NETWORK-AND-SERVER.md
Phase 4: CSS & Rendering (Medium Impact)
- Remove runtime CSS-in-JS: Replace UnoCSS runtime / styled-components with static CSS
- Extract critical CSS: Inline above-fold CSS in
<head> - Remove unused CSS: PurgeCSS or manual removal
- Fix CLS sources: Add
aspect-ratio, explicit dimensions, font fallback metrics - Defer non-critical CSS: Load below-fold styles asynchronously
- Add
deferto all non-critical<script>tags
Details: RENDERING-AND-CSS.md
Phase 5: Runtime & Interaction (For INP/TBT)
- Fix ReDoS: Check regex patterns for catastrophic backtracking (email/password validators)
- Break long tasks: Use
scheduler.yield()orsetTimeout(0)to yield to main thread - Optimize React renders:
React.memo,useMemofor expensive computations - Virtualize long lists:
react-windowor@tanstack/virtual - Replace heavy hover handlers: Use
onMouseEnter/onMouseLeaveinstead ofonMouseOver - Remove unnecessary animations: framer-motion, CSS transitions on layout properties
Phase 6: SSR & Advanced (If Time Permits)
- Implement SSR: Stream HTML with
renderToPipeableStreamfor instant FCP/LCP - Move to Vite: If stuck with Webpack dev mode, migrate for better DX and build
- Deploy static assets to CDN: Cloudflare Pages or similar
- Service Worker: Cache static assets for repeat visits (if required by rules)
Validation Loop
After every major change:
1. Build → verify no errors
2. Run Lighthouse locally on affected pages
3. Check VRT if available: npx playwright test
4. Compare scores to previous baseline
5. Commit working state before next optimizationNever skip VRT. Regulation violations = disqualification.
Time Management (31-hour competition)
| Hours | Focus | Expected Impact |
| 0-0.5 | Recon & analysis | Baseline established |
| 0.5-4 | Build/bundle fixes | +100-300 pts |
| 4-8 | Image/font optimization | +50-150 pts |
| 8-14 | Server/network/API | +30-100 pts |
| 14-20 | CSS/rendering/CLS | +20-80 pts |
| 20-26 | Runtime/INP/TBT polish | +10-50 pts |
| 26-30 | SSR/advanced if needed | +20-100 pts |
| 30-31 | Final VRT check & deploy | Safety margin |
Reference Files
- WSH Known Traps — Intentional performance pitfalls by year
- Bundle Optimization — Webpack/Vite config, dependency replacement
- Image & Font Optimization — Format conversion, lazy loading, subsetting
- Network & Server — Compression, caching, DB, API optimization
- Rendering & CSS — Critical CSS, CLS, runtime CSS-in-JS removal
- Scoring Reference — Historical scoring formulas and thresholds
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

