Agent skill

Crud Grpc

by ArtisanCloud in ArtisanCloud/PowerX

PowerX CRUD gRPC 开发规范(proto、server、拦截器、错误映射). An agent skill from ArtisanCloud/PowerX.

Apache-2.0Auto-check passedBackend & APIs

Install Crud Grpc

skills CLI
$ npx skills add ArtisanCloud/PowerX --skill crud-grpc -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ArtisanCloud/PowerX crud-grpc --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ArtisanCloud/PowerX.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.codex/skills/crud/grpc .claude/skills/crud-grpc && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
crud-grpc
GitHub stars
379
Token cost
~1.3k tokens
SKILL.md length
18 words
Files
2
Skills in repo
21
Repo updated
First seen
Licence
Apache-2.0

At a glance

PowerX CRUD gRPC 开发规范(proto、server、拦截器、错误映射). An agent skill from ArtisanCloud/PowerX.

  • Works in 3 steps: 打开 本文件内嵌规则。 → 按规则执行实现/校对。 → 完成后按核对清单验收。
  • Tasks that involve gRPC and Protobuf
  • SKILL.md covers 步骤, 核对点 and 规则(内嵌)
  • Reaches github.com

What it does

Crud Grpc is an agent skill from ArtisanCloud/PowerX. PowerX CRUD gRPC 开发规范(proto、server、拦截器、错误映射)。

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `dev_crud_grpc_guides.md`).

It sits in Backend & APIs, covering gRPC and Protobuf. It works with gRPC. The repository describes itself as: PowerX是一款以企业微信为基础的微信私域运营开放平台,帮助企业实现引流获客、精细运营。 The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve gRPC and Protobuf

Example prompts

  • “/crud-grpc”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

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

What it can do on your machine

Read from SKILL.md and the folder at commit 3f7619d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Crud Grpc loads about 1.3k tokens when it runs. Until then it costs about 14 tokens; SKILL.md has 18 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~14
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ArtisanCloud/PowerX at commit 3f7619d, republished under its Apache-2.0 licence (© ArtisanCloud). 18 words, ~1,261 tokens.

Download SKILL.mdSave it as .claude/skills/crud-grpc/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
crud-grpc
description
PowerX CRUD gRPC 开发规范(proto、server、拦截器、错误映射)。

PowerX CRUD gRPC

步骤

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

核对点

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

规则(内嵌)

dev_crud_grpc_guides.md
markdown
# PowerX CRUD – gRPC Guides

> 本文与《dev_crud_http_guides.md》并列,复用同一套 **Model / Repository / Service** 主干,仅替换传输层为 gRPC。
> 入口仍由 `constitution.md` 控制,别名解析由同级 `manifest.yaml` 完成(`@dev-crud-grpc`)。

---

## 1. 适用范围(Scope)

* 与 HTTP 版 CRUD 规范**等价**:创建/查询/更新/删除、分页、错误、审计、多租户。
* 仅规定 **gRPC 传输层**:Server 行为、拦截器、错误映射、分页/上下文 DTO 对齐 **proto 契约**。
* 宪章入口仍为 `.specify/memory/constitution.md`(由其 `use: "` 决定是否引入本指南)。"

---

## 2. 目录与生成物(与你仓库对齐)

```
api/grpc/
  contracts/                # *.proto 契约(Buf 维护)
    buf.yaml
    buf.gen.yaml
    common/v1/{context,pagination,resource,response}.proto
    powerx/{iam,agent,auth/sts,plugin/control,setting}/v1/*.proto
  gen/go/...                # 代码生成产物(勿手改)
  sdk/{ts,rust,php}/...     # 多语言 SDK(封装拨号、上下文、重试等)

internal/transport/grpc/
  iam/{member_handler.go,team_handler.go,...}
  agent/{stream_handler.go,setting_handler.go,...}
  auth/{sts_handler.go}
  auth/middleware/auth_interceptor.go
```

* 你的 `api/grpc` 与 `internal/transport/grpc` 已经是成熟形态;本指南只统一**约束与验收**。

---

## 3. 设计原则(Transport-Agnostic)

* **服务端不写业务**:gRPC Server 仅做 **参数绑定/校验 → 调 Service → 错误映射**。
  示例:`MemberServer` 只解析上下文、分页、调用 `MemberService.ListMembers` 并映射返回。
* **多租户一致**:`tenant_id` 必须来自 **RequestContext 或 Metadata**;缺失返回 400 语义。
* **错误等价**:将应用错误(`ErrInvalidParam/ErrForbidden/ErrNotFound/ErrConflict`)映射为 gRPC `codes.*`;HTTP 与 gRPC 语义一致。
* **分页一致**:`common.v1.pagination.proto` 的 PageRequest/PageResponse 必须与 HTTP 页码/页大小语义一致。
* **审计与鉴权**:通过拦截器(Auth + Tenant)注入上下文,Service 侧照常记录审计;Server 不直接写审计逻辑。

---

## 4. Proto 契约(最小统一约束)

* **公共类型**:统一使用 `common/v1` 下的 `context.proto / pagination.proto / resource.proto / response.proto`。
* **包与版本**:采用 `powerx.<domain>.v1`,破坏性变更才升级 `v2`。
* **分页**:推荐结构(与你现有 common 保持一致):

    * `PageRequest{ page, page_size, sort_by, sort_order, offset? }`
    * `PageResponse{ total, page, page_size, pages? }`
* **Context**:`RequestContext{ tenant_id, request_id, actor_id, trace_id, ... }`,所有 RPC **强制**携带。
* 生成配置使用 Buf:`buf.yaml / buf.gen.yaml`(已存在)。

> 你现有 `powerx/iam/v1/member.proto`、`team.proto` 与 `common/v1/*.proto` 均满足上述形态,可直接沿用。

---

## 5. Server 实现(约束与示例)

### 5.1 绑定/校验

* **tenant 提取**:优先读 `RequestContext.tenant_id`,其次仅从 Metadata `tenant-id` 兜底(不接受任何 `x-powerx-*` 遗留租户头)。
  你的 `tenantIDFrom()` 已经实现这一落地逻辑。
* **分页映射**:`PageRequest(offset,page_size)` → `(page,size)` 的换算统一用工具函数(如 `pageFrom()`)。
* **错误回包**:Meta 中返回 `code/message/request_id`,与你的 `okMeta/badMeta` 一致(见 `member_handler.go`/`team_handler.go` 调用)。

### 5.2 调用 Service

* Server 仅调用同名用例,如 `MemberService.ListMembers/GetMember/...`;
* 严禁在 Server 内写 DB 或外部 IO 调用(与 HTTP 版一致)。

### 5.3 映射输出

* 领域对象 → PB:使用专用转换函数(如 `toPBMember()`),并保持 PRN/Ref 等字段预留。
* 分页总数写入 `PageResponse.total`,按需要计算 `pages`。

---

## 6. 拦截器(Auth / Tenant / Trace / Recovery)

* 统一在 `internal/transport/grpc/auth/middleware/auth_interceptor.go` 注册链:
  `Tracing → Auth/Tenant → Recovery → Logging/Audit(可选)`。
* Auth 成功后,将 `tenant_id`、`actor` 注入 `context.Context`,与 HTTP 中间件语义一致。
* Server 端实现保持**无状态**;租户与权限校验仍以 Service 为准。
  (你已存在 `auth_interceptor.go` 路径,保持即可。)

---

## 7. 错误映射(与 HTTP 等价)

| 应用错误                   | gRPC Code                                          |
| ---------------------- | -------------------------------------------------- |
| ErrInvalidParam / 参数缺失 | `codes.InvalidArgument`                            |
| ErrForbidden / 越权      | `codes.PermissionDenied`                           |
| ErrNotFound / 不存在      | `codes.NotFound`                                   |
| ErrConflict / 冲突       | `codes.AlreadyExists` 或 `codes.FailedPrecondition` |
| 其他未分类                  | `codes.Internal`                                   |

> 建议提供一个 `grpcerr.FromAppError(err)` 小工具集中处理映射;当前 `member_handler.go`/`team_handler.go` 以 “Meta + 200/400/500 语义”返回,你也可以逐步替换为标准 `status.Error` 形式以统一链路。

---

## 8. 流式(Server-Streaming)

* 与 SSE 事件顺序对齐:`start → data(token/partial) → final → end`;异常用 `error` 结束。
* 建议为长连接加入 heartbeat(超时时间与退避策略由客户端/SDK 控制)。
* 你的 `agent/stream_handler.go` 已是落地点,遵循以上语义即可。

---

## 9. 代码生成(Buf)

* 在 `api/grpc/contracts/` 下运行:

  ```
  buf lint
  buf breaking --against 'https://github.com/<org>/<repo>.git#branch=main'
  buf generate
  ```
* 生成物落在 `api/grpc/gen/go/**`,不要手改;SDK 封装在 `api/grpc/sdk/**`。

---

## 10. 验收要点(Checklist)

* [ ] **Server 零业务**:仅绑定/校验/调用 Service/错误映射(对齐 HTTP 版职能)。
* [ ] **多租户**:`tenant_id` 必带;缺失返回 400 语义或 `codes.InvalidArgument`。
* [ ] **分页一致**:PageRequest/PageResponse 与 HTTP 语义一致(`page/page_size/pages`)。
* [ ] **错误等价**:应用错误 → `codes.*`;或临时以 Meta 语义保持一致,逐步收敛至 `status.Error`。
* [ ] **拦截器链**:Tracing → Auth/Tenant → Recovery → Logging/Audit;服务端不重复做鉴权解析细节。
* [ ] **输出映射**:使用 `toPB*`,保留 `ResourceRef/PRN` 等字段空位。
* [ ] **生成流程**:`buf lint / breaking / generate` 通过;生成物与源码分离。
* [ ] **与 HTTP 等价**:同一用例在 HTTP 与 gRPC 的语义、错误、分页完全可对照。

---

© ArtisanCloud, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .codex/skills/crud/grpc of ArtisanCloud/PowerX.

  • SKILL.md
  • dev_crud_grpc_guides.md

Open the folder on GitHubat commit 3f7619d

Compare with similar skills

Crud Grpc next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Crud Grpc compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Crud Grpc this skillArtisanCloud/PowerX379—~1.3kAutomated safety check: PassApache-2.0
Use Yaakmountain-loop/yaak19k—~1.9kAutomated safety check: PassMIT
Golang Proantoniopaya22/go-rest-template1723 repos~1.2kAutomated safety check: PassMIT
Debug Grpc ConnectionGetBindu/Bindu10k—~1.2kAutomated safety check: PassCustom licence
Aspnet Corefanslead/ReverseProxy.Store1632 repos~1.4kAutomated safety check: PassApache-2.0
Regenerate Grpc StubsGetBindu/Bindu10k—~810Automated safety check: PassCustom licence

Similar skills

  • Use Yaak

    mountain-loop/yaak

    A skill your agent uses when the user mentions Yaak, a Yaak workspace, or the yaak command, or asks to call, hit, or smoke test HTTP/REST endpoints, save or organize API requests for reuse or manual…

    19k GitHub stars~1.9k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Golang Pro

    antoniopaya22/go-rest-template

    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…

    172 GitHub starsUsed in 3 repos~1.2k tokens
    Backend & APIsAuto-check passed
  • Debug Grpc Connection

    GetBindu/Bindu

    Diagnose gRPC connection issues between the Bindu core and a language SDK.

    10k GitHub stars~1.2k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Aspnet Core

    fanslead/ReverseProxy.Store

    Build, review, refactor, or architect ASP.NET Core web applications using current official guidance for .NET web development.

    163 GitHub starsUsed in 2 repos~1.4k tokens
    Backend & APIsAuto-check passed
  • Regenerate Grpc Stubs

    GetBindu/Bindu

    Regenerate Python + TypeScript gRPC stubs after editing proto files.

    10k GitHub stars~810 tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Spider King

    aoyunyang/spider-king-skill

    Pure-web protocol reverse skill: turn hostile browser clients into browser-free Python collectors.

    507 GitHub stars~7.3k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed

More from ArtisanCloud/PowerX

All 21 skills in this repo
  • API Naming

    ArtisanCloud/PowerX

    PowerX API 命名与访问规范(/api/v1、/admin、/internal 边界). An agent skill from ArtisanCloud/PowerX.

    379 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Capability Governance

    ArtisanCloud/PowerX

    PowerX 底座 Capability 治理与发布准入规则。用于审计 REST/OpenAPI/gRPC/Gin 生成的能力候选、正式 platformcapabilities 目录、Capability Registry 登记、agentusable/permissioncode/risklevel 元数据、ignore…

    379 GitHub stars~3k tokensUpdated today
    Auto-check passed
  • Crud Di

    ArtisanCloud/PowerX

    PowerX CRUD 依赖注入规则(Deps 单入口、构造注入、跨传输复用). An agent skill from ArtisanCloud/PowerX.

    379 GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Crud Handler HTTP

    ArtisanCloud/PowerX

    PowerX HTTP Handler 规则(绑定校验、统一回包、无 DB IO). An agent skill from ArtisanCloud/PowerX.

    379 GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Crud HTTP

    ArtisanCloud/PowerX

    PowerX CRUD HTTP 开发规范(管理端路由、绑定、错误桥接、多租户). An agent skill from ArtisanCloud/PowerX.

    379 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Crud Model

    ArtisanCloud/PowerX

    PowerX CRUD Model 规则(GORM 模型、多租户、索引、命名). An agent skill from ArtisanCloud/PowerX.

    379 GitHub stars~1.3k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Crud Grpc

What does Crud Grpc do?

PowerX CRUD gRPC 开发规范(proto、server、拦截器、错误映射). An agent skill from ArtisanCloud/PowerX. Crud Grpc is an agent skill from ArtisanCloud/PowerX.

When should I use Crud Grpc?

Crud Grpc fits situations like: tasks that involve gRPC and Protobuf.

How do I install Crud Grpc in Claude Code?

Run `npx skills add ArtisanCloud/PowerX --skill crud-grpc -a claude-code`. Or copy the skill folder (.codex/skills/crud/grpc in ArtisanCloud/PowerX) into .claude/skills/crud-grpc in your project. Claude Code loads it when a task matches its description.

How do I install Crud Grpc in Codex?

Run `npx skills add ArtisanCloud/PowerX --skill crud-grpc -a codex`. Or copy the skill folder (.codex/skills/crud/grpc in ArtisanCloud/PowerX) into .agents/skills/crud-grpc in your project. Codex loads it when a task matches its description.

Can I use Crud Grpc in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ArtisanCloud/PowerX --skill crud-grpc -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/crud-grpc, .gemini/skills/crud-grpc, .github/skills/crud-grpc and .opencode/skills/crud-grpc in your project.

What does Crud Grpc need to run?

SKILL.md names no scripts, command-line tools or credentials: Crud Grpc is instructions for the agent only.

Does Crud Grpc access the network?

SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Crud Grpc safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Crud Grpc use?

Crud Grpc is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Crud Grpc use?

About 1.3k tokens (SKILL.md is roughly 5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Crud Grpc?

Skills that share tags, products or a category with Crud Grpc: Use Yaak (mountain-loop/yaak, 19k stars), Golang Pro (antoniopaya22/go-rest-template, 172 stars), Debug Grpc Connection (GetBindu/Bindu, 10k stars) and Aspnet Core (fanslead/ReverseProxy.Store, 163 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Crud Grpc?

ArtisanCloud (a GitHub organization) maintains it in ArtisanCloud/PowerX, which has 379 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on October 8, 2026.

Source: ArtisanCloud/PowerX on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.