Semantic Trap Detector

Detect and fix semantic traps in Claude Skills that cause LLM hallucinations. Use for testing skills, optimizing prompts, improving skill accuracy, fixing skill hallucinations, LLM output quality, and prompt engineering.

26 stars 3 forksAI, LLMs & Agents

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add Jumbo-WJB/semantic-trap-detector --skill semantic-trap-detector
Manual install
git clone --depth 1 https://github.com/Jumbo-WJB/semantic-trap-detector.git /tmp/semantic-trap-detector
mkdir -p ~/.claude/skills
cp -r /tmp/semantic-trap-detector/. ~/.claude/skills/semantic-trap-detector

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# 语义陷阱检测器 (Semantic Trap Detector)

## 概述

语义陷阱检测器是一个专门用于检测和优化其他 Claude Skills 的元 Skill。它基于**语义陷阱理论**——即在大模型认知空间中,某些在日常语境下含义相近的词汇对,其语义边界(激活范围)存在巨大差异。使用语义边界过宽的词汇会导致大模型突破 Prompt 约束,产生幻觉输出。

本检测器通过系统化的四步工作流,自动识别 Skill 中的高风险词汇和结构模式,并提供具体的替换建议和边界锚定策略。

---

## 核心理论

### 什么是语义陷阱?

**语义陷阱**(Semantic Trap):在人类日常语境中含义相近,但在大模型的语义空间中激活范围(即语义边界)存在巨大差异的词汇对。

示例:
- "漏洞" vs "风险" → 在实验中导致 **27个百分点** 的准确率差异(89.3% vs 62.1%)
- "检查" vs "审查" → 前者触发客观判定,后者触发主观评价
- "列出" vs "描述" → 前者输出结构化条目,后者触发解释和评论

### LLM 语义敏感度矩阵

```
            边界清晰度
            高 ←————→ 低
        ┌───────────────────┐
 低    │  漏洞  缺陷  错误  │  ← 安全区
 ↑     │  检查  列出  要求  │
 发    │─────────────────── │
 散    │  总结  问题  审查  │
 倾    │  建议  分析  风险  │  ← 危险区
 向    │  异常  评估  描述  │
 ↓     └───────────────────┘
 高
```

**关键洞察**:词汇选择比 Prompt 结构更根本。如果"砖块"(词汇)本身会膨胀,再精良的"围墙"(工作流)也会被撑破。

---

## 检测工作流

本检测器采用严格的四步工作流,**不得跳过或重新排序任何步骤**。

### STEP 1: 加载词典

**目标**:加载语义陷阱词典,建立检测知识基础

**执行动作**:
1. 读取 `semantic-trap-lexicon.md` 文件
2. 确认词典包含以下内容:
   - 17+ 组中文词汇对
   - 10+ 组英文词汇对
   - 语义敏感度矩阵
   - 边界锚定策略

**验证标准**:
- 词典文件成功加载
- 记录词典中的词汇对数量

---

### STEP 2: 提取关键词

**目标**:从待检测文本中提取四类高风险关键词

**执行动作**:

#### 2.1 核心术语提取
提取任务类型名词,如:
- 漏洞、风险、问题、缺陷、错误、异常
- Vulnerability, Risk, Issue, Defect, Error, Anomaly

#### 2.2 动作指令提取
提取指导大模型执行的动词或动宾短语:
- 检查、审查、分析、评估、探索、理解
- Check, Review, Analyze, Evaluate, Explore, Understand

#### 2.3 约束词提取
提取限定范围的词:
- 要求、建议、原则、规则、必须、应该
- Requirement, Suggestion, Must, Should, Principle

#### 2.4 输出描述词提取
提取描述期望输出的词:
Read the full skill on GitHub

Details

Skill name
semantic-trap-detector
License
MIT
Repo updated
8 March 2026

FAQ

What does the Semantic Trap Detector skill do?

Detect and fix semantic traps in Claude Skills that cause LLM hallucinations. Use for testing skills, optimizing prompts, improving skill accuracy, fixing skill hallucinations, LLM output quality, and prompt engineering.

How do I install the Semantic Trap Detector skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add Jumbo-WJB/semantic-trap-detector --skill semantic-trap-detector. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Semantic Trap Detector popular?

It lives in Jumbo-WJB/semantic-trap-detector, which has 26 GitHub stars and 3 forks.

Related skills

Zinxtick

25

zxzin/zinxtick

Beginner-friendly generic sticker and meme-pack production workflow for AI agents. Use when turning a user-provided character, animal, mascot, product, food, drink, can, object, logo-like subject, or original visual concept into a cohesive platform-ready static or animated sticker/expression pack, including built-in style preset selection, theme preset selection or custom prompt handling, item planning, image-generation prompting, contact sheets, transparent cutouts, platform export assets, and visual QA.

AI, LLMs & Agents

LangSmith Fetch

27

OthmanAdi/langsmith-fetch-skill

Debug LangChain agents via LangSmith execution traces. Fetch and analyze traces to understand agent behavior and debug issues.

AI, LLMs & Agents

Antirea

31

MockirDev/antirea

Protect a project from AI-driven reverse engineering tools like REA. Applies three complementary layers — agent instruction barriers, terminal shims, and build hardening — to make REA's output meaningless even when it runs. Use when a project owner wants maximum protection against REA-based analysis at every stage: development, CI, and distribution.

AI, LLMs & Agents

Interest Radar

27

Igloo302/interest-radar

通用相关性判断引擎(兴趣雷达/Interest Radar/Personal Radar):接收外部内容,利用用户的个人上下文判断内容与用户的相关程度。平台无关,可在各种 Agent 平台上运行。触发场景:(1) 用户转发/粘贴链接/消息并询问相关性;(2) 用户要求分析某条内容与项目的关联;(3) 用户提到"兴趣雷达"、"personal radar"、"相关性判断";(4) 其他推送 Skill 调用 batch_judge 增强推送质量。

AI, LLMs & Agents

LLM Wiki Skill

31

aaronoah/llm-wiki-skill

A CLI agent skill based on Karpathy's LLM Wiki — Create and maintain a persistent, interconnected Markdown knowledge base—ingesting sources, enabling queries over compiled knowledge, and ensuring consistency through linting.

AI, LLMs & Agents

Flowmaker

25

xntj-ai/flowmaker

生成单 HTML、零后端、可拖拽编辑的网页流程图。LLM 只产出 nodes/edges 的 JSON,引擎自动布局并渲染成浅色玻璃风、带判断菱形/起止圆角条/处理矩形三种形状的可交互流程图(拖节点、拖连线、双击改名、面板增删)。Use when 用户要"做流程图/画流程图/把流程画出来/流程可视化/flowchart/泳道/判断分支图",尤其要可在浏览器里编辑、且要一个独立 HTML 文件不带后端。NOT for 纯静态示意图(直接 mermaid 即可)、需要服务端渲染的大批量图表。

AI, LLMs & Agents

Browse the most popular Claude skills, all ai, llms & agents skills, or write your own with the skills generator.