/claude-skills:security-best-practicesfrom claude-skills
Reviews code for language- and framework-specific security issues covering OWASP Top 10, supply chain, secrets, and dependency auditing. Supports Python, JavaScript/TypeScript, and Go.
Ships in claude-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill provides a description of how to identify the language and frameworks used by the current context, and then to load information from this skill's references directory about the security best practices for this language and or frameworks.
This information, if present, can be used to write new secure by default code, or to passively detect major issues within existing code, or (if requested by the user) provide a vulnerability report and suggest fixes.
The initial step for this skill is to identify ALL languages and ALL frameworks which you are being asked to use or already exist in the scope of the project you are working in. Focus on the primary core frameworks. Often you will want to identify both frontend and backend languages and frameworks.
Then check this skill's references directory to see if there are any relevant documentation for the language and or frameworks. Make sure you read ALL reference files which relate to the specific framework or language. The format of the filenames is <language>-<framework>-<stack>-security.md. You should also check if there is a <language>-general-<stack>-security.md which is agnostic to the framework you may be using.
If working on a web application which includes a frontend and a backend, make sure you have checked for reference documents for BOTH the frontend and backend!
If you are asked to make a web app which will include both a frontend and backend, but the frontend framework is not specified, also check out javascript-general-web-frontend-security.md. It is important that you understand how to secure both the frontend and backend.
If no relevant information is available in the skill's references directory, think a little bit about what you know about the language, the framework, and all well known security best practices for it. If you are unsure you can try to search online for documentation on security best practices.
From there it can operate in a few ways.
The primary mode is to just use the information to write secure by default code from this point forward. This is useful for starting a new project or when writing new code.
The secondary mode is to passively detect vulnerabilities while working in the project and writing code for the user. Critical or very important vulnerabilities or major issues going against security guidance can be flagged and the user can be told about them. This passive mode should focus on the largest impact vulnerabilities and secure defaults.
The user can ask for a security report or to improve the security of the codebase. In this case a full report should be produced describe anyways the project fails to follow security best practices guidance. The report should be prioritized and have clear sections of severity and urgency. Then offer to start working on fixes for these issues. See #fixes below.
references/, load only the relevant files and follow their instructions.Modern applications are heavily dependent on third-party packages. Always assess:
Dependency auditing:
# Node.js
npm audit
npx better-npm-audit audit --level moderate
# Python
pip-audit
safety check
# Go
govulncheck ./...
Lock file integrity: Ensure package-lock.json, yarn.lock, poetry.lock, or go.sum is committed and reproducible.
Typosquatting: Check for packages with names very similar to popular ones (e.g., lodahs vs lodash).
Pinned versions in CI: Use exact versions or digests in CI/CD, not ranges.
SBOM generation: For production applications, recommend generating a Software Bill of Materials:
# Node.js
npx @cyclonedx/cyclonedx-npm --output-file sbom.json
# Python
cyclonedx-py environment -o sbom.json
Secrets in code are a critical and frequent finding. Check for:
.env files committed to git (check .gitignore)Detection tools:
# Gitleaks — scan git history for secrets
gitleaks detect --source . --verbose
# TruffleHog — scan git history
trufflehog git file://. --since-commit HEAD~20
# Detect-secrets
detect-secrets scan --all-files
Recommended patterns:
git filter-repo to scrub leaked secrets from historyWhile these references contain the security best practices for languages and frameworks, customers may have cases where they need to bypass or override these practices. Pay attention to specific rules and instructions in the project's documentation and prompt files which may require you to override certain best practices. When overriding a best practice, you MAY report it to the user, but do not fight with them. If a security best practice needs to be bypassed / ignored for some project specific reason, you can also suggest to add documentation about this to the project so it is clear why the best practice is not being followed and to follow that bypass in the future.
When producing a report, you should write the report as a markdown file in security_best_practices_report.md or some other location if provided by the user. You can ask the user where they would like the report to be written to.
The report should have a short executive summary at the top.
The report should be clearly delineated into multiple sections based on severity of the vulnerability. The report should focus on the most critical findings as these have the highest impact for the user. All findings should be noted with an numeric ID to make them easier to reference.
For critical findings include a one sentence impact statement.
Once the report is written, also report it to the user directly, although you may be less verbose. You can offer to explain any of the findings or the reasons behind the security best practices guidance if the user wants more info on any findings.
Important: When referencing code in the report, make sure to find and include line numbers for the code you are referencing.
After you write the report file, summarize the findings to the user.
Also tell the user where the final report was written to
If you produced a report, let the user read the report and ask to begin performing fixes.
If you passively found a critical finding, notify the user and ask if they would like you to fix this finding.
When producing fixes, focus on fixing a single finding at a time. The fixes should have concise clear comments explaining that the new code is based on the specific security best practice, and perhaps a very short reason why it would be dangerous to not do it in this way.
Always consider if the changes you want to make will impact the functionality of the user's code. Consider if the changes may cause regressions with how the project works currently. It is often the case that insecure code is relied on for other reasons (and this is why insecure code lives on for so long). Avoid breaking the user's project as this may make them not want to apply security fixes in the future. It is better to write a well thought out, well informed by the rest of the project, fix, then a quick slapdash change.
Always follow any normal change or commit flow the user has configured. If making git commits, provide clear commit messages explaining this is to align with security best practices. Try to avoid bunching a number of unrelated findings into a single commit.
Always follow any normal testing flows the user has configured (if any) to confirm that your changes are not introducing regressions. Consider the second order impacts the changes may have and inform the user before making them if there are any.
Below is a few bits of secure coding advice that applies to almost any language or framework.
When assigning an ID for some resource, which will then be used by exposed to the internet, avoid using small auto-incrementing IDs. Use longer, random UUID4 or random hex string instead. This will prevent users from learning the quantity of a resource and being able to guess resource IDs.
While TLS is important for production deployments, most development work will be with TLS disabled or provided by some out-of-scope TLS proxy. Due to this, be very careful about not reporting lack of TLS as a security issue. Also be very careful around use of "secure" cookies. They should only be set if the application will actually be over TLS. If they are set on non-TLS applications (such as when deployed for local dev or testing), it will break the application. You can provide a env or other flag to override setting secure as a way to keep it off until on a TLS production deployment. Additionally avoid recommending HSTS. It is dangerous to use without full understanding of the lasting impacts (can cause major outages and user lockout) and it is not generally recommended for the scope of projects being reviewed by codex.
This section documents known failure modes and edge cases when applying security best practices:
Pitfall: The agent assumes that security best practices apply universally to all code contexts, without understanding the specific constraints, threat models, or deployment contexts of the user's project.
Manifestation:
Mitigation:
Pitfall: Flagging missing HTTPS or TLS as a security vulnerability in local development, test, or CI environments where TLS is not yet deployed.
Manifestation:
Mitigation:
See also: A note on TLS above for related guidance
Pitfall: Recommending setting Secure, HttpOnly, and SameSite cookie flags in development environments, which breaks the application when running over non-TLS connections (localhost, HTTP-only dev servers).
Manifestation:
Secure but the dev server uses HTTPMitigation:
Secure in production, not in developmentsecure: process.env.NODE_ENV === 'production')See also: A note on TLS above for related guidance
Pitfall: Treating all security best practices as absolute rules, without acknowledging legitimate reasons to deviate, override, or postpone them.
Manifestation:
Mitigation:
Pitfall: Passively flagging security concerns while the agent is working, without understanding whether the user wants active security monitoring or is focused on feature delivery.
Manifestation:
Mitigation:
LICENSE.txt (opens in a new tab)agents/openai.yaml (opens in a new tab)references/golang-general-backend-security.md (opens in a new tab)references/javascript-express-web-server-security.md (opens in a new tab)references/javascript-general-web-frontend-security.md (opens in a new tab)references/javascript-jquery-web-frontend-security.md (opens in a new tab)references/javascript-typescript-nextjs-web-server-security.md (opens in a new tab)references/javascript-typescript-react-web-frontend-security.md (opens in a new tab)references/javascript-typescript-vue-web-frontend-security.md (opens in a new tab)references/python-django-web-server-security.md (opens in a new tab)references/python-fastapi-web-server-security.md (opens in a new tab)references/python-flask-web-server-security.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Generated from the plugin's indexed repository (ckorhonen/claude-skills) — no native marketplace selected
npx claudepluginhub p/ckorhonen-claude-skills59 skills in this plugin
/agent-browserAutomate headless browser interactions using agent-browser CLI. Use when scraping web pages, automating form submissions, testing web apps, or performing browser automation tasks. Works with element refs (@e1, @e2) optimized for AI agent reasoning./agent-engineeringBattle-tested engineering principles for AI coding agents. Covers plan-first workflow, subagent delegation, self-improvement loops, verification gates, elegant solutions, autonomous bug fixing, and structured task management. Use when configuring agent behavior, writing AGENTS.md files, or improving agent reliability and code quality./app-marketing-copyWrite marketing copy and App Store / Google Play listings (ASO keywords, titles, subtitles, short+long descriptions, feature bullets, release notes), plus screenshot caption sets and text-to-image prompt templates for generating store screenshot backgrounds/promo visuals. Use when asked to: write/refresh app marketing copy, craft app store metadata, brainstorm taglines/value props, produce ad/landing/email copy, or generate prompts for screenshot/creative generation./ascii-pixel-artGenerate animated ASCII art from images with subject detection, blurred pixelated backgrounds, and dynamic visual effects. Use when asked to create ASCII art, convert an image to ASCII, generate pixel art, add animated text art effects, or make retro-style visual art from photos./autopredictWrap the howdymary/autopredict Polymarket trading-agent repo. Use when you need to scan live Polymarket markets, inspect structural event mispricing, evaluate a market with your own fair probability, run reproducible backtests against a JSON dataset, tune strategy parameters safely, or review the repo's paper/live trading scaffolds and failure modes./autoresearchRun a rigorous autonomous experiment loop for any optimization target using explicit hypotheses, repeated trials, structured experiment logs, and local HTML reports. Use when asked to "run autoresearch", "optimize X in a loop", "start experiments", or "improve this with benchmark-driven iteration".Other plugins' skills for the same job