Handle Codebase Scan
Retrieve full scan reports through cubic MCP, verify each finding against the current checkout, and
make only the changes the user requests.
Instructions
1. Choose the input path
- For a repository request, detect
owner/repo from git remote get-url origin. Support common
HTTPS and SSH GitHub URLs and remove a trailing .git.
- If the repository cannot be identified, call
list_scans to discover accessible repositories.
Do not call it first when the current repository is known.
- For a CSV request, read the supplied local CSV and extract valid UUIDs from the
violationId
query parameter in its Issue link column. Deduplicate the UUIDs and ignore the scan ID portion
of each URL because get_issue uses the stable issue UUID.
2. Retrieve findings
- In repository mode, call
get_scan with owner, repo, triageStatus: "open", limit: 10,
and offset: 0 by default. The response aggregates the latest completed full scan with newer
completed diff scans; it does not accept a scan ID.
- Apply
category, minSeverity, filePath, or a different triageStatus only when the user asks
for it. For "unresolved" findings, retrieve both open and in_review. Retrieve all statuses
only when the user explicitly asks for them.
- Do not follow
hasMore by default. Show the first page and its total count, then fetch another
page only when the user asks for more or explicitly requested a larger result set.
- For listing requests, present the
get_scan summaries without fetching every full report. Fetch
an issue with the cubic codebase scan get_issue tool only when the user asks to investigate or
fix it.
- For an investigation or fix request without a user-selected issue list, process at most the five
highest-severity findings in one batch and report how many remain.
- In CSV or issue-ID mode, call
get_issue directly for each selected UUID. Process no more than
five issues per batch and load one full report at a time.
- If a required cubic codebase scan MCP tool is unavailable, stop and ask the user to connect and
authenticate the cubic MCP integration. Do not retry the same unavailable tool for every issue.
3. Verify and act
When the user asks to investigate or fix findings, process each selected finding:
- Read the full MCP report and the referenced code on the current checkout.
- Classify it as still present, already absent, false positive, or blocked.
- If the issue is real and the user requested fixes, make the smallest root-cause fix.
- Run focused tests or file-targeted linting for the touched area.
Do not commit, push, open a pull request, or update cubic triage state unless the user explicitly
requests that separate action.
Output
For listing requests, show the issue UUID, severity, category, file location, and summary. For
investigation or fix requests, report each selected finding as still present, fixed, already
absent, false positive, or blocked. Include focused verification for every code change.
1---2name: handle-codebase-scan3description: Inspects and fixes cubic codebase scan findings through MCP. Use when the user asks to show, investigate, or fix codebase scan issues; provides a cubic scan CSV; or names a scan issue UUID.4---56# Handle Codebase Scan78Retrieve full scan reports through cubic MCP, verify each finding against the current checkout, and9make only the changes the user requests.1011## Instructions1213### 1. Choose the input path1415- For a repository request, detect `owner/repo` from `git remote get-url origin`. Support common16 HTTPS and SSH GitHub URLs and remove a trailing `.git`.17- If the repository cannot be identified, call `list_scans` to discover accessible repositories.18 Do not call it first when the current repository is known.19- For a CSV request, read the supplied local CSV and extract valid UUIDs from the `violationId`20 query parameter in its `Issue link` column. Deduplicate the UUIDs and ignore the scan ID portion21 of each URL because `get_issue` uses the stable issue UUID.2223### 2. Retrieve findings2425- In repository mode, call `get_scan` with `owner`, `repo`, `triageStatus: "open"`, `limit: 10`,26 and `offset: 0` by default. The response aggregates the latest completed full scan with newer27 completed diff scans; it does not accept a scan ID.28- Apply `category`, `minSeverity`, `filePath`, or a different `triageStatus` only when the user asks29 for it. For "unresolved" findings, retrieve both `open` and `in_review`. Retrieve all statuses30 only when the user explicitly asks for them.31- Do not follow `hasMore` by default. Show the first page and its total count, then fetch another32 page only when the user asks for more or explicitly requested a larger result set.33- For listing requests, present the `get_scan` summaries without fetching every full report. Fetch34 an issue with the cubic codebase scan `get_issue` tool only when the user asks to investigate or35 fix it.36- For an investigation or fix request without a user-selected issue list, process at most the five37 highest-severity findings in one batch and report how many remain.38- In CSV or issue-ID mode, call `get_issue` directly for each selected UUID. Process no more than39 five issues per batch and load one full report at a time.40- If a required cubic codebase scan MCP tool is unavailable, stop and ask the user to connect and41 authenticate the cubic MCP integration. Do not retry the same unavailable tool for every issue.4243### 3. Verify and act4445When the user asks to investigate or fix findings, process each selected finding:46471. Read the full MCP report and the referenced code on the current checkout.482. Classify it as still present, already absent, false positive, or blocked.493. If the issue is real and the user requested fixes, make the smallest root-cause fix.504. Run focused tests or file-targeted linting for the touched area.5152Do not commit, push, open a pull request, or update cubic triage state unless the user explicitly53requests that separate action.5455## Output5657For listing requests, show the issue UUID, severity, category, file location, and summary. For58investigation or fix requests, report each selected finding as still present, fixed, already59absent, false positive, or blocked. Include focused verification for every code change.