Quick Start
Five steps, no account required. You need Node.js 20 or newer and the CLI installed (npm install -g @prism-engine/cli).
Step 1: Initialize Prism
In your project directory:
prism initprism init makes no network calls. It reads your package.json, globals.css, and Tailwind config, then writes:
.prism/rules.json— your rule set (version 1 schema).claude/settings.json— Claude Code hooks (PreToolUse, PostToolUse, Stop), created or merged
If Cursor or Antigravity config directories exist, it also wires their hooks (.cursor/hooks.json, .agents/hooks.json). It never overwrites an existing rules.json without asking; use --yes to skip prompts (CI) or --force to regenerate.
Flags:
prism init --yes # accept defaults, no prompts
prism init --force # overwrite an existing .prism/rules.jsonStep 2: Look at what it generated
cat .prism/rules.jsonThe generated rules come from your own project. A typical generated starter contains a design-token rule (severity block, exact hex values lifted from your CSS, scoped to .tsx/.jsx/.ts/.js/.html) and an arbitrary-Tailwind-brackets rule (severity warn, heuristic).
Step 3: Edit a rule
Open .prism/rules.json and add a rule. This one blocks a color literal:
{
"version": 1,
"rules": [
{
"id": "styling/no-magenta",
"category": "styling",
"severity": "block",
"extensions": [".tsx"],
"instruction": "Use the design system palette. Never hardcode magenta.",
"check": {
"type": "forbidden_pattern",
"pattern": "#ff00ff",
"message": "Use the design system palette, not magenta."
}
}
]
}Step 4: See a violation get blocked
Create a file that breaks the rule, for example Button.tsx:
export const Button = () => (
<button style={{ color: "#ff00ff" }}>Click me</button>
);Check it by hand:
prism check Button.tsxYou get a finding for styling/no-magenta and exit code 1 (blocking violations found).
Step 5: Let the agent correct itself
Now open your project in Claude Code (or Cursor/Antigravity). The hooks from Step 1 run prism check on every write:
- PreToolUse — the proposed content is checked before the write lands; a
blockviolation exits with code 2 and the agent must fix it - PostToolUse — the written file is re-checked as a safety net
- Stop — the session cannot end while blocking violations remain in files it changed
Ask the agent to create the same Button.tsx. The hook fires, the agent reads the correction, and it rewrites the file without the banned color.
Working with something sensitive? Disable enforcement for a session:
export PRISM_DISABLE=1Connect to the dashboard (optional)
The CLI works without an account. If your team keeps rules on the dashboard (prism.syntaxure.dev ):
# 1. Sign up, create a project, add rules
# 2. Create an API key in Settings
export PRISM_API_KEY=your_key_here
# 3. Authenticate (opens the browser)
prism login
# 4. Fetch your team's rules into .prism/rules.json (fails safe)
prism pull
# Optional: pick a project explicitly
prism pull --project my-slugprism pull never breaks a working rules.json: if auth, the network, or the response is wrong, it keeps the existing file and warns.
What’s next?
- Rules — All rule types, categories, and severities
- Hooks and IDE Setup — Per-agent configuration
- CLI Reference — Every command
- Troubleshooting — When something does not fire