Skip to content
SlashClone

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.

SkillDevOpsv0.1.0 (latest)Tested
Activity
New: be the first to try it
  1. 1{
  2. 2 "name": "cookie-consent-banner",
  3. 3 "owner": "slashclone",
  4. 4 "version": "0.1.0",
  5. 5 "type": "skill",
  6. 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. 7 "category": "devops",
  8. 8 "license": "MIT",
  9. 9 "compat": ["claude-code"],
  10. 10 "permissions": {
  11. 11 "shell": ["node scripts/consent-plan.mjs"],
  12. 12 "files": {
  13. 13 "read": ["./examples/**", "./data/**", "./templates/**", "./src/**", "./app/**"],
  14. 14 "write": ["./out/consent-plan*"]
  15. 15 }
  16. 16 },
  17. 17 "tests": {
  18. 18 "cases": [
  19. 19 {
  20. 20 "name": "plans the example registry with no problems",
  21. 21 "inputs": {},
  22. 22 "checks": [
  23. 23 {
  24. 24 "type": "command_exits_zero",
  25. 25 "command": "node scripts/consent-plan.mjs --services examples/services.json --out out/consent-plan.json"
  26. 26 },
  27. 27 {
  28. 28 "type": "output_matches_schema",
  29. 29 "path": "out/consent-plan.json",
  30. 30 "schema": {
  31. 31 "type": "object",
  32. 32 "required": ["problems", "categories", "csp", "cookieTable"],
  33. 33 "properties": {
  34. 34 "problems": {
  35. 35 "type": "array",
  36. 36 "maxItems": 0
  37. 37 },
  38. 38 "banner": {
  39. 39 "const": true
  40. 40 },
  41. 41 "categories": {
  42. 42 "const": ["analytics", "advertising", "media"]
  43. 43 },
  44. 44 "csp": {
  45. 45 "type": "object",
  46. 46 "properties": {
  47. 47 "frame": {
  48. 48 "const": ["https://player.video.example"]
  49. 49 }
  50. 50 }
  51. 51 }
  52. 52 }
  53. 53 }
  54. 54 }
  55. 55 ]
  56. 56 },
  57. 57 {
  58. 58 "name": "catches a clear pattern that would sign people out and an http host",
  59. 59 "inputs": {
  60. 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. 61 },
  62. 62 "checks": [
  63. 63 {
  64. 64 "type": "command_exits_zero",
  65. 65 "command": "node scripts/consent-plan.mjs --services data/bad.json --out out/consent-plan.json --report-only"
  66. 66 },
  67. 67 {
  68. 68 "type": "output_matches_schema",
  69. 69 "path": "out/consent-plan.json",
  70. 70 "schema": {
  71. 71 "type": "object",
  72. 72 "properties": {
  73. 73 "problems": {
  74. 74 "type": "array",
  75. 75 "minItems": 2,
  76. 76 "maxItems": 2
  77. 77 }
  78. 78 }
  79. 79 }
  80. 80 }
  81. 81 ]
  82. 82 }
  83. 83 ]
  84. 84 }

Cookies that keep you signed in and remember these choices are always on. Everything else is off until you turn it on.