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/adonai-labs/agent-runway/gogit clone --depth 1 https://github.com/adonai-labs/agent-runwayWrote 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/adonai-labs/agent-runway/go)<a href="https://agentmods.dev/rules/adonai-labs/agent-runway/go"><img src="https://agentmods.dev/badge/rules/adonai-labs/agent-runway/go.svg" alt="Measured on agentmods" 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 | $0.00000 | $0.00580 |
| Opus 5 | $0.00000 | $0.00290 |
| Sonnet 5 | $0.00000 | $0.00116 |
| Haiku 4.5 | $0.00000 | $0.00058 |
Grade A, and why
go 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 — 58 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Go Development Guidelines
Directives for Go development. Apply when working with .go files or go.mod.
Error Handling
- Return errors as the last return value; check every error — do not discard with
_unless justified. - Wrap errors with context using
fmt.Errorf("...: %w", err)so callers canerrors.Is/errors.As. - Do not
panicfor expected failures; reservepanicfor truly unrecoverable states. - Define sentinel errors (
var ErrNotFound = errors.New(...)) or typed errors for conditions callers branch on.
Concurrency
- Pass
context.Contextas the first parameter to functions that do I/O or can block; honour cancellation. - Never start a goroutine without a clear stop/lifecycle; avoid goroutine leaks.
- Protect shared state with a mutex or a channel — not both for the same data.
- Run tests with
-race; data races are bugs even if they don't fail today. - Do not capture loop variables by reference in goroutines without copying (pre-1.22 semantics).
Interfaces and API Design
- Accept interfaces, return concrete types.
- Keep interfaces small — define them at the consumer, not the producer.
- Avoid empty
interface{}/anywhere a concrete type or generic would be clearer.
Idioms
- Prefer early returns over deep nesting; keep the happy path left-aligned.
- Use
deferfor cleanup (close files, unlock mutexes) right after acquisition. - Do not ignore the result of
Close()on writers where it can surface data loss. - Keep package names short, lower-case, and meaningful; avoid stutter (
http.HTTPServer).
Testing
- Use table-driven tests with subtests (
t.Run). - Use the standard
testingpackage; reserve external assertion libraries for genuine value. - Cover happy path, edge cases, and error paths.
- Use
t.Cleanupfor teardown; avoid global test state.
Common Anti-patterns
| Anti-pattern | Do instead |
|---|---|
Ignoring returned errors (val, _ :=) |
Check and handle or wrap the error |
panic for expected failures |
Return an error |
| Goroutine with no cancellation/stop | Pass context.Context and select on ctx.Done() |
| Naked returns in long functions | Return values explicitly |
| Logging and returning the same error | Do one or the other, not both |
interface{}/any everywhere |
Use concrete types or generics |
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 · 58 lines · 0 tokens per session scan A 6c7cdada6248
go is a cursor rule published in the GitHub repository adonai-labs/agent-runway (2 stars, last pushed 14d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 580 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-09-03.
Other cursor rules, from other repositories
go
Idiomatic Go rules. Explicit error handling, interface-based design, context-first concurrency.
go-backend-scalability-cursorrules-prompt-file
Cursor rules for Go development with backend scalability.
jest-unit-testing-cursorrules-prompt-file
Cursor rules for Jest development with unit testing.
go-servemux-rest-api-cursorrules-prompt-file
Cursor rules for Go development with ServeMux REST API integration.
python-cursorrules-prompt-file-best-practices
Cursor rules for Python development with best practices integration.
go-temporal-dsl-prompt-file
Cursor rules for Go development with Temporal DSL integration.