Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/xyzbit/AI-CodingWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/xyzbit/ai-coding/g-code-spec)<a href="https://agentmods.dev/rules/xyzbit/ai-coding/g-code-spec"><img src="https://agentmods.dev/badge/rules/xyzbit/ai-coding/g-code-spec/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/xyzbit/ai-coding/g-code-spec"><img src="https://agentmods.dev/badge/rules/xyzbit/ai-coding/g-code-spec.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.01101 |
| Opus 5.5 | $0.00000 | $0.00440 |
| Sonnet 5.5 | $0.00000 | $0.00220 |
| Haiku 4.5 | $0.00000 | $0.00110 |
Grade A, and why
g-code-spec scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 230 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Golang Cursor Rules
你是一位遵循 Uber Go 编码规范的 Golang 专家。在生成和修改代码时必须遵循以下规范:
代码格式
- 行长度控制
// 不要超过 120 个字符
// Bad
func (r *SomeType) SomeLongFunctionName(someArg1 Type1, someArg2 Type2, someArg3 Type3, someArg4 Type4, someArg5 Type5) (Type6, error) {
// ...
}
// Good
func (r *SomeType) SomeLongFunctionName(
someArg1 Type1,
someArg2 Type2,
someArg3 Type3,
someArg4 Type4,
someArg5 Type5,
) (Type6, error) {
// ...
}
- 声明分组
// Good
const (
defaultPort = 8080
defaultUser = "user"
)
var (
errInvalidUser = errors.New("invalid user")
errInvalidPort = errors.New("invalid port")
)
- import 分组
// Good
import (
// 标准库
"fmt"
"net/http"
// 外部库
"github.com/pkg/errors"
"go.uber.org/zap"
// 内部包
"yourproject/internal/auth"
)
命名规范
- 包名
// Bad
package authService
// Good
package auth
- 接口命名
// Good - 单方法接口以方法名+er结尾
type Reader interface {
Read(p []byte) (n int, err error)
}
// Good - 双方法接口可以组合两个名词
type ReadWriter interface {
Reader
Writer
}
- 变量命名
// Bad
var UserMap map[string]*User
// Good
var usersByID map[string]*User
// Bad
const TTL = 60
// Good
const timeToLive = 60
编程范式
- 接口处理
// Bad - 指针接收器
type Handler struct{}
func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {}
// Good - 值接收器
type Handler struct{}
func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {}
- 错误处理
// Bad
if err != nil {
log.Fatal(err)
}
// Good
if err != nil {
return fmt.Errorf("failed to process request: %w", err)
}
- 避免使用 init()
// Bad
func init() {
db.Connect()
}
// Good
func main() {
if err := db.Connect(); err != nil {
log.Fatal(err)
}
}
并发处理
- goroutine 管理
// Bad - fire and forget
go process()
// Good - 使用 WaitGroup
var wg sync.WaitGroup
wg.Add(1)
go func() {
defer wg.Done()
process()
}()
wg.Wait()
- channel 使用
// Bad - 使用带缓冲的 channel
ch := make(chan int, 10)
// Good - 无缓冲 channel 或缓冲大小为 1
ch := make(chan int)
ch := make(chan int, 1)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3mo ago First seen · 230 lines · 1,101 tokens per session scan A faadb15d9ee3
g-code-spec is a cursor rule published in the GitHub repository xyzbit/AI-Coding (21 stars, last pushed 1y ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,101 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
g-code-spec compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| g-code-specxyzbit/AI-Coding | Cursor rule | 21 | 1y ago | Apache-2.0 | A | 0 | Cursor |
| gonavi-goSyngnat/GoNavi | Cursor rule | 2.1k | yesterday | Apache-2.0 | A | 0 | Cursor |
| backend0xJacky/nginx-ui | Cursor rule | 12k | today | AGPL-3.0 | A | 441 | Cursor |
| code-stylecoddy-project/coddy-agent | Cursor rule | 215 | today | MIT | A | 366 | Cursor |
| gosupertokens/create-supertokens-app | Cursor rule | 24 | 6d ago | Apache-2.0 | A | 0 | Cursor |
| go-stdlib-firsttacoda/keystone | Cursor rule | 44 | 4d ago | MIT | A | 0 | Cursor |
| gozapstore/zsp | Cursor rule | 20 | 5d ago | MIT | A | 0 | Cursor |