cursor_rules

cursor_rules is a cursor rule for Cursor from parvez3019/go-swagger3. It costs 0 tokens per session (3,386 once invoked), scanned A, original, MIT.

A set of Cursor editor rules for documenting existing Go HTTP APIs with comments and generating OpenAPI 3 specifications. OpenAPI is a machine-readable description of an API’s endpoints, inputs, and outputs.

In plain words
What is it for?
Use it to add documentation comments and data tags to Go handlers and structures, then generate an OpenAPI file with the go-swagger3 tool.
Why use it?
It gives the coding agent a defined process for adding API documentation without rewriting request handlers. The resulting specification can describe how other programs should call the service.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is --module-path . --main-file-path ./cmd/api/main.go --output oas.json --schema-without-pkg.

Good fit Use it to add documentation comments and data tags to Go handlers and structures, then generate an OpenAPI file with the go-swagger3 tool.

Compare 6 cursor rules from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/parvez3019/go-swagger3
agentmods
npx agentmods add rules/parvez3019/go-swagger3/cursor_rules

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 cursor_rules

README.md
[![agentmods](https://agentmods.dev/badge/rules/parvez3019/go-swagger3/cursor_rules/github.svg)](https://agentmods.dev/rules/parvez3019/go-swagger3/cursor_rules)
Your own site
<a href="https://agentmods.dev/rules/parvez3019/go-swagger3/cursor_rules"><img src="https://agentmods.dev/badge/rules/parvez3019/go-swagger3/cursor_rules/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cursor_rules

Your own site · 80×15
<a href="https://agentmods.dev/rules/parvez3019/go-swagger3/cursor_rules"><img src="https://agentmods.dev/badge/rules/parvez3019/go-swagger3/cursor_rules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 3,386 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00000 $0.03386
Opus 5.5 $0.00000 $0.01354
Sonnet 5.5 $0.00000 $0.00677
Haiku 4.5 $0.00000 $0.00339

Measured 3mo ago against content hash 70de9abc843c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cursor_rules 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 3mo 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.

agent-skills/cursor/cursor_rules.mdc · 345 lines

How it starts

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

go-swagger3 — document existing Go APIs

Copy this file into your project as .cursor/rules/go-swagger3.mdc.

When the user asks to document an API, add Swagger/OpenAPI comments, or generate an OAS file: annotate existing Go code with go-swagger3 godoc @ tags and struct tags, then run the CLI. Prefer editing comments and tags over rewriting handlers.

Install

go install github.com/parvez3019/go-swagger3@latest
export PATH="$HOME/go/bin:$PATH"

# Docker alternative
docker run -t --rm -v $(pwd):/app -w /app parvez3019/go-swagger3:latest \
  --module-path . --main-file-path ./cmd/api/main.go --output oas.json --schema-without-pkg

Workflow

  1. Confirm go.mod exists (Go modules only).
  2. Put service annotations on the main/entry file (@Title and @Version required).
  3. Annotate each HTTP handler’s godoc (comments must sit directly above the func).
  4. Add json + OAS tags on request/response structs; add @Enum / @HeaderParameters types when needed.
  5. Generate (pick the matching layout):
    # main next to go.mod
    go-swagger3 --module-path . --output oas.json --schema-without-pkg
    
    # main elsewhere
    go-swagger3 --module-path . --main-file-path ./cmd/api/main.go --output oas.json --schema-without-pkg
    
    # only scan handlers under a path
    go-swagger3 --module-path . --main-file-path ./cmd/api/main.go --handler-path ./internal/handlers --output oas.json --schema-without-pkg
    
    # YAML
    go-swagger3 --module-path . --main-file-path ./cmd/api/main.go --output oas.json --schema-without-pkg --generate-yaml
    
  6. Open the output, fix gaps, re-run with --debug if needed. Use --strict when hardening.

CLI flags

Flag Purpose
--module-path Module root to scan
--main-file-path File with service-level annotations
--handler-path Optional: only scan handlers under this path
--output Output path (default oas.json)
--schema-without-pkg Schema names without package prefix
--generate-yaml Emit YAML (.json output becomes .yml)
--exclude Comma-separated dirs to skip
--quiet Reduce log noise
--debug Debug logging
--strict Treat parse warnings as fatal

Read the full file on GitHub · 345 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. 3mo ago First seen · 345 lines · 0 tokens per session scan A 70de9abc843c

Subscribe to this mod's changes

cursor_rules is a cursor rule published in the GitHub repository parvez3019/go-swagger3 (154 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,386 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.

Related

cursor_rules compared with cursor rules from other repositories

cursor_rules next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cursor_rulesparvez3019/go-swagger3Cursor rule1542d agoMITA0Cursor
backend0xJacky/nginx-uiCursor rule12ktodayAGPL-3.0A441Cursor
kotlin-springboot-rulesholtwood/awesome-cursorrules-zhCursor rule2441mo agoMITA0Cursor
fastapi-file-structureholtwood/awesome-cursorrules-zhCursor rule2441mo agoMITA4Cursor
fastapi-dependency-injectionholtwood/awesome-cursorrules-zhCursor rule2441mo agoMITA7Cursor
graphql-apollo-client-usageholtwood/awesome-cursorrules-zhCursor rule2441mo agoMITA0Cursor
springboot-jpa-best-practicesholtwood/awesome-cursorrules-zhCursor rule2441mo agoMITA0Cursor