security-patterns

security-patterns is a skill for Claude Code from CloudAI-X/claude-workflow-v2. It costs 60 tokens per session (3,544 once invoked), scanned A, original, MIT.

A collection of patterns for protecting applications through login, permissions, encryption, secret storage, and traffic controls.

In plain words
What is it for?
Use it when building authentication with JWT or OAuth, assigning role-based permissions, hashing passwords, managing secrets, configuring CORS, validating input, or adding rate limits.
Why use it?
It helps prevent common security mistakes when handling users, passwords, API keys, cross-origin requests, and excessive traffic.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the project-starter plugin — 14 skills shipped together , and of project-starter

Good fit Use it when building authentication with JWT or OAuth, assigning role-based permissions, hashing passwords, managing secrets, configuring CORS, validating input, or adding rate limits.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cloudai-x/claude-workflow-v2/security-patterns
About the project

Project Starter is a workflow plugin that equips coding agents with specialized subagents, reusable skills, commands, hooks, and output styles for software projects. It is for developers who want structured assistance with tasks such as planning, debugging, code review, security, and automation across several coding-agent platforms. Catalogue add-ons are components of its own workflow.

CloudAI-X/claude-workflow-v2 · 1,423 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add CloudAI-X/claude-workflow-v2 --skill security-patterns
Clone the repo
git clone --depth 1 https://github.com/CloudAI-X/claude-workflow-v2

Made for: Claude Code.

Or install project-starter, the plugin that ships this one along with the rest of its 14 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for security-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/cloudai-x/claude-workflow-v2/security-patterns/github.svg)](https://agentmods.dev/skills/cloudai-x/claude-workflow-v2/security-patterns)
Your own site
<a href="https://agentmods.dev/skills/cloudai-x/claude-workflow-v2/security-patterns"><img src="https://agentmods.dev/badge/skills/cloudai-x/claude-workflow-v2/security-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for security-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/cloudai-x/claude-workflow-v2/security-patterns"><img src="https://agentmods.dev/badge/skills/cloudai-x/claude-workflow-v2/security-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,544 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 248
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00060 $0.03544
Opus 5.5 $0.00024 $0.01418
Sonnet 5.5 $0.00012 $0.00709
Haiku 4.5 $0.00006 $0.00354

Measured 1mo ago against content hash e9df7f633842, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

security-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/security-patterns/SKILL.md · 495 lines

How it starts

The opening of the file, as written. The whole thing — 495 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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 };
}

// WRONG: localStorage (XSS vulnerable) | CORRECT: httpOnly cookie for refresh, memory for access
res.cookie("refreshToken", refreshToken, {
  httpOnly: true,
  secure: true,
  sameSite: "strict",
  maxAge: 7 * 24 * 60 * 60 * 1000,
  path: "/api/auth/refresh",
});

JWT Verification Middleware

function authenticate(req: Request, res: Response, next: NextFunction) {
  const header = req.headers.authorization;
  if (!header?.startsWith("Bearer ")) {
    return res.status(401).json({ error: "Missing token" });
  }

  try {
    const token = header.slice(7);
    const payload = jwt.verify(token, process.env.JWT_SECRET!, {
      algorithms: ["HS256"], // pin: never let the token choose its algorithm
    }) as JwtPayload;
    req.user = { id: payload.sub, role: payload.role };
    next();
  } catch (err) {
    if (err instanceof jwt.TokenExpiredError) {
      return res.status(401).json({ error: "Token expired" });
    }
    return res.status(401).json({ error: "Invalid token" });
  }
}

Read the full file on GitHub · 495 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +11 lines e9df7f633842
  2. 3mo ago First seen · 484 lines · 60 tokens per session scan A 9e90b1df8863

Subscribe to this mod's changes

security-patterns is a skill published in the GitHub repository CloudAI-X/claude-workflow-v2 (1,423 stars, last pushed 1mo ago), licensed MIT. It adds 60 tokens to every session and 3,544 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

security-patterns compared with skills from other repositories

security-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
security-patternsCloudAI-X/claude-workflow-v2Skill1.4k1mo agoMITA60Claude Code
x-tweet-by-conversationbrowser-act/skillsSkill6.5k27d agoMITA218Claude Code, Codex
oma-scholarfirst-fluke/oh-my-agentSkill1.5ktodayMITA30Claude Code
monorepo-managementwshobson/agentsSkill43kyesterdayMITC54Claude Code
render-3d-product-showcasegooseworks-ai/goose-skillsSkill1.4k3d agoMITA159Claude Code, Codex
render-airdrop-carouselgooseworks-ai/goose-skillsSkill1.4k3d agoMITA207Claude Code, Codex
email-lifecycle-flow-writergooseworks-ai/goose-skillsSkill1.4k3d agoMITA50Claude Code, Codex