---
description: Add an already generated static-analysis report to a review config.
argument-hint: "<tool> <report-path> [--project-root <path>] [--output-dir <path>] [--config <path>]"
arguments:
  - add_args
allowed-tools:
  - Bash
  - Read
  - Glob
user-invocable: true
disable-model-invocation: false
---

# Add Report

Register an existing static-analysis report with the local review pipeline.

Supported tools:

- `cppcheck`
- `flawfinder`
- `splint`
- `cppdepend`
- `coverity`

Run from the repository root:

```bash
python "${CLAUDE_PLUGIN_ROOT}/plugins/code-review-assistant/scripts/review.py" /code-review-assistant:add <tool> <report-path> [options]
```

If the wrapper path above does not exist, fall back to:

```bash
python "${CLAUDE_PLUGIN_ROOT}/scripts/review.py" /code-review-assistant:add <tool> <report-path> [options]
```

Common usage:

```bash
python plugins/code-review-assistant/scripts/review.py /code-review-assistant:add cppcheck reports/cppcheck.xml --project-root sample_project
```

Behavior:

1. Copy the report into `<output-dir>/raw-reports/<tool>/`.
2. Create or update `review.auto.yaml`.
3. Enable the selected tool in the config with `mode: import`.
4. Preserve existing enabled tools in the config.
5. Validate the generated config.

Options:

- `--config <path>` updates an existing config.
- `--project-root <path>` is required when creating a new config.
- `--output-dir <path>` controls where the copied report and generated config are written.
- `--provider heuristic|codex|claude_code` sets or updates hosted/local review mode.
- `--evidence-artifact <path>` copies extra evidence beside the report; useful for flawfinder manifest/detailed/high-risk files.

After adding reports, run:

```bash
python plugins/code-review-assistant/scripts/review.py all --config <output-dir>/review.auto.yaml
```
