Remote Skills

Remote Skills

API reference

SDK constructors, parameters, return values, data types, and errors.

Reference for @remote-skills/client, Python's remote_skills, and the Vercel AI SDK integration. Method tables show awaited return values: TypeScript methods return promises, and Python async methods are awaited. For a runnable integration, see Consume skills.

Client creation

createRemoteSkills(config, dependencies?) returns a RemoteSkillsClient.

import { createRemoteSkills } from "@remote-skills/client";

const client = createRemoteSkills({
  origins: {
    team: { url: "https://skills.example.com" },
  },
});

RemoteSkillsConfig fields:

FieldTypeDefaultDescription
originsOriginMapRequiredMap of local aliases to origin settings. At least one origin.
defaultsCatalogDefaultsBuilt-in defaultsShared timeoutMs, retries, and catalogBytes. Per-origin values take precedence.
cacheCacheSelection"disk""disk", "memory", or a custom CacheBackend.
cacheOptionsDiskCacheOptions or MemoryCacheOptionsBackend defaultsOptions for the selected built-in cache.
limitsActivationLimitsDefaults belowPer-skill download and extraction limits.

The optional second argument, RemoteSkillsDependencies, supplies transport, resolution, timing, and session-nonce hooks. Normal use needs only config.

Origin settings

All fields except url are optional. Origins use HTTPS; URL credentials, query strings, and fragments are rejected. Discovery uses the host-root /.well-known/agent-skills/index.json, regardless of a path in url.

Each origins entry is an OriginConfig.

FieldType and defaultDescription
urlstring or URL
Required
Host base URL.
headersString-to-string map
Default: {}
Headers for requests to this host.
artifactHeadersHost-to-header-map
Default: {}
Separate headers for exact artifact hosts, including ports when present.
scopestring
Default: unset
Requested catalog view; see scoped catalogs.
timeoutMsinteger
Default: 30000
Request timeout in milliseconds; 1300000.
retriesinteger
Default: 2
Retry count; 010.
catalogBytesinteger
Default: 1048576
Maximum catalog bytes; 152428800.
staleStaleCatalogConfig
Default: disabled
{ maxAgeMs: number } enables age-bounded stale-catalog fallback for new sessions.
allowLoopbackHttpboolean
Default: false
Allows HTTP for explicitly configured loopback development.
networkPolicyNetworkPolicyConfig
Defaults below
Address exceptions and redirect limit.

Network policy

TypeScript fieldPython argumentDefault and accepted value
networkPolicy.allowedAddressesNetworkPolicy(allowed_addresses=...)Empty collection. Exact IP address exceptions, not hostnames or CIDR ranges.
networkPolicy.maxRedirectsNetworkPolicy(max_redirects=...)5; integer from 0 to 5.

Address checks apply to each connection and redirect. Trust and security explains the policy; Authentication and authorization covers credential handling.

Client methods

catalog

LanguageSignatureResolves to
TypeScriptclient.catalog(options?: CatalogOptions)AggregateCatalog
Pythonawait client.catalog(strict=False)AggregateCatalog
ParameterDefaultBehavior
options.strict / strictfalse / FalseWhen enabled, any origin failure throws an aggregate error instead of returning partial results.

The result contains entries and failures. Each failure includes originAlias (TypeScript) or origin_alias (Python) and error. Strict-mode exceptions are CatalogAggregateError in TypeScript and AggregateCatalogError in Python, both exposing failures.

session

LanguageSignatureResolves to
TypeScriptclient.session(originAlias: string)RemoteSkillsSession
Pythonclient.session(origin_alias, stale=None)RemoteSkillsSession when awaited; also supports async with.
ParameterDefaultBehavior
originAlias / origin_aliasRequiredAlias from the client's configured origins, not a URL.
Python staleNoneStaleCatalog(max_age_seconds=...) permits a verified cached catalog within that age bound.

TypeScript configures stale fallback through OriginConfig.stale.maxAgeMs. Both default to requiring an online catalog unless an acceptable fresh cached catalog is available. See Caching and updates for fallback conditions.

refresh

LanguageSignatureResolves to
TypeScriptclient.refresh(originAlias?: string)void
Pythonawait client.refresh(origin_alias=None)None

Revalidates the selected origin's catalog, or all configured origins when omitted. Affects future sessions only; existing sessions and their selected skills stay unchanged.

Session methods

catalog

LanguageSignatureResolves to
TypeScriptsession.catalog()readonly CatalogEntry[]
Pythonawait session.catalog()tuple[CatalogEntry, ...]

Returns the session's fixed catalog snapshot without loading skill instructions.

activate

LanguageSignatureResolves to
TypeScriptsession.activate(name: string, requestedRange?: string)ActivatedSessionSkill
Pythonawait session.activate(skill_name, version_range=None)ActivatedSkill
ParameterDefaultBehavior
name / skill_nameRequiredSkill name from the catalog.
requestedRange / version_rangeNo restrictionSelects the highest advertised release matching the range; prereleases require explicit inclusion. An unversioned current skill is allowed only without a restriction or with *.

Downloads and verifies the complete artifact, then pins the chosen bytes for the session. Later activation calls for the same skill return that pinned selection, even if a different range is passed. Range syntax and prerelease rules are in Versions and history.

close

LanguageSignatureResolves to
TypeScriptsession.close()void
Pythonawait session.close()None

Releases the session's cache pins. Further catalog, activation, and resource operations fail with session_closed. TypeScript also supports async disposal; Python's async with closes the session automatically.

Session metadata

TypeScriptPythonMeaning
metadata.originAliasmetadata.origin_aliasConfigured origin alias.
metadata.confirmedScopemetadata.confirmed_scopeHost-confirmed scope, if any.
metadata.requestedScopeRequested scope, if configured.
metadata.stale, stalemetadata.stale, staleWhether stale-catalog fallback was used.
metadata.staleAgeMs, staleAgeMsmetadata.catalog_age_secondsCatalog age for stale fallback, in milliseconds or seconds respectively.
closedWhether the Python session is closed.

Returned data

Catalog entries

TypeScriptPythonType and meaning
originAliasorigin_aliasString; configured origin alias.
name, descriptionname, descriptionStrings; discovery metadata.
artifactTypeartifact_type"skill-md" or "archive".
url, digesturl, digestStrings; resolved artifact URL and SHA-256 digest.
versionversionString when versioned; otherwise absent or None.
releasesreleasesAdvertised release descriptors, when provided. Each has version, artifact type, URL, and digest.

Activated data

TypeScriptPythonType and meaning
name, descriptionname, descriptionStrings; selected skill metadata.
instructionsinstructionsString; Markdown instructions from SKILL.md.
frontmatterfrontmatterRead-only mapping of parsed skill metadata.
version, digestversion, digestSelected version, if any, and the exact pinned digest.
originAliasorigin_aliasConfigured origin alias.
confirmedScopeconfirmed_scopeConfirmed catalog scope, if any.
descriptorpinSelected artifact descriptor (TypeScript) or activation identity (Python).
descriptor.artifactType, descriptor.urlartifact_type, urlSelected artifact format and URL.
staleWhether the Python activation came from a stale catalog.

Resource methods

TypeScript methods return promises. Python methods are awaited. All reads use already verified local files; they do not make additional network requests or execute scripts.

TypeScriptPythonResolves to
skill.list(prefix?: string)await skill.list(prefix=None)Array or tuple of resource metadata.
skill.read(path: string)await skill.read(path)UTF-8 text string.
skill.readBytes(path: string)await skill.read_bytes(path)Uint8Array or bytes.
ParameterAccepted value
prefixOptional resource path or directory prefix. Omitted means all resources; a non-empty prefix with no matches returns resource_not_found.
pathRequired skill-relative file path, such as references/welcome.md.

Each listed resource has path, size (bytes), and media_type. Listings describe files; they do not include file contents or grant permission to use them.

Activation limits

Configured through limits in TypeScript or ActivationLimits(...) passed as Python's limits argument. Values are positive integers; byte limits are measured before text decoding.

TypeScriptPythonDefaultLimit
archiveBytesarchive_bytes52428800 (50 MiB)Compressed artifact download.
extractedBytesextracted_bytes104857600 (100 MiB)Total extracted bytes per skill.
filesfiles1000Files per skill.
fileBytesfile_bytes10485760 (10 MiB)Individual file, including standalone Markdown skills.

Catalog size is controlled separately by the origin's catalog-byte limit.

Scoped catalogs

ContractValue
Request headerRemote-Skills-Scope: <name>, on catalog requests.
Portable nameNon-secret ASCII, 1–128 bytes, without whitespace, control characters, or commas; accepted by both SDKs.
Successful responseExactly one matching Remote-Skills-Scope header on 200 and 304.
Invalid confirmationMissing, duplicate, or mismatched confirmation returns catalog_invalid.
Artifact requestsThe scope header is not automatically included and is not an access credential.

The provider authorizes catalog views and artifact downloads using the caller's identity. Authentication and authorization covers both sides of this contract.

Catalog version history

Optional wire extension for version selection; Versions and history covers authoring and publishing.

Field or ruleContract
Skill versionmetadata.version in SKILL.md.
Catalog extensionx-remote-skills, with advertised releases for each versioned skill.
Release descriptorVersion, artifact type, URL, and digest.
History limit100 release descriptors per skill, including the current release.
Current releaseIts descriptor agrees with the ordinary catalog entry.
Build inputOlder releases are carried forward only from verified prior output.
Other discovery clientsCan ignore the extension and load the current release.

Vercel AI SDK integration

remoteSkills(options: RemoteSkillsOptions): Promise<RemoteSkillsIntegration> is exported by @remote-skills/ai-sdk. For installation and a complete agent example, see Vercel AI SDK.

Source options

Exactly one source form is accepted:

FormTypeBehavior
{ client, origin }RemoteSkillsClient, stringOpens one session for a configured origin alias.
{ client, origins }RemoteSkillsClient, readonly string[]Opens one session per alias. The list must be non-empty and contain no duplicates. All origins must open successfully.
{ session }RemoteSkillsSessionUses a caller-owned session without taking ownership of it.

Every form also accepts:

OptionTypeDefaultBehavior
versionsReadonly<Record<string, string>>UnsetApplication-selected version constraints, passed to SDK activation. Keys name catalog skills: howdy for one origin, or team/howdy when multiple origins are opened. Unknown skill keys or empty constraints fail setup.

Creation discovers metadata without activating skills. Authentication, scopes, cache, transport, timeouts, and limits come from the supplied client or session. If setup fails, sessions opened by the integration are closed; a caller-owned session stays open.

Returned integration

MemberTypeContract
agentOptions{ instructions: string; tools: RemoteSkillsTools }Settings to spread into ToolLoopAgent, generateText, or streamText. Does not configure a model or stop condition.
toolsRemoteSkillsToolsThe same skill and readFile tools exposed by agentOptions.
sessionsreadonly RemoteSkillsSession[]Underlying sessions for catalog access and activation, with staleness and confirmed-scope metadata.
sandboxSandbox from bash-toolRead-only, remote-backed filesystem rooted at /workspace/skills/. Command execution and writes are unsupported.
close()Promise<void>Disables tools, waits for pending operations, closes owned sessions, and removes temporary files. Safe to call repeatedly. Does not close a caller-owned session or clear the SDK cache.
[Symbol.asyncDispose]()Promise<void>Same cleanup as close(); supports await using.

The package also exports the types RemoteSkillsOptions, RemoteSkillsIntegration, and RemoteSkillsTools.

Model-facing tools

ToolInputResult
skill{ skillName: string }Vercel's skill-loader result, including instructions and resource paths on success. Downloads and verifies the selected skill through the SDK before returning its instructions.
readFileVercel's file-reader input, including pathUTF-8 file content from the verified skill. Binary reads return resource_not_text; binary access remains available through SDK sessions.

Tool errors retain SDK error codes without diagnostic context. Unexpected tool failures return a fixed message; setup errors remain available to the application. Abort signals are checked around tool operations, but an already-started SDK download follows the client's timeout and session-close behavior rather than per-call cancellation.

Request failures

Setting or conditionBehavior
Default timeout30 seconds per request.
Default retriesUp to two retries for eligible catalog and artifact GET failures.
Retryable HTTP status408, 429, and 5xx.
Invalid schema, policy, digest, or archiveNo retry. Clients fail closed rather than returning unchecked content.

Stable error codes

CodeMeaning
configuration_invalidInvalid client, origin, or option configuration.
origin_unavailableThe origin could not provide a usable response.
request_timeoutRequest exceeded its timeout.
catalog_invalidCatalog content or scope confirmation is invalid.
unsupported_schemaDiscovery schema is missing or unsupported.
authentication_failedCredentials are missing, invalid, or expired (401).
authorization_deniedThe caller lacks access (403).
skill_not_foundThe selected catalog does not contain that skill.
version_unavailableNo advertised release matches the requested range.
artifact_unsupportedUnsupported artifact type or encoding.
digest_mismatchDownloaded bytes do not match the advertised digest.
archive_unsafeArchive structure or entries failed safety checks.
limit_exceededConfigured size or file-count limit exceeded.
resource_not_foundNo matching resource exists.
resource_not_textResource cannot be decoded as UTF-8 text.
path_invalidResource path is invalid or escapes the skill.
policy_deniedURL, address, or redirect rejected by network policy.
session_closedOperation attempted after the session closed.
cache_corruptCached data or cache coordination is invalid.

SDK errors expose code, retryable, and sanitized context. Catalog and request errors use RemoteSkillsError in TypeScript and CatalogError in Python; cache operations can also raise CacheConfigurationError or CacheCorruptError. Diagnostics exclude credentials, response bodies, instructions, and resource contents; URL context is sanitized.

On this page