sem-integration
Provides sem semantic-diff detection, install-on-first-use, and fallback patterns. Use when building skills that consume git diff output.
What this skill does
# sem Integration
Foundation patterns for using
[sem](https://github.com/Ataraxy-Labs/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:
```bash
# 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):
```bash
sem diff --format json <baseline>
```
Fallback path (sem unavailable):
```bash
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):
```bash
sem impact --json <file-or-entity>
```
Fallback path (sem unavailable): use rg/grep to trace
callers by filename. See `modules/fallback.md`.
Related in infrastructure
progressive-loading
IncludedImplements hub-and-spoke lazy loading to minimize token usage in large skills. Use when building multi-module skills that need conditional on-demand loading.
cicd-pipeline-qe-orchestrator
IncludedOrchestrate quality engineering across CI/CD pipeline phases. Use when designing test strategies, planning quality gates, or implementing shift-left/shift-right testing.
evaluation-framework
IncludedProvides weighted scoring, rubrics, and decision-threshold patterns. Use when designing quality gates, evaluation systems, or decision frameworks.
authentication-patterns
IncludedProvides auth patterns for API keys, OAuth, and token management. Use when implementing or reviewing service authentication and credential handling.
damage-control
IncludedRecovers broken agent state via crash recovery, context overflow, and merge conflict protocols. Use when an agent session fails or a worktree is corrupted.
storage-templates
IncludedProvides templates and lifecycle patterns for storage and documentation systems. Use when organizing knowledge storage, config lifecycle, or naming conventions.