/project-toolkit:codeql-scanfrom project-toolkit
Executes CodeQL security scans with automated language detection, database caching, and SARIF output. Use for static security analysis on Python or GitHub Actions code.
Ships in project-toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Execute CodeQL security scans with automated language detection, database caching, and SARIF output generation.
# Via Claude Code skill system
/codeql-scan
# Full scan with auto-detected languages
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/codeql-scan/scripts/invoke_codeql_scan.py --operation full; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
# Quick scan with cached databases
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/codeql-scan/scripts/invoke_codeql_scan.py --operation quick; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
# Validate configuration only
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/codeql-scan/scripts/invoke_codeql_scan.py --operation validate; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
Run CodeQL scanCheck for vulnerabilitiesValidate CodeQL configurationQuick security scanScan for security issuesNeed CodeQL analysis?
+-- First time setup --> python3 .codeql/scripts/install_codeql.py
+-- Validate config --> invoke_codeql_scan.py --operation validate
+-- Full repository scan --> invoke_codeql_scan.py --operation full
+-- Quick scan (cached) --> invoke_codeql_scan.py --operation quick
+-- Specific language --> invoke_codeql_scan.py --operation full --languages python
+-- CI mode --> invoke_codeql_scan.py --operation full --ci
| Operation | Use When | Performance | Output |
|---|---|---|---|
full | First scan, major changes, pre-PR validation | 30-60s | SARIF + Console |
quick | Iterative development, minor changes | 10-20s | SARIF + Console |
validate | Config changes, troubleshooting | <5s | Console only |
flowchart TD
A[Start CodeQL Scan] --> B{Operation Type}
B -->|full| C[Check CLI Installed]
B -->|quick| C
B -->|validate| D[Run test_codeql_config.py]
C --> E{CLI Available?}
E -->|No| F[Error: Install CLI]
E -->|Yes| G[Detect Languages]
G --> H[Run invoke_codeql_scan.py]
H --> I{Scan Successful?}
I -->|Yes| J[Generate SARIF]
I -->|No| K[Error: Scan Failed]
J --> L[Display Summary]
D --> M{Config Valid?}
M -->|Yes| N2[Display Config Status]
M -->|No| O2[Exit 2: Config Invalid]
L --> N[Exit 0]
N2 --> N
F --> O[Exit 3]
K --> P[Exit 3]
Run a comprehensive security analysis of the entire codebase.
Check Prerequisites:
# Verify CodeQL CLI is installed
test -f .codeql/cli/codeql || echo "CodeQL CLI not found. Run: python3 .codeql/scripts/install_codeql.py"
Run Scan:
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/codeql-scan/scripts/invoke_codeql_scan.py --operation full; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
Review Results:
.codeql/results/*.sarifUse for rapid iteration during development. Only re-scans if source files changed.
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/codeql-scan/scripts/invoke_codeql_scan.py --operation quick; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
Performance comparison:
Verify CodeQL configuration YAML syntax and query packs.
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/codeql-scan/scripts/invoke_codeql_scan.py --operation validate; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
Wrapper script providing skill-specific functionality.
| Parameter | Type | Default | Description |
|---|---|---|---|
--operation | choice | full | Operation type: full, quick, validate |
--languages | list | (auto-detect) | Languages to scan: python, actions |
--ci | flag | false | Enable CI mode (exit 1 on findings, exit 2 if .codeql/ is missing) |
--format | choice | console | json prints {"status": "skipped", ...} to stdout when .codeql/ is missing |
Exit Codes (ADR-035):
| Code | Meaning | CI Behavior |
|---|---|---|
| 0 | Success (no findings or findings ignored), or .codeql/ missing without --ci (skipped) | Pass |
| 1 | Findings detected (CI mode only) | Fail |
| 2 | Configuration invalid, or .codeql/ missing with --ci (no scan ran) | Fail |
| 3 | Scan execution failed | Fail |
This skill wraps these core CodeQL scripts:
| Script | Purpose | Location |
|---|---|---|
install_codeql.py | Download and install CodeQL CLI | .codeql/scripts/ |
invoke_codeql_scan.py | Execute security scans | .codeql/scripts/ |
test_codeql_config.py | Validate configuration | .codeql/scripts/ |
get_codeql_diagnostics.py | Comprehensive health check | .codeql/scripts/ |
| Avoid | Why | Instead |
|---|---|---|
| Skip config validation before scan | Wastes time on invalid config | Run --operation validate first |
| Ignore exit codes | Silent failures hide security issues | Check $? (Bash/Zsh) or $LASTEXITCODE (PowerShell) after every invocation |
| Suppress stderr before checking exit code | Loses diagnostic information | Capture output, check exit code, then filter |
| Full scan on every minor change | 3-5x slower than needed | Use --operation quick for iteration |
| Mix skill wrapper with direct script calls | Inconsistent behavior | Always use invoke_codeql_scan.py |
Before completing a security scan task:
--operation validate)invoke_codeql_scan.py completed successfully (exit code 0; see exit codes in Scripts section).codeql/results/| Skill | Purpose | When to Use |
|---|---|---|
security-detection | Detect security-critical file changes | Before CodeQL scan to identify high-risk changes |
github | GitHub operations (PR comments, issues) | Report CodeQL findings to PR reviews |
=== CodeQL Security Scan ===
[OK] CodeQL CLI found at .codeql/cli/codeql
[OK] Languages detected: python, actions
[OK] Running full scan (no cache)...
Scanning python...
Database created: .codeql/db/python
Queries executed: 89
Findings: 1 (0 high, 0 medium, 1 low)
Scanning actions...
Database created: .codeql/db/actions
Queries executed: 45
Findings: 0
[OK] SARIF results saved to .codeql/results/
[OK] Scan completed successfully
Total findings: 1 (0 high, 0 medium, 1 low)
Results are saved in SARIF format for IDE integration.
Location: .codeql/results/<language>.sarif
{
"version": "2.1.0",
"runs": [{
"tool": {
"driver": {
"name": "CodeQL",
"version": "2.15.0"
}
},
"results": [{
"ruleId": "py/sql-injection",
"level": "error",
"message": {
"text": "Potential SQL injection vulnerability"
},
"locations": [{
"physicalLocation": {
"artifactLocation": {
"uri": "scripts/example.py"
},
"region": {
"startLine": 42
}
}
}]
}]
}]
}
{
"status": "findings_detected",
"languages": ["python", "actions"],
"findings": {
"total": 1,
"high": 0,
"medium": 0,
"low": 1
},
"sarif_files": [
".codeql/results/python.sarif",
".codeql/results/actions.sarif"
]
}
# Console output (default)
python3 .codeql/scripts/get_codeql_diagnostics.py
# JSON output (programmatic parsing)
python3 .codeql/scripts/get_codeql_diagnostics.py --output-format json
# Markdown report
python3 .codeql/scripts/get_codeql_diagnostics.py --output-format markdown > diagnostics.md
| Check | What It Validates |
|---|---|
| CLI | Installation, version, executable permissions |
| Config | YAML syntax, query pack availability, language support |
| Database | Existence, cache validity, size, creation timestamp |
| Results | SARIF files, findings count, last scan timestamp |
| Code | Meaning |
|---|---|
| 0 | All checks passed |
| 1 | Some checks failed (warnings) |
| 3 | Unable to run diagnostics |
Error: CodeQL CLI not found at .codeql/cli/codeql
Solution:
python3 .codeql/scripts/install_codeql.py --add-to-path
codeql version
Error: Invalid query pack: codeql/unknown-queries
Solution:
python3 .codeql/scripts/test_codeql_config.py
codeql resolve qlpacks
Error: Query execution timed out after 300s
Solution: Reduce scope by scanning a specific language.
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/codeql-scan/scripts/invoke_codeql_scan.py --operation full --languages python; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
Warning: Using cached database, but source files changed
Solution: Force database rebuild with a full scan.
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/codeql-scan/scripts/invoke_codeql_scan.py --operation full; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub rjmurillo/ai-agents --plugin project-toolkit105 skills in this plugin
/adr-generatorCreate comprehensive Architectural Decision Records (ADRs). Researches the destination directory to detect existing template conventions, gathers context, determines next ADR number, generates the ADR, validates completeness, and saves. Supports multiple ADR formats (MADR, Nygard, Alexandrian, project canonical). Use when documenting technical decisions, creating new ADR files, or capturing rationale so future readers can revisit a choice. Use when you say "write an ADR", "document this decision", "document these design choices", "record why we chose this", "capture the rationale", or "for future maintainers", or when creating an ADR-like markdown file under docs/decisions/, docs/adr/, docs/architecture/, architecture/decisions/, or .project-toolkit/architecture/. Do NOT use to debate or review an existing ADR (use adr-review)./adr-reviewMulti-agent debate orchestration for Architecture Decision Records. Automatically triggers on ADR create/edit/delete. Coordinates architect, critic, independent-thinker, security, analyst, and high-level-advisor agents in structured debate rounds until consensus. Use when you say "review this ADR", when an ADR is created/edited/deleted, or when reviewing, accepting, or updating a decision file under .project-toolkit/architecture/, docs/architecture/, docs/decisions/, docs/adr/, or architecture/decisions/, including intent like "review this decision record" or "check this rationale for future maintainers". Do NOT use to author a new ADR (use adr-generator)./agent-harness-referenceField reference for Claude Code and GitHub Copilot CLI hook contracts. Covers hook locations, events, matchers, payloads, decisions, exit codes, timeouts, plugin roots, and cloud limits with official URLs and versioned probes. Use for `harness contract`, `copilot cli hook behavior`, `hook payload format`, `stale plugin root`, `Errno 2 _dispatch.py`, or before changing cross-harness hooks. Do NOT use to run the porting campaign (in the ai-agents repository, use `ai-agents-portability-campaign`)./ai-agents-external-claimsVerify external, vendor, and third-party claims (numbers, attributions, structure) against authoritative primary sources before they land in a repo artifact or external deliverable. Covers stake-holding sources, round-number tells, citation-chain drift, and the walk-the-gate-or-file-conservative discipline. Use when you say `verify an external claim`, `check a vendor number`, `is this stat real`, `validate a third-party citation`. Do NOT use for running an experiment (use `ai-agents-research-methodology` in the ai-agents repository) or command-injection scanning (use `security-scan`)./analysis-provenanceIdentify code ownership before modifying validators or linters. Checks file headers for provenance indicators, reviews documentation, and determines provenance as UPSTREAM, LOCAL, VENDOR, or UNKNOWN. Prevents accidental modification of upstream tools./analyzeSystematic multi-step codebase analysis producing prioritized findings with file-line evidence. Covers architecture reviews, security assessments, and code quality evaluations through guided exploration, investigation planning, and synthesis. Use when you say "analyze this codebase", "run security assessment", "architecture review of this system", "find code smells", or "review code quality" across multiple files. Do NOT use for single-file maintainability scoring (use code-qualities-assessment) or CWE-78 injection pattern scanning (use security-scan).2 plugins in one repository ship this exact skill · first indexed Nov 13, 2026
Other plugins' skills for the same job