grab

grab is a cursor rule for Cursor from vahiiiid/go-rest-api-boilerplate. It costs 1,787 tokens per session, scanned A, original, MIT.

A set of development rules for GRAB, a Go REST API starter project, covering code structure, Docker-based commands, database migrations, and version checks.

In plain words
What is it for?
Use it when building or maintaining GRAB APIs, including handlers, services, repositories, migrations, tests, linting, and generated API documentation.
Why use it?
It gives developers consistent conventions for organising API code and running common development tasks.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions AGENTS.md.

Good fit Use it when building or maintaining GRAB APIs, including handlers, services, repositories…

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/vahiiiid/go-rest-api-boilerplate/grab
Install

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.

Clone the repo
git clone --depth 1 https://github.com/vahiiiid/go-rest-api-boilerplate

Made for: Cursor.

Wrote 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.

agentmods badge for grab

README.md
[![agentmods](https://agentmods.dev/badge/rules/vahiiiid/go-rest-api-boilerplate/grab.svg)](https://agentmods.dev/rules/vahiiiid/go-rest-api-boilerplate/grab)
Your own site
<a href="https://agentmods.dev/rules/vahiiiid/go-rest-api-boilerplate/grab"><img src="https://agentmods.dev/badge/rules/vahiiiid/go-rest-api-boilerplate/grab.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,787 This file is loaded in full into every session.
When invoked 1,787 The same file — it is already loaded in full.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.01787 $0.01787
Opus 5 $0.00894 $0.00894
Sonnet 5 $0.00357 $0.00357
Haiku 4.5 $0.00179 $0.00179

Measured 7d ago against content hash 1c40ea89601e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

grab scanned grade A with 1 finding 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 7d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

| Health check | `curl localhost:8080/health` |
.cursor/rules/grab.mdc · 281 lines

How it starts

The opening of the file, as written. The whole thing — 281 lines — stays where its author put it; the contents beside it link to each section on GitHub.

GRAB Development Rules for Cursor

Version: v2.0.0 Last Updated: 2025-12-10 Purpose: Developer guidelines for building APIs with GRAB (Go REST API Boilerplate)


Core Principles

1. Clean Architecture

Every domain follows: Handler → Service → Repository

  • No business logic in handlers
  • No HTTP concerns in services
  • Repository only talks to database

2. Docker-First Development

Developers run make on host, Makefile detects Docker and executes commands automatically:

make up          # Start containers
make test        # Run tests (in container if available)
make lint        # Run linting (in container if available)
make lint-fix    # Auto-fix linting issues
make swag        # Generate Swagger docs

3. Migration Naming Pattern

Format: YYYYMMDDHHMMSS_verb_noun_table

Examples:

  • 20251025225126_create_users_table
  • 20251028000000_create_refresh_tokens_table
  • 20251210120000_add_avatar_to_users_table

Commands:

make migrate-create NAME=create_todos_table
make migrate-up
make migrate-down
make migrate-status

4. Version Checking

Never hardcode versions. Show how to check:

go version                    # Check Go version
docker --version              # Check Docker
make exec-db                  # Enter DB container
psql --version                # Check PostgreSQL

Domain Structure

internal/<domain>/
├── model.go       # GORM models
├── dto.go         # API contracts (request/response)
├── repository.go  # Database layer
├── service.go     # Business logic
├── handler.go     # HTTP handlers (Gin)
└── *_test.go      # Tests

Example: See internal/user/ for complete reference implementation.


Adding New Entities

  1. Create directory: mkdir -p internal/<domain>
  2. Define model with GORM tags
  3. Create DTOs for request/response validation
  4. Implement repository interface and methods
  5. Implement service with business logic
  6. Create handler with Swagger annotations
  7. Generate migration: make migrate-create NAME=create_<table>_table
  8. Register routes in internal/server/router.go
  9. Write tests for all layers
  10. Run: make migrate-up && make test && make lint && make swag

Read the full file on GitHub · 281 lines

Changes

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.

  1. 7d ago First seen · 281 lines · 1,787 tokens per session scan A 1c40ea89601e

Subscribe to this mod's changes

grab is a cursor rule published in the GitHub repository vahiiiid/go-rest-api-boilerplate (65 stars, last pushed 20d ago), licensed MIT. It adds 1,787 tokens to every session, about $0.0089 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.