Skip to content

aiskillstore/marketplace / skills/aayushbaniya2006/auth-handler

auth-handler

Verified

Manage authentication, authorization, and user sessions. Use when dealing with login, sign-up, API protection, middleware, or user data fetching.

FileKindSize
SKILL.mdskill md1.0 KB
reference.mdmarkdown786 B
skill-report.jsonconfig16.5 KB

skill-report.json

View on GitHub
{
  "schema_version": "2.0",
  "meta": {
    "generated_at": "2026-07-06T00:29:26.945Z",
    "slug": "aayushbaniya2006-auth-handler",
    "source_url": "https://github.com/AayushBaniya2006/blinkfund/tree/main/.claude/skills/auth-handler",
    "source_ref": "main",
    "model": "codex",
    "analysis_version": "3.0.0",
    "source_type": "community",
    "content_hash": "dddad1d62994c5cfbe321ee79bbef87ad79ddb7bb9d9ffa39c03fd82aeec6751",
    "tree_hash": "f6431196d57dacd13cb9b7cfad74eb35d7a95b02d9f5c47ebe3b35152dd6838e",
    "provenance": {
      "model_requested": "gpt-5.5:high",
      "model_effective": "codex:gpt-5.5:high",
      "fallback_chain": [
        {
          "agent": "codex",
          "model": "gpt-5.5",
          "effort": "high",
          "outcome": "success"
        }
      ],
      "analysis_version": "3.0.0"
    }
  },
  "skill": {
    "name": "auth-handler",
    "description": "Guide authentication, authorization, route protection, and session access for a Next.js application using project-specific helpers.",
    "summary": "Apply project authentication helpers for protected routes, admin access, cron security, and user session data.",
    "icon": "📦",
    "version": "1.0.0",
    "author": "AayushBaniya2006",
    "license": "MIT",
    "tags": [
      "authentication",
      "authorization",
      "nextjs",
      "nextauth",
      "api-security"
    ],
    "supported_tools": [
      "claude",
      "codex",
      "claude-code"
    ],
    "risk_factors": [
      "external_commands"
    ],
    "category": "security"
  },
  "security_audit": {
    "risk_level": "safe",
    "is_blocked": false,
    "safe_to_publish": true,
    "analysis_status": "ok",
    "summary": "All static findings are false positives caused by Markdown backticks and section headings in documentation. No prompt injection, malicious intent, command execution, or network reconnaissance evidence was found in the reviewed files.",
    "remediation": [],
    "risk_factor_evidence": [
      {
        "factor": "external_commands",
        "evidence": [
          {
            "file": "SKILL.md",
            "line_start": 13,
            "line_end": 13
          },
          {
            "file": "SKILL.md",
            "line_start": 14,
            "line_end": 16
          },
          {
            "file": "SKILL.md",
            "line_start": 16,
            "line_end": 17
          },
          {
            "file": "SKILL.md",
            "line_start": 17,
            "line_end": 18
          },
          {
            "file": "SKILL.md",
            "line_start": 18,
            "line_end": 22
          },
          {
            "file": "SKILL.md",
            "line_start": 22,
            "line_end": 23
          },
          {
            "file": "SKILL.md",
            "line_start": 23,
            "line_end": 23
          },
          {
            "file": "SKILL.md",
            "line_start": 26,
            "line_end": 26
          },
          {
            "file": "SKILL.md",
            "line_start": 27,
            "line_end": 27
          }
        ]
      }
    ],
    "static_findings": [
      {
        "id": "external_commands:SKILL.md:13:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 13,
        "line_end": 13,
        "snippet": "- **Standard Routes**: Use `withAuthRequired`."
      },
      {
        "id": "external_commands:SKILL.md:14:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 14,
        "line_end": 16,
        "snippet": "```typescript"
      },
      {
        "id": "external_commands:SKILL.md:16:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 16,
        "line_end": 17,
        "snippet": "```"
      },
      {
        "id": "external_commands:SKILL.md:17:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 17,
        "line_end": 18,
        "snippet": "- **Super Admin Routes**: Use `withSuperAdminAuthRequired`."
      },
      {
        "id": "external_commands:SKILL.md:18:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 18,
        "line_end": 22,
        "snippet": "- **Cron Jobs**: Use `cronAuthRequired`."
      },
      {
        "id": "external_commands:SKILL.md:22:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 22,
        "line_end": 23,
        "snippet": "- **Client Components**: Use `useUser()` hook (SWR)."
      },
      {
        "id": "external_commands:SKILL.md:23:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 23,
        "line_end": 23,
        "snippet": "- **Restriction**: NEVER use `useSession` from `next-auth/react`."
      },
      {
        "id": "external_commands:SKILL.md:26:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 26,
        "line_end": 26,
        "snippet": "- **Check Auth**: Import `auth` from `@/auth`."
      },
      {
        "id": "external_commands:SKILL.md:27:ruby-shell-backtick-execution",
        "category": "external_commands",
        "severity": "medium",
        "pattern": "Ruby/shell backtick execution",
        "file": "SKILL.md",
        "line_start": 27,
        "line_end": 27,
        "snippet": "- **Get Plan**: Use `getUserPlan(session.user.id)`. `session.user` is minimal."
      },
      {
        "id": "blocker:SKILL.md:21:network-reconnaissance",
        "category": "blocker",
        "severity": "low",
        "pattern": "Network reconnaissance",
        "file": "SKILL.md",
        "line_start": 21,
        "line_end": 22,
        "snippet": "### 2. Frontend Data Access"
      },
      {
        "id": "blocker:SKILL.md:25:network-reconnaissance",
        "category": "blocker",
        "severity": "low",
        "pattern": "Network reconnaissance",
        "file": "SKILL.md",
        "line_start": 25,
        "line_end": 26,
        "snippet": "### 3. Server-Side Data Access"
      }
    ],
    "finding_verdicts": [
      {
        "id": "external_commands:SKILL.md:13:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.96,
        "reason": "The backticks on line 13 mark an inline helper name in Markdown, not executable shell or Ruby code. The text instructs users to apply withAuthRequired for route protection."
      },
      {
        "id": "external_commands:SKILL.md:14:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.96,
        "reason": "The fenced block starts a TypeScript documentation example and does not run a command. No shell invocation or user-controlled execution is present."
      },
      {
        "id": "external_commands:SKILL.md:16:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.96,
        "reason": "The backticks close a Markdown code fence and are not executable content. This is documentation formatting only."
      },
      {
        "id": "external_commands:SKILL.md:17:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.96,
        "reason": "The inline backticks identify the withSuperAdminAuthRequired helper. They do not invoke a shell or execute external commands."
      },
      {
        "id": "external_commands:SKILL.md:18:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.96,
        "reason": "The inline backticks identify the cronAuthRequired helper in prose. There is no command execution behavior or injection surface in this line."
      },
      {
        "id": "external_commands:SKILL.md:22:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.96,
        "reason": "The inline backticks identify the useUser hook for client data access. This is Markdown formatting, not Ruby or shell execution."
      },
      {
        "id": "external_commands:SKILL.md:23:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.96,
        "reason": "The inline backticks name a prohibited import path for guidance. The line contains no executable command or external process call."
      },
      {
        "id": "external_commands:SKILL.md:26:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.96,
        "reason": "The inline backticks identify an import target for server-side authentication. This is documentation text, not command execution."
      },
      {
        "id": "external_commands:SKILL.md:27:ruby-shell-backtick-execution",
        "verdict": "false_positive",
        "confidence": 0.96,
        "reason": "The inline backticks identify getUserPlan and session.user in prose. The line documents application helpers and does not execute a shell command."
      },
      {
        "id": "blocker:SKILL.md:21:network-reconnaissance",
        "verdict": "false_positive",
        "confidence": 0.94,
        "reason": "This finding points to a section heading about frontend data access. It contains no network scanning, reconnaissance behavior, or external request instruction."
      },
      {
        "id": "blocker:SKILL.md:25:network-reconnaissance",
        "verdict": "false_positive",
        "confidence": 0.94,
        "reason": "This finding points to a section heading about server-side data access. It does not describe probing networks, scanning hosts, or collecting infrastructure data."
      }
    ],
    "semantic_findings": [],
    "critical_findings": [],
    "high_findings": [],
    "medium_findings": [],
    "low_findings": [],
    "dangerous_patterns": [],
    "files_scanned": 2,
    "total_lines": 55,
    "audit_model": "codex",
    "audited_at": "2026-07-06T00:29:26.945Z",
    "agent_auto_install_policy": "allowed",
    "manual_install_policy": "allowed"
  },
  "content": {
    "user_title": "Protect Next.js Auth Routes",
    "value_statement": "Authentication changes often fail when teams mix session APIs and route guards. This skill guides Claude, Codex, and Claude Code toward the project helpers for secure access control.",
    "seo_keywords": [
      "Claude",
      "Codex",
      "Claude Code",
      "Next.js authentication",
      "NextAuth v5",
      "API route protection",
      "authorization middleware",
      "user session management",
      "admin route security",
      "cron job authentication"
    ],
    "actual_capabilities": [
      "Selects the required wrapper for standard API routes, super admin routes, and cron jobs.",
      "Directs client components to use the project useUser hook for user data.",
      "Directs server code to import auth from the project auth module.",
      "Reminds agents to add per-route protection instead of relying only on middleware.",
      "Points maintainers to project auth files, schema files, and helper locations."
    ],
    "limitations": [
      "Does not implement authentication providers or database schema changes by itself.",
      "Assumes the referenced project helpers already exist in the target repository.",
      "Does not validate runtime configuration, secrets, or provider credentials.",
      "Does not replace a full security review of custom authorization logic."
    ],
    "use_cases": [
      {
        "title": "Protect API Endpoints",
        "description": "Add the correct authentication wrapper to new or existing API routes.",
        "target_user": "Backend engineers"
      },
      {
        "title": "Load Current User Data",
        "description": "Use the approved client or server access pattern for user session data.",
        "target_user": "Frontend engineers"
      },
      {
        "title": "Audit Auth Consistency",
        "description": "Check whether routes, cron jobs, and admin paths follow the project auth conventions.",
        "target_user": "Security reviewers"
      }
    ],
    "prompt_templates": [
      {
        "title": "Protect a Route",
        "scenario": "Beginner route protection task",
        "prompt": "Review this API route and apply the correct project authentication wrapper. Keep the existing handler behavior unchanged."
      },
      {
        "title": "Fix User Loading",
        "scenario": "Client or server session access task",
        "prompt": "Check this component or server function for user session access. Replace unsupported session usage with the project-approved pattern."
      },
      {
        "title": "Secure Admin Access",
        "scenario": "Privileged route review task",
        "prompt": "Review this admin endpoint and ensure it uses the project super admin protection pattern. Explain any authorization assumptions."
      },
      {
        "title": "Audit Auth Coverage",
        "scenario": "Advanced multi-file authentication review",
        "prompt": "Audit these changed files for route protection, cron authentication, and user data access. List missing safeguards and propose focused fixes."
      }
    ],
    "output_examples": [
      {
        "input": "A new API route returns account data without an explicit route guard.",
        "output": "The route should use the standard authenticated wrapper. The existing response logic can stay inside the protected handler."
      },
      {
        "input": "A client component reads the session through the unsupported NextAuth hook.",
        "output": "The component should use the project user hook. This keeps client data access consistent with the application architecture."
      },
      {
        "input": "A scheduled endpoint accepts cron requests without the project cron helper.",
        "output": "The endpoint should use the cron authentication helper. Middleware alone is not enough for this background job path."
      }
    ],
    "best_practices": [
      "Protect each sensitive route with the matching project helper, even when middleware already exists.",
      "Use the project user hook in client components and the project auth import on the server.",
      "Check auth provider settings, user schema changes, and required environment values during auth work."
    ],
    "anti_patterns": [
      "Do not rely only on global middleware for sensitive API routes.",
      "Do not use unsupported session hooks when the project provides its own user hook.",
      "Do not assume minimal session data includes plan or authorization details."
    ],
    "faq": [
      {
        "question": "What kind of project is this skill for?",
        "answer": "It is for a Next.js application that uses project-specific authentication helpers and NextAuth v5 patterns."
      },
      {
        "question": "Can it create a new auth system?",
        "answer": "No. It guides work inside an existing auth architecture and references existing helper files."
      },
      {
        "question": "Which routes does it cover?",
        "answer": "It covers standard API routes, super admin routes, and cron endpoints that need explicit protection."
      },
      {
        "question": "Does it support client user data access?",
        "answer": "Yes. It directs client components to use the project useUser hook for user data."
      },
      {
        "question": "Does it check secrets or provider credentials?",
        "answer": "No. It mentions relevant environment values, but it does not validate live secrets or provider setup."
      },
      {
        "question": "Can Claude Code and Codex use it?",
        "answer": "Yes. The report marks support for Claude, Codex, and Claude Code compatible workflows."
      }
    ]
  },
  "file_structure": [
    {
      "name": "reference.md",
      "type": "file",
      "path": "reference.md",
      "lines": 23
    },
    {
      "name": "SKILL.md",
      "type": "file",
      "path": "SKILL.md",
      "lines": 32
    }
  ]
}
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall