Install any skill in seconds. Free to start, no credit card required.
Get Started Free →When the user wants to set up authentication and authorization for a web application. Use when the user mentions "auth," "login," "OAuth," "SSO," "single sign-on," "role-based access," "RBAC," "permissions," "user roles," "access control," "authentication," or "authorization." Covers OAuth 2.0 provider integration, session management, and role/permission architecture. For JWT-specific tasks, see jwt-handler. For security review, see security-audit.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | 18% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 61% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 81% | 0% |
| case-06 | ✓→✓ | = Same ✓ | 51% | 0% |
| case-07 | ✓→✓ | = Same ✓ | 62% | 0% |
Designs and implements complete authentication and authorization systems for web applications. Covers OAuth 2.0 provider integration (Google, GitHub, Microsoft), session and token management, role-based access control (RBAC), and permission architectures. Generates production-ready code, database migrations, and tests.
Before generating any code, determine:
Create the auth flow diagram and data model:
For each OAuth provider:
Always use PKCE for public clients. Always validate the state parameter.
Generate the permission-checking middleware:
authorize(resource, action) → middleware function
1. Extract user from request (via JWT or session)
2. Load user roles and permissions (cache with TTL)
3. Check if any role grants the required permission
4. Return 403 with clear error if deniedFor row-level security, add ownership filters:
filterByOwnership(resource) → middleware function
1. If user role has wildcard access, skip filter
2. Otherwise, add WHERE clause: resource.owner_id = user.id
3. Apply to SELECT, UPDATE, DELETE queriesCreate tests for:
Prompt: "Set up Google OAuth with JWT tokens for my Express app. I need admin and user roles."
Output:
auth/providers/google.ts — OAuth 2.0 + PKCE flowauth/middleware/authenticate.ts — JWT verificationauth/middleware/authorize.ts — Role checkermigrations/001_auth_tables.sql — Users, roles, permissions, refresh_tokensauth/services/token.service.ts — JWT issuance with refresh rotationauth/routes.ts — /auth/google, /auth/callback, /auth/refresh, /auth/logouttests/auth.test.ts — 18 integration testsPrompt: "Add GitHub login to my Django app. Each organization has its own roles: owner, editor, viewer."
Output:
accounts/providers/github.py — OAuth integration via django-allauthaccounts/models.py — Organization, Membership, Role modelsaccounts/permissions.py — Per-organization permission backendaccounts/middleware.py — Org context middleware (from subdomain or header)accounts/decorators.py — @require_org_role('editor') decoratormigrations/0001_multi_tenant_auth.py — Schema migrationtests/test_permissions.py — 22 test cases across org boundariesOther measured skills in the registry, with their headline benchmark lift.