Groundrule
概览
作者提供的说明(英文原文)
Your repository's engineering standards for coding agents: rules per file, CI check, rule proposals.
PopNx MCP 的三大支柱
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
- 用户评价i暂无评价评价功能将在后续阶段与账户功能一起开放
- 我们的基础检查i2 项中通过 2 项依据公开信息检查;尚未扫描代码
- 使用情况i非常新↓ 213/周 · ★ 1
它能帮你做什么
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
- 连接方式: 在你的电脑上运行
- 传输方式: stdio
- 分类: 开发者工具
安装
选择你使用的 AI 应用,然后复制设置。
安装之前
- 基础检查:2 项中通过 2 项
- 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
- 注册中心没有列出需要填写的密钥。
你需要
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"groundrule": {
"command": "npx",
"args": [
"-y",
"@groundrule/cli",
"mcp"
]
}
}
}在终端中运行这条命令
claude mcp add groundrule -- npx -y @groundrule/cli mcp或者自己复制设置
粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"groundrule": {
"command": "npx",
"args": [
"-y",
"@groundrule/cli",
"mcp"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
或者自己复制设置
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"groundrule": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@groundrule/cli",
"mcp"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
哪些应用可以使用它
依据这个服务器的连接方式和各应用自己的文档,检查于 2026年11月10日。
在你的电脑上运行,适用于
ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast
它能做什么
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
基础检查i
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月10日
- ✓ 通过
作者与仓库一致
注册名称已通过 GitHub 账户 Metricall-AI-Lab 验证,该账户拥有此仓库
- ✓ 通过
仍在维护
代码最后更新于11天前
- … 尚未检查
有许可证
我们还没有从 GitHub 读取这个仓库
- – 不适用
端点有响应
它在你的电脑上运行,没有互联网端点
- – 不适用
使用 OAuth 登录
在你的电脑上运行,改用本地设置
- … 尚未检查
工具描述中没有隐藏指令
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与“开发者工具”中的其他服务器比较i
- 星标数多于此分类中其他 5725 个服务器的 65%
- 发布到注册中心的时间比此分类中其他 5725 个服务器的 66% 更新
- 基础检查结果等于或优于此分类中其他 5725 个服务器的 100%
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
常见问题
Groundrule 安全吗?
它在 2 项适用的基础检查中通过了 2 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
它需要哪些密钥或代码?
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在我的电脑上运行还是在云端?
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
它还在维护吗?
GitHub 仓库最后更新于11天前,最新版本(0.23.1)于12天前进入注册中心。
哪些应用可以使用它?
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。
有什么可以替代它?
同一分类中有:REA, Netdata, Front-End Checklist
替代选择
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Netdata
Real-time infrastructure monitoring with metrics, logs, alerts, and ML-based anomaly detection.
Front-End Checklist
Review frontend code and live pages against 386 quality-gated web development rules.
作者的 README
打开 README
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
Groundrule
Your engineering standards, taught to every coding agent and checked on every PR.
Write a standard once, as a small YAML file in git. Groundrule:
- teaches your coding agents. It generates
AGENTS.md,CLAUDE.md, Cursor rules, and Copilot instructions containing only the standards that apply, without touching what you wrote by hand. An MCP server and hooks let Claude Code, Codex, Cursor and Copilot follow action policies before each tool call and check their own changes before they finish. - checks the code. It runs locally and in CI against your changes or the whole repository, with deterministic checks (files, patterns, dependencies, imports, layout, metrics, change sets), Semgrep, and optional AI checks on the Groundrule platform.
- tells you why. Every finding names the standard, shows the evidence, says how to fix it, and labels whether it came from a deterministic check or AI.
Everything in this repository works offline and without an account. The Groundrule platform adds a shared rulebook, staged rollout, hosted checks and a compliance report on top of it.
Status: 0.x. Groundrule checks its own repositories with it. The document format is
groundrule.dev/v1alpha1and may still change before 1.0; changes are announced in Discussions.
See it in 60 seconds
Quick start
Thirty seconds, no account, nothing leaves your machine:
npx @groundrule/cli init # detects your stack, picks packs, writes .groundrule/config.yaml
npx @groundrule/cli sync # writes AGENTS.md / CLAUDE.md / Cursor / Copilot instructions npx @groundrule/cli check # checks your uncommitted changes
groundrule check · 11 standards · 2 files changed
✕ TS-003 No eval or new Function BLOCKER · deterministic (regex) src/app.ts:3 eval or new Function in application code 3: return eval(input); → Parse the input instead: JSON.parse, a schema, or a lookup table of allowed operations. → groundrule explain TS-003
Failed ✓ 7 passed ✕ 1 failed ◇ 2 guidance · 0.1s
A standard
apiVersion: groundrule.dev/v1alpha1
kind: Standard metadata: id: DEP-008 title: Use the platform HTTP client type: forbidden-tech owner: team:platform spec: severity: warning requirement: Backend services must use @acme/http-client for outbound HTTP calls. examples: forbidden: ["import axios from 'axios'"] checks:
- evaluator: dependencies forbid: [axios, got, node-fetch] allowInstead: ["@acme/http-client"]
More in examples/foundation.
Commands
| Command | What it does | ||
|---|---|---|---|
groundrule init | Create .groundrule/config.yaml with packs for your stack | ||
groundrule sync [--check] [--upload] | Write (or verify) coding-agent instructions; --upload reports what the repository delivers to agents | ||
groundrule check [--base ] [--all] | Check changes, a branch, or everything. `-f json\ | sarif\ | markdown, --summary ` |
groundrule standards | List the standards in effect | ||
groundrule keys generate | Create a signing key pair for check results (RFC 0008) | ||
groundrule verify --key | Check a run's signature offline | ||
groundrule explain | Why a standard exists, examples, how to comply, exceptions | ||
groundrule doctor | Check configuration, tools, and agent files | ||
groundrule packs | List bundled packs | ||
groundrule scan [--json] [--upload] | Observe this repository against the whole catalog: stack, agent files, tools, and how every rule would do today. Changes nothing | ||
groundrule propose " " | Propose a rule for your team to review on the platform. --why, --example, --file path[:line] | ||
groundrule mcp | Serve your standards to coding agents over MCP, let them check their changes and propose rules (see below) | ||
groundrule hooks [--agents ] [--remove] | Have Claude Code, Codex, Cursor, or Copilot follow action policies before each tool call and run the check when they finish a task (see below) | ||
groundrule login | Sign in to your organization on the Groundrule platform (browser approval) | ||
groundrule whoami / logout | Show or remove (and revoke) your saved sign-in |
Exit codes: 0 passed, 1 failed, 2 configuration or usage error.
Using the Groundrule platform (optional)
Everything above works offline. If your organization manages its standards on the Groundrule platform, connect a repository instead of listing packs:
npx @groundrule/cli login # approve this computer in your browser
npx @groundrule/cli init --org acme # writes platform: { org: acme } to .groundrule/config.yaml npx @groundrule/cli sync # your organization's rules, with every customization
groundrule scan --upload shares a scan with your organization so it can see which rules fit each repository. It also imports what you already have as proposals: instructions from AGENTS.md, CLAUDE.md, Cursor, and Copilot files; ESLint, Biome, Ruff, golangci-lint, Checkstyle, PMD, and tsconfig settings that match catalog rules; CODEOWNERS; and the architecture the code already keeps, as proposed boundary rules with the files that would fail each today (RFC 0011; use --no-import to leave these out). Reports contain counts and at most three one-line, redacted snippets per rule (none for security rules, none at all with --no-snippets); --json shows exactly what would be sent. When uploading, the scan also tests your organization's own rules that have checks, drafts included, so you see their impact before publishing them.
groundrule check --upload sends the result to your organization as a compliance record (RFC 0007): which rules were in effect (as a digest anyone with the same rules can recompute), each rule's version, rollout stage and whether it could fail the change, the exceptions that applied, and which coding agents the change's commits declare, from Co-Authored-By trailers and bot authors (counts only; never commit messages or email addresses). Agent counts are a declaration, not proof; leave them out with --no-authorship.
With a signing key in CI (groundrule keys generate, then the private key as GROUNDRULE_SIGNING_KEY), every uploaded run is signed with Ed25519 (RFC 0008); groundrule verify proves later, offline, that a run wasn't altered. The signature covers everything but code snippets. In GitHub Actions, --sigstore signs with the job's own identity instead of a key (RFC 0009, needs id-token: write; opt-in, since the identity and the result's hash go to Sigstore's public log).
What each command takes from the platform depends on the rule's rollout stage: sync writes rules at Teach, Advise, and Enforce into your agent files; check runs Enforce rules as set and Advise rules as warnings. Rules your repository defines in .groundrule/standards/ still apply. In CI, set GROUNDRULE_TOKEN to a token from Settings → API tokens. Sign-ins are saved in ~/.config/groundrule/credentials.json, readable only by you.
Coding agents (MCP)
groundrule mcp is a Model Context Protocol server (stdio) with four tools:
list_standards: the rules in effect in the repository, so the agent follows them. Works offline.rules_for: the rules that name the files the agent is about to change (by path or language), blocking first, with how to comply (ADR 0010). The server's instructions tell the agent to call it before editing a file; rules that apply everywhere stay in the agent file. Works offline.check: the same check CI runs, on the agent's uncommitted changes (or since abaseref, orallfiles). It lists only what the change introduced, with where and how to fix it, so the agent fixes it before it finishes. Works offline. In a repository connected to its workspace, the counts per rule are reported to the workspace (see below).propose_rule: when you correct your agent and say (or agree) that it should apply to everyone, it proposes the rule to your organization's review inbox, with where it came up. Nothing changes until a reviewer accepts it. Needs a connected repository andgroundrule login.
Add it to your agent once per repository or user:
claude mcp add groundrule -- npx -y @groundrule/cli mcp # Claude Code
{ "mcpServers": { "groundrule": { "command": "npx", "args": ["-y", "@groundrule/cli", "mcp"] } } }
The JSON form goes in .cursor/mcp.json for Cursor, .vscode/mcp.json for VS Code (as servers), or your agent's MCP settings. Proposals carry the rule, your reason, and a file and line if given; nothing else from the repository is sent.
Hooks: before each action, and when the agent finishes
groundrule hooks adds two hooks to the agent's project settings. A before-tool hook decides what the agent is about to do against your action policies, and a stop hook runs the check every time the agent finishes a task, whether or not it remembered to:
npx @groundrule/cli hooks # Claude Code, plus Codex, Cursor and Copilot if the repository uses them
| Agent | File | Before an action | When the check fails |
|---|---|---|---|
| Claude Code | .claude/settings.json | allow, ask or deny, with the reason; the rules for a file ride along before an edit (ADR 0010) | The agent is stopped from finishing and told what to fix |
| Codex | .codex/hooks.json | allow or deny (ask is delivered as deny, with the reason); each developer trusts the hooks once with /hooks | The same |
| Cursor | .cursor/hooks.json | shell commands, MCP calls and file reads (ask on a read is deny) | What to fix is sent as a follow-up message |
| Copilot (CLI and cloud agent) | .github/hooks/groundrule.json | allow, ask or deny (the cloud agent treats ask as deny) | The agent takes another turn with what to fix |
Existing settings and hooks are kept. Without an action policy the before-tool hook answers nothing, and without a Groundrule configuration neither hook does anything. The stop hook asks once per turn, so an agent that can't fix something isn't kept going forever. Commit the files so every developer's agent runs them; --remove takes the hooks out again.
What agents may do (action policies)
A standard says what the code must be. An action policy (RFC 0017) says what the agent may *do*: which shell commands, edits, reads, fetches and MCP calls it may run on its own (allow), which a person confirms first (ask, the default), and which are refused (deny). It lives next to your standards, with the same identity, scope, owner, exceptions and rollout stages:
apiVersion: groundrule.dev/v1alpha1
kind: ActionPolicy metadata: id: ACT-001 title: Never force-push spec: severity: blocker effect: deny requirement: Never force