[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CHBCSZTTMVFMD9W4TZFSHW":3,"skill-same:01M7CHBCSZTTMVFMD9W4TZFSHW":183},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M7CHBCSZTTMVFMD9W4TZFSHW","codeql",null,"Scans a codebase for security vulnerabilities using CodeQL's interprocedural data flow and taint tracking analysis. Triggers on \"run codeql\", \"codeql scan\", \"build codeql database\", \"SAST scan\", \"taint analysis\", \"dataflow analysis\", or \"find vulnerabilities in this repo\". Covers Python, JavaScript\u002FTypeScript, Go, Java\u002FKotlin, C\u002FC++, C#, Ruby, and Swift. Supports \"run all\" (security-and-quality + security-experimental) and \"important only\" (high-precision) scan modes, and creates data extension models for project-specific sources and sinks. For fast single-file pattern matching, or when no build is available for a compiled language, use the semgrep skill; to parse SARIF that already exists rather than produce it, use the sarif-parsing skill.","bongkage\u002Ftrailofbits-skills","bongkage","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F101378796?v=4","01M7CH419QTJ16DNJ33P0WCWBE","01M7CH41A9NWK8D2JBRK9F0M2C",1,"CC-BY-SA-4.0","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\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\", \"build codeql database\",\n  \"SAST scan\", \"taint analysis\", \"dataflow analysis\", or \"find vulnerabilities in this repo\".\n  Covers Python, JavaScript\u002FTypeScript, Go, Java\u002FKotlin, C\u002FC++, C#, Ruby, and Swift. Supports\n  \"run all\" (security-and-quality + security-experimental) and \"important only\"\n  (high-precision) scan modes, and creates data extension models for project-specific sources\n  and sinks. For fast single-file pattern matching, or when no build is available for a\n  compiled language, use the semgrep skill; to parse SARIF that already exists rather than\n  produce it, use the sarif-parsing skill.\nallowed-tools: Bash Read Write Edit Glob Grep AskUserQuestion TaskCreate TaskList TaskUpdate TaskGet\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 — a cached build extracts nothing while reporting success.\n\n2. **Data extensions catch what CodeQL misses.** Django, Spring, and Express projects still wrap database calls, request parsing, and shell execution in project-specific APIs that no shipped model covers.\n\n3. **Explicit suite references prevent silent query dropping.** Never pass pack names to `codeql database analyze` — each pack's `defaultSuiteFile` applies hidden filters that can produce zero results. Always generate a `.qls`.\n\n4. **Zero findings needs investigation, not celebration.** It can mean poor extraction, missing models, the wrong packs, or suite filtering. Run `{baseDir}\u002Fscripts\u002Fcheck_db_quality.py` after the build, confirm `{baseDir}\u002Fscripts\u002Fverify_query_suite.py` exited zero for the suite in use — the generation scripts run it, so invoke it by hand only for a reused or hand-edited suite — and say in the report that both passed.\n\n5. **macOS Apple Silicon requires workarounds for compiled languages.** Exit code 137 is an `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.** Each phase gates the next; skipping quality assessment or data extensions leaves the gap invisible in the results.\n\n## Each Bash call is a fresh shell\n\nNothing carries across a Bash call: not variables, not arrays, not functions sourced from\n`build_log.sh`. Every block below that uses a value must re-establish it in the same block.\nThe workflows point back here rather than repeating it; what they do state is the specific\ndamage at that site, because each one fails differently and silently:\n\n- a lost **function** makes `run_logged` exit 127, which the build ladder reads as a failed\n  method and walks down to `--build-mode=none`, never having invoked CodeQL\n- a lost **array** expands to nothing, so every `--threat-model` and `--model-packs` the user\n  chose is dropped while the final report still lists them as used\n- a lost **scalar** under `set -u` aborts the block with `unbound variable`\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\nSet `USER_SPECIFIED_DIR` to the literal path from the user's prompt before running this,\nor leave it unset to auto-increment. Nothing else assigns it.\n\n```bash\n# Resolve output directory\nUSER_SPECIFIED_DIR=\"${USER_SPECIFIED_DIR:-}\"   # substitute the user's path here, if any\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│   └── run-all.qls | important-only.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.** `find_databases.sh` prints one database path per line, filtering\nout the marker files a failed build leaves behind. Build the array **in the same block\nthat selects from it** — each Bash call is a fresh shell, so an array built here is empty\nby the next call, and the run concludes there is no database:\n\n```bash\n# Command substitution, not `done \u003C \u003C(...)`: a process substitution discards the script's\n# exit status, so \"codeql is not on this shell's PATH\" (exit 2) would arrive as an empty\n# list and route to \"build a new database\" with three good ones sitting on disk.\nif ! DB_LIST=$(\"{baseDir}\u002Fscripts\u002Ffind_databases.sh\" \"${OUTPUT_DIR:-.}\" .); then\n  echo \"ERROR: database discovery failed — see the message above\" >&2\n  exit 1\nfi\n\nFOUND_DBS=()\nwhile IFS= read -r db; do\n  [ -n \"$db\" ] || continue\n  FOUND_DBS+=(\"$db\")\ndone \u003C\u003C\u003C\"$DB_LIST\"\n\necho \"Found ${#FOUND_DBS[@]} existing database(s)\"\n\n# The metadata the selection prompt needs, collected here rather than in a block of its\n# own: FOUND_DBS is gone by the next Bash call, and a loop over an array that no longer\n# exists prints nothing and reports success.\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\nNever assume a database is named `codeql.db` — discover it by its marker file.\n\n**When multiple databases are found:** use `AskUserQuestion` to let the user select which database to use, or to build a new one, from the language and creation time printed above. `AskUserQuestion` takes at most four options, so with more databases than that, offer the three most recent plus \"Build a new database\" and list the rest in the prompt text. **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# Verify CodeQL is installed. Stop here if it is not — every later command fails with\n# a less informative error, and the run wastes a build cycle before saying why.\nif ! command -v codeql >\u002Fdev\u002Fnull 2>&1; then\n  echo \"ERROR: codeql not found on PATH. Install it with one of:\" >&2\n  echo \"  gh extension install github\u002Fgh-codeql   # then: gh codeql install-stub\" >&2\n  echo \"  brew install --cask codeql\" >&2\n  echo \"  https:\u002F\u002Fgithub.com\u002Fgithub\u002Fcodeql-action\u002Freleases  (codeql-bundle)\" >&2\n  exit 1\nfi\n\n# jq parses `codeql resolve database --format=json` in the very next step. Without it\n# CODEQL_LANG comes back empty and the run continues against the wrong language.\nif ! command -v jq >\u002Fdev\u002Fnull 2>&1; then\n  echo \"ERROR: jq not found on PATH (brew install jq \u002F apt install jq)\" >&2\n  exit 1\nfi\n\n# uv runs both guard scripts and both suite generators. Check it here rather than at\n# suite generation, which is after the build — otherwise a machine without uv spends\n# the whole build before failing.\nif ! command -v uv >\u002Fdev\u002Fnull 2>&1; then\n  echo \"ERROR: uv not found on PATH (https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002Fgetting-started\u002F)\" >&2\n  exit 1\nfi\n\ncodeql --version\n```\n\nThen resolve `OUTPUT_DIR` using the block in [Output Directory](#output-directory) above —\nit honours a user-specified directory, which a bare auto-increment does not.\n\nThen execute the full pipeline: **build database → create data extensions → run analysis** using the workflows below.\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\"** - Run `check_db_quality.py` and `verify_query_suite.py` and report that they passed. Without them, zero findings and a database that extracted nothing are the same output.\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\nThese runs are long. A database build has four fallback methods, so use the task tools to\ntrack progress. Decide which steps are worth tracking based on the run.\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### Building unattended\n\nThis plugin ships `\u002Fstatic-analysis:codeql-build`, which runs the build-database steps\nend to end: detect the language and toolchain, walk the method ladder applying fixes from\n[build-fixes.md](references\u002Fbuild-fixes.md) between rungs, and enforce the quality gate.\n\n```\n\u002Fstatic-analysis:codeql-build {\"target\": \"\u002Fabs\u002Fpath\", \"lang\": \"cpp\"}\n```\n\nIt asks nothing. Every method failing, and a database that built but sits below the quality\nthreshold, come back as statuses — `no-method-succeeded` and `built-below-threshold` — for you\nto act on here, because whether the remaining extractor errors are confined to code nobody\nneeds analysed is a judgement call the run cannot make.\n\nUse it when the build is the long, uncertain part and you want it driven to a conclusion. Work\n[build-database.md](workflows\u002Fbuild-database.md) by hand when you want a say in which method is\ntried, or when a build failure needs interpreting as it happens.\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\nusing the command in [Database Discovery](#database-discovery) above, then decide.\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`, capped at four options — see [Database Discovery](#database-discovery) |\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**,\npresent them via `AskUserQuestion` under the header \"Existing CodeQL Databases\". Label each\noption with the path, language, and creation time collected above — `.\u002Fstatic_analysis_codeql_1\u002Fcodeql.db\n(language: python, created: 2026-02-24)` — and make the last option \"Build a new database\".\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 neither the database nor the workflow is clear from the prompt, offer the four\nworkflows via `AskUserQuestion` — full scan (recommended), build database, create data\nextensions, run analysis — naming any databases found and the resolved `$OUTPUT_DIR`.\n\n---\n\n## Reference Index\n\n| File | Content |\n|------|---------|\n| **Scripts** | |\n| [scripts\u002Fverify_query_suite.py](scripts\u002Fverify_query_suite.py) | Fails a suite that resolves to zero queries. The generation scripts run it; invoke by hand only for a reused or hand-edited suite |\n| [scripts\u002Fcheck_db_quality.py](scripts\u002Fcheck_db_quality.py) | Fails a database with no analysable source. Run after every build |\n| [scripts\u002Fbuild_log.sh](scripts\u002Fbuild_log.sh) | `log_step`\u002F`run_logged` helpers; source before any build step |\n| [scripts\u002Ffind_databases.sh](scripts\u002Ffind_databases.sh) | Prints every database that `codeql resolve database` accepts, one per line. Build your array from it in the block that reads it |\n| [scripts\u002Fgenerate_suite.sh](scripts\u002Fgenerate_suite.sh) | Writes the run-all or important-only `.qls` and verifies it resolves to a non-zero query count |\n| **References** — the three workflows are listed under [Workflow Selection](#workflow-selection) | |\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) and `{baseDir}\u002Fscripts\u002Fcheck_db_quality.py` exited zero\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), and `{baseDir}\u002Fscripts\u002Fverify_query_suite.py` exited zero for it\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","# 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 — a cached build extracts nothing while reporting success.\n\n2. **Data extensions catch what CodeQL misses.** Django, Spring, and Express projects still wrap database calls, request parsing, and shell execution in project-specific APIs that no shipped model covers.\n\n3. **Explicit suite references prevent silent query dropping.** Never pass pack names to `codeql database analyze` — each pack's `defaultSuiteFile` applies hidden filters that can produce zero results. Always generate a `.qls`.\n\n4. **Zero findings needs investigation, not celebration.** It can mean poor extraction, missing models, the wrong packs, or suite filtering. Run `{baseDir}\u002Fscripts\u002Fcheck_db_quality.py` after the build, confirm `{baseDir}\u002Fscripts\u002Fverify_query_suite.py` exited zero for the suite in use — the generation scripts run it, so invoke it by hand only for a reused or hand-edited suite — and say in the report that both passed.\n\n5. **macOS Apple Silicon requires workarounds for compiled languages.** Exit code 137 is an `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.** Each phase gates the next; skipping quality assessment or data extensions leaves the gap invisible in the results.\n\n## Each Bash call is a fresh shell\n\nNothing carries across a Bash call: not variables, not arrays, not functions sourced from\n`build_log.sh`. Every block below that uses a value must re-establish it in the same block.\nThe workflows point back here rather than repeating it; what they do state is the specific\ndamage at that site, because each one fails differently and silently:\n\n- a lost **function** makes `run_logged` exit 127, which the build ladder reads as a failed\n  method and walks down to `--build-mode=none`, never having invoked CodeQL\n- a lost **array** expands to nothing, so every `--threat-model` and `--model-packs` the user\n  chose is dropped while the final report still lists them as used\n- a lost **scalar** under `set -u` aborts the block with `unbound variable`\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\nSet `USER_SPECIFIED_DIR` to the literal path from the user's prompt before running this,\nor leave it unset to auto-increment. Nothing else assigns it.\n\n```bash\n# Resolve output directory\nUSER_SPECIFIED_DIR=\"${USER_SPECIFIED_DIR:-}\"   # substitute the user's path here, if any\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│   └── run-all.qls | important-only.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.** `find_databases.sh` prints one database path per line, filtering\nout the marker files a failed build leaves behind. Build the array **in the same block\nthat selects from it** — each Bash call is a fresh shell, so an array built here is empty\nby the next call, and the run concludes there is no database:\n\n```bash\n# Command substitution, not `done \u003C \u003C(...)`: a process substitution discards the script's\n# exit status, so \"codeql is not on this shell's PATH\" (exit 2) would arrive as an empty\n# list and route to \"build a new database\" with three good ones sitting on disk.\nif ! DB_LIST=$(\"{baseDir}\u002Fscripts\u002Ffind_databases.sh\" \"${OUTPUT_DIR:-.}\" .); then\n  echo \"ERROR: database discovery failed — see the message above\" >&2\n  exit 1\nfi\n\nFOUND_DBS=()\nwhile IFS= read -r db; do\n  [ -n \"$db\" ] || continue\n  FOUND_DBS+=(\"$db\")\ndone \u003C\u003C\u003C\"$DB_LIST\"\n\necho \"Found ${#FOUND_DBS[@]} existing database(s)\"\n\n# The metadata the selection prompt needs, collected here rather than in a block of its\n# own: FOUND_DBS is gone by the next Bash call, and a loop over an array that no longer\n# exists prints nothing and reports success.\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\nNever assume a database is named `codeql.db` — discover it by its marker file.\n\n**When multiple databases are found:** use `AskUserQuestion` to let the user select which database to use, or to build a new one, from the language and creation time printed above. `AskUserQuestion` takes at most four options, so with more databases than that, offer the three most recent plus \"Build a new database\" and list the rest in the prompt text. **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# Verify CodeQL is installed. Stop here if it is not — every later command fails with\n# a less informative error, and the run wastes a build cycle before saying why.\nif ! command -v codeql >\u002Fdev\u002Fnull 2>&1; then\n  echo \"ERROR: codeql not found on PATH. Install it with one of:\" >&2\n  echo \"  gh extension install github\u002Fgh-codeql   # then: gh codeql install-stub\" >&2\n  echo \"  brew install --cask codeql\" >&2\n  echo \"  https:\u002F\u002Fgithub.com\u002Fgithub\u002Fcodeql-action\u002Freleases  (codeql-bundle)\" >&2\n  exit 1\nfi\n\n# jq parses `codeql resolve database --format=json` in the very next step. Without it\n# CODEQL_LANG comes back empty and the run continues against the wrong language.\nif ! command -v jq >\u002Fdev\u002Fnull 2>&1; then\n  echo \"ERROR: jq not found on PATH (brew install jq \u002F apt install jq)\" >&2\n  exit 1\nfi\n\n# uv runs both guard scripts and both suite generators. Check it here rather than at\n# suite generation, which is after the build — otherwise a machine without uv spends\n# the whole build before failing.\nif ! command -v uv >\u002Fdev\u002Fnull 2>&1; then\n  echo \"ERROR: uv not found on PATH (https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002Fgetting-started\u002F)\" >&2\n  exit 1\nfi\n\ncodeql --version\n```\n\nThen resolve `OUTPUT_DIR` using the block in [Output Directory](#output-directory) above —\nit honours a user-specified directory, which a bare auto-increment does not.\n\nThen execute the full pipeline: **build database → create data extensions → run analysis** using the workflows below.\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\"** - Run `check_db_quality.py` and `verify_query_suite.py` and report that they passed. Without them, zero findings and a database that extracted nothing are the same output.\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\nThese runs are long. A database build has four fallback methods, so use the task tools to\ntrack progress. Decide which steps are worth tracking based on the run.\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### Building unattended\n\nThis plugin ships `\u002Fstatic-analysis:codeql-build`, which runs the build-database steps\nend to end: detect the language and toolchain, walk the method ladder applying fixes from\n[build-fixes.md](references\u002Fbuild-fixes.md) between rungs, and enforce the quality gate.\n\n```\n\u002Fstatic-analysis:codeql-build {\"target\": \"\u002Fabs\u002Fpath\", \"lang\": \"cpp\"}\n```\n\nIt asks nothing. Every method failing, and a database that built but sits below the quality\nthreshold, come back as statuses — `no-method-succeeded` and `built-below-threshold` — for you\nto act on here, because whether the remaining extractor errors are confined to code nobody\nneeds analysed is a judgement call the run cannot make.\n\nUse it when the build is the long, uncertain part and you want it driven to a conclusion. Work\n[build-database.md](workflows\u002Fbuild-database.md) by hand when you want a say in which method is\ntried, or when a build failure needs interpreting as it happens.\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\nusing the command in [Database Discovery](#database-discovery) above, then decide.\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`, capped at four options — see [Database Discovery](#database-discovery) |\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**,\npresent them via `AskUserQuestion` under the header \"Existing CodeQL Databases\". Label each\noption with the path, language, and creation time collected above — `.\u002Fstatic_analysis_codeql_1\u002Fcodeql.db\n(language: python, created: 2026-02-24)` — and make the last option \"Build a new database\".\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 neither the database nor the workflow is clear from the prompt, offer the four\nworkflows via `AskUserQuestion` — full scan (recommended), build database, create data\nextensions, run analysis — naming any databases found and the resolved `$OUTPUT_DIR`.\n\n---\n\n## Reference Index\n\n| File | Content |\n|------|---------|\n| **Scripts** | |\n| [scripts\u002Fverify_query_suite.py](scripts\u002Fverify_query_suite.py) | Fails a suite that resolves to zero queries. The generation scripts run it; invoke by hand only for a reused or hand-edited suite |\n| [scripts\u002Fcheck_db_quality.py](scripts\u002Fcheck_db_quality.py) | Fails a database with no analysable source. Run after every build |\n| [scripts\u002Fbuild_log.sh](scripts\u002Fbuild_log.sh) | `log_step`\u002F`run_logged` helpers; source before any build step |\n| [scripts\u002Ffind_databases.sh](scripts\u002Ffind_databases.sh) | Prints every database that `codeql resolve database` accepts, one per line. Build your array from it in the block that reads it |\n| [scripts\u002Fgenerate_suite.sh](scripts\u002Fgenerate_suite.sh) | Writes the run-all or important-only `.qls` and verifies it resolves to a non-zero query count |\n| **References** — the three workflows are listed under [Workflow Selection](#workflow-selection) | |\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) and `{baseDir}\u002Fscripts\u002Fcheck_db_quality.py` exited zero\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), and `{baseDir}\u002Fscripts\u002Fverify_query_suite.py` exited zero for it\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",{"name":5,"description":7,"allowed-tools":23},"Bash Read Write Edit Glob Grep AskUserQuestion TaskCreate TaskList TaskUpdate TaskGet","main","321ccfe628eca0d314b0ee4eaffcdd8a05639aaf","plugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql",0,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills","https:\u002F\u002Fgithub.com\u002Fbongkage","2026-11-06 12:15:06",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add bongkage\u002Ftrailofbits-skills --skill codeql",{"tool":37,"command":38},"bunx","bunx skills add bongkage\u002Ftrailofbits-skills --skill codeql",{"tool":40,"command":41},"pnpm","pnpm dlx skills add bongkage\u002Ftrailofbits-skills --skill codeql","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002FSKILL.md",true,[45,51,57,61,65,69,73,77,81,85,89,93,97,101,105,111,115,119,123,127,131,135,139,143,147,151,155,159,163,167,171,175,179],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"agents\u002Fopenai.yaml","REFERENCE","参考文档",128,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Fagents\u002Fopenai.yaml",{"path":52,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":55,"sourceHtmlUrl":56},"assets\u002Ftrail-of-bits-mark.svg","ASSET","资产文件",3084,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Fassets\u002Ftrail-of-bits-mark.svg",{"path":58,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":59,"sourceHtmlUrl":60},"references\u002Fbuild-fixes.md",3290,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Freferences\u002Fbuild-fixes.md",{"path":62,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":63,"sourceHtmlUrl":64},"references\u002Fdiagnostic-query-templates.md",9751,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Freferences\u002Fdiagnostic-query-templates.md",{"path":66,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":67,"sourceHtmlUrl":68},"references\u002Fextension-yaml-format.md",7621,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Freferences\u002Fextension-yaml-format.md",{"path":70,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":71,"sourceHtmlUrl":72},"references\u002Fimportant-only-suite.md",5270,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Freferences\u002Fimportant-only-suite.md",{"path":74,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":75,"sourceHtmlUrl":76},"references\u002Flanguage-details.md",5811,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Freferences\u002Flanguage-details.md",{"path":78,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":79,"sourceHtmlUrl":80},"references\u002Fmacos-arm64e-workaround.md",7455,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Freferences\u002Fmacos-arm64e-workaround.md",{"path":82,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Fperformance-tuning.md",2835,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Freferences\u002Fperformance-tuning.md",{"path":86,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Fquality-assessment.md",7969,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Freferences\u002Fquality-assessment.md",{"path":90,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":91,"sourceHtmlUrl":92},"references\u002Fruleset-catalog.md",2197,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Freferences\u002Fruleset-catalog.md",{"path":94,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":95,"sourceHtmlUrl":96},"references\u002Frun-all-suite.md",5552,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Freferences\u002Frun-all-suite.md",{"path":98,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":99,"sourceHtmlUrl":100},"references\u002Fsarif-processing.md",3119,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Freferences\u002Fsarif-processing.md",{"path":102,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":103,"sourceHtmlUrl":104},"references\u002Fthreat-models.md",2799,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Freferences\u002Fthreat-models.md",{"path":106,"resourceType":107,"resourceTypeDesc":108,"sizeBytes":109,"sourceHtmlUrl":110},"scripts\u002Fbuild_log.sh","SCRIPT","脚本",2144,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Fscripts\u002Fbuild_log.sh",{"path":112,"resourceType":107,"resourceTypeDesc":108,"sizeBytes":113,"sourceHtmlUrl":114},"scripts\u002Fcheck_db_quality.py",15069,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Fscripts\u002Fcheck_db_quality.py",{"path":116,"resourceType":107,"resourceTypeDesc":108,"sizeBytes":117,"sourceHtmlUrl":118},"scripts\u002Ffind_databases.sh",2515,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Fscripts\u002Ffind_databases.sh",{"path":120,"resourceType":107,"resourceTypeDesc":108,"sizeBytes":121,"sourceHtmlUrl":122},"scripts\u002Fgenerate_suite.sh",3406,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Fscripts\u002Fgenerate_suite.sh",{"path":124,"resourceType":107,"resourceTypeDesc":108,"sizeBytes":125,"sourceHtmlUrl":126},"scripts\u002Fpyproject.toml",585,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Fscripts\u002Fpyproject.toml",{"path":128,"resourceType":107,"resourceTypeDesc":108,"sizeBytes":129,"sourceHtmlUrl":130},"scripts\u002Ftest_build_log.py",3244,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Fscripts\u002Ftest_build_log.py",{"path":132,"resourceType":107,"resourceTypeDesc":108,"sizeBytes":133,"sourceHtmlUrl":134},"scripts\u002Ftest_build_mode_claims.py",3678,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Fscripts\u002Ftest_build_mode_claims.py",{"path":136,"resourceType":107,"resourceTypeDesc":108,"sizeBytes":137,"sourceHtmlUrl":138},"scripts\u002Ftest_check_db_quality.py",20247,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Fscripts\u002Ftest_check_db_quality.py",{"path":140,"resourceType":107,"resourceTypeDesc":108,"sizeBytes":141,"sourceHtmlUrl":142},"scripts\u002Ftest_find_databases.py",6116,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Fscripts\u002Ftest_find_databases.py",{"path":144,"resourceType":107,"resourceTypeDesc":108,"sizeBytes":145,"sourceHtmlUrl":146},"scripts\u002Ftest_generation_scripts.py",11900,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Fscripts\u002Ftest_generation_scripts.py",{"path":148,"resourceType":107,"resourceTypeDesc":108,"sizeBytes":149,"sourceHtmlUrl":150},"scripts\u002Ftest_script_flags.py",6451,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Fscripts\u002Ftest_script_flags.py",{"path":152,"resourceType":107,"resourceTypeDesc":108,"sizeBytes":153,"sourceHtmlUrl":154},"scripts\u002Ftest_section_pointers.py",8072,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Fscripts\u002Ftest_section_pointers.py",{"path":156,"resourceType":107,"resourceTypeDesc":108,"sizeBytes":157,"sourceHtmlUrl":158},"scripts\u002Ftest_shell_blocks.py",29804,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Fscripts\u002Ftest_shell_blocks.py",{"path":160,"resourceType":107,"resourceTypeDesc":108,"sizeBytes":161,"sourceHtmlUrl":162},"scripts\u002Ftest_suite_templates.py",5120,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Fscripts\u002Ftest_suite_templates.py",{"path":164,"resourceType":107,"resourceTypeDesc":108,"sizeBytes":165,"sourceHtmlUrl":166},"scripts\u002Ftest_verify_query_suite.py",1902,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Fscripts\u002Ftest_verify_query_suite.py",{"path":168,"resourceType":107,"resourceTypeDesc":108,"sizeBytes":169,"sourceHtmlUrl":170},"scripts\u002Fverify_query_suite.py",2802,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Fscripts\u002Fverify_query_suite.py",{"path":172,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":173,"sourceHtmlUrl":174},"workflows\u002Fbuild-database.md",13273,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Fworkflows\u002Fbuild-database.md",{"path":176,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":177,"sourceHtmlUrl":178},"workflows\u002Fcreate-data-extensions.md",10555,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Fworkflows\u002Fcreate-data-extensions.md",{"path":180,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":181,"sourceHtmlUrl":182},"workflows\u002Frun-analysis.md",12939,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fstatic-analysis\u002Fskills\u002Fcodeql\u002Fworkflows\u002Frun-analysis.md",[184,191,198,205,212,219],{"skillNo":185,"name":186,"nameZh":6,"description":187,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":188,"categories":189,"keywords":190,"publishedAt":18},"01M7CHJAESZRWKJXFQG55BMNAA","zeroize-audit","Detects missing zeroization of sensitive data in source code and identifies zeroization removed by compiler optimizations, with assembly-level analysis, and control-flow verification. Use for auditing C\u002FC++\u002FRust code handling secrets, keys, passwords, or other sensitive data.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fzeroize-audit\u002Fskills\u002Fzeroize-audit\u002FSKILL.md",[],[],{"skillNo":192,"name":193,"nameZh":6,"description":194,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":195,"categories":196,"keywords":197,"publishedAt":18},"01M7CHJ543G42A9GQC3PJE4F4V","yara-rule-authoring","Guides authoring of high-quality YARA-X detection rules for malware identification. Use when writing, reviewing, or optimizing YARA rules. Covers naming conventions, string selection, performance optimization, migration from legacy YARA, and false positive reduction. Triggers on: YARA, YARA-X, malware detection, threat hunting, IOC, signature, crx module, dex module.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fyara-authoring\u002Fskills\u002Fyara-rule-authoring\u002FSKILL.md",[],[],{"skillNo":199,"name":200,"nameZh":6,"description":201,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":202,"categories":203,"keywords":204,"publishedAt":18},"01M7CHHYVFS1AKDTH3YDS1Y4K4","writing-lean-proofs","Writes and reviews structured Lean 4 proofs and designs Lean libraries following Mathlib conventions. Use when proving theorems in Lean, formalizing mathematics or specifications in Lean 4, defining new types or definitions in a Lean library, reviewing Lean proofs for readability and maintainability, refactoring long tactic proofs into lemmas, filling in sorry placeholders in a Lean development, setting up CI or linters for a Lean project, diagnosing slow proofs or maxHeartbeats timeouts, or writing custom tactics, macros, or linters.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fwriting-lean-proofs\u002Fskills\u002Fwriting-lean-proofs\u002FSKILL.md",[],[],{"skillNo":206,"name":207,"nameZh":6,"description":208,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":209,"categories":210,"keywords":211,"publishedAt":18},"01M7CHHQXA39M4965MV2RMM5YS","vulnerability-triage-brocards","This skill should be used when the user asks to \"triage a vulnerability report\", \"assess a CVE\", \"evaluate a bug bounty submission\", \"decide if a finding is valid\", \"review a security finding\", \"dismiss a vulnerability\", \"should we fix this CVE\", \"prioritize a vulnerability report\", or needs to determine whether an incoming vulnerability report warrants investigation. Applies 7 brocards (rules of thumb) to systematically accept, dismiss, or request more information on vulnerability reports, or needs to filter raw findings from agentic vulnerability discovery pipelines before human review.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fvulnerability-triage-brocards\u002Fskills\u002Fvulnerability-triage-brocards\u002FSKILL.md",[],[],{"skillNo":213,"name":214,"nameZh":6,"description":215,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":216,"categories":217,"keywords":218,"publishedAt":18},"01M7CHHJVQC2ZG2M310GXT0T42","variant-analysis","Hunts for the other instances of a bug already found — the variants of one root cause across a codebase. Use immediately after a vulnerability, logic bug, or bad pattern turns up in a specific file and the question becomes where else it occurs, including the bare conversational form (\"are there others like this?\", \"is this the same bug?\"). Also for generalizing one known instance into a CodeQL or Semgrep query for its whole pattern family, and for triaging a set of look-alike candidates against a known root cause. Not for initial discovery with no bug in hand.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fvariant-analysis\u002Fskills\u002Fvariant-analysis\u002FSKILL.md",[],[],{"skillNo":220,"name":221,"nameZh":6,"description":222,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":223,"categories":224,"keywords":225,"publishedAt":18},"01M7CHHC1GM5GH585ZWGP7D03P","vector-forge","Mutation-driven test vector generation. Finds implementations of a cryptographic algorithm or protocol, runs mutation testing to identify escaped mutants, then generates new test vectors that deliberately exercise the uncovered code paths. Compares before\u002Fafter mutation kill rates to prove vector effectiveness. Use when generating cryptographic test vectors, measuring Wycheproof coverage gaps, finding escaped mutants via mutation testing, creating cross-implementation test suites, or improving test vector coverage for crypto primitives.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftrailmark\u002Fskills\u002Fvector-forge\u002FSKILL.md",[],[]]