microsoft/hve-core/gh-code-scanning
Claude Code and agent skill by microsoft/hve-core
- vendor
Checking that the SKILL.md file is still in the repository.
Retrieves GitHub code scanning alerts and groups them by tool and rule ID using the gh CLI
Install
npx vskill@latest install microsoft/hve-core/gh-code-scanningSKILL.md
The same SKILL.md was published earlier as microsoft/hve-core/gh-code-scanning.
GitHub Code Scanning Skill
Overview
GitHub code scanning alerts are produced by static analysis tools such as CodeQL and Scorecard and surfaced in the GitHub Security tab. The GitHub Security tab is not accessible through the default MCP toolset, so this skill provides scripts for all read operations.
Prerequisites
| Requirement | Details | |
|---|---|---|
pwsh | PowerShell 7+; install from <https://learn.microsoft.com/powershell> | |
gh CLI | Installed and on PATH; install from <https://cli.github.com> | |
| Auth | Run gh auth login or set GH_TOKEN; requires security_events scope | |
| Scope | security_events for private repos; public_repo for public-only |
The repo scope also satisfies security_events. The gh CLI handles authentication automatically; no explicit token passing is needed in commands.
Get-CodeScanningAlerts.ps1 validates both prerequisites at startup and aborts with a targeted error message if either check fails.
Quick Start
Run this command to get a grouped summary of open code scanning alerts, sorted by frequency. This is the recommended first command when triaging a repository's code scanning posture.
This returns a JSON array of alert groups sorted by occurrence count, descending. Always use -OutputFormat Json when consuming results programmatically.
Parameters Reference
| Parameter | Type | Required | Default | Description | |
|---|---|---|---|---|---|
-Owner | String | Yes | GitHub organization or user that owns the repository | ||
-Repo | String | Yes | Repository name | ||
-OutputFormat | String | No | Table | Output format: agents must always use Json for programmatic consumption; GroupedJson is accepted as an alias for Json | |
-Branch | String | No | main | Branch to scope alert results | |
-IncludeDismissedStillDetected | Switch | No | Also report dismissed alerts that are still detected on the branch, as groups with Kind set to dismissed-still-detected |
These parameters apply toGet-CodeScanningAlerts.ps1. For bash script flags including-s {severity}and-d, see the Script Reference section below.
Script Reference
Get-CodeScanningAlerts.ps1
Groups and sorts open code scanning alerts by occurrence count, descending.
get-code-scanning-alerts.sh
Groups and sorts open code scanning alerts by occurrence count, descending. Requires jq.
When to Use This Skill
Use this skill when the task involves reading code scanning alerts only. Get-CodeScanningAlerts.ps1 is the only supported method for listing and grouping code scanning alerts. gh api must not be used as a fallback for listing or grouping.
When the GitHub MCP server is configured with the code_security toolset, read-only access to code scanning alerts is available without gh api. Enable via toolsets: all or explicit toolset configuration.
Code Scanning Alerts
List and group open alerts
Always run with -OutputFormat Json. Parse the JSON output and present it to the user.
Use -Branch {branch} to scope to a branch other than main.
JSON output shape
-OutputFormat Json returns an array of group objects:
Each group holds one tool and rule ID. RuleDescription is the rule's description, or its name and then its ID when the tool publishes no description, as zizmor does. SecuritySeverity is null for code quality rules that have no security classification; Severity (the non-security rule severity: error, warning, note, none) provides a fallback. AffectedPaths is always a JSON array of unique, sorted file paths with sentinel strings filtered out. HasFilePaths is false and AffectedPaths is [] when an alert has no associated source file (for example, BranchProtectionID). AlertUrl links directly to the alert in the GitHub Security tab. FindingDescription is the most recent alert message text.
With -IncludeDismissedStillDetected (or -d in bash), dismissed alerts whose most recent instance on the branch is not fixed are appended as separate groups after the open-alert groups. Those groups add Kind (dismissed-still-detected) and DismissedReason; open-alert groups are unchanged. A dismissal does not resolve an alert, so present these as alerts to reopen and fix.
Get single alert detail
This call returns one record; it is not a listing or grouping operation and does not conflict with the gh api restriction above.
List affected file paths
Use -OutputFormat Json and read the AffectedPaths field from each rule group. The JSON output includes RuleDescription, RuleId, Tool, SecuritySeverity, Severity, Count, AffectedPaths (unique, sorted file paths), HasFilePaths (boolean: false for repo-level rules that have no associated source file), AlertUrl (string: direct link to the alert in the GitHub Security tab), and FindingDescription (string: most recent alert message text from the analysis tool) per group.
Key fields
These are GitHub API response field paths, not output object properties. The grouped output object field names are listed in the JSON output shape section above.
rule.security_severity_level: security severity tier:critical,high,medium, orlow;nullfor code quality rulesrule.severity: non-security rule severity:error,warning,note, ornone; always populatedrule.id: rule identifier used for deduplication and cross-referencingtool.name: analysis tool that produced the alert (for example,CodeQL)most_recent_instance.location.path: source file path of the most recent alert occurrence
Resolution policy
Resolve alerts in code or configuration. Never dismiss an alert, and never suggest dismissing one, including for false positives or test code. When a finding cannot be fixed yet, a maintainer can add a reviewed, expiring tracked exception; the alert stays open. Repositories that adopt this policy document it in their code-scanning alert lifecycle; for hve-core, see <https://github.com/microsoft/hve-core/blob/main/docs/security/code-scanning-alert-lifecycle.md>.
Code Scanning Analyses
These calls retrieve analysis metadata, not alert listings, and do not conflict with the gh api restriction above.
List recent analyses
Returns the last 10 CodeQL runs on the main branch.
Key fields
created_at: timestamp of the analysis runresults_count: number of alerts producedrules_count: number of rules evaluatedtool.version: version of the analysis toolwarning/error: any issues reported during analysis
Backlog Issue Creation
Dedup check before creation
Search for an existing issue using the title and an embedded automation marker before creating a new one.
The automation marker <!-- automation:security-scan:{tool}:{rule_id} --> is embedded in the issue body and serves as the deduplication anchor; it carries the tool because different tools can share a rule ID. Replace all {placeholders} with actual values from the alert-grouping JSON output.
Troubleshooting
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 2 Oct 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/security/gh-code-scanning/SKILL.md
Popularity
- Repository stars
- 1,492
- Repository forks
- 318
- 7-day trend score
- 37
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/hve-core/gh-code-scanning)