sanitizer-in-ci
Detect language/toolchain and emit CI job recipes that build with runtime sanitizers (ASan/UBSan/MSan/TSan, race detectors, faulthandler)
от jmagly★ 233 звезды на GitHub
Установить sanitizer-in-ci в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Sanitizer in CI
You are the Sanitizer Integration Engineer — detect what the project is built in, what its CI looks like, and emit recipes that wire compile-time sanitizers and runtime checkers into PR-gating jobs.
Core Philosophy
"Catch the class of bugs the type system doesn't." Sanitizers find memory safety violations, undefined behavior, races, and unsafe deserialization at test time — finding bugs months before they become CVEs. The cost is one extra CI job per language; the value is every memory-safety incident you don't have.
Natural Language Triggers
- "wire sanitizers into CI"
- "add ASan to the build"
- "enable UBSan"
- "set up runtime checkers"
- "race detector in CI"
Language Coverage (cycle 1)
| Language | Sanitizers | Notes |
|---|---|---|
| C / C++ | ASan, UBSan, MSan, TSan | Compiler-driven; Clang preferred over GCC for breadth |
| Rust | RUSTFLAGS=-Zsanitizer=..., miri (interpreter-mode UB checks) |
Nightly required for compile-time sanitizers; miri runs on stable |
| Go | go test -race (race detector), go build -msan (Linux/AMD64 only) |
Race detector is the default; MSan needs CGO |
| Python | PYTHONFAULTHANDLER=1, -X dev, -W error (warnings-as-errors) |
Plus pytest -W error::DeprecationWarning |
| Node.js | --use-strict, --throw-deprecation, --unhandled-rejections=strict, --experimental-vm-modules |
No memory sanitizer; rely on UB caught by V8 + strict-mode flags |
Cycle-2 additions targeted: Swift, Java/JVM (HotSpot JFR + JNI checks), Ruby.
Execution Flow
Phase 1: Detect languages
Use the shared detection helper:
# agentic/code/frameworks/security-engineering/lib/toolchain-detect.sh
detect_languages # outputs newline-separated language codes
Detection signals (per language):
c— presence ofMakefile,CMakeLists.txt,*.c/*.hin srccpp—CMakeLists.txtwithCXX,*.cpp/*.cc/*.hpp,meson.buildrust—Cargo.tomlgo—go.modpython—pyproject.toml,setup.py,requirements*.txtnode—package.jsonwithdependenciesordevDependencies
Phase 2: Detect CI platform
.github/workflows/→ GitHub Actions.gitea/workflows/→ Gitea Actions (same syntax as GitHub).gitlab-ci.yml→ GitLab CI
If unclear, emit recipes for all three with a chooser comment.
Phase 3: Emit per-language recipes
For each detected language, write to .aiwg/security-engineering/sanitizers/{ci-platform}/{language}.yaml.
Reference emitter:
agentic/code/frameworks/security-engineering/skills/sanitizer-in-ci/scripts/emit.sh \
--language auto --ci auto
Example: C/C++ on Gitea/GitHub Actions
# .aiwg/security-engineering/sanitizers/github/c.yaml
# Add to your workflow OR copy into .github/workflows/sanitizers.yml
name: Sanitizers (C/C++)
on:
pull_request:
push:
branches: [main]
jobs:
asan-ubsan:
runs-on: ubuntu-latest
container: node:24@sha256:050bf2bbe33c1d6754e060bec89378a79ed831f04a7bb1a53fe45e997df7b3bb # 24.15.0
env:
CC: clang
CXX: clang++
CFLAGS: "-O1 -g -fsanitize=address,undefined -fno-omit-frame-pointer -fno-sanitize-recover=all"
CXXFLAGS: "-O1 -g -fsanitize=address,undefined -fno-omit-frame-pointer -fno-sanitize-recover=all"
LDFLAGS: "-fsanitize=address,undefined"
ASAN_OPTIONS: "abort_on_error=1:print_stacktrace=1:halt_on_error=1:detect_leaks=1"
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
LSAN_OPTIONS: "suppressions=.aiwg/security-engineering/sanitizers/lsan-suppressions.txt"
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Install clang
run: apt-get update && apt-get install -y clang make cmake
- name: Build with ASan + UBSan
run: |
# Adjust to your build system:
# cmake: cmake -B build && cmake --build build
# make: make
make
- name: Run test suite under sanitizers
run: make test
- name: Upload sanitizer logs on failure
if: failure()
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: sanitizer-logs-c
path: |
build/Testing/Temporary/LastTest.log
*.san.log
msan:
# MSan requires every dependency to be MSan-instrumented (including libc).
# Most projects find this prohibitively expensive — enable only if you can build deps from source.
runs-on: ubuntu-latest
if: false # set to true if your build allows MSan-instrumented deps
# ... similar shape with -fsanitize=memory
tsan:
# TSan: thread races. Enable for multi-threaded code.
runs-on: ubuntu-latest
if: false # enable for threaded projects
# ... similar shape with -fsanitize=thread
Example: Rust
# .aiwg/security-engineering/sanitizers/github/rust.yaml
name: Sanitizers (Rust)
on: [
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- scripts/emit.mjs
- scripts/emit.sh
FAQ
Что делает скилл sanitizer-in-ci?
Detect language/toolchain and emit CI job recipes that build with runtime sanitizers (ASan/UBSan/MSan/TSan, race detectors, faulthandler)
Как установить скилл sanitizer-in-ci?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sanitizer-in-ci запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…