Skip to content

aiskillstore/marketplace / skills/abdul-haseeb360/frontend-api-client-with-jwt

frontend-api-client-with-jwt

Verified

A conceptual skill for building an API client in Next.js that handles JWT tokens

FileKindSize
SKILL.mdskill md6.7 KB
skill-report.jsonconfig12.0 KB

skill-report.json

View on GitHub
{
  "schema_version": "2.0",
  "meta": {
    "generated_at": "2026-07-18T09:34:58.491Z",
    "slug": "abdul-haseeb360-frontend-api-client-with-jwt",
    "source_url": "https://github.com/Abdul-Haseeb360/Hackathon-II-AI-Native-Systems/tree/main/.claude/skills/frontend-api-client",
    "source_ref": "main",
    "model": "claude",
    "analysis_version": "3.0.0",
    "source_type": "community",
    "content_hash": "68efc3b7b7e7c39ec31503f5efb2f969a517c5a38fb0342be3748bcadb3a5112",
    "tree_hash": "4258cb4c58b7061519773fe339e9578d0cc20afc40b17b1085a20f486492ea8d",
    "provenance": {
      "model_effective": "claude",
      "fallback_chain": [
        {
          "agent": "codex",
          "outcome": "failed",
          "error": "2026-07-18T09:34:58.621842Z ERROR codex_models_manager::manager: failed to refresh available models: Missing environment variable: `HELM_API_KEY`.\n2026-07-18T09:34:58.642863Z ERROR codex_models_manage…"
        },
        {
          "agent": "claude",
          "outcome": "success"
        }
      ],
      "analysis_version": "3.0.0"
    }
  },
  "skill": {
    "name": "Frontend API Client with JWT",
    "description": "Guidance for designing a centralized Next.js API client that attaches JWT authorization headers, refreshes tokens, and handles API errors consistently.",
    "summary": "Design a consistent JWT-aware API client for Next.js applications.",
    "icon": "📦",
    "version": "1.0.0",
    "author": "Claude",
    "license": "MIT",
    "category": "coding",
    "tags": [
      "nextjs",
      "jwt-authentication",
      "api-client",
      "token-refresh",
      "typescript"
    ],
    "supported_tools": [
      "claude",
      "codex",
      "claude-code"
    ],
    "risk_factors": []
  },
  "security_audit": {
    "risk_level": "safe",
    "is_blocked": false,
    "safe_to_publish": true,
    "analysis_status": "ok",
    "summary": "All six static detections are false positives caused by ordinary JWT, HTTP error-handling, React context, and testing language. SKILL.md provides conceptual defensive implementation guidance and contains no evidence of reconnaissance, data exfiltration, prompt injection, or harmful behavior.",
    "remediation": [],
    "risk_factor_evidence": [],
    "static_findings": [
      {
        "id": "blocker:SKILL.md:74:system-reconnaissance",
        "category": "blocker",
        "severity": "low",
        "pattern": "System reconnaissance",
        "file": "SKILL.md",
        "line_start": 74,
        "line_end": 74,
        "snippet": "- Valid JWT token for authorization"
      },
      {
        "id": "blocker:SKILL.md:100:system-reconnaissance",
        "category": "blocker",
        "severity": "low",
        "pattern": "System reconnaissance",
        "file": "SKILL.md",
        "line_start": 100,
        "line_end": 100,
        "snippet": "- HTTP 401 Unauthorized for expired/invalid tokens"
      },
      {
        "id": "blocker:SKILL.md:141:system-reconnaissance",
        "category": "blocker",
        "severity": "low",
        "pattern": "System reconnaissance",
        "file": "SKILL.md",
        "line_start": 141,
        "line_end": 141,
        "snippet": "4. **Error Information**: Avoid exposing sensitive information in error messages"
      },
      {
        "id": "blocker:SKILL.md:149:system-reconnaissance",
        "category": "blocker",
        "severity": "low",
        "pattern": "System reconnaissance",
        "file": "SKILL.md",
        "line_start": 149,
        "line_end": 149,
        "snippet": "- Implement efficient token refresh to avoid blocking requests"
      },
      {
        "id": "blocker:SKILL.md:166:system-reconnaissance",
        "category": "blocker",
        "severity": "low",
        "pattern": "System reconnaissance",
        "file": "SKILL.md",
        "line_start": 166,
        "line_end": 166,
        "snippet": "- Test token attachment functionality with valid/invalid tokens"
      },
      {
        "id": "blocker:SKILL.md:132:network-reconnaissance",
        "category": "blocker",
        "severity": "low",
        "pattern": "Network reconnaissance",
        "file": "SKILL.md",
        "line_start": 132,
        "line_end": 133,
        "snippet": "- Enable context-based API client access"
      }
    ],
    "finding_verdicts": [
      {
        "id": "blocker:SKILL.md:74:system-reconnaissance",
        "verdict": "false_positive",
        "confidence": 0.99,
        "reason": "The line lists a valid JWT as an input requirement for authorized API requests. It does not instruct system discovery or collection of host information."
      },
      {
        "id": "blocker:SKILL.md:100:system-reconnaissance",
        "verdict": "false_positive",
        "confidence": 0.99,
        "reason": "The line documents normal HTTP 401 handling for expired or invalid tokens. It contains no system reconnaissance activity or instructions."
      },
      {
        "id": "blocker:SKILL.md:141:system-reconnaissance",
        "verdict": "false_positive",
        "confidence": 0.99,
        "reason": "The line advises authors not to expose sensitive details in error messages. This is defensive guidance, not system reconnaissance."
      },
      {
        "id": "blocker:SKILL.md:149:system-reconnaissance",
        "verdict": "false_positive",
        "confidence": 0.99,
        "reason": "The line recommends efficient token refresh to improve request performance. It does not collect or inspect system information."
      },
      {
        "id": "blocker:SKILL.md:166:system-reconnaissance",
        "verdict": "false_positive",
        "confidence": 0.99,
        "reason": "The line asks developers to test valid and invalid token behavior in their own application. It does not describe reconnaissance or unauthorized probing."
      },
      {
        "id": "blocker:SKILL.md:132:network-reconnaissance",
        "verdict": "false_positive",
        "confidence": 0.99,
        "reason": "The line describes React context access for an API client. It does not scan, enumerate, or probe networks."
      }
    ],
    "semantic_findings": [],
    "critical_findings": [],
    "high_findings": [],
    "medium_findings": [],
    "low_findings": [],
    "dangerous_patterns": [],
    "files_scanned": 1,
    "total_lines": 171,
    "audit_model": "claude",
    "audited_at": "2026-07-18T09:34:58.491Z",
    "agent_auto_install_policy": "allowed",
    "manual_install_policy": "allowed"
  },
  "content": {
    "user_title": "Build a Secure JWT API Client",
    "value_statement": "JWT API clients can become inconsistent when token refresh, headers, and errors are handled in each component. This skill provides a design framework for a centralized Next.js client with consistent authentication and error handling.",
    "seo_keywords": [
      "Claude",
      "Codex",
      "Claude Code",
      "Next.js JWT client",
      "JWT authentication",
      "API client design",
      "token refresh",
      "Authorization header",
      "React API integration",
      "frontend security"
    ],
    "actual_capabilities": [
      "Defines a centralized API-client structure for Next.js applications.",
      "Guides Authorization header attachment with Bearer JWT tokens.",
      "Explains token expiry detection and coordinated refresh flows.",
      "Describes consistent parsing for authentication, authorization, and network errors.",
      "Covers client-side, server-side, and React context integration patterns.",
      "Lists security, performance, validation, and testing considerations."
    ],
    "limitations": [
      "Provides conceptual guidance, not production-ready source code.",
      "Does not implement an authentication provider or issue JWT tokens.",
      "Does not choose a secure token storage method for your threat model.",
      "Requires you to adapt endpoints, error formats, and framework details."
    ],
    "use_cases": [
      {
        "title": "Standardize application requests",
        "description": "Create one API-client approach for a Next.js product with many authenticated endpoints.",
        "target_user": "Frontend developer"
      },
      {
        "title": "Plan token refresh behavior",
        "description": "Define how an application refreshes expired tokens and handles failed refresh requests.",
        "target_user": "Authentication engineer"
      },
      {
        "title": "Review client integration",
        "description": "Check API calls for consistent headers, errors, cancellation, and security practices.",
        "target_user": "Technical lead"
      }
    ],
    "prompt_templates": [
      {
        "title": "Start an API client plan",
        "scenario": "Beginner",
        "prompt": "Use this skill to outline a simple Next.js API client for my JWT-protected API. Include token attachment and basic error handling."
      },
      {
        "title": "Add refresh handling",
        "scenario": "Intermediate",
        "prompt": "Use this skill to design a token refresh flow for my Next.js API client. Explain how to prevent duplicate refresh requests."
      },
      {
        "title": "Integrate React access",
        "scenario": "Intermediate",
        "prompt": "Use this skill to propose a React context and hook interface for a centralized JWT API client."
      },
      {
        "title": "Review production behavior",
        "scenario": "Advanced",
        "prompt": "Use this skill to review my Next.js API-client design for token storage, server and client boundaries, retries, validation, and error exposure."
      }
    ],
    "output_examples": [
      {
        "input": "Plan a client for authenticated profile and billing endpoints.",
        "output": [
          "Central API client with a configurable base URL and request methods.",
          "Bearer token attachment for protected endpoints.",
          "A refresh coordinator that retries eligible requests once.",
          "Typed handling for 401, 403, validation, and network errors."
        ]
      },
      {
        "input": "Review an existing token refresh approach.",
        "output": [
          "Identify where expiration is checked and where refresh begins.",
          "Recommend a single in-flight refresh operation for concurrent requests.",
          "Specify logout and user feedback behavior after a refresh failure."
        ]
      }
    ],
    "best_practices": [
      "Use HTTPS and validate request parameters before sending them.",
      "Keep token refresh logic centralized and limit retries after refresh failure.",
      "Show safe user messages while keeping sensitive server details out of errors."
    ],
    "anti_patterns": [
      "Do not attach tokens to every request without considering endpoint and origin.",
      "Do not start separate token refresh requests for each concurrent API call.",
      "Do not expose raw API errors, tokens, or internal details in the interface."
    ],
    "faq": [
      {
        "question": "Does this skill provide a complete API client library?",
        "answer": "No. It provides conceptual guidance that you adapt to your application."
      },
      {
        "question": "Can this skill manage JWT token refresh?",
        "answer": "It explains a refresh design, including coordination and failure handling."
      },
      {
        "question": "Does it support Next.js App Router and Pages Router?",
        "answer": "Yes. The guidance applies to either router, with adaptation for your execution context."
      },
      {
        "question": "Which token storage method should I use?",
        "answer": "Choose storage based on your threat model. The skill does not prescribe one method."
      },
      {
        "question": "Can it handle API errors?",
        "answer": "Yes. It describes consistent handling for authentication, authorization, network, and general errors."
      },
      {
        "question": "Does it replace server-side authorization?",
        "answer": "No. The API server must validate tokens and enforce authorization independently."
      }
    ]
  },
  "file_structure": [
    {
      "name": "SKILL.md",
      "type": "file",
      "path": "SKILL.md",
      "lines": 171
    }
  ]
}
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall