auth-db-billing

auth-db-billing is a skill for Claude Code, Codex from pinebasedev/svelteflare. It costs 172 tokens per session (2,903 once invoked), scanned A, original, MIT.

A backend development guide for the svelteflare monorepo, a repository containing multiple related applications, covering login, users, databases, and Stripe payments.

In plain words
What is it for?
Use it when adding protected routes, changing database tables or migrations, managing sessions, or implementing billing and subscription limits.
Why use it?
It shows where server-side logic belongs and how authentication, database access, subscriptions, and paid-feature checks fit together.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { widget } from '../db/schema';.

Good fit Use it when adding protected routes, changing database tables or migrations, managing sessions, or implementing billing and subscription limits.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/pinebasedev/svelteflare
agentmods
npx agentmods add skills/pinebasedev/svelteflare/auth-db-billing

Made for: Claude Code, Codex.

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 auth-db-billing

README.md
[![agentmods](https://agentmods.dev/badge/skills/pinebasedev/svelteflare/auth-db-billing/github.svg)](https://agentmods.dev/skills/pinebasedev/svelteflare/auth-db-billing)
Your own site
<a href="https://agentmods.dev/skills/pinebasedev/svelteflare/auth-db-billing"><img src="https://agentmods.dev/badge/skills/pinebasedev/svelteflare/auth-db-billing/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 auth-db-billing

Your own site · 80×15
<a href="https://agentmods.dev/skills/pinebasedev/svelteflare/auth-db-billing"><img src="https://agentmods.dev/badge/skills/pinebasedev/svelteflare/auth-db-billing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 172 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,903 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 pass 7 Sept 2026
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.00172 $0.02903
Opus 5.5 $0.00069 $0.01161
Sonnet 5.5 $0.00034 $0.00581
Haiku 4.5 $0.00017 $0.00290

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

Security

Grade A, and why

auth-db-billing 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 2mo 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.

.agents/skills/auth-db-billing/SKILL.md · 365 lines

How it starts

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

Auth / DB / Billing

Backend product systems for the svelteflare monorepo. All server logic lives in apps/api (Hono Worker). The SvelteKit app (apps/web) is a pure SPA with ssr = false — it has no +page.server.ts or hooks.server.ts. Every authenticated action, DB query, and billing operation goes through the Hono API.


Architecture quick-map

apps/api/src/
  auth.ts               ← Better Auth singleton factory (getAuth)
  db/
    schema.ts           ← Drizzle schema: app tables + re-exports auth-schema.ts
    auth-schema.ts      ← Better Auth tables, GENERATED (pnpm --filter @repo/api generate:auth)
    database.ts         ← DB singleton factory (getDb)
  middleware/
    auth.ts             ← authMiddleware — resolves session on every request
    authorization.ts    ← requireAuthenticated, requireEntitled
    subscription.ts     ← subscriptionMiddleware — resolves isEntitled
    rateLimit.ts        ← rate limits differ by subscription tier
  routes/
    index.ts            ← route groups (public / authenticated / admin)
    auth.ts             ← passes all /v1/auth/* to Better Auth handler

apps/web/src/lib/
  authClient.ts         ← Better Auth client (browser-side)
  api.ts                ← Hono RPC client (hc<AppType>)

Better Auth

How auth is initialized

getAuth(db, env) in apps/api/src/auth.ts is a singleton factory. It takes the Drizzle DB instance and Cloudflare env bindings. Never call betterAuth() directly in a route — always use getAuth.

Active plugins:

  • emailOTP — 6-digit OTP for email verification, 15-min expiry
  • @better-auth/stripe — creates Stripe customer on signup, manages subscriptions
  • Email/password (requires email verification before login)
  • Google OAuth (disableImplicitSignUp: true — must sign up first)

No org/role/team plugins are active. The current auth model is single-user with subscription tiers only.

Session access in Hono routes

authMiddleware runs on every request and sets these on the Hono context:

Read the full file on GitHub · 365 lines

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. 2mo ago Changed · -15 lines f87901cfc5ab
  2. 3mo ago First seen · 380 lines · 172 tokens per session scan A 10f4438d9d26

Subscribe to this mod's changes

auth-db-billing is a skill published in the GitHub repository pinebasedev/svelteflare (57 stars, last pushed 2mo ago), licensed MIT. It adds 172 tokens to every session and 2,903 once invoked, about $0.0007 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

auth-db-billing compared with skills from other repositories

auth-db-billing next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
auth-db-billingpinebasedev/svelteflareSkill572mo agoMITA172Claude Code, Codex
auth-setupfirtoz/cf-multiworker-starter-kitSkill121mo agononeA39Claude Code, Codex
binding-hono-clientfirtoz/cf-multiworker-starter-kitSkill121mo agononeA83Claude Code, Codex
durable-object-packagefirtoz/cf-multiworker-starter-kitSkill121mo agononeA86Claude Code, Codex
socka-realtimefirtoz/cf-multiworker-starter-kitSkill121mo agononeA73Claude Code, Codex
worker-rpc-turbofirtoz/cf-multiworker-starter-kitSkill121mo agononeA66Claude Code, Codex
web-alchemy-bindingsfirtoz/cf-multiworker-starter-kitSkill121mo agononeA60Claude Code, Codex