Create, Evaluate, and Connect AI Skills
Python ai-agentsai-skillsartificial-intelligenceknowledge-graphlarge-language-modelsnatural-language-processingopenkgskillnetskills
update README.md
LiamLYYYa4e34a02681e
diff --git a/README.md b/README.mdindex 9daeafb..d8066d2 100644--- a/README.md+++ b/README.md@@ -1 +1,262 @@-test+<div align="center">++# SkillNet: Create, Evaluate, and Connect AI Skills++[](https://badge.fury.io/py/skillnet-ai)+[](https://opensource.org/licenses/MIT)+[](https://arxiv.org/)+[](http://skillnet.openkg.cn/)++</div>+++## π Table of Contents++- [π Overview](#-overview)+- [π Features](#-features)+- [π API Access](#-api-access)+- [π Python Toolkit (`skillnet-ai`)](#-python-toolkit-skillnet-ai)+ - [π₯ Installation](#-installation)+ - [π Python SDK Usage](#-usage-python-sdk)+ - [π» CLI Usage](#-cli-usage)+- [π Skill Structure](#-skill-structure)+- [πΊ Roadmap & Contributing](#-roadmap)++---++## π Overview++SkillNet is an open infrastructure for creating, evaluating, and organizing AI skills at scale.++## π Features++- **π Search**: Find skills using keywords match or semantic search.+- **π¦ One-Line Installation**: Download skill packages directly from GitHub repositories.+- **β¨ Skill Creation**: Automatically convert local files (agent execution logs, conversation logs ...) or GitHub repositories into structured, reusable `skill` packages using LLMs.+- **π Evaluation**: Evaluate and score skills for quality assurance (Safety, Completeness, Excutability, Modifiability, Cost-Aware).++---++## π API Access++SkillNet provides a public API to search skills. Support both keywords match and semantic search.++**Base Endpoint:** `http://api-skillnet.openkg.cn/v1/search`++### β‘ Quick Examples++**1. Keywords Match**++Find "development" tools sorted by stars.+```bash+curl -X GET http://api-skillnet.openkg.cn/v1/search?q=development&sort_by=stars&limit=5 \+ -H "accept: application/json"+```++**2. Vector Semantic Search**++Find skills related to "reading charts" using AI similarity.+```bash+curl -X GET http://api-skillnet.openkg.cn/v1/search?q=reading%20charts&mode=vector&threshold=0.8 \+ -H "accept: application/json"+```++### π‘ Parameter Reference++| Parameter | Type | Required | Default | Description |+| :--- | :--- | :---: | :--- | :--- |+| `q` | string | β | - | The search query (Keywords or Natural Language). |+| `mode` | string | - | `keyword` | `keyword` (Fuzzy match) or `vector` (Semantic AI). |+| `category` | string | - | `None` | Filter: Development, AIGC, Research, Science, etc. |+| `limit` | int | - | `10` | Results per request (Max: 50). |++**Mode Specific Parameters:**++* **Keyword Mode:** `page` (int), `min_stars` (int), `sort_by` (string: `stars` or `recent`)+* **Vector Mode:** `threshold` (float: `0.0` to `1.0`)++### π¦ Response Structure++<details>+<summary>Click to view JSON Response Example</summary>++```json+{+ "data": [+ {+ "skill_name": "pdf-extractor-v1",+ "skill_description": "Extracts text and tables from PDF documents.",+ "author": "openkg-team",+ "stars": 128,+ "skill_url": "http://...",+ "category": "Productivity"+ }+ ],+ "meta": {+ "query": "pdf",+ "mode": "keyword",+ "total": 1,+ "limit": 10,+ ...+ },+ "success": true+}+```+</details>++---++## π Python Toolkit (`skillnet-ai`)++**skillnet-ai** is the official Python Toolkit. It functions seamlessly as both a library and a CLI to **Create**, **Evaluate**, and **Organize** skills.++### π₯ Installation++```bash+pip install skillnet-ai+```++### π Usage (Python SDK)++The `SkillNetClient` is your main entry point.++#### 1. Initialization+```python+from skillnet_ai import SkillNetClient++client = SkillNetClient(+ api_key="sk-...", # Required for Creation, and Evaluation+ # base_url="...", # Optional: Custom LLM base URL+ # github_token="ghp-..." # Optional: For private repos or higher rate limits+)+```++#### 2. Search for Skills+Perform keywords match or semantic searches to find skills. (See Parameter Reference Above for configuration details.)++```python+# 1. Standard Keywords Match+results = client.search(q="pdf tool")++# 2. Semantic Search+results = client.search(q="Help me analyze financial PDF reports", mode="vector")++if results:+ top_skill = results[0]+ print(f"Found: {top_skill.skill_name} (Stars: {top_skill.stars})")+ print(f"URL: {top_skill.skill_url}")+```++#### 3. Install Skills+Download and install a skill directly from a URL (e.g., from above search results) into your local workspace.++```python+skill_url = "https://github.com/anthropics/skills/tree/main/skills/skill-creator"++try:+ # Downloads to ./my_agent_skills+ local_path = client.download(url=skill_url, target_dir="./my_agent_skills")+ print(f"Skill successfully installed at: {local_path}")+except Exception as e:+ print(f"Download failed: {e}")+```++#### 4. Create Skills+Turn local Trajectory or GitHub repository into a polished Skill Package (SKILL.md, scripts, etc.).++```python+# 1. Create from Local Trajectory+# Prepare your trajectory (e.g., a conversation log string)+trajectory_log = """+User: I need to rename all .jpg files in this folder to .png.+Agent: I will write a python script to iterate through the folder...+Agent: Script executed. Renamed 5 files.+"""++# Generate Skill, Returns a list of paths to the generated skill folders+created_paths = client.create(+ trajectory_content=trajectory_log,+ output_dir="./created_skills",+ model="gpt-4o"+)++# 2. Create from GitHub Repository+created_paths = client.create(+ github_url="https://github.com/zjunlp/DeepKE",+ output_dir="./created_skills",+ model="gpt-4o"+)++print(f"Created {len(created_paths)} new skills.")+for path in created_paths:+ print(f"- {path}")+```++#### 5. Skill Evaluation+Assess the Safety, Completeness, Executability, Modifiability and Cost-Aware of a skill. Supports both remote GitHub URLs and local directories.++```python+# target_skill = "./my_skills/web_search"+target_skill = "https://github.com/microsoft/autogen/tree/main/samples/tools/web_search"++# Evaluates the skill using the client's API key+result = client.evaluate(target=target_skill)++# Display results+print(f"Evaluation Result: {result}")+```+++### π» CLI Usage++The CLI is powered by `Typer` and `Rich` for a beautiful terminal experience.++#### Common Commands++| Command | Action | Example |+| :--- | :--- | :--- |+| **`search`** | Search skills | `skillnet search "data viz" --mode vector` |+| **`download`** | Install skill | `skillnet download <github_url> -d ./skills` |+| **`create`** | Generate skill | `skillnet create log.txt --model gpt-4o` |+| **`evaluate`** | Audit skill | `skillnet evaluate ./my_tool` |++> **Tip:** Use `skillnet [command] --help` to see all available options (e.g., thresholds, sorting).++#### Environment Configuration+To use **Creation** or **Evaluation** features, set your environment variables:++```bash+export API_KEY="your_api_key"+export BASE_URL="https://xxxxx" # Optional+```++---++## π Skill Structure++Standardized structure for all SkillNet packages:++```text+skill-name/+βββ SKILL.md # [Required] Metadata (YAML) + Instructions+βββ scripts/ # [Optional] Executable Python/Bash scripts+βββ references/ # [Optional] Static docs or API specs+βββ assets/ # [Optional] Icons, templates, examples+```++---++## πΊ Roadmap++- [x] β Keyword Match & Semantic Search+- [x] β Skill Installer+- [x] β Skill Creator (Local File & GitHub Repository)+- [x] β Skill Evaluation & Scoring++## π€ Contributing++Contributions are welcome! Please submit a Pull Request or open an Issue on GitHub.++## π License++This project is licensed under the [MIT License](LICENSE).