/policystack:policystack-instrumentfrom policystack
Scans codebases for un-annotated data collection and egress, then inserts PolicyStack marker calls so the generated privacy policy reflects actual data flows.
Ships in policystack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Make the policy reflect reality: annotate real data flows at their call sites
so the @policystack/vite build scans them into the config. The markers are
identity functions — they return their value unchanged and have no runtime
effect; the build reads them statically.
@policystack/sdk)collecting(category, value, labels) — wrap a value at the point it is
stored. labels maps each field to a human label, or Ignore to
exclude it (e.g. password: Ignore).sharing(key, recipient, value) — wrap an outbound payload at a data
egress edge (the CCPA sell/share signal).thirdParty(name, purpose, policyUrl?) — declare a vendor exists; place
next to its initialisation.defineCookie(category) — declare a consent category at its use site.Constraint: category, key, recipient, name and the label
map must be string / object literals. Non-literal arguments are skipped by
the static scanner (it emits a build diagnostic — they are not silently lost,
but no annotation is produced). Never pass a variable.
The scanner already recognises common cookie/vendor surfaces (document.cookie,
js-cookie, cookies-next, react-cookie, server set-cookie, and
~30 known vendor imports) and flags any that are not gated by
<ConsentGate>, a consent.has(...) check, or an accept/set helper. Look
for, in priority order:
collecting().sharing() and no thirdParty().localStorage writes and tracker <script>/SDK init with no
defineCookie() and not consent-gated.DataCategories.AccountInfo, DataCategories.Communications, DataCategories.DeviceInfo, DataCategories.LocationData, DataCategories.PaymentInfo, DataCategories.SessionData, DataCategories.UsageDataLegalBases.Consent, LegalBases.Contract, LegalBases.LegalObligation, LegalBases.LegitimateInterests, LegalBases.PublicTask, LegalBases.VitalInterestsRetention.AsRequiredByLaw, Retention.NinetyDays, Retention.OneYear, Retention.ThirtyDays, Retention.ThreeYears, Retention.UntilAccountDeletion, Retention.UntilSessionExpiryProviders.AWS, Providers.Auth0, Providers.Clerk, Providers.Cloudflare, Providers.Datadog, Providers.GoogleAnalytics, Providers.LemonSqueezy, Providers.Loops, Providers.Mixpanel, Providers.Paddle, Providers.PayPal, Providers.Plausible, Providers.PostHog, Providers.Postmark, Providers.Resend, Providers.SendGrid, Providers.Sentry, Providers.Stripe, Providers.VercelCompliance.CCPA, Compliance.GDPR, Compliance.UK_GDPRdata.context /
cookies.context entry in policystack.ts (the typed config enforces
this).policystack-audit to confirm the config still validates.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub jamiedavenport/policystack --plugin policystack4 skills in this plugin
/policystack-auditAudit a policystack.ts config: run `policystack validate --json`, explain each issue code, propose a minimal config fix, then re-validate until clean. Use when a PolicyStack config has validation errors or warnings./policystack-initScaffold PolicyStack in a project: run the @policystack/cli installer, then wire the single <PolicyStack> provider (policy + consent). Use when adding a privacy/cookie policy or a consent banner to a web app./policystack-jurisdictionExplain the consent and policy-text posture (the §4.2 stance) implied by a set of declared PolicyStack `jurisdictions`. Use when choosing or reviewing the `jurisdictions` array in policystack.ts.Other plugins' skills for the same job