Sem integration

From athola/claude-night-market · View interactive version

Sem integration is an AI agent skill from the GitHub repository athola/claude-night-market. Provides sem semantic-diff detection, install-on-first-use, and fallback patterns. Use when building skills that consume git diff output.

How to use this skill

Skill file

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

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

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

runs at most once per session regardless of how many skills

invoke it

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

variants); no silent failure

JSON output per modules/fallback.md; consumers downstream

see the same structure from both paths

dependencies: [leyline:sem-integration] in frontmatter

rather than reimplementing the detection pattern

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.