Agent Skills
› nightly-labs/openbot
› API Skill Builder
API Skill Builder
GitHub将重复的API调用或工作流转化为可测试的本地OpenBot技能,包括读取文档、获取样本、编写SKILL.md和脚本、安全测试及注册。
Trigger Scenarios
用户重复向服务发送相同请求
代理需手动执行的重复工作流
Install
npx skills add nightly-labs/openbot --skill API Skill Builder -g -y
SKILL.md
Frontmatter
{
"name": "API Skill Builder",
"description": "Turn an API or a repeated workflow into a tested local OpenBot skill. Read the docs, sample one real response first, keep keys out of files, write the smallest SKILL.md and a script only when needed, test it, then register it. Use when the user repeats the same request against a service."
}
API Skill Builder
When to use
- The user repeats the same request to a service, or a workflow that the agent does by hand.
- Not for a one-time request. Do it directly and do not make a skill.
Inputs
- The job. One sentence: the request the user repeats, its inputs, and the result they want. If it is
not clear, ask one question with
ask_user. - The docs. Open them with
openbot_browser(callopenbot_browser.list_tabsfirst), or ask the user to paste the relevant page. You need: the base address, the auth method, the one or two endpoints for the job, paging, and rate limits. - The key. If the API needs a key or token, check whether one is already saved with
list_api_keys. If not, callrequest_api_keywith the variable name that the script reads, such asWEATHER_API_KEY. Never ask for a key in chat. If the user pastes one, ask again withrequest_api_keyand do not repeat the value.
Steps
- Call
list_local_skills. If a skill for this job exists, read it withread_local_skilland revise it. - Data shape first. Make ONE real read-only request with the smallest input. Read the key from its
saved file in the same command:
curl -s -H "Authorization: Bearer $(cat '<path>')" .... Never print the key. Record the field names, types, and one example value per field. Remove personal data from the example. Do not call an endpoint that writes, sends or charges to get a sample. - Decide what the skill keeps: the inputs it takes, the fields it returns, and the output format.
- Make a folder in your workspace, for example
skills/<slug>/. WriteSKILL.mdwith frontmattername(80 characters or less) anddescription(500 or less). Optional:example-prompt. In the body: the outcome, the steps, the request and the fields, the error cases, and how to check the result. - Add a script in
scripts/only when the steps are hard to repeat by hand: paging, signing, or parsing. Use what the computer already has (shell tools, Python or Node standard library). The script reads the key from an environment variable. No secrets, environment files, dependencies, symlinks or archives in the folder. - Test. Follow the skill on a representative request from the user. Compare the result with the sample. Test one failure: a bad input or a missing key must give a clear message, not a stack trace.
- Register:
create_skillwith the workspace-relative folder path, orrevise_skillwith the skill ID, theexpectedRevision, and the folder path. Report the returned ID and revision.
Checks
Each check is PASS or FAIL. Register only when checks 1 to 4 pass.
- Shape known: one real response was read, and the skill names the fields it uses.
- Key safe: no key, token or password in any file, message, tool argument or memory. Search the folder for "token", "secret", "key=" and "Bearer" before you register.
- Smallest: every section and script is used by the job. Nothing for jobs the user did not ask for.
- Tested: the representative request and one failure case ran, with the output shown.
- Registered: the tool returned an ID and a revision.
Output
Skill: <name> — <ID>, revision <n>
Job: <one sentence>
Request: <method> <endpoint> — fields used: <list>
Key: <variable name> (saved with request_api_key) | none
Checks
1. Shape known — PASS — sampled <endpoint> at <time>
2. Key safe — PASS
3. Smallest — PASS — SKILL.md, scripts/<file>
4. Tested — PASS — "<request>" → <result summary>; bad input → "<message>"
5. Registered — PASS
Installed on: this agent only
Approvals and stop conditions
- Creating a skill does not allow publishing, sharing or sending. Ask the user before you publish it, share it, or install it on another agent.
- Do not call endpoints that write, send, delete or spend money without the user's yes, also in tests.
- Stop if the API terms forbid the use, or the docs require a paid plan the user has not confirmed.
- Ask before you write a key into an environment file.
Common failures
- Writing the skill from the docs alone. The real response often differs.
- A key in the script, the example, or the chat.
- A large script for a job that two documented requests can do.
- Registering a skill that never ran on a real request.
Version History
- ac99196 Current 2026-11-02 08:40


