Skill Purpose
Use CLI commands or API interfaces provided by the skill4agent platform to implement a complete workflow for searching skills, reading skill details, and installing skills.
Usage Options
This skill provides two mutually exclusive usage options:
- 1. CLI Option: Requires Node.js environment, uses
npx skill4agent commands - API Option: No external dependencies, uses direct HTTPS requests to skill4agent.com
Choose one option based on the available environment. If Node.js is available, prefer the CLI option for convenience. If Node.js is not available, use the API option.
Three Core Operations
1. Search Skills (search)
Purpose: Find relevant skills using Chinese, English, or mixed Chinese-English keywords
CLI Command (requires Node.js environment)
CODEBLOCK0
API Interface
CODEBLOCK1
Parameter Description:
- -
keyword (required): Search keyword (supports Chinese, English, or mixed Chinese-English) - INLINECODE2 (optional): Number of returned results, default 10, maximum 50
Important Return Fields:
- -
skillId: Skill ID - INLINECODE4 : Skill source repository
- INLINECODE5 : Skill name
- INLINECODE6 : Skill description
- INLINECODE7 : Skill tags
- INLINECODE8 : Number of installations
- INLINECODE9 : Skill detail URL
- INLINECODE10 : Skill download URL
- INLINECODE11 : Translation information (original language, whether translation is available, translated language)
- INLINECODE12 : Script check information (whether scripts are included, whether sensitive code exists, specific locations of sensitive code)
2. Read Skills (read)
Purpose: View detailed information and complete content of skill (SKILL.md)
CLI Command (requires Node.js environment)
CODEBLOCK2
API Interface
CODEBLOCK3
Parameter Description:
- -
source (required): Skill source repository (obtained from search results) - INLINECODE14 (required): Skill name (obtained from search results)
- INLINECODE15 (optional): Content type (
original/translated), default INLINECODE18
Important Return Fields:
- -
skillId: Skill ID - INLINECODE20 : Skill source repository
- INLINECODE21 : Skill name
- INLINECODE22 : Skill download URL
- INLINECODE23 : Translation information (original language, whether translation is available, translated language)
- INLINECODE24 : Script check information (whether scripts are included, whether sensitive code exists, specific locations of sensitive code)
- INLINECODE25 : Detailed skill content (complete content of SKILL.md)
3. Install Skills (install)
Purpose: Install skills to local projects
CLI Command (requires Node.js environment)
CODEBLOCK4
API Interface
CODEBLOCK5
Parameter Description:
- -
skillId (required): Skill ID (obtained from search results or skill detail information) - INLINECODE27 (optional): Content type (
original/translated), default INLINECODE30
Installation Instructions
- - CLI command: Installs to
.agents/skills/<skill_name> directory under the current directory - API interface: Download ZIP file and extract to get
<skill_name> directory - To install the skill to other paths (e.g., user-specified or application-required paths), move the skill directory to the target location manually
Script Security Check
Use the returned
script field to check whether the skill contains scripts and whether sensitive code exists.
- -
has_script: true means the skill contains scripts - INLINECODE36 :
-
safe: Script is safe
-
need attention: Contains sensitive code
- -
script_check_notes: Specific locations of sensitive code, need to recheck after installation
Note: For skills that contain scripts with sensitive code, you must obtain user consent before installation. After installation, recheck the sensitive code locations listed in script_check_notes along with the code context to ensure there are no risks of malicious programs, unauthorized access to user private information, modification or deletion of local files, or changes to system configurations.
Scenario-based Workflows
Scenario 1: Only understand related skills
- - Action: Use keywords to search for relevant skills
- Output: Summarize search results and wait for user's further instructions
Scenario 2: Find suitable skills to complete tasks
- 1. Search: Use keywords to search for relevant skills
- Filter: Preliminary filtering based on
description, tags, and INLINECODE43 - Read: View detailed information about candidate skills, analyze whether the skill meets the task requirements
- Recommend: Recommend the most suitable skills to users (if the skill contains scripts with sensitive code, you must inform the user)
Scenario 3: Search and install skills
- 1. Search: Use keywords to search for relevant skills
- Filter: Filter suitable skills based on search results
- Read (if needed): Further understand skill details, analyze whether the skill meets the task requirements
- Install: Install the skill to the required directory (for skills containing scripts with sensitive code, do NOT install without user consent - you must obtain user consent before installing)
- Script Security Recheck: If the skill contains scripts with sensitive code, recheck the sensitive code locations listed in
script_check_notes along with the code context after installation to ensure there are no risks of malicious programs, unauthorized access to user private information, modification or deletion of local files, or changes to system configurations.
Search Optimization Suggestions
When no results are found:
- 1. Optimize keywords: Use more general or concise keywords
- Switch language:
- If English search returns no results → Try Chinese or mixed Chinese-English keywords
- If Chinese search returns no results → Try English or mixed Chinese-English keywords
Best Practices
- - JSON Format: Always add
-j parameter to search and read commands to return JSON format output for easier parsing - Language Version Selection: Choose appropriate version based on user's preferred language (check original and translated languages via
translation field)
技能目的
使用skill4agent平台提供的CLI命令或API接口,实现搜索技能、阅读技能详情和安装技能的完整工作流程。
使用选项
本技能提供两种互斥的使用选项:
- 1. CLI选项:需要Node.js环境,使用npx skill4agent命令
- API选项:无外部依赖,直接向skill4agent.com发送HTTPS请求
根据可用环境选择一种选项。如果Node.js可用,建议使用CLI选项以方便操作。如果Node.js不可用,则使用API选项。
三个核心操作
1. 搜索技能(search)
目的:使用中文、英文或中英文混合关键词查找相关技能
CLI命令(需要Node.js环境)
bash
基础搜索(建议使用-j参数输出JSON格式)
npx skill4agent search <关键词> -j
控制返回结果数量(建议使用-j参数输出JSON格式)
npx skill4agent search <关键词> -j -l <数量>
API接口
https://skill4agent.com/api/search?keyword=<关键词>
参数说明:
- - keyword(必填):搜索关键词(支持中文、英文或中英文混合)
- limit(可选):返回结果数量,默认10,最大50
重要返回字段:
- - skillId:技能ID
- source:技能来源仓库
- skillname:技能名称
- description:技能描述
- tags:技能标签
- totalInstalls:安装次数
- readskillurl:技能详情URL
- downloadzip_url:技能下载URL
- translation:翻译信息(原始语言、是否有翻译、翻译后的语言)
- script:脚本检查信息(是否包含脚本、是否存在敏感代码、敏感代码的具体位置)
2. 阅读技能(read)
目的:查看技能的详细信息和完整内容(SKILL.md)
CLI命令(需要Node.js环境)
bash
阅读原始内容(建议使用-j参数输出JSON格式)
npx skill4agent read <来源> <技能名称> -j
阅读翻译内容(建议使用-j参数输出JSON格式)
npx skill4agent read <来源> <技能名称> --type translated -j
API接口
https://skill4agent.com/api/skills/info?source=<来源>&skill_name=<技能名称>
参数说明:
- - source(必填):技能来源仓库(从搜索结果获取)
- skill_name(必填):技能名称(从搜索结果获取)
- type(可选):内容类型(original/translated),默认original
重要返回字段:
- - skillId:技能ID
- source:技能来源仓库
- skillname:技能名称
- downloadzip_url:技能下载URL
- translation:翻译信息(原始语言、是否有翻译、翻译后的语言)
- script:脚本检查信息(是否包含脚本、是否存在敏感代码、敏感代码的具体位置)
- content:技能详细内容(SKILL.md的完整内容)
3. 安装技能(install)
目的:将技能安装到本地项目
CLI命令(需要Node.js环境)
bash
安装原始技能
npx skill4agent install <来源> <技能名称>
安装翻译后的技能
npx skill4agent install <来源> <技能名称> --type translated
API接口
https://skill4agent.com/api/download/?type=<类型>
参数说明:
- - skillId(必填):技能ID(从搜索结果或技能详情信息获取)
- type(可选):内容类型(original/translated),默认original
安装说明
- - CLI命令:安装到当前目录下的.agents/skills/<技能名称>目录
- API接口:下载ZIP文件并解压,获取<技能名称>目录
- 如需将技能安装到其他路径(如用户指定或应用要求的路径),需手动将技能目录移动到目标位置
脚本安全检查
使用返回的script字段检查技能是否包含脚本以及是否存在敏感代码。
- - hasscript:true表示技能包含脚本
- scriptcheck_result:
- safe:脚本安全
- need attention:包含敏感代码
- - scriptchecknotes:敏感代码的具体位置,安装后需重新检查
注意:对于包含敏感代码脚本的技能,安装前必须获得用户同意。安装后,需根据scriptchecknotes中列出的敏感代码位置,结合代码上下文重新检查,确保不存在恶意程序、未经授权访问用户隐私信息、修改或删除本地文件、更改系统配置等风险。
场景化工作流程
场景一:仅了解相关技能
- - 操作:使用关键词搜索相关技能
- 输出:总结搜索结果,等待用户进一步指示
场景二:找到合适的技能完成任务
- 1. 搜索:使用关键词搜索相关技能
- 筛选:根据description、tags和totalInstalls进行初步筛选
- 阅读:查看候选技能的详细信息,分析技能是否满足任务需求
- 推荐:向用户推荐最合适的技能(如果技能包含敏感代码脚本,必须告知用户)
场景三:搜索并安装技能
- 1. 搜索:使用关键词搜索相关技能
- 筛选:根据搜索结果筛选合适的技能
- 阅读(如需):进一步了解技能详情,分析技能是否满足任务需求
- 安装:将技能安装到所需目录(对于包含敏感代码脚本的技能,未经用户同意不得安装——安装前必须获得用户同意)
- 脚本安全复查:如果技能包含敏感代码脚本,安装后需根据scriptchecknotes中列出的敏感代码位置,结合代码上下文重新检查,确保不存在恶意程序、未经授权访问用户隐私信息、修改或删除本地文件、更改系统配置等风险。
搜索优化建议
当未找到结果时:
- 1. 优化关键词:使用更通用或更简洁的关键词
- 切换语言:
- 如果英文搜索无结果→尝试中文或中英文混合关键词
- 如果中文搜索无结果→尝试英文或中英文混合关键词
最佳实践
- - JSON格式:搜索和阅读命令始终添加-j参数,返回JSON格式输出以便于解析
- 语言版本选择:根据用户偏好的语言选择合适的版本(通过translation字段查看原始语言和翻译语言)