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.
curl -O https://raw.githubusercontent.com/ArtisanCloud/PowerX/release/v1.0.0/.codex/skills/crud/di/SKILL.mdgit clone --depth 1 https://github.com/ArtisanCloud/PowerXWrote 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.
[](https://agentmods.dev/skills/artisancloud/powerx/di)<a href="https://agentmods.dev/skills/artisancloud/powerx/di"><img src="https://agentmods.dev/badge/skills/artisancloud/powerx/di/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.
<a href="https://agentmods.dev/skills/artisancloud/powerx/di"><img src="https://agentmods.dev/badge/skills/artisancloud/powerx/di.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 3 findings, up to high
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- high Privilege Escalation · line 51 Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
- high Privilege Escalation · line 97 Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
- high Privilege Escalation · line 117 Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00028 | $0.01655 |
| Opus 5.5 | $0.00011 | $0.00662 |
| Sonnet 5.5 | $0.00006 | $0.00331 |
| Haiku 4.5 | $0.00003 | $0.00166 |
Grade A, and why
crud-di 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.
How it starts
The opening of the file, as written. The whole thing — 191 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PowerX CRUD DI
步骤
- 打开
本文件内嵌规则。 - 按规则执行实现/校对。
- 完成后按核对清单验收。
核对点
- 与 PowerX 当前代码结构、路径与命名一致。
- 仅在传输层/契约层做职责内改动,不跨层越界。
规则(内嵌)
di.yaml
kind: ruleset
name: crud_di
version: 1.0.0
owner: powerx
status: stable
meta:
intent: >
统一依赖注入装配:Deps 作为单一入口,Service/Repo/Handler 经构造函数注入;
禁止在 Handler/Service 中直接 new 外部客户端或直连 DB;支持 HTTP/GRPC/MQ 等多传输共用同一业务服务。
references:
- constitution.md
- dev_crud_http_guides.md
scope:
codebase:
deps_file: "internal/app/shared/deps.go"
service_globs:
- "internal/service/**/**_service.go"
repo_globs:
- "internal/repository/**/**_repo.go"
handler_globs:
- "internal/transport/http/**/**_handler.go"
grpc_server_globs:
- "internal/transport/grpc/**/**.go"
principles:
- Deps 为“服务容器”:提供 DB/Logger/Cache/EventBus/KeyRing/Config 等基础依赖。
- 构造函数注入:NewXxxService(NewXxxRepo(...));禁止全局单例与包级可变状态。
- 传输解耦:HTTP/GRPC 层仅持有 Service;Service 不感知传输实现。
- 生命周期统一:Deps 负责启动/关闭顺序(DB→Repo/Service→Transport)。
checks:
- id: deps.file.exists
level: error
when: { file: "internal/app/shared/deps.go" }
assert:
- must_define: "type Deps struct"
- must_define: "func NewDeps() (*Deps, error)"
- id: service.constructor
level: error
when: { glob: "internal/service/**/**_service.go" }
assert:
- must_define_like: "func New*Service(*Deps) *"
- must_not_import: ["database/sql","gorm.io/gorm"] # Service 通过 deps 间接持有 DB
- id: repo.constructor
level: error
when: { glob: "internal/repository/**/**_repo.go" }
assert:
- must_define_like: "func New*Repo(*gorm.DB) *"
- id: handler.depends_on_service_only
level: error
when: { glob: "internal/transport/http/**/**_handler.go" }
assert:
- must_define_like: "type *Handler struct { svc *service.* }"
- must_define_like: "func New*Handler(*service.*) *"
- must_not_import: ["gorm.io/gorm","database/sql","net/http"]
- id: grpc.server.uses_service
level: warn
when: { glob: "internal/transport/grpc/**/**.go" }
assert:
- should_contain: "deps.*Service" # gRPC 服务实现注入 Service,而非直连 Repo/DB
- id: deps.no_new_external_in_handlers
level: error
when: { glob: "internal/transport/http/**/**_handler.go" }
assert:
- must_not_call: ["redis.NewClient(","kafka.NewReader(","http.DefaultClient.Do"]
acceptance:
checklist:
- "[ ] internal/app/shared/deps.go 定义 Deps 与 NewDeps"
- "[ ] Service/Repo/Handler 均提供 New* 构造函数"
- "[ ] Handler/GRPC 层仅依赖 Service,不直连 Repo/DB/外部客户端"
- "[ ] Deps 提供 DB/Logger/Cache/EventBus/KeyRing/Config 等公共依赖"
- "[ ] 无全局可变单例;关闭顺序由 Deps 统一管理"
templates:
deps_go: |
// internal/app/shared/deps.go
package shared
import (
"context"
"gorm.io/gorm"
"github.com/redis/go-redis/v9"
"log"
)
type Deps struct {
DB *gorm.DB
Redis *redis.Client
Logger *log.Logger
// EventBus any
// KeyRing any // 与 STS 对齐的验签/加密材料
// Config *Config
// Tracer trace.Tracer
// ...
// 业务服务
{{Entity}}Service *{{domain}}.{{Entity}}Service
}
func NewDeps() (*Deps, error) {
// 1) 初始化基础设施(DB/Cache/Logger/...)
db := mustOpenDB()
rdb := mustOpenRedis()
logger := mustLogger()
d := &Deps{DB: db, Redis: rdb, Logger: logger}
// 2) 初始化 Repository & Service
{{entity}}Repo := {{domain}}repo.New{{Entity}}Repo(d.DB)
d.{{Entity}}Service = {{domain}}svc.New{{Entity}}Service(d, {{entity}}Repo)
return d, nil
}
func (d *Deps) Close(ctx context.Context) error {
// 逆序关闭资源
if d.Redis != nil { _ = d.Redis.Close() }
// if d.DB != nil { sqlDB, _ := d.DB.DB(); _ = sqlDB.Close() }
return nil
}
service_go: |
// internal/service/{{domain}}/{{resource}}_service.go
package {{domain}}svc
import "github.com/ArtisanCloud/PowerX/internal/app/shared"
type {{Entity}}Service struct {
deps *shared.Deps
repo {{domain}}repo.{{Entity}}Repo
}
func New{{Entity}}Service(d *shared.Deps, r {{domain}}repo.{{Entity}}Repo) *{{Entity}}Service {
return &{{Entity}}Service{deps: d, repo: r}
}
repo_go: |
// internal/repository/{{domain}}/{{resource}}_repo.go
package {{domain}}repo
import "gorm.io/gorm"
type {{Entity}}Repo interface {
// 定义接口方法
}
type {{Entity}}RepoImpl struct {
db *gorm.DB
}
func New{{Entity}}Repo(db *gorm.DB) {{Entity}}Repo {
return &{{Entity}}RepoImpl{db: db}
}
wire_in_api_go: |
// internal/transport/http/{{layer}}/{{domain}}/api.go
func Register{{Domain}}Routes(rg *gin.RouterGroup, deps *shared.Deps) {
h := New{{Entity}}Handler(deps.{{Entity}}Service)
g := rg.Group("/{{domain}}/{{resource}}")
{
g.POST("", h.Create)
g.GET("", h.List)
g.GET("/:id", h.Get)
g.PATCH("/:id", h.Update)
g.DELETE("/:id", h.Delete)
}
}
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.
- 1mo ago First seen · 191 lines · 28 tokens per session scan A 4fd783ef9710
crud-di is a skill published in the GitHub repository ArtisanCloud/PowerX (382 stars, last pushed 2d ago), licensed Apache-2.0. It adds 28 tokens to every session and 1,655 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.
Other skills, from other repositories
printing-press
Set up a new integration, connector, or CLI binding for any API. Wrap or generate a ship-ready Go CLI from an OpenAPI, HAR, or Postman spec via the lean research -> generate -> build -> shipcheck loop. Use when the user says build a CLI, wrap this API, set up a new integration, add a connector, integrate with a…
generate-code
Generate Go client, server, or type code from an OpenAPI spec.
climate-generator
Generate Go CLIs from OpenAPI 3.x specs with climate, inspect generated CLIs, and emit Markdown skill prompts so those CLIs can be attached to agent workflows.
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.
golang-pro
Implements concurrent Go patterns using goroutines and channels, designs and builds microservices with gRPC or REST, optimizes Go application performance with pprof, and enforces idiomatic Go with generics, interfaces, and robust error handling. Use when building Go applications requiring concurrent programming…
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.