Set up AI Guard in the current JavaScript/TypeScript project so every change is checked automatically - project hooks for Claude Code, Cursor and Codex, a pre-commit gate, and an agent-config check - after showing the user exactly what will change. Use when the user asks to set up, install or enable AI Guard, or wants checks to run automatically instead of on request.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Setup?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ai-guard-dev-setup)
---
name: setup
description: Set up AI Guard in the current JavaScript/TypeScript project so every change is checked automatically - project hooks for Claude Code, Cursor and Codex, a pre-commit gate, and an agent-config check - after showing the user exactly what will change. Use when the user asks to set up, install or enable AI Guard, or wants checks to run automatically instead of on request.
argument-hint: "[--agent claude|cursor|codex|all] [--check-installs]"
---
# Set up AI Guard in this project
This plugin itself only contains instructions. Automatic checks after each edit and before Claude finishes need AI Guard installed in the project, which the `protect` command does. **Only do this when the user asks for it, and only after they have seen the dry run.**
Arguments: `$ARGUMENTS` (passed to `protect`, for example `--agent all` or `--check-installs`).
## 1. Show what would change
From the project root, with Bash:
```bash
npx --yes eslint-plugin-ai-guard@1.4.8 protect --dry-run $ARGUMENTS
```
Show the user the output. It lists:
- the devDependency it installs (`eslint-plugin-ai-guard`, plus `@typescript-eslint/parser` in TypeScript projects), with the project's package manager;
- the hook entries it adds to the project's agent settings (for Claude Code, `.claude/settings.json`: PostToolUse, SessionStart, Stop and PreToolUse): a check after JS/TS edits, a verification when the agent finishes, and confirmation before commands that skip Git hooks (`--no-verify`, `HUSKY=0`);
- the pre-commit gate (`verify --staged`) through the project's hook manager, or `.git/hooks/pre-commit` when there is none (local to that clone);
- the agent-config check of `CLAUDE.md`, `AGENTS.md`, skills and MCP config.
Explain that the hooks run AI Guard from the project's own `node_modules`, are committed with the project, and can be removed by deleting those entries.
## 2. Apply it only if the user agrees
If the user confirms, run the same command without `--dry-run`:
```bash
npx --yes eslint-plugin-ai-guard@1.4.8 protect $ARGUMENTS
```
Running it again changes nothing. Options: `--no-agent-hooks` (no agent hooks), `--no-git-hook` (no pre-commit gate), `--no-install`, `--check-installs` (also check npm packages before agents install them; sends package names to the npm registry).
## 3. Report
Summarize the final output: what was installed and which files were changed. Mention that new project hooks may only take effect in a new Claude Code session, and that the user should review the changed files before committing them.