Using with AI coding agents
The package ships a SKILL.md (Claude Code skill format) documenting its own API, common
customization recipes, and guardrails — like “never edit files inside node_modules” or
“don’t pre-check a category without a specific reason” — so an agent can safely make changes on
your behalf. Things like “change the cookie banner text to X” or “gate this new analytics
script behind consent” work without the agent guessing at prop names or breaking the
zero-flash design.
Setup for Claude Code
Section titled “Setup for Claude Code”Copy it into your project once after installing the package:
mkdir -p .claude/skills/astro-cookie-consentcp node_modules/astro-cookie-consent/SKILL.md .claude/skills/astro-cookie-consent/SKILL.mdOther agents
Section titled “Other agents”It’s a plain Markdown file, so it works as context for any agent that can read a file from the
repo — point it at node_modules/astro-cookie-consent/SKILL.md directly if your tool doesn’t
use the .claude/skills convention.
What the guardrails cover
Section titled “What the guardrails cover”A few examples of what SKILL.md tells an agent to push back on rather than blindly comply
with:
- Adding a filled/accent background to the Accept or Decline buttons — they’re deliberately styled with equal prominence, see GDPR-related features.
- Pre-checking a category (
default: true) without a specific, deliberate reason. - “Fixing” the banner’s inline script to import
consent.js— it deliberately embeds its own copy of the read/write logic so it can render before first paint with zero flash. - Adding or changing privacy-policy wording on the user’s behalf — that’s the site owner’s call, not the agent’s.