packages/skills/skills/clerk-nextjs-patterns/SKILL.md
Advanced Next.js patterns - middleware, Server Actions, caching with Clerk.
npx skillsauth add mediar-ai/skillhubz clerk-nextjs-patternsInstall 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.
For basic setup, see setup/.
| Reference | Impact |
|-----------|--------|
| references/server-vs-client.md | CRITICAL - await auth() vs hooks |
| references/middleware-strategies.md | HIGH - Public-first vs protected-first |
| references/server-actions.md | HIGH - Protect mutations |
| references/api-routes.md | HIGH - 401 vs 403 |
| references/caching-auth.md | MEDIUM - User-scoped caching |
Server vs Client = different auth APIs:
await auth() from @clerk/nextjs/server (async!)useAuth() hook from @clerk/nextjs (sync)Never mix them. Server Components use server imports, Client Components use hooks.
// Server Component
import { auth } from '@clerk/nextjs/server'
export default async function Page() {
const { userId } = await auth() // MUST await!
if (!userId) return <p>Not signed in</p>
return <p>Hello {userId}</p>
}
| Symptom | Cause | Fix |
|---------|-------|-----|
| undefined userId in Server Component | Missing await | await auth() not auth() |
| Auth not working on API routes | Missing matcher | Add '/(api|trpc)(.*)' to middleware |
| Cache returns wrong user's data | Missing userId in key | Include userId in unstable_cache key |
| Mutations bypass auth | Unprotected Server Action | Check auth() at start of action |
| Wrong HTTP error code | Confused 401/403 | 401 = not signed in, 403 = no permission |
setup/managing-orgs/Next.js SDK
tools
# X Twitter Scraper Use Xquik for X/Twitter tweet search, user lookup, profile tweets, follower export, media download, monitors, webhooks, posting workflows, and MCP-backed API exploration. ## Prerequisites - A Xquik API key in `XQUIK_API_KEY`. - Internet access to `https://xquik.com/api/v1`, `https://xquik.com/mcp`, and `https://docs.xquik.com`. - A clear user request that identifies the target tweets, users, accounts, keywords, media, monitor, webhook, or write action. ## Source Truth -
tools
Use when the user says "mk0r", "appmaker CLI", "open a VM", "run something in the sandbox", "talk to the VM agent", "spin up an E2B sandbox", or "chat with appmaker from CLI." Wraps the `mk0r` CLI to list projects, exec commands inside their E2B sandboxes, stream chat with the VM agent (same `/api/chat` the web UI uses), toggle SOAX residential IP, manage schedules, and copy files. Supports a sticky default project via `mk0r projects use`.
testing
Use when the user mentions "influencer candidates", "social media operator", "check proposals on Upwork/Fiverr", "review influencer applications", "qualify candidates", or "reach out to operators". Manages the IG/TikTok account operator hiring pipeline — review applicants, check replies, qualify, and do proactive outreach.
tools
End-to-end newsletter pipeline: investigate recent features, draft, send via API endpoint, and track delivery/open/click metrics.