PowerX: Skill for Codex

.codex/skills/crud/dto/SKILL.md

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

A set of PowerX rules for data-transfer objects, or DTOs: structures used to receive and return API data. It separates API input and output from database models and defines validation, pagination, filtering, sorting, and error-response conventions.

In plain words
What is it for?
Use it when designing or checking HTTP DTO files, create and update inputs, list responses, pagination, filters, sorting, JSON fields, and validation.
Why use it?
It prevents database models from being exposed directly through HTTP and makes API data shapes and validation more consistent.

Skill for Codex

Written for Codex: installed under .codex/.

This is ArtisanCloud/PowerX's own configuration. It tells Codex how to work on PowerX itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything PowerX configures →

Reuse

Borrowing it

Nothing to install: this file belongs to ArtisanCloud/PowerX. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/ArtisanCloud/PowerX/release/v1.0.0/.codex/skills/crud/dto/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/ArtisanCloud/PowerX

Made for: 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/github.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/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 crud-dto

Your own site · 80×15
<a href="https://agentmods.dev/skills/artisancloud/powerx/dto"><img src="https://agentmods.dev/badge/skills/artisancloud/powerx/dto.svg" alt="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00021 $0.01536
Opus 5.5 $0.00008 $0.00614
Sonnet 5.5 $0.00004 $0.00307
Haiku 4.5 $0.00002 $0.00154

Measured 1mo ago against content hash 333f456e99bd, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.

.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. 1mo ago 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 (382 stars, last pushed 2d 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.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

fastapi

FastAPI best practices and conventions. Use when working with FastAPI APIs, Pydantic models, dependencies, streaming responses including Server-Sent Events (SSE), and serving frontend apps. Keeps FastAPI code clean and up to date with the latest features and patterns.

fastapi/fastapi · 57 tokens

langbot-eba-adapter-dev

Build, refactor, and test LangBot platform adapters for the Event-Based Agents architecture. Use when adding or migrating Telegram, Discord, or other messaging platform adapters to the EBA adapter layout, validating unified event/message conversion, writing live adapter probes, or using standalone plugin runtime plus…

langbot-app/LangBot · 73 tokens

langbot-dev

Develop, build, and debug the LangBot core backend and web frontend. Use when working inside the LangBot repository — backend (Python/Quart, src/langbot/pkg), the Vite/React web UI, HTTP API controllers/services, Alembic migrations, or the MCP server. Covers the dev environment (uv, pnpm), repo layout, the API auth…

langbot-app/LangBot · 136 tokens

wxjava-module-selector

A decision guide for choosing the correct WxJava Maven module, dependency management file, and example for a WeChat use case. WxJava is a Java software development kit for services such as official accounts, mini programs, and payments.

binarywang/WxJava · 86 tokens

wxjava-api-contributor

A contributor guide for adding or maintaining official WeChat API support in WxJava, a Java software development kit. It covers services, request and response data objects, data conversion, HTTP handling, starter configuration, and regression tests.

binarywang/WxJava · 68 tokens

wxjava-integration-guide

A setup guide for connecting Java, Spring Boot, or Solon applications to WxJava, a Java software development kit for WeChat services. It covers choosing modules, adding dependencies, configuring accounts, and making an initial API call.

binarywang/WxJava · 72 tokens