跳到正文
Skillpedia
安全8.0k · #12735

trailmark-summary

它能做什么

这项技能快速提供软件项目的结构概览,列出其使用的语言、入口点和依赖项。适合刚接触某个代码库的安全审查人员。

适用场景

  • ✓你打开一个不熟悉的项目,想在深入工作前获得快速地图时。
  • ✓你需要知道项目使用了哪些语言,以及有多少个入口点时。
  • ✓你想在开始审计前获取依赖项列表时。

技能链接

https://github.com/trailofbits/skills/blob/main/plugins/trailmark/skills/trailmark-summary/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/trailofbits/skills/blob/main/plugins/trailmark/skills/trailmark-summary/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请给我这个项目的快速结构概览,包括它使用的语言和入口点。”

每周 5 个新技能,1 分钟读完。

工作原理

它会以摘要模式对某个文件夹运行 Trailmark 工具。它会自动检测语言,并列出入口点和依赖项。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Trailmark Summary

Runs trailmark analyze --language auto --summary on a target directory. This is a v0.2-safe workflow; do not require Trailmark 0.4.0 just to produce a summary.

When to Use

  • Vivisect Phase 0 needs a quick structural overview before decomposition
  • Galvanize Phase 1 needs detected languages and entry point count
  • Quick orientation on an unfamiliar codebase before deeper analysis

When NOT to Use

  • Full structural analysis with all passes needed (use trailmark-structural)
  • Detailed code graph queries (use the main trailmark skill directly)
  • You need hotspot scores or taint data (use trailmark-structural)

Rationalizations to Reject

Rationalization Why It's Wrong Required Action
"I can read the code manually instead" Manual reading misses parser-based language detection, dependency data, and entry point enumeration Install and run trailmark
"Language detection doesn't matter" Wrong language selection produces empty or partial analysis Use Trailmark's parser-based detection or --language auto
"Partial output is good enough" Missing any of the three required outputs (detected languages, entry points, dependencies) means incomplete analysis Verify all three are present
"Tool isn't installed, I'll skip it" This skill exists specifically to run trailmark Report the installation gap instead of skipping

Usage

The target directory is passed via the args parameter.

Execution

Step 1: Check that trailmark is available.

trailmark analyze --help 2>/dev/null || \
  uv run trailmark analyze --help 2>/dev/null

If neither command works, report "trailmark is not installed" and return. Do NOT run pip install, uv pip install, git clone, or any install command. The user must install trailmark themselves.

Optionally record the version if the installed build supports it:

trailmark --version 2>/dev/null || uv run trailmark --version 2>/dev/null || true

Do not fail if the version command is missing; older v0.2.x builds may still support the summary workflow.

Step 2: Detect languages with Trailmark's parse API.

python3 - "{args}" <<'PY'
import json
import sys

try:
    from trailmark.parse import detect_languages  # canonical location since 0.3.x
except ModuleNotFoundError:
    # v0.2.x predates trailmark.parse; the same function lives in query.api
    from trailmark.query.api import detect_languages

print(json.dumps(detect_languages(sys.argv[1])))
PY

If the import fails, rerun the same snippet with uv run --with trailmark python - "{args}". If the result is [], report "Trailmark found no supported languages under target" and return.

Step 3: Run the summary with auto-detection.

trailmark analyze --language auto --summary {args} 2>&1 || \
  uv run trailmark analyze --language auto --summary {args} 2>&1

Step 4: Verify the output.

The output must include ALL THREE of:

  1. Detected languages from Step 2
  2. Entrypoints: line from the summary output
  3. Dependencies: line from the summary output

If any are missing, report the gap. Do not fabricate output.

Return the detected language list plus the full Trailmark summary output. If a version string was available, include it in the returned metadata.

常见问题

它会显示风险评分吗?

不会。它只提供概览。详细的热点和污点数据来自完整的结构分析技能。

我需要较新的 Trailmark 版本吗?

不需要。该技能也设计为可与较旧版本一同使用。

我能只依靠它来完成审计吗?

不能。它是帮助你了解全局的起点,而不是完整的分析。

详情

作者的原始描述

Runs a Trailmark summary analysis on a codebase. Returns auto-detected languages, entry point count, and dependency list. Use when vivisect or galvanize needs a quick structural overview. Triggers: trailmark summary, code summary, structural overview.

repo: trailofbits/skills

热度

GitHub 星标
8.0k
排名
#12735
许可证
CC-BY-SA-4.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能