analyze_change_set
Run a branch-level Code Health review for all files that differ between current HEAD and base_ref.
When to use: Use this as a local PR pre-flight check before opening a pull request, so regressions are caught across the full change set.
Limitations:
- Requires a valid git repository path.
- base_ref must exist and be resolvable by git in that repository.
- Reviews only files that differ from base_ref.
- Output is JSON text from the CLI command.
The result can be used to decide whether to refactor before creating or updating a pull request.
Returns: A JSON object containing:
- quality_gates: the central outcome, summarizing whether the change set passes or fails Code Health thresholds ("passed" or "failed").
- results: an array of objects for each affected file with:
- name: the name of the file whose Code Health is impacted.
- verdict: "improved", "degraded", or "stable".
- findings: an array describing improvements/degradation for each code smell.
On failure: If this tool returns an error (e.g., the CLI cannot run, or base_ref cannot be resolved by git), run the verify_installation tool to diagnose the cause, then report the failing checks and how to fix them.
Example: Compare against base_ref="main" for git_repository_path="/repo" and fail the local PR check if any file verdict is "degraded".