Xpersona
S

sem-integration

CLAWHUB · Unverified

Provides sem semantic-diff detection, install-on-first-use, and fallback patterns Skill: sem-integration Owner: athola Summary: Provides sem semantic-diff detection, install-on-first-use, and fallback patterns Tags: latest:1.9.19 Version history: v1.9.19 | 2026-08-26T13:15:33.205Z | user Release v1.9.19 v1.9.17 | 2026-07-30T05:36:26.250Z | user Release v1.9.17 v1.9.16 | 2026-07-14T19:53:11.823Z | user Release v1.9.16 v1.9.14 | 2026-06-30T18:02:05.089Z | user Release v1.9.14 v1.9.13 | 2026-06-27T16

62
Rank
84
Safety
1.6k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.6K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17emme0e2m3cpf7k2jvp3a84984b8z9:nm-leyline-sem-integration
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-leyline-sem-integration/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

80,942 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: sem-integration
description: |
  Provides sem semantic-diff detection, install-on-first-use, and fallback patterns
version: 1.9.8
triggers:
  - sem
  - semantic-diff
  - git
  - foundation
  - building skills that consume git diff output
metadata: {"openclaw": {"homepage": "https://github.com/athola/claude-night-market/tree/master/plugins/leyline", "emoji": "\ud83e\udd9e"}}
source: claude-night-market
source_plugin: leyline
---

> **Night Market Skill** — ported from [claude-night-market/leyline](https://github.com/athola/claude-night-market/tree/master/plugins/leyline). For the full experience with agents, hooks, and commands, install the Claude Code plugin.


# 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`.

_meta.json

{
  "ownerId": "kn7d107jg9jv602h9ytsegydq184a42s",
  "slug": "nm-leyline-sem-integration",
  "version": "1.9.19",
  "publishedAt": 1787750133205
}

modules/detection.md

---
name: detection
description: sem CLI detection and install-on-first-use
parent_skill: leyline:sem-integration
estimated_tokens: 250
---

# sem Detection and Installation

## Detection Logic

1. Check session cache at
   `$CLAUDE_CODE_TMPDIR/sem-available`
2. If cache exists, use cached value
3. If no cache, run `command -v sem`
4. Write result to cache

## Install-on-First-Use

When sem is not detected, present installation options
in priority order:

**Rust toolchain (preferred, works on all platforms):**

```bash
cargo install --locked sem-cli
```

**macOS (Homebrew, if formula exists):**

```bash
brew search sem-cli && brew install sem-cli
```

Note: the Homebrew formula may not exist. If `brew search`
returns no results, fall back to `cargo install` above.

**Linux (binary download):**

```bash
mkdir -p ~/.local/bin && curl -fsSL https://github.com/Ataraxy-Labs/sem/releases/latest/download/sem-x86_64-unknown-linux-gnu -o ~/.local/bin/sem && chmod +x ~/.local/bin/sem
```

## Prompt Template

When sem is missing, say:

> sem (semantic diff tool) can provide entity-level diffs
> instead of line-level diffs. Install it?
>
> - `cargo install --locked sem-cli` (any platform with Rust)
> - `brew install sem-cli` (macOS, if formula available)
> - Linux binary: `mkdir -p ~/.local/bin && curl -fsSL
>   https://github.com/Ataraxy-Labs/sem/releases/latest/download/sem-x86_64-unknown-linux-gnu
>   -o ~/.local/bin/sem && chmod +x ~/.local/bin/sem`
> - Or skip to use standard git diff

If the user declines, write `0` to the cache and
proceed with fallback for the rest of the session.

## Cache Invalidation

The cache file is in `$CLAUDE_CODE_TMPDIR` which is
per-session. No explicit invalidation needed: each new
Claude Code session starts fresh.

modules/fallback.md

---
name: fallback
description: Output normalization for git diff fallback path
parent_skill: leyline:sem-integration
estimated_tokens: 250
---

# Fallback Output Normalization

When sem is unavailable, produce entity-like output from
standard git commands.

## Entity Schema

sem produces raw output with these fields:

```json
{
  "entityId": "module::Class.method",
  "entityType": "function|class|method",
  "entityName": "method",
  "changeType": "added|modified|deleted|renamed",
  "filePath": "path/to/file.py"
}
```

The normalization layer maps these to a common schema
used by consumer skills:

```json
{
  "name": "entity_or_filename",
  "kind": "function|class|file",
  "change_type": "added|modified|deleted|renamed",
  "file": "path/to/file.py"
}
```

Mapping: `entityName` to `name`, `entityType` to `kind`,
`changeType` to `change_type`, `filePath` to `file`.
Fallback uses `file` as the kind since git diff
operates at file level.

## Fallback Commands

```bash
# Collect changes by type
added=$(git diff --name-only --diff-filter=A <baseline>)
modified=$(git diff --name-only --diff-filter=M <baseline>)
deleted=$(git diff --name-only --diff-filter=D <baseline>)
renamed=$(git diff --name-only --diff-filter=R <baseline>)
```

## Entity Extraction from Diff Hunks

For richer fallback (optional), parse diff hunks for
function/class definitions:

```bash
# Extract added functions from diff (includes async def)
git diff <baseline> | grep -E '^\+(async )?def |^\+class ' | \
  sed 's/^+//' | sed 's/(.*//'
```

This gives function-level granularity without sem,
though it misses renames, decorated definitions, and
cross-file dependencies.

## Impact Fallback

When `sem impact` is unavailable, trace callers with rg:

```bash
# For each changed file, find importers
git diff --name-only HEAD | while read f; do
  module=$(basename "$f" .py)
  if command -v rg &>/dev/null; then
    rg -l "import.*$module|from.*$module" --type py .
  else
    grep -rl "import.*$module\|from.*$module" \
      --include="*.py" .
  fi
done | sort -u
```

skill-card.md

## Description:

Provides sem semantic-diff detection, install-on-first-use, and fallback patterns.

This skill is ready for commercial/non-commercial use.

## Publisher:

[athola](https://clawhub.ai/user/athola)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and engineers use this skill when building or modifying agent skills that consume git diff output, so they can apply sem semantic-diff detection, optional installation prompts, and git-diff fallback patterns.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Optional installation commands may install sem-cli or download an external binary.

Mitigation: Verify the sem-cli package or release before running installation commands, and prefer a pinned version.

Risk: Broad triggers may make the skill appear in unrelated git discussions.

Mitigation: Confirm the task needs sem-based semantic diff guidance before applying the skill.

## Reference(s):

- [ClawHub skill page](https://clawhub.ai/athola/skills/nm-leyline-sem-integration)
- [ClawHub metadata homepage](https://github.com/athola/claude-night-market/tree/master/plugins/leyline)
- [sem semantic diff project](https://github.com/Ataraxy-Labs/sem)

## Skill Output:

**Output Type(s):** [text, markdown, shell commands, configuration, guidance]

**Output Format:** [Markdown guidance with inline bash commands and JSON schema examples]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Includes sem detection, install-on-first-use options, normalized diff schemas, and git diff fallback commands.]

## Skill Version(s):

1.9.19 (source: server release evidence)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to sem-integration and adjacent AI workflows.