SummerSec/semantic-linter
Semantic-Linter 是一个面向 LLM 指令文件的插件与 CLI,用来收窄语义边界过宽的表达。它主要用于 SKILL.md、AGENTS.md、CLAUDE.md、prompt 文档、command 文档等指令资产,帮助减少因为措辞过宽带来的幻觉和范围漂移。
catalog descriptioncatalog 简介 / catalog description:一款面向 LLM 指令文件的插件和命令行工具,用于检测语义边界过宽的用词,并提供受保护的 Hook、项目级本地规则注入,以及针对 Skill、Prompt 和 Agent 的语义陷阱检查。
Project Overview项目介绍
Semantic-Linter is a plugin and command-line tool for checking LLM instruction files that identifies overly broad semantic expressions to reduce model hallucination and scope drift. It works with common instruction assets like SKILL.md, AGENTS.md, CLAUDE.md, prompt documents, and command definitions. It supports three AI coding agent platforms: Claude Code, Codex, and DeepSeek Harness, each with its own dedicated installation process. For Claude Code, you install it from the plugin marketplace with three commands: add the repository, install the plugin, then reload plugins. For Codex, installation is similar, though it uses AGENTS.md rule blocks instead of Claude’s hook manifest.
Semantic-Linter uses a layered design instead of the older pointer-only approach. It injects a compact rule pointer at session start, propagates the pointer to subagents when they start, and runs checks at multiple points in the workflow: before user prompts are submitted, before tools write or edit files, and after writes are completed. It also keeps the bin/scan.js CLI entry for explicit scanning of a single file, an entire directory, or the current working directory. The default mode is guarded, which enables the rule pointer plus pre-write and post-write checks, while other modes like off, pointer, and strict are also available.
For DeepSeek Harness, you first need to install the official DSH CLI globally, then add this repository as a bundle to your desired profile using the dsh plugin command. Local development can be done by adding the current working directory directly to the profile. To initialize a local rule set for your existing project, run the build-rules.js script to generate a semantic-rules.md file and add managed rule blocks to AGENTS.md or CLAUDE.md. You can customize behavior through the optional .semantic-linter.json config file, which supports settings like ignored paths, default mode, and rule source strategy. The project includes full test coverage for core functionality, and you can run all tests with the npm test command.
Semantic-Linter 是一款面向大语言模型指令文件的插件与命令行工具,核心功能是检测并收窄语义边界过宽的表达,减少因措辞模糊导致的模型幻觉和任务范围漂移。它支持对 SKILL.md、AGENTS.md、CLAUDE.md 以及各类 prompt 文档、命令文档等指令资产做语义检查,可在 Claude Code、Codex 以及 DeepSeek Harness 三个平台安装使用,不同平台都提供了对应的适配接入方式。
它采用分层设计架构,默认启用 guarded 运行模式,会在会话启动时注入规则指针,子代理启动时传播规则,用户提交提示词前和工具写入修改前后分别做检查,还保留了独立的 CLI 入口,支持手动扫描单文件、整个目录或当前工作区。规则默认采用项目优先策略,先查找项目本地的 semantic-rules.md 规则文件,不存在时再回退使用插件自带规则。
对于 DeepSeek Harness 用户,需要先安装官方 DSH CLI,再通过 dsh plugin 命令将本仓库作为 bundle 添加到对应 profile 配置中。项目支持通过 .semantic-linter.json 自定义配置,可设置忽略规则、默认运行模式、规则来源等参数。要在现有项目中初始化本地规则,可运行指定脚本生成规则文件和对应受管指令区块。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:semantic-linter(SummerSec/semantic-linter)
仓库:https://github.com/SummerSec/semantic-linter
本站详情页:https://www.yhbd.top/plugins/summersec-semantic-linter/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证未声明 · ⭐ 2 · 最近提交 2026-08-15 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
- Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile headless add github:SummerSec/semantic-linter
把 SummerSec/semantic-linter 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
Semantic-Linter
Semantic-Linter 是一个面向 LLM 指令文件的插件与 CLI,用来收窄语义边界过宽的表达。它主要用于 SKILL.md、AGENTS.md、CLAUDE.md、prompt 文档、command 文档等指令资产,帮助减少因为措辞过宽带来的幻觉和范围漂移。
当前架构
Semantic-Linter 现在使用分层设计,不再是旧的 pointer-only 方案:
SessionStart注入一条紧凑的STL:规则指针,指向当前生效的semantic-rules.mdSubagentStart把同样的规则指针传播给子代理UserPromptSubmit可以在提示词进入模型前提醒宽边界表达PreToolUse会在Write和Edit修改指令文件前给出预警PostToolUse会在写入后再次检查结果,并记录升级状态bin/scan.js仍然保留为显式 CLI 扫描入口,可扫描单文件、目录或当前工作区
默认运行模式是 guarded:
off:关闭 semantic-linterpointer:只保留轻量规则指针guarded:规则指针 + 写入期检查strict:规则指针 + 写入期检查 + prompt 扫描
规则来源策略
默认使用 project-first 规则解析策略:
- 从当前编辑文件或工作区开始,向上查找最近的
semantic-rules.md - 如果项目内没有,则回退到插件自带的
semantic-rules.md
你也可以通过 .semantic-linter.json 强制使用 plugin-only。
安装
Claude Code
claude plugin marketplace add SummerSec/semantic-linter
claude plugin install semantic-linter@summersec-semantic-linter
/reload-plugins
Codex
codex plugin marketplace add SummerSec/semantic-linter
codex plugin add semantic-linter@semantic-linter
Codex 不直接消费 Claude 的 hook manifest。它的项目级接入方式是把受管规则块写入 AGENTS.md。
DeepSeek Harness
安装官方 DSH CLI,并把本仓库作为 bundle 加入需要使用的 profile:
npm install -g @deepseek-ai/dsh@0.1.0-rc.6
dsh plugin --profile headless add github:SummerSec/semantic-linter
dsh plugin --profile web add github:SummerSec/semantic-linter
本地开发时可以在仓库根目录执行:
dsh plugin --profile headless add .
如果 pnpm 返回 ERR_PNPM_ADDING_TO_ROOT,在命令末尾追加 --ignore-workspace-root-check 后重试。
这个 DSH bundle 会把仓库根目录 skills/ 下的四个 Skill 注册到 ctx.skills。DSH 还会读取工作区中的 AGENTS.md 或 CLAUDE.md;调用 rules-installer 后,项目可以通过受管规则块按需读取 semantic-rules.md。
DSH 不会直接执行本仓库的 Claude hook manifest。DSH 下提供的是 packaged Skill + 项目 instruction pointer;SessionStart、SubagentStart、UserPromptSubmit、PreToolUse、PostToolUse 和 /stl-mode 仍仅属于 Claude hook 路径。
项目初始化
如果你想把项目本地规则注入到当前仓库,可以运行:
node /absolute/path/to/semantic-linter/scripts/build-rules.js --existing "$(pwd)"
这会生成:
semantic-rules.mdAGENTS.md和或CLAUDE.md中的受管规则区块
如果两个文件都不存在,脚本会根据宿主环境创建默认目标:
- Codex 或 auto:
AGENTS.md - Claude:
CLAUDE.md
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
Unclecheng-li/DeepSec
WestFox-AwA/dsh-prompt-optimizer
Noob-stupid/dsh-plugin-gating-hub
yannicksong0106/dsh-550c-boot