Skills API

用於列出、搜尋和取得技能的端點。

列出技能

GET /api/v1/skills

參數

| 參數 | 類型 | 描述 | |-----------|------|-------------| | page | number | 頁碼(預設:1) | | limit | number | 每頁項目數(預設:20,最大:100) | | sort | string | 排序依據:starsupdatedname | | order | string | 排序順序:ascdesc | | category | string | 依分類 slug 篩選 | | platform | string | 依平台篩選 |

請求範例

bash
curl "https://skillsmp.com/api/v1/skills?category=development&sort=stars&order=desc&limit=10"

回應範例

json
{
  "data": [
    {
      "id": "123",
      "owner": "anthropic",
      "repo": "brand-guidelines",
      "name": "Brand Guidelines",
      "description": "Maintain consistent brand identity",
      "stars": 1250,
      "forks": 89,
      "updatedAt": "2024-01-15T10:30:00Z",
      "categories": ["marketing", "design"],
      "platforms": ["claude-code", "codex", "chatgpt"]
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 150,
    "totalPages": 15
  }
}

取得技能

GET /api/v1/skills/:owner/:repo

請求範例

bash
curl https://skillsmp.com/api/v1/skills/anthropic/brand-guidelines

回應範例

json
{
  "data": {
    "id": "123",
    "owner": "anthropic",
    "repo": "brand-guidelines",
    "name": "Brand Guidelines",
    "description": "Maintain consistent brand identity across all AI-generated content",
    "content": "# Brand Guidelines\n\n## Overview...",
    "stars": 1250,
    "forks": 89,
    "watchers": 45,
    "openIssues": 3,
    "license": "MIT",
    "createdAt": "2023-06-15T10:30:00Z",
    "updatedAt": "2024-01-15T10:30:00Z",
    "pushedAt": "2024-01-14T15:00:00Z",
    "categories": ["marketing", "design"],
    "platforms": ["claude-code", "codex", "chatgpt"],
    "author": {
      "name": "Anthropic",
      "avatar": "https://github.com/anthropic.png"
    },
    "installCommands": {
      "claudeCode": "claude skill add anthropic/brand-guidelines",
      "codex": "codex config add-skill anthropic/brand-guidelines",
      "chatgpt": "Copy to Custom Instructions"
    }
  }
}

取得技能內容

GET /api/v1/skills/:owner/:repo/content

回傳原始 SKILL.md 內容。

請求範例

bash
curl https://skillsmp.com/api/v1/skills/anthropic/brand-guidelines/content

回應範例

json
{
  "data": {
    "content": "---\nname: Brand Guidelines\n...",
    "sha": "abc123def",
    "size": 4523
  }
}

取得技能統計資料

GET /api/v1/skills/:owner/:repo/stats

回應範例

json
{
  "data": {
    "views": 15234,
    "installs": 3456,
    "favorites": 789,
    "starHistory": [
      {"date": "2024-01-01", "stars": 1100},
      {"date": "2024-01-08", "stars": 1150},
      {"date": "2024-01-15", "stars": 1250}
    ]
  }
}

錯誤代碼

| 代碼 | HTTP 狀態 | 描述 | |------|-------------|-------------| | NOT_FOUND | 404 | 技能不存在 | | INVALID_PARAMS | 400 | 無效的查詢參數 | | RATE_LIMITED | 429 | 請求過多 | | SERVER_ERROR | 500 | 內部錯誤 |