Cookie consent banner
@slashclone/cookie-consent-banner
Add an honest cookie banner to a web app: analytics, ad pixels, and video embeds load only after a yes, and saying no is one click. One registry of every cookie and service drives the banner, the loaders, the CSP, and the privacy page's cookie table. Includes a registry checker and React templates.
- Activity
- New: be the first to try it
- Installs
- 0 installs
- Likes
- 0 likes
- Clones
- 0 clones
- 1{
- 2 "name": "cookie-consent-banner",
- 3 "owner": "slashclone",
- 4 "version": "0.1.0",
- 5 "type": "skill",
- 6 "description": "Add an honest cookie banner to a web app: analytics, ad pixels, and video embeds load only after a yes, and saying no is one click. One registry of every cookie and service drives the banner, the loaders, the CSP, and the privacy page's cookie table. Includes a registry checker and React templates.",
- 7 "category": "devops",
- 8 "license": "MIT",
- 9 "compat": ["claude-code"],
- 10 "permissions": {
- 11 "shell": ["node scripts/consent-plan.mjs"],
- 12 "files": {
- 13 "read": ["./examples/**", "./data/**", "./templates/**", "./src/**", "./app/**"],
- 14 "write": ["./out/consent-plan*"]
- 15 }
- 16 },
- 17 "tests": {
- 18 "cases": [
- 19 {
- 20 "name": "plans the example registry with no problems",
- 21 "inputs": {},
- 22 "checks": [
- 23 {
- 24 "type": "command_exits_zero",
- 25 "command": "node scripts/consent-plan.mjs --services examples/services.json --out out/consent-plan.json"
- 26 },
- 27 {
- 28 "type": "output_matches_schema",
- 29 "path": "out/consent-plan.json",
- 30 "schema": {
- 31 "type": "object",
- 32 "required": ["problems", "categories", "csp", "cookieTable"],
- 33 "properties": {
- 34 "problems": {
- 35 "type": "array",
- 36 "maxItems": 0
- 37 },
- 38 "banner": {
- 39 "const": true
- 40 },
- 41 "categories": {
- 42 "const": ["analytics", "advertising", "media"]
- 43 },
- 44 "csp": {
- 45 "type": "object",
- 46 "properties": {
- 47 "frame": {
- 48 "const": ["https://player.video.example"]
- 49 }
- 50 }
- 51 }
- 52 }
- 53 }
- 54 }
- 55 ]
- 56 },
- 57 {
- 58 "name": "catches a clear pattern that would sign people out and an http host",
- 59 "inputs": {
- 60 "data/bad.json": "{\"consentCookie\":\"consent\",\"necessary\":[{\"name\":\"consent\",\"purpose\":\"Choice.\",\"lifetime\":\"6 months\"},{\"name\":\"session\",\"purpose\":\"Sign-in.\",\"lifetime\":\"30 days\"}],\"services\":[{\"id\":\"stats\",\"name\":\"Stats\",\"category\":\"analytics\",\"provider\":\"Example\",\"stores\":[{\"name\":\"id\",\"purpose\":\"Visitor id.\",\"lifetime\":\"1 year\"}],\"clear\":\"^(id|session)$\",\"csp\":{\"script\":[\"http://stats.example\"]}}]}"
- 61 },
- 62 "checks": [
- 63 {
- 64 "type": "command_exits_zero",
- 65 "command": "node scripts/consent-plan.mjs --services data/bad.json --out out/consent-plan.json --report-only"
- 66 },
- 67 {
- 68 "type": "output_matches_schema",
- 69 "path": "out/consent-plan.json",
- 70 "schema": {
- 71 "type": "object",
- 72 "properties": {
- 73 "problems": {
- 74 "type": "array",
- 75 "minItems": 2,
- 76 "maxItems": 2
- 77 }
- 78 }
- 79 }
- 80 }
- 81 ]
- 82 }
- 83 ]
- 84 }
- 85}
