crud-dto

crud-dto is a skill for Claude Code, Codex from ArtisanCloud/PowerX. It costs 21 tokens per session (1,536 once invoked), scanned A, original, Apache-2.0.

PowerX CRUD DTO 规则(输入输出分离、分页、校验)。.

Skill for Claude CodeCodex

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 skills/artisancloud/powerx/dto
Any agent
npx skills add ArtisanCloud/PowerX --skill dto
Clone the repo
git clone --depth 1 https://github.com/ArtisanCloud/PowerX

Made for: Claude Code, Codex.

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 crud-dto

README.md
[![agentmods](https://agentmods.dev/badge/skills/artisancloud/powerx/dto.svg)](https://agentmods.dev/skills/artisancloud/powerx/dto)
Your own site
<a href="https://agentmods.dev/skills/artisancloud/powerx/dto"><img src="https://agentmods.dev/badge/skills/artisancloud/powerx/dto.svg" alt="Measured on agentmods" height="20"></a>
Per session 21 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,536 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00021 $0.01536
Opus 5 $0.00010 $0.00768
Sonnet 5 $0.00004 $0.00307
Haiku 4.5 $0.00002 $0.00154

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

Security

Grade A, and why

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

.codex/skills/crud/dto/SKILL.md · 171 lines

How it starts

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

PowerX CRUD DTO

步骤

  1. 打开 本文件内嵌规则
  2. 按规则执行实现/校对。
  3. 完成后按核对清单验收。

核对点

  • 与 PowerX 当前代码结构、路径与命名一致。
  • 仅在传输层/契约层做职责内改动,不跨层越界。

规则(内嵌)

dto.yaml

kind: ruleset
name: crud_dto
version: 1.0.0
owner: powerx
status: stable

meta:
  intent: >
    统一 DTO 目录、命名、字段与校验规则:DTO 与模型解耦;输入严格校验(binding/validate),
    输出统一信封(Response / ResponseList / PaginationResponse),并提供通用筛选/排序/搜索契约。
  references:
    - dev_crud_http_guides.md
    - constitution.md

scope:
  codebase:
    dto_globs:
      - "internal/transport/http/**/**/dto/*.go"
    handler_globs:
      - "internal/transport/http/**/**_handler.go"

principles:
  - DTO ≠ Model:DTO 不得包含 gorm tag/DB 逻辑;Model 不直接暴露给 HTTP 层。
  - 入参与出参分离:Create/Update 与 Get/List 各自独立结构。
  - 统一分页/筛选/排序:PaginationRequest、Filters、SortBy/SortOrder;输出 PaginationResponse。
  - 统一错误回包:错误由 Handler 使用统一桥接封装,无自定义裸写。

checks:
  - id: dto.no_gorm_tags
    level: error
    when: { glob: "internal/transport/http/**/**/dto/*.go" }
    assert:
      - must_not_contain: '`gorm:"'
  - id: dto.json_tags_required
    level: error
    when: { glob: "internal/transport/http/**/**/dto/*.go" }
    assert:
      - must_contain_regex: "`json:\"[a-zA-Z][a-zA-Z0-9]*\""
  - id: dto.has_validation_tags
    level: warn
    when: { glob: "internal/transport/http/**/**/dto/*_req.go" }
    assert:
      - should_contain_any: ["`binding:","`validate:"]
  - id: dto.pagination_exists
    level: error
    when: { glob: "internal/transport/http/**/**/dto/*.go" }
    assert:
      - must_define: "type PaginationRequest struct"
      - must_define: "type PaginationResponse struct"
  - id: handler.binds_dto
    level: error
    when: { glob: "internal/transport/http/**/**_handler.go" }
    assert:
      - must_call_one_of: ["ValidateRequestWithContext(", "ValidateAndBindWithContext("]
  - id: dto.separation
    level: warn
    when: { glob: "internal/transport/http/**/**/dto/*.go" }
    assert:
      - should_file_suffix_one_of: ["_req.go","_resp.go","_common.go"]

acceptance:
  checklist:
    - "[ ] DTO 不包含任何 gorm Tag / DB 细节"
    - "[ ] Create/Update/Get/List DTO 独立,字段含 json & 校验 tag"
    - "[ ] handler 使用统一绑定函数进行校验与上下文注入"
    - "[ ] 存在 PaginationRequest 与 PaginationResponse"
    - "[ ] 错误回包统一通过错误桥接函数完成"

templates:
  common_dto_go: |
    // internal/transport/http/{{layer}}/{{domain}}/dto/common_dto.go
    package dto

    type PaginationRequest struct {
      Page     int    `json:"page"      binding:"omitempty,min=1"`
      PageSize int    `json:"pageSize"  binding:"omitempty,min=1,max=200"`
      SortBy   string `json:"sortBy"    binding:"omitempty,oneof=createdAt updatedAt id"`
      SortOrder string `json:"sortOrder" binding:"omitempty,oneof=asc desc"`
      Q        string `json:"q"         binding:"omitempty"`
      // 通用过滤:filters[field]=op:value → 在 handler/service 解析
      Filters map[string]string `json:"filters" binding:"omitempty"`
    }

    type PaginationResponse struct {
      Total    int64 `json:"total"`
      Page     int   `json:"page"`
      PageSize int   `json:"pageSize"`
      Pages    int   `json:"pages"`
    }

    type ResponseSuccess struct {
      OK bool `json:"ok"`
    }

    type ResponseList[T any] struct {
      Items      []T                `json:"items"`
      Pagination PaginationResponse `json:"pagination"`
    }
  entity_req_resp_go: |
    // internal/transport/http/{{layer}}/{{domain}}/dto/{{resource}}_req_resp.go
    package dto

    // Create
    type {{Entity}}CreateReq struct {
      Name   string            `json:"name"   binding:"required,min=1,max=128"`
      Code   string            `json:"code"   binding:"required,alphanum,max=64"`
      Meta   map[string]any    `json:"meta"   binding:"omitempty"`
      Status *int16            `json:"status" binding:"omitempty,oneof=0 1"`
    }

    // Update
    type {{Entity}}UpdateReq struct {
      ID     string            `json:"id"     binding:"required,ulid|uuid4"`
      Name   *string           `json:"name"   binding:"omitempty,max=128"`
      Meta   map[string]any    `json:"meta"   binding:"omitempty"`
      Status *int16            `json:"status" binding:"omitempty,oneof=0 1"`
      // 幂等/并发(可选)
      IfMatch *string          `json:"ifMatch" binding:"omitempty"`
    }

    // Get
    type {{Entity}}GetReq struct {
      ID string `json:"id" binding:"required,ulid|uuid4"`
    }

    // Delete
    type {{Entity}}DeleteReq struct {
      ID    string `json:"id" binding:"required,ulid|uuid4"`
      Force bool   `json:"force" binding:"omitempty"`
    }

    // List
    type {{Entity}}ListReq struct {
      PaginationRequest
    }

  bind_helpers_go: |
    // internal/transport/http/{{layer}}/{{domain}}/dto/bind_helpers.go
    package dto

    import "github.com/gin-gonic/gin"

    // 仅示例:项目内已有 ValidateRequestWithContext/ValidateAndBindWithContext 则无需重复
    func Bind[T any](c *gin.Context, v *T) error {
      return c.ShouldBind(v)
    }

Read the full file on GitHub · 171 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 · 171 lines · 21 tokens per session scan A 333f456e99bd

Subscribe to this mod's changes

crud-dto is a skill published in the GitHub repository ArtisanCloud/PowerX (364 stars, last pushed 3d ago), licensed Apache-2.0. It adds 21 tokens to every session and 1,536 once invoked, about $0.0001 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-04.

Related

Other skills, from other repositories

scalar-docs

Skill for writing and updating scalar.config.json — Scalar Docs configuration reference for users and LLMs.

scalar/scalar · 24 tokens

openapi-glossary

Use consistent OpenAPI terminology and definitions when writing documentation, educational material, and tooling guidance.

scalar/scalar · 24 tokens

wxjava-api-contributor

按 WxJava 的 Maven 多模块、Java 8、公共 API 兼容性和 TestNG 约定,为微信官方接口新增或维护 SDK 支持。适用于新增 Service API、请求响应 Bean、序列化、HTTP 实现、Starter 配置或回归测试时。.

binarywang/WxJava · 68 tokens

datamodel-code-generator

Use this skill when the user wants Python data models, Pydantic models, dataclasses, TypedDicts, msgspec structs, or type-safe Python classes generated from OpenAPI, AsyncAPI, JSON Schema, GraphQL, JSON/YAML/CSV sample data, MCP tool schemas, Protocol Buffers, XML Schema, Apache Avro, or existing Python model objects.…

koxudaxi/datamodel-code-generator · 147 tokens

langbot-deploy

Deploy and configure a LangBot instance — Docker / Docker Compose, Kubernetes, the config.yaml model, the Box sandbox runtime, the plugin runtime, and the global API key. Use when installing, deploying, upgrading, or configuring LangBot in production or self-hosted environments. Triggers on "deploy langbot", "langbot…

langbot-app/LangBot · 104 tokens

om-auto-sec-report-pr

Paranoid OWASP-oriented security analysis for a SINGLE unit of work — one PR, one spec under .ai/specs/, or one branch diff. Hunts non-obvious attack vectors beyond OWASP Top 10, flags same-pattern hotspots elsewhere, and emits "Next steps — go deeper" follow-ups. Writes markdown + HTML under .ai/analysis/; runs…

open-mercato/open-mercato · 93 tokens