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.
npx skills add nonlinear-xyz/factory-kit --skill factory-auth-wiring-specialistgit clone --depth 1 https://github.com/nonlinear-xyz/factory-kitWrote 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.
[](https://agentmods.dev/skills/nonlinear-xyz/factory-kit/factory-auth-wiring-specialist)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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)
-
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.
-
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.
-
Procedure tiers? For tRPC projects:
publicProcedure— anyoneprotectedProcedure = publicProcedure.use(requireAuth)orgProcedure = protectedProcedure.use(requireOrg)
For server-action projects, the equivalent is calling the wrappers at the top of each action.
-
Multi-tenancy enforcement? Every domain query / mutation must:
- Pull
orgIdfrom session viawithOrgContext - Filter by
orgIdin the query / mutation - Never trust an
orgIdfrom the request body — always from the session
- Pull
-
OAuth flows?
- Validate
?next=params withsafeNext()— 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)
- Validate
-
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)
-
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
- Wrap in
-
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];
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.
- 10d ago First seen · 168 lines · 138 tokens per session scan A 121b190e187d
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.
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).
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).
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).
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.
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.
dotnet-coding-standards
.NET coding guidance covering common C# patterns, ASP.NET Core web applications, and Entity Framework Core database access.