skills/security-best-practices/SKILL.md
Use when performing security reviews, writing secure-by-default code, generating vulnerability reports, or hardening existing codebases. Also use when the user mentions security audit, secure coding, OWASP, vulnerability assessment, or security best practices. NEVER use for general code review without security focus (use clean-code), penetration testing execution, or compliance certification (use data-privacy-compliance).
npx skillsauth add sharkitect-solutions/sharkitect-claude-toolkit security-best-practicesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Performs language-and-framework-specific security reviews, writes secure-by-default code, and generates prioritized vulnerability reports with actionable fixes.
| File | Purpose | Load When | |------|---------|-----------| | SKILL.md | Security review procedure, depth calibration, cross-language principles, report format, override handling | Always (auto-loaded) | | threat-modeling-guide.md | STRIDE methodology applied, trust boundary identification, attack surface enumeration, threat prioritization, business logic security threats, common threat modeling failures | When performing threat modeling, assessing attack surface for new features, or evaluating security architecture | | security-anti-patterns.md | Authentication anti-patterns (7), authorization anti-patterns (7), data handling anti-patterns (7), infrastructure anti-patterns (7), error handling anti-patterns (5), dependency anti-patterns (6) | When reviewing code for security issues, educating developers, or when a review finds vulnerabilities | | dependency-security-guide.md | Dependency audit procedure, vulnerability triage (CVSS+EPSS), lock file security, update strategies, npm/pip/Go-specific risks, CI/CD pipeline security, SBOM generation | When auditing dependencies, setting up supply chain security, or responding to vulnerability disclosures | | references/golang-general-backend-security.md | Go backend security patterns | Project uses Go | | references/javascript-express-web-server-security.md | Express.js server hardening | Project uses Express | | references/javascript-general-web-frontend-security.md | Frontend security fundamentals | Any web frontend project | | references/javascript-jquery-web-frontend-security.md | jQuery-specific XSS prevention | Project uses jQuery | | references/javascript-typescript-nextjs-web-server-security.md | Next.js server security | Project uses Next.js | | references/javascript-typescript-react-web-frontend-security.md | React frontend security | Project uses React | | references/javascript-typescript-vue-web-frontend-security.md | Vue frontend security | Project uses Vue | | references/python-django-web-server-security.md | Django security configuration | Project uses Django | | references/python-fastapi-web-server-security.md | FastAPI security patterns | Project uses FastAPI | | references/python-flask-web-server-security.md | Flask security hardening | Project uses Flask |
Loading rule: For web applications with both frontend and backend, load BOTH the backend framework guide AND the relevant frontend guide. If the frontend framework is unspecified, load javascript-general-web-frontend-security.md.
| This Skill Handles | Defer To | |---|---| | Security code review and vulnerability identification | clean-code (general code quality without security focus) | | Secure-by-default coding patterns | senior-backend (general backend architecture decisions) | | OWASP Top 10 and framework-specific security | vulnerability-scanner (automated scanning and EPSS-based triage) | | Threat modeling and attack surface analysis | data-privacy-compliance (GDPR/HIPAA/SOC2 compliance frameworks) | | Dependency and supply chain security | docker-expert (container security and image hardening) | | Security report generation | senior-architect (system-level architecture review) |
package.json, requirements.txt, go.mod, directory structure, and import statements. List your evidence.security_best_practices_report.md with executive summary, findings by severity, line numbers, and impact statements.| Trigger | Depth | Focus | |---------|-------|-------| | Writing new code in an existing project | Passive -- apply secure defaults from reference files | Input validation, auth patterns, output encoding | | User says "review security" or "security check" | Active -- audit changed files against reference guidance | Full OWASP Top 10 coverage for the detected stack | | User requests vulnerability report | Report -- comprehensive audit of entire codebase scope | All findings with severity, line numbers, fix recommendations | | Quick fix on a single file | Passive -- scan the file for critical issues only | Injection, auth bypass, secrets exposure |
These apply regardless of framework. Framework-specific rules in reference files override these when they conflict.
| Principle | Implementation | Why | |-----------|---------------|-----| | Never use incrementing IDs for public resources | UUID4 or random hex for any externally-exposed ID | Prevents enumeration attacks and leaks resource count | | Validate all external input at system boundaries | Whitelist validation on user input, API responses, file reads | Injection and type confusion attacks exploit unvalidated input | | Secrets never in code or env-committed files | Use secrets management (vault, env vars loaded at runtime, Docker secrets) | Secrets in code persist in git history even after deletion | | Parameterize all database queries | Use ORM query builders or parameterized statements -- never string concatenation | SQL injection remains the #1 exploited vulnerability class | | Output encode for the destination context | HTML-encode for DOM, URL-encode for query params, JSON-encode for API responses | XSS exploits output that reaches the browser unencoded | | Principle of least privilege | Minimal permissions for DB users, API keys, file access, container users | Limits blast radius when a component is compromised |
When generating a report, write to security_best_practices_report.md (or user-specified location):
Fix one finding at a time. Confirm no regressions after each fix. Follow the project's commit and testing conventions.
Project documentation or user instructions may override specific security practices. When overriding:
Secure cookie flag breaks non-TLS environments -- gate it behind a production/TLS flag| Rationalization | Why It Fails | |---|---| | "This is just a prototype, security doesn't matter yet" | Prototypes become production code; insecure patterns established early persist because refactoring is deferred indefinitely | | "The framework handles security automatically" | Frameworks provide defaults, not guarantees; misconfiguration, custom endpoints, and raw queries bypass framework protections | | "We'll add security in the next sprint" | Security debt compounds faster than technical debt; each insecure endpoint is an active attack surface, not a future TODO | | "Only internal users will access this" | Internal tools get exposed through VPN splits, contractor access, lateral movement after breach; internal != trusted | | "I already know the common vulnerabilities" | Knowledge of vulnerabilities doesn't prevent them -- structured reference checklists catch what tired developers miss | | "The input is always clean because we control the client" | Clients can be bypassed with curl, browser devtools, or a compromised frontend; server-side validation is mandatory |
* wildcard on authenticated endpointsdevelopment
When the user wants help with paid advertising campaigns on Google Ads, Meta (Facebook/Instagram), LinkedIn, Twitter/X, or other ad platforms. Also use when the user mentions 'PPC,' 'paid media,' 'ad copy,' 'ad creative,' 'ROAS,' 'CPA,' 'ad campaign,' 'retargeting,' or 'audience targeting.' This skill covers campaign strategy, ad creation, audience targeting, and optimization.
testing
--- name: using-sharkitect-methodology description: Use when starting any conversation in a Sharkitect workspace OR before any task involving NEW pricing, positioning, proposal, strategy, plan-execution, or schema-design work — mandates invocation of Sharkitect-specific methodology skills (pricing-strategy, marketing-strategy-pmm, smb-cfo, hq-revenue-ops, executing-plans, brainstorming) under the same anti-rationalization discipline as using-superpowers. Documentation has failed 4 times across H
testing
Use when user says 'end session', 'wrap up', 'stop for the day', 'done for today', 'close out', 'save session', 'wrapping up', or invokes /end-session. Runs the full 9-step end-of-session protocol: resource audit, MEMORY.md update, lessons capture, plan status, pending items, workspace checklist, .tmp/ audit, git commit+push, Supabase brain sync, session brief, summary. Final step schedules a detached self-kill of the current session ONLY (3s delay) so the window closes cleanly. Other claude.exe processes (active workspaces) are NOT touched -- orphan cleanup is handled separately by Claude-Orphan-Cleanup-Hourly with proper age safeguards. Do NOT use for: mid-session quick saves (use session-checkpoint), skill syncing (use sync-skills.py), brain memory queries (use supabase-sync.py pull), document freshness reviews (use document-lifecycle), resource gap detection (use resource-auditor).
testing
Remove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's comprehensive "Signs of AI writing" guide. Detects and fixes patterns including: inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, passive voice, negative parallelisms, and filler phrases.