Agent skill

Crud API REST

by ArtisanCloud in ArtisanCloud/PowerX

“PowerX REST 契约规则(资源命名、分页、错误、版本化)。”

— description from SKILL.md by ArtisanCloud
Apache-2.0Auto-check passedBackend & APIs

Install Crud API REST

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

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

GitHub CLI
$ gh skill install ArtisanCloud/PowerX crud-api-rest --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/api-rest .claude/skills/crud-api-rest && 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-api-rest
GitHub stars
379
Token cost
~2.3k tokens
SKILL.md length
19 words
Files
1
Skills in repo
21
Repo updated
First seen
Licence
Apache-2.0

At a glance

  • Works in 3 steps: 打开 本文件内嵌规则。 → 按规则执行实现/校对。 → 完成后按核对清单验收。
  • SKILL.md covers 步骤, 核对点 and 规则(内嵌)
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

About this skill

Crud API REST is a skill in ArtisanCloud/PowerX (379 stars). Its SKILL.md is about 2.3k tokens. Licence: Apache-2.0.

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 yaml).

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

  • Network

    No URLs in SKILL.md.

    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 API REST loads about 2.3k tokens when it runs. Until then it costs about 12 tokens; SKILL.md has 19 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~12
When it runs · the whole SKILL.md, loaded when a task matches
~2.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). 19 words, ~2,264 tokens.

Download SKILL.mdSave it as .claude/skills/crud-api-rest/SKILL.md (or your agent's skills folder).
name
crud-api-rest
description
PowerX REST 契约规则(资源命名、分页、错误、版本化)。

PowerX CRUD API REST

步骤

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

核对点

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

规则(内嵌)

api_rest.yaml
yaml
kind: ruleset
name: crud_api_rest
version: 1.0.0
owner: powerx
status: stable

meta:
  intent: >
    定义 PowerX 的 REST 契约基线:版本化路径、统一错误与分页信封、标准 CRUD 动词与资源命名、
    统一筛选/排序/搜索约定、SSE 事件名、速率限制与乐观并发,确保与 gRPC 在语义上可对照。
  references:
    - constitution.md
    - dev_crud_http_guides.md
    - dev_sts_guides.md

scope:
  applies_to:
    - "internal/transport/http/**/api.go"         # 路由注册文件需满足契约形态
    - "openapi/**/*.yaml"                          # 若你维护 OAS,亦按此规范校验(可选)
  api_versions:
    - "/api/v1/admin"
    - "/api/v1/open"
    - "/api/v1/web"                                # 仅当存在该前台接口时使用
    - "/api/v1/app"                               # 仅当存在在该前台APP接口时使用
  # 破坏性变更才允许升级 URL 版本(v1→v2)。:contentReference[oaicite:2]{index=2}

principles:
  - API 必须使用版本化前缀(/api/v1/*);破坏性变更才升级版本。            # 路径/版本  :contentReference[oaicite:3]{index=3}
  - 统一错误信封:{ code, message, details?, request_id };状态码集合固定。   # 错误结构/码  :contentReference[oaicite:4]{index=4}
  - 统一分页信封:pagination{ total,page,pageSize,pages }。                 # 分页字段     :contentReference[oaicite:5]{index=5}
  - 多租户上下文来自鉴权中间件/令牌,不允许以业务参数绕过。                 # 宪章-多租户  :contentReference[oaicite:6]{index=6}
  - 鉴权对齐 STS:HTTP 层若使用 JWT,应与 STS 的 KeyRing/issuer/kid 策略一致。 # STS 对齐   :contentReference[oaicite:7]{index=7}
  - SSE/WS 事件名统一(start/intent/plan/token/data/action/final/end/error/heartbeat)。 # 流式事件  :contentReference[oaicite:8]{index=8}
  - 与 gRPC 在错误/分页语义可一一对照(等价)。                             # gRPC 等价   :contentReference[oaicite:9]{index=9}

contracts:
  resource_naming:
    noun_style: kebab                   # e.g. /media/assets
    id_param: ":id"                    # /:id
    collection:
      verbs:
        create: { method: POST,   path: "" }
        list:   { method: GET,    path: "" }
      item:
        get:    { method: GET,    path: "/:id" }
        update: { method: PATCH,  path: "/:id" }
        delete: { method: DELETE, path: "/:id" }
    notes: "动词与路径需符合标准 CRUD 语义,保持与 handler 目录示例一致。"   # :contentReference[oaicite:10]{index=10}

  pagination:
    query_params:
      - { name: "page",      type: integer, default: 1,   min: 1 }
      - { name: "pageSize",  type: integer, default: 20,  min: 1, max: 200 }
      - { name: "sortBy",    type: string,  enum: ["createdAt","updatedAt","id"], optional: true }
      - { name: "sortOrder", type: string,  enum: ["asc","desc"], optional: true }
      - { name: "q",         type: string,  optional: true }   # 全文或关键字搜索
    response_shape:
      object: "ResponseList"
      fields:
        - "items: array<any>"
        - "pagination.total: integer"
        - "pagination.page: integer"
        - "pagination.pageSize: integer"
        - "pagination.pages: integer"
    must_align_with_http_guides: true   # 字段语义与指南一致  :contentReference[oaicite:11]{index=11}

  filtering:
    pattern: "filters[<field>]=<op>:<value>"
    ops:
      - "eq"     # 等于
      - "ne"     # 不等于
      - "in"     # 逗号分隔集合
      - "gte"    # ≥
      - "lte"    # ≤
      - "like"   # 模糊匹配
    examples:
      - "/media/assets?filters[status]=eq:1&filters[createdAt]=gte:2025-01-01"

  error_and_status:
    envelope: ["code","message","details?","request_id"]
    http_status_whitelist: [400,401,403,404,409,429,500]  # 统一状态集  :contentReference[oaicite:12]{index=12}
    mapping_notes: "与同名应用错误在 gRPC codes.* 上可对照。"                # :contentReference[oaicite:13]{index=13}

  auth_and_tenant:
    scheme: "Authorization: Bearer <JWT>"
    tenant_source: "从令牌解析;中间件注入到 ctx,不以 query/body 传递。"   # 宪章 & STS  :contentReference[oaicite:14]{index=14} :contentReference[oaicite:15]{index=15}
    sts_alignment: "验签使用与 STS 相同 KeyRing(包含 kid)与 issuer/aud 校验。" # :contentReference[oaicite:16]{index=16}

  concurrency_and_idempotency:
    etag:
      enabled_for: ["PATCH","DELETE"]
      headers: ["If-Match"]
      policy: "未匹配 ETag → 412(在实现层可折算为 409 语义)。"
    idempotency:
      enabled_for: ["POST"]
      header: "Idempotency-Key"
      ttl_seconds: 24*3600

  sse_and_ws:
    sse_content_type: "text/event-stream"
    events: ["start","intent","plan","token","data","action","final","end","error","heartbeat"]  # :contentReference[oaicite:17]{index=17}

  rate_limit:
    response_headers: ["X-RateLimit-Limit","X-RateLimit-Remaining","X-RateLimit-Reset"]
    on_exceed_status: 429

  content_negotiation:
    consume: ["application/json"]
    produce: ["application/json"]      # 流式除外(SSE)
    charset: "utf-8"

checks:
  versioned_paths:
    - id: api.version.prefix
      level: error
      when: { glob: "internal/transport/http/**/api.go" }
      assert:
        - must_prefix_route_one_of: ["/api/v1/admin","/api/v1/open","/api/v1/web"]   # :contentReference[oaicite:18]{index=18}

  crud_routes_shape:
    - id: routes.crud.shape
      level: error
      when: { glob: "internal/transport/http/**/api.go" }
      assert:
        - must_register_methods:
            - "POST \"\""
            - "GET \"\""
            - "GET \"/:id\""
            - "PATCH \"/:id\""
            - "DELETE \"/:id\""              # 形态对齐示例路由  :contentReference[oaicite:19]{index=19}

  envelope_and_codes:
    - id: response.error.schema
      level: error
      when: { glob: "internal/transport/http/**/**_handler.go" }
      assert:
        - must_use_error_bridge: ["RespondErrorFrom","ResponseSuccess"]  # 统一错误桥接
        - http_status_in: [400,401,403,404,409,429,500]         # 统一状态集    :contentReference[oaicite:21]{index=21}

  pagination_contract:
    - id: pagination.contract
      level: error
      when: { glob: "internal/transport/http/**/**_handler.go" }
      assert:
        - must_bind_dto: ["PaginationRequest"]
        - must_return: ["ResponseList","PaginationResponse"]    # 统一分页信封  :contentReference[oaicite:22]{index=22}

  sse_contract:
    - id: sse.events
      level: warn
      when: { contains: "WriteToSSE(" }
      assert:
        - must_use_events: ["start","intent","plan","token","data","action","final","end","error","heartbeat"]  # :contentReference[oaicite:23]{index=23}

  auth_alignment:
    - id: auth.sts.aligned
      level: warn
      when: { glob: "internal/transport/http/**/**_handler.go" }
      assert:
        - must_verify_jwt_with_keyring: true      # 与 STS KeyRing 对齐(issuer/aud/kid)  :contentReference[oaicite:24]{index=24}

acceptance:
  checklist:
    - "[ ] 路由使用 /api/v1/{admin|open|web|app} 前缀;破坏性变更才升级版本"           # :contentReference[oaicite:25]{index=25}
    - "[ ] CRUD 形态:POST/GET/GET/:id/PATCH/:id/DELETE/:id 全量存在"             # :contentReference[oaicite:26]{index=26}
    - "[ ] 错误结构统一,状态码限定在 {400,401,403,404,409,429,500}"              # :contentReference[oaicite:27]{index=27}
    - "[ ] 分页响应包含 total/page/pageSize/pages,列表封装在 ResponseList"       # :contentReference[oaicite:28]{index=28}
    - "[ ] SSE/WS(若有)事件名与规范一致"                                         # :contentReference[oaicite:29]{index=29}
    - "[ ] 鉴权对齐 STS:JWT 验签与 KeyRing/issuer/aud/kid 一致"                  # :contentReference[oaicite:30]{index=30}
    - "[ ] (可选)支持 Idempotency-Key 与 If-Match(Etag) 的幂等与并发控制"
    - "[ ] 与 gRPC 的分页/错误语义可对照(等价)"                                  # :contentReference[oaicite:31]{index=31}

templates:
  # OpenAPI 片段(如你维护 OAS)
  openapi_snippet: |
    paths:
      /api/v1/admin/media/assets:
        get:
          summary: List assets
          parameters:
            - in: query; name: page; schema: { type: integer, minimum: 1, default: 1 }
            - in: query; name: pageSize; schema: { type: integer, minimum: 1, maximum: 200, default: 20 }
            - in: query; name: sortBy; schema: { type: string, enum: [createdAt, updatedAt, id] }
            - in: query; name: sortOrder; schema: { type: string, enum: [asc, desc] }
            - in: query; name: q; schema: { type: string }
          responses:
            "200":
              description: OK
              content:
                application/json:
                  schema:
                    $ref: "#/components/schemas/ResponseList"
            "400": { $ref: "#/components/responses/BadRequest" }
            "401": { $ref: "#/components/responses/Unauthorized" }
            "403": { $ref: "#/components/responses/Forbidden" }
            "404": { $ref: "#/components/responses/NotFound" }
            "409": { $ref: "#/components/responses/Conflict" }
            "429": { $ref: "#/components/responses/TooManyRequests" }
            "500": { $ref: "#/components/responses/InternalError" }

  router_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)
      }
    }

© 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

Just SKILL.md in .codex/skills/crud/api-rest of ArtisanCloud/PowerX.

Open the folder on GitHubat commit 3f7619d

Compare with similar skills

Crud API REST 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 API REST compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Crud API REST this skillArtisanCloud/PowerX379—~2.3kAutomated safety check: PassApache-2.0
API DesignerJeffallan/claude-skills12k2 repos~2kAutomated safety check: PassMIT
Paperclippaperclipai/paperclip99k—~9.6kAutomated safety check: PassMIT
Nodejs Backend Patternsever-works/ever-works15818 repos~4kAutomated safety check: PassAGPL-3.0
OpenAPI to MCP Servermcp-use/mcp-use11k—~5.2kAutomated safety check: PassApache-2.0
Use Yaakmountain-loop/yaak19k—~1.9kAutomated safety check: PassMIT

Similar skills

  • API Designer

    Jeffallan/claude-skills

    Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.

    12k GitHub starsUsed in 2 repos~2k tokens
    Backend & APIsAuto-check passed
  • Paperclip

    paperclipai/paperclip

    Interact with the Paperclip control plane API for task coordination and governance.

    99k GitHub stars~9.6k tokensUpdated today
    Backend & APIsAuto-check passed
  • Nodejs Backend Patterns

    ever-works/ever-works

    Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices.

    158 GitHub starsUsed in 18 repos~4k tokens
    Backend & APIsAuto-check passed
  • OpenAPI to MCP Server

    mcp-use/mcp-use

    Turns an OpenAPI or Swagger spec into an MCP server with the mcp-use TypeScript SDK, mapping each operation to a tool, wiring auth, testing and deploying.

    11k GitHub stars~5.2k tokensUpdated today
    Backend & APIsAuto-check passed
  • 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
  • Covers the RuView `wifi-densepose` command line binary, its Axum REST API and the WebAssembly builds for browsers and ESP32, for embedding or scripting RuView.

    97k GitHub stars~1.2k tokensUpdated today
    Backend & APIsAuto-check: notes

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 Grpc

    ArtisanCloud/PowerX

    PowerX CRUD gRPC 开发规范(proto、server、拦截器、错误映射). 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

Categories

Questions about Crud API REST

How do I install Crud API REST in Claude Code?

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

How do I install Crud API REST in Codex?

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

Can I use Crud API REST 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-api-rest -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-api-rest, .gemini/skills/crud-api-rest, .github/skills/crud-api-rest and .opencode/skills/crud-api-rest in your project.

What does Crud API REST need to run?

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

Does Crud API REST access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Crud API REST 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 API REST use?

Crud API REST 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 API REST use?

About 2.3k tokens (SKILL.md is roughly 9.1k 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 API REST?

Skills that share tags, products or a category with Crud API REST: API Designer (Jeffallan/claude-skills, 12k stars), Paperclip (paperclipai/paperclip, 99k stars), Nodejs Backend Patterns (ever-works/ever-works, 158 stars) and OpenAPI to MCP Server (mcp-use/mcp-use, 11k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Crud API REST?

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.