getPlatformPaths()
Get OS-appropriate paths for CAAMP’s global directories. SignaturegetSystemInfo()
Get a cached system information snapshot. Signature_resetPlatformPathsCache()
Invalidate the path and system info caches. Use in tests after mutating AGENTS_HOME env var. SignaturegetPlatformLocations()
Resolves platform-specific directory locations for the current OS. SignaturegetAgentsHome()
Returns the global agents home directory path. SignaturegetProjectAgentsDir(projectRoot)
Returns the project-local.agents directory path.
Signature
| Name | Type | Description |
|---|---|---|
projectRoot | : string | The project root directory, defaults to process.cwd() |
.agents directory
Example
resolveProjectPath(relativePath, projectDir)
Resolves a relative path against a project directory. Signature| Name | Type | Description |
|---|---|---|
relativePath | string | The relative path to resolve |
projectDir | : string | The project root directory, defaults to process.cwd() |
getCanonicalSkillsDir()
Returns the canonical skills storage directory path. SignaturegetLockFilePath()
Returns the path to the CAAMP lock file. Signature.caamp-lock.json file
Example
getAgentsMcpDir(scope, projectDir)
Gets the MCP directory within the.agents/ standard structure.
Signature
| Name | Type | Description |
|---|---|---|
scope | : PathScope | "global" for ~/.agents/mcp/, "project" for <project>/.agents/mcp/ |
projectDir | : string | Project root (defaults to process.cwd()) |
getAgentsMcpServersPath(scope, projectDir)
Gets the MCP servers.json path within the.agents/ standard structure.
Signature
| Name | Type | Description |
|---|---|---|
scope | : PathScope | "global" for ~/.agents/mcp/servers.json, "project" for <project>/.agents/mcp/servers.json |
projectDir | : string | Project root (defaults to process.cwd()) |
servers.json file
Example
getAgentsInstructFile(scope, projectDir)
Gets the primary AGENTS.md instruction file path within.agents/.
Signature
| Name | Type | Description |
|---|---|---|
scope | : PathScope | "global" for ~/.agents/AGENTS.md, "project" for <project>/.agents/AGENTS.md |
projectDir | : string | Project root (defaults to process.cwd()) |
getAgentsConfigPath(scope, projectDir)
Gets the config.toml path within the.agents/ standard structure.
Signature
| Name | Type | Description |
|---|---|---|
scope | : PathScope | "global" for ~/.agents/config.toml, "project" for <project>/.agents/config.toml |
projectDir | : string | Project root (defaults to process.cwd()) |
getAgentsWikiDir(scope, projectDir)
Gets the wiki directory within the.agents/ standard structure.
Signature
| Name | Type | Description |
|---|---|---|
scope | : PathScope | "global" or "project" |
projectDir | : string | Project root (defaults to process.cwd()) |
getAgentsSpecDir(scope, projectDir)
Gets the spec directory within the.agents/ standard structure.
Signature
| Name | Type | Description |
|---|---|---|
scope | : PathScope | "global" or "project" |
projectDir | : string | Project root (defaults to process.cwd()) |
getAgentsLinksDir(scope, projectDir)
Gets the links directory within the.agents/ standard structure.
Signature
| Name | Type | Description |
|---|---|---|
scope | : PathScope | "global" or "project" |
projectDir | : string | Project root (defaults to process.cwd()) |
resolveRegistryTemplatePath(template)
Resolves a registry template path by substituting platform variables. Signature| Name | Type | Description |
|---|---|---|
template | string | The template string containing $VARIABLE placeholders |
resolveProviderConfigPath(provider, scope, projectDir)
Resolves the configuration file path for a provider at the given scope. Signature| Name | Type | Description |
|---|---|---|
provider | Provider | The provider whose config path to resolve |
scope | PathScope | Whether to resolve global or project config path |
projectDir | : string | The project root directory, defaults to process.cwd() |
resolvePreferredConfigScope(provider, useGlobalFlag)
Determines the preferred configuration scope for a provider. Signature| Name | Type | Description |
|---|---|---|
provider | Provider | The provider to determine scope for |
useGlobalFlag | : boolean | Optional flag to force global scope |
resolveProviderSkillsDir(provider, scope, projectDir)
Resolves the skills directory path for a provider at the given scope. Signature| Name | Type | Description |
|---|---|---|
provider | Provider | The provider whose skills directory to resolve |
scope | PathScope | Whether to resolve global or project skills path |
projectDir | : string | The project root directory, defaults to process.cwd() |
resolveProviderSkillsDirs(provider, scope, projectDir)
Gets all target directories for skill installation based on provider precedence. Signature| Name | Type | Description |
|---|---|---|
provider | Provider | Provider to resolve paths for |
scope | PathScope | Whether to resolve global or project paths |
projectDir | : string | Project directory for project-scope resolution |
resolveProviderProjectPath(provider, projectDir)
Resolves a provider’s project-level path against a project directory. Signature| Name | Type | Description |
|---|---|---|
provider | Provider | The provider whose project path to resolve |
projectDir | : string | The project root directory, defaults to process.cwd() |
resolveProvidersRegistryPath(startDir)
Locates the providers registry.json file by searching up from a start directory. Signature| Name | Type | Description |
|---|---|---|
startDir | string | The directory to start searching from |
providers/registry.json file
Throws
- Error if
providers/registry.jsoncannot be found within 8 parent levels
normalizeSkillSubPath(path)
Normalizes a skill sub-path by cleaning separators and removing SKILL.md suffix. Signature| Name | Type | Description |
|---|---|---|
path | string | undefined | The raw skill sub-path to normalize |
buildSkillSubPathCandidates(marketplacePath, parsedPath)
Builds a list of candidate sub-paths for skill file resolution. Signature| Name | Type | Description |
|---|---|---|
marketplacePath | string | undefined | The sub-path from the marketplace listing |
parsedPath | string | undefined | The sub-path parsed from the source URL |
getAllProviders()
Retrieve all registered providers with resolved platform paths. Providers are lazily loaded fromproviders/registry.json on first call and cached for subsequent calls.
Signature
getProvider(idOrAlias)
Look up a provider by its ID or any of its aliases. Signature| Name | Type | Description |
|---|---|---|
idOrAlias | string | Provider ID (e.g. "claude-code") or alias (e.g. "claude") |
undefined if not found
Example
resolveAlias(idOrAlias)
Resolve an alias to its canonical provider ID. If the input is already a canonical ID (or unrecognized), it is returned as-is. Signature| Name | Type | Description |
|---|---|---|
idOrAlias | string | Provider ID or alias to resolve |
getProvidersByPriority(priority)
Filter providers by their priority tier. Signature| Name | Type | Description |
|---|---|---|
priority | ProviderPriority | Priority level to filter by ("primary", "high", "medium", or "low") |
getPrimaryProvider()
Get the single primary harness provider, if any is registered. Signatureundefined if none is registered
Example
getProvidersByStatus(status)
Filter providers by their lifecycle status. Signature| Name | Type | Description |
|---|---|---|
status | ProviderStatus | Status to filter by ("active", "beta", "deprecated", or "planned") |
getProvidersByInstructFile(file)
Filter providers that use a specific instruction file. Multiple providers often share the same instruction file (e.g. many use"AGENTS.md").
Signature
| Name | Type | Description |
|---|---|---|
file | string | Instruction file name (e.g. "CLAUDE.md", "AGENTS.md") |
getInstructionFiles()
Get the set of all unique instruction file names across all providers. Signature["CLAUDE.md", "AGENTS.md", "GEMINI.md"])
Example
getProviderCount()
Get the total number of registered providers. SignaturegetRegistryVersion()
Get the semantic version string of the provider registry. Signatureproviders/registry.json (e.g. "2.0.0")
Example
getProvidersByHookEvent(event)
Filter providers that support a specific hook event. Signature| Name | Type | Description |
|---|---|---|
event | HookEvent | Hook event to filter by (e.g. "onToolComplete") |
getCommonHookEvents(providerIds)
Get hook events common to all specified providers. If providerIds is provided, returns the intersection of their supported events. If providerIds is undefined or empty, uses all providers. Signature| Name | Type | Description |
|---|---|---|
providerIds | : string[] | Optional array of provider IDs to intersect |
providerSupports(provider, dotPath)
Check whether a provider supports a specific capability via dot-path query. The dot-path addresses a value insideprovider.capabilities. For boolean fields the provider “supports” the capability when the value is true. For non-boolean fields the provider “supports” it when the value is neither null nor undefined (and, for arrays, non-empty).
Signature
| Name | Type | Description |
|---|---|---|
provider | Provider | Provider to inspect |
dotPath | string | Dot-delimited capability path (e.g. "spawn.supportsSubagents", "hooks.supported") |
true when the provider has the specified capability
Example
getSpawnCapableProviders()
Filter providers that support spawning subagents. Signaturecapabilities.spawn.supportsSubagents === true
Example
getProvidersBySpawnCapability(flag)
Filter providers by a specific boolean spawn capability flag. Signature| Name | Type | Description |
|---|---|---|
flag | keyof Omit<ProviderSpawnCapability | One of the four boolean flags on ProviderSpawnCapability ("supportsSubagents", "supportsProgrammaticSpawn", "supportsInterAgentComms", "supportsParallelSpawn") |
true
Example
resetRegistry()
Reset cached registry data, forcing a reload on next access. SignaturegetProvidersBySkillsPrecedence(precedence)
Filter providers by their skills precedence value. Signature| Name | Type | Description |
|---|---|---|
precedence | SkillsPrecedence | Skills precedence to filter by |
getEffectiveSkillsPaths(provider, scope, projectDir)
Get the effective skills paths for a provider, ordered by precedence. Signature| Name | Type | Description |
|---|---|---|
provider | Provider | Provider to resolve paths for |
scope | PathScope | Whether to resolve global or project paths |
projectDir | : string | Project directory for project-scope resolution |
buildSkillsMap()
Build a full skills map for all providers. SignaturegetProviderCapabilities(idOrAlias)
Get capabilities for a provider by ID or alias. Signature| Name | Type | Description |
|---|---|---|
idOrAlias | string | Provider ID or alias |
providerSupportsById(idOrAlias, capabilityPath)
Check if a provider supports a capability using ID/alias lookup. Convenience wrapper that resolves the provider first, then delegates to the provider-levelproviderSupports.
Signature
| Name | Type | Description |
|---|---|---|
idOrAlias | string | Provider ID or alias |
capabilityPath | string | Dot-path into capabilities (e.g. “spawn.supportsSubagents”) |
buildInjectionContent(template)
Build injection content from a structured template. Produces a string suitable for injection between CAAMP markers. References are output as@ lines, content blocks are appended as-is.
Signature
| Name | Type | Description |
|---|---|---|
template | InjectionTemplate | Template defining references and content |
parseInjectionContent(content)
Parse injection content back into template form. Lines starting with@ are treated as references. All other non-empty lines are treated as content blocks.
Signature
| Name | Type | Description |
|---|---|---|
content | string | Raw injection content string |
generateInjectionContent(options)
Generate a standard CAAMP injection block for instruction files. Produces markdown content suitable for injection between CAAMP markers. Optionally includes MCP server and custom content sections. Signature| Name | Type | Description |
|---|---|---|
options | : { mcpServerName?: string; customContent?: string; } | Optional configuration for the generated content |
generateSkillsSection(skillNames)
Generate a skills discovery section for instruction files. Signature| Name | Type | Description |
|---|---|---|
skillNames | string[] | Array of skill names to list |
getInstructFile(provider)
Get the correct instruction file name for a provider. Signature| Name | Type | Description |
|---|---|---|
provider | Provider | Provider registry entry |
groupByInstructFile(providers)
Group providers by their instruction file name. Useful for determining which providers share the same instruction file (e.g. multiple providers usingAGENTS.md).
Signature
| Name | Type | Description |
|---|---|---|
providers | Provider[] | Array of providers to group |
checkInjection(filePath, expectedContent)
Check the status of a CAAMP injection block in an instruction file. Returns the injection status: -"missing" - File does not exist - "none" - File exists but has no CAAMP markers - "current" - CAAMP block exists and matches expected content (or no expected content given) - "outdated" - CAAMP block exists but differs from expected content
Signature
| Name | Type | Description |
|---|---|---|
filePath | string | Absolute path to the instruction file |
expectedContent | : string | Optional expected content to compare against |
inject(filePath, content)
Inject content into an instruction file between CAAMP markers. Behavior depends on the file state: - File does not exist: creates the file with the injection block →"created" - File exists without markers: prepends the injection block → "added" - File exists with multiple markers (duplicates): consolidates into single block → "consolidated" - File exists with markers, content differs: replaces the block → "updated" - File exists with markers, content matches: no-op → "intact" This function is idempotent — calling it multiple times with the same content will not modify the file after the first write.
Signature
| Name | Type | Description |
|---|---|---|
filePath | string | Absolute path to the instruction file |
content | string | Content to inject between CAAMP markers |
"created", "added", "consolidated", "updated", or "intact"
Example
removeInjection(filePath)
Remove the CAAMP injection block from an instruction file. If removing the block would leave the file empty, the file is deleted entirely. Signature| Name | Type | Description |
|---|---|---|
filePath | string | Absolute path to the instruction file |
true if a CAAMP block was found and removed, false otherwise
Example
checkAllInjections(providers, projectDir, scope, expectedContent)
Check injection status across all providers’ instruction files. Deduplicates by file path since multiple providers may share the same instruction file (e.g. many providers useAGENTS.md).
Signature
| Name | Type | Description |
|---|---|---|
providers | Provider[] | Array of providers to check |
projectDir | string | Absolute path to the project directory |
scope | "project" | "global" | Whether to check project or global instruction files |
expectedContent | : string | Optional expected content to compare against |
injectAll(providers, projectDir, scope, content)
Inject content into all providers’ instruction files. Deduplicates by file path to avoid injecting the same file multiple times. Signature| Name | Type | Description |
|---|---|---|
providers | Provider[] | Array of providers to inject into |
projectDir | string | Absolute path to the project directory |
scope | "project" | "global" | Whether to target project or global instruction files |
content | string | Content to inject between CAAMP markers |
"created", "added", "consolidated", "updated", or "intact")
Example
ensureProviderInstructionFile(providerId, projectDir, options)
Ensure a provider’s instruction file exists with the correct CAAMP block. This is the canonical API for adapters and external packages to manage provider instruction files. Instead of directly creating/modifying CLAUDE.md, GEMINI.md, etc., callers should use this function to delegate instruction file management to CAAMP. The instruction file name is resolved from CAAMP’s provider registry (single source of truth), not hardcoded by the caller. Signature| Name | Type | Description |
|---|---|---|
providerId | string | Provider ID from the registry (e.g. "claude-code", "gemini-cli") |
projectDir | string | Absolute path to the project directory |
options | EnsureProviderInstructionFileOptions | References, content, and scope configuration |
- Error if the provider ID is not found in the registry
ensureAllProviderInstructionFiles(providerIds, projectDir, options)
Ensure instruction files for multiple providers at once. Deduplicates by file path — providers sharing the same instruction file (e.g. many providers use AGENTS.md) are only written once. Signature| Name | Type | Description |
|---|---|---|
providerIds | string[] | Array of provider IDs from the registry |
projectDir | string | Absolute path to the project directory |
options | EnsureProviderInstructionFileOptions | References, content, and scope configuration |
- Error if any provider ID is not found in the registry
setVerbose(v)
Enable or disable verbose (debug) logging mode. When enabled, debug messages are written to stderr. Signature| Name | Type | Description |
|---|---|---|
v | boolean | true to enable verbose mode, false to disable |
setQuiet(q)
Enable or disable quiet mode. When enabled, info and warning messages are suppressed. Errors are always shown. Signature| Name | Type | Description |
|---|---|---|
q | boolean | true to enable quiet mode, false to disable |
debug(args)
Log a debug message to stderr when verbose mode is enabled. Signature| Name | Type | Description |
|---|---|---|
args | unknown[] | Values to log (forwarded to console.error) |
info(args)
Log an informational message to stdout. Signature| Name | Type | Description |
|---|---|---|
args | unknown[] | Values to log (forwarded to console.log) |
warn(args)
Log a warning message to stderr. Signature| Name | Type | Description |
|---|---|---|
args | unknown[] | Values to log (forwarded to console.warn) |
error(args)
Log an error message to stderr. Signature| Name | Type | Description |
|---|---|---|
args | unknown[] | Values to log (forwarded to console.error) |
isVerbose()
Check if verbose (debug) logging is currently enabled. Signaturetrue if verbose mode is active
Example
isQuiet()
Check if quiet mode is currently enabled. Signaturetrue if quiet mode is active
Example
setHuman(h)
Enable or disable human-readable output mode. When enabled, commands output human-readable format instead of JSON. Signature| Name | Type | Description |
|---|---|---|
h | boolean | true to enable human mode, false to disable |
isHuman()
Check if human-readable output mode is currently enabled. Signaturetrue if human mode is active
Example
detectProvider(provider)
Detect if a single provider is installed on the system. Checks each detection method configured for the provider (binary, directory, appBundle, flatpak) and returns which methods matched. Signature| Name | Type | Description |
|---|---|---|
provider | Provider | The provider to detect |
detectProjectProvider(provider, projectDir)
Detect if a provider has project-level config in the given directory. Signature| Name | Type | Description |
|---|---|---|
provider | Provider | Provider to check for project-level config |
projectDir | string | Absolute path to the project directory |
true if the provider has a config file in the project directory
Example
detectAllProviders(options)
Detect all registered providers and return their installation status. Runs detection for every provider in the registry. Signature| Name | Type | Description |
|---|---|---|
options | : DetectionCacheOptions | Cache control options |
getInstalledProviders(options)
Get only providers that are currently installed on the system. Convenience wrapper that filtersdetectAllProviders results to only those with installed === true.
Signature
| Name | Type | Description |
|---|---|---|
options | : DetectionCacheOptions | Cache control options passed through to detection |
detectProjectProviders(projectDir, options)
Detect all providers and enrich results with project-level presence. ExtendsdetectAllProviders by also checking whether each provider has a project-level config file in the given directory.
Signature
| Name | Type | Description |
|---|---|---|
projectDir | string | Absolute path to the project directory to check |
options | : DetectionCacheOptions | Cache control options passed through to detection |
projectDetected populated
Example
resetDetectionCache()
Reset the detection result cache, forcing fresh detection on next call. SignatureinstallToCanonical(sourcePath, skillName)
Copy skill files to the canonical location. Signature| Name | Type | Description |
|---|---|---|
sourcePath | string | Absolute path to the source skill directory to copy |
skillName | string | Name for the skill (used as the subdirectory name) |
installSkill(sourcePath, skillName, providers, isGlobal, projectDir)
Install a skill from a local path to the canonical location and link to agents. Signature| Name | Type | Description |
|---|---|---|
sourcePath | string | Local path to the skill directory to install |
skillName | string | Name for the installed skill |
providers | Provider[] | Target providers to link the skill to |
isGlobal | boolean | Whether to link to global or project skill directories |
projectDir | : string | Project directory (defaults to process.cwd()) |
removeSkill(skillName, providers, isGlobal, projectDir)
Remove a skill from the canonical location and all agent symlinks. Signature| Name | Type | Description |
|---|---|---|
skillName | string | Name of the skill to remove |
providers | Provider[] | Providers to unlink the skill from |
isGlobal | boolean | Whether to target global or project skill directories |
projectDir | : string | Project directory (defaults to process.cwd()) |
listCanonicalSkills()
List all skills installed in the canonical skills directory. SignatureselectProvidersByMinimumPriority(providers, minimumPriority)
Filters providers by minimum priority and returns them in deterministic tier order. Signature| Name | Type | Description |
|---|---|---|
providers | Provider[] | The full list of providers to filter |
minimumPriority | : ProviderPriority | The minimum priority threshold, defaults to "low" (include all) |
installBatchWithRollback(options)
Installs multiple skills across filtered providers with rollback. Signature| Name | Type | Description |
|---|---|---|
options | BatchInstallOptions | The batch installation options including providers, operations, and scope |
updateInstructionsSingleOperation(providers, content, scope, projectDir)
Updates instruction files across providers as a single operation. Signature| Name | Type | Description |
|---|---|---|
providers | Provider[] | The providers whose instruction files to update |
content | string | The instruction content to inject |
scope | : Scope | The scope for instruction updates, defaults to "project" |
projectDir | : string | The project root directory, defaults to process.cwd() |
resolveFormat(options)
Resolves output format based on flags and defaults. Signature| Name | Type | Description |
|---|---|---|
options | FormatOptions | Format resolution options |
"json" or "human"
Throws
- Error if format flags conflict
buildEnvelope(operation, mvi, result, error, page, sessionId, warnings)
Builds a standard LAFS envelope. Signature| Name | Type | Description |
|---|---|---|
operation | string | Operation identifier (e.g., "skills.list", "doctor.check") |
mvi | MVILevel | Machine-Verified Instruction disclosure level |
result | T | null | Operation result data (null if error) |
error | LAFSErrorShape | null | Error details (null if success) |
page | : LAFSPage | null | Pagination info (null if not applicable) |
sessionId | : string | Optional session identifier |
warnings | : LAFSWarning[] | Optional array of warnings to attach |
emitError(operation, mvi, code, message, category, details, exitCode)
Emits a JSON error envelope to stderr and exits the process. Signature| Name | Type | Description |
|---|---|---|
operation | string | Operation identifier |
mvi | MVILevel | Machine-Verified Instruction disclosure level |
code | string | Error code |
message | string | Error message |
category | LAFSErrorCategory | Error category from LAFS protocol |
details | : Record<string | Additional error details |
exitCode | : number | Process exit code (default: 1) |
emitJsonError(operation, mvi, code, message, category, details)
Emits a JSON error envelope without exiting (for catch blocks). Signature| Name | Type | Description |
|---|---|---|
operation | string | Operation identifier |
mvi | MVILevel | Machine-Verified Instruction disclosure level |
code | string | Error code |
message | string | Error message |
category | LAFSErrorCategory | Error category from LAFS protocol |
details | : Record<string | Additional error details |
outputSuccess(operation, mvi, result, page, sessionId, warnings)
Outputs a successful LAFS envelope to stdout. Signature| Name | Type | Description |
|---|---|---|
operation | string | Operation identifier |
mvi | MVILevel | Machine-Verified Instruction disclosure level |
result | T | Operation result data |
page | : LAFSPage | Optional pagination info |
sessionId | : string | Optional session identifier |
warnings | : LAFSWarning[] | Optional warnings to attach |
handleFormatError(error, operation, mvi, jsonFlag)
Handles format resolution errors consistently. Signature| Name | Type | Description |
|---|---|---|
error | unknown | The error that occurred during format resolution |
operation | string | Operation identifier |
mvi | MVILevel | Machine-Verified Instruction disclosure level |
jsonFlag | boolean | undefined | Whether --json flag was explicitly set |
LAFSCommandError
Structured error class for LAFS-compliant command failures with error codes and recovery hints. SignatureemitSuccess(operation, result, mvi)
Emits a successful LAFS result envelope to stdout. Signature| Name | Type | Description |
|---|---|---|
operation | string | The LAFS operation identifier |
result | T | The result payload to include in the envelope |
mvi | : MVILevel | The minimum viable information level, defaults to “standard” |
emitError(operation, error, mvi)
Emits a failed LAFS error envelope to stderr. Signature| Name | Type | Description |
|---|---|---|
operation | string | The LAFS operation identifier |
error | unknown | The error to serialize, either a LAFSCommandError or generic Error/unknown |
mvi | : MVILevel | The minimum viable information level, defaults to “standard” |
runLafsCommand(command, mvi, action)
Runs an async action and emits the result as a LAFS success or error envelope. Signature| Name | Type | Description |
|---|---|---|
command | string | The LAFS operation identifier |
mvi | MVILevel | The minimum viable information level |
action | ( | The async function to execute |
parsePriority(value)
Parses and validates a provider priority tier string. Signature| Name | Type | Description |
|---|---|---|
value | string | The priority string to parse |
resolveProviders(options)
Resolves the set of target providers from CLI targeting options. Signature| Name | Type | Description |
|---|---|---|
options | ProviderTargetOptions | The provider targeting options from the CLI |
readJsonFile(path)
Reads and parses a JSON file from disk. Signature| Name | Type | Description |
|---|---|---|
path | string | Absolute or relative path to the JSON file |
readSkillOperations(path)
Reads and validates a JSON file containing skill batch operations. Signature| Name | Type | Description |
|---|---|---|
path | string | Path to the JSON file containing an array of skill operations |
readTextInput(inlineContent, filePath)
Reads text input from either inline content or a file path, enforcing mutual exclusivity. Signature| Name | Type | Description |
|---|---|---|
inlineContent | string | undefined | Inline text content from the —content flag, or undefined |
filePath | string | undefined | Path to a content file from the —content-file flag, or undefined |
registerAdvancedBatch(parent)
Registers theadvanced batch subcommand for rollback-capable batch install of skills.
Signature
| Name | Type | Description |
|---|---|---|
parent | Command | The parent advanced Command to attach the batch subcommand to |
registerAdvancedInstructions(parent)
Registers theadvanced instructions subcommand for single-operation instruction updates.
Signature
| Name | Type | Description |
|---|---|---|
parent | Command | The parent advanced Command to attach the instructions subcommand to |
registerAdvancedProviders(parent)
Registers theadvanced providers subcommand for selecting providers by priority tier.
Signature
| Name | Type | Description |
|---|---|---|
parent | Command | The parent advanced Command to attach the providers subcommand to |
registerAdvancedCommands(program)
Registers theadvanced command group with providers, batch, and instructions subcommands.
Signature
| Name | Type | Description |
|---|---|---|
program | Command | The root Commander program to attach the advanced command group to |
deepMerge(target, source)
Deep merge two objects, withsource values winning on conflict. Recursively merges nested plain objects. Arrays and non-object values from source overwrite target values.
Signature
| Name | Type | Description |
|---|---|---|
target | Record<string | Base object to merge into |
source | Record<string | Object with values that take precedence |
setNestedValue(obj, keyPath, key, value)
Set a nested value using a dot-notation key path. Signature| Name | Type | Description |
|---|---|---|
obj | Record<string | Root object to modify |
keyPath | string | Dot-separated path to the parent key (e.g. "mcpServers") |
key | string | Final key name for the value |
value | unknown | Value to set at the nested location |
getNestedValue(obj, keyPath)
Get a nested value from an object using a dot-notation key path. Signature| Name | Type | Description |
|---|---|---|
obj | Record<string | Object to traverse |
keyPath | string | Dot-separated key path (e.g. "mcpServers" or "a.b.c") |
undefined if not found
Example
ensureDir(filePath)
Ensure that the parent directories of a file path exist. Creates directories recursively if they do not exist. Signature| Name | Type | Description |
|---|---|---|
filePath | string | Absolute path to a file (parent directories will be created) |
readJsonConfig(filePath)
Read and parse a JSON or JSONC config file. Signature| Name | Type | Description |
|---|---|---|
filePath | string | Absolute path to the JSON/JSONC file |
writeJsonConfig(filePath, configKey, serverName, serverConfig)
Write a server config entry to a JSON/JSONC file, preserving comments. Signature| Name | Type | Description |
|---|---|---|
filePath | string | Absolute path to the JSON/JSONC file |
configKey | string | Dot-notation key path to the servers section (e.g. "mcpServers") |
serverName | string | Name/key for the server entry |
serverConfig | unknown | Server configuration object to write |
removeJsonConfig(filePath, configKey, serverName)
Remove a server entry from a JSON/JSONC config file. Signature| Name | Type | Description |
|---|---|---|
filePath | string | Absolute path to the JSON/JSONC file |
configKey | string | Dot-notation key path to the servers section |
serverName | string | Name/key of the server entry to remove |
true if the entry was removed, false if the file or entry was not found
Example
readTomlConfig(filePath)
Read and parse a TOML config file. Signature| Name | Type | Description |
|---|---|---|
filePath | string | Absolute path to the TOML file |
writeTomlConfig(filePath, configKey, serverName, serverConfig)
Write a server config entry to a TOML file. Signature| Name | Type | Description |
|---|---|---|
filePath | string | Absolute path to the TOML file |
configKey | string | Dot-notation key path to the servers section |
serverName | string | Name/key for the server entry |
serverConfig | unknown | Server configuration object to write |
removeTomlConfig(filePath, configKey, serverName)
Remove a server entry from a TOML config file. Signature| Name | Type | Description |
|---|---|---|
filePath | string | Absolute path to the TOML file |
configKey | string | Dot-notation key path to the servers section |
serverName | string | Name/key of the server entry to remove |
true if the entry was removed, false if the file or entry was not found
Example
readYamlConfig(filePath)
Read and parse a YAML config file. Signature| Name | Type | Description |
|---|---|---|
filePath | string | Absolute path to the YAML file |
writeYamlConfig(filePath, configKey, serverName, serverConfig)
Write a server config entry to a YAML file. Signature| Name | Type | Description |
|---|---|---|
filePath | string | Absolute path to the YAML file |
configKey | string | Dot-notation key path to the servers section |
serverName | string | Name/key for the server entry |
serverConfig | unknown | Server configuration object to write |
removeYamlConfig(filePath, configKey, serverName)
Remove a server entry from a YAML config file. Signature| Name | Type | Description |
|---|---|---|
filePath | string | Absolute path to the YAML file |
configKey | string | Dot-notation key path to the servers section |
serverName | string | Name/key of the server entry to remove |
true if the entry was removed, false if the file or entry was not found
Example
readConfig(filePath, format)
Read and parse a config file in the specified format. Dispatches to the appropriate format handler (JSON/JSONC, YAML, or TOML). Signature| Name | Type | Description |
|---|---|---|
filePath | string | Absolute path to the config file |
format | ConfigFormat | Config file format |
- If the file cannot be read or the format is unsupported
writeConfig(filePath, format, key, serverName, serverConfig)
Write a server entry to a config file, preserving existing content. Dispatches to the appropriate format handler. For JSONC files, comments are preserved usingjsonc-parser.
Signature
| Name | Type | Description |
|---|---|---|
filePath | string | Absolute path to the config file |
format | ConfigFormat | Config file format |
key | string | Dot-notation key path to the servers section (e.g. "mcpServers") |
serverName | string | Name/key for the server entry |
serverConfig | unknown | Server configuration object to write |
- If the format is unsupported
removeConfig(filePath, format, key, serverName)
Remove a server entry from a config file in the specified format. Signature| Name | Type | Description |
|---|---|---|
filePath | string | Absolute path to the config file |
format | ConfigFormat | Config file format |
key | string | Dot-notation key path to the servers section |
serverName | string | Name/key of the server entry to remove |
true if the entry was removed, false otherwise
Throws
- If the format is unsupported
registerConfigCommand(program)
Registers theconfig command group with show and path subcommands for viewing provider configurations.
Signature
| Name | Type | Description |
|---|---|---|
program | Command | The root Commander program to attach the config command group to |
readLockFile()
Read and parse the CAAMP lock file from disk. SignaturewriteLockFile(lock)
Write the lock file atomically under a process lock guard. Signature| Name | Type | Description |
|---|---|---|
lock | CaampLockFile | Lock file data to persist |
updateLockFile(updater)
Safely read-modify-write the lock file under a process lock guard. Signature| Name | Type | Description |
|---|---|---|
updater | (lock: CaampLockFile | Callback that modifies the lock object (may be async) |
getCaampVersion()
Retrieve the current CAAMP package version from the nearestpackage.json.
Signature
"1.8.1")
Example
registerDoctorCommand(program)
Registers thedoctor command for diagnosing configuration issues and overall system health.
Signature
| Name | Type | Description |
|---|---|---|
program | Command | The root Commander program to attach the doctor command to |
registerInstructionsCheck(parent)
Registers theinstructions check subcommand for verifying injection status across providers.
Signature
| Name | Type | Description |
|---|---|---|
parent | Command | The parent instructions Command to attach the check subcommand to |
registerInstructionsInject(parent)
Registers theinstructions inject subcommand for injecting instruction blocks into provider files.
Signature
| Name | Type | Description |
|---|---|---|
parent | Command | The parent instructions Command to attach the inject subcommand to |
registerInstructionsUpdate(parent)
Registers theinstructions update subcommand for refreshing all instruction file injections.
Signature
| Name | Type | Description |
|---|---|---|
parent | Command | The parent instructions Command to attach the update subcommand to |
registerInstructionsCommands(program)
Registers theinstructions command group with inject, check, and update subcommands.
Signature
| Name | Type | Description |
|---|---|---|
program | Command | The root Commander program to attach the instructions command group to |
resetHookMappings()
Reset the cached hook mappings data. SignaturegetCanonicalEvent(event)
Get the canonical event definition (category, description, canBlock). Signature| Name | Type | Description |
|---|---|---|
event | CanonicalHookEvent | The canonical event name to look up. |
getAllCanonicalEvents()
Get all canonical event definitions. SignaturegetCanonicalEventsByCategory(category)
Get canonical events filtered by category. Signature| Name | Type | Description |
|---|---|---|
category | HookCategory | The hook category to filter by (e.g. "session", "tool"). |
getProviderHookProfile(providerId)
Get the full hook profile for a provider. Signature| Name | Type | Description |
|---|---|---|
providerId | string | The provider identifier (e.g. "claude-code", "gemini-cli"). |
undefined if not found.
Example
getMappedProviderIds()
Get all provider IDs that have hook mappings. SignaturetoNative(canonical, providerId)
Translate a CAAMP canonical event name to the provider’s native name. Signature| Name | Type | Description |
|---|---|---|
canonical | CanonicalHookEvent | The CAAMP canonical event name to translate. |
providerId | string | The target provider identifier. |
null if unsupported.
Example
toCanonical(nativeName, providerId)
Translate a provider-native event name to the CAAMP canonical name. Signature| Name | Type | Description |
|---|---|---|
nativeName | string | The provider-native event name to look up. |
providerId | string | The provider identifier to search within. |
null if no mapping exists.
Example
toNativeBatch(canonicals, providerId)
Batch-translate multiple canonical events to native names for a provider. Signature| Name | Type | Description |
|---|---|---|
canonicals | CanonicalHookEvent[] | Array of canonical event names to translate. |
providerId | string | The target provider identifier. |
supportsHook(canonical, providerId)
Check if a provider supports a specific canonical hook event. Signature| Name | Type | Description |
|---|---|---|
canonical | CanonicalHookEvent | The canonical event name to check. |
providerId | string | The provider identifier to check against. |
true if the provider supports this canonical event, false otherwise.
Example
getHookSupport(canonical, providerId)
Get full hook support details for a canonical event on a provider. Signature| Name | Type | Description |
|---|---|---|
canonical | CanonicalHookEvent | The canonical event name to query. |
providerId | string | The provider identifier to query against. |
getSupportedEvents(providerId)
Get all supported canonical events for a provider. Signature| Name | Type | Description |
|---|---|---|
providerId | string | The provider identifier to query. |
getUnsupportedEvents(providerId)
Get all unsupported canonical events for a provider. Signature| Name | Type | Description |
|---|---|---|
providerId | string | The provider identifier to query. |
getProvidersForEvent(canonical)
Get providers that support a specific canonical event. Signature| Name | Type | Description |
|---|---|---|
canonical | CanonicalHookEvent | The canonical event name to search for. |
getCommonEvents(providerIds)
Get canonical events common to all specified providers. Signature| Name | Type | Description |
|---|---|---|
providerIds | string[] | Array of provider IDs to intersect. |
getProviderSummary(providerId)
Get a summary of hook support for a provider. Signature| Name | Type | Description |
|---|---|---|
providerId | string | The provider identifier to summarize. |
undefined if the provider is not found.
Example
buildHookMatrix(providerIds)
Build a cross-provider hook support matrix. Signature| Name | Type | Description |
|---|---|---|
providerIds | : string[] | Optional array of provider IDs to include. Defaults to all mapped providers. |
getHookSystemType(providerId)
Get the hook system type for a provider. Signature| Name | Type | Description |
|---|---|---|
providerId | string | The provider identifier to query. |
"config", "plugin", or "none").
Example
getHookConfigPath(providerId)
Get the resolved hook config path for a provider. Signature| Name | Type | Description |
|---|---|---|
providerId | string | The provider identifier to query. |
null if not available.
Example
getProviderOnlyEvents(providerId)
Get provider-only events (native events with no canonical mapping). Signature| Name | Type | Description |
|---|---|---|
providerId | string | The provider identifier to query. |
translateToAll(canonical, providerIds)
Translate a canonical event to native names across multiple providers. Signature| Name | Type | Description |
|---|---|---|
canonical | CanonicalHookEvent | The canonical event name to translate. |
providerIds | string[] | Array of provider IDs to translate for. |
resolveNativeEvent(nativeName)
Find the best canonical match for a native event name across all providers. Signature| Name | Type | Description |
|---|---|---|
nativeName | string | The provider-native event name to resolve. |
getHookMappingsVersion()
Get the version of the hook mappings data. SignatureregisterProvidersCommand(program)
Registers theproviders command group with list, detect, show, skills-map, hooks, and capabilities subcommands.
Signature
| Name | Type | Description |
|---|---|---|
program | Command | The root Commander program to attach the providers command group to |
getRulesByCategory(category)
Get audit rules filtered by category. Signature| Name | Type | Description |
|---|---|---|
category | string | Category name to filter by |
getRulesBySeverity(severity)
Get audit rules filtered by severity level. Signature| Name | Type | Description |
|---|---|---|
severity | AuditSeverity | Severity level to filter by |
getCategories()
Get all unique rule categories. SignaturescanFile(filePath, rules)
Scan a single file against security audit rules. Signature| Name | Type | Description |
|---|---|---|
filePath | string | Absolute path to the file to scan |
rules | : AuditRule[] | Custom rules to scan against (defaults to the built-in 46+ rules) |
scanDirectory(dirPath)
Scan a directory of skills for security issues. Signature| Name | Type | Description |
|---|---|---|
dirPath | string | Absolute path to the skills directory to scan |
toSarif(results)
Convert audit results to SARIF 2.1.0 format (Static Analysis Results Interchange Format). Signature| Name | Type | Description |
|---|---|---|
results | AuditResult[] | Array of audit results to convert |
registerSkillsAudit(parent)
Registers theskills audit subcommand for security scanning skill files.
Signature
| Name | Type | Description |
|---|---|---|
parent | Command | The parent skills Command to attach the audit subcommand to |
parseSource(input)
Parse and classify a source string into a typedParsedSource.
Signature
| Name | Type | Description |
|---|---|---|
input | string | Raw source string to classify |
isMarketplaceScoped(input)
Check if a source string looks like a marketplace scoped name (@author/name).
Signature
| Name | Type | Description |
|---|---|---|
input | string | Source string to check |
true if the input matches the @scope/name pattern
Example
recordSkillInstall(skillName, scopedName, source, sourceType, agents, canonicalPath, isGlobal, projectDir, version)
Record a skill installation in the lock file. Signature| Name | Type | Description |
|---|---|---|
skillName | string | Skill name |
scopedName | string | Scoped name (may include marketplace scope) |
source | string | Original source string |
sourceType | SourceType | Classified source type |
agents | string[] | Provider IDs the skill was linked to |
canonicalPath | string | Absolute path to the canonical installation |
isGlobal | boolean | Whether this is a global installation |
projectDir | : string | Project directory (for project-scoped installs) |
version | : string | Version string or commit SHA |
removeSkillFromLock(skillName)
Remove a skill entry from the lock file. Signature| Name | Type | Description |
|---|---|---|
skillName | string | Name of the skill to remove |
true if the entry was found and removed, false if not found
Example
getTrackedSkills()
Get all skills tracked in the lock file. SignaturecheckSkillUpdate(skillName)
Check if a skill has updates available by comparing the installed version against the latest remote commit SHA. Signature| Name | Type | Description |
|---|---|---|
skillName | string | Name of the installed skill to check |
checkAllSkillUpdates()
Check for updates across all tracked skills. SignatureregisterSkillsCheck(parent)
Registers theskills check subcommand for checking available skill updates.
Signature
| Name | Type | Description |
|---|---|---|
parent | Command | The parent skills Command to attach the check subcommand to |
NetworkError
Structured error for network failures with categorized kind. SignaturefetchWithTimeout(url, init, timeoutMs)
Fetch a URL with an automatic timeout viaAbortSignal.timeout.
Signature
| Name | Type | Description |
|---|---|---|
url | string | URL to fetch |
init | : RequestInit | Optional RequestInit options forwarded to fetch |
timeoutMs | : number | Timeout in milliseconds (defaults to DEFAULT_FETCH_TIMEOUT_MS) |
Response object from the fetch call
Throws
NetworkErroron timeout or network failure
ensureOkResponse(response, url)
Assert that aResponse has an OK status, throwing on failure.
Signature
| Name | Type | Description |
|---|---|---|
response | Response | Fetch Response to validate |
url | string | Original request URL (included in the error) |
Response if status is OK
Throws
NetworkErrorwhenresponse.okisfalse
formatNetworkError(error)
Format a network error into a user-friendly message string. Signature| Name | Type | Description |
|---|---|---|
error | unknown | The caught error value |
SkillsMPAdapter
Marketplace adapter for the agentskills.in API. Signaturesearch()
Search for skills by query string.getSkill()
Look up a specific skill by its scoped name.SkillsShAdapter
Marketplace adapter for the skills.sh API. Signaturesearch()
Search for skills by query string.getSkill()
Look up a specific skill by its scoped name.MarketplaceUnavailableError
Error thrown when all marketplace sources fail to respond. SignatureMarketplaceClient
Unified marketplace client that aggregates results from multiple marketplace adapters. Queries all configured marketplaces in parallel, deduplicates results by scoped name, and sorts by star count. Signaturesearch()
Search all marketplaces and return deduplicated, sorted results. Queries all adapters in parallel and deduplicates byscopedName, keeping the entry with the highest star count. Results are sorted by stars descending.
getSkill()
Get a specific skill by its scoped name from any marketplace. Tries each adapter in order and returns the first match.tokenizeCriteriaValue(value)
Splits a comma-separated criteria string into normalized tokens. Signature| Name | Type | Description |
|---|---|---|
value | string | The comma-separated string to tokenize |
validateRecommendationCriteria(input)
Validates recommendation criteria input for correctness and consistency. Signature| Name | Type | Description |
|---|---|---|
input | RecommendationCriteriaInput | The raw recommendation criteria to validate |
normalizeRecommendationCriteria(input)
Normalizes raw recommendation criteria into a consistent tokenized form. Signature| Name | Type | Description |
|---|---|---|
input | RecommendationCriteriaInput | The raw recommendation criteria to normalize |
scoreSkillRecommendation(skill, criteria, options)
Computes a recommendation score for a single skill against normalized criteria. Signature| Name | Type | Description |
|---|---|---|
skill | MarketplaceResult | The marketplace skill result to score |
criteria | NormalizedRecommendationCriteria | The normalized recommendation criteria to score against |
options | : RecommendationOptions | Optional scoring configuration including weights and markers |
recommendSkills(skills, criteriaInput, options)
Validates, normalizes, scores, and ranks a list of skills against criteria. Signature| Name | Type | Description |
|---|---|---|
skills | MarketplaceResult[] | The array of marketplace skill results to rank |
criteriaInput | RecommendationCriteriaInput | The raw recommendation criteria from the user |
options | : RecommendationOptions | Optional configuration for scoring and result limiting |
- Error with
codeandissuesproperties when criteria are invalid
formatSkillRecommendations(result, opts)
Format skill recommendation results for display or serialization. Signature| Name | Type | Description |
|---|---|---|
result | RecommendSkillsResult | The recommendation result to format |
opts | { mode: "human" | "json"; details?: boolean; } | Formatting options including output mode and detail level |
searchSkills(query, options)
Search for skills via marketplace APIs. Signature| Name | Type | Description |
|---|---|---|
query | string | Search query string (must be non-empty) |
options | : SearchSkillsOptions | Search options including result limit |
recommendSkills(query, criteria, options)
Search and rank skills based on query and recommendation criteria. Signature| Name | Type | Description |
|---|---|---|
query | string | Search query string |
criteria | Omit<RecommendationCriteriaInput | Recommendation criteria (task type, context, preferences) |
options | : RecommendSkillsQueryOptions | Options for limiting and tuning results |
registerSkillsFind(parent)
Registers theskills find subcommand for searching marketplaces and recommending skills.
Signature
| Name | Type | Description |
|---|---|---|
parent | Command | The parent skills Command to attach the find subcommand to |
registerSkillsInit(parent)
Registers theskills init subcommand for scaffolding new SKILL.md templates.
Signature
| Name | Type | Description |
|---|---|---|
parent | Command | The parent skills Command to attach the init subcommand to |
loadLibraryFromModule(root)
Load a SkillLibrary from a module (index.js) at the given root directory. Signature| Name | Type | Description |
|---|---|---|
root | string | Absolute path to the library root (must contain index.js or package.json with main) |
- If the module cannot be loaded or does not implement SkillLibrary
buildLibraryFromFiles(root)
Build a SkillLibrary from raw files in a directory. Signature| Name | Type | Description |
|---|---|---|
root | string | Absolute path to the library root directory |
- If skills.json is not found at the root
registerSkillLibrary(library)
Registers a SkillLibrary instance directly as the active catalog. Signature| Name | Type | Description |
|---|---|---|
library | SkillLibrary | A SkillLibrary implementation to use as the catalog |
registerSkillLibraryFromPath(root)
Registers a skill library by loading it from a directory path. Signature| Name | Type | Description |
|---|---|---|
root | string | Absolute path to the skill library root directory |
- Error if the library cannot be loaded from the given path
clearRegisteredLibrary()
Clears the registered skill library instance. SignatureisCatalogAvailable()
Checks whether a skill library is available for use. SignaturegetSkills()
Returns all skill entries from the catalog. SignaturegetManifest()
Returns the parsed skill library manifest. SignaturelistSkills()
Lists all available skill names in the catalog. SignaturegetSkill(name)
Gets skill metadata by name from the catalog. Signature| Name | Type | Description |
|---|---|---|
name | string | The unique skill name to look up |
getSkillPath(name)
Resolves the absolute path to a skill’s SKILL.md file. Signature| Name | Type | Description |
|---|---|---|
name | string | The unique skill name to resolve |
getSkillDir(name)
Resolves the absolute path to a skill’s directory. Signature| Name | Type | Description |
|---|---|---|
name | string | The unique skill name to resolve |
readSkillContent(name)
Reads a skill’s SKILL.md content as a string. Signature| Name | Type | Description |
|---|---|---|
name | string | The unique skill name to read |
getCoreSkills()
Returns all skills marked as core in the catalog. SignaturegetSkillsByCategory(category)
Returns skills filtered by category. Signature| Name | Type | Description |
|---|---|---|
category | SkillLibraryEntry["category"] | The category to filter by |
getSkillDependencies(name)
Gets the direct dependency names for a skill. Signature| Name | Type | Description |
|---|---|---|
name | string | The unique skill name to query dependencies for |
resolveDependencyTree(names)
Resolves the full dependency tree for a set of skill names. Signature| Name | Type | Description |
|---|---|---|
names | string[] | The skill names to resolve dependencies for |
listProfiles()
Lists all available profile names in the catalog. SignaturegetProfile(name)
Gets a profile definition by name from the catalog. Signature| Name | Type | Description |
|---|---|---|
name | string | The unique profile name to look up |
resolveProfile(name)
Resolves a profile to its full skill list including inherited skills. Signature| Name | Type | Description |
|---|---|---|
name | string | The profile name to resolve |
listSharedResources()
Lists all available shared resource names in the catalog. SignaturegetSharedResourcePath(name)
Gets the absolute path to a shared resource file. Signature| Name | Type | Description |
|---|---|---|
name | string | The shared resource name to resolve |
readSharedResource(name)
Reads a shared resource file’s content as a string. Signature| Name | Type | Description |
|---|---|---|
name | string | The shared resource name to read |
listProtocols()
Lists all available protocol names in the catalog. SignaturegetProtocolPath(name)
Gets the absolute path to a protocol file. Signature| Name | Type | Description |
|---|---|---|
name | string | The protocol name to resolve |
readProtocol(name)
Reads a protocol file’s content as a string. Signature| Name | Type | Description |
|---|---|---|
name | string | The protocol name to read |
validateSkillFrontmatter(name)
Validates a single skill’s frontmatter against the schema. Signature| Name | Type | Description |
|---|---|---|
name | string | The skill name to validate |
validateAll()
Validates all skills in the catalog and returns results per skill. SignaturegetDispatchMatrix()
Gets the dispatch matrix from the skill library manifest. SignaturegetVersion()
Returns the skill library version string. SignaturegetLibraryRoot()
Returns the absolute path to the skill library root directory. SignatureparseSkillFile(filePath)
Parse a SKILL.md file and extract its frontmatter metadata. Signature| Name | Type | Description |
|---|---|---|
filePath | string | Absolute path to the SKILL.md file |
null if invalid
Example
discoverSkill(skillDir)
Discover a single skill at a given directory path. Signature| Name | Type | Description |
|---|---|---|
skillDir | string | Absolute path to a skill directory (containing SKILL.md) |
null if no valid SKILL.md exists
Example
discoverSkills(rootDir)
Scan a directory for skill subdirectories, each containing a SKILL.md file. Signature| Name | Type | Description |
|---|---|---|
rootDir | string | Absolute path to a skills root directory to scan |
discoverSkillsMulti(dirs)
Discover skills across multiple directories. Signature| Name | Type | Description |
|---|---|---|
dirs | string[] | Array of absolute paths to skills directories to scan |
cloneRepo(owner, repo, ref, subPath)
Clone a GitHub repo to a temp directory. Signature| Name | Type | Description |
|---|---|---|
owner | string | GitHub repository owner (user or organization) |
repo | string | GitHub repository name |
ref | : string | Branch or tag to clone (defaults to the repo’s default branch) |
subPath | : string | Subdirectory within the repo to target |
fetchRawFile(owner, repo, path, ref)
Fetch a specific file from GitHub using the raw API. Signature| Name | Type | Description |
|---|---|---|
owner | string | GitHub repository owner |
repo | string | GitHub repository name |
path | string | File path within the repository |
ref | : string | Branch or tag to fetch from (defaults to "main") |
null if the file cannot be fetched
Example
repoExists(owner, repo)
Check if a GitHub repo exists. Signature| Name | Type | Description |
|---|---|---|
owner | string | GitHub repository owner |
repo | string | GitHub repository name |
true if the repository exists and is accessible
Example
cloneGitLabRepo(owner, repo, ref, subPath)
Clone a GitLab repo to a temp directory. Signature| Name | Type | Description |
|---|---|---|
owner | string | GitLab repository owner (user or group) |
repo | string | GitLab repository name |
ref | : string | Branch or tag to clone (defaults to the repo’s default branch) |
subPath | : string | Subdirectory within the repo to target |
fetchGitLabRawFile(owner, repo, path, ref)
Fetch a specific file from GitLab using the raw API. Signature| Name | Type | Description |
|---|---|---|
owner | string | GitLab repository owner (user or group) |
repo | string | GitLab repository name |
path | string | File path within the repository |
ref | : string | Branch or tag to fetch from (defaults to "main") |
null if the file cannot be fetched
Example
registerSkillsInstall(parent)
Registers theskills install subcommand for installing skills from various sources.
Signature
| Name | Type | Description |
|---|---|---|
parent | Command | The parent skills Command to attach the install subcommand to |
registerSkillsList(parent)
Registers theskills list subcommand for listing installed skills.
Signature
| Name | Type | Description |
|---|---|---|
parent | Command | The parent skills Command to attach the list subcommand to |
registerSkillsRemove(parent)
Registers theskills remove subcommand for removing installed skills.
Signature
| Name | Type | Description |
|---|---|---|
parent | Command | The parent skills Command to attach the remove subcommand to |
registerSkillsUpdate(parent)
Registers theskills update subcommand for updating all outdated skills.
Signature
| Name | Type | Description |
|---|---|---|
parent | Command | The parent skills Command to attach the update subcommand to |
validateSkill(filePath)
Validate a SKILL.md file against the Agent Skills standard. Signature| Name | Type | Description |
|---|---|---|
filePath | string | Absolute path to the SKILL.md file to validate |
registerSkillsValidate(parent)
Registers theskills validate subcommand for validating SKILL.md file format.
Signature
| Name | Type | Description |
|---|---|---|
parent | Command | The parent skills Command to attach the validate subcommand to |
registerSkillsCommands(program)
Registers theskills command group with all skill management subcommands.
Signature
| Name | Type | Description |
|---|---|---|
program | Command | The root Commander program to attach the skills command group to |
isCaampOwnedSkill(skillName)
Check whether a skill name is reserved by CAAMP (ct-* prefix). Signature| Name | Type | Description |
|---|---|---|
skillName | string | Skill name to check |
true if the skill name starts with ct-
Example
checkSkillIntegrity(skillName, providers, scope, projectDir)
Check the integrity of a single installed skill. Signature| Name | Type | Description |
|---|---|---|
skillName | string | Name of the skill to check |
providers | Provider[] | Providers to check symlinks for |
scope | : "global" | "project" | Whether to check global or project links |
projectDir | : string | Project directory (for project scope) |
checkAllSkillIntegrity(providers, scope, projectDir)
Check integrity of all tracked skills. Signature| Name | Type | Description |
|---|---|---|
providers | Provider[] | Providers to check symlinks for |
scope | : "global" | "project" | Whether to check global or project links |
projectDir | : string | Project directory (for project scope) |
shouldOverrideSkill(skillName, incomingSource, existingEntry)
Resolve a skill name conflict where a user-installed skill collides with a CAAMP-owned (ct-*) skill. Signature| Name | Type | Description |
|---|---|---|
skillName | string | Skill name to check |
incomingSource | string | Source of the incoming skill installation |
existingEntry | LockEntry | undefined | Existing lock entry, if any |
true if the incoming installation should proceed
Example
validateInstructionIntegrity(providers, projectDir, scope, expectedContent)
Validate instruction file injection status across all providers. Signature| Name | Type | Description |
|---|---|---|
providers | Provider[] | Providers to check |
projectDir | string | Project directory |
scope | "project" | "global" | Whether to check global or project files |
expectedContent | : string | Expected CAAMP block content |
resolveCantImports(content, projectRoot)
Resolve *.cant references in instruction file content. Scans each line for directives pointing to .cant files. For each match, reads and parses the .cant file, converts its definitions to markdown, and replaces the line with the generated content. Lines that don’t match the .cant import pattern are left unchanged. Signature| Name | Type | Description |
|---|---|---|
content | string | Raw instruction file content |
projectRoot | string | Absolute path to the project root directory |
cantToMarkdown(cantContent)
Convert a .cant file’s content to markdown equivalent. Parses the frontmatter to determine the document kind, then converts the body into structured markdown that providers can consume (headings, bullet lists, code blocks). Signature| Name | Type | Description |
|---|---|---|
cantContent | string | Raw .cant file content |
discoverWellKnown(domain)
Discover skills from a well-known URL. Signature| Name | Type | Description |
|---|---|---|
domain | string | Domain name to query (e.g. "example.com") |