skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
blogic-cz/blogic-marketplace69 installs

better-auth

This skill should be used when implementing or reviewing Better Auth authorization boundaries in template-ts apps, especially when selecting TRPC protected procedures for organization/project/member/admin access.

How do I install this agent skill?

npx skills add https://github.com/blogic-cz/blogic-marketplace --skill better-auth
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    The skill provides secure guidelines and code examples for implementing authentication and authorization using the Better Auth library within TRPC procedures. It promotes best practices such as using environment variables for sensitive credentials, implementing robust role-based access controls, and performing schema-based input validation.

  • Socketpass

    No alerts

  • Snykpass

    Risk: LOW · No issues

  • Runlayerpass

    1/1 file flagged

What does this agent skill do?

Better Auth Procedure Selection

Select authorization boundaries with Better Auth + TRPC patterns used in template-ts apps.

Procedure Selection Table

ProcedureAccess LevelContext Provided
publicProcedureNo auth{ db, session?, headers }
protectedProcedureAuthenticated{ db, session, userId, headers }
adminProcedureAdmin role{ db, session, headers }
protectedOrganizationMemberProcedureOrg member{ ..., member, organizationId }
protectedOrganizationAdminProcedureOrg admin/owner{ ..., member, organizationId }
protectedProjectMemberProcedureProject access{ ..., project, projectRole, orgRole }
protectedProjectAdminProcedureProject admin{ ..., project, projectRole, orgRole }
protectedProjectEditorProcedureProject editor+{ ..., project, projectRole, orgRole }

Use this table as the primary selector before writing router logic.

Use This Skill When

  • Select the correct protected procedure for organization/project/member/admin access.
  • Implement Better Auth authorization checks inside TRPC procedures.
  • Review auth boundaries in existing routers.

Follow This Workflow

  1. Identify required access level from the Procedure Selection Table.
  2. Start implementation from the matching base procedure.
  3. Chain stricter middleware only when the table does not fully satisfy the access rule.
  4. Load references/better-auth-examples.md for detailed examples and copy-ready snippets.
  5. Keep context shape stable; add only route-specific fields.

Key Rules

  1. Select the narrowest procedure that matches the required permission.
  2. Reuse inherited context (userId, organizationId, project, roles) instead of recomputing it.
  3. Grant organization admins automatic project-admin behavior; avoid duplicate checks.
  4. Pass ctx.headers to auth.api.* server calls.
  5. Validate variable origins in every middleware (opts.ctx, opts.input) before adding business logic.

References

  • references/better-auth-examples.md — auth configuration, context setup, middleware examples, client auth usage, and admin API patterns.

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/blogic-cz/blogic-marketplace/better-auth">View better-auth on skillZs</a>