plugins/smedjen/skills/expo-api-routes/SKILL.md
API routes in Expo Router — server functions, request handling, middleware, and type-safe endpoints
npx skillsauth add hjemmesidekongen/ai expo-api-routesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Expo Router supports API routes via +api.ts files — server-only handlers running in Node.js, not in the React Native runtime. They enable full-stack Expo without a separate backend.
app/
api/
users+api.ts # /api/users
users/[id]+api.ts # /api/users/:id
Export named functions per HTTP method using ExpoRequest / ExpoResponse from expo-router/server:
import { ExpoRequest, ExpoResponse } from 'expo-router/server';
export async function GET(request: ExpoRequest): Promise<ExpoResponse> {
const users = await db.user.findMany();
return ExpoResponse.json(users);
}
export async function POST(request: ExpoRequest): Promise<ExpoResponse> {
const body = await request.json();
const user = await db.user.create({ data: body });
return ExpoResponse.json(user, { status: 201 });
}
Authorization: Bearer headers — cookies aren't reliable in RN clients.See references/process.md for dynamic segments, middleware, auth, database access, type sharing, error handling, deployment, and anti-patterns.
development
Creates a brand from scratch through market research and interactive sparring. Runs competitive research via Perplexity, then guides the user through positioning, audience, voice, values, and content pillars. Produces the full brand guideline set at .ai/brand/{name}/. Use when building a new brand, defining brand strategy for a product, or when /våbenskjold:create is invoked.
testing
Loads brand guidelines from .ai/brand/{name}/ and makes them available to the current context. Progressive disclosure: L1 confirms brand exists, L2 loads summary, L3 loads specific files on demand. Use when a downstream skill or user needs brand context, or when /våbenskjold:apply is invoked.
documentation
Guided reinvention of an existing brand guideline. Loads current brand from .ai/brand/{name}/, identifies what to keep vs change, and walks the user through targeted evolution. Preserves brand equity while updating positioning, voice, or values. Use when refreshing a brand or when /våbenskjold:evolve is invoked.
development
Codifies an existing brand from materials, samples, and references. Analyzes provided content to extract voice patterns, values, and positioning. Produces the same guideline format as brand-strategy. Use when a brand already exists but isn't documented, or when /våbenskjold:audit is invoked.