Agent skill

API Naming

by ArtisanCloud in ArtisanCloud/PowerX

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

Apache-2.0Auto-check passedBackend & APIs

Install API Naming

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

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

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

At a glance

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

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

What it does

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

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

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

When your agent uses it

  • Backend & APIs work in your project

Example prompts

  • “/api-naming”

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

    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

API Naming loads about 1.1k tokens when it runs. Until then it costs about 15 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
~15
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

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,144 tokens.

Download SKILL.mdSave it as .claude/skills/api-naming/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
api-naming
description
PowerX API 命名与访问规范(/api/v1、/admin、/internal 边界)。

PowerX API Naming

步骤

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

核对点

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

规则(内嵌)

api-naming.md
markdown
# PowerX API 命名与访问规范(全局)

> 本文件定义 PowerX 平台所有 HTTP API 的路径前缀、用途边界、版本策略、鉴权与命名风格。适用于 CoreX 底座、插件框架、插件业务服务。

## 1. 路径前缀与用途边界

### 1.1 公共访问域(对外/客户端)

- **/api/v1/**:对外开放的稳定 API(OpenAPI 可暴露)
  - 典型对象:租户端、开放平台、第三方客户端
  - 版本语义:语义化版本 v1 / v2

- **/api/**:兼容入口(老路径或内部自用),可作为路由代理或重定向到 /api/v1
  - 若 /api/v1 存在同名路径,优先迁移到 /api/v1

> **注意:APIPrefix 可配置**(`cfg.Server.APIPrefix`)。本文档使用 `/api` 作为默认示例,实际运行路径为 `<APIPrefix>/...`,常见取值:`/api` 或 `/api/v1`。

### 1.2 管理/后台域(管理端/控制台)

- **/api/v1/admin/**:管理端 API(带管理权限)
  - 典型对象:管理控制台、运营/内部管理系统
  - 典型调用主体:PowerX Admin、插件 Admin 页面
  - 鉴权语义:用户 JWT + tenant member + RBAC + 业务权限
  - 必须带授权 token
  - 不作为插件服务态 STS 直连的默认开放域

### 1.2.1 外部业务域(Web / Mini-app / Customer)

- **/api/v1/**:外部业务开放 API
  - 典型对象:租户侧 Web、mini-app、customer portal、第三方客户端
  - 典型调用主体:web user、mini-app user、customer actor、service actor
  - 鉴权语义:用户 JWT、customer token、API Key、OAuth client 或明确声明的 STS
  - 资源边界:默认 tenant-scoped;customer/mini-app 自助接口必须 owner-scoped/self-scoped
  - 不得复用 `/api/v1/admin/*` 的全量治理语义

### 1.2.2 Capability 统一调用域

- **/api/v1/tenant/invocations**:服务态 capability 调度入口
  - 典型对象:插件后端、agent、skill、系统集成
  - 鉴权语义:STS/API Key/OAuth client + capability registration/grant
  - 语义:按 `capability_id` 调用已授权能力,而不是直接暴露后台路由

### 1.3 内部/宿主域(仅内部使用)

- **<APIPrefix>/internal/**:宿主/插件内部调用入口(不对公网开放)
  - 典型对象:PowerXPlugin Framework、CLI、宿主内部服务
  - **必须最小化暴露,不写入公开 OpenAPI**
  - 允许与 /api/v1 同时存在,但用途必须明确区分

> 说明:已有历史文档/实现中使用 `/internal/*` 或 `/api/internal/*`,统一向 `/api/internal/*` 对齐。

---

## 2. 版本策略

- 稳定对外接口必须挂在 `/api/v1`,有破坏性变更时升级 `/api/v2`
- `/api/internal` 不承诺稳定版本,但变更需记录在变更日志
- `/api` 仅作为兼容入口或内部路由代理,不建议新功能落地

---

## 3. 鉴权与租户透传

- **所有 `/api/v1/admin` 与 `/api/internal` 必须鉴权**
- 租户信息必须通过 token(JWT claims)或 `tenant_uuid` 字段解析,不接受遗留租户头注入。
- 内部接口也需 tenant 校验,禁止跨租户调用
- 设计新接口前必须声明调用主体:`admin_user`、`service_actor`、`web_user`、`mini_app_user`、`customer_actor`。
- 后台用户态接口和外部业务接口即使操作同一资源,也必须按 actor、资源范围、风险等级和授权开关判断是否复用同一 capability。
- customer/mini-app 自助接口不得使用 admin 全量管理权限;默认只能访问当前 customer/user/owner 可见资源。

---

## 4. 命名风格

### 4.1 资源命名

- REST 资源采用名词复数:
  - `/api/v1/admin/agents`
  - `/api/v1/admin/knowledge-spaces`
  - `/api/v1/customer/accounts`

### 4.1.0 Actor 边界命名

- 后台管理:`/api/v1/admin/<resources>`
  - 示例:`/api/v1/admin/customer/accounts`
- 外部业务/客户自助:`/api/v1/<domain>/<resources>` 或 `/api/v1/customer/<resources>`
  - 示例:`/api/v1/customer/account`
  - 示例:`/api/v1/customer/orders`
- 服务态开放接口:`/api/v1/<domain>/<resources>`,必须在能力或接口文档中声明允许的 STS/API Key/OAuth actor
  - 示例:`/api/v1/scheduler/jobs`
- 统一能力调度:`/api/v1/tenant/invocations`

路径前缀不等于 capability。`/api/v1/admin/<resource>` 与 `/api/v1/<resource>` 如果业务语义和授权边界一致,可以是同一个 capability 的不同 binding;如果 actor 可操作资源范围不同,必须拆 capability。

### 4.1.1 插件相关命名

- 管理端插件资源:`/api/v1/admin/plugins/*`
  - 示例:`/api/v1/admin/plugins`、`/api/v1/admin/plugins/:id`
- 宿主内部插件资源:`/api/internal/plugins/*`
  - 示例:`/api/internal/plugins/local/reload`、`/api/internal/plugins/environments/check`
- 插件发布/治理内部分发:`/api/internal/version/*`、`/api/internal/notify/*`
- 宿主模式插件前端入口(反代):`/_p/<pluginId>/admin/<path>`
  - 示例:`/_p/com.powerx.helloworld/admin/intro`
- 宿主模式插件后端 API(反代):`/_p/<pluginId>/api/<path>`
  - 示例:`/_p/com.powerx.helloworld/api/healthz`

### 4.2 行为/动作

- 动作用 **子路径** 或 **操作端点**:
  - `/api/v1/admin/agents/:id/activate`
  - `<APIPrefix>/internal/ws-bus/publish`

### 4.3 异步任务

- 提交任务:`POST /.../tasks`
- 查询任务:`GET /.../tasks/:taskId`

---

## 5. OpenAPI / 合同要求

- `/api/v1` 与 `/api/v1/admin` 必须有 OpenAPI 文档
- `/api/internal` 默认不在公开 OpenAPI 中暴露
- 任何新增对外接口必须更新 specs/contracts

---

## 6. 日志 / 追踪 / 审计

- 对外与管理接口必须具备 trace_id
- `/api/internal` 必须记录 tenant/topic/trace_id(若涉及事件)

---

## 7. 示例

### 7.1 对外 API

```
GET /api/v1/knowledge-spaces
```

### 7.2 管理端 API

```
POST /api/v1/admin/agents/test/connection
```

### 7.2.1 Customer / Mini-app API

```
GET /api/v1/customer/account
PATCH /api/v1/customer/account/profile
GET /api/v1/customer/orders
```

### 7.2.2 Capability Invocation API

```
POST /api/v1/tenant/invocations
GET /api/v1/tenant/capabilities
```

### 7.3 内部 API

```
POST <APIPrefix>/internal/ws-bus/publish
```

### 7.4 插件相关 API

```
GET /api/v1/admin/plugins
POST /api/internal/plugins/local/reload
GET /_p/<pluginId>/admin/
GET /_p/<pluginId>/api/healthz
```

---

## 8. 变更记录

- 2026-02-03:首次定义 `/api/internal` 作为宿主/插件内部 API 前缀

© 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/governance/api-naming of ArtisanCloud/PowerX.

  • SKILL.md
  • api-naming.md

Open the folder on GitHubat commit 3f7619d

Compare with similar skills

API Naming 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.

API Naming compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
API Naming this skillArtisanCloud/PowerX379—~1.1kAutomated safety check: PassApache-2.0
Configuring Horizoncoollabsio/coolify63k4 repos~898Automated safety check: PassMIT
Nestjs Best Practicesrolling-scopes/rsschool-app10k6 repos~1.2kAutomated safety check: PassMIT
Sub2API AdminWei-Shaw/sub2api43k1 repos~717Automated safety check: PassLGPL-3.0
Firecrawl Build Onboardingfirecrawl/firecrawl189k1 repos~1.4kAutomated safety check: NotesISC
Obsidian BasesAtmosphere/atmosphere3.8k22 repos~3.2kAutomated safety check: PassApache-2.0

Similar skills

  • Configuring Horizon

    coollabsio/coolify

    A skill your agent uses whenever the user mentions Horizon by name in a Laravel context.

    63k GitHub starsUsed in 4 repos~898 tokens
    Backend & APIsAuto-check passed
  • Nestjs Best Practices

    rolling-scopes/rsschool-app

    NestJS best practices and architecture patterns for building production-ready applications.

    10k GitHub starsUsed in 6 repos~1.2k tokens
    Backend & APIsAuto-check passed
  • Sub2API Admin

    Wei-Shaw/sub2api

    Manages a Sub2API deployment from the command line: accounts, redeem and invitation codes, groups, proxies, imports, exports and raw admin API calls.

    43k GitHub starsUsed in 1 repo~717 tokens
    Backend & APIsAuto-check passed
  • Firecrawl Build Onboarding

    firecrawl/firecrawl

    Gets Firecrawl working in a project: signs you in through the browser, saves FIRECRAWL_API_KEY to .env and picks the first SDK or REST path.

    189k GitHub starsUsed in 1 repo~1.4k tokens
    Backend & APIsAuto-check: notes
  • Obsidian Bases

    Atmosphere/atmosphere

    Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries.

    3.8k GitHub starsUsed in 22 repos~3.2k tokens
    Backend & APIsAuto-check passed
  • Fortify Development

    coollabsio/coolify

    ACTIVATE when the user works on authentication in Laravel. An agent skill from coollabsio/coolify.

    63k GitHub starsUsed in 4 repos~1.9k tokens
    Backend & APIsAuto-check passed

More from ArtisanCloud/PowerX

All 21 skills in this repo
  • 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
  • Crud Model

    ArtisanCloud/PowerX

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

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

Categories

Questions about API Naming

What does API Naming do?

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

When should I use API Naming?

API Naming fits situations like: backend & APIs work in your project.

How do I install API Naming in Claude Code?

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

How do I install API Naming in Codex?

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

Can I use API Naming 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 api-naming -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/api-naming, .gemini/skills/api-naming, .github/skills/api-naming and .opencode/skills/api-naming in your project.

What does API Naming need to run?

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

Does API Naming 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 API Naming 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 API Naming use?

API Naming 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 API Naming use?

About 1.1k tokens (SKILL.md is roughly 4.6k 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 API Naming?

Skills that share tags, products or a category with API Naming: Configuring Horizon (coollabsio/coolify, 63k stars), Nestjs Best Practices (rolling-scopes/rsschool-app, 10k stars), Sub2API Admin (Wei-Shaw/sub2api, 43k stars) and Firecrawl Build Onboarding (firecrawl/firecrawl, 189k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains API Naming?

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 7, 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.