Skip to content
Documentation

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.

Copy it into your project once after installing the package:

Terminal window
mkdir -p .claude/skills/astro-cookie-consent
cp node_modules/astro-cookie-consent/SKILL.md .claude/skills/astro-cookie-consent/SKILL.md

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.

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.