This one's a practical reference for implementing auth and security patterns correctly. It walks through JWT vs session auth, shows you how to avoid common mistakes like storing tokens in localStorage or using timing-vulnerable comparisons, and includes working code for RBAC, password hashing with bcrypt, API key authentication, and CORS configuration. The side-by-side "wrong vs correct" examples are genuinely helpful, like pointing out that "invalid password" error messages leak information about which emails exist in your system. Load it when you're building login flows, managing secrets, or need to remember the proper way to set httpOnly cookies. It won't teach you security from scratch, but it's solid for avoiding the footguns.

skills.sh installs
132
GitHub stars
1.4K
last updated
Jun 9, 2026

Install

$ npx -y skills add cloudai-x/claude-workflow-v2 --skill security-patterns --agent claude-code

Installs into .claude/skills of the current project.

Files

Security Patterns

When to Load

  • Trigger: Auth flows, encryption, secrets management, CORS configuration, input validation, rate limiting
  • Skip: No security surface involved in the current task

Security Implementation Workflow

Copy this checklist and track progress:

Security Implementation Progress:
- [ ] Step 1: Choose authentication strategy
- [ ] Step 2: Implement authorization model
- [ ] Step 3: Set up password hashing
- [ ] Step 4: Configure secrets management
- [ ] Step 5: Enable encryption (transit + rest)
- [ ] Step 6: Configure CORS
- [ ] Step 7: Add rate limiting
- [ ] Step 8: Validate against anti-patterns checklist

Authentication Patterns

JWT (JSON Web Tokens)

import jwt from "jsonwebtoken";

function generateTokens(user: User) {
  const accessToken = jwt.sign(
    { sub: user.id, role: user.role },
    process.env.JWT_SECRET!,
    { expiresIn: "15m", algorithm: "HS256" },
  );
  const refreshToken = jwt.sign(
    { sub: user.id, tokenVersion: user.tokenVersion },
    process.env.JWT_REFRESH_SECRET!,
    { expiresIn: "7d" },
  );
  return { accessToken, refreshToken };
}

Sponsors

Details

Repository
github.com/cloudai-x/claude-workflow-v2
Categories
Backend & APIs, Security, Automation & Workflows
License
MIT
First seen
Jun 11, 2026

More from cloudai-x/claude-workflow-v2

All 14
1htx-exchange avatarusdt-m-futureshtx-exchange/htx-skills-hubHTX USDT-M Futures trading using the HTX API. Authentication requires API key and secret key for certain endpoints. Supports mainnet.132skills.sh installs
2andrelandgraf avatarbase-app-setupandrelandgraf/fullstackrecipesComplete setup guide for a Next.js app with Shadcn UI, Neon Postgres, Drizzle ORM, and AI SDK.122skills.sh installs
3loops-so avatarcliloops-so/skillsUse this skill whenever the user wants to work with the Loops CLI from the terminal. This includes installing or updating the CLI, authenticating, storing and s122skills.sh installs
4signoz avatarsignoz-docssignoz/agent-skillsUse this skill first whenever the user asks about SigNoz instrumentation, OpenTelemetry setup, querying, dashboards, alerts, troubleshooting, self-hosted deploy116skills.sh installs
5nuxt-content avatarnuxt-contentnuxt-content/nuxt-studioUse when working with Nuxt Content v3 - provides collections (local/remote/API sources), queryCollection API, MDC rendering, database configuration, NuxtStudio 114skills.sh installs
6masondelan avatarselvedgemasondelan/selvedgeUse before editing a tracked entity (a DB column, table, function, API endpoint, dependency, or env var) and after any substantive change. Call prior_attempts f2skills.sh installs