From pinky-promise
Validates API calls against published interface contracts from a registry. Useful when planning or reviewing code that consumes external services.
How this skill is triggered — by the user, by Claude, or both
Slash command
/pinky-promise:api-contract-checkThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Validate the current implementation or plan against published API specs.
Validate the current implementation or plan against published API specs.
Specs come exclusively from the registry. Never read another service's code or files — no find, no reading from .. or sibling directories, no inferring the API from .go, .ts, .proto, or any other source files. Only read from .pinky-promise/registry/ after a fresh clone.
Announce: "Running api-contract-check to validate against published API specs."
Resolve API_REGISTRY_REPO — use the Read tool, no shell execution:
.claude/settings.json → check env.API_REGISTRY_REPOCLAUDE.md → line matching API_REGISTRY_REPO=If not found in either, $API_REGISTRY_REPO may still be set in the session environment and will be used directly by the clone command below. Only stop if the clone itself fails.
Clone with --filter=blob:none --sparse — no blobs are fetched yet:
rm -rf .pinky-promise/registry
git clone --depth 1 --filter=blob:none --sparse "$API_REGISTRY_REPO" .pinky-promise/registry
If clone fails:
"Registry unreachable or not configured (
API_REGISTRY_REPOis not set, or the repo is inaccessible). Skipping contract check. SetAPI_REGISTRY_REPOin.claude/settings.jsonor projectCLAUDE.md— seedocs/registry-setup.md."
Stop.
cat api-dependencies.json
If the file does not exist, prompt to create it:
"No api-dependencies.json found. Which services does this project consume?"
List available services using the tree index (no blobs downloaded):
git -C .pinky-promise/registry ls-tree HEAD services/
For each service the user names (resolve partial names against the listing), list available versions and ask which to pin:
git -C .pinky-promise/registry sparse-checkout set "services/<service-name>"
ls .pinky-promise/registry/services/<service-name>/ | sort -V
Write api-dependencies.json to the project root:
{
"<service-name>": "<pinned-version>"
}
Announce: "Created api-dependencies.json. Proceeding with contract check."
For each entry in api-dependencies.json, sparse-checkout that service (adding to any already checked out):
git -C .pinky-promise/registry sparse-checkout add "services/<service-name>"
If the service directory does not exist after checkout:
"Warning: [service-name] has no entry in the registry. Run
/api-spec-import <url-to-spec>to register it and enable contract checking. Skipping contract check for this service."
Continue to the next dependency.
If the service exists, read the pinned contract:
cat .pinky-promise/registry/services/<service-name>/<pinned-version>.json
Check pinkyPromiseVersion in the contract. If it is higher than 1:
"Warning: [service-name] v[pinned-version] was written by a newer version of pinky-promise (format version [n]). Update the plugin to validate correctly. Skipping contract check for this service."
Continue to the next dependency.
Also read the bindings if present:
cat .pinky-promise/registry/services/<service-name>/bindings.json 2>/dev/null || true
Select the binding entries that apply to the pinned version using this priority order:
contractVersion match (e.g. "1.5.0" for pinned version 1.5.0)"1.*" for any 1.x.y)contractVersion (fallback)Use only the selected entries for transport-level validation (HTTP paths, gRPC RPC names, connection URLs).
Also read the consumer's credential mapping if present:
cat .pinky-promise/credentials.json 2>/dev/null || true
If connection.auth is declared in the binding but .pinky-promise/credentials.json has no entry for this service, warn:
"Warning: [service-name] requires
[auth.type]authentication but no credentials are configured. Add an entry for[service-name]to.pinky-promise/credentials.json."
If the file does not exist:
"Error: [service-name] version [pinned-version] not found in registry ([API_REGISTRY_REPO]). Check api-dependencies.json."
rm -rf .pinky-promise/registry
Stop on this error.
For each pinned spec, check the current implementation or plan:
Operations called:
Events/subscriptions consumed:
Report each violation:
"[service-name] — [member-name]: [description of violation]"
If no violations:
"[service-name] v[pinned-version] — contract check passed."
For each deprecated member in use:
"Warning: [service-name].[member-name] is deprecated. [deprecated.message][. Sunset planned for v[deprecated.sunsetVersion] if present]."
For each pinned service, find the highest version within the same major:
MAJOR=$(echo "<pinned-version>" | cut -d. -f1)
ls .pinky-promise/registry/services/<service-name>/ | sort -V | grep "^${MAJOR}\." | tail -1
If a newer compatible version exists:
"Update available: [service-name] [pinned-version] → [latest-compatible]. New in [latest-compatible]: [list operations/events/subscriptions added since pinned-version, found by comparing the two spec files]."
rm -rf .pinky-promise/registry
npx claudepluginhub superluminar-io/pinky-promise --plugin pinky-promiseCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.