server-api

server-api is a skill for Claude Code from YuDefine/nuxt-supabase-starter. It costs 27 tokens per session (1,965 once invoked), scanned A, original, MIT.

Guidance for designing server-side API routes in a Nuxt application, including validation, permissions, database writes, and response formats.

In plain words
What is it for?
Use it when creating files in server/api, building endpoints with defineEventHandler, or defining request and response schemas.
Why use it?
It keeps sensitive write operations and business rules on the server instead of exposing them directly in the browser.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it when creating files in server/api, building endpoints with defineEventHandler, or defining request and response schemas.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yudefine/nuxt-supabase-starter/server-api
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add YuDefine/nuxt-supabase-starter --skill server-api
Clone the repo
git clone --depth 1 https://github.com/YuDefine/nuxt-supabase-starter

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for server-api

README.md
[![agentmods](https://agentmods.dev/badge/skills/yudefine/nuxt-supabase-starter/server-api/github.svg)](https://agentmods.dev/skills/yudefine/nuxt-supabase-starter/server-api)
Your own site
<a href="https://agentmods.dev/skills/yudefine/nuxt-supabase-starter/server-api"><img src="https://agentmods.dev/badge/skills/yudefine/nuxt-supabase-starter/server-api/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for server-api

Your own site · 80×15
<a href="https://agentmods.dev/skills/yudefine/nuxt-supabase-starter/server-api"><img src="https://agentmods.dev/badge/skills/yudefine/nuxt-supabase-starter/server-api.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,965 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 56
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00027 $0.01965
Opus 5.5 $0.00011 $0.00786
Sonnet 5.5 $0.00005 $0.00393
Haiku 4.5 $0.00003 $0.00197

Measured 11d ago against content hash bb4c26f80dff, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

server-api scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

template/.claude/skills/server-api/SKILL.md · 149 lines

How it starts

The opening of the file, as written. The whole thing — 149 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Server API 設計規範

依實際安裝的 Nuxt/DB/auth 模組選用。Supabase helper(requireRole、getSupabaseWithContext 等)是 consumer 自己實作的函式,使用前查其來源與授權行為。

Client 端寫入預設走 Server API

Client 端(app/ 目錄)的讀取路徑依 consumer manifest(canonical .clade/manifest.json;canonical 缺席的未遷移 consumer 讀 legacy .claude/hub.json)的 modules.auth 而定:

  • modules.auth 是 Supabase Auth(supabase-self-hosted)→ 預設只透過 useSupabaseClient<Database>() 執行 .select() 查詢。
  • modules.auth 是 nuxt-auth-utils / better-auth → Supabase 不簽 JWT,瀏覽器的 useSupabaseClient() 恆以 anon role 存取,登入與否都一樣 —— 要讓 client 讀得到就得把表開成 TO public,等於對任何持有 publishable key 的人公開。那些 auth stack 下 client 直讀不是預設:讀寫都走 /api/v1/*,client 端 Supabase 只留 Storage(bucket policy 獨立)。見 [[auth-data-path-consistency]] § Auth 策略與資料路徑的合法組合。

所有寫入操作預設必須透過 Server API(/api/v1/*):

// ❌ 預設不允許 — client 端直接寫入
const client = useSupabaseClient<Database>();
await client.from("posts").insert({ title: "Hello" });

// ✅ 正確 — 透過 Server API
await $fetch("/api/v1/posts", {
  method: "POST",
  body: { title: "Hello" },
});

Client 端寫入是架構例外,只有在 proposal / ADR 明確記錄並同時滿足下列條件時,才可在 client 使用 .insert() / .update() / .delete() / .upsert():

  • RLS policy 能完整表達 tenant / user scope 與所有授權規則
  • GRANT 只開必要 schema / table / operation,不給寬權限
  • 不需要 service_role、server-only secret、跨表 transaction、workflow transition、audit-chain、storage upload 或外部 API
  • 不涉及角色 / 權限、薪資、簽核、出勤、稽核、批次修復等敏感流程
  • 有 focused tests 驗證 allow path、deny path、tenant isolation 與 RLS 失敗時的 UI/錯誤處理

契約來源

新增 API 時,request/response schema 請定義在 shared/schemas/,並由同一個模組導出衍生型別。

  • shared/schemas/*.ts:Zod schema + 衍生型別
  • shared/types/*.ts:相容轉發或 UI/view-model 型別,不是新的 request/response 真相來源

選填欄位的 Null 慣例(Hard Rule)

接收 user input 的選填欄位 MUST 用 .nullish(),NEVER 只用 .optional()。

// ❌ 錯誤 — 只接受 string | undefined
const schema = z.object({
  return_notes: z.string().trim().max(500).optional(),
})
// Client 送 { return_notes: null } → 400 ZodError

Read the full file on GitHub · 149 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago Changed · -1 lines bb4c26f80dff
  2. 25d ago Changed · -21 lines b5e5217429d7
  3. 27d ago Changed · +1 lines be6b6ece0417
  4. 1mo ago Changed · -3 lines · -58 tokens per session e878cd7ebd30
  5. 1mo ago Changed · +59 lines · +34 tokens per session 9cb39005e427
  6. 1mo ago First seen · 114 lines · 51 tokens per session scan A ed4a0d9e1360

Subscribe to this mod's changes

server-api is a skill published in the GitHub repository YuDefine/nuxt-supabase-starter (44 stars, last pushed yesterday), licensed MIT. It adds 27 tokens to every session and 1,965 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

walkeros-create-destination

Use when creating a new walkerOS destination to send events to a vendor or API (GA4/gtag, Meta/Facebook Pixel, Mixpanel, Amplitude, a custom HTTP API, Measurement Protocol), web or server-side. Example-driven workflow: research the vendor SDK and define step examples before implementing the destination interface, env…

elbwalker/walkerOS · 77 tokens

walkeros-create-source

Use when creating a new walkerOS source to capture events (browser source, dataLayer interception, server/HTTP source, webhook receiver, event capture), web or server-side. Example-driven workflow: research the input format and define step examples before implementing the push interface, createTrigger, and env pattern.

elbwalker/walkerOS · 65 tokens

nw-fp-hexagonal-architecture

Hexagonal architecture patterns with pure core and side-effect shell for functional codebases.

nWave-ai/nWave · 24 tokens

springboot-tdd

Test-driven development for Spring Boot using JUnit 5, Mockito, MockMvc, Testcontainers, and JaCoCo. Use when adding features, fixing bugs, or refactoring.

loulanyue/awesome-claude-notes · 42 tokens

webiny-api-permissions

Schema-based permission system for API features. Use this skill when implementing authorization in use cases, defining permission schemas with createPermissionSchema, creating injectable permissions via createPermissionsAbstraction/createPermissionsFeature, checking read/write/delete/publish permissions, handling…

webiny/webiny-js · 78 tokens

nw-ddd-tactical

Tactical DDD — aggregate design rules, entities, value objects, domain events, repositories, domain services, and anti-pattern detection.

nWave-ai/nWave · 32 tokens