/ai-guard:verify-changes [file-or-directory] [preset]from AI Guard
Scans JavaScript/TypeScript changes with AI Guard for bugs like floating promises, empty catches, hardcoded secrets, and SQL injection. Fixes findings and rescans until clean.
Ships in AI Guard. 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.
AI Guard is a deterministic, read-only analyzer. Its tools report findings; you make the fixes with your normal editing tools. Never claim code is clean unless a scan says so.
Arguments: $ARGUMENTS (optional path, optional preset).
| Situation | Tool and arguments |
|---|---|
| Default: verify everything changed (staged, unstaged, untracked JS/TS) | ai_guard_scan_diff {} |
| Changes on a branch | ai_guard_scan_diff {"base": "main"} (use the exact local ref) |
| One file was given or just written | ai_guard_scan_file {"path": "<file>"} |
| A directory was given, or a baseline is needed | ai_guard_scan_project {"path": "<dir>"} |
If a path argument was given, scan that file or directory. Preset defaults to agent (high-confidence rules). Use recommended, strict, or security only when asked. Keep the same tool, scope, and preset for every rescan.
| Result | Meaning | What to do |
|---|---|---|
status: "complete", clean: true | Every selected file was analyzed; no findings | Report it as clean and stop |
status: "complete", clean: false | Analysis finished; issues lists findings | Fix them (step 3) |
status: "partial" | Not a clean result. See errors[].code: PARSE_ERROR, PARSER_UNAVAILABLE, INCOMPLETE_SCAN, ANALYSIS_ERROR, or RESULT_LIMIT (more findings than returned; totalIssues has the real count) | Fix returned findings; report every non-RESULT_LIMIT error to the user |
status: "failed" | The scan did not run (OUTSIDE_WORKSPACE, FILE_EXCLUDED, GIT_FAILED, INVALID_GIT_REF, RESOURCE_LIMIT, SERVER_BUSY, …) | Report errors[].code and message. Retry SERVER_BUSY once. Never treat it as clean |
If the AI Guard tools are not available (the MCP server failed to start or is disabled), say so plainly, point the user to /mcp, and do not state or imply the code was verified.
For every issue: open file at line, read the surrounding code, and fix the root cause using its remediation. If the rule is unclear, call ai_guard_rules with {"rules": ["<ruleId>"]} for its description, fix, and docs link.
Rescan with the same arguments. Repeat steps 2–4 at most 3 times. If findings remain after that, stop and report them.
For findings marked fixable: true, ai_guard_fix with {"path": "<file>"} shows the deterministic fix as a diff, and "apply": true writes it.
Call ai_guard_verify_change {}. If pass is false, fix blocking. Tell the user about every item in disclosures (deleted, skipped or weakened tests, agent-config changes), or undo them. Fix the code rather than the tests.
End with one line: findings fixed, findings remaining, and the final status/clean values. Say "clean" only when the last scan returned status: "complete" and clean: true.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub ai-guard-dev/eslint-plugin-ai-guard --plugin ai-guardOther plugins' skills for the same job