dto

dto is a cursor rule for Cursor from hiromaily/go-crypto-wallet. It costs 0 tokens per session (1,369 once invoked), scanned A, original, MIT.

A set of rules for defining data structures at the correct boundaries of a Go application. It distinguishes user-facing input, application data, database or API wire data, and domain business objects.

In plain words
What is it for?
Use it when adding request and response types, database records, API payloads, or application interfaces in a Clean Architecture project. It explains where each type belongs and when to convert it.
Why use it?
It prevents database models and API-specific structures from spreading through the whole codebase. Conversion happens at clear boundaries, so one layer can change without forcing changes everywhere else.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when adding request and response types, database records, API payloads, or application interfaces in a Clean Architecture project. It explains where each type belongs and when to convert it.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/hiromaily/go-crypto-wallet/dto
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/hiromaily/go-crypto-wallet

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 dto

README.md
[![agentmods](https://agentmods.dev/badge/rules/hiromaily/go-crypto-wallet/dto.svg)](https://agentmods.dev/rules/hiromaily/go-crypto-wallet/dto)
Your own site
<a href="https://agentmods.dev/rules/hiromaily/go-crypto-wallet/dto"><img src="https://agentmods.dev/badge/rules/hiromaily/go-crypto-wallet/dto.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,369 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.01369
Opus 5 $0.00000 $0.00685
Sonnet 5 $0.00000 $0.00274
Haiku 4.5 $0.00000 $0.00137

Measured 4d ago against content hash 16696852dfea, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

dto 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 4d 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.

.cursor/rules/internal/dto.mdc · 158 lines

How it starts

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

DTO and Data Definition Placement Rules

Overview

Rules for where to define data types (DTOs, wire types, presentation types) and where to place conversion logic in the Clean Architecture layers of internal/.

Layer Summary

Interface Adapters  → defines: presentation input/output types (CLI args, HTTP body, gRPC message)
                      converts: presentation → application DTO before calling use case

Application Layer   → defines: canonical cross-boundary DTOs (internal/application/dto/)
                      port interfaces use ONLY these types in their signatures

Infrastructure      → defines: internal wire/DB types (JSON-tagged structs, ORM models)
                      converts: wire types ↔ application DTOs at the boundary

Domain Layer        → defines: domain entities, value objects (with business logic — NOT DTOs)
                      no conversion, no DTOs

Rules

1. Application DTOs Are the Canonical Cross-Boundary Types

All types used in application/ports/ interface signatures MUST be defined in internal/application/dto/. Infrastructure types MUST NOT appear in port interface signatures.

// ✅ GOOD: port interface uses application DTO
// internal/application/ports/api/xrp/interface.go
type TransactionPreparer interface {
    CreateRawTransaction(
        ctx context.Context,
        senderAccount, receiverAccount string,
        amount float64,
        instructions *dtoxrp.Instructions,  // application DTO
    ) (*dtoxrp.TxInput, string, error)       // application DTO
}

// ❌ BAD: port interface returns an infrastructure package type
type KeyGenerator interface {
    WalletPropose(ctx context.Context, passphrase string) (*xrprpcadmin.ResponseWalletPropose, error)
    //                                                      ^^^^^^^^^ infrastructure type in port
}

2. Infrastructure Defines Wire Types Locally, Converts at the Boundary

Infrastructure packages may define their own internal types optimised for wire format (JSON tags, protocol buffer fields, etc.). These must be converted to/from application DTOs before crossing the boundary.

Read the full file on GitHub · 158 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. 4d ago First seen · 158 lines · 0 tokens per session scan A 16696852dfea

Subscribe to this mod's changes

dto is a cursor rule published in the GitHub repository hiromaily/go-crypto-wallet (127 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,369 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.