Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问clear审计通过

audit-context-building审计环境构建

Agent Skill

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

总安装

52,272

周安装

2,206

GitHub Stars

4,915

下载量

18,304
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:audit-context-building(审计环境构建)
来源仓库:https://github.com/trailofbits/skills
仓库路径:skills/audit-context-building
安装命令:
npx skills add https://github.com/trailofbits/skills --skill audit-context-building
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/trailofbits/skills --skill audit-context-building

简介

超细粒度、逐行代码分析,可在发现漏洞之前构建稳定的架构上下文。

  • 通过在微观尺度上应用第一原则、5 个为什么和 5 个如何进行逐块分析,随着理解的发展建立和完善持久的心智模型
  • 将内部和外部调用链跟踪为连续执行流,跳转到可用代码并将黑盒调用建模为对抗性
  • 需要结构化输出,并记录不变量、假设、风险分析和跨职能依赖性;强制执行最低质量阈值以防止出现幻觉
  • 在充分的微观分析后,通过状态映射、工作流重建、信任边界识别和复杂性聚类来重建全局系统理解
  • 明确纠正矛盾,定期锚定关键事实,并避免猜测 - 仅为安全审计、架构审查和威胁建模准备而设计

SKILL.md

Deep Context Builder Skill (Ultra-Granular Pure Context Mode)

1. Purpose

This skill governs how Claude thinks during the context-building phase of an audit.

When active, Claude will:

  • Perform line-by-line / block-by-block code analysis by default.
  • Apply First Principles, 5 Whys, and 5 Hows at micro scale.
  • Continuously link insights → functions → modules → entire system.
  • Maintain a stable, explicit mental model that evolves with new evidence.
  • Identify invariants, assumptions, flows, and reasoning hazards.

This skill defines a structured analysis format (see Example: Function Micro-Analysis below) and runs before the vulnerability-hunting phase.


2. When to Use This Skill

Use when:

  • Deep comprehension is needed before bug or vulnerability discovery.
  • You want bottom-up understanding instead of high-level guessing.
  • Reducing hallucinations, contradictions, and context loss is critical.
  • Preparing for security auditing, architecture review, or threat modeling.

Do not use for:

  • Vulnerability findings
  • Fix recommendations
  • Exploit reasoning
  • Severity/impact rating

3. How This Skill Behaves

When active, Claude will:

  • Default to ultra-granular analysis of each block and line.
  • Apply micro-level First Principles, 5 Whys, and 5 Hows.
  • Build and refine a persistent global mental model.
  • Update earlier assumptions when contradicted ("Earlier I thought X; now Y.").
  • Periodically anchor summaries to maintain stable context.
  • Avoid speculation; express uncertainty explicitly when needed.

Goal: deep, accurate understanding, not conclusions.


Rationalizations (Do Not Skip)

RationalizationWhy It's WrongRequired Action
"I get the gist"Gist-level understanding misses edge casesLine-by-line analysis required
"This function is simple"Simple functions compose into complex bugsApply 5 Whys anyway
"I'll remember this invariant"You won't. Context degrades.Write it down explicitly
"External call is probably fine"External = adversarial until proven otherwiseJump into code or model as hostile
"I can skip this helper"Helpers contain assumptions that propagateTrace the full call chain
"This is taking too long"Rushed context = hallucinated vulnerabilities laterSlow is fast

4. Phase 1 — Initial Orientation (Bottom-Up Scan)

Before deep analysis, Claude performs a minimal mapping:

  1. Identify major modules/files/contracts.
  2. Note obvious public/external entrypoints.
  3. Identify likely actors (users, owners, relayers, oracles, other contracts).
  4. Identify important storage variables, dicts, state structs, or cells.
  5. Build a preliminary structure without assuming behavior.

This establishes anchors for detailed analysis.


5. Phase 2 — Ultra-Granular Function Analysis (Default Mode)

Every non-trivial function receives full micro analysis.

5.1 Per-Function Microstructure Checklist

For each function:

  1. Purpose

- Why the function exists and its role in the system.

  1. Inputs & Assumptions

- Parameters and implicit inputs (state, sender, env). - Preconditions and constraints.

  1. Outputs & Effects

- Return values. - State/storage writes. - Events/messages. - External interactions.

  1. Block-by-Block / Line-by-Line Analysis For each logical block: Apply per-block:

- What it does. - Why it appears here (ordering logic). - What assumptions it relies on. - What invariants it establishes or maintains. - What later logic depends on it. - First Principles - 5 Whys - 5 Hows


5.2 Cross-Function & External Flow Analysis

*(Full Integration of Jump-Into-External-Code Rule)*

When encountering calls, continue the same micro-first analysis across boundaries.

Internal Calls

  • Jump into the callee immediately.
  • Perform block-by-block analysis of relevant code.
  • Track flow of data, assumptions, and invariants: caller → callee → return → caller.
  • Note if callee logic behaves differently in this specific call context.

External Calls — Two Cases

Case A — External Call to a Contract Whose Code Exists in the Codebase Treat as an internal call:

  • Jump into the target contract/function.
  • Continue block-by-block micro-analysis.
  • Propagate invariants and assumptions seamlessly.
  • Consider edge cases based on the *actual* code, not a black-box guess.

Case B — External Call Without Available Code (True External / Black Box) Analyze as adversarial:

  • Describe payload/value/gas or parameters sent.
  • Identify assumptions about the target.
  • Consider all outcomes:

- revert - incorrect/strange return values - unexpected state changes - misbehavior - reentrancy (if applicable)

Continuity Rule

Treat the entire call chain as one continuous execution flow. Never reset context. All invariants, assumptions, and data dependencies must propagate across calls.


5.3 Complete Analysis Example

See FUNCTION_MICRO_ANALYSIS_EXAMPLE.md for a complete walkthrough demonstrating:

  • Full micro-analysis of a DEX swap function
  • Application of First Principles, 5 Whys, and 5 Hows
  • Block-by-block analysis with invariants and assumptions
  • Cross-function dependency mapping
  • Risk analysis for external interactions

This example demonstrates the level of depth and structure required for all analyzed functions.


5.4 Output Requirements

When performing ultra-granular analysis, Claude MUST structure output following the format defined in OUTPUT_REQUIREMENTS.md.

Key requirements:

  • Purpose (2-3 sentences minimum)
  • Inputs & Assumptions (all parameters, preconditions, trust assumptions)
  • Outputs & Effects (returns, state writes, external calls, events, postconditions)
  • Block-by-Block Analysis (What, Why here, Assumptions, First Principles/5 Whys/5 Hows)
  • Cross-Function Dependencies (internal calls, external calls with risk analysis, shared state)

Quality thresholds:

  • Minimum 3 invariants per function
  • Minimum 5 assumptions documented
  • Minimum 3 risk considerations for external interactions
  • At least 1 First Principles application
  • At least 3 combined 5 Whys/5 Hows applications

5.5 Completeness Checklist

Before concluding micro-analysis of a function, verify against the COMPLETENESS_CHECKLIST.md:

  • Structural Completeness: All required sections present (Purpose, Inputs, Outputs, Block-by-Block, Dependencies)
  • Content Depth: Minimum thresholds met (invariants, assumptions, risk analysis, First Principles)
  • Continuity & Integration: Cross-references, propagated assumptions, invariant couplings
  • Anti-Hallucination: Line number citations, no vague statements, evidence-based claims

Analysis is complete when all checklist items are satisfied and no unresolved "unclear" items remain.


6. Phase 3 — Global System Understanding

After sufficient micro-analysis:

  1. State & Invariant Reconstruction

- Map reads/writes of each state variable. - Derive multi-function and multi-module invariants.

  1. Workflow Reconstruction

- Identify end-to-end flows (deposit, withdraw, lifecycle, upgrades). - Track how state transforms across these flows. - Record assumptions that persist across steps.

  1. Trust Boundary Mapping

- Actor → entrypoint → behavior. - Identify untrusted input paths. - Privilege changes and implicit role expectations.

  1. Complexity & Fragility Clustering

- Functions with many assumptions. - High branching logic. - Multi-step dependencies. - Coupled state changes across modules.

These clusters help guide the vulnerability-hunting phase.


7. Stability & Consistency Rules

*(Anti-Hallucination, Anti-Contradiction)*

Claude must:

  • Never reshape evidence to fit earlier assumptions. When contradicted:

- Update the model. - State the correction explicitly.

  • Periodically anchor key facts Summarize core:

- invariants - state relationships - actor roles - workflows

  • Avoid vague guesses Use:

- "Unclear; need to inspect X." instead of: - "It probably…"

  • Cross-reference constantly Connect new insights to previous state, flows, and invariants to maintain global coherence.

8. Subagent Usage

Claude may spawn subagents for:

  • Dense or complex functions.
  • Long data-flow or control-flow chains.
  • Cryptographic / mathematical logic.
  • Complex state machines.
  • Multi-module workflow reconstruction.

Use the function-analyzer agent for per-function deep analysis. It follows the full microstructure checklist, cross-function flow rules, and quality thresholds defined in this skill, and enforces the pure-context-building constraint.

Subagents must:

  • Follow the same micro-first rules.
  • Return summaries that Claude integrates into its global model.

9. Relationship to Other Phases

This skill runs before:

  • Vulnerability discovery
  • Classification / triage
  • Report writing
  • Impact modeling
  • Exploit reasoning

It exists solely to build:

  • Deep understanding
  • Stable context
  • System-level clarity

10. Non-Goals

While active, Claude should NOT:

  • Identify vulnerabilities
  • Propose fixes
  • Generate proofs-of-concept
  • Model exploits
  • Assign severity or impact

This is pure context building only.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

29.53%
按下载量换算5,405

OpenCode

21.98%
按下载量换算4,023

Gemini CLI

16.37%
按下载量换算2,996

Antigravity

13.5%
按下载量换算2,471

Cursor

7.12%
按下载量换算1,303

Codex

2.99%
按下载量换算547

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/trailofbits/skills --skill audit-context-building;npx skills add trailofbits/skills --skill "audit-context-building" 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills