Community研究与数据分析github.com

grahama1970/analyze-elf

从ELF二进制文件中逆向工程功能,提取CLI命令、状态机、协议、Zod模式和数据模型,并自动生成包含Mermaid图表的审查简报。

analyze-elf 是什么?

`analyze-elf` 是一个 AI agent 技能,专注于从编译后的 ELF 二进制文件中提取高级功能,而不是进行低级反汇编。它适用于分析各种语言(如 Bun SEA、Go、Rust、C/C++)编译的 CLI 工具、状态机、协议模式和 JSON-RPC 方法。该技能通过模式匹配和可选的 AST 分析(借助 `/treesitter`)提取 CLI 帮助文本、枚举赋值、事件类型和 Zod 模式等。它自动生成一个包含 Mermaid 图表(CLI 命令树、状态机图等)的“审查简报”走查文档,帮助开发者快速理解二进制文件的行为。支持在 Claude Code 等 Agent 环境中使用 `features`、`elf`、`strings` 等命令,并依赖 `pyelftools` 和 `httpx` 等库。

兼容平台✓Claude Code~Codex CLI~Cursor✓Antigravity
npx skills add https://github.com/grahama1970/agent-skills/tree/main/skills/analyze-elf

Installed? Explore more 研究与数据分析 skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

停止。在调用任何端点之前,请先完整阅读本 SKILL.md。

analyze-elf 是做什么的?

从编译后的 ELF 二进制文件中逆向工程功能。这不是反汇编器——而是一个功能提取器,回答“这个二进制文件能做什么?”

何时使用

  • 理解编译后的 CLI 工具的功能(Bun SEA、Go、Rust、C/C++)
  • 提取 CLI 命令、标志和帮助文本
  • 恢复状态机、协议模式和事件类型
  • 映射 JSON-RPC 方法和 Zod 数据模型
  • 生成带有 Mermaid 图表的审查简报走查文档

快速开始

# 主要命令——提取功能,生成走查文档
.pi/skills/analyze-elf/run.sh features /path/to/binary --goal "理解任务系统"

# 通过 /treesitter 进行 AST 分析(较慢但更深入)
.pi/skills/analyze-elf/run.sh features /path/to/binary --ast --goal "查找所有 RPC 方法"

# JSON 格式输出,便于程序化使用
.pi/skills/analyze-elf/run.sh features /path/to/binary --output-format json

# 低层级 ELF 信息(头部、符号、运行时检测)
.pi/skills/analyze-elf/run.sh elf /path/to/binary

# 使用正则表达式提取字符串
.pi/skills/analyze-elf/run.sh strings /path/to/binary --pattern "mission|worker"

命令

命令描述
features主要命令。 提取功能 → 生成包含 Mermaid 图表的走查文档
elf低层级:头部、段、符号、运行时检测
strings正则过滤的字符串提取

features 提取的内容

类别方法示例
CLI 命令帮助文本模式匹配exec, daemon, mcp
状态机枚举赋值模式(M.State="value")orchestrator_turn, paused
事件类型KH.literal("type_name") 模式mission_accepted, worker_completed
JSON-RPC 方法method: KH.literal("name") 模式droid.session_notification
Zod 模式KH.object({...}) 字段提取Feature, WorkerHandoff, State
npm 包打包的 package.json 中的 "name": "pkg"@grpc/grpc-js
API 路由/api/ 和 /v1/ 路径字面量/api/auth/login
类/函数通过 /treesitter 进行 AST 分析(使用 --ast 标志)MissionRunner, spawnWorker

组合

/treesitter(AST 分析)

当传递 --ast 时,该技能会:

  1. 从 .rodata 段中提取 JS 源代码字符串
  2. 过滤出包含 JS 特征的行(函数/类/导入/Zod 模式)
  3. 将数据块通过 /treesitter parse --language javascript 传递
  4. 提取类、函数和方法签名

/create-walkthrough(自动生成)

features 命令会生成一份审查简报,包含:

  • Mermaid CLI 命令树
  • Mermaid 状态机图
  • Mermaid 事件类型分类
  • 带字段类型的模式表
  • 风险评估(“可能出什么问题”)

/create-figure

通过 elf 命令生成的 DOT 格式依赖和模块图,可经 /create-figure 渲染。

依赖项

  • pyelftools — 结构化 ELF 解析
  • httpx — /scillm API 调用
  • typer — CLI 框架
  • loguru — 日志记录
  • 系统:binutils(readelf, nm, strings)

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

grahama1970/acceptance-contract

Turn a client brief, zip bundle, directory, or single requirements file into a typed acceptance-contract bundle with extracted requirements, acceptance checks, open questions, an immutable-goal draft, and a create-report-backed decision report. Use when users say acceptance contract, brief to requirements, freeze the goal, create immutable goal, amend immutable goal, build a Battle requirements bundle, or extract requirements from this bundle.

grahama1970/agent-ecosystem

Canonical map and shared contracts for the agent-governance ecosystem: the pi.receipt_envelope.v1 boundary envelope, the component graph, and the rules for which component owns which schema. Use when wiring a skill or extension into the shared receipt world, when asking how shame, triage-error, tau, ask, project-watchdog, ops-herdr, ponytail, and Memory fit together, or when validating an envelope.

grahama1970/agentic-evals

Agentic evaluation of skills using multi-trial fixtures, deterministic command assertions, trajectory checks, safety constraints, and evidence-backed readiness scoring. Use when users ask for agentic evals, multi-trial skill evaluation, skill trajectory validation, or readiness scoring for a skill workflow.

grahama1970/agent-inbox

File-based inter-agent messaging with headless dispatch. Check inbox, send bugs/requests to other projects, automatically spawn headless agents to fix bugs, and track progress via task-monitor.

grahama1970/agents-registry

Generate and query the centralized agent identity registry. Scans .pi/agents/*/AGENTS.md, parses frontmatter, outputs agents-registry.json and optionally syncs to /memory for semantic search.

grahama1970/agent-status

Artifact-driven status surfaces for long-running project-agent work. Maintains status.json, events.jsonl, proof manifests, and a stale-aware STATUS.html so humans can tell where the agent is, what passed, what is still unproven, and what decision or action is next — without dashboard theater.

grahama1970/align

Round-based context alignment before execution. Use when the human, project agent, WebGPT, scillm, ask, dogpile, memory, or project-knowledge may each hold different facts about a task; especially before ambiguous design, infographic, product workflow, high-stakes implementation, plan-iterate, project-infographic, or multi-review work.

grahama1970/analytics

Flexible data science analytics for any dataset. Auto-discovers schema, recommends charts, exports to create-figure. Works with JSONL, JSON, CSV from any source.

grahama1970/analyze-chatterbox-emotions

Evaluate generated Chatterbox voice files as voice-quality artifacts: affect match, arousal/valence proxies, pause placement, intelligibility inputs, clipping, loudness, and discontinuity flags. Use when reviewing Chatterbox emotional tags, pauses, Turbo/base affect delivery, Persona Dream utterance renders, or whether generated speech matches an intended product-facing affect.

grahama1970/animation-vocabulary

Reverse-lookup glossary that turns a vague description of a web animation or motion effect into its exact term ("the bouncy thing when a popover opens" → Pop in; "the iOS rubber-band scroll" → Rubber-banding). Use when the user asks "what's it called when…", or describes a motion effect without knowing its name and wants the right word to prompt an AI or designer with. For naming an effect, not designing or building one.

grahama1970/anonymize-data

Anonymize supported CSV, JSON, UTF-8 text, and SQLite files using an explicit policy through the oai-trial project. Use for anonymize data, pseudonymize exports, redact policy literals, or discover and explicitly approve fuzzy name aliases. The skill is a thin CLI/Docker interface, not another engine.

grahama1970/anvil

Heavy-duty "No-Vibes" debugging and hardening orchestrator. Use this for complex, stubborn bugs where `review-code` has failed, or for "Red Teaming" (hardening) a codebase. Runs multiple agents in parallel (Thunderdome) using git worktree isolation.

grahama1970/apple-design

Apple's approach to interface design and fluid, physical motion, translated for the web. Use when building or reviewing gesture-driven UI, spring animations, drag/swipe/sheet interactions, momentum and interruptible transitions, translucent materials and depth, typography (optical sizing, tracking, leading), reduced-motion, or the design foundations (feedback, spatial consistency, restraint) behind Apple-style interfaces.

grahama1970/argue

Multi-persona structured debate orchestrator. Personas research via /dogpile, consult colleagues via /ask, and argue toward nuanced synthesis on complex questions.

grahama1970/arxiv

Search arXiv for papers and extract knowledge into memory. Use `search` to find papers, `learn` to extract knowledge.

grahama1970/ask

Use when the user asks to query project memory, ask an oracle, use supported browser-backed reviewers, run Tau roundtable/single-handler workflows, ask Pi-native subagents from within Pi, run persona/deep-review workflows, generate image prompts, check OS/project health through composed skills, or run an ask DAG. This skill is the executable /ask runtime; do not replace it with an informal subagent, plain web search, or hand-written review; inside Pi, explicit Pi-native subagent targets are routed through the pi-subagents tool as an Ask target type.

grahama1970/assess

Step back and critically reassess project state. Use when asked to "assess", "step back", "fresh eyes", "check alignment", "sanity check", "health check", "prune documentation", or "evaluate what's working". Offers documentation pruning and doc-code alignment analysis. Offer to run after major changes (don't auto-run).

grahama1970/assistant

Shared GPT + classifier inference gateway for persona monitor tasks. Routes validation and classification through a 4-tier cascade: heuristic → classifier → local GPT → scillm.

grahama1970/assistant-lab

Self-improvement workbench for /assistant. All the tools needed to diagnose, train, evaluate, and promote models in a continuous loop. The "warm pond" where /assistant evolves its own inference stack.

grahama1970/batch-quality

Pre-flight validation and quality gates for batch LLM operations. ACTUALLY tests samples through LLM before burning tokens. Uses SPARTA contracts for DuckDB validation queries. Integrates with task-monitor for enforced quality gates.

相关技能