Registries API Reference
Bases: ABC
Abstract base for skill registries.
A skill registry is a source of skills that can be searched, retrieved, installed and updated. Concrete implementations may back registries with a Git repository, a REST API, a local directory, etc.
Convenience methods :meth:filtered, :meth:prefixed, and
:meth:renamed return lightweight wrapper views — the underlying
registry is never modified.
Source code in pydantic_ai_skills/registries/_base.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
search
abstractmethod
async
search(query: str, limit: int = 10) -> list[Skill]
Search for skills by keyword.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Keyword matched case-insensitively against |
required |
limit
|
int
|
Maximum number of results. |
10
|
Returns:
| Type | Description |
|---|---|
list[Skill]
|
List of matching :class: |
Source code in pydantic_ai_skills/registries/_base.py
44 45 46 47 48 49 50 51 52 53 54 55 | |
get
abstractmethod
async
get(skill_name: str) -> Skill
Return a single skill by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skill_name
|
str
|
Exact skill name from |
required |
Returns:
| Type | Description |
|---|---|
Skill
|
The matching :class: |
Raises:
| Type | Description |
|---|---|
SkillNotFoundError
|
When no skill with |
Source code in pydantic_ai_skills/registries/_base.py
57 58 59 60 61 62 63 64 65 66 67 68 69 | |
install
abstractmethod
async
install(skill_name: str, target_dir: str | Path) -> Path
Copy a skill into target_dir.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skill_name
|
str
|
Name of the skill to install. |
required |
target_dir
|
str | Path
|
Destination directory; a |
required |
Returns:
| Type | Description |
|---|---|
Path
|
Path to the installed skill directory. |
Source code in pydantic_ai_skills/registries/_base.py
71 72 73 74 75 76 77 78 79 80 81 82 | |
update
abstractmethod
async
update(skill_name: str, target_dir: str | Path) -> Path
Update an already-installed skill to the latest version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skill_name
|
str
|
Name of the skill to update. |
required |
target_dir
|
str | Path
|
Directory where the skill was previously installed. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
Path to the updated skill directory. |
Source code in pydantic_ai_skills/registries/_base.py
84 85 86 87 88 89 90 91 92 93 94 | |
get_skills
abstractmethod
get_skills() -> list[Skill]
Return all skills available in this registry.
Concrete implementations must return pre-loaded skill objects.
This is called synchronously by :class:~pydantic_ai_skills.SkillsToolset
during initialization.
Returns:
| Type | Description |
|---|---|
list[Skill]
|
List of :class: |
Source code in pydantic_ai_skills/registries/_base.py
96 97 98 99 100 101 102 103 104 105 106 | |
filtered
filtered(predicate: Callable[[Skill], bool]) -> FilteredRegistry
Return a view of this registry limited to skills matching predicate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
predicate
|
Callable[[Skill], bool]
|
A callable that accepts a :class: |
required |
Returns:
| Name | Type | Description |
|---|---|---|
A |
FilteredRegistry
|
|
FilteredRegistry
|
view backed by the same underlying source. |
Source code in pydantic_ai_skills/registries/_base.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |
prefixed
prefixed(prefix: str) -> PrefixedRegistry
Return a view of this registry with prefix prepended to every skill name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prefix
|
str
|
String to prepend to every skill name. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
A |
PrefixedRegistry
|
|
PrefixedRegistry
|
view backed by the same underlying source. |
Source code in pydantic_ai_skills/registries/_base.py
123 124 125 126 127 128 129 130 131 132 133 134 135 | |
renamed
renamed(name_map: dict[str, str]) -> RenamedRegistry
Return a view of this registry with skills renamed per name_map.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name_map
|
dict[str, str]
|
Mapping of |
required |
Returns:
| Name | Type | Description |
|---|---|---|
A |
RenamedRegistry
|
|
RenamedRegistry
|
view backed by the same underlying source. |
Source code in pydantic_ai_skills/registries/_base.py
137 138 139 140 141 142 143 144 145 146 147 148 149 | |
Bases: SkillRegistry
Skills registry backed by a Git repository cloned with GitPython.
Clones the target repository on the first call to install or
search/get, then performs a git pull on subsequent calls
(or a full re-clone if the local copy is corrupted/missing).
The registry only reads the filesystem after cloning — it never calls any hosting platform's REST/GraphQL API — so it works with any git host accessible over HTTPS or SSH (GitHub, GitLab, Bitbucket, self-hosted, etc.).
search() and get() return :class:~pydantic_ai_skills.Skill objects
parsed from SKILL.md frontmatter + body. Registry-specific metadata
(source_url, version, repo) is stored in skill.metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo_url
|
str
|
Full URL of the Git repository to clone (e.g.
|
required |
target_dir
|
str | Path | None
|
Local directory where the repository is cloned. Defaults to
a temporary directory scoped to the registry instance. The cloned
tree persists across |
None
|
path
|
str
|
Sub-path inside the repository that contains the skill directories.
Defaults to the repository root ( |
''
|
token
|
str | None
|
Personal access token (or any HTTPS password) used for
authentication. When |
None
|
ssh_key_file
|
str | Path | None
|
Path to a private SSH key for SSH-based authentication.
When provided, |
None
|
clone_options
|
GitCloneOptions | None
|
Fine-grained GitPython configuration. See
:class: |
None
|
validate
|
bool
|
Whether to run |
True
|
auto_install
|
bool
|
When |
True
|
Examples:
Basic usage — clone and register all skills:
from pydantic_ai_skills import SkillsToolset
from pydantic_ai_skills.registries.git import GitSkillsRegistry
toolset = SkillsToolset(
registries=[
GitSkillsRegistry(
repo_url="https://github.com/anthropics/skills",
path="skills",
target_dir="./cached-skills",
),
]
)
Blobless shallow clone with a PAT, only the pdf sub-path:
from pydantic_ai_skills.registries.git import GitSkillsRegistry, GitCloneOptions
registry = GitSkillsRegistry(
repo_url="https://github.com/anthropics/skills",
path="skills/pdf",
token="ghp_...",
clone_options=GitCloneOptions(
depth=1,
single_branch=True,
sparse_paths=["skills/pdf"],
multi_options=["--filter=blob:none"],
),
)
Filter to only PDF-related skills:
pdf_registry = registry.filtered(lambda skill: "pdf" in skill.name.lower())
Prefix all skill names from this registry:
prefixed_registry = registry.prefixed("anthropic-")
# "pdf" skill is now accessible as "anthropic-pdf"
SSH authentication with a custom key:
registry = GitSkillsRegistry(
repo_url="git@github.com:my-org/private-skills.git",
ssh_key_file="~/.ssh/id_ed25519_skills",
)
Offline / air-gapped — pre-clone manually, disable auto-install:
registry = GitSkillsRegistry(
repo_url="https://github.com/anthropics/skills",
target_dir="/opt/skills-mirror",
auto_install=False,
)
Source code in pydantic_ai_skills/registries/git.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 | |
get_skills
get_skills() -> list[Skill]
Return all skills discovered from the cloned repository.
If auto_install=True (default), the repository was cloned during
__init__ and skills are returned from cache. Otherwise, loads
from whatever exists on disk without triggering a clone/pull.
Returns:
| Type | Description |
|---|---|
list[Skill]
|
List of enriched :class: |
Source code in pydantic_ai_skills/registries/git.py
491 492 493 494 495 496 497 498 499 500 501 502 | |
search
async
search(query: str, limit: int = 10) -> list[Skill]
Search available skills by keyword.
Matches query (case-insensitively) against each skill's name and
description. Uses the cached skill list populated during __init__.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Keyword to search for. |
required |
limit
|
int
|
Maximum number of results. |
10
|
Returns:
| Type | Description |
|---|---|
list[Skill]
|
List of :class: |
list[Skill]
|
|
Source code in pydantic_ai_skills/registries/git.py
508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 | |
get
async
get(skill_name: str) -> Skill
Return the full skill by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skill_name
|
str
|
Exact skill name (with optional prefix). |
required |
Returns:
| Type | Description |
|---|---|
Skill
|
A fully-parsed :class: |
Skill
|
containing |
Raises:
| Type | Description |
|---|---|
SkillNotFoundError
|
When no skill with |
Source code in pydantic_ai_skills/registries/git.py
531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
install
async
install(skill_name: str, target_dir: str | Path) -> Path
Copy a skill from the cloned repository into target_dir.
Clones the repository first if the local cache doesn't exist. Validation
is handled by discover_skills() during cache population, so skills
in the cache are already validated.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skill_name
|
str
|
Name of the skill to install. |
required |
target_dir
|
str | Path
|
Destination directory; a |
required |
Returns:
| Type | Description |
|---|---|
Path
|
Path to the installed skill directory ( |
Raises:
| Type | Description |
|---|---|
SkillNotFoundError
|
When |
SkillRegistryError
|
On git or filesystem errors. |
Source code in pydantic_ai_skills/registries/git.py
549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 | |
update
async
update(skill_name: str, target_dir: str | Path) -> Path
Pull the latest changes and re-copy the skill to target_dir.
Performs a git pull on the cached clone before re-installing.
Falls back to a fresh install if the skill is not yet installed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skill_name
|
str
|
Name of the skill to update. |
required |
target_dir
|
str | Path
|
Directory where the skill was previously installed. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
Path to the updated skill directory. |
Raises:
| Type | Description |
|---|---|
SkillNotFoundError
|
When |
SkillRegistryError
|
On git or network errors. |
Source code in pydantic_ai_skills/registries/git.py
607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 | |
Low-level GitPython configuration for clone and fetch operations.
All fields map directly to arguments accepted by git.Repo.clone_from or
git.Remote.fetch / git.Remote.pull, so developers who know GitPython can
use the full API without any wrapper layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
depth
|
int | None
|
Create a shallow clone with history truncated to this many commits.
Passed as |
None
|
branch
|
str | None
|
Name of the remote branch, tag, or ref to check out after cloning
( |
None
|
single_branch
|
bool
|
When |
False
|
sparse_paths
|
list[str]
|
List of path patterns to include in a sparse checkout
( |
list()
|
env
|
dict[str, str]
|
Mapping of environment variables forwarded to every git sub-process
(e.g. |
dict()
|
multi_options
|
list[str]
|
Extra |
list()
|
git_options
|
dict[str, Any]
|
Mapping forwarded as keyword arguments directly to
|
dict()
|
Source code in pydantic_ai_skills/registries/git.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
Composition Wrappers
Bases: SkillRegistry
A registry that wraps another registry and delegates to it.
All abstract methods are forwarded to wrapped. Subclasses
override only the methods they need to modify.
Example
class MyCustomRegistry(WrapperRegistry):
async def search(self, query: str, limit: int = 10) -> list[Skill]:
results = await self.wrapped.search(query, limit)
# custom post-processing
return results
Source code in pydantic_ai_skills/registries/wrapper.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
search
async
search(query: str, limit: int = 10) -> list[Skill]
Delegate search to the wrapped registry.
Source code in pydantic_ai_skills/registries/wrapper.py
38 39 40 | |
get
async
get(skill_name: str) -> Skill
Delegate get to the wrapped registry.
Source code in pydantic_ai_skills/registries/wrapper.py
42 43 44 | |
install
async
install(skill_name: str, target_dir: str | Path) -> Path
Delegate install to the wrapped registry.
Source code in pydantic_ai_skills/registries/wrapper.py
46 47 48 | |
update
async
update(skill_name: str, target_dir: str | Path) -> Path
Delegate update to the wrapped registry.
Source code in pydantic_ai_skills/registries/wrapper.py
50 51 52 | |
get_skills
get_skills() -> list[Skill]
Delegate get_skills to the wrapped registry.
Source code in pydantic_ai_skills/registries/wrapper.py
54 55 56 | |
Bases: WrapperRegistry
A registry that filters skills using a predicate function.
Only skills for which predicate(skill) returns True are
visible through this view. The underlying registry is never modified.
Example
pdf_only = registry.filtered(lambda s: 'pdf' in s.name)
results = await pdf_only.search('document')
Source code in pydantic_ai_skills/registries/filtered.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
search
async
search(query: str, limit: int = 10) -> list[Skill]
Search the wrapped registry and filter results by predicate.
Fetches extra results from the inner registry to compensate for
filtering, then trims to limit.
Source code in pydantic_ai_skills/registries/filtered.py
37 38 39 40 41 42 43 44 | |
get
async
get(skill_name: str) -> Skill
Get a skill by name, raising if it doesn't pass the predicate.
Source code in pydantic_ai_skills/registries/filtered.py
46 47 48 49 50 51 | |
install
async
install(skill_name: str, target_dir: str | Path) -> Path
Install a skill after validating it passes the predicate.
Source code in pydantic_ai_skills/registries/filtered.py
53 54 55 56 | |
update
async
update(skill_name: str, target_dir: str | Path) -> Path
Update a skill after validating it passes the predicate.
Source code in pydantic_ai_skills/registries/filtered.py
58 59 60 61 | |
get_skills
get_skills() -> list[Skill]
Return only skills that pass the predicate.
Source code in pydantic_ai_skills/registries/filtered.py
63 64 65 | |
Bases: WrapperRegistry
A registry that prepends a prefix to every skill name.
The prefix is added to names returned by search and get,
and stripped before delegating install and update to the
wrapped registry.
Example
prefixed = registry.prefixed('anthropic-')
# Skill 'pdf' is now accessible as 'anthropic-pdf'
skill = await prefixed.get('anthropic-pdf')
Source code in pydantic_ai_skills/registries/prefixed.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | |
search
async
search(query: str, limit: int = 10) -> list[Skill]
Search the wrapped registry and prefix all result names.
Source code in pydantic_ai_skills/registries/prefixed.py
48 49 50 51 | |
get
async
get(skill_name: str) -> Skill
Get a skill by its prefixed name.
Raises:
| Type | Description |
|---|---|
SkillNotFoundError
|
When the name doesn't start with the expected prefix. |
Source code in pydantic_ai_skills/registries/prefixed.py
53 54 55 56 57 58 59 60 61 62 63 64 | |
install
async
install(skill_name: str, target_dir: str | Path) -> Path
Install a skill, stripping the prefix before delegating.
Source code in pydantic_ai_skills/registries/prefixed.py
66 67 68 69 | |
update
async
update(skill_name: str, target_dir: str | Path) -> Path
Update a skill, stripping the prefix before delegating.
Source code in pydantic_ai_skills/registries/prefixed.py
71 72 73 74 | |
get_skills
get_skills() -> list[Skill]
Return all skills with the prefix prepended to their names.
Source code in pydantic_ai_skills/registries/prefixed.py
76 77 78 | |
Bases: WrapperRegistry
A registry that renames skills using a name map.
name_map maps new names to original names:
{'new-name': 'original-name'}. Skills not present in the
map keep their original names.
Example
renamed = registry.renamed({'doc-tool': 'pdf', 'sheet-tool': 'xlsx'})
skill = await renamed.get('doc-tool') # fetches 'pdf'
skill = await renamed.get('xlsx') # still works (unmapped)
Source code in pydantic_ai_skills/registries/renamed.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
search
async
search(query: str, limit: int = 10) -> list[Skill]
Search the wrapped registry and apply renames to results.
Source code in pydantic_ai_skills/registries/renamed.py
53 54 55 56 | |
get
async
get(skill_name: str) -> Skill
Get a skill by its (possibly renamed) name.
Source code in pydantic_ai_skills/registries/renamed.py
58 59 60 61 62 | |
install
async
install(skill_name: str, target_dir: str | Path) -> Path
Install a skill, resolving the renamed name first.
Source code in pydantic_ai_skills/registries/renamed.py
64 65 66 67 | |
update
async
update(skill_name: str, target_dir: str | Path) -> Path
Update a skill, resolving the renamed name first.
Source code in pydantic_ai_skills/registries/renamed.py
69 70 71 72 | |
get_skills
get_skills() -> list[Skill]
Return all skills with renamed names applied.
Source code in pydantic_ai_skills/registries/renamed.py
74 75 76 | |
Bases: SkillRegistry
A registry that aggregates multiple registries into one.
Searches are fanned out to every child registry in parallel.
get, install, and update try each registry in order
and return the first successful result.
Example
from pydantic_ai_skills.registries import CombinedRegistry
combined = CombinedRegistry(registries=[github_registry, gitlab_registry])
results = await combined.search('pdf')
Source code in pydantic_ai_skills/registries/combined.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
search
async
search(query: str, limit: int = 10) -> list[Skill]
Search all child registries in parallel and merge results.
Results are deduplicated by skill name (first occurrence wins).
Source code in pydantic_ai_skills/registries/combined.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
get
async
get(skill_name: str) -> Skill
Try each registry in order and return the first match.
Raises:
| Type | Description |
|---|---|
SkillNotFoundError
|
When no registry contains the skill. |
Source code in pydantic_ai_skills/registries/combined.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
install
async
install(skill_name: str, target_dir: str | Path) -> Path
Install from the first registry that contains the skill.
Raises:
| Type | Description |
|---|---|
SkillNotFoundError
|
When no registry contains the skill. |
Source code in pydantic_ai_skills/registries/combined.py
73 74 75 76 77 78 79 80 81 82 83 84 85 | |
update
async
update(skill_name: str, target_dir: str | Path) -> Path
Update from the first registry that contains the skill.
Raises:
| Type | Description |
|---|---|
SkillNotFoundError
|
When no registry contains the skill. |
Source code in pydantic_ai_skills/registries/combined.py
87 88 89 90 91 92 93 94 95 96 97 98 99 | |
get_skills
get_skills() -> list[Skill]
Return skills from all child registries, deduplicated by name.
First occurrence wins when multiple registries provide skills with the same name.
Source code in pydantic_ai_skills/registries/combined.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |