Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Add An Adapter?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/hishamkaram-add-an-adapter)
---
name: add-an-adapter
description: Add a provider adapter with runtime capability checks while preserving shared lifecycle ownership and versioned evidence interpretation.
---
# Add a provider adapter
## Trigger
Use this skill for a new provider adapter or a repair to an adapter contract,
profile, interpreter, registration, fixture, or acceptance gate. Read the
[launch boundary](../../agents/_data/adapter-contract.md#2-launch-planning-and-preflight-policy)
and [evidence interpretation rules](../../agents/_data/adapter-contract.md#4-evidence-capture-and-publication-predicates).
Use the [provider guide](../../docs/providers.md) for current profiles and load
lifecycle or native guidance only when the change affects those boundaries.
## Inputs
- the immutable provider ID, supported request options, runtime capability
profile, executable/help compatibility, and output-predicate revision;
- the exact owned package, catalog, fixture, harness, and documentation files;
- the provider's configuration precedence, identity/session semantics, native
envelope, usage fields, and failure markers; and
- the plan's unit, supervisor, containment, continuation, refusal/timeout, and
replay scenarios.
## Workflow
1. Define the smallest supported profile and validate the controls requested by
the task. Reject escalation, arbitrary executable loading, and unsupported
or ineffective requested options before admission. Treat native
configuration, authentication, MCP servers, hooks, plugins, unrelated
provider policy, and OS/version/build identity as provider-owned
observations: record or report them, but do not reject them as adapter-owned
policy drift. Preserve existing IDs and native login flows.
2. Implement provider-owned preparation, native argv/configuration and identity
handling, and a versioned interpreter over sealed evidence. The adapter only
prepares a plan and interprets evidence: it does not own pipes, capture,
sealing, processes, stopping, deadlines, collection, or publication.
For small non-secret UTF-8 configuration files, declare `Plan.InputFiles`
with a safe lowercase name, exact content and an empty reserved argv slot.
The `stage.` prefix is reserved for core durability and scavenging.
For optional native output files, declare `Plan.OutputArtifacts` and the
`OutputWriterContract` in both the plan and adapter declaration. The core
binds declarations to immutable metadata, supplies paths,
materializes input files, and imports completed outputs into sealed raw
evidence. Never write protocol records or expose a raw-writer handle from
provider code. Interpret named output through `predicate.NamedEvidence`;
`predicate.ErrEvidenceAbsent` means optional absence, while other read faults
must not be treated as fallback. Present empty or contradictory output is
evidence. Verify writer completion at process exit and stream EOF; a stable
file alone is insufficient.
For finite profiles with continuation, supply `PreparedProfile.Identity`
using the bounded `execution.IdentityObserver` interface. Non-interactive
machine channels use `PreparedProfile.Protocol`; explicit native user
interaction uses `PreparedProfile.Interaction`. Follow the
[canonical transport selection rules](../../internal/execution/interaction_contract.go):
a machine Protocol cannot be combined with Identity or Interaction. The
selected native protocol is the sole stdout observer. Each selected path
reports validated session identity through its runner-owned callback so the
core persists the session reference. Returning a session from the
sealed-evidence interpreter alone does not create that reference. Test
chunked observation, identity mismatch, parser bounds and callback errors,
then prove fresh-to-resume dispatch with the compiled CLI.
3. Register the adapter once in the explicit catalog. `Registration.Prepare`
accepts the shared `PrepareCandidate` hook. For an ordinary finite profile
factory, use `provider.ReadyCandidate(Prepare)`; no inspection implementation
is needed. A provider that requires native metadata declares a
`ProfileCandidate` with static placement, an `InspectionDefinition`, and a
pure finalizer over nonsecret facts. Read the
[architecture guide](../../docs/architecture.md) for that
conditional path and its current integration status. Core owns inspection
execution; never hide native commands in a preparation or finalizer callback.
Catalog finalization retains capability and artifact checks and refuses
changes to the candidate's workspace or writable roots. The compatibility
`Catalog.Prepare` method refuses inspection candidates.
Reuse shared task, execution, predicate, usage, lifecycle, and acceptance
mechanics; do not add provider-specific core branches.
4. Add deterministic fixtures for valid and malformed envelopes, blank answers,
refusal/error/timeout markers, exit conflicts, identity mismatch, policy
drift, usage scope, and historical predicate revisions. Collection must stay
observational and must never retry paid work.
Put Python driver regressions beside the existing driver tests under
`scripts/acceptance/provider_drivers/tests/test_<provider>_driver.py`.
Follow [module organization](../../agents/_data/maintainability-contract.md#module-organization)
for the complete feature and its consumers. Use `make test-native-harness`
as a focused target; `make test-python` already includes these tests.
5. Run the provider through the shipped dispatcher/runner with isolated pueue,
existing authentication, and the exact plan budgets. Finite profiles receive
the brief on stdin followed by EOF. Machine Protocol and native Interaction
profiles exchange core-owned frames until native completion closes stdin.
Inspect sealed raw evidence and filesystem effects directly; do not use
direct signals, shell wrappers, or global configuration changes.
6. Match filesystem controls to the advertised native mode. Unattended write
modes must prove creation, editing, and shell execution from filesystem and
sealed evidence; they do not promise outside-workspace denial. Preserve
applicable native read-only and sandbox controls. A rejected task is valid
when the canonical `outcome.json` authority publishes its rejected verdict
with sealed evidence; its rejection payload may be present and non-empty.
This is distinct from rejecting a success-shaped result that fails the
success predicate. Missing prerequisites and inconclusive controls are
`BLOCKED`, never pass.
7. Record sanitized platform/profile/predicate/configuration, task and session
identities, timings, commands, observations and Delegate-owned evidence.
Follow the [product boundary](../../agents/_data/product-boundary.md) for
installed providers and retain their native configuration and sessions.
Keep raw private evidence outside the repository and let Root integrate
contributor guidance.
## Deliverables
- provider package, catalog registration, and focused deterministic fixtures;
- a profile and interpretation record with compatibility and failure behavior;
- acceptance receipt covering positive, denial, continuation, timeout/refusal,
and replay scenarios; and
- a bounded handoff naming changed files, commands, results, and blocked cases.
## Exit criteria
- Provider behavior is contained behind a real narrow boundary; shared lifecycle,
capture, sealing, and publication code is reused without exceptions.
- Committed success requires valid versioned sealed evidence, matching
identities, a non-whitespace answer and a satisfied success predicate.
A valid sealed rejected interpretation may publish a rejected `outcome.json`
and rejection payload.
Unsealed evidence or evidence/identity validation errors prevent publication.
- Unit/fault tests and required supervisor/live acceptance pass with sanitized
evidence, or a missing prerequisite is recorded as `BLOCKED`.
- Historical collection remains available without the current executable, and
no paid retry or automatic fallback was introduced.
Report affected guidance and diagram changes under the project
[documentation completion rule](../../AGENTS.md#documentation-completion).