skills/securing-code/SKILL.md
Use when writing or reviewing code that handles external input, manages access, touches data or crypto, or changes dependencies. Triggers: endpoints, auth/authz, DB/ORM, file handling, secrets, "is this secure?", "security review". NOT for formatting, pure UI, or explaining code.
npx skillsauth add ahgraber/skills securing-codeInstall 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.
Inform the user when this skill is being invoked: securing-code.
code-review invokes this skill internally for its security lensThese apply regardless of task type — implementation or review.
All of the following must be satisfied when generating or modifying code:
*); no unlimited operationsSecure, HttpOnly, SameSite=Lax (Strict for high-risk sessions); if SameSite=None, pair with Secure + CSRF defensesThe following categories have a large blast radius or affect the trust model. Surface them and get explicit user approval before writing code, even if the user's request implies them:
credentials: true, wildcard)For these, state what is changing and the risk, then wait for confirmation. A user request to "add login" is permission for the feature, not for a specific auth design — confirm the design first.
Push back on these framings — from the user or yourself — when they appear as justification for skipping a control:
| Rationalization | Reality | | ------------------------------------------------ | --------------------------------------------------------------------------------- | | "It's an internal tool, security doesn't matter" | Internal tools get compromised; attackers pivot through the weakest link. | | "We'll add security later" | Retrofitting is far harder than building it in; "later" usually means "in prod". | | "No one would try to exploit this" | Automated scanners find everything reachable; obscurity is not a control. | | "The framework handles it" | Frameworks provide tools, not guarantees — they still have to be wired correctly. | | "It's just a prototype / spike / demo" | Prototypes ship. The auth shortcut becomes the production auth. | | "This endpoint isn't exposed publicly" | Network boundaries change; SSRF, misconfig, and lateral movement reach it anyway. |
Apply Tier 1 above (always)
Open references/tier2-implementation.md and follow the checklist for your task type:
| Task | Section | | ----------------------------------- | ------- | | General feature / component | §2.1 | | REST or GraphQL API endpoint | §2.2 | | Auth, sessions, or access control | §2.3 | | Secrets, crypto, or data protection | §2.4 | | Supply chain or CI/CD | §2.5 |
For security-complex domains, also load the matching Tier 3 reference:
| Domain | Reference |
| ----------------------- | -------------------------------------- |
| Input handling | references/tier3-input-validation.md |
| File upload / download | references/tier3-file-upload.md |
| Database-heavy features | references/tier3-database.md |
| Auth / session flows | references/tier3-threat-modeling.md |
| C / C++ / embedded | references/tier3-memory-safety.md |
references/tier2-review.md for the review workflow and checklistreferences/owasp-2025.md to verify coverage against all 10 OWASP categoriesreferences/tier2-implementation.md — task-specific implementation checklists (§2.1–§2.5)references/tier2-review.md — code review workflow, OWASP-mapped checklist, output formatreferences/tier3-input-validation.md — allowlist validation, output encoding, CSPreferences/tier3-file-upload.md — file upload validation, storage, retrievalreferences/tier3-database.md — injection prevention, DB access control, encryptionreferences/tier3-error-handling.md — safe error handling, security event loggingreferences/tier3-memory-safety.md — C/C++ memory safety, compiler flags, sanitizersreferences/tier3-language-specific.md — Python, JS/Node, Java, C#/.NET forbidden patterns and safe alternativesreferences/tier3-threat-modeling.md — STRIDE, trust boundaries, risk ratingreferences/owasp-2025.md — OWASP Top 10 2025 with control mapping to skill tiersdevelopment
Use when the user wants rigorous, non-sycophantic editorial feedback on a draft, essay, blog post, or argument through back-and-forth dialogue — pressure-testing thesis, structure, argument, clarity, tone, and evidence. Triggers: "be my sparring partner", "pressure-test this draft", "poke holes in my argument", "is this ready to publish", "sharpen this post", "where is this weak". Not for one-shot copyediting, proofreading, or ghostwriting.
testing
Use when distilling the through-line gist of one or more sources — the spine, argument, tension, or recurring frame running through a set of documents, notes, research, or transcripts, OR across the ideas within a single rich piece — into a few concise paragraphs. Triggers: "synthesize", "what's the through-line/gist", "extract the insight", "pull these together". Not for faithful summary or condensation that covers what a source says, nor for comparisons or catalogs where enumeration is the deliverable.
development
Use when writing or reviewing tests in any language, or diagnosing a suite that is slow, brittle, or hard to read. Triggers: "write tests", "how should I test this", "what kind of test", "test is flaky/fragile", "should I mock this", "test is hard to read". For Python-specific guidance see `python-testing`.
development
Use when writing, debugging, or explaining Strudel live-coding music patterns — mini-notation syntax, pattern functions (fast/slow/every/off/stack), synth/sample selection, audio effects, scale/chord/voicing API, or EDM production recipes. Triggers: "write a Strudel pattern", "how do I make a bassline in Strudel", "what does .every() do", "strudel drum beat", "strudel chord voicing", any Strudel code question.