A conceptual skill for building an API client in Next.js that handles JWT tokens
SkillScore95Maintained
Automatic
◆Frontend / UI pack
Last verified 8/22/2026
What it changes
Passed 21 of 22 test cases with the skill, and 20 of 22 without it.
Without skill91%
With skill95%
Checks it passed that the model alone missed
The error parser differentiates between network-level failures and HTTP status error responses.
1 fixed20 passed either way1 still failing0 broke
Pass-rate lift
+5 pp
Tokens
+30%
Agent turns
0%
Response time
-13%
Model gemini-3.6-flashMeasured 8/22/2026v121 of 22 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
A test case the skill fixed. Same model, same prompt, with and without the skill.
Prompt
Our Next.js API client currently throws raw fetch `Response` objects when an endpoint returns a 400 or 500 status code, forcing UI components to parse JSON manually. Provide an error parser implementation that normalizes API errors into a standard structure.
What was checked, without and with the skill
Checked
Without skill
With skill
The error parser extracts error messages and status codes into a standard structured JavaScript object.
Passed
Passed
The error parser differentiates between network-level failures and HTTP status error responses.
Missed
Passed
case-10 · gemini-3.6-flash · 8/22/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md162 linessingle file
Frontend API Client with JWT Skill
When to Use This Skill
Use this conceptual skill when you need to implement a robust API client in Next.js that properly handles JWT tokens for authentication. This skill is appropriate for:
Creating centralized API communication layer in Next.js applications
Managing JWT-based authentication across multiple API endpoints
Handling token expiration and refresh scenarios
Standardizing error response parsing and handling
Implementing secure API communication patterns
This skill should NOT be used for:
Applications without JWT-based authentication
Static sites without API communication needs
Applications using alternative authentication methods (API keys, OAuth 2.0 client credentials, etc.)
Simple applications with minimal API interaction
Prerequisites
Next.js application (either App Router or Pages Router)
Understanding of JWT (JSON Web Token) concepts
Knowledge of HTTP headers and authorization mechanisms
Basic understanding of asynchronous JavaScript operations
Awareness of client-side vs server-side execution contexts
Conceptual Implementation Framework
Authorization Header Attachment Capability
Automatically attach JWT tokens to API requests as Authorization headers
Determine when to include tokens based on request type and endpoint
Handle token attachment for both client-side and server-side requests
Manage token inclusion in cross-origin requests appropriately
Ensure proper header formatting ("Bearer ")
Token Expiry Handling Capability
Detect JWT token expiration before making API requests