跳到主要内容
知仓学习社ZHICANG

sem-integration

Provides sem semantic-diff detection, install-on-first-use, and fallback patterns. Use when building skills that consume git diff output.

执行命令联网无严重或高危命中athola/claude-night-market

它会碰到什么

扫了多少3 个文本文件,6 KB
它会碰到什么执行命令联网
命中总数1 处
命中统计严重 0 · 高 0 · 中 0 · 低 0

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

sem Integration

Foundation patterns for using

sem semantic

diffs in night-market skills.

When To Use

Consult this skill when building or modifying skills that

consume git diff output. It provides the detection,

installation, and fallback patterns.

When NOT To Use

  • Direct sem CLI usage (just run sem diff yourself)
  • Skills that don't consume diff output

Detection Pattern

Check sem availability once per session:

# Detection (cache per session)
_sem_check() {
  local cache="${CLAUDE_CODE_TMPDIR:-/tmp}/sem-available"
  if [ -f "$cache" ]; then
    cat "$cache"
    return
  fi
  if command -v sem &>/dev/null; then
    echo "1" | tee "$cache"
  else
    echo "0" | tee "$cache"
  fi
}

When _sem_check returns 0, offer installation.

See modules/detection.md for install-on-first-use

logic and platform-specific commands.

Semantic Diff Pattern

Primary path (sem available):

sem diff --format json <baseline>

Fallback path (sem unavailable):

git diff --name-only --diff-filter=A <baseline>
git diff --name-only --diff-filter=M <baseline>
git diff --name-only --diff-filter=D <baseline>
git diff --name-only --diff-filter=R <baseline>

See modules/fallback.md for output normalization

that produces the same entity schema from both paths.

Impact Analysis Pattern

Primary path (sem available):

sem impact --json <file-or-entity>

Fallback path (sem unavailable): use rg/grep to trace

callers by filename. See modules/fallback.md.

Exit Criteria

  • [ ] _sem_check result cached per session at

${CLAUDE_CODE_TMPDIR:-/tmp}/sem-available; detection command

runs at most once per session regardless of how many skills

invoke it

  • [ ] When sem is unavailable, install offer presented and fallback

path used automatically (git diff --name-only --diff-filter=

variants); no silent failure

  • [ ] Fallback output normalized to the same entity schema as sem

JSON output per modules/fallback.md; consumers downstream

see the same structure from both paths

  • [ ] Skills consuming this integration declare

dependencies: [leyline:sem-integration] in frontmatter

rather than reimplementing the detection pattern

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。