Skip to main content
skill CX Codex

security-best-practices · akillness — Claude Code skill

This skill turns vague web and API security requests into one scoped hardening brief, with a primary risk area and matching verification steps.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add akillness/jeo-skills --skill security-best-practices -a claude-code
Open on GitHub

What security-best-practices does

security-best-practices starts by framing the surface, workflow, current controls, and likely risk. It then selects one primary hardening mode: browser and perimeter policy, session and CSRF protection, abuse controls, validation and unsafe execution, secrets and runtime configuration, or review and verification.

The result is a bounded brief with the control state, highest-risk gaps, first changes, and a verification plan. Related work is routed elsewhere: auth-stack decisions go to authentication-setup, schema work to database-schema-design, concrete code fixes to debugging or code-review.

It can use Bash, Read, Write, Edit, Glob, and Grep. Cloud IAM and auth-stack selection sit outside its main route, so those jobs belong with infrastructure-specific or authentication skills.

What it helps with

  • classify the missing security layer
  • turn an OWASP request into a focused hardening brief
  • prioritize fixes for a web app or API
  • attach verification steps to security changes
  • route auth, schema, and code-fix work correctly

Example prompts for the agent

  • Review this API and identify the single highest-risk missing security layer.
  • Turn these launch-review notes into a scoped hardening brief with a verification plan.
  • Decide whether this issue belongs to CSRF, abuse controls, validation, or secret handling, then route adjacent work.

How to install security-best-practices

1Skills CLI (Vercel)

npx skills add akillness/jeo-skills --skill security-best-practices -a claude-code

2Manually: put the files in place

~/.claude/skills/security-best-practices/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/security-best-practices/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about security-best-practices

How do I install security-best-practices in Claude Code?

Run npx skills add akillness/jeo-skills --skill security-best-practices -a claude-code, then check ~/.claude/skills/security-best-practices/SKILL.md.

What does security-best-practices do?

It identifies the main missing security layer, selects one hardening mode, and produces a focused brief with changes, verification, and route-outs.

Which work should go to another skill?

Auth-stack choices belong to authentication-setup; schema design to database-schema-design; concrete vulnerability fixes to debugging or code-review; environment wiring to system-environment-setup.

Source text

SKILL.md · MIT
---
name: security-best-practices
description: >
  Routing-first skill for web/application/API hardening. Use when the main job is
  classifying which security layer is missing — browser/perimeter policy,
  session/cookie/CSRF, abuse controls, validation/unsafe execution,
  secrets/runtime config, or verification — and turning vague OWASP/security asks
  into one concrete hardening brief. Route auth-stack choice to
  `authentication-setup`, schema work to `database-schema-design`, code-level bug
  fixing to `debugging` / `code-review`, and environment wiring to
  `system-environment-setup`.
allowed-tools: Bash Read Write Edit Glob Grep
compatibility: >
  Best for web apps, APIs, backend/fullstack services, marketing-site forms,
  edge/frontend-plus-backend systems, and game-adjacent service/web launch
  surfaces where the team needs a vendor-neutral hardening workflow instead of a
  giant middleware or scanner checklist.
license: MIT
metadata:
  version: "2.1.0"
  modernization: 2026-04-14
  hardening: 2026-04-18
  tags: security-best-practices, owasp, appsec, csp, csrf, secrets, rate-limiting, web-security, api-security
  platforms: Claude, ChatGPT, Gemini, Codex
---

# Security Best Practices

Use this skill when the job is to **name one missing security layer and turn it into a bounded hardening brief**.

The job is not to dump a giant OWASP list, middleware catalog, or scanner parade.
The job is to:
1. frame the surface and risk,
2. choose one primary hardening mode,
3. recommend the smallest credible first slice,
4. name the verification ladder,
5. route adjacent work honestly.

Read these support docs first:
- [references/modes-and-boundaries.md](references/modes-and-boundaries.md)
- [references/mode-packets-and-route-outs.md](references/mode-packets-and-route-outs.md)
- [references/hardening-review-checklist.md](references/hardening-review-checklist.md)
- [references/verification-ladder.md](references/verification-ladder.md)

## When to use this skill
- A team says “make this secure” and the missing security layer is still unclear
- A web app, API, marketing-site flow, admin panel, or game-service surface needs a hardening pass before launch or migration
- You need to decide whether the main problem is CSP/headers, cookies/CSRF, abuse controls, validation/unsafe execution, secret handling, or weak verification
- Scanner findings, OWASP requests, or launch-review notes need to be converted into one prioritized hardening brief
- The current stack has some controls already, but trust is low and the next verification step is unclear

## When not to use this skill
- **The main job is choosing an auth vendor, session architecture, org/member model, or enterprise SSO path** → `authentication-setup`
- **The main job is API contract/interface design before security controls are slotted in** → `api-design`
- **The main job is schema constraints, token tables, indexes, or migration safety** → `database-schema-design`
- **The main job is backend regression coverage or auth/security test implementation** → `backend-testing`
- **The main job is fixing a specific vulnerability in code or reviewing a concrete diff** → `debugging` or `code-review`
- **The main job is secret injection mechanics, toolchain bootstrapping, or environment wiring** → `system-environment-setup` / `environment-setup`
- **The main job is cloud IAM, VPC/network, or broader infrastructure security** → use the infrastructure-specific skill instead of this app-hardening anchor

## Instructions

### Step 1: Frame the hardening job before naming tools
Capture the minimum facts first.

```yaml
security_intake:
  surface: frontend | backend-api | fullstack | edge-worker | marketing-site | game-service-web | mixed | unknown
  workflow_type: new-build | hardening-pass | audit-review | launch-readiness | incident-follow-up | migration
  auth_session_model: cookie-session | bearer-token | mixed | unknown
  current_controls:
    - headers-csp
    - csrf
    - rate-limit
    - validation
    - secret-store
    - scanning
    - none
  primary_risk: xss-browser-policy | csrf-session | abuse-automation | injection-unsafe-execution | secret-exposure | verification-gap | mixed | unknown
  environments: local | preview | staging | prod | multi-env | unknown
  ownership: app-team | platform | security | shared | unknown
```

Rule: do **not** start with “install Helmet,” “turn on CORS,” or “just add WAF rules.”
First label the missing layer.

### Step 2: Choose exactly one primary hardening mode
Use the router in [references/mode-packets-and-route-outs.md](references/mode-packets-and-route-outs.md).

Primary modes:
1. `browser-perimeter-policy`
2. `session-cookie-csrf`
3. `abuse-controls`
4. `validation-unsafe-execution`
5. `secrets-runtime-config`
6. `review-verification`

Pick the **highest-risk missing layer** as primary.
List everything else as follow-up, not as equal co-owners.

### Step 3: Keep the invariants visible
These rules survive every answer:
- CORS, auth, CSRF, rate limiting, validation, and secrets are separate concerns even when they touch the same route
- browser-policy work may need staged rollout or report-only verification
- framework defaults help, but they do not prove full coverage
- secret scanning is detection, not storage/rotation policy
- WAF and rate limiting are compensating/perimeter controls, not full substitutes for app-layer fixes
- every recommendation needs a matching verification step

### Step 4: Build the security hardening brief
Return this structure:

```markdown
# Security Hardening Brief

## Scope
- Surface: ...
- Workflow type: ...
- Primary mode: ...
- Confidence: high | medium | low

## Current control state
- Controls already present: ...
- Missing or untrusted controls: ...

## Highest-risk gaps
1. ...
2. ...
3. ...

## Recommended first slice
1. ...
2. ...
3. ...

## Verification plan
- Manual review: ...
- Static/policy checks: ...
- Dynamic/runtime verification: ...
- Operational evidence: ...

## Ownership and route-outs
- Primary owner: ...
- Adjacent skills / teams: ...
```

### Step 5: Use the mode packet, not a giant checklist
Pull the packet from [references/mode-packets-and-route-outs.md](references/mode-packets-and-route-outs.md).

Mode rules:
- `browser-perimeter-policy` → headers, CSP, framing, secure transport, report-only rollout, proxy/CDN vs app ownership
- `session-cookie-csrf` → cookie flags, state-changing browser routes, origin assumptions, web vs API/mobile differences
- `abuse-controls` → login/reset/form/expensive-endpoint protection, per-route vs global limits, bot carve-outs, monitoring
- `validation-unsafe-execution` → trust boundaries, validation/encoding, uploads, SSRF, command execution, dangerous patterns
- `secrets-runtime-config` → secret-vs-config separation, storage/injection, least privilege, rotation/revocation, client-bundle avoidance
- `review-verification` → classify findings, keep/fix/add/defer decisions, smallest proof ladder, honest ownership

### Step 6: Route adjacent work explicitly
Use these route-outs when the problem crosses boundaries:

| If the real job is... | Route to... |
|---|---|
| auth vendor choice, enterprise SSO, org/member model, hosted-vs-native auth | `authentication-setup` |
| API auth/error/webhook contract design | `api-design` |
| schema constraints, token tables, migration/data-model safety | `database-schema-design` |
| backend security regression tests or CI gates | `backend-testing` |
| concrete vulnerability fix or risky diff review | `debugging` / `code-review` |
| environment bootstrap or secret injection wiring | `system-environment-setup` / `environment-setup` |

## Output expectations
A strong answer from this skill should:
1. identify the **primary missing layer**,
2. recommend one bounded first slice,
3. name the **verification ladder**,
4. avoid pretending one library/tool solves everything,
5. route adjacent work outward instead of absorbing it.

## Examples

### Example 1: cookie-based admin app hardening
**Input**
> Our Next.js admin app uses cookie sessions. POST routes lack CSRF protection and staging/prod cookie flags drift.

**Output direction**
- choose `session-cookie-csrf`
- identify which routes need CSRF protection and which cookie flags must be fixed
- include a verification step for staging/prod drift
- avoid reframing the task as auth-vendor selection

### Example 2: marketing-site form abuse
**Input**
> Our signup and demo-request forms are getting spammed even after adding a honeypot and CAPTCHA.

**Output direction**
- choose `abuse-controls`
- separate form abuse controls from generic CSP/header work
- recommend route-aware throttles / anti-automation steps plus monitoring
- keep broader infrastructure or vendor-rule authoring outside the core brief

### Example 3: game-service secret leakage risk
**Input**
> We have a game companion site plus backend APIs. I’m worried partner keys and admin tokens are drifting into CI logs and maybe client bundles.

**Output direction**
- choose `secrets-runtime-config`
- separate secret detection from storage/rotation/injection policy
- route environment bootstrapping details away when needed
- include revocation/rotation proof requirements

### Example 4: scanner report with weak ownership
**Input**
> The scanner says weak CSP and missing headers, but the app already added middleware and no one trusts the result.

**Output direction**
- choose `review-verification` or `browser-perimeter-policy`
- keep middleware installation distinct from rollout proof
- recommend staged/report-only verification or a scanner/runtime handoff

## Best practices
1. Choose the missing security layer before naming tools.
2. Keep browser policy, session safety, abuse controls, validation, secrets, and verification separate.
3. Pair every recommendation with evidence that would prove it worked.
4. Treat framework defaults and scanners as inputs, not final answers.
5. Prefer one bounded hardening brief over a giant compliance dump.

## References
- [OWASP Application Security Verification Standard](https://owasp.org/www-project-application-security-verification-standard/)
- [OWASP Cheat Sheet Series](https://cheatsheetseries.owasp.org/)
- [MDN: Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP)
- [MDN: Set-Cookie](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie)
- [OWASP ZAP](https://www.zaproxy.org/)
- [GitHub CodeQL code scanning](https://docs.github.com/en/code-security/concepts/code-scanning/codeql/about-code-scanning-with-codeql)

© akillness · MIT · akillness/jeo-skills

Similar skills

All skills for Security →

security-best-practices by other authors comes first.

security-best-practices github.com/openai/skills A skill that reviews code against security best practices for Python, JavaScript/TypeScript and Go, then suggests fixes. CX Codex +1 361installs security-best-practices Mindrally A skill providing security principles for backend and microservice development. It helps agents enforce strict input validation, protect APIs, and prevent sensitive data leaks. CX Codex +1 930installs git-guardrails-claude-code Matt Pocock This skill adds a Claude Code hook that stops risky Git commands before they run. Use it when an agent must not push or discard working-tree changes. 499,069installs ponytail-review DietrichGebert ponytail-review reviews a change beyond the diff, checking connected code, bugs, risks, load, tests, speed, and unnecessary code. Use it for PRs and commits. CX Codex +1 57,000installs ponytail-audit DietrichGebert It audits a repository and ranks bugs, risks, and redundant code in a one-shot report. Use it when you need a review without code changes. CX Codex +1 45,400installs security-audit cloudflare Reviews codebases and APIs for vulnerabilities using safe sandboxing. Fits pre-release security reviews, pen-test triage, and architecture checks. CX Codex +1 54,800installs security-and-hardening addyosmani Guides threat modeling and security checks for code that handles user input, authentication, sessions, or external services. Use it when building a feature that accepts untrusted data or reviewing code before release. CX Codex +1 70,200installs supabase official supabase Guides the agent through database configuration and strict RLS policies in Supabase. CX Codex GP ChatGPT 8installs

From the same set46

testing-strategies This skill turns unclear test policy into a focused validation brief. Use it to choose the gate, risk level, and evidence a change needs. CX Codex +1 368installs authentication-setup Walks you through choosing an auth lane for a web app or API and drawing the line between what the provider owns and what stays in your app. CX Codex +1 368installs changelog-maintenance This skill turns verified shipped work into changelog entries, release notes, migration updates, and small game patch notes. Use it after a release or patch. CX Codex +1 367installs bmad-idea Turns a rough idea into a single concept artifact and points to the next skill. Meant for the step before PRDs and sprint plans. CX Codex +1 366installs state-management A skill that classifies React state into packets and picks the narrowest owner, so you stop arguing about libraries before you know what the state is. CX Codex +1 365installs sprint-retrospective Runs a sprint or milestone retrospective and turns it into a few owned actions instead of another template ritual. CX Codex +1 364installs debugging A skill that walks the agent through a reproduce → isolate → verify loop for concrete bugs, regressions and flaky failures. Useful once you already have a failing test or request. CX Codex +1 361installs git-submodule A skill that first asks whether a submodule is the right boundary, then walks you through one safe workflow. Useful when your project pulls in outside code through .gitmodules. CX Codex +1 360installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor