microsoft/ebpf-for-windows/verify-bpf
Claude Code and agent skill by microsoft/ebpf-for-windows
- vendor
Checking that the SKILL.md file is still in the repository.
Build and verify eBPF programs for the ebpf-for-windows project. Use this skill when asked to compile a .c BPF source to .o, verify a .o ELF file with bpf2c, or diagnose verification failures. Covers the full clang→bpf2c pipeline.
Install
npx vskill@latest install microsoft/ebpf-for-windows/verify-bpfSKILL.md
The same SKILL.md was published earlier as microsoft/ebpf-for-windows/verify-bpf.
Build & Verify eBPF Programs (ebpf-for-windows)
Compile eBPF C source to ELF bytecode with clang, then verify (and optionally generate native code) with bpf2c. On verification failure, diagnose using the PREVAIL reference.
When to Use
- User asks to compile/build a
.ceBPF program to.o - User asks to verify a
.oELF file or check if it passes the verifier - User asks to debug or fix a verification failure from bpf2c output
- User mentions bpf2c, clang+bpf, or PREVAIL verification in the ebpf-for-windows context
Prerequisites
- clang.exe — find the first existing path (highest priority first):
packages\llvm.tools\clang.exe, "$env:ProgramFiles\LLVM\bin\clang.exe", "$(& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath)\VC\Tools\Llvm\bin\clang.exe"
- bpf2c.exe — if
x64\Debug\bpf2c.exeis missing, build it:
msbuild ebpf-for-windows.sln /m /p:Configuration=Debug /p:Platform=x64 /t:tools\bpf2c
Quick Reference
1. Compile: C → ELF (.o)
Run from the solution root directory (use the clang path found above):
For undocked programs (tests\sample\undocked\*.c), also add:
-Itests\sample-Iundocked\tests\sample\ext\inc
2. Verify: ELF (.o) → native C (via bpf2c)
Add `--verbose` to get detailed verifier output (pre/post invariants at each instruction) on failure.
bpf2c Options
| Flag | Purpose | |
|---|---|---|
--bpf <file> | Input ELF file containing BPF bytecode | |
--sys <file> | Generate Windows kernel driver C wrapper | |
--dll <file> | Generate Windows DLL C wrapper | |
--raw <file> | Generate C code without platform wrapper | |
--verbose | Show detailed verifier failure info (invariants) | |
--type <str> | Override eBPF program type string | |
--hash <alg> | Algorithm used to hash ELF file |
Workflow
Step 1: Identify the Source
Determine the .c source file and where the .o should go. Common patterns:
| Source Location | Include Flags | |
|---|---|---|
tests\sample\*.c | -Iinclude -Iexternal\bpftool -Itests\xdp -Itests\socket -Itests\sample\ext\inc -Itests\include | |
tests\sample\undocked\*.c | Same as above, plus -Itests\sample -Iundocked\tests\sample\ext\inc | |
| User-provided file | Start with the standard sample flags; add more -I paths as needed |
Step 2: Compile with Clang
Run clang. If it fails, fix compiler errors in the C source (standard C/clang diagnostics).
Step 3: Verify with bpf2c
Run bpf2c with --sys (or --dll/--raw). Two outcomes:
- Success → bpf2c generates the output C file. Verification passed.
- Failure → bpf2c prints verifier errors. Proceed to diagnosis.
Step 4: Diagnose Failures
On verification failure:
- Re-run with `--verbose` if not already used, to get full invariant output.
- Read `external/ebpf-verifier/docs/llm-context.md` — the authoritative PREVAIL diagnostic reference.
- Follow the diagnosis protocol in that document (identify error → check pre-invariant →
trace root cause → recommend fix).
Example: Full Pipeline
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 1 Oct 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/verify-bpf/SKILL.md
Popularity
- Repository stars
- 3,566
- Repository forks
- 310
- 7-day trend score
- 41
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 16 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/ebpf-for-windows/verify-bpf)