crud-test

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

PowerX CRUD 测试规则(Service 必测、Repo 可选集测)。.

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/test
Any agent
npx skills add ArtisanCloud/PowerX --skill test
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-test

README.md
[![agentmods](https://agentmods.dev/badge/skills/artisancloud/powerx/test.svg)](https://agentmods.dev/skills/artisancloud/powerx/test)
Your own site
<a href="https://agentmods.dev/skills/artisancloud/powerx/test"><img src="https://agentmods.dev/badge/skills/artisancloud/powerx/test.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,243 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.01243
Opus 5 $0.00010 $0.00622
Sonnet 5 $0.00004 $0.00249
Haiku 4.5 $0.00002 $0.00124

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

Security

Grade A, and why

crud-test 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/test/SKILL.md · 155 lines

How it starts

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

PowerX CRUD Test

步骤

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

核对点

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

规则(内嵌)

test.yaml


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

meta:
  intent: >
    要求 CRUD 关键层有最小可用测试覆盖:Service 单元测试必须存在;
    可选提供 Repository 的集成测试(sqlite/pg 临时库)。
  references:
    - crud_service.yaml
    - crud_repository.yaml

scope:
  applies_to:
    - "internal/service/**/**_service_test.go"
    - "internal/repository/**/**_repo_test.go"

principles:
  - Service 层单测为必选:mock Repo,覆盖 404/409/成功分支与事务失败。
  - Repository 可选集测:使用临时 DB(prefer sqlite-in-memory 或 testcontainer PG)。
  - 测试不依赖传输层(无 gin/grpc 依赖)。

checks:

  # Service 单测存在
  - id: service.tests.exist
    level: error
    when: { glob: "internal/service/**/**_service.go" }
    assert:
      - must_have_companion_test: true

  # Service 测试基础要素
  - id: service.tests.shape
    level: warn
    when: { glob: "internal/service/**/**_service_test.go" }
    assert:
      - must_import: ["testing"]
      - should_import_any: ["github.com/stretchr/testify/assert","github.com/stretchr/testify/require"]
      - must_not_import: ["github.com/gin-gonic/gin","google.golang.org/grpc"]

  # Repository 集测(可选,存在则建议约束)
  - id: repo.tests.optional
    level: warn
    when: { glob: "internal/repository/**/**_repo_test.go" }
    assert:
      - should_import_any: ["gorm.io/driver/sqlite","github.com/testcontainers/testcontainers-go"]
      - should_contain_any: ["sqlite.Open(\"file::memory:?cache=shared\")","testcontainers"]

acceptance:
  checklist:
    - "[ ] 每个 Service 至少有一个 *_service_test.go 覆盖核心分支(404/409/成功/事务失败)"
    - "[ ] 测试不依赖 HTTP/gRPC 传输"
    - "[ ] 有基础断言库(testify)"
    - "[ ] (可选)Repository 集测基于临时 DB"

templates:
  service_test_go: |
    // internal/service/{{domain}}/{{resource}}_service_test.go
    package {{domain}}svc_test

    import (
      "context"
      "errors"
      "testing"

      "{{module_path}}/internal/app/shared"
      svc "{{module_path}}/internal/service/{{domain}}"
      repo "{{module_path}}/internal/repository/{{domain}}"
      "github.com/stretchr/testify/assert"
      "gorm.io/gorm"
    )

    // 伪造 Repo(可替换为 gomock)
    type fakeRepo struct {
      create func(ctx context.Context, db *gorm.DB, tenantID uint64, in any) error
      get    func(ctx context.Context, db *gorm.DB, tenantID uint64, id string) (any, error)
    }
    // 满足接口(示例,按你实际接口补全)
    // ...

    func Test_Get_NotFound(t *testing.T) {
      d := &shared.Deps{}
      fr := &fakeRepo{
        get: func(ctx context.Context, db *gorm.DB, tenantID uint64, id string) (any, error) {
          return nil, gorm.ErrRecordNotFound
        },
      }
      s := svc.New{{Entity}}Service(d, fr)
      _, err := s.Get(context.Background(), 1, "id-x")
      assert.Error(t, err)
      assert.Equal(t, svc.ErrNotFound, err)
    }

  repo_sqlite_test_go: |
    // internal/repository/{{domain}}/{{resource}}_repo_test.go
    package {{domain}}repo_test

    import (
      "context"
      "testing"

      "gorm.io/driver/sqlite"
      "gorm.io/gorm"
      repo "{{module_path}}/internal/repository/{{domain}}"
      m "{{module_path}}/pkg/corex/db/persistence/model/{{domain}}"
      "github.com/stretchr/testify/require"
    )

    func newDB(t *testing.T) *gorm.DB {
      db, err := gorm.Open(sqlite.Open("file::memory:?cache=shared"), &gorm.Config{})
      require.NoError(t, err)
      require.NoError(t, db.AutoMigrate(&m.{{Entity}}{}))
      return db
    }

    func Test_Create_And_Get(t *testing.T) {
      db := newDB(t)
      r := repo.New{{Entity}}Repo(db)
      ctx := context.Background()

      in := &m.{{Entity}}{TenantID: 1, Name: "n"}
      require.NoError(t, r.Create(ctx, db, 1, in))

      got, err := r.GetByID(ctx, db, 1, in.ID)
      require.NoError(t, err)
      require.NotNil(t, got)
    }

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

Subscribe to this mod's changes

crud-test 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,243 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