[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XC5K8A308YCDSS14FXV04N":3,"skill-same:01M6XC5K8A308YCDSS14FXV04N":78},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":30,"publishedAt":47,"linkOnly":48,"markdownContent":49,"markdownBody":50,"frontMatter":51,"refName":52,"commitSha":53,"skillDirectory":54,"forksCount":13,"repositoryHtmlUrl":55,"repositoryHomepageUrl":6,"ownerHtmlUrl":56,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":57,"install":58,"resources":71},"01M6XC5K8A308YCDSS14FXV04N","api-proxy-endpoint",null,"Create serverless API proxy endpoints that hide API keys and provide a unified backend for the dashboard frontend. Designed for Vercel deployment.","UF-gzj\u002Fopenspace-claude-evolution","UF-gzj","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F272393507?v=4","01M6XBCZB755P01VVYGQWPYZY3","01M6XBCZFJA5AREA17WGETA3FW",0,"MIT","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fapi-proxy-endpoint\u002FSKILL.md",[17,22,25],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000009","前端开发","SCENARIO","使用场景",{"categoryNo":23,"categoryName":24,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],"proxy","endpoint","api","api proxy endpoint","frontend","dashboard","deployment","create","vercel deployment","serverless","backend","vercel","endpoints","keys","for","api keys","2026-11-10 10:12:30",false,"---\nname: api-proxy-endpoint\ndescription: Create serverless API proxy endpoints that hide API keys and provide a unified backend for the dashboard frontend. Designed for Vercel deployment.\n---\n\n# API Proxy Endpoint Pattern\n\nExternal APIs often require API keys that must not be exposed in frontend code. Create serverless proxy endpoints that:\n- Hide API keys on the server side\n- Provide a unified `\u002Fapi\u002F*` namespace for the frontend\n- Handle CORS, rate limiting, and error wrapping\n\n## Endpoint Structure\n\nEach API endpoint is a file in the `api\u002F` directory:\n\n```\napi\u002F\n├── stocks.ts          # Stock market data proxy\n├── news.ts            # News API proxy\n├── calendar.ts        # Calendar events proxy\n└── _cors.ts           # Shared CORS helper\n```\n\n## CORS Helper\n\n```typescript\n\u002F\u002F api\u002F_cors.ts\nexport function corsHeaders() {\n  return {\n    'Access-Control-Allow-Origin': '*',\n    'Access-Control-Allow-Methods': 'GET, OPTIONS',\n    'Access-Control-Allow-Headers': 'Content-Type',\n  };\n}\n\nexport function handleCors(req: Request): Response | null {\n  if (req.method === 'OPTIONS') {\n    return new Response(null, { status: 204, headers: corsHeaders() });\n  }\n  return null;\n}\n```\n\n## Example: Stock Proxy Endpoint\n\n```typescript\n\u002F\u002F api\u002Fstocks.ts\nimport type { VercelRequest, VercelResponse } from '@vercel\u002Fnode';\n\nexport default async function handler(req: VercelRequest, res: VercelResponse) {\n  \u002F\u002F CORS\n  res.setHeader('Access-Control-Allow-Origin', '*');\n  if (req.method === 'OPTIONS') return res.status(204).end();\n\n  const symbols = (req.query.symbols as string || '').split(',').filter(Boolean);\n  if (symbols.length === 0) {\n    return res.status(400).json({ error: 'Missing symbols parameter' });\n  }\n\n  const apiKey = process.env.FINNHUB_API_KEY;\n  if (!apiKey) {\n    return res.status(500).json({ error: 'API key not configured' });\n  }\n\n  try {\n    const quotes = await Promise.all(\n      symbols.map(async (sym) => {\n        const resp = await fetch(\n          `https:\u002F\u002Ffinnhub.io\u002Fapi\u002Fv1\u002Fquote?symbol=${sym}&token=${apiKey}`\n        );\n        if (!resp.ok) throw new Error(`Finnhub ${resp.status}`);\n        const data = await resp.json();\n        return {\n          symbol: sym,\n          price: data.c,       \u002F\u002F current price\n          change: data.dp,     \u002F\u002F percent change\n          high: data.h,\n          low: data.l,\n          open: data.o,\n          prevClose: data.pc,\n        };\n      })\n    );\n    res.setHeader('Cache-Control', 's-maxage=30, stale-while-revalidate=60');\n    return res.json({ quotes });\n  } catch (err) {\n    console.error('Stock API error:', err);\n    return res.status(502).json({ error: 'Upstream API failed' });\n  }\n}\n```\n\n## Example: News Proxy Endpoint\n\n```typescript\n\u002F\u002F api\u002Fnews.ts\nimport type { VercelRequest, VercelResponse } from '@vercel\u002Fnode';\n\nexport default async function handler(req: VercelRequest, res: VercelResponse) {\n  res.setHeader('Access-Control-Allow-Origin', '*');\n  if (req.method === 'OPTIONS') return res.status(204).end();\n\n  const apiKey = process.env.NEWS_API_KEY;\n  if (!apiKey) return res.status(500).json({ error: 'API key not configured' });\n\n  const query = req.query.q as string || '';\n  const category = req.query.category as string || 'general';\n  const lang = req.query.lang as string || 'en';\n\n  try {\n    const url = query\n      ? `https:\u002F\u002Fgnews.io\u002Fapi\u002Fv4\u002Fsearch?q=${encodeURIComponent(query)}&lang=${lang}&max=20&token=${apiKey}`\n      : `https:\u002F\u002Fgnews.io\u002Fapi\u002Fv4\u002Ftop-headlines?category=${category}&lang=${lang}&max=20&token=${apiKey}`;\n\n    const resp = await fetch(url);\n    if (!resp.ok) throw new Error(`GNews ${resp.status}`);\n    const data = await resp.json();\n\n    res.setHeader('Cache-Control', 's-maxage=120, stale-while-revalidate=300');\n    return res.json({\n      articles: (data.articles || []).map((a: any) => ({\n        title: a.title,\n        description: a.description,\n        url: a.url,\n        source: a.source?.name || '',\n        publishedAt: a.publishedAt,\n        image: a.image,\n      })),\n    });\n  } catch (err) {\n    console.error('News API error:', err);\n    return res.status(502).json({ error: 'Upstream API failed' });\n  }\n}\n```\n\n## Key Patterns\n\n1. **One file per API domain** in the `api\u002F` directory\n2. **Always set CORS headers** — frontend runs on different origin during dev\n3. **Environment variables** for API keys (`process.env.FINNHUB_API_KEY`)\n4. **Cache-Control headers** for edge caching (Vercel CDN)\n5. **Error wrapping** — return structured JSON errors, never raw upstream errors\n6. **Input validation** — validate query parameters before calling upstream\n7. **Typed responses** — keep response shapes consistent for frontend consumption\n\n## Local Development\n\nDuring `vite dev`, configure a proxy in `vite.config.ts`:\n\n```typescript\nexport default defineConfig({\n  server: {\n    proxy: {\n      '\u002Fapi': {\n        target: 'http:\u002F\u002Flocalhost:3000',\n        changeOrigin: true,\n      },\n    },\n  },\n});\n```\n\nOr use `vercel dev` to run serverless functions locally.\n\n","# API Proxy Endpoint Pattern\n\nExternal APIs often require API keys that must not be exposed in frontend code. Create serverless proxy endpoints that:\n- Hide API keys on the server side\n- Provide a unified `\u002Fapi\u002F*` namespace for the frontend\n- Handle CORS, rate limiting, and error wrapping\n\n## Endpoint Structure\n\nEach API endpoint is a file in the `api\u002F` directory:\n\n```\napi\u002F\n├── stocks.ts          # Stock market data proxy\n├── news.ts            # News API proxy\n├── calendar.ts        # Calendar events proxy\n└── _cors.ts           # Shared CORS helper\n```\n\n## CORS Helper\n\n```typescript\n\u002F\u002F api\u002F_cors.ts\nexport function corsHeaders() {\n  return {\n    'Access-Control-Allow-Origin': '*',\n    'Access-Control-Allow-Methods': 'GET, OPTIONS',\n    'Access-Control-Allow-Headers': 'Content-Type',\n  };\n}\n\nexport function handleCors(req: Request): Response | null {\n  if (req.method === 'OPTIONS') {\n    return new Response(null, { status: 204, headers: corsHeaders() });\n  }\n  return null;\n}\n```\n\n## Example: Stock Proxy Endpoint\n\n```typescript\n\u002F\u002F api\u002Fstocks.ts\nimport type { VercelRequest, VercelResponse } from '@vercel\u002Fnode';\n\nexport default async function handler(req: VercelRequest, res: VercelResponse) {\n  \u002F\u002F CORS\n  res.setHeader('Access-Control-Allow-Origin', '*');\n  if (req.method === 'OPTIONS') return res.status(204).end();\n\n  const symbols = (req.query.symbols as string || '').split(',').filter(Boolean);\n  if (symbols.length === 0) {\n    return res.status(400).json({ error: 'Missing symbols parameter' });\n  }\n\n  const apiKey = process.env.FINNHUB_API_KEY;\n  if (!apiKey) {\n    return res.status(500).json({ error: 'API key not configured' });\n  }\n\n  try {\n    const quotes = await Promise.all(\n      symbols.map(async (sym) => {\n        const resp = await fetch(\n          `https:\u002F\u002Ffinnhub.io\u002Fapi\u002Fv1\u002Fquote?symbol=${sym}&token=${apiKey}`\n        );\n        if (!resp.ok) throw new Error(`Finnhub ${resp.status}`);\n        const data = await resp.json();\n        return {\n          symbol: sym,\n          price: data.c,       \u002F\u002F current price\n          change: data.dp,     \u002F\u002F percent change\n          high: data.h,\n          low: data.l,\n          open: data.o,\n          prevClose: data.pc,\n        };\n      })\n    );\n    res.setHeader('Cache-Control', 's-maxage=30, stale-while-revalidate=60');\n    return res.json({ quotes });\n  } catch (err) {\n    console.error('Stock API error:', err);\n    return res.status(502).json({ error: 'Upstream API failed' });\n  }\n}\n```\n\n## Example: News Proxy Endpoint\n\n```typescript\n\u002F\u002F api\u002Fnews.ts\nimport type { VercelRequest, VercelResponse } from '@vercel\u002Fnode';\n\nexport default async function handler(req: VercelRequest, res: VercelResponse) {\n  res.setHeader('Access-Control-Allow-Origin', '*');\n  if (req.method === 'OPTIONS') return res.status(204).end();\n\n  const apiKey = process.env.NEWS_API_KEY;\n  if (!apiKey) return res.status(500).json({ error: 'API key not configured' });\n\n  const query = req.query.q as string || '';\n  const category = req.query.category as string || 'general';\n  const lang = req.query.lang as string || 'en';\n\n  try {\n    const url = query\n      ? `https:\u002F\u002Fgnews.io\u002Fapi\u002Fv4\u002Fsearch?q=${encodeURIComponent(query)}&lang=${lang}&max=20&token=${apiKey}`\n      : `https:\u002F\u002Fgnews.io\u002Fapi\u002Fv4\u002Ftop-headlines?category=${category}&lang=${lang}&max=20&token=${apiKey}`;\n\n    const resp = await fetch(url);\n    if (!resp.ok) throw new Error(`GNews ${resp.status}`);\n    const data = await resp.json();\n\n    res.setHeader('Cache-Control', 's-maxage=120, stale-while-revalidate=300');\n    return res.json({\n      articles: (data.articles || []).map((a: any) => ({\n        title: a.title,\n        description: a.description,\n        url: a.url,\n        source: a.source?.name || '',\n        publishedAt: a.publishedAt,\n        image: a.image,\n      })),\n    });\n  } catch (err) {\n    console.error('News API error:', err);\n    return res.status(502).json({ error: 'Upstream API failed' });\n  }\n}\n```\n\n## Key Patterns\n\n1. **One file per API domain** in the `api\u002F` directory\n2. **Always set CORS headers** — frontend runs on different origin during dev\n3. **Environment variables** for API keys (`process.env.FINNHUB_API_KEY`)\n4. **Cache-Control headers** for edge caching (Vercel CDN)\n5. **Error wrapping** — return structured JSON errors, never raw upstream errors\n6. **Input validation** — validate query parameters before calling upstream\n7. **Typed responses** — keep response shapes consistent for frontend consumption\n\n## Local Development\n\nDuring `vite dev`, configure a proxy in `vite.config.ts`:\n\n```typescript\nexport default defineConfig({\n  server: {\n    proxy: {\n      '\u002Fapi': {\n        target: 'http:\u002F\u002Flocalhost:3000',\n        changeOrigin: true,\n      },\n    },\n  },\n});\n```\n\nOr use `vercel dev` to run serverless functions locally.\n\n",{"name":5,"description":7},"main","0650921d63895de3997bc81f1ff1d0ac67032072","showcase\u002Fskills\u002Fapi-proxy-endpoint","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution","https:\u002F\u002Fgithub.com\u002FUF-gzj","2026-04-16 09:31:03",{"source":8,"skillName":5,"commands":59,"prompt":69,"zipAvailable":70},[60,63,66],{"tool":61,"command":62},"npx","npx skills add UF-gzj\u002Fopenspace-claude-evolution --skill api-proxy-endpoint",{"tool":64,"command":65},"bunx","bunx skills add UF-gzj\u002Fopenspace-claude-evolution --skill api-proxy-endpoint",{"tool":67,"command":68},"pnpm","pnpm dlx skills add UF-gzj\u002Fopenspace-claude-evolution --skill api-proxy-endpoint","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fapi-proxy-endpoint\u002FSKILL.md",true,[72],{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},".skill_id","OTHER","其他",33,"https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fapi-proxy-endpoint\u002F.skill_id",[79,103,120,129,155,171],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":47},"01M6XCCXD3NCM2YKR3WNGBASPC","write-special-chars-ts-check","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) using a Python heredoc script, plus a reliable TypeScript type-checking step that filters output to only the newly-written files to avoid being misled by pre-existing errors.","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-ts-check\u002FSKILL.md",[],[86,87,88,89,90,91,92,93,45,94,95,96,97,98,99,100,101,102],"check","write","write special chars ts check","typescript","filters","characters","Existing","type-checking","errors","script","output","type","files","only","template","file","python",{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":47},"01M6XCCT7E3J922Q345PBGSHPN","write-special-chars-readback","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) using a Python heredoc script, with mandatory post-write verification via read_file and cleanup of \u002Ftmp helper scripts.","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-readback\u002FSKILL.md",[],[110,111,87,101,112,102,113,114,115,116,117,100,118,119,91,45,95],"readback","write special chars readback","helper","post","via","scripts","cleanup","read","verification","with",{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":47},"01M6XCCMQX1R8B6FECWB3P63T7","write-special-chars-heredoc","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) by using a Python heredoc script executed via shell.","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-heredoc\u002FSKILL.md",[],[127,87,91,128,95,114,100,101,102,45],"write special chars heredoc","shell",{"skillNo":130,"name":131,"nameZh":6,"description":132,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":138,"publishedAt":47},"01M6XCCG41M994JJEX6VN52PEP","worldmonitor-reference","Curated architecture index of the WorldMonitor open-source dashboard. Reference for extracting patterns — vanilla TypeScript, Panel class hierarchy, service layer, CSS grid, API edge functions, refresh scheduler, and 60+ data source integrations.","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fworldmonitor-reference\u002FSKILL.md",[135],{"categoryNo":136,"categoryName":137,"taxonomyType":28,"taxonomyTypeDesc":29},"01JBSEEDCAT000000000000033","数据分析师",[139,140,141,142,36,89,143,144,145,146,147,45,148,149,150,151,152,153,33,154],"reference","worldmonitor","worldmonitor reference","architecture","css","scheduler","layer","hierarchy","source","extracting","panel","patterns","edge functions","integrations","open","data",{"skillNo":156,"name":157,"nameZh":6,"description":158,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":159,"categories":160,"keywords":161,"publishedAt":47},"01M6XCCCHWNKG2W4VH9E6A10HF","virtual-list","Implement efficient virtual scrolling for rendering large lists with DOM recycling, chunk-based rendering, and performance optimizations","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fvirtual-list\u002FSKILL.md",[],[162,163,164,165,45,166,119,167,168,169,170],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":172,"name":173,"nameZh":6,"description":174,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":175,"categories":176,"keywords":177,"publishedAt":47},"01M6XCC7X8PKMR2DEW91XGHYSV","verify-directory-structure","Diagnose and resolve file access issues by first verifying the directory structure.","https:\u002F\u002Fgithub.com\u002FUF-gzj\u002Fopenspace-claude-evolution\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fverify-directory-structure\u002FSKILL.md",[],[178,179,180,181,182,183,101,184,185,186],"directory","verify directory structure","structure","verify","access","first","issues","diagnose","file access"]