tiangolo-library-skills

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Library Skills

库技能

Skill by ara.so — Daily 2026 Skills collection.
Library Skills lets AI coding agents use libraries as intended — always up to date. Libraries (e.g. FastAPI, Streamlit) embed official AI skills in each release, and
library-skills
discovers those installed packages and wires their skills into your project's
.agents
directory as symbolic links. When you upgrade a library, its skills update automatically.

ara.so提供的技能——2026每日技能合集。
Library Skills 让AI编码Agent能够按预期使用各类库,且始终保持最新状态。诸如FastAPI、Streamlit这类库会在每个版本中嵌入官方AI技能,
library-skills
会发现已安装的这些包,并通过符号链接将它们的技能关联到项目的
.agents
目录中。当你升级库时,其技能会自动更新。

Installation & Quick Start

安装与快速开始

No global install required. Run directly with
uvx
(Python) or
npx
(JavaScript/TypeScript):
bash
undefined
无需全局安装。直接使用
uvx
(Python)或
npx
(JavaScript/TypeScript)运行:
bash
undefined

Python projects

Python 项目

uvx library-skills
uvx library-skills

JavaScript/TypeScript projects

JavaScript/TypeScript 项目

npx library-skills

For Claude Code (which doesn't yet support the standard `.agents` directory):

```bash
uvx library-skills --claude
npx library-skills

针对暂不支持标准`.agents`目录的Claude Code:

```bash
uvx library-skills --claude

Also installs into .claude/skills in addition to .agents

除了.agents目录外,还会安装到.claude/skills目录


---

---

What It Does

功能说明

  1. Scans your project's installed dependencies (e.g. from the active virtualenv or
    node_modules
    )
  2. Finds libraries that publish their own skills at agentskills.io
  3. Prompts you to select which skills to install
  4. Creates symbolic links under
    .agents/
    (and optionally
    .claude/skills/
    ) pointing into the installed package
Because they are symlinks, upgrading the library (e.g.
pip install -U fastapi
) automatically updates the skill content — no need to re-run
library-skills
.

  1. 扫描项目已安装的依赖(例如来自激活的虚拟环境或
    node_modules
  2. 查找在agentskills.io上发布自有技能的库
  3. 提示你选择要安装的技能
  4. .agents/
    (可选
    .claude/skills/
    )目录下创建指向已安装包的符号链接
由于使用的是符号链接,升级库(例如
pip install -U fastapi
)会自动更新技能内容——无需重新运行
library-skills

CLI Reference

CLI 参考

bash
uvx library-skills [OPTIONS]
OptionDescription
--claude
Also install skills in
.claude/skills/
for Claude Code compatibility
--help
Show help message and exit

bash
uvx library-skills [OPTIONS]
选项描述
--claude
同时在
.claude/skills/
目录安装技能,以兼容Claude Code
--help
显示帮助信息并退出

Directory Structure After Installation

安装后的目录结构

my-project/
├── .agents/
│   └── fastapi -> /path/to/venv/lib/python3.x/site-packages/fastapi/skills/
├── .claude/
│   └── skills/
│       └── fastapi -> /path/to/venv/lib/python3.x/site-packages/fastapi/skills/
├── src/
│   └── main.py
└── pyproject.toml

my-project/
├── .agents/
│   └── fastapi -> /path/to/venv/lib/python3.x/site-packages/fastapi/skills/
├── .claude/
│   └── skills/
│       └── fastapi -> /path/to/venv/lib/python3.x/site-packages/fastapi/skills/
├── src/
│   └── main.py
└── pyproject.toml

Python Project Workflow

Python 项目工作流

1. Create and activate a virtualenv with your dependencies

1. 创建并激活包含依赖的虚拟环境

bash
uv venv
source .venv/bin/activate
uv add fastapi streamlit
bash
uv venv
source .venv/bin/activate
uv add fastapi streamlit

2. Run library-skills

2. 运行library-skills

bash
uvx library-skills
bash
uvx library-skills

→ Scans .venv, finds fastapi, streamlit with embedded skills

→ 扫描.venv,找到带有嵌入技能的fastapi和streamlit

→ Prompts: Install fastapi skills? [Y/n]

→ 提示:是否安装fastapi技能?[Y/n]

→ Creates .agents/fastapi -> .venv/lib/.../fastapi/skills/

→ 创建.agents/fastapi -> .venv/lib/.../fastapi/skills/

undefined
undefined

3. For Claude Code users

3. 针对Claude Code用户

bash
uvx library-skills --claude
bash
uvx library-skills --claude

→ Creates .agents/fastapi AND .claude/skills/fastapi

→ 创建.agents/fastapi和.claude/skills/fastapi


---

---

JavaScript/TypeScript Project Workflow

JavaScript/TypeScript 项目工作流

1. Install dependencies

1. 安装依赖

bash
npm install
bash
npm install

or

pnpm install
undefined
pnpm install
undefined

2. Run library-skills

2. 运行library-skills

bash
npx library-skills
bash
npx library-skills

or with Claude support

或支持Claude的版本

npx library-skills --claude

---
npx library-skills --claude

---

Real Code Example: FastAPI with Up-to-Date Skills

真实代码示例:使用最新技能的FastAPI

After installing FastAPI skills, your agent will use current patterns, not deprecated ones.
python
undefined
安装FastAPI技能后,你的Agent将使用当前模式,而非已弃用的模式。
python
undefined

main.py — agent uses skills to write correct, modern FastAPI code

main.py — Agent使用技能编写正确、现代的FastAPI代码

from fastapi import FastAPI from pydantic import BaseModel
app = FastAPI()
class Item(BaseModel): name: str price: float
@app.get("/items/{item_id}") async def read_item(item_id: int, q: str | None = None): return {"item_id": item_id, "q": q}
@app.post("/items/") async def create_item(item: Item): return item

With skills installed, the agent reads the embedded SKILL.md from the FastAPI package and applies the documented patterns — including any new features added in the latest release.

---
from fastapi import FastAPI from pydantic import BaseModel
app = FastAPI()
class Item(BaseModel): name: str price: float
@app.get("/items/{item_id}") async def read_item(item_id: int, q: str | None = None): return {"item_id": item_id, "q": q}
@app.post("/items/") async def create_item(item: Item): return item

安装技能后,Agent会读取FastAPI包中嵌入的SKILL.md文件,并应用文档中记录的模式——包括最新版本新增的所有功能。

---

How Library Authors Publish Skills

库作者如何发布技能

If you are a library author who wants to embed skills in your package:
  1. Create a
    skills/SKILL.md
    (or similar) inside your package directory
  2. Publish the package to PyPI or npm
  3. Register at agentskills.io so
    library-skills
    can discover it
my-library/
├── my_library/
│   ├── __init__.py
│   └── skills/
│       └── SKILL.md   ← embedded skill, shipped with every release
├── pyproject.toml
└── README.md

如果你是想要在包中嵌入技能的库作者:
  1. 在包目录内创建
    skills/SKILL.md
    (或类似文件)
  2. 将包发布到PyPI或npm
  3. agentskills.io注册,以便
    library-skills
    能够发现它
my-library/
├── my_library/
│   ├── __init__.py
│   └── skills/
│       └── SKILL.md   ← 嵌入的技能随每个版本一同发布
├── pyproject.toml
└── README.md

Common Patterns

常见模式

Re-running after upgrading libraries

升级库后重新运行

Skills update automatically via symlinks. But if you add new libraries that have skills, re-run:
bash
uvx library-skills
技能会通过符号链接自动更新。但如果你添加了带有技能的新库,请重新运行:
bash
uvx library-skills

Committing
.agents/
to version control

.agents/
提交到版本控制

Symlinks can be committed so the whole team benefits:
bash
git add .agents/
git commit -m "Add library skills for fastapi"
Teammates need the same virtualenv path for symlinks to resolve, so consider using relative symlinks or documenting the setup.
符号链接可以被提交,以便整个团队受益:
bash
git add .agents/
git commit -m "添加fastapi的库技能"
团队成员需要相同的虚拟环境路径才能解析符号链接,因此建议使用相对符号链接或记录设置步骤。

Checking which skills are installed

查看已安装的技能

bash
ls -la .agents/
bash
ls -la .agents/

fastapi -> /home/user/project/.venv/lib/python3.12/site-packages/fastapi/skills

fastapi -> /home/user/project/.venv/lib/python3.12/site-packages/fastapi/skills

streamlit -> /home/user/project/.venv/lib/python3.12/site-packages/streamlit/skills

streamlit -> /home/user/project/.venv/lib/python3.12/site-packages/streamlit/skills


---

---

Troubleshooting

故障排除

uvx library-skills
finds no skills

uvx library-skills
未找到任何技能

  • Make sure you have a virtualenv activated (or the packages are installed in the current environment)
  • The library must ship its own skills — not all libraries do yet; check agentskills.io
  • 确保已激活虚拟环境(或包已安装在当前环境中)
  • 该库必须自带技能——并非所有库都支持,可查看agentskills.io

Symlinks are broken after moving the project

移动项目后符号链接失效

Symlinks are absolute by default. Re-run
uvx library-skills
from the new location to recreate them.
默认使用绝对符号链接。在新位置重新运行
uvx library-skills
即可重新创建。

Claude Code doesn't load skills from
.agents/

Claude Code无法从
.agents/
加载技能

Use the
--claude
flag to also install into
.claude/skills/
:
bash
uvx library-skills --claude
使用
--claude
标志将技能同时安装到
.claude/skills/
bash
uvx library-skills --claude

Skills are stale after
pip install -U fastapi

pip install -U fastapi
后技能未更新

Skills update automatically via symlinks — no action needed. If they don't, verify the symlink target points into the virtualenv:
bash
readlink .agents/fastapi

技能会通过符号链接自动更新——无需操作。如果未更新,请验证符号链接目标指向虚拟环境:
bash
readlink .agents/fastapi

Key Concepts

核心概念

ConceptExplanation
Library SkillA
SKILL.md
(or similar file) shipped inside a library package
.agents/
directory
Standard location where agent skills are discovered by AI coding tools
Symlink
library-skills
uses symlinks so skills stay in sync with installed library version
agentskills.ioRegistry of libraries that publish agent skills
--claude
Flag to also populate
.claude/skills/
for Claude Code compatibility

概念说明
Library Skill随库包一同发布的
SKILL.md
(或类似文件)
.agents/
目录
AI编码工具发现Agent技能的标准位置
符号链接
library-skills
使用符号链接确保技能与已安装库版本保持同步
agentskills.io发布Agent技能的库注册中心
--claude
用于同时填充
.claude/skills/
目录以兼容Claude Code的标志

Links

链接