Agent skill

JWT

by kataras in kataras/jwt

Development guide for the jwt JSON Web Token library for Go (github.com/kataras/jwt).

MITAuto-check passedBackend & APIs

Install JWT

skills CLI
$ npx skills add kataras/jwt --skill jwt -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install kataras/jwt jwt --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/kataras/jwt.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skill/jwt .claude/skills/jwt && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
jwt
GitHub stars
212
Token cost
~1.5k tokens
SKILL.md length
647 words
Files
6 (incl. references)
Skills in repo
2
Repo updated
First seen
Licence
MIT

At a glance

Development guide for the jwt JSON Web Token library for Go (github.com/kataras/jwt).

  • Choosing a signing algorithm (HMAC
  • SKILL.md covers Quick start, Rules that prevent the common… and Reference index
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Validating standard

What it does

JWT is an agent skill from kataras/jwt. Development guide for the jwt JSON Web Token library for Go (github.com/kataras/jwt). Use this skill when signing or verifying JWTs, choosing a signing algorithm (HMAC, RSA, RSA-PSS, ECDSA, EdDSA), reading or validating standard or custom claims, setting expiry and clock-skew tolerance, rotating keys with a kid-based registry, fetching or publishing a JWKS, blocklisting (revoking) tokens, encrypting a payload, or extracting a token from an HTTP request.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files (for example `references/api-map.md`, `references/keys-and-jwks.md` and `references/security.md`).

It sits in Backend & APIs, covering Authentication. It works with GitHub and Go. The repository describes itself as: A fast and simple JWT implementation with Generics support for Go 1.27+. The licence is MIT.

When your agent uses it

  • Choosing a signing algorithm (HMAC
  • Validating standard
  • Setting expiry and clock-skew tolerance
  • Rotating keys with a kid-based registry

Example prompts

  • “/jwt”

What it can do on your machine

Read from SKILL.md and the folder at commit 87a77ff. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are go).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

JWT loads about 1.5k tokens when it runs, and up to ~19k if it reads all its reference files. Until then it costs about 115 tokens; SKILL.md has 647 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~115
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~19k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from kataras/jwt at commit 87a77ff, republished under its MIT licence (© kataras). 647 words, ~1,487 tokens.

Download SKILL.mdSave it as .claude/skills/jwt/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
jwt
description
Development guide for the jwt JSON Web Token library for Go (github.com/kataras/jwt). Use this skill when signing or verifying JWTs, choosing a signing algorithm (HMAC, RSA, RSA-PSS, ECDSA, EdDSA), reading or validating standard or custom claims, setting expiry and clock-skew tolerance, rotating keys with a kid-based registry, fetching or publishing a JWKS, blocklisting (revoking) tokens, encrypting a payload, or extracting a token from an HTTP request.
tags
go, jwt, jws, jwk, jwks, authentication, security, tokens

The jwt library for Go

github.com/kataras/jwt is a zero-dependency JWT and JWKS implementation for Go, built on RFC 7519 (JWT) and RFC 7518 (JWA). It signs and verifies compact tokens over HMAC, RSA, RSA-PSS, ECDSA and EdDSA, decodes claims into a struct or a map, and ships the pieces most applications end up writing by hand: a kid-based multi-key registry, JWKS fetch and publish, a server-side blocklist, standard-claims validators, and HTTP token extraction.

Quick start

go
package main

import (
    "fmt"
    "time"

    "github.com/kataras/jwt"
)

// Generate this once and keep it outside source control (env var, secret manager).
// 32 bytes is the RFC 7518 minimum for HS256.
var sharedKey = jwt.MustGenerateRandom(32)

type FooClaims struct {
    Foo string `json:"foo"`
}

func main() {
    token, err := jwt.Sign(jwt.HS256, sharedKey, FooClaims{Foo: "bar"}, jwt.MaxAge(15*time.Minute))
    if err != nil {
        panic(err)
    }

    verifiedToken, err := jwt.Verify(jwt.HS256, sharedKey, token)
    if err != nil {
        panic(err)
    }

    var claims FooClaims
    if err = verifiedToken.Claims(&claims); err != nil {
        panic(err)
    }

    fmt.Println(claims.Foo) // bar
}
  • Module path: github.com/kataras/jwt
  • Go 1.27+, no third-party dependencies in the root module

Rules that prevent the common mistakes

The algorithm is always a parameter you supply to Sign and Verify, never a value read out of the token. Verify checks the token's header against the literal algorithm name you passed; passing a fixed algorithm you chose (never one derived from client input) is what stops the classic RS256/HS256 algorithm-confusion attack. A custom HeaderValidator that trusts the token's own "alg" field reopens it.

HMAC key length is not checked. Sign and Verify for HS256/384/512 only type-assert the key to []byte; a two-byte secret works and is brute-forceable. RFC 7518 wants 32/48/64 bytes; use jwt.MustGenerateRandom(32) (or larger) rather than a short literal.

jwt.NONE is a real, selectable algorithm that produces and accepts an empty signature. Never let request input choose the alg argument to Verify. Enrich and UnverifiedToken.Enrich refuse it explicitly, but Sign and Verify do not stop you from passing it yourself.

Claims' expiry field is named Expiry (JSON "exp"), not ExpiresAt. ExpiresAt() is a method that reads Expiry as a time.Time. jwt.Claims{ExpiresAt: ...} does not compile; Claims has no such field.

TokenValidator order is significant. Verify runs validators in order and stops at the first one that returns a non-nil error; a validator meant to rescue an error (Skew, Future) has to be listed before any stricter validator (Expected, RequireExpiry, your own), or the stricter one already saw the unrescued error and returned before the rescuer ran.

Keys, the kid-based registry, is not safe for concurrent writes. Register every key during startup, before any goroutine calls Verify/SignToken/VerifyToken concurrently.

Blocklist.InvalidateToken keys on the token's "jti" claim. A token with no "jti" falls back to using the whole raw token, signature included, as the map key, so blocklisting it pins a full bearer credential in memory until expiry. Give any token you might revoke a "jti".

Verifying a token against a fetched JWKS checks the signature only. It does not check that the token was issued to your application rather than some other client of the same identity provider; add jwt.Expected{Issuer: ..., Audience: ...} yourself, or use jwt.NewCognitoKeySet for AWS Cognito, which returns one already populated. Prefer jwt.KeySet (NewRemoteKeySet/NewCognitoKeySet) over calling FetchPublicKeys/FetchJWKS yourself on a timer; it already handles background refresh, rate-limited refresh on an unrecognized kid, and safe concurrent reads.

Show full SKILL.md (186 more words)Show less

None of the exported symbols' doc comments are compiled or tested: this package has no func Example* tests, so a code sample inside a doc comment (including in doc.go, which is prose, not code) is illustrative, not verified. Do not assert that a symbol exists or has a given signature without checking the .go source yourself. When a reference document below disagrees with the source, the source wins and the document is a bug.

Reference index

Load the one that matches the task; each is self-contained.

ReferenceLoad it when
api-map.mdWriting code against the library and you need the real signature of an exported symbol, grouped by task
security.mdChoosing an algorithm, sizing a key, reviewing algorithm-confusion/none/expiry-skew risk, or checking what Verify does and does not validate for you
keys-and-jwks.mdManaging more than one signing key, rotating keys by kid, fetching or publishing a JWKS, or verifying tokens from Auth0, AWS Cognito, Google or Microsoft
validators.mdComposing TokenValidators, using Blocklist/Expected/Leeway/Skew/RequireExpiry, or mapping a verification error to an HTTP response with Classify
testing.mdWriting or running a test, overriding jwt.Clock, or understanding the -tags safe build

© kataras, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (references) in skill/jwt of kataras/jwt.

  • SKILL.md
  • references/api-map.md
  • references/keys-and-jwks.md
  • references/security.md
  • references/testing.md
  • references/validators.md

Open the folder on GitHubat commit 87a77ff

Compare with similar skills

JWT next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

JWT compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
JWT this skillkataras/jwt212—~1.5kAutomated safety check: PassMIT
Jwx Guide V4lestrrat-go/jwx2.4k—~5.3kAutomated safety check: PassMIT
Jwx Companion Bulklestrrat-go/jwx2.4k—~1.9kAutomated safety check: PassMIT
GitHub OAuth Nango IntegrationAgentWorkforce/relay8661 repos~3.4kAutomated safety check: PassApache-2.0
Auth Setupbutterbase-ai/butterbase-skills534—~2.2kAutomated safety check: PassMIT
Apikerhodgef/apiker127—~1.4kAutomated safety check: PassMIT

Similar skills

  • Jwx Guide V4

    lestrrat-go/jwx

    Guide for developing Go applications with github.com/lestrrat-go/jwx v4 — parse/sign JWTs, work with JWS/JWE/JWK, pick algorithms, and avoid the common footguns.

    2.4k GitHub stars~5.3k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Jwx Companion Bulk

    lestrrat-go/jwx

    Apply bulk operations across all jwx companion modules. An agent skill from lestrrat-go/jwx.

    2.4k GitHub stars~1.9k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • GitHub OAuth Nango Integration

    AgentWorkforce/relay

    A skill your agent uses when implementing GitHub OAuth + GitHub App authentication with Nango - provides two-connection pattern for user login and repo access with webhook handling

    866 GitHub starsUsed in 1 repo~3.4k tokens
    Backend & APIsAuto-check passed
  • Auth Setup

    butterbase-ai/butterbase-skills

    A skill your agent uses when configuring OAuth providers (Google/GitHub/Apple/X/etc.), setting up post-login auth hooks, tuning JWT lifetimes, or generating service API keys

    534 GitHub stars~2.2k tokensUpdated 3 days ago
    Backend & APIsAuto-check passed
  • Apiker

    hodgef/apiker

    Develop, review, and extend the Apiker library — a framework for building serverless REST APIs on Cloudflare Workers + Durable Objects.

    127 GitHub stars~1.4k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Golang Swagger

    context-labs/whip

    Golang OpenAPI/Swagger docs with swaggo/swag — annotations (@Summary, @Param, @Success, @Router, @Security), swag init, framework integrations (gin, echo, fiber, chi), security definitions, struct…

    1.1k GitHub starsUsed in 2 repos~2.3k tokens
    Backend & APIsAuto-check passed

More from kataras/jwt

  • Human Writing

    kataras/jwt

    A skill your agent uses when writing or editing any prose in this repository - the book's preface, its chapters and epilogue, the brand kit notes, the agent skill documents, the changelog, and the…

    212 GitHub stars~1.9k tokensUpdated 25 days ago
    Auto-check passed

Works with

Categories

Questions about JWT

What does JWT do?

Development guide for the jwt JSON Web Token library for Go (github.com/kataras/jwt). JWT is an agent skill from kataras/jwt.com/kataras/jwt).

When should I use JWT?

JWT fits situations like: choosing a signing algorithm (HMAC; validating standard; setting expiry and clock-skew tolerance; rotating keys with a kid-based registry.

How do I install JWT in Claude Code?

Run `npx skills add kataras/jwt --skill jwt -a claude-code`. Or copy the skill folder (skill/jwt in kataras/jwt) into .claude/skills/jwt in your project. Claude Code loads it when a task matches its description.

How do I install JWT in Codex?

Run `npx skills add kataras/jwt --skill jwt -a codex`. Or copy the skill folder (skill/jwt in kataras/jwt) into .agents/skills/jwt in your project. Codex loads it when a task matches its description.

Can I use JWT in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add kataras/jwt --skill jwt -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/jwt, .gemini/skills/jwt, .github/skills/jwt and .opencode/skills/jwt in your project.

What does JWT need to run?

SKILL.md names no scripts, command-line tools or credentials: JWT is instructions for the agent only.

Does JWT access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is JWT safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does JWT use?

JWT is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does JWT use?

About 1.5k tokens (SKILL.md is roughly 5.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 18k tokens, read only when the agent opens those files.

What are the alternatives to JWT?

Skills that share tags, products or a category with JWT: Jwx Guide V4 (lestrrat-go/jwx, 2.4k stars), Jwx Companion Bulk (lestrrat-go/jwx, 2.4k stars), GitHub OAuth Nango Integration (AgentWorkforce/relay, 866 stars) and Auth Setup (butterbase-ai/butterbase-skills, 534 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains JWT?

kataras (a GitHub user) maintains it in kataras/jwt, which has 212 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on September 13, 2026.

Source: kataras/jwt on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.