Verify JavaScript/TypeScript changes with AI Guard before calling work done. Runs the AI Guard CLI on the change, fixes each finding, and reruns until the change verifies. Use after writing or editing JS/TS code, before committing, or when asked to check code for floating promises, empty catches, hardcoded secrets, SQL injection, weakened tests, or other AI-generated-code bugs.
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 Verify Changes?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ai-guard-dev-verify-changes-eslint-plugin-ai-guard)
---
name: verify-changes
description: Verify JavaScript/TypeScript changes with AI Guard before calling work done. Runs the AI Guard CLI on the change, fixes each finding, and reruns until the change verifies. Use after writing or editing JS/TS code, before committing, or when asked to check code for floating promises, empty catches, hardcoded secrets, SQL injection, weakened tests, or other AI-generated-code bugs.
argument-hint: "[file-or-directory] [preset]"
---
# Verify changes with AI Guard
AI Guard is a deterministic, open-source analyzer (`eslint-plugin-ai-guard` on npm, MIT). It reports findings; **you** make the fixes with your normal editing tools. Never say code is clean unless AI Guard's output says so.
Arguments: `$ARGUMENTS` (optional path, optional preset: `agent`, `recommended`, `strict` or `security`).
## How to run AI Guard
Run it with Bash from the project root. Every command goes through the user's normal permission prompt.
- If the project already has AI Guard (`node_modules/.bin/ai-guard` exists), use `npx ai-guard <command>`.
- Otherwise use the pinned package. The TypeScript parser is included so `.ts` files are analyzed:
```bash
npx --yes -p eslint-plugin-ai-guard@1.4.8 -p @typescript-eslint/parser ai-guard <command>
```
Never run a bare `npx ai-guard` in a project that does not have AI Guard installed: that name resolves to an unrelated npm package.
Below, `AI_GUARD` stands for whichever of the two forms applies.
## 1. Choose the check
| Situation | Command |
| --- | --- |
| Default: the uncommitted change (staged, unstaged, untracked) | `AI_GUARD verify --json` |
| Changes on a branch | `AI_GUARD verify --base main --json` (use the exact local ref) |
| A file or directory was given | `AI_GUARD run --path <path> --preset <preset> --json` |
`verify` defaults to the `agent` preset (high-confidence rules). Use another preset only when asked, and keep the same command for every rerun.
## 2. Read the result
**`verify --json`** prints one JSON object:
| Field | Meaning | What to do |
| --- | --- | --- |
| `success: false` | Verification could not run (`errors[]` says why) | Report the error. Never treat it as clean |
| `pass: true` | Every changed file was analyzed and nothing blocks | Report `disclosures` (step 5), then stop |
| `blocking[]` | Problems the change introduced | Fix each one (step 3) |
| `disclosures[]` | Deleted, skipped or weakened tests, agent-config changes, duplicated code | Tell the user about each one, or undo it |
| `errors[]` | Files that could not be analyzed | The change is not verified; report them |
Each finding has `file`, `line`, `check`, `message` and usually `remediation`.
**`run --json`** prints `files[].issues[]` with `ruleId`, `line`, `message` and `remediation`, plus `totalErrors`, `totalWarnings` and `parserErrors`. A non-empty `parserErrors` means some files were not checked: report them.
## 3. Fix each finding
Open `file` at `line`, read the surrounding code, and fix the root cause using `remediation`.
- Make the smallest correct change. Do not add `eslint-disable` comments, skip tests or loosen configuration to make a finding go away. AI Guard reports those changes too.
- If a finding is a genuine false positive, leave the code and tell the user which finding and why.
- If a fix needs a product decision (for example, which auth middleware to use), ask instead of guessing.
## 4. Rerun
Rerun the same command. Repeat steps 2 to 4 at most 3 times. If findings remain, stop and report them.
## 5. Report
End with one line: findings fixed, findings remaining, and the final result. Say "verified" only when the last `verify` returned `success: true` and `pass: true` with an empty `errors`, and list every disclosure.