数据测试
- 作者仓库星标 0
- 作者更新于 实时读取
- 作者仓库 skills-registry
- 领域
- AI 智能
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @tomevault-io · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需手动接入
- 是否需要外部 API Key
- 需要 · Vendor-specific
- 兼容的系统
- macOS
- 底层运行要求
- 无特殊要求
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 网络行为
- 允许外网请求
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: alf
description: Agentic LLDB fuzzer and crash-triage toolkit for Apple Mach-O on arm64(e). Use this skill whenev…
category: AI 智能
runtime: 无特殊运行时
---
# alf 输出预览
## PART A: 任务判断
- 适用问题:提示词、Agent 工作流、模型评估或自动化推理。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Choose the entry point by goal / Crash triage / Fuzzing”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于提示词、Agent 工作流、模型评估或自动化推理,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Choose the entry point by goal / Crash triage / Fuzzing”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、会按任务需要访问外部网络、需要准备 Vendor-specific API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令;会按任务需要访问外部网络;需要准备 Vendor-specific API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文出现了 `/tmp`、`/etc` 这类斜杠命令;如果你的 Agent 支持命令触发,优先用命令开场,再补充目标和边界。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令。
先用一个小任务确认它会围绕“Choose the entry point by goal / Crash triage / Fuzzing”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: alf
description: Agentic LLDB fuzzer and crash-triage toolkit for Apple Mach-O on arm64(e). Use this skill whenev…
category: AI 智能
source: tomevault-io/skills-registry
---
# alf
## 什么时候使用
- 把 AI / Agent方向的常用动作沉淀成 Agent 可调用的技能 适合处理AI Agent、提示词、模型评估与自动化推理,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查…
- 面向提示词、Agent 工作流、模型评估或自动化推理,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Choose the entry point by goal / Crash triage / Fuzzing」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令;会按任务需要访问外部网络;需要准备 Vendor-specific API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "alf" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Choose the entry point by goal / Crash triage / Fuzzing
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> 无特殊运行时 | 读取文件、写入/修改文件、执行终端命令 | 会按任务需要访问外部网络
安全层 -> 需要准备 Vendor-specific API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} alf — Agentic LLDB Fuzzer
alf lets an AI agent drive LLDB over MCP to analyze crashes, fuzz targets, and debug kernels. Target: Apple Mach-O, arm64(e). Agent-first design: every capability is an MCP tool call.
Choose the entry point by goal
| Goal | Entry point |
|---|---|
| Post-mortem analysis of a single crash | Crash triage |
| LLM-driven fuzzing campaign | Fuzzing |
| Kernel / remote-stub debugging (VZ, QEMU, KDP) | Kernel debugging |
| Let an agent freely explore a live target | Interactive exploration |
| Plug alf into Claude Code / Codex / Gemini CLI | ACP integration |
When in doubt: alf server --transport stdio exposes every capability as MCP tools. Everything else is a higher-level orchestrator around that same tool surface.
Before anything else, verify the host is configured: uv run alf doctor. A failing lldb_launch check almost always means macOS Developer Mode is off — see Gotchas.
Crash triage
Use when: the user has a binary and a crashing input (from libFuzzer, AFL++, Jackalope, etc.) and wants to understand the root cause, classify it, and/or generate a minimized/expanded corpus.
Three levels, pick by how much autonomy the agent should have:
| Level | Command | When |
|---|---|---|
| Fully scripted pipeline | uv run alf analyze --pipeline --binary <bin> --crash <input> |
Same output every run; good for CI |
| LLM-in-the-loop director | uv run alf director --binary <bin> --crash <input> --mode auto |
Need the agent to pick which commands to run |
| Raw MCP surface | alf server + lldb_launch → lldb_crash_context → ... |
Building a custom workflow, or an outer agent already orchestrates |
Sub-commands (alf analyze <subcommand>):
triage— capture backtrace, registers, disassembly →logs/*.jsonclassify— heuristic exploitability + LLM bucketingreport— render a markdown RCA from a triage JSONminimize— shrink a crash input while preserving the stack hashcorpus— synthesize new seeds from a crash (add--llmfor LLM-guided)
Agent recipe (raw MCP):
lldb_launch(binary, crash_input=...)— auto-runs to the stoplldb_crash_context()— one JSON with reason, registers, top frames, disasm, stack bytes, stack hash- If you need more:
lldb_backtrace_json(max_frames=32),lldb_read_memory("$x0", size=64),lldb_disassemble("--pc", count=20) lldb_stack_hash()for deduplication against previous crashes
One-call-gets-most-of-it: lldb_crash_context is the fastest path to a full picture.
Fuzzing
Use when: the user wants alf to run a campaign, not just analyze an existing crash.
| Mode | Command | Fits when |
|---|---|---|
auto |
alf fuzz auto <bin> --corpus <seeds> |
LLM picks functions, installs stop-hooks, mutates live. Works on any Mach-O. |
hybrid |
alf fuzz hybrid <bin> --corpus <seeds> --max-time 3600 |
libFuzzer does the volume, alf does the cold-start + triage. Best bang-for-buck on libFuzzer harnesses. |
jackalope |
alf fuzz jackalope <harness> --instrument-module <M> --target-method <m> |
macOS framework fuzzing (ImageIO, AVFoundation, etc.) via TinyInst. Requires a Jackalope build. |
Agent recipe for in-process mutation (raw MCP, after lldb_launch):
lldb_lookup_symbol(query="parse_", regex_search=True, as_json=True)— find candidate parserslldb_install_stop_hook(function="parse_foo", ptr_reg="x0", len_reg="x1")— mutate the buffer at entrylldb_generate_fuzz_script(function=..., skip_conditions=[...])— scripted IOUserClientexternalMethodfilteringtelemetry_rate()/telemetry_snapshot()— exec/s visibility while the hook runslldb_poll_crashes()— deduplicated crash events surfaced by the stop hook
Kernel debugging
Use when: the debug target is not a local process — a macOS guest kernel under Virtualization.framework, a QEMU gdbstub, a JTAG bridge, an iOS device over KDP.
This is a first-class path in alf as of the kernel-debug update. Do not try to use lldb_launch/lldb_attach for kernels; they are for local userspace processes.
Agent recipe:
# Attach to the stub (required first step)
lldb_gdb_remote(
port=8864, # VZ hypervisor default varies; whatever your stub exposes
host="127.0.0.1", # default
target="/Library/Developer/KDKs/KDK_*.kdk/System/Library/Kernels/kernel.release.vmapple",
arch="arm64e", # optional; some stubs omit it
plugin="kdp-remote", # "kdp-remote" for macOS; omit for QEMU/JTAG
)
# Pull in xnu's lldb macros (auto-detects KDK / ~/src/xnu / ALF_XNU_LLDBMACROS)
lldb_load_xnu_macros()
# Add a kext whose symbols aren't in the main kernel
lldb_add_module(path="/path/to/com.apple.MyKext.kext/Contents/MacOS/MyKext", dsym="...")
# Set breakpoints two ways
lldb_set_breakpoint(function="smb2_rq_decompress_read") # by symbol (after macros loaded)
lldb_set_breakpoint(static_addr="0xfffffe000a5ec4c8", # by link-time addr from IDA/disassembly
module="kernel.release.vmapple") # resolved against the runtime slide
# Work the stop
lldb_continue(wait=True)
lldb_register_read("x0")
lldb_read_memory("$x0+0x620", size=4)
# Poke the guest without fully halting it (single atomic pause/write/continue)
lldb_write_memory(address="_smbfs_loglevel", data="ffff0000",
encoding="hex", resume=True)
# Clean teardown — keeps the remote inferior running (attach/gdb_remote is detach-safe)
lldb_terminate()
Key rules:
static_addr+moduleis the correct way to break on an IDA address.lldb_set_breakpoint(address=...)is for runtime addresses and will miss under KASLR.lldb_write_memory(resume=True)is the kernel-debug primitive: one round trip, guest SSH barely blips.lldb_terminateon an attach/gdb-remote session detaches (does not kill the inferior). Launched processes are killed. Trust it.lldb_slide(module=...)returnsNoneif lldb hasn't resolved a slide yet (target not attached / unloaded module) — that is a legitimate answer, not an error; retry after attach.- If the server says "No active session" vs "Session ended": the first means you never attached; the second means the adapter died and you should gather what you have and report.
See references/workflows.md for the full VZ gdbstub recipe including KDK path discovery.
Interactive exploration
Use when: the agent should freely poke at a live target without a fixed workflow — answering "how does this work?" or "what does this function do on this input?"
uv run alf server --transport stdio # preferred for Claude Desktop / Claude Code
uv run alf server --transport sse --listen-port 7777 # for web clients
The server spawns lldb-dap automatically — no manual port juggling. It also runs a readiness probe and surfaces actionable spawn errors (missing binary, port in use, code-signing refusal). If you see "lldb-dap exited with code 0 before binding", the installed adapter doesn't accept --port; alf has already moved to --connection listen://host:port for this reason.
Tool families the agent has access to (~50 tools):
- Session —
lldb_launch,lldb_attach,lldb_gdb_remote,lldb_load_core,lldb_status,lldb_terminate - Execution —
lldb_execute(raw LLDB),lldb_continue,lldb_step,lldb_set_breakpoint,lldb_watchpoint - Inspection —
lldb_backtrace,lldb_disassemble,lldb_read_memory,lldb_register_read/write,lldb_memory_search,lldb_frame_*,lldb_thread_* - Crash —
lldb_crash_context,lldb_stack_hash,lldb_poll_crashes - Symbols —
lldb_lookup_symbol(withas_json=Truefor structured output),lldb_dump_symtab,lldb_read_source - Kernel —
lldb_add_module,lldb_slide,lldb_load_xnu_macros,lldb_write_memory - Instrumentation —
lldb_install_stop_hook,lldb_install_fork_server,lldb_generate_fuzz_script,telemetry_rate,telemetry_snapshot - Static analysis (no target required) —
macho_*for load commands, entitlements, dylibs, Swift symbols;static_lookup - ObjC runtime —
runtime_objc_classes,runtime_objc_class_dump,runtime_objc_object_dump - Capabilities —
heap_check,heap_inspect,objc_inspect,monitor_trace,xpc_sniff,xpc_send
Full one-line descriptions in references/mcp-tool-catalog.md.
ACP integration
ACP (Agent Client Protocol) is how alf drives agent CLIs (Claude Code, Codex, Gemini CLI) that authenticate via a user's subscription instead of an API key. The inverse is also true: those CLIs can consume alf as an MCP server.
Using alf from Claude Code / Codex / Gemini CLI
Add alf to the client's MCP config. For Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"alf": {
"command": "uv",
"args": ["run", "--directory", "/path/to/alf", "alf", "server", "--transport", "stdio"]
}
}
}
Claude Code's project-local .mcp.json takes the same shape. Gemini CLI: pass via --experimental-acp with an equivalent config. The server auto-spawns lldb-dap — no side setup.
Driving an agent CLI from alf
alf's ACP bridge (alf acp run) launches an external agent with alf already attached as an MCP server. Useful when you want alf to orchestrate Claude Code (for example, to run a multi-turn triage under subscription auth). Example:
uv run alf acp run --agent claude --prompt "Triage crash at /tmp/crash_input against /tmp/fuzz_bin"
Agents: claude (via claude-code-acp), codex (via codex-acp), gemini (via gemini --experimental-acp). alf discovers Zed-installed agents under ~/Library/Application Support/Zed/external_agents/ automatically.
Backend selection
alf supports four debugger backends. For an agent making MCP tool calls, the backend is almost always chosen by whoever started alf server — you don't pick it per call. But if the user asks:
| Backend | Flag | Use when |
|---|---|---|
dap (default) |
--backend dap |
Anywhere. Portable. Required for lldb_gdb_remote. |
sbapi |
--backend sbapi |
Batch crash triage, need 10-100× throughput, don't need gdb-remote |
lldb_mcp |
--backend lldb_mcp |
Experimental native LLDB MCP protocol |
mock |
--backend mock |
Tests/CI without an LLDB install |
Default is dap. If the user is doing kernel / remote work, they need dap (only backend with attach_gdb_remote).
Gotchas
process exited with status -1on launch → macOS Developer Mode is off.uv run alf doctorwill print the fix (System Settings → Privacy & Security → Developer Mode;DevToolsSecurity --enable; reboot).lldb_executereturns "No active session" → the agent never called a session-opening tool. Tell it to calllldb_launch,lldb_attach,lldb_load_core, orlldb_gdb_remotefirst.lldb_executereturns "Session ended" → the adapter died mid-flight. Don't retry — collect what you have fromlldb_crash_context/lldb_statusand report.lldb-dap exited with code 0 before binding <port>→ the installed adapter doesn't accept--port; you're on a build old enough that alf's--connection listen://...spawn still failed. Upgrade Xcode command-line tools or LLVM.- Breakpoint set on a kernel address never fires → you used
address=with a link-time address. Usestatic_addr=+module=instead so alf applies the runtime slide. lldb_slidereturns null → either the target isn't attached yet, or lldb hasn't resolved the module. Both are retryable; it's not an error.- Symbols look wrong / macros missing in a kernel session → call
lldb_add_modulefor the KDK kernel andlldb_load_xnu_macrosbefore trying to usezprint/showallkmods/etc. alf doctorreportsxnu_lldbmacros: WARN→ advisory only. Not needed for userspace. Install a KDK or setALF_XNU_LLDBMACROSif you're doing kernel work.
Reference files
- references/mcp-tool-catalog.md — every MCP tool, one line each, grouped by category.
- references/workflows.md — end-to-end recipes: kernel bp-on-parser loop, crash triage from cold, stop-hook-driven fuzzing, ACP orchestration.
- references/backends.md — detailed backend comparison and when each wins.
Source: blacktop/alf — distributed by TomeVault.
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核