Install
$ agentstack add skill-cogni-ai-ou-cogni-ai-agent-skills-codeql ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Skill: codeql
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
- When configuring advanced CodeQL security scanning via GitHub Actions (
.github/workflows/codeql.yml). - To manually build CodeQL databases and run queries using the standalone CodeQL CLI.
- When troubleshooting CodeQL autobuild failures for compiled languages like C++ or Java.
When Not to Use
- When running standard linters (like ESLint or Ruff) that do not use CodeQL's semantic analysis.
- For managing third-party dependency vulnerabilities (use Dependabot or the
sbomskill). - If the repository has explicitly disabled CodeQL in favor of a different enterprise SAST tool.
Common Pitfalls
- Autobuilding Complex Projects: Relying on
build-mode: autobuildfor compiled languages with complex, non-standard build scripts, resulting in empty databases. - Missing Write Permissions: Forgetting to add
security-events: writeto the GitHub Actions job, causing the SARIF upload step to fail with HTTP 403. - Disk Space Exhaustion: Running CodeQL on massive monorepos without filtering paths or using caching, exhausting the GitHub Actions runner's disk space.
Core Process
- Choose Setup Type: Select between Default setup or Advanced setup (
.github/workflows/codeql.yml). - Configure Triggers: Define
push,pull_request,schedule, ormerge_groupworkflow triggers. - Set Permissions: Ensure
security-events: writeandcontents: readpermissions. - Configure Language Matrix: Specify languages (e.g.,
c-cpp,javascript-typescript,python). - Initialize CodeQL: Use
github/codeql-action/init@v4specifyingbuild-mode(none,autobuild,manual). - Build (if needed): Provide explicit manual build steps for compiled languages lacking autobuild support.
- Analyze: Use
github/codeql-action/analyze@v4to perform analysis and upload SARIF results.
Quick Start (Advanced Setup)
name: "CodeQL Advanced"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
security-events: write
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: javascript-typescript
build-mode: none
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
Commands / Usage Patterns (CodeQL CLI)
- Create Database:
codeql database create codeql-db --language=javascript-typescript --source-root=src - Create DB with Build Command:
codeql database create codeql-db --language=c-cpp --command="make build" - Analyze Database:
codeql database analyze codeql-db javascript-code-scanning.qls --format=sarif-latest --output=results.sarif - Upload Results:
codeql github upload-results --repository=owner/repo --ref=refs/heads/main --commit= --sarif=results.sarif
Diagnostics and Troubleshooting
- Autobuild failure: Switch
build-modetomanualand add explicit build commands. - Out of disk/memory: Use larger runners, reduce scope via
pathsconfig, or usebuild-mode: none. - Resource not accessible: Verify
security-events: writepermission is granted. - SARIF upload fails: Check if SARIF file exceeds 10 MB limit; ensure
GITHUB_TOKENis valid.
| Problem | Solution | |---|---| | Workflow not triggering | Verify on: triggers match event; check paths/branches filters; ensure workflow exists on target branch | | Resource not accessible error | Add security-events: write and contents: read permissions | | Autobuild failure | Switch to build-mode: manual and add explicit build commands | | No source code seen | Verify --source-root, build command, and language identifier | | C# compiler failure | Check for /p:EmitCompilerGeneratedFiles=true conflicts with .sqlproj or legacy projects | | Fewer lines scanned than expected | Switch from none to autobuild/manual; verify build compiles all source | | Kotlin in no-build mode | Disable and re-enable default setup to switch to autobuild | | Cache miss every run | Verify dependency-caching: true on init action | | Out of disk/memory | Use larger runners; reduce analysis scope via paths config; use build-mode: none | | SARIF upload fails | Ensure token has security-events: write; check 10 MB file size limit | | SARIF results exceed limits | Split across multiple uploads with different --sarif-category; reduce query scope | | Two CodeQL workflows | Disable default setup if using advanced setup, or remove old workflow file | | Slow analysis | Enable dependency caching; use --threads=0; reduce query suite scope |
Best Practices
- Use
security-extendedorsecurity-and-qualityfor comprehensive vulnerability coverage. - Set
dependency-caching: trueon theinitaction to optimize run times. - For monorepos, use the
categoryparameter in theanalyzestep to separate component results. - Pin GitHub actions to specific major versions (e.g.,
@v4) or commit SHAs for better security.
What to Avoid
- Avoid using the standalone CodeQL CLI download; always use the CodeQL bundle which includes precompiled queries.
- Avoid using
autobuildfor complex compiled language setups where a custom build is required.
References
-
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: Cogni-AI-OU
- Source: Cogni-AI-OU/cogni-ai-agent-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.