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/dstotijn/mcp-origin/go-project-structuregit clone --depth 1 https://github.com/dstotijn/mcp-originWhat 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.00520 | $0.00520 |
| Opus 5 | $0.00260 | $0.00260 |
| Sonnet 5 | $0.00104 | $0.00104 |
| Haiku 4.5 | $0.00052 | $0.00052 |
Grade A, and why
go-project-structure 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 2d 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.
This is a copy
100% identical to go-project-structure — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 85 lines — stays where its author put it; the contents beside it link to each section on GitHub.
description: Go Project Structure Rules globs: *.go
Description
This rule ensures that Go projects follow a consistent and idiomatic structure, making the codebase easier to navigate, maintain, and scale.
Rule
When organizing a Go project:
Package Organization
- Organize packages by functionality, not by type
- Keep package names short, clear, and descriptive
- Avoid package name collisions with standard library
- Use singular form for package names (e.g.,
store, notstores) - Avoid deeply nested package hierarchies
Dependency Management
- Use Go modules for dependency management
- Pin dependencies to specific versions in go.mod
- Regularly update and audit dependencies
- Minimize the number of external dependencies
- Prefer standard library solutions when available
Configuration
- Use environment variables for configuration
- Support configuration files as an alternative
- Provide sensible defaults for all configuration options
- Validate configuration at startup
Testing
- Place tests in the same package as the code they test
- Use
_test.gosuffix for test files - Place integration tests in a separate
integrationpackage - Store test fixtures in
testdatadirectories
Implementation
- The Cursor IDE will enforce this rule by:
- Suggesting appropriate locations for new files
- Highlighting structural issues
- Providing refactoring options to improve project organization
Benefits
- Consistent, navigable project structure
- Clear separation of concerns
- Better code reusability
- Easier onboarding for new team members
- Alignment with Go community standards
Examples
✅ Correct Project Structure:
myproject/
├── cmd/
│ └── myapp/
│ └── main.go
├── internal/
│ ├── auth/
│ │ └── auth.go
│ └── database/
│ └── database.go
├── pkg/
│ └── validator/
│ └── validator.go
├── api/
│ └── openapi.yaml
├── configs/
│ └── config.yaml
├── scripts/
│ └── setup.sh
└── go.mod
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.
- 2d ago First seen · 85 lines · 520 tokens per session scan A 2c406ea6ff84
go-project-structure is a cursor rule published in the GitHub repository dstotijn/mcp-origin (5 stars, last pushed 1y ago), licensed Apache-2.0. It adds 520 tokens to every session, about $0.0026 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to go-project-structure, differing in 0 lines, and is treated as a copy.
Other cursor rules, from other repositories
cursor-go-skills
Load the Go skills orchestrator before any Go task.
backend
You are an expert in Go, Gin, Gorm, Gen, Cosy (https://cosy.uozi.org/) with a deep understanding of best practices and performance optimization techniques in these technologies.
code-style
Formatting, lint, comments language.
shared-libraries
Shared libraries - condition framework, inventory containers, file-backed DB, itinerary, references.
go-conventions
Go conventions for all Go code (modules, naming, errors, logging, metrics).
unit-test-coverage-95
Unit test coverage ≥95% per Go package (binding rule).