factory-auth-wiring-specialist

factory-auth-wiring-specialist is a skill for Claude Code from nonlinear-xyz/factory-kit. It costs 138 tokens per session (1,610 once invoked), scanned A, original, MIT.

An authentication setup helper for adding sign-in, roles, organizations, or a new authentication provider to an application. It uses a common interface for checking signed-in users, roles, and organization context.

In plain words
What is it for?
Use it when starting authentication, changing providers, or adding organization and role features. It helps wire protected procedures and shared authentication wrappers into the project.
Why use it?
It helps keep authentication decisions and authorization checks consistent across the application. It also guides the choice between Better Auth, Supabase Auth, and Clerk based on the project's needs.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the factory-kit plugin — 37 skills, 8 commands, 12 agents, 1 MCP server shipped together

Good fit Use it when starting authentication, changing providers, or adding organization and role features. It helps wire protected procedures and shared authentication wrappers into the project.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nonlinear-xyz/factory-kit/factory-auth-wiring-specialist
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 nonlinear-xyz/factory-kit --skill factory-auth-wiring-specialist
Clone the repo
git clone --depth 1 https://github.com/nonlinear-xyz/factory-kit

Made for: Claude Code.

Or install factory-kit, the plugin that ships this one along with the rest of its 37 skills, 8 commands, 12 agents, 1 MCP server.

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 factory-auth-wiring-specialist

README.md
[![agentmods](https://agentmods.dev/badge/skills/nonlinear-xyz/factory-kit/factory-auth-wiring-specialist/github.svg)](https://agentmods.dev/skills/nonlinear-xyz/factory-kit/factory-auth-wiring-specialist)
Your own site
<a href="https://agentmods.dev/skills/nonlinear-xyz/factory-kit/factory-auth-wiring-specialist"><img src="https://agentmods.dev/badge/skills/nonlinear-xyz/factory-kit/factory-auth-wiring-specialist/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 factory-auth-wiring-specialist

Your own site · 80×15
<a href="https://agentmods.dev/skills/nonlinear-xyz/factory-kit/factory-auth-wiring-specialist"><img src="https://agentmods.dev/badge/skills/nonlinear-xyz/factory-kit/factory-auth-wiring-specialist.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 138 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,610 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.
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.00138 $0.01610
Opus 5 $0.00069 $0.00805
Sonnet 5 $0.00028 $0.00322
Haiku 4.5 $0.00014 $0.00161

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

Security

Grade A, and why

factory-auth-wiring-specialist 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 10d 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.

skills/factory-auth-wiring-specialist/SKILL.md · 168 lines

How it starts

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

Apply the auth-wiring-specialist workflow. Wire auth using the factory's conventions, not generic provider-specific boilerplate. Load the canonical factory-auth and factory-security skills through the host's skill capability when needed.

How to think (in order)

  1. Which provider? Apply the decision matrix:

    • Better Auth + organization plugin — default. B2B with team/org concept.
    • Supabase Auth + RLS — RLS is doing real work (multi-role partner/distributor, deeply branched authz).
    • Clerk — consumer / SSO-heavy. Managed UI matters.

    If the user has expressed a preference or the project already has a provider, defer to that. Otherwise pick from the matrix and flag.

  2. Wrapper interface present? Check for src/lib/auth/ (or equivalent). The seam is:

    • requireAuth() -> { user, session }
    • requireRole(role) -> { user, session }
    • withOrgContext(fn) — wraps an async function with org context

    If the seam exists, use it. If not, create it before writing any new auth-touching code.

  3. Procedure tiers? For tRPC projects:

    • publicProcedure — anyone
    • protectedProcedure = publicProcedure.use(requireAuth)
    • orgProcedure = protectedProcedure.use(requireOrg)

    For server-action projects, the equivalent is calling the wrappers at the top of each action.

  4. Multi-tenancy enforcement? Every domain query / mutation must:

    • Pull orgId from session via withOrgContext
    • Filter by orgId in the query / mutation
    • Never trust an orgId from the request body — always from the session
  5. OAuth flows?

    • Validate ?next= params with safeNext() — reject protocol-relative, non-relative URLs
    • Post-login redirect by role (admin → /admin, rep → /submit, default /)
    • Skip ?next= for OAuth callback flows (too easy to weaponize on first sign-in)
  6. JWT verification? (Clerk / Supabase)

    • Always verify RS256 signature against JWKS
    • Cache JWKS in memory; refresh on signature failure
    • Fallback user-linking on first request (create user record inline if webhook hasn't arrived)
  7. Admin / service-role client?

    • Wrap in withAdmin(fn) — never expose at module scope
    • Call requireAdmin() inside the wrapper before returning the client
    • See factory-security.md
  8. Role definition? Don't put roles in code as string literals. Define an enum / const and reference it:

    export const ROLES = ['owner', 'admin', 'member', 'guest'] as const;
    export type Role = (typeof ROLES)[number];
    

Read the full file on GitHub · 168 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. 10d ago First seen · 168 lines · 138 tokens per session scan A 121b190e187d

Subscribe to this mod's changes

factory-auth-wiring-specialist is a skill published in the GitHub repository nonlinear-xyz/factory-kit (9 stars, last pushed 1mo ago), licensed MIT. It adds 138 tokens to every session and 1,610 once invoked, about $0.0007 per session on Opus 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-31.

Related

Other skills, from other repositories

databases

· Configure/tune/migrate PostgreSQL, MongoDB, MySQL/MariaDB, MSSQL. Triggers: 'database', 'postgres', 'mysql', 'mongodb', 'database schema', 'database migration', 'pgbouncer', 'EXPLAIN'. Not for HTTP APIs (use backend-api).

iuliandita/skills · 66 tokens

update-docs

· Sweep docs after changes: README, changelog, API, runbooks. Triggers: 'update docs', 'refresh docs', 'sync docs', 'docs drift', 'merged PR', 'release cut', 'version bump', 'update changelog'. Not for PR text (use git).

iuliandita/skills · 64 tokens

backend-api

· Design/review HTTP APIs for FastAPI, Express, NestJS: REST, OpenAPI, pagination, OAuth/JWT. Triggers: 'fastapi', 'express', 'nestjs', 'openapi', 'pagination', 'idempotency', 'rest api', 'endpoint'. Not for schemas (use databases).

iuliandita/skills · 68 tokens

social-login

An implementation guide for letting users sign in with accounts from Google, Apple, Kakao, or Naver. It explains the frontend and backend steps, including checking the sign-in token before creating a session for your app.

Dannykkh/skill-olympus · 80 tokens

fullstack-coding-standards

A reference guide for full-stack development, covering frontend code, APIs, databases, and Java Spring Boot examples. It is intended for explicit use rather than automatic application to every implementation.

Dannykkh/skill-olympus · 53 tokens

dotnet-coding-standards

.NET coding guidance covering common C# patterns, ASP.NET Core web applications, and Entity Framework Core database access.

Dannykkh/skill-olympus · 50 tokens