From 5af33794706736dfef5dd01a78e2f2d5250364a9 Mon Sep 17 00:00:00 2001 From: iWP Claudy Date: Sun, 2 Aug 2026 20:15:46 +0200 Subject: [PATCH] Add design/accessibility/security/sanitization skills --- README.md | 8 ++ skills/code-sanitization/SKILL.md | 99 +++++++++++++++++++++++ skills/security-headers-and-tls/SKILL.md | 80 ++++++++++++++++++ skills/web-accessibility/SKILL.md | 76 +++++++++++++++++ skills/web-design-best-practices/SKILL.md | 66 +++++++++++++++ 5 files changed, 329 insertions(+) create mode 100644 skills/code-sanitization/SKILL.md create mode 100644 skills/security-headers-and-tls/SKILL.md create mode 100644 skills/web-accessibility/SKILL.md create mode 100644 skills/web-design-best-practices/SKILL.md diff --git a/README.md b/README.md index d2e43cc..fd8b2fd 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,14 @@ than assuming the delegate can fetch it itself. as fact; how to actually re-verify. - `karpathy-guidelines` -- general LLM-coding behavioral guidelines (simplicity, surgical changes, surfacing assumptions). +- `web-design-best-practices` -- modern UI/UX conventions to apply by + default (typography, spacing, color/contrast, motion, forms). +- `web-accessibility` -- WCAG-aligned baseline (semantic HTML, keyboard + nav, contrast, ARIA usage, forms). +- `security-headers-and-tls` -- HTTP security headers and TLS/SSL + configuration strength, including reverse-proxy-layer gotchas. +- `code-sanitization` -- framework-agnostic injection-prevention baseline + (SQLi, XSS, command injection, path traversal, uploads, deserialization). ## Provenance diff --git a/skills/code-sanitization/SKILL.md b/skills/code-sanitization/SKILL.md new file mode 100644 index 0000000..a04a37e --- /dev/null +++ b/skills/code-sanitization/SKILL.md @@ -0,0 +1,99 @@ +--- +name: code-sanitization +description: Use when writing any code that handles external input (user input, API responses, file uploads, database queries, shell commands). Framework-agnostic injection-prevention baseline. +--- + +# Code Sanitization + +Framework-agnostic baseline for handling untrusted input safely. Applies +regardless of language — the specific function names differ, the +principle doesn't. + +## The core rule: sanitize on input, escape on output, separately + +These are two different concerns, both required: +- **Sanitize/validate on input**: reject or normalize data that doesn't + match the expected shape, as early as possible (at the point you first + receive it). +- **Escape on output**: transform data for the specific context it's + being placed into (HTML, a SQL query, a shell command, a URL, JSON) — + every different output context needs its OWN escaping, applied at the + point of output, not once globally. + +A common real mistake: sanitizing once on input and assuming that's +sufficient for every later output context. It isn't — data that's safe +to store isn't automatically safe to interpolate into HTML, and separately +isn't automatically safe to interpolate into a shell command. + +## SQL injection + +**Parameterized queries / prepared statements, always, no exceptions.** +Never build a SQL string via concatenation or interpolation with a +variable in it, even if you're "sure" the variable is safe (a value that +was safe when the code was written is not guaranteed to stay safe as +the codebase evolves and new call sites appear). + +## Cross-site scripting (XSS) + +Escape for the exact context: +- HTML body text: HTML-entity-escape (`<`, `>`, `&`, `"`, `'`). +- HTML attribute: attribute-escape (stricter than body-text escaping). +- JavaScript string embedded in a `