integrate-context-matic
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAPI Integration
API集成
When the user asks to integrate a third-party API or implement anything involving an external API or SDK, follow this workflow. Do not rely on your own knowledge for available APIs or their capabilities — always use the context-matic MCP server.
当用户要求集成第三方API或实现任何涉及外部API或SDK的功能时,请遵循此工作流。不要依赖你自身关于可用API及其能力的知识——始终使用context-matic MCP服务器。
When to Apply
适用场景
Apply this skill when the user:
- Asks to integrate a third-party API
- Wants to add a client or SDK for an external service
- Requests implementation that depends on an external API
- Mentions a specific API (e.g. PayPal, Twilio) and implementation or integration
当用户有以下需求时使用本技能:
- 要求集成第三方API
- 想要为外部服务添加客户端或SDK
- 请求实现依赖外部API的功能
- 提到具体API(例如PayPal、Twilio)以及相关实现或集成需求
Workflow
工作流
1. Ensure Guidelines and Skills Exist
1. 确认指南和技能已存在
1a. Detect the Project's Primary Language
1a. 检测项目主语言
Before checking for guidelines or skills, identify the project's primary programming language by inspecting the workspace:
| File / Pattern | Language |
|---|---|
| |
| |
| |
| |
| |
| |
| |
Use the detected language in all subsequent steps wherever is required.
language在检查指南或技能之前,通过检查工作区识别项目的主要编程语言:
| 文件 / 匹配规则 | 语言 |
|---|---|
| |
包含 | |
| |
| |
| |
| |
| |
在后续所有需要填写的步骤中使用检测到的语言。
language1b. Check for Existing Guidelines and Skills
1b. 检查现有指南和技能
Check whether guidelines and skills have already been added for this project by looking for their presence in the workspace.
- is the skill produced by add_skills.
{language}-conventions - and
{language}-security-guidelines.mdare language-specific guideline files produced by add_guidelines.{language}-test-guidelines.md - is a workflow guideline file produced by add_guidelines (it is not language-specific).
update-activity-workflow.md - Check these independently. Do not treat the presence of one set as proof that the other set already exists.
- If any required guideline files for this project are missing: Call add_guidelines.
- If is missing for the project's language: Call add_skills.
{language}-conventions - If all required guideline files and already exist: Skip this step and proceed to step 2.
{language}-conventions
通过检查工作区内容,确认该项目是否已经添加了相关指南和技能。
- 是add_skills生成的技能文件。
{language}-conventions - 和
{language}-security-guidelines.md是add_guidelines生成的语言特定指南文件。{language}-test-guidelines.md - 是add_guidelines生成的工作流指南文件(不区分语言)。
update-activity-workflow.md - 独立检查以上文件,不要认为其中一类存在就代表另一类也已经存在。
- 如果项目缺少任何必填的指南文件: 调用add_guidelines。
- 如果项目缺少对应语言的: 调用add_skills。
{language}-conventions - 如果所有必填指南文件和都已存在: 跳过此步骤,继续执行步骤2。
{language}-conventions
2. Discover Available APIs
2. 发现可用API
Call fetch_api to find available APIs — always start here.
- Provide the parameter using the language detected in step 1a.
language - The response returns available APIs with their names, descriptions, and values.
key - Identify the API that matches the user's request based on the name and description.
- Extract the correct for the user's requested API before proceeding. This key will be used for all subsequent tool calls related to that API.
key
If the requested API is not in the list:
- Inform the user that the API is not currently available in this plugin (context-matic) and stop.
- Request guidance from user on how to proceed with the API's integration.
调用fetch_api查找可用API——始终从这一步开始。
- 传入步骤1a中检测到的语言作为参数。
language - 响应会返回可用API的名称、描述和值。
key - 根据名称和描述识别匹配用户需求的API。
- 在继续后续步骤前提取用户请求的API对应的正确,该key将用于所有和此API相关的后续工具调用。
key
如果请求的API不在列表中:
- 告知用户该API目前不在本插件(context-matic)的支持范围内,终止当前流程。
- 向用户请求关于如何继续集成该API的指导。
3. Get Integration Guidance
3. 获取集成指南
- Provide with:
ask,language(from step 2), and yourkey.query - Break complex questions into smaller focused queries for best results:
- "How do I authenticate?"
- "How do I create a payment?"
- "What are the rate limits?"
- 向传入:
ask、(步骤2得到的)language以及你的key。query - 将复杂问题拆分为更小的针对性查询以获得最佳结果:
- "我该如何进行身份验证?"
- "我该如何创建支付订单?"
- "接口的限流规则是什么?"
4. Look Up SDK Models and Endpoints (as needed)
4. 按需查询SDK模型和端点
These tools return definitions only — they do not call APIs or generate code.
- model_search — look up a model/object definition.
- Provide: ,
language, and an exact or partial case-sensitive model name askey(e.g.query,availableBalance).TransactionId
- Provide:
- endpoint_search — look up an endpoint method's details.
- Provide: ,
language, and an exact or partial case-sensitive method name askey(e.g.query,createUser).get_account_balance
- Provide:
这些工具仅返回定义内容——不会调用API或生成代码。
- model_search — 查询模型/对象定义。
- 传入:、
language,以及精确或部分匹配的区分大小写的模型名称作为key(例如query、availableBalance)。TransactionId
- 传入:
- endpoint_search — 查询端点方法的详情。
- 传入:、
language,以及精确或部分匹配的区分大小写的方法名称作为key(例如query、createUser)。get_account_balance
- 传入:
5. Record Milestones
5. 记录里程碑
Call update_activity (with the appropriate ) whenever one of these is concretely reached in code or infrastructure — not merely mentioned or planned:
milestone| Milestone | When to pass it |
|---|---|
| SDK package is installed in the project (e.g. |
| API credentials are explicitly written into the project's runtime environment (e.g. present in a |
| First API call code written and executed |
| Developer reports a bug, error response, or failing call |
| Fix applied and API call confirmed working |
当以下里程碑在代码或基础设施中切实达成时调用update_activity(传入对应的参数)——仅提到或计划完成不算:
milestone| 里程碑 | 触发时机 |
|---|---|
| SDK包已成功安装到项目中(例如 |
| API凭证已明确写入项目的运行时环境(例如存在于 |
| 首个API调用代码已编写并执行 |
| 开发者上报bug、错误响应或调用失败 |
| 修复已应用,且API调用已确认可以正常工作 |
Checklist
检查清单
- Project's primary language detected (step 1a)
- called if guideline files were missing, otherwise skipped
add_guidelines - called if
add_skillswas missing, otherwise skipped{language}-conventions - called with correct
fetch_apifor the projectlanguage - Correct identified for the requested API (or user informed if not found)
key - called only when a milestone is concretely reached in code/infrastructure — never for questions, searches, or tool lookups
update_activity - called with the appropriate
update_activityat each integration milestonemilestone - used for integration guidance and code samples
ask - /
model_searchused as needed for SDK detailsendpoint_search - Project compiles after each code modification
- 已检测项目主语言(步骤1a)
- 如果缺少指南文件已调用,否则跳过
add_guidelines - 如果缺少已调用
{language}-conventions,否则跳过add_skills - 已使用项目对应的正确参数调用
languagefetch_api - 已识别出请求API对应的正确(如果未找到已告知用户)
key - 仅当里程碑在代码/基础设施中切实达成时才调用——查询、搜索、工具查找场景下不调用
update_activity - 每个集成里程碑阶段都已传入对应的参数调用
milestoneupdate_activity - 已使用获取集成指南和代码示例
ask - 按需使用/
model_search查询SDK详情endpoint_search - 每次代码修改后项目都可以正常编译
Notes
注意事项
- API not found: If an API is missing from , do not guess at SDK usage — inform the user that the API is not currently available in this plugin and stop.
fetch_api - update_activity and fetch_api: is API discovery, not integration — do not call
fetch_apibefore it.update_activity
- 未找到API:如果返回结果中没有目标API,不要猜测SDK的使用方法——告知用户该API目前不在本插件的支持范围内并终止流程。
fetch_api - update_activity和fetch_api:属于API发现环节,不是集成环节——不要在此之前调用
fetch_api。update_activity