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.
npx agentmods add rules/xyzbit/ai-coding/g-code-specgit clone --depth 1 https://github.com/xyzbit/AI-CodingWhat 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 | $0.00000 | $0.01101 |
| Opus 5 | $0.00000 | $0.00550 |
| Sonnet 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 yesterday.
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.
- yesterday 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 10mo 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.
Other cursor rules, from other repositories
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
typescript
Changes to these high-fan-out internals can affect every message, delta, element, or rerun. Keep work in them minimal, and benchmark changes with representative stress-test apps.
coolify-ai-docs
Master reference to all Coolify AI documentation in .ai/ directory.
python_lib
Tips and guidelines specific to the development of the Streamlit Python library, not applicable to scripts and e2e tests.
specs
This directory contains product and tech specs for Streamlit features.