skills/harden/SKILL.md
Harden code proactively against vulnerabilities at the boundary where untrusted input enters the system. Use when implementing auth, handling user input, storing or transmitting sensitive data, integrating external APIs, adding file uploads, or any code that crosses a trust boundary. Don't use for reactive secret scanning (use `safe-repo`) or dependency CVE checks (use `deps-audit`).
npx skillsauth add helderberto/skills hardenInstall 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.
Security as a constraint on every line that touches user data, auth, or external systems. This skill is proactive: applied during implementation, not after. For reactive scans, use safe-repo (sensitive data) or deps-audit (CVEs).
httpOnly, secure, sameSiteeval() or innerHTML with user-provided data| Risk | Mitigation | |------|------------| | Injection (SQL/NoSQL/OS) | Parameterized queries; ORM with bound params; never concat user input | | Broken authentication | bcrypt/argon2 hashing; httpOnly+secure+sameSite cookies; rate-limit auth endpoints | | XSS | Framework auto-escape; sanitize with DOMPurify if HTML is unavoidable | | Broken access control | Check authorization on EVERY endpoint; verify ownership, not just authentication | | Misconfiguration | helmet for headers; CORS restricted to known origins via env var | | Sensitive data exposure | Strip sensitive fields before API response; env vars for secrets | | Insufficient logging | Log auth failures, access denials, input rejections | | SSRF | Allowlist outbound destinations; never fetch user-provided URLs without validation |
Always validate at the system boundary (route handler, message consumer), not in business logic:
mimetype)npm audit / CVE findingsCritical or High severity?
├── Vulnerable code reachable in your app?
│ ├── YES → Fix immediately
│ └── NO (dev-only, unused path) → Fix soon, not a blocker
└── Fix available?
├── YES → Update to patched version
└── NO → Workaround / replace dep / allowlist with review date
Defer with documented reason and review date. Never silent allowlist.
.env.example → committed (template, placeholder values)
.env → NOT committed (real secrets)
.env.local → NOT committed (local overrides)
*.pem, *.key → NOT committed
Pre-commit check: git diff --cached | grep -iE "password|secret|api_key|token". Better: safe-repo --diff as part of ship.
*) or no CORS configAfter implementing security-relevant code, confirm:
deps-audit shows no critical or high CVEs (or each is documented with review date)safe-repo --diff cleancurl -I)| Rationalization | Reality | |-----------------|---------| | "Internal tool, security doesn't matter" | Internal tools get compromised; attackers target the weakest link | | "We'll add security later" | Retrofitting is 10x harder than building it in | | "No one would exploit this" | Automated scanners will; security-by-obscurity is not security | | "Framework handles security" | Frameworks provide tools, not guarantees | | "It's a prototype" | Prototypes become production; habits compound |
tools
Teach the user a new skill or concept, within this workspace.
documentation
Compact the current conversation into a handoff document for another agent to pick up.
testing
Ultra-compressed communication mode. Cuts token usage ~75% by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.
development
Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, or build a new skill, or asks "make a skill for X".