[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-trail-of-bits-codeql":3,"mdc-jugu2z-key":37,"related-org-trail-of-bits-codeql":3018,"related-repo-trail-of-bits-codeql":3172},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":25,"repoUrl":26,"updatedAt":27,"license":28,"forks":29,"topics":30,"repo":32,"sourceUrl":35,"mdContent":36},"codeql","scan codebases for security vulnerabilities","Scans a codebase for security vulnerabilities using CodeQL's interprocedural data flow and taint tracking analysis. Triggers on \"run codeql\", \"codeql scan\", \"codeql analysis\", \"build codeql database\", or \"find vulnerabilities with codeql\". Supports \"run all\" (security-and-quality + security-experimental suites) and \"important only\" (high-precision security findings) scan modes. Also handles creating data extension models and processing CodeQL SARIF output.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"trail-of-bits","Trail of Bits","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Ftrail-of-bits.png","trailofbits",[13,17,19,22],{"name":14,"slug":15,"type":16},"Security","security","tag",{"name":18,"slug":4,"type":16},"CodeQL",{"name":20,"slug":21,"type":16},"Code Analysis","code-analysis",{"name":23,"slug":24,"type":16},"Testing","testing",6139,"https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Fskills","2026-07-17T06:05:26.337443",null,541,[31],"agent-skills",{"repoUrl":26,"stars":25,"forks":29,"topics":33,"description":34},[31],"Trail of Bits Claude Code skills for security research, vulnerability detection, and audit workflows","https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Fskills\u002Ftree\u002FHEAD\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql","---\nname: codeql\ndescription: >-\n  Scans a codebase for security vulnerabilities using CodeQL's interprocedural data flow and\n  taint tracking analysis. Triggers on \"run codeql\", \"codeql scan\", \"codeql analysis\", \"build\n  codeql database\", or \"find vulnerabilities with codeql\". Supports \"run all\" (security-and-quality\n  + security-experimental suites) and \"important only\" (high-precision security findings) scan\n  modes. Also handles creating data extension models and processing CodeQL SARIF output.\nallowed-tools: Bash Read Write Edit Glob Grep AskUserQuestion TaskCreate TaskList TaskUpdate TaskGet TodoRead TodoWrite\n---\n\n# CodeQL Analysis\n\nSupported languages: Python, JavaScript\u002FTypeScript, Go, Java\u002FKotlin, C\u002FC++, C#, Ruby, Swift.\n\n**Skill resources:** Reference files and templates are located at `{baseDir}\u002Freferences\u002F` and `{baseDir}\u002Fworkflows\u002F`.\n\n## Essential Principles\n\n1. **Database quality is non-negotiable.** A database that builds is not automatically good. Always run quality assessment (file counts, baseline LoC, extractor errors) and compare against expected source files. A cached build produces zero useful extraction.\n\n2. **Data extensions catch what CodeQL misses.** Even projects using standard frameworks (Django, Spring, Express) have custom wrappers around database calls, request parsing, or shell execution. Skipping the create-data-extensions workflow means missing vulnerabilities in project-specific code paths.\n\n3. **Explicit suite references prevent silent query dropping.** Never pass pack names directly to `codeql database analyze` — each pack's `defaultSuiteFile` applies hidden filters that can produce zero results. Always generate a custom `.qls` suite file.\n\n4. **Zero findings needs investigation, not celebration.** Zero results can indicate poor database quality, missing models, wrong query packs, or silent suite filtering. Investigate before reporting clean.\n\n5. **macOS Apple Silicon requires workarounds for compiled languages.** Exit code 137 is `arm64e`\u002F`arm64` mismatch, not a build failure. Try Homebrew arm64 tools or Rosetta before falling back to `build-mode=none`.\n\n6. **Follow workflows step by step.** Once a workflow is selected, execute it step by step without skipping phases. Each phase gates the next — skipping quality assessment or data extensions leads to incomplete analysis.\n\n## Output Directory\n\nAll generated files (database, build logs, diagnostics, extensions, results) are stored in a single output directory.\n\n- **If the user specifies an output directory** in their prompt, use it as `OUTPUT_DIR`.\n- **If not specified**, default to `.\u002Fstatic_analysis_codeql_1`. If that already exists, increment to `_2`, `_3`, etc.\n\nIn both cases, **always create the directory** with `mkdir -p` before writing any files.\n\n```bash\n# Resolve output directory\nif [ -n \"$USER_SPECIFIED_DIR\" ]; then\n  OUTPUT_DIR=\"$USER_SPECIFIED_DIR\"\nelse\n  BASE=\"static_analysis_codeql\"\n  N=1\n  while [ -e \"${BASE}_${N}\" ]; do\n    N=$((N + 1))\n  done\n  OUTPUT_DIR=\"${BASE}_${N}\"\nfi\nmkdir -p \"$OUTPUT_DIR\"\n```\n\nThe output directory is resolved **once** at the start before any workflow executes. All workflows receive `$OUTPUT_DIR` and store their artifacts there:\n\n```\n$OUTPUT_DIR\u002F\n├── rulesets.txt                 # Selected query packs (logged after Step 3)\n├── codeql.db\u002F                   # CodeQL database (dir containing codeql-database.yml)\n├── build.log                    # Build log\n├── codeql-config.yml            # Exclusion config (interpreted languages)\n├── diagnostics\u002F                 # Diagnostic queries and CSVs\n├── extensions\u002F                  # Data extension YAMLs\n├── raw\u002F                         # Unfiltered analysis output\n│   ├── results.sarif\n│   └── \u003Cmode>.qls\n└── results\u002F                     # Final results (filtered for important-only, copied for run-all)\n    └── results.sarif\n```\n\n### Database Discovery\n\nA CodeQL database is identified by the presence of a `codeql-database.yml` marker file inside its directory. When searching for existing databases, **always collect all matches** — there may be multiple databases from previous runs or for different languages.\n\n**Discovery command:**\n\n```bash\n# Find ALL CodeQL databases (top-level and one subdirectory deep)\nfind . -maxdepth 3 -name \"codeql-database.yml\" -not -path \"*\u002F\\.*\" 2>\u002Fdev\u002Fnull \\\n  | while read -r yml; do dirname \"$yml\"; done\n```\n\n- **Inside `$OUTPUT_DIR`:** `find \"$OUTPUT_DIR\" -maxdepth 2 -name \"codeql-database.yml\"`\n- **Project-wide (for auto-detection):** `find . -maxdepth 3 -name \"codeql-database.yml\"` — covers databases at the project top level (`.\u002Fdb-name\u002F`) and one subdirectory deep (`.\u002Fsubdir\u002Fdb-name\u002F`). Does not search deeper.\n\nNever assume a database is named `codeql.db` — discover it by its marker file.\n\n**When multiple databases are found:**\n\nFor each discovered database, collect metadata to help the user choose:\n\n```bash\n# For each database, extract language and creation time\nfor db in $FOUND_DBS; do\n  CODEQL_LANG=$(codeql resolve database --format=json -- \"$db\" 2>\u002Fdev\u002Fnull | jq -r '.languages[0]')\n  CREATED=$(grep '^creationMetadata:' -A5 \"$db\u002Fcodeql-database.yml\" 2>\u002Fdev\u002Fnull | grep 'creationTime' | awk '{print $2}')\n  echo \"$db — language: $CODEQL_LANG, created: $CREATED\"\ndone\n```\n\nThen use `AskUserQuestion` to let the user select which database to use, or to build a new one. **Skip `AskUserQuestion` if the user explicitly stated which database to use or to build a new one in their prompt.**\n\n## Quick Start\n\nFor the common case (\"scan this codebase for vulnerabilities\"):\n\n```bash\n# 1. Verify CodeQL is installed\nif ! command -v codeql >\u002Fdev\u002Fnull 2>&1; then\n  echo \"NOT INSTALLED: codeql binary not found on PATH\"\nelse\n  codeql --version || echo \"ERROR: codeql found but --version failed (check installation)\"\nfi\n\n# 2. Resolve output directory\nBASE=\"static_analysis_codeql\"; N=1\nwhile [ -e \"${BASE}_${N}\" ]; do N=$((N + 1)); done\nOUTPUT_DIR=\"${BASE}_${N}\"; mkdir -p \"$OUTPUT_DIR\"\n```\n\nThen execute the full pipeline: **build database → create data extensions → run analysis** using the workflows below.\n\n## When to Use\n\n- Scanning a codebase for security vulnerabilities with deep data flow analysis\n- Building a CodeQL database from source code (with build capability for compiled languages)\n- Finding complex vulnerabilities that require interprocedural taint tracking or AST\u002FCFG analysis\n- Performing comprehensive security audits with multiple query packs\n\n## When NOT to Use\n\n- **Writing custom queries** - Use a dedicated query development skill\n- **CI\u002FCD integration** - Use GitHub Actions documentation directly\n- **Quick pattern searches** - Use Semgrep or grep for speed\n- **No build capability** for compiled languages - Consider Semgrep instead\n- **Single-file or lightweight analysis** - Semgrep is faster for simple pattern matching\n\n## Rationalizations to Reject\n\nThese shortcuts lead to missed findings. Do not accept them:\n\n- **\"security-extended is enough\"** - It is the baseline. Always check if Trail of Bits packs and Community Packs are available for the language. They catch categories `security-extended` misses entirely.\n- **\"security-and-quality is the broadest suite\"** - `security-and-quality` excludes all `experimental\u002F` query paths. For run-all mode, import both `security-and-quality` and `security-experimental`. The delta is 1–52 queries depending on the language.\n- **\"The database built, so it's good\"** - A database that builds does not mean it extracted well. Always run quality assessment and check file counts against expected source files.\n- **\"Data extensions aren't needed for standard frameworks\"** - Even Django\u002FSpring apps have custom wrappers that CodeQL does not model. Skipping extensions means missing vulnerabilities.\n- **\"build-mode=none is fine for compiled languages\"** - It produces severely incomplete analysis. Only use as an absolute last resort. On macOS, try the arm64 toolchain workaround or Rosetta first.\n- **\"The build fails on macOS, just use build-mode=none\"** - Exit code 137 is caused by `arm64e`\u002F`arm64` mismatch, not a fundamental build failure. See [macos-arm64e-workaround.md](references\u002Fmacos-arm64e-workaround.md).\n- **\"No findings means the code is secure\"** - Zero findings can indicate poor database quality, missing models, or wrong query packs. Investigate before reporting clean results.\n- **\"I'll just run the default suite\"** \u002F **\"I'll just pass the pack names directly\"** - Each pack's `defaultSuiteFile` applies hidden filters and can produce zero results. Always use an explicit suite reference.\n- **\"I'll put files in the current directory\"** - All generated files must go in `$OUTPUT_DIR`. Scattering files in the working directory makes cleanup impossible and risks overwriting previous runs.\n- **\"Just use the first database I find\"** - Multiple databases may exist for different languages or from previous runs. When more than one is found, present all options to the user. Only skip the prompt when the user already specified which database to use.\n- **\"The user said 'scan', that means they want me to pick a database\"** - \"Scan\" is not database selection. If multiple databases exist and the user didn't name one, ask.\n\n---\n\n## Workflow Selection\n\nThis skill has three workflows. **Once a workflow is selected, execute it step by step without skipping phases.**\n\n| Workflow | Purpose |\n|----------|---------|\n| [build-database](workflows\u002Fbuild-database.md) | Create CodeQL database using build methods in sequence |\n| [create-data-extensions](workflows\u002Fcreate-data-extensions.md) | Detect or generate data extension models for project APIs |\n| [run-analysis](workflows\u002Frun-analysis.md) | Select rulesets, execute queries, process results |\n\n### Auto-Detection Logic\n\n**If user explicitly specifies** what to do (e.g., \"build a database\", \"run analysis on .\u002Fmy-db\"), execute that workflow directly. **Do NOT call `AskUserQuestion` for database selection if the user's prompt already makes their intent clear** — e.g., \"build a new database\", \"analyze the codeql database in static_analysis_codeql_2\", \"run a full scan from scratch\".\n\n**Default pipeline for \"test\", \"scan\", \"analyze\", or similar:** Discover existing databases first, then decide.\n\n```bash\n# Find ALL CodeQL databases by looking for codeql-database.yml marker file\n# Search top-level dirs and one subdirectory deep\nFOUND_DBS=()\nwhile IFS= read -r yml; do\n  db_dir=$(dirname \"$yml\")\n  codeql resolve database -- \"$db_dir\" >\u002Fdev\u002Fnull 2>&1 && FOUND_DBS+=(\"$db_dir\")\ndone \u003C \u003C(find . -maxdepth 3 -name \"codeql-database.yml\" -not -path \"*\u002F\\.*\" 2>\u002Fdev\u002Fnull)\n\necho \"Found ${#FOUND_DBS[@]} existing database(s)\"\n```\n\n| Condition | Action |\n|-----------|--------|\n| No databases found | Resolve new `$OUTPUT_DIR`, execute build → extensions → analysis (full pipeline) |\n| One database found | Use `AskUserQuestion`: reuse it or build new? |\n| Multiple databases found | Use `AskUserQuestion`: list all with metadata, let user pick one or build new |\n| User explicitly stated intent | Skip `AskUserQuestion`, act on their instructions directly |\n\n### Database Selection Prompt\n\nWhen existing databases are found **and the user did not explicitly specify which to use**, present via `AskUserQuestion`:\n\n```\nheader: \"Existing CodeQL Databases\"\nquestion: \"I found existing CodeQL database(s). What would you like to do?\"\noptions:\n  - label: \"\u003Cdb_path_1> (language: python, created: 2026-02-24)\"\n    description: \"Reuse this database\"\n  - label: \"\u003Cdb_path_2> (language: cpp, created: 2026-02-23)\"\n    description: \"Reuse this database\"\n  - label: \"Build a new database\"\n    description: \"Create a fresh database in a new output directory\"\n```\n\nAfter selection:\n- **If user picks an existing database:** Set `$OUTPUT_DIR` to its parent directory (or the directory containing it), set `$DB_NAME` to the selected path, then proceed to extensions → analysis.\n- **If user picks \"Build new\":** Resolve a new `$OUTPUT_DIR`, execute build → extensions → analysis.\n\n### General Decision Prompt\n\nIf the user's intent is ambiguous (neither database selection nor workflow is clear), ask:\n\n```\nI can help with CodeQL analysis. What would you like to do?\n\n1. **Full scan (Recommended)** - Build database, create extensions, then run analysis\n2. **Build database** - Create a new CodeQL database from this codebase\n3. **Create data extensions** - Generate custom source\u002Fsink models for project APIs\n4. **Run analysis** - Run security queries on existing database\n\n[If databases found: \"I found N existing database(s): \u003Clist paths with language>\"]\n[Show output directory: \"Output will be stored in \u003COUTPUT_DIR>\"]\n```\n\n---\n\n## Reference Index\n\n| File | Content |\n|------|---------|\n| **Workflows** | |\n| [workflows\u002Fbuild-database.md](workflows\u002Fbuild-database.md) | Database creation with build method sequence |\n| [workflows\u002Fcreate-data-extensions.md](workflows\u002Fcreate-data-extensions.md) | Data extension generation pipeline |\n| [workflows\u002Frun-analysis.md](workflows\u002Frun-analysis.md) | Query execution and result processing |\n| **References** | |\n| [references\u002Fmacos-arm64e-workaround.md](references\u002Fmacos-arm64e-workaround.md) | Apple Silicon build tracing workarounds |\n| [references\u002Fbuild-fixes.md](references\u002Fbuild-fixes.md) | Build failure fix catalog |\n| [references\u002Fquality-assessment.md](references\u002Fquality-assessment.md) | Database quality metrics and improvements |\n| [references\u002Fextension-yaml-format.md](references\u002Fextension-yaml-format.md) | Data extension YAML column definitions and examples |\n| [references\u002Fsarif-processing.md](references\u002Fsarif-processing.md) | jq commands for SARIF output processing |\n| [references\u002Fdiagnostic-query-templates.md](references\u002Fdiagnostic-query-templates.md) | QL queries for source\u002Fsink enumeration |\n| [references\u002Fimportant-only-suite.md](references\u002Fimportant-only-suite.md) | Important-only suite template and generation |\n| [references\u002Frun-all-suite.md](references\u002Frun-all-suite.md) | Run-all suite template |\n| [references\u002Fruleset-catalog.md](references\u002Fruleset-catalog.md) | Available query packs by language |\n| [references\u002Fthreat-models.md](references\u002Fthreat-models.md) | Threat model configuration |\n| [references\u002Flanguage-details.md](references\u002Flanguage-details.md) | Language-specific build and extraction details |\n| [references\u002Fperformance-tuning.md](references\u002Fperformance-tuning.md) | Memory, threading, and timeout configuration |\n\n---\n\n## Success Criteria\n\nA complete CodeQL analysis run should satisfy:\n\n- [ ] Output directory resolved (user-specified or auto-incremented default)\n- [ ] All generated files stored inside `$OUTPUT_DIR`\n- [ ] Database built (discovered via `codeql-database.yml` marker) with quality assessment passed (baseline LoC > 0, errors \u003C 5%)\n- [ ] Data extensions evaluated — either created in `$OUTPUT_DIR\u002Fextensions\u002F` or explicitly skipped with justification\n- [ ] Analysis run with explicit suite reference (not default pack suite)\n- [ ] All installed query packs (official + Trail of Bits + Community) used or explicitly excluded\n- [ ] Selected query packs logged to `$OUTPUT_DIR\u002Frulesets.txt`\n- [ ] Unfiltered results preserved in `$OUTPUT_DIR\u002Fraw\u002Fresults.sarif`\n- [ ] Final results in `$OUTPUT_DIR\u002Fresults\u002Fresults.sarif` (filtered for important-only, copied for run-all)\n- [ ] Zero-finding results investigated (database quality, model coverage, suite selection)\n- [ ] Build log preserved at `$OUTPUT_DIR\u002Fbuild.log` with all commands, fixes, and quality assessments\n",{"data":38,"body":40},{"name":4,"description":6,"allowed-tools":39},"Bash Read Write Edit Glob Grep AskUserQuestion TaskCreate TaskList TaskUpdate TaskGet TodoRead TodoWrite",{"type":41,"children":42},"root",[43,52,58,86,93,205,211,216,271,291,626,645,655,662,682,690,849,908,921,929,934,1228,1253,1259,1264,1596,1608,1614,1637,1643,1696,1702,1707,1900,1904,1910,1920,1999,2005,2029,2039,2345,2445,2451,2469,2478,2483,2528,2534,2539,2548,2551,2557,2843,2846,2852,2857,3012],{"type":44,"tag":45,"props":46,"children":48},"element","h1",{"id":47},"codeql-analysis",[49],{"type":50,"value":51},"text","CodeQL Analysis",{"type":44,"tag":53,"props":54,"children":55},"p",{},[56],{"type":50,"value":57},"Supported languages: Python, JavaScript\u002FTypeScript, Go, Java\u002FKotlin, C\u002FC++, C#, Ruby, Swift.",{"type":44,"tag":53,"props":59,"children":60},{},[61,67,69,76,78,84],{"type":44,"tag":62,"props":63,"children":64},"strong",{},[65],{"type":50,"value":66},"Skill resources:",{"type":50,"value":68}," Reference files and templates are located at ",{"type":44,"tag":70,"props":71,"children":73},"code",{"className":72},[],[74],{"type":50,"value":75},"{baseDir}\u002Freferences\u002F",{"type":50,"value":77}," and ",{"type":44,"tag":70,"props":79,"children":81},{"className":80},[],[82],{"type":50,"value":83},"{baseDir}\u002Fworkflows\u002F",{"type":50,"value":85},".",{"type":44,"tag":87,"props":88,"children":90},"h2",{"id":89},"essential-principles",[91],{"type":50,"value":92},"Essential Principles",{"type":44,"tag":94,"props":95,"children":96},"ol",{},[97,108,118,152,162,195],{"type":44,"tag":98,"props":99,"children":100},"li",{},[101,106],{"type":44,"tag":62,"props":102,"children":103},{},[104],{"type":50,"value":105},"Database quality is non-negotiable.",{"type":50,"value":107}," A database that builds is not automatically good. Always run quality assessment (file counts, baseline LoC, extractor errors) and compare against expected source files. A cached build produces zero useful extraction.",{"type":44,"tag":98,"props":109,"children":110},{},[111,116],{"type":44,"tag":62,"props":112,"children":113},{},[114],{"type":50,"value":115},"Data extensions catch what CodeQL misses.",{"type":50,"value":117}," Even projects using standard frameworks (Django, Spring, Express) have custom wrappers around database calls, request parsing, or shell execution. Skipping the create-data-extensions workflow means missing vulnerabilities in project-specific code paths.",{"type":44,"tag":98,"props":119,"children":120},{},[121,126,128,134,136,142,144,150],{"type":44,"tag":62,"props":122,"children":123},{},[124],{"type":50,"value":125},"Explicit suite references prevent silent query dropping.",{"type":50,"value":127}," Never pass pack names directly to ",{"type":44,"tag":70,"props":129,"children":131},{"className":130},[],[132],{"type":50,"value":133},"codeql database analyze",{"type":50,"value":135}," — each pack's ",{"type":44,"tag":70,"props":137,"children":139},{"className":138},[],[140],{"type":50,"value":141},"defaultSuiteFile",{"type":50,"value":143}," applies hidden filters that can produce zero results. Always generate a custom ",{"type":44,"tag":70,"props":145,"children":147},{"className":146},[],[148],{"type":50,"value":149},".qls",{"type":50,"value":151}," suite file.",{"type":44,"tag":98,"props":153,"children":154},{},[155,160],{"type":44,"tag":62,"props":156,"children":157},{},[158],{"type":50,"value":159},"Zero findings needs investigation, not celebration.",{"type":50,"value":161}," Zero results can indicate poor database quality, missing models, wrong query packs, or silent suite filtering. Investigate before reporting clean.",{"type":44,"tag":98,"props":163,"children":164},{},[165,170,172,178,180,186,188,194],{"type":44,"tag":62,"props":166,"children":167},{},[168],{"type":50,"value":169},"macOS Apple Silicon requires workarounds for compiled languages.",{"type":50,"value":171}," Exit code 137 is ",{"type":44,"tag":70,"props":173,"children":175},{"className":174},[],[176],{"type":50,"value":177},"arm64e",{"type":50,"value":179},"\u002F",{"type":44,"tag":70,"props":181,"children":183},{"className":182},[],[184],{"type":50,"value":185},"arm64",{"type":50,"value":187}," mismatch, not a build failure. Try Homebrew arm64 tools or Rosetta before falling back to ",{"type":44,"tag":70,"props":189,"children":191},{"className":190},[],[192],{"type":50,"value":193},"build-mode=none",{"type":50,"value":85},{"type":44,"tag":98,"props":196,"children":197},{},[198,203],{"type":44,"tag":62,"props":199,"children":200},{},[201],{"type":50,"value":202},"Follow workflows step by step.",{"type":50,"value":204}," Once a workflow is selected, execute it step by step without skipping phases. Each phase gates the next — skipping quality assessment or data extensions leads to incomplete analysis.",{"type":44,"tag":87,"props":206,"children":208},{"id":207},"output-directory",[209],{"type":50,"value":210},"Output Directory",{"type":44,"tag":53,"props":212,"children":213},{},[214],{"type":50,"value":215},"All generated files (database, build logs, diagnostics, extensions, results) are stored in a single output directory.",{"type":44,"tag":217,"props":218,"children":219},"ul",{},[220,237],{"type":44,"tag":98,"props":221,"children":222},{},[223,228,230,236],{"type":44,"tag":62,"props":224,"children":225},{},[226],{"type":50,"value":227},"If the user specifies an output directory",{"type":50,"value":229}," in their prompt, use it as ",{"type":44,"tag":70,"props":231,"children":233},{"className":232},[],[234],{"type":50,"value":235},"OUTPUT_DIR",{"type":50,"value":85},{"type":44,"tag":98,"props":238,"children":239},{},[240,245,247,253,255,261,263,269],{"type":44,"tag":62,"props":241,"children":242},{},[243],{"type":50,"value":244},"If not specified",{"type":50,"value":246},", default to ",{"type":44,"tag":70,"props":248,"children":250},{"className":249},[],[251],{"type":50,"value":252},".\u002Fstatic_analysis_codeql_1",{"type":50,"value":254},". If that already exists, increment to ",{"type":44,"tag":70,"props":256,"children":258},{"className":257},[],[259],{"type":50,"value":260},"_2",{"type":50,"value":262},", ",{"type":44,"tag":70,"props":264,"children":266},{"className":265},[],[267],{"type":50,"value":268},"_3",{"type":50,"value":270},", etc.",{"type":44,"tag":53,"props":272,"children":273},{},[274,276,281,283,289],{"type":50,"value":275},"In both cases, ",{"type":44,"tag":62,"props":277,"children":278},{},[279],{"type":50,"value":280},"always create the directory",{"type":50,"value":282}," with ",{"type":44,"tag":70,"props":284,"children":286},{"className":285},[],[287],{"type":50,"value":288},"mkdir -p",{"type":50,"value":290}," before writing any files.",{"type":44,"tag":292,"props":293,"children":298},"pre",{"className":294,"code":295,"language":296,"meta":297,"style":297},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# Resolve output directory\nif [ -n \"$USER_SPECIFIED_DIR\" ]; then\n  OUTPUT_DIR=\"$USER_SPECIFIED_DIR\"\nelse\n  BASE=\"static_analysis_codeql\"\n  N=1\n  while [ -e \"${BASE}_${N}\" ]; do\n    N=$((N + 1))\n  done\n  OUTPUT_DIR=\"${BASE}_${N}\"\nfi\nmkdir -p \"$OUTPUT_DIR\"\n","bash","",[299],{"type":44,"tag":70,"props":300,"children":301},{"__ignoreMap":297},[302,314,361,388,397,424,442,504,539,548,590,599],{"type":44,"tag":303,"props":304,"children":307},"span",{"class":305,"line":306},"line",1,[308],{"type":44,"tag":303,"props":309,"children":311},{"style":310},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[312],{"type":50,"value":313},"# Resolve output directory\n",{"type":44,"tag":303,"props":315,"children":317},{"class":305,"line":316},2,[318,324,330,335,340,346,351,356],{"type":44,"tag":303,"props":319,"children":321},{"style":320},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[322],{"type":50,"value":323},"if",{"type":44,"tag":303,"props":325,"children":327},{"style":326},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[328],{"type":50,"value":329}," [",{"type":44,"tag":303,"props":331,"children":332},{"style":326},[333],{"type":50,"value":334}," -n",{"type":44,"tag":303,"props":336,"children":337},{"style":326},[338],{"type":50,"value":339}," \"",{"type":44,"tag":303,"props":341,"children":343},{"style":342},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[344],{"type":50,"value":345},"$USER_SPECIFIED_DIR",{"type":44,"tag":303,"props":347,"children":348},{"style":326},[349],{"type":50,"value":350},"\"",{"type":44,"tag":303,"props":352,"children":353},{"style":326},[354],{"type":50,"value":355}," ];",{"type":44,"tag":303,"props":357,"children":358},{"style":320},[359],{"type":50,"value":360}," then\n",{"type":44,"tag":303,"props":362,"children":364},{"class":305,"line":363},3,[365,370,375,379,383],{"type":44,"tag":303,"props":366,"children":367},{"style":342},[368],{"type":50,"value":369},"  OUTPUT_DIR",{"type":44,"tag":303,"props":371,"children":372},{"style":326},[373],{"type":50,"value":374},"=",{"type":44,"tag":303,"props":376,"children":377},{"style":326},[378],{"type":50,"value":350},{"type":44,"tag":303,"props":380,"children":381},{"style":342},[382],{"type":50,"value":345},{"type":44,"tag":303,"props":384,"children":385},{"style":326},[386],{"type":50,"value":387},"\"\n",{"type":44,"tag":303,"props":389,"children":391},{"class":305,"line":390},4,[392],{"type":44,"tag":303,"props":393,"children":394},{"style":320},[395],{"type":50,"value":396},"else\n",{"type":44,"tag":303,"props":398,"children":400},{"class":305,"line":399},5,[401,406,410,414,420],{"type":44,"tag":303,"props":402,"children":403},{"style":342},[404],{"type":50,"value":405},"  BASE",{"type":44,"tag":303,"props":407,"children":408},{"style":326},[409],{"type":50,"value":374},{"type":44,"tag":303,"props":411,"children":412},{"style":326},[413],{"type":50,"value":350},{"type":44,"tag":303,"props":415,"children":417},{"style":416},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[418],{"type":50,"value":419},"static_analysis_codeql",{"type":44,"tag":303,"props":421,"children":422},{"style":326},[423],{"type":50,"value":387},{"type":44,"tag":303,"props":425,"children":427},{"class":305,"line":426},6,[428,433,437],{"type":44,"tag":303,"props":429,"children":430},{"style":342},[431],{"type":50,"value":432},"  N",{"type":44,"tag":303,"props":434,"children":435},{"style":326},[436],{"type":50,"value":374},{"type":44,"tag":303,"props":438,"children":439},{"style":416},[440],{"type":50,"value":441},"1\n",{"type":44,"tag":303,"props":443,"children":445},{"class":305,"line":444},7,[446,451,455,460,465,470,475,480,485,490,495,499],{"type":44,"tag":303,"props":447,"children":448},{"style":320},[449],{"type":50,"value":450},"  while",{"type":44,"tag":303,"props":452,"children":453},{"style":326},[454],{"type":50,"value":329},{"type":44,"tag":303,"props":456,"children":457},{"style":326},[458],{"type":50,"value":459}," -e",{"type":44,"tag":303,"props":461,"children":462},{"style":326},[463],{"type":50,"value":464}," \"${",{"type":44,"tag":303,"props":466,"children":467},{"style":342},[468],{"type":50,"value":469},"BASE",{"type":44,"tag":303,"props":471,"children":472},{"style":326},[473],{"type":50,"value":474},"}",{"type":44,"tag":303,"props":476,"children":477},{"style":416},[478],{"type":50,"value":479},"_",{"type":44,"tag":303,"props":481,"children":482},{"style":326},[483],{"type":50,"value":484},"${",{"type":44,"tag":303,"props":486,"children":487},{"style":342},[488],{"type":50,"value":489},"N",{"type":44,"tag":303,"props":491,"children":492},{"style":326},[493],{"type":50,"value":494},"}\"",{"type":44,"tag":303,"props":496,"children":497},{"style":326},[498],{"type":50,"value":355},{"type":44,"tag":303,"props":500,"children":501},{"style":320},[502],{"type":50,"value":503}," do\n",{"type":44,"tag":303,"props":505,"children":507},{"class":305,"line":506},8,[508,513,518,523,528,534],{"type":44,"tag":303,"props":509,"children":510},{"style":342},[511],{"type":50,"value":512},"    N",{"type":44,"tag":303,"props":514,"children":515},{"style":326},[516],{"type":50,"value":517},"=$((",{"type":44,"tag":303,"props":519,"children":521},{"style":520},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[522],{"type":50,"value":489},{"type":44,"tag":303,"props":524,"children":525},{"style":416},[526],{"type":50,"value":527}," +",{"type":44,"tag":303,"props":529,"children":531},{"style":530},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[532],{"type":50,"value":533}," 1",{"type":44,"tag":303,"props":535,"children":536},{"style":326},[537],{"type":50,"value":538},"))\n",{"type":44,"tag":303,"props":540,"children":542},{"class":305,"line":541},9,[543],{"type":44,"tag":303,"props":544,"children":545},{"style":320},[546],{"type":50,"value":547},"  done\n",{"type":44,"tag":303,"props":549,"children":551},{"class":305,"line":550},10,[552,556,560,565,569,573,577,581,585],{"type":44,"tag":303,"props":553,"children":554},{"style":342},[555],{"type":50,"value":369},{"type":44,"tag":303,"props":557,"children":558},{"style":326},[559],{"type":50,"value":374},{"type":44,"tag":303,"props":561,"children":562},{"style":326},[563],{"type":50,"value":564},"\"${",{"type":44,"tag":303,"props":566,"children":567},{"style":342},[568],{"type":50,"value":469},{"type":44,"tag":303,"props":570,"children":571},{"style":326},[572],{"type":50,"value":474},{"type":44,"tag":303,"props":574,"children":575},{"style":416},[576],{"type":50,"value":479},{"type":44,"tag":303,"props":578,"children":579},{"style":326},[580],{"type":50,"value":484},{"type":44,"tag":303,"props":582,"children":583},{"style":342},[584],{"type":50,"value":489},{"type":44,"tag":303,"props":586,"children":587},{"style":326},[588],{"type":50,"value":589},"}\"\n",{"type":44,"tag":303,"props":591,"children":593},{"class":305,"line":592},11,[594],{"type":44,"tag":303,"props":595,"children":596},{"style":320},[597],{"type":50,"value":598},"fi\n",{"type":44,"tag":303,"props":600,"children":602},{"class":305,"line":601},12,[603,608,613,617,622],{"type":44,"tag":303,"props":604,"children":605},{"style":520},[606],{"type":50,"value":607},"mkdir",{"type":44,"tag":303,"props":609,"children":610},{"style":416},[611],{"type":50,"value":612}," -p",{"type":44,"tag":303,"props":614,"children":615},{"style":326},[616],{"type":50,"value":339},{"type":44,"tag":303,"props":618,"children":619},{"style":342},[620],{"type":50,"value":621},"$OUTPUT_DIR",{"type":44,"tag":303,"props":623,"children":624},{"style":326},[625],{"type":50,"value":387},{"type":44,"tag":53,"props":627,"children":628},{},[629,631,636,638,643],{"type":50,"value":630},"The output directory is resolved ",{"type":44,"tag":62,"props":632,"children":633},{},[634],{"type":50,"value":635},"once",{"type":50,"value":637}," at the start before any workflow executes. All workflows receive ",{"type":44,"tag":70,"props":639,"children":641},{"className":640},[],[642],{"type":50,"value":621},{"type":50,"value":644}," and store their artifacts there:",{"type":44,"tag":292,"props":646,"children":650},{"className":647,"code":649,"language":50},[648],"language-text","$OUTPUT_DIR\u002F\n├── rulesets.txt                 # Selected query packs (logged after Step 3)\n├── codeql.db\u002F                   # CodeQL database (dir containing codeql-database.yml)\n├── build.log                    # Build log\n├── codeql-config.yml            # Exclusion config (interpreted languages)\n├── diagnostics\u002F                 # Diagnostic queries and CSVs\n├── extensions\u002F                  # Data extension YAMLs\n├── raw\u002F                         # Unfiltered analysis output\n│   ├── results.sarif\n│   └── \u003Cmode>.qls\n└── results\u002F                     # Final results (filtered for important-only, copied for run-all)\n    └── results.sarif\n",[651],{"type":44,"tag":70,"props":652,"children":653},{"__ignoreMap":297},[654],{"type":50,"value":649},{"type":44,"tag":656,"props":657,"children":659},"h3",{"id":658},"database-discovery",[660],{"type":50,"value":661},"Database Discovery",{"type":44,"tag":53,"props":663,"children":664},{},[665,667,673,675,680],{"type":50,"value":666},"A CodeQL database is identified by the presence of a ",{"type":44,"tag":70,"props":668,"children":670},{"className":669},[],[671],{"type":50,"value":672},"codeql-database.yml",{"type":50,"value":674}," marker file inside its directory. When searching for existing databases, ",{"type":44,"tag":62,"props":676,"children":677},{},[678],{"type":50,"value":679},"always collect all matches",{"type":50,"value":681}," — there may be multiple databases from previous runs or for different languages.",{"type":44,"tag":53,"props":683,"children":684},{},[685],{"type":44,"tag":62,"props":686,"children":687},{},[688],{"type":50,"value":689},"Discovery command:",{"type":44,"tag":292,"props":691,"children":693},{"className":294,"code":692,"language":296,"meta":297,"style":297},"# Find ALL CodeQL databases (top-level and one subdirectory deep)\nfind . -maxdepth 3 -name \"codeql-database.yml\" -not -path \"*\u002F\\.*\" 2>\u002Fdev\u002Fnull \\\n  | while read -r yml; do dirname \"$yml\"; done\n",[694],{"type":44,"tag":70,"props":695,"children":696},{"__ignoreMap":297},[697,705,783],{"type":44,"tag":303,"props":698,"children":699},{"class":305,"line":306},[700],{"type":44,"tag":303,"props":701,"children":702},{"style":310},[703],{"type":50,"value":704},"# Find ALL CodeQL databases (top-level and one subdirectory deep)\n",{"type":44,"tag":303,"props":706,"children":707},{"class":305,"line":316},[708,713,718,723,728,733,737,741,745,750,755,759,764,768,773,778],{"type":44,"tag":303,"props":709,"children":710},{"style":520},[711],{"type":50,"value":712},"find",{"type":44,"tag":303,"props":714,"children":715},{"style":416},[716],{"type":50,"value":717}," .",{"type":44,"tag":303,"props":719,"children":720},{"style":416},[721],{"type":50,"value":722}," -maxdepth",{"type":44,"tag":303,"props":724,"children":725},{"style":530},[726],{"type":50,"value":727}," 3",{"type":44,"tag":303,"props":729,"children":730},{"style":416},[731],{"type":50,"value":732}," -name",{"type":44,"tag":303,"props":734,"children":735},{"style":326},[736],{"type":50,"value":339},{"type":44,"tag":303,"props":738,"children":739},{"style":416},[740],{"type":50,"value":672},{"type":44,"tag":303,"props":742,"children":743},{"style":326},[744],{"type":50,"value":350},{"type":44,"tag":303,"props":746,"children":747},{"style":416},[748],{"type":50,"value":749}," -not",{"type":44,"tag":303,"props":751,"children":752},{"style":416},[753],{"type":50,"value":754}," -path",{"type":44,"tag":303,"props":756,"children":757},{"style":326},[758],{"type":50,"value":339},{"type":44,"tag":303,"props":760,"children":761},{"style":416},[762],{"type":50,"value":763},"*\u002F\\.*",{"type":44,"tag":303,"props":765,"children":766},{"style":326},[767],{"type":50,"value":350},{"type":44,"tag":303,"props":769,"children":770},{"style":326},[771],{"type":50,"value":772}," 2>",{"type":44,"tag":303,"props":774,"children":775},{"style":416},[776],{"type":50,"value":777},"\u002Fdev\u002Fnull",{"type":44,"tag":303,"props":779,"children":780},{"style":342},[781],{"type":50,"value":782}," \\\n",{"type":44,"tag":303,"props":784,"children":785},{"class":305,"line":363},[786,791,796,802,807,812,817,822,827,831,836,840,844],{"type":44,"tag":303,"props":787,"children":788},{"style":326},[789],{"type":50,"value":790},"  |",{"type":44,"tag":303,"props":792,"children":793},{"style":320},[794],{"type":50,"value":795}," while",{"type":44,"tag":303,"props":797,"children":799},{"style":798},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[800],{"type":50,"value":801}," read",{"type":44,"tag":303,"props":803,"children":804},{"style":416},[805],{"type":50,"value":806}," -r",{"type":44,"tag":303,"props":808,"children":809},{"style":416},[810],{"type":50,"value":811}," yml",{"type":44,"tag":303,"props":813,"children":814},{"style":326},[815],{"type":50,"value":816},";",{"type":44,"tag":303,"props":818,"children":819},{"style":320},[820],{"type":50,"value":821}," do",{"type":44,"tag":303,"props":823,"children":824},{"style":520},[825],{"type":50,"value":826}," dirname",{"type":44,"tag":303,"props":828,"children":829},{"style":326},[830],{"type":50,"value":339},{"type":44,"tag":303,"props":832,"children":833},{"style":342},[834],{"type":50,"value":835},"$yml",{"type":44,"tag":303,"props":837,"children":838},{"style":326},[839],{"type":50,"value":350},{"type":44,"tag":303,"props":841,"children":842},{"style":326},[843],{"type":50,"value":816},{"type":44,"tag":303,"props":845,"children":846},{"style":320},[847],{"type":50,"value":848}," done\n",{"type":44,"tag":217,"props":850,"children":851},{},[852,875],{"type":44,"tag":98,"props":853,"children":854},{},[855,867,869],{"type":44,"tag":62,"props":856,"children":857},{},[858,860,865],{"type":50,"value":859},"Inside ",{"type":44,"tag":70,"props":861,"children":863},{"className":862},[],[864],{"type":50,"value":621},{"type":50,"value":866},":",{"type":50,"value":868}," ",{"type":44,"tag":70,"props":870,"children":872},{"className":871},[],[873],{"type":50,"value":874},"find \"$OUTPUT_DIR\" -maxdepth 2 -name \"codeql-database.yml\"",{"type":44,"tag":98,"props":876,"children":877},{},[878,883,884,890,892,898,900,906],{"type":44,"tag":62,"props":879,"children":880},{},[881],{"type":50,"value":882},"Project-wide (for auto-detection):",{"type":50,"value":868},{"type":44,"tag":70,"props":885,"children":887},{"className":886},[],[888],{"type":50,"value":889},"find . -maxdepth 3 -name \"codeql-database.yml\"",{"type":50,"value":891}," — covers databases at the project top level (",{"type":44,"tag":70,"props":893,"children":895},{"className":894},[],[896],{"type":50,"value":897},".\u002Fdb-name\u002F",{"type":50,"value":899},") and one subdirectory deep (",{"type":44,"tag":70,"props":901,"children":903},{"className":902},[],[904],{"type":50,"value":905},".\u002Fsubdir\u002Fdb-name\u002F",{"type":50,"value":907},"). Does not search deeper.",{"type":44,"tag":53,"props":909,"children":910},{},[911,913,919],{"type":50,"value":912},"Never assume a database is named ",{"type":44,"tag":70,"props":914,"children":916},{"className":915},[],[917],{"type":50,"value":918},"codeql.db",{"type":50,"value":920}," — discover it by its marker file.",{"type":44,"tag":53,"props":922,"children":923},{},[924],{"type":44,"tag":62,"props":925,"children":926},{},[927],{"type":50,"value":928},"When multiple databases are found:",{"type":44,"tag":53,"props":930,"children":931},{},[932],{"type":50,"value":933},"For each discovered database, collect metadata to help the user choose:",{"type":44,"tag":292,"props":935,"children":937},{"className":294,"code":936,"language":296,"meta":297,"style":297},"# For each database, extract language and creation time\nfor db in $FOUND_DBS; do\n  CODEQL_LANG=$(codeql resolve database --format=json -- \"$db\" 2>\u002Fdev\u002Fnull | jq -r '.languages[0]')\n  CREATED=$(grep '^creationMetadata:' -A5 \"$db\u002Fcodeql-database.yml\" 2>\u002Fdev\u002Fnull | grep 'creationTime' | awk '{print $2}')\n  echo \"$db — language: $CODEQL_LANG, created: $CREATED\"\ndone\n",[938],{"type":44,"tag":70,"props":939,"children":940},{"__ignoreMap":297},[941,949,980,1072,1180,1220],{"type":44,"tag":303,"props":942,"children":943},{"class":305,"line":306},[944],{"type":44,"tag":303,"props":945,"children":946},{"style":310},[947],{"type":50,"value":948},"# For each database, extract language and creation time\n",{"type":44,"tag":303,"props":950,"children":951},{"class":305,"line":316},[952,957,962,967,972,976],{"type":44,"tag":303,"props":953,"children":954},{"style":320},[955],{"type":50,"value":956},"for",{"type":44,"tag":303,"props":958,"children":959},{"style":342},[960],{"type":50,"value":961}," db ",{"type":44,"tag":303,"props":963,"children":964},{"style":320},[965],{"type":50,"value":966},"in",{"type":44,"tag":303,"props":968,"children":969},{"style":342},[970],{"type":50,"value":971}," $FOUND_DBS",{"type":44,"tag":303,"props":973,"children":974},{"style":326},[975],{"type":50,"value":816},{"type":44,"tag":303,"props":977,"children":978},{"style":320},[979],{"type":50,"value":503},{"type":44,"tag":303,"props":981,"children":982},{"class":305,"line":363},[983,988,993,997,1002,1007,1012,1017,1021,1026,1030,1034,1038,1043,1048,1052,1057,1062,1067],{"type":44,"tag":303,"props":984,"children":985},{"style":342},[986],{"type":50,"value":987},"  CODEQL_LANG",{"type":44,"tag":303,"props":989,"children":990},{"style":326},[991],{"type":50,"value":992},"=$(",{"type":44,"tag":303,"props":994,"children":995},{"style":520},[996],{"type":50,"value":4},{"type":44,"tag":303,"props":998,"children":999},{"style":416},[1000],{"type":50,"value":1001}," resolve",{"type":44,"tag":303,"props":1003,"children":1004},{"style":416},[1005],{"type":50,"value":1006}," database",{"type":44,"tag":303,"props":1008,"children":1009},{"style":416},[1010],{"type":50,"value":1011}," --format=json",{"type":44,"tag":303,"props":1013,"children":1014},{"style":416},[1015],{"type":50,"value":1016}," --",{"type":44,"tag":303,"props":1018,"children":1019},{"style":326},[1020],{"type":50,"value":339},{"type":44,"tag":303,"props":1022,"children":1023},{"style":342},[1024],{"type":50,"value":1025},"$db",{"type":44,"tag":303,"props":1027,"children":1028},{"style":326},[1029],{"type":50,"value":350},{"type":44,"tag":303,"props":1031,"children":1032},{"style":326},[1033],{"type":50,"value":772},{"type":44,"tag":303,"props":1035,"children":1036},{"style":416},[1037],{"type":50,"value":777},{"type":44,"tag":303,"props":1039,"children":1040},{"style":326},[1041],{"type":50,"value":1042}," |",{"type":44,"tag":303,"props":1044,"children":1045},{"style":520},[1046],{"type":50,"value":1047}," jq",{"type":44,"tag":303,"props":1049,"children":1050},{"style":416},[1051],{"type":50,"value":806},{"type":44,"tag":303,"props":1053,"children":1054},{"style":326},[1055],{"type":50,"value":1056}," '",{"type":44,"tag":303,"props":1058,"children":1059},{"style":416},[1060],{"type":50,"value":1061},".languages[0]",{"type":44,"tag":303,"props":1063,"children":1064},{"style":326},[1065],{"type":50,"value":1066},"'",{"type":44,"tag":303,"props":1068,"children":1069},{"style":326},[1070],{"type":50,"value":1071},")\n",{"type":44,"tag":303,"props":1073,"children":1074},{"class":305,"line":390},[1075,1080,1084,1089,1093,1098,1102,1107,1111,1115,1120,1124,1128,1132,1136,1141,1145,1150,1154,1158,1163,1167,1172,1176],{"type":44,"tag":303,"props":1076,"children":1077},{"style":342},[1078],{"type":50,"value":1079},"  CREATED",{"type":44,"tag":303,"props":1081,"children":1082},{"style":326},[1083],{"type":50,"value":992},{"type":44,"tag":303,"props":1085,"children":1086},{"style":520},[1087],{"type":50,"value":1088},"grep",{"type":44,"tag":303,"props":1090,"children":1091},{"style":326},[1092],{"type":50,"value":1056},{"type":44,"tag":303,"props":1094,"children":1095},{"style":416},[1096],{"type":50,"value":1097},"^creationMetadata:",{"type":44,"tag":303,"props":1099,"children":1100},{"style":326},[1101],{"type":50,"value":1066},{"type":44,"tag":303,"props":1103,"children":1104},{"style":416},[1105],{"type":50,"value":1106}," -A5",{"type":44,"tag":303,"props":1108,"children":1109},{"style":326},[1110],{"type":50,"value":339},{"type":44,"tag":303,"props":1112,"children":1113},{"style":342},[1114],{"type":50,"value":1025},{"type":44,"tag":303,"props":1116,"children":1117},{"style":416},[1118],{"type":50,"value":1119},"\u002Fcodeql-database.yml",{"type":44,"tag":303,"props":1121,"children":1122},{"style":326},[1123],{"type":50,"value":350},{"type":44,"tag":303,"props":1125,"children":1126},{"style":326},[1127],{"type":50,"value":772},{"type":44,"tag":303,"props":1129,"children":1130},{"style":416},[1131],{"type":50,"value":777},{"type":44,"tag":303,"props":1133,"children":1134},{"style":326},[1135],{"type":50,"value":1042},{"type":44,"tag":303,"props":1137,"children":1138},{"style":520},[1139],{"type":50,"value":1140}," grep",{"type":44,"tag":303,"props":1142,"children":1143},{"style":326},[1144],{"type":50,"value":1056},{"type":44,"tag":303,"props":1146,"children":1147},{"style":416},[1148],{"type":50,"value":1149},"creationTime",{"type":44,"tag":303,"props":1151,"children":1152},{"style":326},[1153],{"type":50,"value":1066},{"type":44,"tag":303,"props":1155,"children":1156},{"style":326},[1157],{"type":50,"value":1042},{"type":44,"tag":303,"props":1159,"children":1160},{"style":520},[1161],{"type":50,"value":1162}," awk",{"type":44,"tag":303,"props":1164,"children":1165},{"style":326},[1166],{"type":50,"value":1056},{"type":44,"tag":303,"props":1168,"children":1169},{"style":416},[1170],{"type":50,"value":1171},"{print $2}",{"type":44,"tag":303,"props":1173,"children":1174},{"style":326},[1175],{"type":50,"value":1066},{"type":44,"tag":303,"props":1177,"children":1178},{"style":326},[1179],{"type":50,"value":1071},{"type":44,"tag":303,"props":1181,"children":1182},{"class":305,"line":399},[1183,1188,1192,1196,1201,1206,1211,1216],{"type":44,"tag":303,"props":1184,"children":1185},{"style":798},[1186],{"type":50,"value":1187},"  echo",{"type":44,"tag":303,"props":1189,"children":1190},{"style":326},[1191],{"type":50,"value":339},{"type":44,"tag":303,"props":1193,"children":1194},{"style":342},[1195],{"type":50,"value":1025},{"type":44,"tag":303,"props":1197,"children":1198},{"style":416},[1199],{"type":50,"value":1200}," — language: ",{"type":44,"tag":303,"props":1202,"children":1203},{"style":342},[1204],{"type":50,"value":1205},"$CODEQL_LANG",{"type":44,"tag":303,"props":1207,"children":1208},{"style":416},[1209],{"type":50,"value":1210},", created: ",{"type":44,"tag":303,"props":1212,"children":1213},{"style":342},[1214],{"type":50,"value":1215},"$CREATED",{"type":44,"tag":303,"props":1217,"children":1218},{"style":326},[1219],{"type":50,"value":387},{"type":44,"tag":303,"props":1221,"children":1222},{"class":305,"line":426},[1223],{"type":44,"tag":303,"props":1224,"children":1225},{"style":320},[1226],{"type":50,"value":1227},"done\n",{"type":44,"tag":53,"props":1229,"children":1230},{},[1231,1233,1239,1241],{"type":50,"value":1232},"Then use ",{"type":44,"tag":70,"props":1234,"children":1236},{"className":1235},[],[1237],{"type":50,"value":1238},"AskUserQuestion",{"type":50,"value":1240}," to let the user select which database to use, or to build a new one. ",{"type":44,"tag":62,"props":1242,"children":1243},{},[1244,1246,1251],{"type":50,"value":1245},"Skip ",{"type":44,"tag":70,"props":1247,"children":1249},{"className":1248},[],[1250],{"type":50,"value":1238},{"type":50,"value":1252}," if the user explicitly stated which database to use or to build a new one in their prompt.",{"type":44,"tag":87,"props":1254,"children":1256},{"id":1255},"quick-start",[1257],{"type":50,"value":1258},"Quick Start",{"type":44,"tag":53,"props":1260,"children":1261},{},[1262],{"type":50,"value":1263},"For the common case (\"scan this codebase for vulnerabilities\"):",{"type":44,"tag":292,"props":1265,"children":1267},{"className":294,"code":1266,"language":296,"meta":297,"style":297},"# 1. Verify CodeQL is installed\nif ! command -v codeql >\u002Fdev\u002Fnull 2>&1; then\n  echo \"NOT INSTALLED: codeql binary not found on PATH\"\nelse\n  codeql --version || echo \"ERROR: codeql found but --version failed (check installation)\"\nfi\n\n# 2. Resolve output directory\nBASE=\"static_analysis_codeql\"; N=1\nwhile [ -e \"${BASE}_${N}\" ]; do N=$((N + 1)); done\nOUTPUT_DIR=\"${BASE}_${N}\"; mkdir -p \"$OUTPUT_DIR\"\n",[1268],{"type":44,"tag":70,"props":1269,"children":1270},{"__ignoreMap":297},[1271,1279,1324,1344,1351,1387,1394,1403,1411,1451,1532],{"type":44,"tag":303,"props":1272,"children":1273},{"class":305,"line":306},[1274],{"type":44,"tag":303,"props":1275,"children":1276},{"style":310},[1277],{"type":50,"value":1278},"# 1. Verify CodeQL is installed\n",{"type":44,"tag":303,"props":1280,"children":1281},{"class":305,"line":316},[1282,1286,1291,1296,1301,1306,1311,1315,1320],{"type":44,"tag":303,"props":1283,"children":1284},{"style":320},[1285],{"type":50,"value":323},{"type":44,"tag":303,"props":1287,"children":1288},{"style":326},[1289],{"type":50,"value":1290}," !",{"type":44,"tag":303,"props":1292,"children":1293},{"style":798},[1294],{"type":50,"value":1295}," command",{"type":44,"tag":303,"props":1297,"children":1298},{"style":416},[1299],{"type":50,"value":1300}," -v",{"type":44,"tag":303,"props":1302,"children":1303},{"style":416},[1304],{"type":50,"value":1305}," codeql",{"type":44,"tag":303,"props":1307,"children":1308},{"style":326},[1309],{"type":50,"value":1310}," >",{"type":44,"tag":303,"props":1312,"children":1313},{"style":416},[1314],{"type":50,"value":777},{"type":44,"tag":303,"props":1316,"children":1317},{"style":326},[1318],{"type":50,"value":1319}," 2>&1;",{"type":44,"tag":303,"props":1321,"children":1322},{"style":320},[1323],{"type":50,"value":360},{"type":44,"tag":303,"props":1325,"children":1326},{"class":305,"line":363},[1327,1331,1335,1340],{"type":44,"tag":303,"props":1328,"children":1329},{"style":798},[1330],{"type":50,"value":1187},{"type":44,"tag":303,"props":1332,"children":1333},{"style":326},[1334],{"type":50,"value":339},{"type":44,"tag":303,"props":1336,"children":1337},{"style":416},[1338],{"type":50,"value":1339},"NOT INSTALLED: codeql binary not found on PATH",{"type":44,"tag":303,"props":1341,"children":1342},{"style":326},[1343],{"type":50,"value":387},{"type":44,"tag":303,"props":1345,"children":1346},{"class":305,"line":390},[1347],{"type":44,"tag":303,"props":1348,"children":1349},{"style":320},[1350],{"type":50,"value":396},{"type":44,"tag":303,"props":1352,"children":1353},{"class":305,"line":399},[1354,1359,1364,1369,1374,1378,1383],{"type":44,"tag":303,"props":1355,"children":1356},{"style":520},[1357],{"type":50,"value":1358},"  codeql",{"type":44,"tag":303,"props":1360,"children":1361},{"style":416},[1362],{"type":50,"value":1363}," --version",{"type":44,"tag":303,"props":1365,"children":1366},{"style":326},[1367],{"type":50,"value":1368}," ||",{"type":44,"tag":303,"props":1370,"children":1371},{"style":798},[1372],{"type":50,"value":1373}," echo",{"type":44,"tag":303,"props":1375,"children":1376},{"style":326},[1377],{"type":50,"value":339},{"type":44,"tag":303,"props":1379,"children":1380},{"style":416},[1381],{"type":50,"value":1382},"ERROR: codeql found but --version failed (check installation)",{"type":44,"tag":303,"props":1384,"children":1385},{"style":326},[1386],{"type":50,"value":387},{"type":44,"tag":303,"props":1388,"children":1389},{"class":305,"line":426},[1390],{"type":44,"tag":303,"props":1391,"children":1392},{"style":320},[1393],{"type":50,"value":598},{"type":44,"tag":303,"props":1395,"children":1396},{"class":305,"line":444},[1397],{"type":44,"tag":303,"props":1398,"children":1400},{"emptyLinePlaceholder":1399},true,[1401],{"type":50,"value":1402},"\n",{"type":44,"tag":303,"props":1404,"children":1405},{"class":305,"line":506},[1406],{"type":44,"tag":303,"props":1407,"children":1408},{"style":310},[1409],{"type":50,"value":1410},"# 2. Resolve output directory\n",{"type":44,"tag":303,"props":1412,"children":1413},{"class":305,"line":541},[1414,1418,1422,1426,1430,1434,1438,1443,1447],{"type":44,"tag":303,"props":1415,"children":1416},{"style":342},[1417],{"type":50,"value":469},{"type":44,"tag":303,"props":1419,"children":1420},{"style":326},[1421],{"type":50,"value":374},{"type":44,"tag":303,"props":1423,"children":1424},{"style":326},[1425],{"type":50,"value":350},{"type":44,"tag":303,"props":1427,"children":1428},{"style":416},[1429],{"type":50,"value":419},{"type":44,"tag":303,"props":1431,"children":1432},{"style":326},[1433],{"type":50,"value":350},{"type":44,"tag":303,"props":1435,"children":1436},{"style":326},[1437],{"type":50,"value":816},{"type":44,"tag":303,"props":1439,"children":1440},{"style":342},[1441],{"type":50,"value":1442}," N",{"type":44,"tag":303,"props":1444,"children":1445},{"style":326},[1446],{"type":50,"value":374},{"type":44,"tag":303,"props":1448,"children":1449},{"style":416},[1450],{"type":50,"value":441},{"type":44,"tag":303,"props":1452,"children":1453},{"class":305,"line":550},[1454,1459,1463,1467,1471,1475,1479,1483,1487,1491,1495,1499,1503,1507,1511,1515,1519,1523,1528],{"type":44,"tag":303,"props":1455,"children":1456},{"style":320},[1457],{"type":50,"value":1458},"while",{"type":44,"tag":303,"props":1460,"children":1461},{"style":326},[1462],{"type":50,"value":329},{"type":44,"tag":303,"props":1464,"children":1465},{"style":326},[1466],{"type":50,"value":459},{"type":44,"tag":303,"props":1468,"children":1469},{"style":326},[1470],{"type":50,"value":464},{"type":44,"tag":303,"props":1472,"children":1473},{"style":342},[1474],{"type":50,"value":469},{"type":44,"tag":303,"props":1476,"children":1477},{"style":326},[1478],{"type":50,"value":474},{"type":44,"tag":303,"props":1480,"children":1481},{"style":416},[1482],{"type":50,"value":479},{"type":44,"tag":303,"props":1484,"children":1485},{"style":326},[1486],{"type":50,"value":484},{"type":44,"tag":303,"props":1488,"children":1489},{"style":342},[1490],{"type":50,"value":489},{"type":44,"tag":303,"props":1492,"children":1493},{"style":326},[1494],{"type":50,"value":494},{"type":44,"tag":303,"props":1496,"children":1497},{"style":326},[1498],{"type":50,"value":355},{"type":44,"tag":303,"props":1500,"children":1501},{"style":320},[1502],{"type":50,"value":821},{"type":44,"tag":303,"props":1504,"children":1505},{"style":342},[1506],{"type":50,"value":1442},{"type":44,"tag":303,"props":1508,"children":1509},{"style":326},[1510],{"type":50,"value":517},{"type":44,"tag":303,"props":1512,"children":1513},{"style":520},[1514],{"type":50,"value":489},{"type":44,"tag":303,"props":1516,"children":1517},{"style":416},[1518],{"type":50,"value":527},{"type":44,"tag":303,"props":1520,"children":1521},{"style":530},[1522],{"type":50,"value":533},{"type":44,"tag":303,"props":1524,"children":1525},{"style":326},[1526],{"type":50,"value":1527},"));",{"type":44,"tag":303,"props":1529,"children":1530},{"style":320},[1531],{"type":50,"value":848},{"type":44,"tag":303,"props":1533,"children":1534},{"class":305,"line":592},[1535,1539,1543,1547,1551,1555,1559,1563,1567,1571,1575,1580,1584,1588,1592],{"type":44,"tag":303,"props":1536,"children":1537},{"style":342},[1538],{"type":50,"value":235},{"type":44,"tag":303,"props":1540,"children":1541},{"style":326},[1542],{"type":50,"value":374},{"type":44,"tag":303,"props":1544,"children":1545},{"style":326},[1546],{"type":50,"value":564},{"type":44,"tag":303,"props":1548,"children":1549},{"style":342},[1550],{"type":50,"value":469},{"type":44,"tag":303,"props":1552,"children":1553},{"style":326},[1554],{"type":50,"value":474},{"type":44,"tag":303,"props":1556,"children":1557},{"style":416},[1558],{"type":50,"value":479},{"type":44,"tag":303,"props":1560,"children":1561},{"style":326},[1562],{"type":50,"value":484},{"type":44,"tag":303,"props":1564,"children":1565},{"style":342},[1566],{"type":50,"value":489},{"type":44,"tag":303,"props":1568,"children":1569},{"style":326},[1570],{"type":50,"value":494},{"type":44,"tag":303,"props":1572,"children":1573},{"style":326},[1574],{"type":50,"value":816},{"type":44,"tag":303,"props":1576,"children":1577},{"style":520},[1578],{"type":50,"value":1579}," mkdir",{"type":44,"tag":303,"props":1581,"children":1582},{"style":416},[1583],{"type":50,"value":612},{"type":44,"tag":303,"props":1585,"children":1586},{"style":326},[1587],{"type":50,"value":339},{"type":44,"tag":303,"props":1589,"children":1590},{"style":342},[1591],{"type":50,"value":621},{"type":44,"tag":303,"props":1593,"children":1594},{"style":326},[1595],{"type":50,"value":387},{"type":44,"tag":53,"props":1597,"children":1598},{},[1599,1601,1606],{"type":50,"value":1600},"Then execute the full pipeline: ",{"type":44,"tag":62,"props":1602,"children":1603},{},[1604],{"type":50,"value":1605},"build database → create data extensions → run analysis",{"type":50,"value":1607}," using the workflows below.",{"type":44,"tag":87,"props":1609,"children":1611},{"id":1610},"when-to-use",[1612],{"type":50,"value":1613},"When to Use",{"type":44,"tag":217,"props":1615,"children":1616},{},[1617,1622,1627,1632],{"type":44,"tag":98,"props":1618,"children":1619},{},[1620],{"type":50,"value":1621},"Scanning a codebase for security vulnerabilities with deep data flow analysis",{"type":44,"tag":98,"props":1623,"children":1624},{},[1625],{"type":50,"value":1626},"Building a CodeQL database from source code (with build capability for compiled languages)",{"type":44,"tag":98,"props":1628,"children":1629},{},[1630],{"type":50,"value":1631},"Finding complex vulnerabilities that require interprocedural taint tracking or AST\u002FCFG analysis",{"type":44,"tag":98,"props":1633,"children":1634},{},[1635],{"type":50,"value":1636},"Performing comprehensive security audits with multiple query packs",{"type":44,"tag":87,"props":1638,"children":1640},{"id":1639},"when-not-to-use",[1641],{"type":50,"value":1642},"When NOT to Use",{"type":44,"tag":217,"props":1644,"children":1645},{},[1646,1656,1666,1676,1686],{"type":44,"tag":98,"props":1647,"children":1648},{},[1649,1654],{"type":44,"tag":62,"props":1650,"children":1651},{},[1652],{"type":50,"value":1653},"Writing custom queries",{"type":50,"value":1655}," - Use a dedicated query development skill",{"type":44,"tag":98,"props":1657,"children":1658},{},[1659,1664],{"type":44,"tag":62,"props":1660,"children":1661},{},[1662],{"type":50,"value":1663},"CI\u002FCD integration",{"type":50,"value":1665}," - Use GitHub Actions documentation directly",{"type":44,"tag":98,"props":1667,"children":1668},{},[1669,1674],{"type":44,"tag":62,"props":1670,"children":1671},{},[1672],{"type":50,"value":1673},"Quick pattern searches",{"type":50,"value":1675}," - Use Semgrep or grep for speed",{"type":44,"tag":98,"props":1677,"children":1678},{},[1679,1684],{"type":44,"tag":62,"props":1680,"children":1681},{},[1682],{"type":50,"value":1683},"No build capability",{"type":50,"value":1685}," for compiled languages - Consider Semgrep instead",{"type":44,"tag":98,"props":1687,"children":1688},{},[1689,1694],{"type":44,"tag":62,"props":1690,"children":1691},{},[1692],{"type":50,"value":1693},"Single-file or lightweight analysis",{"type":50,"value":1695}," - Semgrep is faster for simple pattern matching",{"type":44,"tag":87,"props":1697,"children":1699},{"id":1698},"rationalizations-to-reject",[1700],{"type":50,"value":1701},"Rationalizations to Reject",{"type":44,"tag":53,"props":1703,"children":1704},{},[1705],{"type":50,"value":1706},"These shortcuts lead to missed findings. Do not accept them:",{"type":44,"tag":217,"props":1708,"children":1709},{},[1710,1728,1768,1778,1788,1798,1829,1839,1863,1880,1890],{"type":44,"tag":98,"props":1711,"children":1712},{},[1713,1718,1720,1726],{"type":44,"tag":62,"props":1714,"children":1715},{},[1716],{"type":50,"value":1717},"\"security-extended is enough\"",{"type":50,"value":1719}," - It is the baseline. Always check if Trail of Bits packs and Community Packs are available for the language. They catch categories ",{"type":44,"tag":70,"props":1721,"children":1723},{"className":1722},[],[1724],{"type":50,"value":1725},"security-extended",{"type":50,"value":1727}," misses entirely.",{"type":44,"tag":98,"props":1729,"children":1730},{},[1731,1736,1738,1744,1746,1752,1754,1759,1760,1766],{"type":44,"tag":62,"props":1732,"children":1733},{},[1734],{"type":50,"value":1735},"\"security-and-quality is the broadest suite\"",{"type":50,"value":1737}," - ",{"type":44,"tag":70,"props":1739,"children":1741},{"className":1740},[],[1742],{"type":50,"value":1743},"security-and-quality",{"type":50,"value":1745}," excludes all ",{"type":44,"tag":70,"props":1747,"children":1749},{"className":1748},[],[1750],{"type":50,"value":1751},"experimental\u002F",{"type":50,"value":1753}," query paths. For run-all mode, import both ",{"type":44,"tag":70,"props":1755,"children":1757},{"className":1756},[],[1758],{"type":50,"value":1743},{"type":50,"value":77},{"type":44,"tag":70,"props":1761,"children":1763},{"className":1762},[],[1764],{"type":50,"value":1765},"security-experimental",{"type":50,"value":1767},". The delta is 1–52 queries depending on the language.",{"type":44,"tag":98,"props":1769,"children":1770},{},[1771,1776],{"type":44,"tag":62,"props":1772,"children":1773},{},[1774],{"type":50,"value":1775},"\"The database built, so it's good\"",{"type":50,"value":1777}," - A database that builds does not mean it extracted well. Always run quality assessment and check file counts against expected source files.",{"type":44,"tag":98,"props":1779,"children":1780},{},[1781,1786],{"type":44,"tag":62,"props":1782,"children":1783},{},[1784],{"type":50,"value":1785},"\"Data extensions aren't needed for standard frameworks\"",{"type":50,"value":1787}," - Even Django\u002FSpring apps have custom wrappers that CodeQL does not model. Skipping extensions means missing vulnerabilities.",{"type":44,"tag":98,"props":1789,"children":1790},{},[1791,1796],{"type":44,"tag":62,"props":1792,"children":1793},{},[1794],{"type":50,"value":1795},"\"build-mode=none is fine for compiled languages\"",{"type":50,"value":1797}," - It produces severely incomplete analysis. Only use as an absolute last resort. On macOS, try the arm64 toolchain workaround or Rosetta first.",{"type":44,"tag":98,"props":1799,"children":1800},{},[1801,1806,1808,1813,1814,1819,1821,1828],{"type":44,"tag":62,"props":1802,"children":1803},{},[1804],{"type":50,"value":1805},"\"The build fails on macOS, just use build-mode=none\"",{"type":50,"value":1807}," - Exit code 137 is caused by ",{"type":44,"tag":70,"props":1809,"children":1811},{"className":1810},[],[1812],{"type":50,"value":177},{"type":50,"value":179},{"type":44,"tag":70,"props":1815,"children":1817},{"className":1816},[],[1818],{"type":50,"value":185},{"type":50,"value":1820}," mismatch, not a fundamental build failure. See ",{"type":44,"tag":1822,"props":1823,"children":1825},"a",{"href":1824},"references\u002Fmacos-arm64e-workaround.md",[1826],{"type":50,"value":1827},"macos-arm64e-workaround.md",{"type":50,"value":85},{"type":44,"tag":98,"props":1830,"children":1831},{},[1832,1837],{"type":44,"tag":62,"props":1833,"children":1834},{},[1835],{"type":50,"value":1836},"\"No findings means the code is secure\"",{"type":50,"value":1838}," - Zero findings can indicate poor database quality, missing models, or wrong query packs. Investigate before reporting clean results.",{"type":44,"tag":98,"props":1840,"children":1841},{},[1842,1847,1849,1854,1856,1861],{"type":44,"tag":62,"props":1843,"children":1844},{},[1845],{"type":50,"value":1846},"\"I'll just run the default suite\"",{"type":50,"value":1848}," \u002F ",{"type":44,"tag":62,"props":1850,"children":1851},{},[1852],{"type":50,"value":1853},"\"I'll just pass the pack names directly\"",{"type":50,"value":1855}," - Each pack's ",{"type":44,"tag":70,"props":1857,"children":1859},{"className":1858},[],[1860],{"type":50,"value":141},{"type":50,"value":1862}," applies hidden filters and can produce zero results. Always use an explicit suite reference.",{"type":44,"tag":98,"props":1864,"children":1865},{},[1866,1871,1873,1878],{"type":44,"tag":62,"props":1867,"children":1868},{},[1869],{"type":50,"value":1870},"\"I'll put files in the current directory\"",{"type":50,"value":1872}," - All generated files must go in ",{"type":44,"tag":70,"props":1874,"children":1876},{"className":1875},[],[1877],{"type":50,"value":621},{"type":50,"value":1879},". Scattering files in the working directory makes cleanup impossible and risks overwriting previous runs.",{"type":44,"tag":98,"props":1881,"children":1882},{},[1883,1888],{"type":44,"tag":62,"props":1884,"children":1885},{},[1886],{"type":50,"value":1887},"\"Just use the first database I find\"",{"type":50,"value":1889}," - Multiple databases may exist for different languages or from previous runs. When more than one is found, present all options to the user. Only skip the prompt when the user already specified which database to use.",{"type":44,"tag":98,"props":1891,"children":1892},{},[1893,1898],{"type":44,"tag":62,"props":1894,"children":1895},{},[1896],{"type":50,"value":1897},"\"The user said 'scan', that means they want me to pick a database\"",{"type":50,"value":1899}," - \"Scan\" is not database selection. If multiple databases exist and the user didn't name one, ask.",{"type":44,"tag":1901,"props":1902,"children":1903},"hr",{},[],{"type":44,"tag":87,"props":1905,"children":1907},{"id":1906},"workflow-selection",[1908],{"type":50,"value":1909},"Workflow Selection",{"type":44,"tag":53,"props":1911,"children":1912},{},[1913,1915],{"type":50,"value":1914},"This skill has three workflows. ",{"type":44,"tag":62,"props":1916,"children":1917},{},[1918],{"type":50,"value":1919},"Once a workflow is selected, execute it step by step without skipping phases.",{"type":44,"tag":1921,"props":1922,"children":1923},"table",{},[1924,1943],{"type":44,"tag":1925,"props":1926,"children":1927},"thead",{},[1928],{"type":44,"tag":1929,"props":1930,"children":1931},"tr",{},[1932,1938],{"type":44,"tag":1933,"props":1934,"children":1935},"th",{},[1936],{"type":50,"value":1937},"Workflow",{"type":44,"tag":1933,"props":1939,"children":1940},{},[1941],{"type":50,"value":1942},"Purpose",{"type":44,"tag":1944,"props":1945,"children":1946},"tbody",{},[1947,1965,1982],{"type":44,"tag":1929,"props":1948,"children":1949},{},[1950,1960],{"type":44,"tag":1951,"props":1952,"children":1953},"td",{},[1954],{"type":44,"tag":1822,"props":1955,"children":1957},{"href":1956},"workflows\u002Fbuild-database.md",[1958],{"type":50,"value":1959},"build-database",{"type":44,"tag":1951,"props":1961,"children":1962},{},[1963],{"type":50,"value":1964},"Create CodeQL database using build methods in sequence",{"type":44,"tag":1929,"props":1966,"children":1967},{},[1968,1977],{"type":44,"tag":1951,"props":1969,"children":1970},{},[1971],{"type":44,"tag":1822,"props":1972,"children":1974},{"href":1973},"workflows\u002Fcreate-data-extensions.md",[1975],{"type":50,"value":1976},"create-data-extensions",{"type":44,"tag":1951,"props":1978,"children":1979},{},[1980],{"type":50,"value":1981},"Detect or generate data extension models for project APIs",{"type":44,"tag":1929,"props":1983,"children":1984},{},[1985,1994],{"type":44,"tag":1951,"props":1986,"children":1987},{},[1988],{"type":44,"tag":1822,"props":1989,"children":1991},{"href":1990},"workflows\u002Frun-analysis.md",[1992],{"type":50,"value":1993},"run-analysis",{"type":44,"tag":1951,"props":1995,"children":1996},{},[1997],{"type":50,"value":1998},"Select rulesets, execute queries, process results",{"type":44,"tag":656,"props":2000,"children":2002},{"id":2001},"auto-detection-logic",[2003],{"type":50,"value":2004},"Auto-Detection Logic",{"type":44,"tag":53,"props":2006,"children":2007},{},[2008,2013,2015,2027],{"type":44,"tag":62,"props":2009,"children":2010},{},[2011],{"type":50,"value":2012},"If user explicitly specifies",{"type":50,"value":2014}," what to do (e.g., \"build a database\", \"run analysis on .\u002Fmy-db\"), execute that workflow directly. ",{"type":44,"tag":62,"props":2016,"children":2017},{},[2018,2020,2025],{"type":50,"value":2019},"Do NOT call ",{"type":44,"tag":70,"props":2021,"children":2023},{"className":2022},[],[2024],{"type":50,"value":1238},{"type":50,"value":2026}," for database selection if the user's prompt already makes their intent clear",{"type":50,"value":2028}," — e.g., \"build a new database\", \"analyze the codeql database in static_analysis_codeql_2\", \"run a full scan from scratch\".",{"type":44,"tag":53,"props":2030,"children":2031},{},[2032,2037],{"type":44,"tag":62,"props":2033,"children":2034},{},[2035],{"type":50,"value":2036},"Default pipeline for \"test\", \"scan\", \"analyze\", or similar:",{"type":50,"value":2038}," Discover existing databases first, then decide.",{"type":44,"tag":292,"props":2040,"children":2042},{"className":294,"code":2041,"language":296,"meta":297,"style":297},"# Find ALL CodeQL databases by looking for codeql-database.yml marker file\n# Search top-level dirs and one subdirectory deep\nFOUND_DBS=()\nwhile IFS= read -r yml; do\n  db_dir=$(dirname \"$yml\")\n  codeql resolve database -- \"$db_dir\" >\u002Fdev\u002Fnull 2>&1 && FOUND_DBS+=(\"$db_dir\")\ndone \u003C \u003C(find . -maxdepth 3 -name \"codeql-database.yml\" -not -path \"*\u002F\\.*\" 2>\u002Fdev\u002Fnull)\n\necho \"Found ${#FOUND_DBS[@]} existing database(s)\"\n",[2043],{"type":44,"tag":70,"props":2044,"children":2045},{"__ignoreMap":297},[2046,2054,2062,2075,2111,2144,2220,2298,2305],{"type":44,"tag":303,"props":2047,"children":2048},{"class":305,"line":306},[2049],{"type":44,"tag":303,"props":2050,"children":2051},{"style":310},[2052],{"type":50,"value":2053},"# Find ALL CodeQL databases by looking for codeql-database.yml marker file\n",{"type":44,"tag":303,"props":2055,"children":2056},{"class":305,"line":316},[2057],{"type":44,"tag":303,"props":2058,"children":2059},{"style":310},[2060],{"type":50,"value":2061},"# Search top-level dirs and one subdirectory deep\n",{"type":44,"tag":303,"props":2063,"children":2064},{"class":305,"line":363},[2065,2070],{"type":44,"tag":303,"props":2066,"children":2067},{"style":342},[2068],{"type":50,"value":2069},"FOUND_DBS",{"type":44,"tag":303,"props":2071,"children":2072},{"style":326},[2073],{"type":50,"value":2074},"=()\n",{"type":44,"tag":303,"props":2076,"children":2077},{"class":305,"line":390},[2078,2082,2087,2091,2095,2099,2103,2107],{"type":44,"tag":303,"props":2079,"children":2080},{"style":320},[2081],{"type":50,"value":1458},{"type":44,"tag":303,"props":2083,"children":2084},{"style":342},[2085],{"type":50,"value":2086}," IFS",{"type":44,"tag":303,"props":2088,"children":2089},{"style":326},[2090],{"type":50,"value":374},{"type":44,"tag":303,"props":2092,"children":2093},{"style":798},[2094],{"type":50,"value":801},{"type":44,"tag":303,"props":2096,"children":2097},{"style":416},[2098],{"type":50,"value":806},{"type":44,"tag":303,"props":2100,"children":2101},{"style":416},[2102],{"type":50,"value":811},{"type":44,"tag":303,"props":2104,"children":2105},{"style":326},[2106],{"type":50,"value":816},{"type":44,"tag":303,"props":2108,"children":2109},{"style":320},[2110],{"type":50,"value":503},{"type":44,"tag":303,"props":2112,"children":2113},{"class":305,"line":399},[2114,2119,2123,2128,2132,2136,2140],{"type":44,"tag":303,"props":2115,"children":2116},{"style":342},[2117],{"type":50,"value":2118},"  db_dir",{"type":44,"tag":303,"props":2120,"children":2121},{"style":326},[2122],{"type":50,"value":992},{"type":44,"tag":303,"props":2124,"children":2125},{"style":520},[2126],{"type":50,"value":2127},"dirname",{"type":44,"tag":303,"props":2129,"children":2130},{"style":326},[2131],{"type":50,"value":339},{"type":44,"tag":303,"props":2133,"children":2134},{"style":342},[2135],{"type":50,"value":835},{"type":44,"tag":303,"props":2137,"children":2138},{"style":326},[2139],{"type":50,"value":350},{"type":44,"tag":303,"props":2141,"children":2142},{"style":326},[2143],{"type":50,"value":1071},{"type":44,"tag":303,"props":2145,"children":2146},{"class":305,"line":426},[2147,2151,2155,2159,2163,2167,2172,2176,2180,2184,2189,2194,2199,2204,2208,2212,2216],{"type":44,"tag":303,"props":2148,"children":2149},{"style":520},[2150],{"type":50,"value":1358},{"type":44,"tag":303,"props":2152,"children":2153},{"style":416},[2154],{"type":50,"value":1001},{"type":44,"tag":303,"props":2156,"children":2157},{"style":416},[2158],{"type":50,"value":1006},{"type":44,"tag":303,"props":2160,"children":2161},{"style":416},[2162],{"type":50,"value":1016},{"type":44,"tag":303,"props":2164,"children":2165},{"style":326},[2166],{"type":50,"value":339},{"type":44,"tag":303,"props":2168,"children":2169},{"style":342},[2170],{"type":50,"value":2171},"$db_dir",{"type":44,"tag":303,"props":2173,"children":2174},{"style":326},[2175],{"type":50,"value":350},{"type":44,"tag":303,"props":2177,"children":2178},{"style":326},[2179],{"type":50,"value":1310},{"type":44,"tag":303,"props":2181,"children":2182},{"style":416},[2183],{"type":50,"value":777},{"type":44,"tag":303,"props":2185,"children":2186},{"style":326},[2187],{"type":50,"value":2188}," 2>&1",{"type":44,"tag":303,"props":2190,"children":2191},{"style":326},[2192],{"type":50,"value":2193}," &&",{"type":44,"tag":303,"props":2195,"children":2196},{"style":342},[2197],{"type":50,"value":2198}," FOUND_DBS",{"type":44,"tag":303,"props":2200,"children":2201},{"style":326},[2202],{"type":50,"value":2203},"+=(",{"type":44,"tag":303,"props":2205,"children":2206},{"style":326},[2207],{"type":50,"value":350},{"type":44,"tag":303,"props":2209,"children":2210},{"style":342},[2211],{"type":50,"value":2171},{"type":44,"tag":303,"props":2213,"children":2214},{"style":326},[2215],{"type":50,"value":350},{"type":44,"tag":303,"props":2217,"children":2218},{"style":326},[2219],{"type":50,"value":1071},{"type":44,"tag":303,"props":2221,"children":2222},{"class":305,"line":444},[2223,2228,2233,2238,2242,2247,2252,2257,2261,2265,2269,2274,2278,2282,2286,2290,2294],{"type":44,"tag":303,"props":2224,"children":2225},{"style":320},[2226],{"type":50,"value":2227},"done",{"type":44,"tag":303,"props":2229,"children":2230},{"style":326},[2231],{"type":50,"value":2232}," \u003C",{"type":44,"tag":303,"props":2234,"children":2235},{"style":326},[2236],{"type":50,"value":2237}," \u003C(",{"type":44,"tag":303,"props":2239,"children":2240},{"style":520},[2241],{"type":50,"value":712},{"type":44,"tag":303,"props":2243,"children":2244},{"style":416},[2245],{"type":50,"value":2246}," . -maxdepth ",{"type":44,"tag":303,"props":2248,"children":2249},{"style":530},[2250],{"type":50,"value":2251},"3",{"type":44,"tag":303,"props":2253,"children":2254},{"style":416},[2255],{"type":50,"value":2256}," -name ",{"type":44,"tag":303,"props":2258,"children":2259},{"style":326},[2260],{"type":50,"value":350},{"type":44,"tag":303,"props":2262,"children":2263},{"style":416},[2264],{"type":50,"value":672},{"type":44,"tag":303,"props":2266,"children":2267},{"style":326},[2268],{"type":50,"value":350},{"type":44,"tag":303,"props":2270,"children":2271},{"style":416},[2272],{"type":50,"value":2273}," -not -path ",{"type":44,"tag":303,"props":2275,"children":2276},{"style":326},[2277],{"type":50,"value":350},{"type":44,"tag":303,"props":2279,"children":2280},{"style":416},[2281],{"type":50,"value":763},{"type":44,"tag":303,"props":2283,"children":2284},{"style":326},[2285],{"type":50,"value":350},{"type":44,"tag":303,"props":2287,"children":2288},{"style":326},[2289],{"type":50,"value":772},{"type":44,"tag":303,"props":2291,"children":2292},{"style":416},[2293],{"type":50,"value":777},{"type":44,"tag":303,"props":2295,"children":2296},{"style":326},[2297],{"type":50,"value":1071},{"type":44,"tag":303,"props":2299,"children":2300},{"class":305,"line":506},[2301],{"type":44,"tag":303,"props":2302,"children":2303},{"emptyLinePlaceholder":1399},[2304],{"type":50,"value":1402},{"type":44,"tag":303,"props":2306,"children":2307},{"class":305,"line":541},[2308,2313,2317,2322,2327,2331,2336,2341],{"type":44,"tag":303,"props":2309,"children":2310},{"style":798},[2311],{"type":50,"value":2312},"echo",{"type":44,"tag":303,"props":2314,"children":2315},{"style":326},[2316],{"type":50,"value":339},{"type":44,"tag":303,"props":2318,"children":2319},{"style":416},[2320],{"type":50,"value":2321},"Found ",{"type":44,"tag":303,"props":2323,"children":2324},{"style":326},[2325],{"type":50,"value":2326},"${#",{"type":44,"tag":303,"props":2328,"children":2329},{"style":342},[2330],{"type":50,"value":2069},{"type":44,"tag":303,"props":2332,"children":2333},{"style":326},[2334],{"type":50,"value":2335},"[@]}",{"type":44,"tag":303,"props":2337,"children":2338},{"style":416},[2339],{"type":50,"value":2340}," existing database(s)",{"type":44,"tag":303,"props":2342,"children":2343},{"style":326},[2344],{"type":50,"value":387},{"type":44,"tag":1921,"props":2346,"children":2347},{},[2348,2364],{"type":44,"tag":1925,"props":2349,"children":2350},{},[2351],{"type":44,"tag":1929,"props":2352,"children":2353},{},[2354,2359],{"type":44,"tag":1933,"props":2355,"children":2356},{},[2357],{"type":50,"value":2358},"Condition",{"type":44,"tag":1933,"props":2360,"children":2361},{},[2362],{"type":50,"value":2363},"Action",{"type":44,"tag":1944,"props":2365,"children":2366},{},[2367,2387,2407,2426],{"type":44,"tag":1929,"props":2368,"children":2369},{},[2370,2375],{"type":44,"tag":1951,"props":2371,"children":2372},{},[2373],{"type":50,"value":2374},"No databases found",{"type":44,"tag":1951,"props":2376,"children":2377},{},[2378,2380,2385],{"type":50,"value":2379},"Resolve new ",{"type":44,"tag":70,"props":2381,"children":2383},{"className":2382},[],[2384],{"type":50,"value":621},{"type":50,"value":2386},", execute build → extensions → analysis (full pipeline)",{"type":44,"tag":1929,"props":2388,"children":2389},{},[2390,2395],{"type":44,"tag":1951,"props":2391,"children":2392},{},[2393],{"type":50,"value":2394},"One database found",{"type":44,"tag":1951,"props":2396,"children":2397},{},[2398,2400,2405],{"type":50,"value":2399},"Use ",{"type":44,"tag":70,"props":2401,"children":2403},{"className":2402},[],[2404],{"type":50,"value":1238},{"type":50,"value":2406},": reuse it or build new?",{"type":44,"tag":1929,"props":2408,"children":2409},{},[2410,2415],{"type":44,"tag":1951,"props":2411,"children":2412},{},[2413],{"type":50,"value":2414},"Multiple databases found",{"type":44,"tag":1951,"props":2416,"children":2417},{},[2418,2419,2424],{"type":50,"value":2399},{"type":44,"tag":70,"props":2420,"children":2422},{"className":2421},[],[2423],{"type":50,"value":1238},{"type":50,"value":2425},": list all with metadata, let user pick one or build new",{"type":44,"tag":1929,"props":2427,"children":2428},{},[2429,2434],{"type":44,"tag":1951,"props":2430,"children":2431},{},[2432],{"type":50,"value":2433},"User explicitly stated intent",{"type":44,"tag":1951,"props":2435,"children":2436},{},[2437,2438,2443],{"type":50,"value":1245},{"type":44,"tag":70,"props":2439,"children":2441},{"className":2440},[],[2442],{"type":50,"value":1238},{"type":50,"value":2444},", act on their instructions directly",{"type":44,"tag":656,"props":2446,"children":2448},{"id":2447},"database-selection-prompt",[2449],{"type":50,"value":2450},"Database Selection Prompt",{"type":44,"tag":53,"props":2452,"children":2453},{},[2454,2456,2461,2463,2468],{"type":50,"value":2455},"When existing databases are found ",{"type":44,"tag":62,"props":2457,"children":2458},{},[2459],{"type":50,"value":2460},"and the user did not explicitly specify which to use",{"type":50,"value":2462},", present via ",{"type":44,"tag":70,"props":2464,"children":2466},{"className":2465},[],[2467],{"type":50,"value":1238},{"type":50,"value":866},{"type":44,"tag":292,"props":2470,"children":2473},{"className":2471,"code":2472,"language":50},[648],"header: \"Existing CodeQL Databases\"\nquestion: \"I found existing CodeQL database(s). What would you like to do?\"\noptions:\n  - label: \"\u003Cdb_path_1> (language: python, created: 2026-02-24)\"\n    description: \"Reuse this database\"\n  - label: \"\u003Cdb_path_2> (language: cpp, created: 2026-02-23)\"\n    description: \"Reuse this database\"\n  - label: \"Build a new database\"\n    description: \"Create a fresh database in a new output directory\"\n",[2474],{"type":44,"tag":70,"props":2475,"children":2476},{"__ignoreMap":297},[2477],{"type":50,"value":2472},{"type":44,"tag":53,"props":2479,"children":2480},{},[2481],{"type":50,"value":2482},"After selection:",{"type":44,"tag":217,"props":2484,"children":2485},{},[2486,2511],{"type":44,"tag":98,"props":2487,"children":2488},{},[2489,2494,2496,2501,2503,2509],{"type":44,"tag":62,"props":2490,"children":2491},{},[2492],{"type":50,"value":2493},"If user picks an existing database:",{"type":50,"value":2495}," Set ",{"type":44,"tag":70,"props":2497,"children":2499},{"className":2498},[],[2500],{"type":50,"value":621},{"type":50,"value":2502}," to its parent directory (or the directory containing it), set ",{"type":44,"tag":70,"props":2504,"children":2506},{"className":2505},[],[2507],{"type":50,"value":2508},"$DB_NAME",{"type":50,"value":2510}," to the selected path, then proceed to extensions → analysis.",{"type":44,"tag":98,"props":2512,"children":2513},{},[2514,2519,2521,2526],{"type":44,"tag":62,"props":2515,"children":2516},{},[2517],{"type":50,"value":2518},"If user picks \"Build new\":",{"type":50,"value":2520}," Resolve a new ",{"type":44,"tag":70,"props":2522,"children":2524},{"className":2523},[],[2525],{"type":50,"value":621},{"type":50,"value":2527},", execute build → extensions → analysis.",{"type":44,"tag":656,"props":2529,"children":2531},{"id":2530},"general-decision-prompt",[2532],{"type":50,"value":2533},"General Decision Prompt",{"type":44,"tag":53,"props":2535,"children":2536},{},[2537],{"type":50,"value":2538},"If the user's intent is ambiguous (neither database selection nor workflow is clear), ask:",{"type":44,"tag":292,"props":2540,"children":2543},{"className":2541,"code":2542,"language":50},[648],"I can help with CodeQL analysis. What would you like to do?\n\n1. **Full scan (Recommended)** - Build database, create extensions, then run analysis\n2. **Build database** - Create a new CodeQL database from this codebase\n3. **Create data extensions** - Generate custom source\u002Fsink models for project APIs\n4. **Run analysis** - Run security queries on existing database\n\n[If databases found: \"I found N existing database(s): \u003Clist paths with language>\"]\n[Show output directory: \"Output will be stored in \u003COUTPUT_DIR>\"]\n",[2544],{"type":44,"tag":70,"props":2545,"children":2546},{"__ignoreMap":297},[2547],{"type":50,"value":2542},{"type":44,"tag":1901,"props":2549,"children":2550},{},[],{"type":44,"tag":87,"props":2552,"children":2554},{"id":2553},"reference-index",[2555],{"type":50,"value":2556},"Reference Index",{"type":44,"tag":1921,"props":2558,"children":2559},{},[2560,2576],{"type":44,"tag":1925,"props":2561,"children":2562},{},[2563],{"type":44,"tag":1929,"props":2564,"children":2565},{},[2566,2571],{"type":44,"tag":1933,"props":2567,"children":2568},{},[2569],{"type":50,"value":2570},"File",{"type":44,"tag":1933,"props":2572,"children":2573},{},[2574],{"type":50,"value":2575},"Content",{"type":44,"tag":1944,"props":2577,"children":2578},{},[2579,2593,2608,2623,2638,2652,2667,2683,2699,2715,2731,2747,2763,2779,2795,2811,2827],{"type":44,"tag":1929,"props":2580,"children":2581},{},[2582,2590],{"type":44,"tag":1951,"props":2583,"children":2584},{},[2585],{"type":44,"tag":62,"props":2586,"children":2587},{},[2588],{"type":50,"value":2589},"Workflows",{"type":44,"tag":1951,"props":2591,"children":2592},{},[],{"type":44,"tag":1929,"props":2594,"children":2595},{},[2596,2603],{"type":44,"tag":1951,"props":2597,"children":2598},{},[2599],{"type":44,"tag":1822,"props":2600,"children":2601},{"href":1956},[2602],{"type":50,"value":1956},{"type":44,"tag":1951,"props":2604,"children":2605},{},[2606],{"type":50,"value":2607},"Database creation with build method sequence",{"type":44,"tag":1929,"props":2609,"children":2610},{},[2611,2618],{"type":44,"tag":1951,"props":2612,"children":2613},{},[2614],{"type":44,"tag":1822,"props":2615,"children":2616},{"href":1973},[2617],{"type":50,"value":1973},{"type":44,"tag":1951,"props":2619,"children":2620},{},[2621],{"type":50,"value":2622},"Data extension generation pipeline",{"type":44,"tag":1929,"props":2624,"children":2625},{},[2626,2633],{"type":44,"tag":1951,"props":2627,"children":2628},{},[2629],{"type":44,"tag":1822,"props":2630,"children":2631},{"href":1990},[2632],{"type":50,"value":1990},{"type":44,"tag":1951,"props":2634,"children":2635},{},[2636],{"type":50,"value":2637},"Query execution and result processing",{"type":44,"tag":1929,"props":2639,"children":2640},{},[2641,2649],{"type":44,"tag":1951,"props":2642,"children":2643},{},[2644],{"type":44,"tag":62,"props":2645,"children":2646},{},[2647],{"type":50,"value":2648},"References",{"type":44,"tag":1951,"props":2650,"children":2651},{},[],{"type":44,"tag":1929,"props":2653,"children":2654},{},[2655,2662],{"type":44,"tag":1951,"props":2656,"children":2657},{},[2658],{"type":44,"tag":1822,"props":2659,"children":2660},{"href":1824},[2661],{"type":50,"value":1824},{"type":44,"tag":1951,"props":2663,"children":2664},{},[2665],{"type":50,"value":2666},"Apple Silicon build tracing workarounds",{"type":44,"tag":1929,"props":2668,"children":2669},{},[2670,2678],{"type":44,"tag":1951,"props":2671,"children":2672},{},[2673],{"type":44,"tag":1822,"props":2674,"children":2676},{"href":2675},"references\u002Fbuild-fixes.md",[2677],{"type":50,"value":2675},{"type":44,"tag":1951,"props":2679,"children":2680},{},[2681],{"type":50,"value":2682},"Build failure fix catalog",{"type":44,"tag":1929,"props":2684,"children":2685},{},[2686,2694],{"type":44,"tag":1951,"props":2687,"children":2688},{},[2689],{"type":44,"tag":1822,"props":2690,"children":2692},{"href":2691},"references\u002Fquality-assessment.md",[2693],{"type":50,"value":2691},{"type":44,"tag":1951,"props":2695,"children":2696},{},[2697],{"type":50,"value":2698},"Database quality metrics and improvements",{"type":44,"tag":1929,"props":2700,"children":2701},{},[2702,2710],{"type":44,"tag":1951,"props":2703,"children":2704},{},[2705],{"type":44,"tag":1822,"props":2706,"children":2708},{"href":2707},"references\u002Fextension-yaml-format.md",[2709],{"type":50,"value":2707},{"type":44,"tag":1951,"props":2711,"children":2712},{},[2713],{"type":50,"value":2714},"Data extension YAML column definitions and examples",{"type":44,"tag":1929,"props":2716,"children":2717},{},[2718,2726],{"type":44,"tag":1951,"props":2719,"children":2720},{},[2721],{"type":44,"tag":1822,"props":2722,"children":2724},{"href":2723},"references\u002Fsarif-processing.md",[2725],{"type":50,"value":2723},{"type":44,"tag":1951,"props":2727,"children":2728},{},[2729],{"type":50,"value":2730},"jq commands for SARIF output processing",{"type":44,"tag":1929,"props":2732,"children":2733},{},[2734,2742],{"type":44,"tag":1951,"props":2735,"children":2736},{},[2737],{"type":44,"tag":1822,"props":2738,"children":2740},{"href":2739},"references\u002Fdiagnostic-query-templates.md",[2741],{"type":50,"value":2739},{"type":44,"tag":1951,"props":2743,"children":2744},{},[2745],{"type":50,"value":2746},"QL queries for source\u002Fsink enumeration",{"type":44,"tag":1929,"props":2748,"children":2749},{},[2750,2758],{"type":44,"tag":1951,"props":2751,"children":2752},{},[2753],{"type":44,"tag":1822,"props":2754,"children":2756},{"href":2755},"references\u002Fimportant-only-suite.md",[2757],{"type":50,"value":2755},{"type":44,"tag":1951,"props":2759,"children":2760},{},[2761],{"type":50,"value":2762},"Important-only suite template and generation",{"type":44,"tag":1929,"props":2764,"children":2765},{},[2766,2774],{"type":44,"tag":1951,"props":2767,"children":2768},{},[2769],{"type":44,"tag":1822,"props":2770,"children":2772},{"href":2771},"references\u002Frun-all-suite.md",[2773],{"type":50,"value":2771},{"type":44,"tag":1951,"props":2775,"children":2776},{},[2777],{"type":50,"value":2778},"Run-all suite template",{"type":44,"tag":1929,"props":2780,"children":2781},{},[2782,2790],{"type":44,"tag":1951,"props":2783,"children":2784},{},[2785],{"type":44,"tag":1822,"props":2786,"children":2788},{"href":2787},"references\u002Fruleset-catalog.md",[2789],{"type":50,"value":2787},{"type":44,"tag":1951,"props":2791,"children":2792},{},[2793],{"type":50,"value":2794},"Available query packs by language",{"type":44,"tag":1929,"props":2796,"children":2797},{},[2798,2806],{"type":44,"tag":1951,"props":2799,"children":2800},{},[2801],{"type":44,"tag":1822,"props":2802,"children":2804},{"href":2803},"references\u002Fthreat-models.md",[2805],{"type":50,"value":2803},{"type":44,"tag":1951,"props":2807,"children":2808},{},[2809],{"type":50,"value":2810},"Threat model configuration",{"type":44,"tag":1929,"props":2812,"children":2813},{},[2814,2822],{"type":44,"tag":1951,"props":2815,"children":2816},{},[2817],{"type":44,"tag":1822,"props":2818,"children":2820},{"href":2819},"references\u002Flanguage-details.md",[2821],{"type":50,"value":2819},{"type":44,"tag":1951,"props":2823,"children":2824},{},[2825],{"type":50,"value":2826},"Language-specific build and extraction details",{"type":44,"tag":1929,"props":2828,"children":2829},{},[2830,2838],{"type":44,"tag":1951,"props":2831,"children":2832},{},[2833],{"type":44,"tag":1822,"props":2834,"children":2836},{"href":2835},"references\u002Fperformance-tuning.md",[2837],{"type":50,"value":2835},{"type":44,"tag":1951,"props":2839,"children":2840},{},[2841],{"type":50,"value":2842},"Memory, threading, and timeout configuration",{"type":44,"tag":1901,"props":2844,"children":2845},{},[],{"type":44,"tag":87,"props":2847,"children":2849},{"id":2848},"success-criteria",[2850],{"type":50,"value":2851},"Success Criteria",{"type":44,"tag":53,"props":2853,"children":2854},{},[2855],{"type":50,"value":2856},"A complete CodeQL analysis run should satisfy:",{"type":44,"tag":217,"props":2858,"children":2861},{"className":2859},[2860],"contains-task-list",[2862,2874,2888,2904,2921,2930,2939,2954,2969,2986,2995],{"type":44,"tag":98,"props":2863,"children":2866},{"className":2864},[2865],"task-list-item",[2867,2872],{"type":44,"tag":2868,"props":2869,"children":2871},"input",{"disabled":1399,"type":2870},"checkbox",[],{"type":50,"value":2873}," Output directory resolved (user-specified or auto-incremented default)",{"type":44,"tag":98,"props":2875,"children":2877},{"className":2876},[2865],[2878,2881,2883],{"type":44,"tag":2868,"props":2879,"children":2880},{"disabled":1399,"type":2870},[],{"type":50,"value":2882}," All generated files stored inside ",{"type":44,"tag":70,"props":2884,"children":2886},{"className":2885},[],[2887],{"type":50,"value":621},{"type":44,"tag":98,"props":2889,"children":2891},{"className":2890},[2865],[2892,2895,2897,2902],{"type":44,"tag":2868,"props":2893,"children":2894},{"disabled":1399,"type":2870},[],{"type":50,"value":2896}," Database built (discovered via ",{"type":44,"tag":70,"props":2898,"children":2900},{"className":2899},[],[2901],{"type":50,"value":672},{"type":50,"value":2903}," marker) with quality assessment passed (baseline LoC > 0, errors \u003C 5%)",{"type":44,"tag":98,"props":2905,"children":2907},{"className":2906},[2865],[2908,2911,2913,2919],{"type":44,"tag":2868,"props":2909,"children":2910},{"disabled":1399,"type":2870},[],{"type":50,"value":2912}," Data extensions evaluated — either created in ",{"type":44,"tag":70,"props":2914,"children":2916},{"className":2915},[],[2917],{"type":50,"value":2918},"$OUTPUT_DIR\u002Fextensions\u002F",{"type":50,"value":2920}," or explicitly skipped with justification",{"type":44,"tag":98,"props":2922,"children":2924},{"className":2923},[2865],[2925,2928],{"type":44,"tag":2868,"props":2926,"children":2927},{"disabled":1399,"type":2870},[],{"type":50,"value":2929}," Analysis run with explicit suite reference (not default pack suite)",{"type":44,"tag":98,"props":2931,"children":2933},{"className":2932},[2865],[2934,2937],{"type":44,"tag":2868,"props":2935,"children":2936},{"disabled":1399,"type":2870},[],{"type":50,"value":2938}," All installed query packs (official + Trail of Bits + Community) used or explicitly excluded",{"type":44,"tag":98,"props":2940,"children":2942},{"className":2941},[2865],[2943,2946,2948],{"type":44,"tag":2868,"props":2944,"children":2945},{"disabled":1399,"type":2870},[],{"type":50,"value":2947}," Selected query packs logged to ",{"type":44,"tag":70,"props":2949,"children":2951},{"className":2950},[],[2952],{"type":50,"value":2953},"$OUTPUT_DIR\u002Frulesets.txt",{"type":44,"tag":98,"props":2955,"children":2957},{"className":2956},[2865],[2958,2961,2963],{"type":44,"tag":2868,"props":2959,"children":2960},{"disabled":1399,"type":2870},[],{"type":50,"value":2962}," Unfiltered results preserved in ",{"type":44,"tag":70,"props":2964,"children":2966},{"className":2965},[],[2967],{"type":50,"value":2968},"$OUTPUT_DIR\u002Fraw\u002Fresults.sarif",{"type":44,"tag":98,"props":2970,"children":2972},{"className":2971},[2865],[2973,2976,2978,2984],{"type":44,"tag":2868,"props":2974,"children":2975},{"disabled":1399,"type":2870},[],{"type":50,"value":2977}," Final results in ",{"type":44,"tag":70,"props":2979,"children":2981},{"className":2980},[],[2982],{"type":50,"value":2983},"$OUTPUT_DIR\u002Fresults\u002Fresults.sarif",{"type":50,"value":2985}," (filtered for important-only, copied for run-all)",{"type":44,"tag":98,"props":2987,"children":2989},{"className":2988},[2865],[2990,2993],{"type":44,"tag":2868,"props":2991,"children":2992},{"disabled":1399,"type":2870},[],{"type":50,"value":2994}," Zero-finding results investigated (database quality, model coverage, suite selection)",{"type":44,"tag":98,"props":2996,"children":2998},{"className":2997},[2865],[2999,3002,3004,3010],{"type":44,"tag":2868,"props":3000,"children":3001},{"disabled":1399,"type":2870},[],{"type":50,"value":3003}," Build log preserved at ",{"type":44,"tag":70,"props":3005,"children":3007},{"className":3006},[],[3008],{"type":50,"value":3009},"$OUTPUT_DIR\u002Fbuild.log",{"type":50,"value":3011}," with all commands, fixes, and quality assessments",{"type":44,"tag":3013,"props":3014,"children":3015},"style",{},[3016],{"type":50,"value":3017},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":3019,"total":3171},[3020,3035,3045,3063,3078,3091,3103,3113,3126,3137,3149,3160],{"slug":3021,"name":3021,"fn":3022,"description":3023,"org":3024,"tags":3025,"stars":25,"repoUrl":26,"updatedAt":3034},"address-sanitizer","detect memory errors during fuzzing","AddressSanitizer detects memory errors during fuzzing. Use when fuzzing C\u002FC++ code to find buffer overflows and use-after-free bugs.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3026,3029,3032,3033],{"name":3027,"slug":3028,"type":16},"C#","c",{"name":3030,"slug":3031,"type":16},"Debugging","debugging",{"name":14,"slug":15,"type":16},{"name":23,"slug":24,"type":16},"2026-07-17T06:05:14.925095",{"slug":3036,"name":3036,"fn":3037,"description":3038,"org":3039,"tags":3040,"stars":25,"repoUrl":26,"updatedAt":3044},"aflpp","perform multi-core fuzzing of C\u002FC++ projects","AFL++ is a fork of AFL with better fuzzing performance and advanced features. Use for multi-core fuzzing of C\u002FC++ projects.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3041,3042,3043],{"name":3027,"slug":3028,"type":16},{"name":14,"slug":15,"type":16},{"name":23,"slug":24,"type":16},"2026-07-17T06:05:12.433192",{"slug":3046,"name":3046,"fn":3047,"description":3048,"org":3049,"tags":3050,"stars":25,"repoUrl":26,"updatedAt":3062},"agentic-actions-auditor","audit GitHub Actions for security vulnerabilities","Audits GitHub Actions workflows for security vulnerabilities in AI agent integrations including Claude Code Action, Gemini CLI, OpenAI Codex, and GitHub AI Inference. Detects attack vectors where attacker-controlled input reaches AI agents running in CI\u002FCD pipelines, including env var intermediary patterns, direct expression injection, dangerous sandbox configurations, and wildcard user allowlists. Use when reviewing workflow files that invoke AI coding agents, auditing CI\u002FCD pipeline security for prompt injection risks, or evaluating agentic action configurations.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3051,3054,3057,3058,3061],{"name":3052,"slug":3053,"type":16},"Agents","agents",{"name":3055,"slug":3056,"type":16},"CI\u002FCD","ci-cd",{"name":20,"slug":21,"type":16},{"name":3059,"slug":3060,"type":16},"GitHub Actions","github-actions",{"name":14,"slug":15,"type":16},"2026-07-18T05:47:48.564744",{"slug":3064,"name":3064,"fn":3065,"description":3066,"org":3067,"tags":3068,"stars":25,"repoUrl":26,"updatedAt":3077},"algorand-vulnerability-scanner","scan Algorand smart contracts for vulnerabilities","Scans Algorand smart contracts for 11 common vulnerabilities including rekeying attacks, unchecked transaction fees, missing field validations, and access control issues. Use when auditing Algorand projects (TEAL\u002FPyTeal).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3069,3072,3073,3074],{"name":3070,"slug":3071,"type":16},"Audit","audit",{"name":20,"slug":21,"type":16},{"name":14,"slug":15,"type":16},{"name":3075,"slug":3076,"type":16},"Smart Contracts","smart-contracts","2026-07-18T05:47:43.989063",{"slug":3079,"name":3079,"fn":3080,"description":3081,"org":3082,"tags":3083,"stars":25,"repoUrl":26,"updatedAt":3090},"ask-questions-if-underspecified","clarify requirements before implementation","Clarify requirements before implementing. Use when serious doubts arise.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3084,3087],{"name":3085,"slug":3086,"type":16},"Engineering","engineering",{"name":3088,"slug":3089,"type":16},"Productivity","productivity","2026-07-17T06:05:33.543262",{"slug":3092,"name":3092,"fn":3093,"description":3094,"org":3095,"tags":3096,"stars":25,"repoUrl":26,"updatedAt":3102},"atheris","fuzz Python code with Atheris","Atheris is a coverage-guided Python fuzzer based on libFuzzer. Use for fuzzing pure Python code and Python C extensions.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3097,3100,3101],{"name":3098,"slug":3099,"type":16},"Python","python",{"name":14,"slug":15,"type":16},{"name":23,"slug":24,"type":16},"2026-07-17T06:05:14.575191",{"slug":3104,"name":3104,"fn":3105,"description":3106,"org":3107,"tags":3108,"stars":25,"repoUrl":26,"updatedAt":3112},"audit-augmentation","augment code graphs with audit findings","Augments Trailmark code graphs with external audit findings from SARIF static analysis results, weAudit annotation files, and version-gated Trailmark 0.4.x binary-analysis graph exports. Maps findings to graph nodes by file and line overlap, creates severity-based subgraphs, and enables cross-referencing findings with pre-analysis data (blast radius, taint, etc.). Use when projecting SARIF results onto a code graph, overlaying weAudit annotations, importing binary graph findings, cross-referencing Semgrep, CodeQL, or binary-analysis findings with call graph data, or visualizing audit findings in the context of code structure.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3109,3110,3111],{"name":3070,"slug":3071,"type":16},{"name":20,"slug":21,"type":16},{"name":14,"slug":15,"type":16},"2026-08-01T05:44:54.920542",{"slug":3114,"name":3114,"fn":3115,"description":3116,"org":3117,"tags":3118,"stars":25,"repoUrl":26,"updatedAt":3125},"audit-context-building","build architectural context for code analysis","Enables ultra-granular, line-by-line code analysis to build deep architectural context before vulnerability or bug finding.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3119,3122,3123,3124],{"name":3120,"slug":3121,"type":16},"Architecture","architecture",{"name":3070,"slug":3071,"type":16},{"name":20,"slug":21,"type":16},{"name":3085,"slug":3086,"type":16},"2026-07-18T05:47:40.122449",{"slug":3127,"name":3127,"fn":3128,"description":3129,"org":3130,"tags":3131,"stars":25,"repoUrl":26,"updatedAt":3136},"audit-prep-assistant","prepare codebases for security audits","Prepares codebases for security review using Trail of Bits' checklist. Helps set review goals, runs static analysis tools, increases test coverage, removes dead code, ensures accessibility, and generates documentation (flowcharts, user stories, inline comments).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3132,3133,3134,3135],{"name":3070,"slug":3071,"type":16},{"name":20,"slug":21,"type":16},{"name":3085,"slug":3086,"type":16},{"name":14,"slug":15,"type":16},"2026-07-18T05:47:39.210985",{"slug":3138,"name":3138,"fn":3139,"description":3140,"org":3141,"tags":3142,"stars":25,"repoUrl":26,"updatedAt":3148},"burpsuite-project-parser","parse Burp Suite project files","Searches and explores Burp Suite project files (.burp) from the command line. Use when searching response headers or bodies with regex patterns, extracting security audit findings, dumping proxy history or site map data, or analyzing HTTP traffic captured in a Burp project.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3143,3144,3147],{"name":3070,"slug":3071,"type":16},{"name":3145,"slug":3146,"type":16},"CLI","cli",{"name":14,"slug":15,"type":16},"2026-07-17T06:05:33.198077",{"slug":3150,"name":3150,"fn":3151,"description":3152,"org":3153,"tags":3154,"stars":25,"repoUrl":26,"updatedAt":3159},"c-review","audit C and C++ code","Performs comprehensive C\u002FC++ security review for memory corruption, integer overflows, race conditions, and platform-specific vulnerabilities. Use when auditing native C\u002FC++ applications, reviewing daemons or services for memory safety, or hunting integer overflow \u002F use-after-free \u002F race conditions in userspace code.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3155,3156,3157,3158],{"name":3070,"slug":3071,"type":16},{"name":3027,"slug":3028,"type":16},{"name":20,"slug":21,"type":16},{"name":14,"slug":15,"type":16},"2026-07-17T06:05:11.333374",{"slug":3161,"name":3161,"fn":3162,"description":3163,"org":3164,"tags":3165,"stars":25,"repoUrl":26,"updatedAt":3170},"cairo-vulnerability-scanner","scan Cairo and StarkNet contracts for vulnerabilities","Scans Cairo\u002FStarkNet smart contracts for 6 critical vulnerabilities including felt252 arithmetic overflow, L1-L2 messaging issues, address conversion problems, and signature replay. Use when auditing StarkNet projects.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3166,3167,3168,3169],{"name":3070,"slug":3071,"type":16},{"name":20,"slug":21,"type":16},{"name":14,"slug":15,"type":16},{"name":3075,"slug":3076,"type":16},"2026-07-18T05:47:42.84568",111,{"items":3173,"total":3219},[3174,3181,3187,3195,3202,3207,3213],{"slug":3021,"name":3021,"fn":3022,"description":3023,"org":3175,"tags":3176,"stars":25,"repoUrl":26,"updatedAt":3034},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3177,3178,3179,3180],{"name":3027,"slug":3028,"type":16},{"name":3030,"slug":3031,"type":16},{"name":14,"slug":15,"type":16},{"name":23,"slug":24,"type":16},{"slug":3036,"name":3036,"fn":3037,"description":3038,"org":3182,"tags":3183,"stars":25,"repoUrl":26,"updatedAt":3044},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3184,3185,3186],{"name":3027,"slug":3028,"type":16},{"name":14,"slug":15,"type":16},{"name":23,"slug":24,"type":16},{"slug":3046,"name":3046,"fn":3047,"description":3048,"org":3188,"tags":3189,"stars":25,"repoUrl":26,"updatedAt":3062},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3190,3191,3192,3193,3194],{"name":3052,"slug":3053,"type":16},{"name":3055,"slug":3056,"type":16},{"name":20,"slug":21,"type":16},{"name":3059,"slug":3060,"type":16},{"name":14,"slug":15,"type":16},{"slug":3064,"name":3064,"fn":3065,"description":3066,"org":3196,"tags":3197,"stars":25,"repoUrl":26,"updatedAt":3077},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3198,3199,3200,3201],{"name":3070,"slug":3071,"type":16},{"name":20,"slug":21,"type":16},{"name":14,"slug":15,"type":16},{"name":3075,"slug":3076,"type":16},{"slug":3079,"name":3079,"fn":3080,"description":3081,"org":3203,"tags":3204,"stars":25,"repoUrl":26,"updatedAt":3090},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3205,3206],{"name":3085,"slug":3086,"type":16},{"name":3088,"slug":3089,"type":16},{"slug":3092,"name":3092,"fn":3093,"description":3094,"org":3208,"tags":3209,"stars":25,"repoUrl":26,"updatedAt":3102},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3210,3211,3212],{"name":3098,"slug":3099,"type":16},{"name":14,"slug":15,"type":16},{"name":23,"slug":24,"type":16},{"slug":3104,"name":3104,"fn":3105,"description":3106,"org":3214,"tags":3215,"stars":25,"repoUrl":26,"updatedAt":3112},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3216,3217,3218],{"name":3070,"slug":3071,"type":16},{"name":20,"slug":21,"type":16},{"name":14,"slug":15,"type":16},77]