

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
12345## Hoist Static I/O to Module Level67**Impact: HIGH (avoids repeated file/network I/O per request)**89When loading static assets (fonts, logos, images, config files) in route handlers or server functions, hoist the I/O operation to module level. Module-level code runs once when the module is first imported, not on every request. This eliminates redundant file system reads or network fetches that would otherwise run on every invocation.1011**Incorrect (reads font file on every request):**1213```typescript14// app/api/og/route.tsx15import { ImageResponse } from 'next/og'1617export async function GET(request: Request) {18 // Runs on EVERY request - expensive!19 const fontData = await fetch(20 new URL('./fonts/Inter.ttf', import.meta.url)21 ).then(res => res.arrayBuffer())2223 const logoData = await fetch(24 new URL('./images/logo.png', import.meta.url)25 ).then(res => res.arrayBuffer())2627 return new ImageResponse(28 <div style={{ fontFamily: 'Inter' }}>29 <img src={logoData} />30 Hello World31 </div>,32 { fonts: [{ name: 'Inter', data: fontData }] }33 )34}35```3637**Correct (loads once at module initialization):**3839```typescript40// app/api/og/route.tsx41import { ImageResponse } from 'next/og'4243// Module-level: runs ONCE when module is first imported44const fontData = fetch(45 new URL('./fonts/Inter.ttf', import.meta.url)46).then(res => res.arrayBuffer())4748const logoData = fetch(49 new URL('./images/logo.png', import.meta.url)50).then(res => res.arrayBuffer())5152export async function GET(request: Request) {53 // Await the already-started promises54 const [font, logo] = await Promise.all([fontData, logoData])5556 return new ImageResponse(57 <div style={{ fontFamily: 'Inter' }}>58 <img src={logo} />59 Hello World60 </div>,61 { fonts: [{ name: 'Inter', data: font }] }62 )63}64```6566**Correct (synchronous fs at module level):**6768```typescript69// app/api/og/route.tsx70import { ImageResponse } from 'next/og'71import { readFileSync } from 'fs'72import { join } from 'path'7374// Synchronous read at module level - blocks only during module init75const fontData = readFileSync(76 join(process.cwd(), 'public/fonts/Inter.ttf')77)7879const logoData = readFileSync(80 join(process.cwd(), 'public/images/logo.png')81)8283export async function GET(request: Request) {84 return new ImageResponse(85 <div style={{ fontFamily: 'Inter' }}>86 <img src={logoData} />87 Hello World88 </div>,89 { fonts: [{ name: 'Inter', data: fontData }] }90 )91}92```9394**Incorrect (reads config on every call):**9596```typescript97import fs from 'node:fs/promises'9899export async function processRequest(data: Data) {100 const config = JSON.parse(101 await fs.readFile('./config.json', 'utf-8')102 )103 const template = await fs.readFile('./template.html', 'utf-8')104105 return render(template, data, config)106}107```108109**Correct (hoists config and template to module level):**110111```typescript112import fs from 'node:fs/promises'113114const configPromise = fs115 .readFile('./config.json', 'utf-8')116 .then(JSON.parse)117const templatePromise = fs.readFile('./template.html', 'utf-8')118119export async function processRequest(data: Data) {120 const [config, template] = await Promise.all([121 configPromise,122 templatePromise,123 ])124125 return render(template, data, config)126}127```128129When to use this pattern:130131- Loading fonts for OG image generation132- Loading static logos, icons, or watermarks133- Reading configuration files that don't change at runtime134- Loading email templates or other static templates135- Any static asset that's the same across all requests136137When not to use this pattern:138139- Assets that vary per request or user140- Files that may change during runtime (use caching with TTL instead)141- Large files that would consume too much memory if kept loaded142- Sensitive data that shouldn't persist in memory143144With Vercel's [Fluid Compute](https://vercel.com/docs/fluid-compute), module-level caching is especially effective because multiple concurrent requests share the same function instance. The static assets stay loaded in memory across requests without cold start penalties.145146In traditional serverless, each cold start re-executes module-level code, but subsequent warm invocations reuse the loaded assets until the instance is recycled.147
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| nota-america/forgecat-agent-profilesprofiles/addyosmani/agent-skills/for-cursor/.cursor/rules/cmd-build.mdc · 51 | Cursor rules | no sections | 16/100 | today | |
| nota-america/forgecat-agent-profilesprofiles/addyosmani/agent-skills/for-cursor/.cursor/rules/cmd-code-simplify.mdc · 51 | Cursor rules | testing-strategy | 30/100 | today | |
| nota-america/forgecat-agent-profilesprofiles/addyosmani/agent-skills/for-cursor/.cursor/rules/cmd-plan.mdc · 51 | Cursor rules | no sections | 16/100 | today | |
| nota-america/forgecat-agent-profilesprofiles/addyosmani/agent-skills/for-cursor/.cursor/rules/cmd-review.mdc · 51 | Cursor rules | no sections | 16/100 | today | |
| nota-america/forgecat-agent-profilesprofiles/addyosmani/agent-skills/for-cursor/.cursor/rules/cmd-ship.mdc · 51 | Cursor rules | testing-strategygitdeploymentdo-not | 61/100 | today | |
| nota-america/forgecat-agent-profilesprofiles/addyosmani/agent-skills/for-cursor/.cursor/rules/cmd-spec.mdc · 51 | Cursor rules | no sections | 16/100 | today | |
| nota-america/forgecat-agent-profilesprofiles/addyosmani/agent-skills/for-cursor/.cursor/rules/cmd-test.mdc · 51 | Cursor rules | no sections | 16/100 | today | |
| nota-america/forgecat-agent-profilesprofiles/addyosmani/agent-skills/for-forgecat/AGENTS.md · 51 | AGENTS.md | lint-formatstylearchdo-not | 73/100 | today | |
| nota-america/forgecat-agent-profilesprofiles/addyosmani/agent-skills/for-forgecat/CLAUDE.md · 51 | CLAUDE.md | teststylearchagent-behaviour | 70/100 | today | |
| nota-america/forgecat-agent-profilesprofiles/anthropics/claude-code/anthropics_claude-code_ralph-wiggum/for-cursor/.cursor/rules/cmd-cancel-ralph.mdc · 51 | Cursor rules | no sections | 16/100 | today | |
| nota-america/forgecat-agent-profilesprofiles/anthropics/claude-code/anthropics_claude-code_ralph-wiggum/for-cursor/.cursor/rules/cmd-help.mdc · 51 | Cursor rules | no sections | 54/100 | today | |
| nota-america/forgecat-agent-profilesprofiles/anthropics/claude-code/anthropics_claude-code_ralph-wiggum/for-cursor/.cursor/rules/cmd-ralph-loop.mdc · 51 | Cursor rules | no sections | 22/100 | today | |
| nota-america/forgecat-agent-profilesprofiles/anthropics/claude-plugins-official/anthropics_claude-plugins-official_agent-sdk-dev/for-cursor/.cursor/rules/cmd-new-sdk-app.mdc · 51 | Cursor rules | setupstylearchdocs | 76/100 | today | |
| nota-america/forgecat-agent-profilesprofiles/anthropics/claude-plugins-official/anthropics_claude-plugins-official_claude-md-management/for-cursor/.cursor/rules/cmd-revise-claude-md.mdc · 51 | Cursor rules | agent-behaviour | 50/100 | today | |
| nota-america/forgecat-agent-profilesprofiles/anthropics/claude-plugins-official/anthropics_claude-plugins-official_code-review/for-cursor/.cursor/rules/cmd-code-review.mdc · 51 | Cursor rules | testing-strategygit | 35/100 | today | |
| nota-america/forgecat-agent-profilesprofiles/anthropics/claude-plugins-official/anthropics_claude-plugins-official_commit-commands/for-cursor/.cursor/rules/cmd-clean_gone.mdc · 51 | Cursor rules | no sections | 60/100 | today | |
| nota-america/forgecat-agent-profilesprofiles/anthropics/claude-plugins-official/anthropics_claude-plugins-official_commit-commands/for-cursor/.cursor/rules/cmd-commit-push-pr.mdc · 51 | Cursor rules | stylegit | 44/100 | today | |
| nota-america/forgecat-agent-profilesprofiles/anthropics/claude-plugins-official/anthropics_claude-plugins-official_commit-commands/for-cursor/.cursor/rules/cmd-commit.mdc · 51 | Cursor rules | style | 44/100 | today | |
| nota-america/forgecat-agent-profilesprofiles/anthropics/claude-plugins-official/anthropics_claude-plugins-official_example-plugin/for-cursor/.cursor/rules/cmd-example-command.mdc · 51 | Cursor rules | lint-formatstyleagent-behaviour | 58/100 | today | |
| nota-america/forgecat-agent-profilesprofiles/anthropics/claude-plugins-official/anthropics_claude-plugins-official_feature-dev/for-cursor/.cursor/rules/cmd-feature-dev.mdc · 51 | Cursor rules | stylearchgit | 56/100 | today |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 14 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 46 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 14 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 14 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 14 days ago | |
| bybren-llc/safe-agentic-workflow.cursor/rules/10-backend-python.mdc · 399 | Cursor rules | testlint-formatstylegit+4 | 97/100 | today |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/nota-america-forgecat-agent-profiles-profiles-vercel-labs-agent-skills-vercel-labs-agent-skills-react-best-practices-for-cursor-cursor-rules-rule-server-hoist-static-io)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.