agentleFS
hishamkaramhishamkaram/delegation-layer/skills/add-an-adapter/SKILL.md

add-an-adapter

Skill2 starsChanged 2 months agoMITView on GitHub

Add a provider adapter with runtime capability checks while preserving shared lifecycle ownership and versioned evidence interpretation.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill for a new provider adapter or a repair to an adapter contract, profile, interpreter, registration, fixture, or acceptance …

    line 10
  2. Distinctive:

    Use the provider guide for current profiles and load lifecycle or native guidance only when the change affects those boundaries.

    line 14
  3. Very specific:

    Add deterministic fixtures for valid and malformed envelopes, blank answers, refusal/error/timeout markers, exit conflicts, identity …

    line 79
  4. Very specific:

    Put Python driver regressions beside the existing driver tests under scripts/acceptance/provider_drivers/tests/test_<provider>_driver.py.

    line 83
  5. Distinctive:

    Run the provider through the shipped dispatcher/runner with isolated pueue, existing authentication, and the exact plan budgets.

    line 88
  6. Distinctive:

    Follow the product boundary for installed providers and retain their native configuration and sessions.

    line 105
  7. Distinctive:

    Keep raw private evidence outside the repository and let Root integrate contributor guidance.

    line 107

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 and evidence interpretation rules. Use the provider guide 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: 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 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 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 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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.