# validation

> 运行验证、分析错误、验证项目/脚本、导入资源。一键 headless 运行 + 错误分析，或按需单项检查。

| 属性 | 值 |
|------|-----|
| 所属层 | headless |
| 安全级别 | danger-api |
| 需要 Godot | 否 |
| 需要编辑器 | 否 |
| 只读 | 否 |
| 长耗时 | 是 |

## Actions

- `run_and_verify`
- `analyze_error`
- `validate_project`
- `validate_scripts`
- `import_resources`
- `assert`
- `stress`
- `export_list_presets`
- `export_get_preset`
- `export_build`
- `validate_gdd`
- `chain_verify`
- `verify_delivery`

## Parameters

| 参数 | 类型 | 必填 | 说明 |
|------|------|------|------|
| `action` | enum (13 项) | ✓ | 操作类型 |
| `project_path` | string |  | Godot 项目目录路径（可选，默认使用 GODOT_PROJECT_PATH 环境变量或当前目录） |
| `scope` | enum: scene | script | full |  | 验证范围(verify_delivery 必填): scene/script/full。其他 action 忽略 |
| `scene_path` | string |  | 场景路径(scope=scene,相对项目,verify_delivery) |
| `script_path` | string |  | 脚本路径(scope=script,相对项目,verify_delivery) |
| `scene` | string |  | 可选场景文件路径（run_and_verify） |
| `timeout` | number |  | 超时秒数（默认 20） |
| `capture_tree` | boolean |  | 同时捕获场景树快照（默认 false） |
| `output` | string |  | Godot 运行时输出全文（analyze_error） |
| `check_resources` | boolean |  | 检查缺失资源文件（默认 true） |
| `check_scripts` | boolean |  | 检查断裂脚本引用（默认 true） |
| `check_scenes` | boolean |  | 验证场景文件结构（默认 true） |
| `exclude_paths` | array |  | 排除的目录路径（相对项目根）。默认排除：.godot, .import |
| `scripts` | array |  | 要验证的脚本路径数组（相对项目）。省略则扫描全部 .gd 文件 |
| `directory` | string |  | 扫描目录（相对项目，如 "assets/ui"） |
| `extensions` | array |  | 导入文件扩展名（默认常见图片/音频/字体类型） |
| `recursive` | boolean |  | 递归扫描子目录（默认 true） |
| `godot_path` | string |  | 覆盖 Godot 二进制路径（可选，优先于项目配置和环境变量） |

## 风险分布

读 10 / 进程 3

---
<!-- AUTO-GENERATED by scripts/gen-tool-docs.mjs from capability-matrix.json v0.32.21. DO NOT edit manually; re-run npm run gen:tool-docs after tool changes. -->
