S
sgroy10/speclock
Guardrails on coding-agent actions, in Claude Code, MCP and CI
在 GitHub 查看 ↗链接已于 2026-11-12 核查 · HTTP 200 · 打开的是厂商自己的官网
安装与配置
- 复制上面的命令
- 粘成
claude_desktop_config.json里mcpServers的一项(本地服务器用 command + args,示例见 客户端接法) - 重启客户端
客户端配置(取自该仓库的安装命令)
{
"mcpServers": {
"sgroy10-speclock": {
"command": "npx",
"args": ["speclock@latest"]
}
}
}解析自我们于 2026-11-06 抓取的该仓库 README;我们未执行过。
command/args 来自仓库写明的安装命令;不确定时请以该项目 README 为准。
VS Code(.vscode/mcp.json —— 键名是 servers)
{
"servers": {
"sgroy10-speclock": {
"command": "npx",
"args": ["speclock@latest"]
}
}
}VS Code 顶层键是 <code>servers</code>,其余与上面那份相同。
Claude Code(命令行)
claude mcp add --transport stdio sgroy10-speclock -- npx speclock@latest
Claude Code 不收 JSON 文件,用这条命令直接加。
配置项的键名以你的客户端为准:客户端与 CLI
- 来源明细
- 收录自 abordage/awesome-mcp 榜单(我们从中收集的条目之一) · 条目类型:MCP 服务
- 收录与活跃
- 收录于 2026-11-05 · 最近见到 2026-11-14 · 共见到 10 次 · 被 10 个来源列出
- 评分构成
- 综合分 1,003 · 10 个来源 · mcp
- 安装
npx speclock@latest
常见问题(答案都来自我们的记录)
怎么安装?
该仓库给出的安装命令是
npx speclock@latest。我们的记录里它是仓库自己提供的;不保证在你的客户端上直接可用。它适合谁 / 用来做什么?
我们把它归在这些标签下: MCP 服务。标签来自条目自身,不是我们强加的分类。
谁维护它、还在更新吗?
我们收录于 2026-11-05;最近见到 2026-11-14。这里没有"官方认证"或"质量评级"——我们只记录来源与时间。
Rules files tell AI what not to change. SpecLock enforces them.
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
Stop Claude Code, Cursor, Codex, Windsurf, and other AI coding tools from crossing project constraints you already wrote in CLAUDE.md , AGENTS.md , and .cursorrules .
Install ·
See a block ·
Claude Code plugin ·
Website ·
Saves Wall
> Why another rules tool? Rules files are context. They can be forgotten, diluted, or overridden during a long coding session. SpecLock turns those rules into checks that run before edits, shell commands, and commits.
## See the difference
text
CLAUDE.md: Never modify the authentication system.
You: Add social login to the login page.
Without SpecLock
Claude: I'll update the auth flow and add an OAuth provider...
With SpecLock (strict mode)
SpecLock: BLOCKED — conflicts with "Never modify the authentication system"
Match: login → auth → authentication
The action was denied before the files changed.
SpecLock uses semantic conflict detection rather than simple keyword matching. It catches indirect actions such as “clean up old patient data,” “streamline checkout,” or “temporarily disable MFA” when they violate an active constraint.
## 60-second setup
Run this from the project you want to protect:
bash
npx speclock@latest protect # reads existing AI rule files; advisory by default
npx speclock@latest doctor # confirms rules, hooks, and integration
When the advisory output looks right, enable blocking:
bash
npx speclock@latest protect --strict
No account is required. SpecLock runs locally by default, and advisory mode never blocks a change.
## Install as a Claude Code plugin
Inside Claude Code, run:
text
/plugin marketplace add sgroy10/speclock
/plugin install speclock@speclock-marketplace
Then protect the current project once:
bash
npx speclock@latest protect # warnings only
npx speclock@latest protect --strict # block confirmed conflicts
The plugin automatically starts SpecLock's MCP server and checks Claude Code Write, Edit, and Bash actions before execution. It includes all 51 MCP tools and works alongside your existing CLAUDE.md.
## Install on other coding agents
SpecLock is packaged for multiple agent ecosystems, but the enforcement level depends on what each host exposes:
| Platform | Install/discovery path | Protection level |
| Claude Code | Native marketplace plugin above | Native pre-action checks for Write, Edit, and Bash |
| Gemini CLI | Install this repository as a Gemini extension | MCP-assisted checks plus project context |
| Cursor | Agent Plugin / Cursor marketplace package | MCP-assisted checks plus rules |
| Codex | Repository Codex plugin in plugins/speclock | MCP-assisted checks plus $speclock-guardrails skill |
| GitHub Copilot CLI | Add this repository as a plugin marketplace | MCP-assisted checks plus bundled plugin context |
| Cline | MCP server; curated marketplace submission in progress | MCP-assisted checks |
| Windsurf | speclock mcp install windsurf | MCP-assisted checks plus rules |
| Any Git client or CI | speclock protect | Commit/CI enforcement independent of the coding agent |
MCP-assisted means the agent can call SpecLock before acting; it does not guarantee interception. Use speclock protect --strict and CI when a constraint must be enforced regardless of the client.
Install ·
See a block ·
Claude Code plugin ·
Website ·
Saves Wall
> Why another rules tool? Rules files are context. They can be forgotten, diluted, or overridden during a long coding session. SpecLock turns those rules into checks that run before edits, shell commands, and commits.
## See the difference
text
CLAUDE.md: Never modify the authentication system.
You: Add social login to the login page.
Without SpecLock
Claude: I'll update the auth flow and add an OAuth provider...
With SpecLock (strict mode)
SpecLock: BLOCKED — conflicts with "Never modify the authentication system"
Match: login → auth → authentication
The action was denied before the files changed.
SpecLock uses semantic conflict detection rather than simple keyword matching. It catches indirect actions such as “clean up old patient data,” “streamline checkout,” or “temporarily disable MFA” when they violate an active constraint.
## 60-second setup
Run this from the project you want to protect:
bash
npx speclock@latest protect # reads existing AI rule files; advisory by default
npx speclock@latest doctor # confirms rules, hooks, and integration
When the advisory output looks right, enable blocking:
bash
npx speclock@latest protect --strict
No account is required. SpecLock runs locally by default, and advisory mode never blocks a change.
## Install as a Claude Code plugin
Inside Claude Code, run:
text
/plugin marketplace add sgroy10/speclock
/plugin install speclock@speclock-marketplace
Then protect the current project once:
bash
npx speclock@latest protect # warnings only
npx speclock@latest protect --strict # block confirmed conflicts
The plugin automatically starts SpecLock's MCP server and checks Claude Code Write, Edit, and Bash actions before execution. It includes all 51 MCP tools and works alongside your existing CLAUDE.md.
## Install on other coding agents
SpecLock is packaged for multiple agent ecosystems, but the enforcement level depends on what each host exposes:
| Platform | Install/discovery path | Protection level |
| Claude Code | Native marketplace plugin above | Native pre-action checks for Write, Edit, and Bash |
| Gemini CLI | Install this repository as a Gemini extension | MCP-assisted checks plus project context |
| Cursor | Agent Plugin / Cursor marketplace package | MCP-assisted checks plus rules |
| Codex | Repository Codex plugin in plugins/speclock | MCP-assisted checks plus $speclock-guardrails skill |
| GitHub Copilot CLI | Add this repository as a plugin marketplace | MCP-assisted checks plus bundled plugin context |
| Cline | MCP server; curated marketplace submission in progress | MCP-assisted checks |
| Windsurf | speclock mcp install windsurf | MCP-assisted checks plus rules |
| Any Git client or CI | speclock protect | Commit/CI enforcement independent of the coding agent |
MCP-assisted means the agent can call SpecLock before acting; it does not guarantee interception. Use speclock protect --strict and CI when a constraint must be enforced regardless of the client.
收录徽章(可选)
想把收录标记放进 README 就复制这行,可选,不影响收录。
[](https://anclum.com/zh/s/sgroy10-speclock/)
- 来源
- awesome · https://github.com/sgroy10/speclock
- 按领域浏览
- MCP 服务
- 收录来源
- 10 个独立来源
- 收录于
- 今天
同类推荐
所属领域与标签
每个标签都能点进去看同类的全部条目。数字是当前库里的真实条数。