api
USE WHEN: Defining HTTP requests, endpoints, and handling API responses.
Install / Use
npx skills add omergulcicek/omergulcicek.comInstalls into whichever agent you are using.
Cursor Rules
Cursor IDE rules (v2)
Quality Score
Category
Development & EngineeringSupported Platforms
Tags
Skill content
View source on GitHubdescription: "USE WHEN: Defining HTTP requests, endpoints, and handling API responses." globs: "src/lib/api.ts,src/features/**/api/*.{ts,tsx}" alwaysApply: false
API Layer
Constraints
- Location: Place all HTTP calls under
features/[feature]/api. - Validation: Use Zod for input/output validation when data is external or untrusted. Parse responses before they reach UI or state.
- Return Type: Return typed data, not raw responses.
- Error Handling: Normalize all API errors to a consistent
AppErrorformat (code,message) before throwing. - Config: Load
baseURLfrom env. Use a singleaxiosinstance (src/lib/api.ts). - Interceptors: Handle cross-cutting concerns (auth, headers) via interceptors.
- Naming:
verb-entity.api.ts(e.g.,get-users.api.ts). Function:getUsers. - SSR Safety: Use only whitelisted internal URLs or absolute paths for server-to-server calls to prevent SSRF.
Bans
- Raw Exposure: Forbidden to use
fetch/axiosor raw API data inside UI components, hooks, or state without validation. - Logic Leaks: Forbidden to leak internal error stack traces or raw axios/fetch errors to the client.
- Security: Forbidden to construct dynamic URLs using unsanitized user inputs.
- Architecture: No
axios.createinside features, no cross-feature API imports, no hardcoded endpoint strings in queries.
Correct Implementation
<example> ```ts export const getUsers = async (): Promise<User[]> => { const { data } = await api.get("/users"); return UserSchema.array().parse(data); }; ``` </example>Incorrect Implementation
<incorrect-example> ```tsx useEffect(() => { axios.get("/users"); }, []); ``` </incorrect-example>Related Skills
momen-cursurrules-prompt-file
40.6kCursor rules for building custom frontends with Momen.app as headless BaaS with GraphQL API, actionflows, AI agents, and Stripe integration.
semiotic-react-dataviz-cursorrules-prompt-file
40.6kCursor rules for Semiotic data visualization library with 30+ chart types, MCP server, and AI-assisted chart generation.
Agent-Reach
73.9kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
67.1kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Security Score
Audited on Aug 18, 2026
