Agent skill · Data & Analytics

api-tier-architecture

3-tier API architecture (Convex WebSocket, SSE, REST) for cross-platform data fetching. Platform detection, hybrid hooks, DAL layer patterns. Triggers on "API", "tier", "Convex", "REST", "SSE", "useConvexQuery", "useQuery", "withAuth", "DAL".

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill api-tier-architecture --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 12 KB
Bundled scripts: none
Path: skills/api/api-tier-architecture/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# API Tier Architecture Three-tier API architecture for web (real-time) and mobile (battery-optimized) platforms. ## Architecture Overview **Tier 1 (Web Desktop):** Convex WebSocket - Real-time bidirectional subscription **Tier 2 (Mobile):** SSE - Server-Sent Events with polling (battery-optimized) **Tier 3 (Mobile Fallback):** REST - Standard HTTP polling All tiers authenticated via `withAuth` middleware, data accessed via DAL layer. ## Platform Detection ```typescript // From apps/web/src/lib/utils/platform.ts export function shouldUseConvex(): boolean { return getDataFetchingStrategy() === "convex"; } export function shouldUseSSE(): boolean { return getDataFetchingStrategy() === "sse"; } // Detection hierarchy: // 1. User-agent (iPhone, Android, mobile browsers) // 2. Viewport width (< 768px) // 3. Touch capability ``` **Manual override for testing:** ```typescript localStorage.setItem("blah_data_strategy", "convex"); // or "sse" or "polling" ``` ## Hybrid Hook Pattern All data hooks use hybrid pattern: Convex for web, React Query for mobile. ```typescript // From apps/web/src/lib/hooks/queries/useConversations.ts export function useConversations(options: UseConversationsOptions

What's inside
Steps it walks through
  1. Architecture Overview
  2. Platform Detection
  3. Hybrid Hook Pattern
  4. DAL Layer (Data Access Layer)
  5. REST API Routes (Tier 3)
  6. SSE Routes (Tier 2)
  7. withAuth Middleware
  8. Tier Selection Criteria
  9. Key Files
  10. Common Patterns
  11. Avoid
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the api-tier-architecture skill do?

3-tier API architecture (Convex WebSocket, SSE, REST) for cross-platform data fetching. Platform detection, hybrid hooks, DAL layer patterns. Triggers on "API", "tier", "Convex", "REST", "SSE", "useConvexQuery", "useQuery", "withAuth", "DAL".

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill api-tier-architecture --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going