Token导航 LogoToken导航TokenDH.com
研究检索需要联网clawhub未标认证来源可访问clear审计通过

agentic-api-transformeragentic API transformer 搜索

Agent Skill

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

总安装

5,727

周安装

246

GitHub Stars

公开资料未说明

下载量

2,007
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:agentic-api-transformer(agentic API transformer 搜索)
来源仓库:https://github.com/tomsun28/agentic-api-transformer
安装命令:
openclaw skills install agentic-api-transformer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install agentic-api-transformer

简介

agentic-api-transformer 用于辅助 API 设计、接口文档和请求响应结构梳理。

  • 适合让 Agent 生成 OpenAPI 草稿、检查字段命名或整理错误码。
  • 使用时需确认业务语义、鉴权方式、分页和错误处理规则,避免凭空补字段。
  • 通过 clawhub 安装,建议结合来源仓库和 README 核验具体用法。
  • 适用宿主包括 OpenClaw,接入前应确认版本、权限和运行环境要求。

SKILL.md

name
agentic-api-transformer
description
Transform existing API systems to follow the Agentic API Spec design with dynamic discovery and progressive disclosure
version
0.1.0
metadata
openclaw
homepage
https://github.com/tomsun28/agent-api-spec

Agentic API Transformer Skill

Purpose

This skill helps you transform existing API systems to follow the Agentic API Spec design. It enables AI agents to discover APIs dynamically at runtime instead of loading massive static documentation upfront.

Use this skill when:

  • Converting traditional REST APIs to agent-friendly formats
  • Adding relates fields to API responses for progressive disclosure
  • Generating /api/llms.txt entry points for API discovery
  • Validating API compliance with the Agentic API specification

Core concepts:

  • Dynamic API Discovery: APIs expose their capabilities through runtime responses
  • Relates Fields: Each response includes next-step actions the agent can take
  • Progressive Disclosure: Agents learn only what they need, when they need it
  • Error Code Standardization: Stable error codes enable predictable agent behavior

Workflow

When the user asks to transform their API to the Agentic API format:

1. Analyze Existing API

  • Parse OpenAPI/Swagger specifications if available
  • Identify CRUD operations and resource relationships
  • Map resource hierarchies and dependencies
  • Extract parameter schemas and response structures
  • Generate TypeChat schemas for type definitions

Tool: Use API analysis utilities to scan existing endpoints Available approaches:

  • OpenAPI/Swagger parser libraries
  • Manual endpoint documentation review
  • Automated API discovery tools

2. Transform API Responses

  • Add the three core fields: data, error, relates
  • Standardize error codes (e.g., TASK_LOCKED, INVALID_PARAM)
  • Generate relates arrays with next-step actions
  • Create middleware for automatic transformation
  • Preserve existing business logic without rewrites

Tool: Use response transformation utilities Available approaches:

  • Middleware wrappers for your framework
  • Response interceptors and decorators
  • Manual response formatting helpers

3. Generate API Entry Point

  • Create /api/llms.txt endpoint for API discovery
  • List top-level operations available to the current user
  • Include TypeChat schemas for each entry API
  • Add authentication requirements and usage guides
  • Organize APIs by functionality or resource type

Tool: Use entry point generators Available approaches:

  • Template-based file generators
  • Dynamic endpoint builders
  • Static file generators with metadata

4. Generate Framework Code

  • Detect the user's backend framework (Express, FastAPI, Spring Boot, Gin)
  • Generate middleware for response transformation
  • Create controller templates with proper structure
  • Provide route handler examples
  • Generate complete project structure if needed

Tool: Use code template systems Available approaches:

  • Framework-specific template engines
  • Code generators with scaffolding
  • Boilerplate plate generators

5. Validate Compliance

  • Check all responses include data, error, relates fields
  • Verify relates entries have method, path, desc, schema
  • Ensure error codes are stable and documented
  • Run automated test suites against transformed APIs
  • Generate compliance reports with actionable recommendations

Tool: Use API validation utilities Available approaches:

  • Compliance testing frameworks
  • Schema validation tools
  • Automated API testing suites

Output Format

After transformation, present:

Analysis Summary

  • Total endpoints analyzed
  • Resource relationships discovered
  • Required transformations identified

Generated Code

  • Middleware implementation for the detected framework
  • Example transformed response structure
  • /api/llms.txt content

Validation Results

  • Compliance status (passed/failed)
  • Issues found with line references
  • Recommendations for fixes

Next Steps

  • Installation commands for dependencies
  • Integration instructions
  • Testing commands to verify the transformation

Rules

Critical Requirements

  • Always preserve business logic: Never rewrite existing API logic, only wrap responses
  • Validate before deploying: Run compliance checks on all transformed endpoints
  • Use stable error codes: Error codes must be consistent and documented (e.g., TASK_LOCKED, not generic messages)
  • Generate complete relates: Every relates entry must include method, path, desc, and schema

Best Practices

  • Start with analysis: Always run API Analyzer before making changes
  • Incremental transformation: Transform key endpoints first, then expand
  • Framework detection: Auto-detect the user's framework from their codebase
  • Test thoroughly: Run validation suite before marking transformation complete
  • Document changes: Generate clear integration instructions for developers

Error Handling

  • If OpenAPI spec is missing, ask user to provide API documentation or endpoint list
  • If framework cannot be detected, ask user which framework they're using
  • If validation fails, provide specific fixes with code examples
  • If dependencies are missing, provide installation commands

Security

  • Never expose API keys or credentials in generated code
  • Warn if relates expose sensitive operations without auth checks
  • Flag any hardcoded secrets in validation reports

Examples

Example 1: Quick API Transformation

# Analyze existing API (using OpenAPI parser)
# Example: Use swagger-parser or similar library

# Transform responses (using middleware)
# Example: Create response wrapper in your framework

# Output format:
# {
#   "data": {"id": "task_123", "title": "Fix bug"},
#   "error": null,
#   "relates": [
#     {
#       "method": "PUT",
#       "path": "/tasks/{id}",
#       "desc": "Update task info",
#       "schema": "interface UpdateTask { title?: string; completed?: boolean; }"
#     }
#   ]
# }

Example 2: Generate Entry Point

# Task Manager API

Manage tasks and projects with AI-friendly endpoints.

## Entry APIs

### POST /tasks
desc: Create a new task with specified priority  
schema: interface CreateTask { title: string; priority: 'low' | 'medium' | 'high'; }

### GET /tasks
desc: List all tasks with pagination  
schema: interface ListTasks { page?: number; limit?: number; }

Generate this file using:

  • Template engines (Handlebars, Mustache)
  • Static site generators
  • Framework-specific routing
  • Manual file creation

Example 3: Framework-Specific Middleware

// Express.js middleware example
app.use((req, res, next) => {
  const originalSend = res.send;
  res.send = function(data) {
    const transformed = {
      data: data,
      error: null,
      relates: generateRelates(req.path, req.method)
    };
    originalSend.call(this, transformed);
  };
  next();
});
# FastAPI middleware example
from fastapi import Request, Response
import json

async def agentic_middleware(request: Request, call_next):
    response = await call_next(request)
    
    if response.headers.get("content-type", "").startswith("application/json"):
        data = json.loads(response.body)
        transformed = {
            "data": data,
            "error": None,
            "relates": generate_relates(request.url.path, request.method)
        }
        response.body = json.dumps(transformed).encode()
    
    return response

Similar patterns apply to Spring Boot, Go/Gin, and other frameworks.

Reference: Agentic API Response Structure

All transformed APIs must return this structure:

{
  "data": {},    // Business data (current state)
  "error": {     // Error control
    "code": "STABLE_ERROR_CODE",
    "message": "Human-readable message"
  },
  "relates": [   // Related actions (future options)
    {
      "method": "GET|POST|PUT|DELETE",
      "path": "/path/to/resource",
      "desc": "Brief description of the API's intent and parameters",
      "schema": "type Schema = { param: string; }"
    }
  ]
}

Reference: /api/llms.txt Format

# Project Name

Project description, usage guide, and authentication info.

## Entry APIs

### POST /tasks
desc: Create a new task with specified priority  
schema: interface CreateTask { title: string; priority: 'low' | 'medium' | 'high'; }

### GET /tasks
desc: List all tasks with pagination  
schema: interface ListTasks { page?: number; limit?: number; }

Troubleshooting

Missing Relates

Problem: Responses don't include next-step actions Fix: Ensure resource relationship mapping in analyzer, check relates generation logic

Invalid TypeChat Schemas

Problem: Schema validation fails Fix: Use TypeScript interface syntax, validate with TypeChat parser

Validation Errors

Problem: Compliance checks fail Fix: Review validation report, fix missing fields, ensure stable error codes

Advanced: Custom Relates Logic

For complex workflows with conditional next steps:

# For complex workflows with conditional next steps:
# Use business logic to determine relates based on:
# - Current resource state
# - User permissions/roles
# - Workflow stage
# - Contextual factors

# Example logic (pseudocode):
if current_state == 'pending' and user.can_approve:
    relates.append({
        'method': 'POST',
        'path': '/approvals',
        'desc': 'Approve pending request',
        'schema': 'type Approve = { request_id: string; }'
    })

Transform your APIs for the AI agent era!

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

78.33%
按下载量换算1,572

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills