/policystack:policystack-initfrom policystack
Scaffolds PolicyStack in a project: runs the @policystack/cli installer, wires the single <PolicyStack> provider for privacy/cookie policy and consent. Use when adding a consent banner or generating policies from a typed config.
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.
Set PolicyStack up in an existing project. PolicyStack generates a privacy
policy, a cookie policy, and the consent runtime from one typed
defineConfig() call. It is not legal advice — a lawyer should review the
output before publication.
npx @policystack/cli@latest init
init detects the package manager and framework from package.json,
installs @policystack/sdk plus the right framework integration, scaffolds a
starter policystack.ts (src/policystack.ts when a src/ directory
exists, else the project root), writes policystack.llms.txt next to it, and
prints a setup prompt. Useful flags: --cwd, --pm, --skip-install,
--dry-run, --yes, --out, --force.
If init cannot run, install by hand: @policystack/sdk always, plus
@policystack/vite and the framework package (@policystack/react, …).
policystack.tsRead the generated policystack.llms.txt — it is the type-accurate SDK
reference (jurisdiction ids, lawful bases, presets) for this exact version.
The canonical, commented reference config is
examples/tanstack/src/policystack.ts.
jurisdictions is required and non-empty. Valid ids:
br, ca, ch, eea, row, uk, us, us-ak, us-al, us-ar, us-az, us-ca, us-co, us-ct, us-de, us-fl, us-ga, us-hi, us-ia, us-id, us-il, us-in, us-ks, us-ky, us-la, us-ma, us-md, us-me, us-mi, us-mn, us-mo, us-ms, us-mt, us-nc, us-nd, us-ne, us-nh, us-nj, us-nm, us-nv, us-ny, us-oh, us-ok, us-or, us-pa, us-ri, us-sc, us-sd, us-tn, us-tx, us-ut, us-va, us-vt, us-wa, us-wi, us-wv, us-wy. All 50 US states use their ISO us-<state> code. Pick the
codes that actually apply; policystack-jurisdiction explains the posture
each implies.
Wrap the app root once with the single provider — it supplies both the policy context and the consent store (derived from the same config):
import { PolicyStack } from "@policystack/react/provider";
import config from "./policystack";
export function App({ children }: { children: React.ReactNode }) {
return <PolicyStack config={config}>{children}</PolicyStack>;
}
<PrivacyPolicy> / <CookiePolicy>, useConsent, and ConsentGate
all read from it. Components ship unstyled and emit data-op-* attributes.
For non-React frameworks use that framework's @policystack/<fw> package.
Run policystack-audit (policystack validate --json) and resolve every
issue before shipping. Annotate real data flows with policystack-instrument
so the policy reflects what the code actually does.
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-instrumentFind un-annotated data collection and data egress in a codebase and add PolicyStack `collecting()` / `sharing()` / `thirdParty()` / `defineCookie()` call sites so the generated policy reflects what the code actually does./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