dimensional-analysis
仓库创建 2026年1月15日最近提交 10 小时前SkillHot 收录 21 天前
▸ 精选理由
对涉及货币、物理量或 DeFi 计算的代码尤为有用,减少单位错误与漏洞。
这个 Skill 做什么
为代码库标注单位与量纲,发现混用精度与缩放导致的计算或安全问题。
在代码里标注单位与量纲(比如金额精度、时间单位、缩放因子),帮你发现混用单位或精度导致的计算错误或安全漏洞。常用在 DeFi、链下计算或任何大量数值运算的代码库审查时。特点是把单位作为注释和传播规则,及早抓住维度不匹配和公式错误,避免线上损失。
▸ 展开 SKILL.md 英文原文
Annotates codebases with dimensional analysis comments documenting units, dimensions, and decimal scaling. Use when someone asks to annotate units in a codebase, perform a dimensional analysis, or find vulnerabilities in a DeFi protocol, offchain code, or other blockchain-related codebase with arithmetic. Prevents dimensional mismatches and catches formula bugs early.
6.3k
Stars
543
Forks
40
仓库内 Skill
+282
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/trailofbits/skills/main/plugins/dimensional-analysis/skills/dimensional-analysis/SKILL.md或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/trailofbits/skills/main/plugins/dimensional-analysis/skills/dimensional-analysis/SKILL.md"SKILL.MD 节选查看完整文件 ↗
# Dimensional Analysis Skill
This skill orchestrates a dimensional-analysis pipeline for codebases that perform numeric computations with mixed units, precisions, or scaling factors. The main skill context is a workflow controller only: it delegates scanning, vocabulary discovery, annotation, propagation, and validation to specialized subagents, then manages batching, persistence, retries, coverage gates, and final reporting.
## When to Use
- Annotating a codebase with unit/dimension comments (e.g., `D18{tok}`, `D27{UoA/tok}`)
- Performing dimensional analysis on DeFi protocols, financial code, or scientific computations
- Hunting for arithmetic bugs caused by unit mismatches, missing scavia SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有