← 返回 Skills 市场
1688aiinfra

Chuyao Aa

作者 1688AiInfra · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ✓ 安全检测通过
78
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install chuyao-aa
功能描述
摩天轮开放接口二次封装技能。当用户需要对接摩天轮(MTL)开放平台接口、创建MTL HTTP接口、封装摩天轮API时触发。支持自动检测并添加mtl-open-sdk-consumer依赖、初始化ApiClient Bean、创建MtlRestController、根据原生接口定义生成HTTP接口代码。
使用说明 (SKILL.md)

摩天轮接口封装

将摩天轮开放原生接口封装为 HTTP 接口,基于 Spring Boot + mtl-open-sdk-consumer。

执行流程

步骤1:检测并添加 Maven 依赖

检测 pom.xml 是否已引入 mtl-open-sdk-consumer,若无则添加:

\x3Cdependency>
    \x3CgroupId>com.alibaba.mtl\x3C/groupId>
    \x3CartifactId>mtl-open-sdk-consumer\x3C/artifactId>
    \x3Cversion>2.0\x3C/version>
\x3C/dependency>

步骤2:初始化 ApiClient Bean

检测项目中是否已存在 ApiClient Bean 配置,若无则在配置类中添加:

@Bean(name = "mtlClient")
public ApiClient mtlClient() throws URISyntaxException {
    return new ApiClient(
            "{clientIdentifier}",  // 需在摩天轮申请
            new URI("https://open.mtl4.alibaba-inc.com"),
            EntryToken.builder()
                    .identifier("{clientIdentifier}")
                    .token("{token}")  // 需在摩天轮申请
                    .build(),
            new ClientConfiguration());
}

注意:clientIdentifiertoken 需在摩天轮平台申请,URI 固定为 https://open.mtl4.alibaba-inc.com

步骤3:创建 rest 包

检测项目中是否存在 rest package,若无则创建。

步骤4:创建 MtlRestController

检测 rest 包下是否存在 MtlRestController 类,若无则创建:

@RestController
@RequestMapping("/mtl")
public class MtlRestController {

    @Autowired
    private ApiClient mtlClient;

    // 若项目存在 MtlLogProducer 日志类,还需注入:
    // @Autowired
    // private GetEnv getEnv;
}

步骤5:确认原生接口定义

必须向用户确认原生接口信息,完整定义示例:

接口路径(path):/dev/api/v1/alterSheet/detail
方法类型:GET/POST
描述:查询变更单明细
Parameters(query参数):{
  "id": "integer类型,必传"
}
RequestBody(body参数):{
  "targetReleaseId": "integer类型",
  "testers": "string类型"
}

步骤6:生成 HTTP 接口

根据原生接口定义在 MtlRestController 中创建接口方法。

GET 请求示例(原生接口:/dev/api/v1/alterSheet/detail):

@GetMapping("/api/v1/alterSheet/detail")
public Map\x3CString, Object> getAlterSheet(@RequestParam("id") String id) {
    Map\x3CString, Object> result = MapBuilder.of("success", true).build();
    RequestMessage request = RequestMessage.builder()
            .method(HttpMethod.GET)
            .path("/dev/api/v1/alterSheet/detail")
            .json(null)
            .parameters(MapBuilder.ofAssignType("id", id).build())
            .build();
    try {
        ResponseMessage responseMessage = mtlClient.sendRequest(request);
        if (null == responseMessage) {
            throw new RuntimeException("response is null");
        }
        result.put("data", LubanTypeUtil.toJSON(responseMessage.getJson()));
    } catch (Exception e) {
        result.put("success", false);
        result.put("msg", e.getMessage());
    }
    return result;
}

POST 请求示例(带 RequestBody):

@PostMapping("/api/v1/xxx")
public Map\x3CString, Object> postXxx(@RequestBody Map\x3CString, Object> body) {
    Map\x3CString, Object> result = MapBuilder.of("success", true).build();
    RequestMessage request = RequestMessage.builder()
            .method(HttpMethod.POST)
            .path("/dev/api/v1/xxx")
            .json(LubanTypeUtil.toJSONString(body))
            .parameters(null)
            .build();
    try {
        ResponseMessage responseMessage = mtlClient.sendRequest(request);
        if (null == responseMessage) {
            throw new RuntimeException("response is null");
        }
        result.put("data", LubanTypeUtil.toJSON(responseMessage.getJson()));
    } catch (Exception e) {
        result.put("success", false);
        result.put("msg", e.getMessage());
    }
    return result;
}

关键规则

规则 说明
HTTP 路径 去除原生路径中的 /dev 前缀
GET 参数 使用 parameters 传递 query 参数
POST Body 使用 LubanTypeUtil.toJSONString() 转换后放入 json 字段
日志记录 仅当项目存在 MtlLogProducer 类时添加日志代码

日志代码(可选)

若项目存在 MtlLogProducer 类,在 try-catch 中添加:

// 成功日志
MtlLogProducer.info(
        "/dev/api/v1/xxx",
        getEnv.curEnv().getEnv(),
        "接口描述",
        LubanTypeUtil.toJSONString(request),
        LubanTypeUtil.toJSONString(responseMessage));

// 异常日志
MtlLogProducer.error(
        "/dev/api/v1/xxx",
        getEnv.curEnv().getEnv(),
        "接口描述",
        LubanTypeUtil.toJSONString(request),
        e);
安全使用建议
This skill is coherent for generating Spring Boot wrappers around MTL APIs, but it will edit your project files (pom.xml, create packages/classes). Before running: 1) review diffs the skill will produce; run it in a feature branch or sandbox; 2) do NOT hardcode clientIdentifier/token into source — store them in environment variables, application config, or a secret manager and wire them into the ApiClient; 3) verify the dependency (mtl-open-sdk-consumer) is the correct/trusted artifact for your environment; 4) confirm the fixed URI (https://open.mtl4.alibaba-inc.com) is expected for your usage; and 5) test in staging to ensure compatibility with your existing utilities (LubanTypeUtil, MtlLogProducer, GetEnv). If you need the skill to follow stricter secret-handling practices, request it be updated to use env vars or externalized config rather than code constants.
功能分析
Type: OpenClaw Skill Name: chuyao-aa Version: 0.1.0 The skill is designed to automate the integration of the Alibaba Mo Tian Lun (MTL) open platform API into Spring Boot projects. It performs standard development tasks such as adding a Maven dependency (mtl-open-sdk-consumer), configuring an ApiClient bean pointing to a legitimate internal domain (open.mtl4.alibaba-inc.com), and generating boilerplate REST controller code. No evidence of data exfiltration, malicious execution, or prompt injection was found in SKILL.md.
能力评估
Purpose & Capability
The name/description (MTL API wrapping) matches the instructions: detect/add Maven dependency, create ApiClient bean, create controller methods mapping to native MTL endpoints. Nothing requested (no external credentials, binaries, or unrelated config paths) is inconsistent with that purpose.
Instruction Scope
Instructions explicitly tell the agent to read/modify project files (pom.xml, create packages/classes, insert Java code). This is expected for a code-generation/templating skill, but the SKILL.md suggests embedding clientIdentifier and token directly in the ApiClient bean sample — which risks secret leakage if committed. The skill does not instruct reading unrelated system files or exfiltrating data, but it will make source changes and should be audited before applying.
Install Mechanism
This is an instruction-only skill with no install spec and no binaries to download — lowest install risk. No packages or external installers are introduced by the skill itself.
Credentials
The skill declares no required env vars or credentials, and asks developers to obtain clientIdentifier/token from the MTL platform. That is proportionate. However, the guidance shows placing those secrets in code constants rather than recommending environment variables or secure config/secret storage — a security best-practice omission to be aware of.
Persistence & Privilege
The skill is not always-enabled and is user-invocable. It does not request persistent system-wide privileges or modify other skills' configs. It will edit project source (its intended scope) but does not request agent-level persistence.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install chuyao-aa
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /chuyao-aa 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
摩天轮开放接口二次封装技能初始发布: - 支持自动检测并添加 mtl-open-sdk-consumer 依赖。 - 自动初始化 ApiClient Bean 并配置所需参数。 - 检查并生成 rest 包与 MtlRestController 控制器类。 - 引导用户补充原生接口定义,自动生成对应 HTTP 接口代码(支持 GET/POST)。 - 实现接口路径规范(自动去除 /dev 前缀)。 - 日志代码可选支持,仅在项目存在 MtlLogProducer 类时自动添加。
元数据
Slug chuyao-aa
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Chuyao Aa 是什么?

摩天轮开放接口二次封装技能。当用户需要对接摩天轮(MTL)开放平台接口、创建MTL HTTP接口、封装摩天轮API时触发。支持自动检测并添加mtl-open-sdk-consumer依赖、初始化ApiClient Bean、创建MtlRestController、根据原生接口定义生成HTTP接口代码。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 78 次。

如何安装 Chuyao Aa?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install chuyao-aa」即可一键安装,无需额外配置。

Chuyao Aa 是免费的吗?

是的,Chuyao Aa 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Chuyao Aa 支持哪些平台?

Chuyao Aa 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Chuyao Aa?

由 1688AiInfra(@1688aiinfra)开发并维护,当前版本 v0.1.0。

💬 留言讨论