codeql
Guides your agent in setting up code analysis tools to find security flaws. Essential for ensuring software protection and quality.
What it does
This tool helps you set up and use CodeQL to analyze your code for security issues. You can use it with GitHub Actions or directly on your computer.
When to use it
- ✓When you want to set up security analysis for your code on GitHub.
- ✓When you need to create or adjust a CodeQL configuration file.
- ✓When you want to run CodeQL on your computer to check your code.
Example of what to ask your AI
“How do I set up CodeQL to analyze my Python project in GitHub Actions?”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
CodeQL creates a 'database' of your code and then analyzes it using a set of security rules. This can be done automatically with GitHub Actions or manually using the command line.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add github/awesome-copilot --skill codeqlOr download just the file:
curl -L https://raw.githubusercontent.com/github/awesome-copilot/main/skills/codeql/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
CodeQL Code Scanning
This skill provides procedural guidance for configuring and running CodeQL code scanning — both through GitHub Actions workflows and the standalone CodeQL CLI.
When to Use This Skill
Use this skill when the request involves:
- Creating or customizing a
codeql.ymlGitHub Actions workflow - Choosing between default setup and advanced setup for code scanning
- Configuring CodeQL language matrix, build modes, or query suites
- Running CodeQL CLI locally (
codeql database create,database analyze,github upload-results) - Understanding or interpreting SARIF output from CodeQL
- Troubleshooting CodeQL analysis failures (build modes, compiled languages, runner requirements)
- Setting up CodeQL for monorepos with per-component scanning
- Configuring dependency caching, custom query packs, or model packs
Supported Languages
CodeQL supports the following language identifiers:
| Language | Identifier | Alternatives |
|---|---|---|
| C/C++ | c-cpp |
c, cpp |
| C# | csharp |
— |
| Go | go |
— |
| Java/Kotlin | java-kotlin |
java, kotlin |
| JavaScript/TypeScript | javascript-typescript |
javascript, typescript |
| Python | python |
— |
| Ruby | ruby |
— |
| Rust | rust |
— |
| Swift | swift |
— |
| GitHub Actions | actions |
— |
Alternative identifiers are equivalent to the standard identifier (e.g.,
javascriptdoes not exclude TypeScript analysis).
Core Workflow — GitHub Actions
Step 1: Choose Setup Type
- Default setup — Enable from repository Settings → Advanced Security → CodeQL analysis. Best for getting started quickly. Uses
nonebuild mode for most languages. - Advanced setup — Create a
.github/workflows/codeql.ymlfile for full control over triggers, build modes, query suites, and matrix strategies.
To switch from default to advanced: disable default setup first, then commit the workflow file.
Step 2: Configure Workflow Triggers
Define when scanning runs:
on:
push:
branches: [main, protected]
pull_request:
branches: [main]
schedule:
- cron: '30 6 * * 1' # Weekly Monday 6:30 UTC
push— scans on every push to specified branches; results appear in Security tabpull_request— scans PR merge commits; results appear as PR check annotationsschedule— periodic scans of the default branch (cron must exist on default branch)merge_group— add if repository uses merge queues
To skip scans for documentation-only PRs:
on:
pull_request:
paths-ignore:
- '**/*.md'
- '**/*.txt'
paths-ignorecontrols whether the workflow runs, not which files are analyzed.
Step 3: Configure Permissions
Set least-privilege permissions:
permissions:
security-events: write # Required to upload SARIF results
contents: read # Required to checkout code
actions: read # Required for private repos using codeql-action
Step 4: Configure Language Matrix
Use a matrix strategy to analyze each language in parallel:
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- language: javascript-typescript
build-mode: none
- language: python
build-mode: none
For compiled languages, set the appropriate build-mode:
none— no build required (supported for C/C++, C#, Java, Rust)autobuild— automatic build detectionmanual— custom build commands (advanced setup only)
For detailed per-language autobuild behavior and runner requirements, search
references/compiled-languages.md.
Step 5: Configure CodeQL Init and Analysis
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-extended
dependency-caching: true
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{ matrix.language }}"
Query suite options:
security-extended— default security queries plus additional coveragesecurity-and-quality— security plus code quality queries- Custom query packs via
packs:input (e.g.,codeql/javascript-queries:AlertSuppression.ql)
…
FAQ
What is CodeQL?
CodeQL is a tool that turns your code into data so it can be analyzed for security vulnerabilities and bugs.
What is GitHub Actions?
GitHub Actions is a service that allows you to automate tasks within GitHub, like running tests or analyzing code, directly from your repository.
What is SARIF?
SARIF is a standard format for reporting security analysis results, used by CodeQL to show the issues found.
Details
Original description by the author
Comprehensive guide for setting up and configuring CodeQL code scanning via GitHub Actions workflows and the CodeQL CLI. This skill should be used when users need help with code scanning configuration, CodeQL workflow files, CodeQL CLI commands, SARIF output, security analysis setup, or troubleshooting CodeQL analysis.
repo: github/awesome-copilot
Popularity
- GitHub stars
- 40k
- Ranking position
- #5055
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
acquire-codebase-knowledge
Helps your agent understand and document an existing code project. It's useful for onboarding new people or getting an overview of the architecture.
github/awesome-copilot
acreadiness-assess
Enables your agent to assess a project's readiness for AI and generate a report. It's useful for understanding how well a project is prepared to use AI tools.
github/awesome-copilot
acreadiness-generate-instructions
Helps your agent create instructions for AI tools based on an assessment. It's useful for improving how AI interacts with code and closing identified gaps.
github/awesome-copilot
acreadiness-policy
Enables your agent to help define or apply policies for AI project assessment. It's useful for standardizing how projects are evaluated and ensuring compliance.
github/awesome-copilot
Similar skills
cpp-testing
Makes your agent write and improve tests for C++ code. It helps set up testing tools and fix errors.
affaan-m/ECC
csharp-testing
Helps your agent create tests for C# and .NET code. It uses best practices to ensure tests are efficient and reliable.
affaan-m/ECC
django-tdd
Enables your agent to apply testing strategies for Django with pytest-django and TDD. It's useful for writing robust tests and ensuring code quality, especially for DRF APIs.
affaan-m/ECC