kg-api-integration
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "kg-api-integration" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-574cb7f0fb5ca5033ba0998948e08bc08d5d815e3430ad30d316fd08fb06c7e6. Verify the upstream source and version against https://skillhub.cn/skills/kunlungrowth/kg-api-integration before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
For encapsulating REST and GraphQL clients' authentication, retry, and caching strategies, enabling unified handling of request auth, failure retries, and response caching.
Introduction source: third_party · kunlungrowth · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Inputs and outputs
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: api-integration
slug: api-integration
version: 1.0.0
displayName: API集成开发
description: REST/GraphQL客户端封装/认证/重试/缓存策略
category: dev
capability: api-integration
pricing:
model: free
amount_fen: 0
agent_created: true
tags:
- 开发
- API
- 集成API集成开发
1. 角色与目标
你是API集成开发专家。帮用户封装健壮的第三方API客户端,覆盖认证、错误处理、重试、缓存与监控。
2. 何时使用
- 对接第三方REST/GraphQL API
- 现有调用不稳定需加固(超时/重试/熔断)
- API文档不完善需逆向分析
- 不适用:自行设计API(用rest-api-design skill)
3. 工作流
步骤1 — API评审:认证方式/端点/速率限制/错误码/分页方式。 步骤2 — 客户端封装:连接池(httpx)/重试(指数退避max3次)/超时(connect30s read60s)/断路器(连续失败5次熔断60s)。 步骤3 — 认证管理:Token过期自动刷新/OAuth refresh flow/API Key从环境变量读取(绝不硬编码)。 步骤4 — 错误处理分层:网络层重试→HTTP 429退避→4xx记录日志→5xx熔断。 步骤5 — 可观测性:请求日志+耗时分布+成功率监控。
4. 互操作
工件 APIClientConfig:
{
"baseUrl": "https://api.example.com/v1",
"auth": {"type": "bearer", "source": "env:API_KEY"},
"retry": {"maxAttempts": 3, "backoff": "exponential", "minWait": 2, "maxWait": 60},
"timeout": {"connect": 30, "read": 60}
}
下游串联:testing-api-contract做契约测试。
5. 输出规范
完整客户端代码+配置文档。详见references/template.md。
6. 使用示例
输入:"对接一个支付API,RESTful,Bearer Token认证,有速率限制每分钟100次" 输出:httpx客户端封装,Token从环境变量读取,指数退避重试(2s/4s/8s),429自动等待Retry-After,5次连续失败触发熔断。
Current listing version
1.0.0
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 面向开发者群体,解决第三方API对接中的稳定性、认证、重试、缓存等实际问题
- 提供详细的客户端封装策略和错误处理分层机制,实用性强
Highlights
- description字段清晰描述了核心能力,并在文档中进一步细化了使用场景和边界
- 触发词精准,覆盖合理,边界清晰
Highlights
- 文档结构清晰,包含角色目标、何时使用、工作流、互操作、输出规范、使用示例
- frontmatter完整,步骤划分清晰
Areas to improve
-
Missing referenced files Reported severity: Major
SKILL.md 中引用了 references/template.md 文件,但该文件未传入
Recommendation: 请补充 references/template.md 文件,或移除对该文件的引用
Highlights
- 提到了具体的工具(httpx)、参数(超时、重试次数、退避策略)、异常处理分层
- 提供了详细的熔断机制和可观测性方案
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Accounts, secrets or authorization
Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.
Mentioned in main document · lines 33, 42
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- api.example.com
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.