skill-go-gin-api

skill-go-gin-api is a cursor rule for Cursor from dewtech-technologies/dare-method. It costs 2,435 tokens per session, scanned A, original, MIT.

Padrões DARE para APIs REST em Go + Gin (ou stdlib net/http) + sqlc + PostgreSQL. Handlers, services, repositories, middleware, validação via binding tags, JWT, rate limit, swag OpenAPI, testify + httptest.

Cursor rule for Cursor

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.

agentmods
npx agentmods add rules/dewtech-technologies/dare-method/skill-go-gin-api
Clone the repo
git clone --depth 1 https://github.com/dewtech-technologies/dare-method

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 skill-go-gin-api

README.md
[![agentmods](https://agentmods.dev/badge/rules/dewtech-technologies/dare-method/skill-go-gin-api.svg)](https://agentmods.dev/rules/dewtech-technologies/dare-method/skill-go-gin-api)
Your own site
<a href="https://agentmods.dev/rules/dewtech-technologies/dare-method/skill-go-gin-api"><img src="https://agentmods.dev/badge/rules/dewtech-technologies/dare-method/skill-go-gin-api.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,435 This file is loaded in full into every session.
When invoked 2,435 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin unknown 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 $0.02435 $0.02435
Opus 5 $0.01218 $0.01218
Sonnet 5 $0.00487 $0.00487
Haiku 4.5 $0.00244 $0.00244

Measured today against content hash 4e0ad981f0d7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

skill-go-gin-api 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 today.

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.

implementations/cursor/.cursor/rules/skill-go-gin-api.mdc · 372 lines

How it starts

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

Skill: Go/Gin API DARE

Você é um desenvolvedor sênior Go especialista em APIs REST. Esta skill garante código idiomático Go, com erros tipados, contexto sempre propagado, queries seguras via sqlc, seguindo Layered Design DARE.

Stack canônica

  • Go 1.22+ (slog, errors.Is/As, generics)
  • Gin (preferido) ou stdlib net/http (Go 1.22+ roteamento OK)
  • sqlc para queries seguras (gera código tipado de SQL)
  • pgx v5 como driver Postgres
  • go-playground/validator (via Gin binding tags)
  • golang-jwt/jwt v5
  • swaggo/swag para OpenAPI
  • testify + httptest
  • golangci-lint + govulncheck

Estrutura

.
├── cmd/server/main.go
├── internal/
│   ├── handlers/                ← Handler
│   ├── services/                ← Service
│   ├── repositories/            ← Repository
│   ├── domain/                  ← Models + erros sentinela
│   ├── middleware/              ← auth, logging, recovery
│   └── config/
├── db/
│   ├── migrations/              ← golang-migrate
│   └── queries/                 ← arquivos .sql para sqlc
├── sqlc.yaml
└── docs/                        ← gerado pelo swag

Handlers

package handlers

import (
    "errors"
    "net/http"
    "github.com/gin-gonic/gin"
    "myapp/internal/domain"
    "myapp/internal/services"
)

type UserHandler struct {
    register *services.RegisterUser
}

func NewUserHandler(r *services.RegisterUser) *UserHandler {
    return &UserHandler{register: r}
}

// @Summary Create user
// @Tags users
// @Accept json
// @Produce json
// @Param user body CreateUserDTO true "user payload"
// @Success 201 {object} UserResponse
// @Failure 409
// @Router /users [post]
func (h *UserHandler) Create(c *gin.Context) {
    var dto CreateUserDTO
    if err := c.ShouldBindJSON(&dto); err != nil {
        c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
        return
    }
    user, err := h.register.Execute(c.Request.Context(), dto.ToService())
    if err != nil {
        if errors.Is(err, domain.ErrUserAlreadyExists) {
            c.JSON(http.StatusConflict, gin.H{"error": "USER_EXISTS"})
            return
        }
        c.JSON(http.StatusInternalServerError, gin.H{"error": "INTERNAL"})
        return
    }
    c.JSON(http.StatusCreated, ToUserResponse(user))
}

Read the full file on GitHub · 372 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. today First seen · 372 lines · 2,435 tokens per session scan A 4e0ad981f0d7

Subscribe to this mod's changes

skill-go-gin-api is a cursor rule published in the GitHub repository dewtech-technologies/dare-method (5 stars, last pushed 1mo ago), licensed MIT. It adds 2,435 tokens to every session, about $0.0122 per session on Opus 5. 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.