Claude Cursor GitHub Copilot Skill

contract-testing-roster

Use when an agent must produce a provider-side contract test for THIS service's API and needs to know the stack adapter and whether the optional Microcks verification layer is enabled. Resolves the stack and reads the Microcks opt-in (off by default), then points to the concrete

LLM Mart · 0 points · 0 views 0 listing impressions 0 install-command copies
Download sebastiendegodez-skraft-plugin-plugins_skraft-framework_skills_contract-testing-roster-c6117c6.zip · 1 KB

Install

skills CLI npx skills add https://github.com/SebastienDegodez/skraft-plugin/tree/main/plugins/skraft-framework/skills/contract-testing-roster
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install sebastiendegodez-skraft-plugin@llmmart
Git git clone https://github.com/SebastienDegodez/skraft-plugin.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole sebastiendegodez/skraft-plugin collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

Contract Testing Roster (stack agnostic, opt-in Microcks)

The single place that resolves how a provider-side contract test is built. A baseline in-process integration test (the app started in-memory, exercised over real HTTP) is ALWAYS produced. A Microcks contract-verification layer is an ADDITIVE opt-in, stacked on top — never a replacement, never a default. The concrete harness (e.g. WebApplicationFactory, @SpringBootTest, FastAPI TestClient, supertest) and the concrete Microcks call are owned by the per-stack adapter, NOT by this roster.

This mirrors resolving-stack-commands: the roster owns routing + the opt-in read; the per-stack adapter owns the concrete wiring of both layers.

One axis (stack) + one boolean (opt-in)

Unlike mocking, there is no exclusive strategy choice here. Only:

  • Stack — WHICH toolchain, detected via resolving-stack-commands.
  • Microcks opt-in — a boolean ADD-ON. false = baseline only (default); true = baseline + Microcks contract-verification layer (the adapter picks the stack-appropriate Microcks API).

Resolving the opt-in (cascade)

Read the opt-in by tool-call, never from recall. Precedence, first writer wins:

  1. Explicit prompt — the run prompt asks for Microcks contract verification.
  2. Repo instruction file — read .github/instructions/skraft.instructions.md field testing.contract.microcks. Read ONLY the testing.contract.* namespace.
  3. Default — false.

Read the file with a tool call (fact-that-must-be-true, S7). If absent, default.

Detection -> adapter

Detect the stack (delegate to resolving-stack-commands), then resolve the per-stack adapter. The adapter carries BOTH layers and branches on the opt-in flag internally:

Stack Adapter Status
.NET contract-testing-dotnet supported
Python contract-testing-python supported
React front end (exposes no API) none needed not applicable: return status: ok with no file and the note front end exposes no API; its gateways are tested against the provider's contract through the mocking roster
Java (contract-testing-java not yet provided) NOT SUPPORTED

Adding a stack = add ONE contract-testing-<stack> adapter and the row here, with zero edits to the worker or the orchestrator.

Generic source

Both layers consume the GENERIC contract artifacts authored by the contract-testing skill (OpenAPI / .apiexamples / .apimetadata). The roster does not duplicate that authoring.

Unknown value -> stop, never guess

If testing.contract.microcks is neither true nor false, or the detected stack has no adapter, STOP and emit a structured blocker:

status: blocked
type: invalid_contract_optin   # | unsupported_stack
message: Could not resolve the contract-testing configuration
context:
  microcks: "maybe"
  stack: dotnet
  source: prompt | skraft.instructions.md | default

Contract for callers

  • Resolve (stack) + opt-in here; do not embed the decision in the worker.
  • Baseline in-process integration test is ALWAYS produced regardless of the opt-in.
  • Adding a stack = add an adapter and a row here, zero edits elsewhere.
Files (skraft-plugin)
  • SKILL.md 3.6 KB
    ---
    name: contract-testing-roster
    description: Use when an agent must produce a provider-side contract test for THIS service's API and needs to know the stack adapter and whether the optional Microcks verification layer is enabled. Resolves the stack and reads the Microcks opt-in (off by default), then points to the concrete `contract-testing-<stack>` adapter. Loaded by the contract-testing-worker. A baseline in-process integration test is always produced; Microcks contract verification is an additive opt-in.
    ---
    
    # Contract Testing Roster (stack agnostic, opt-in Microcks)
    
    The single place that resolves **how** a provider-side contract test is built.
    A baseline in-process integration test (the app started in-memory, exercised over
    real HTTP) is ALWAYS produced. A Microcks contract-verification layer is an
    ADDITIVE opt-in, stacked on top — never a replacement, never a default. The
    concrete harness (e.g. WebApplicationFactory, @SpringBootTest, FastAPI TestClient, supertest) and the
    concrete Microcks call are owned by the per-stack adapter, NOT by this roster.
    
    This mirrors `resolving-stack-commands`: the roster owns routing + the opt-in
    read; the per-stack adapter owns the concrete wiring of both layers.
    
    ## One axis (stack) + one boolean (opt-in)
    
    Unlike mocking, there is no exclusive strategy choice here. Only:
    
    - **Stack** — WHICH toolchain, detected via `resolving-stack-commands`.
    - **Microcks opt-in** — a boolean ADD-ON. `false` = baseline only (default);
      `true` = baseline + Microcks contract-verification layer (the adapter picks the
      stack-appropriate Microcks API).
    
    ## Resolving the opt-in (cascade)
    
    Read the opt-in by tool-call, never from recall. Precedence, first writer wins:
    
    1. **Explicit prompt** — the run prompt asks for Microcks contract verification.
    2. **Repo instruction file** — read
       `.github/instructions/skraft.instructions.md` field
       `testing.contract.microcks`. Read ONLY the `testing.contract.*` namespace.
    3. **Default** — `false`.
    
    Read the file with a tool call (fact-that-must-be-true, S7). If absent, default.
    
    ## Detection -> adapter
    
    Detect the stack (delegate to `resolving-stack-commands`), then resolve the
    per-stack adapter. The adapter carries BOTH layers and branches on the opt-in
    flag internally:
    
    | Stack | Adapter | Status |
    |---|---|---|
    | .NET | `contract-testing-dotnet` | supported |
    | Python | `contract-testing-python` | supported |
    | React front end (exposes no API) | _none needed_ | not applicable: return `status: ok` with no file and the note `front end exposes no API`; its gateways are tested against the provider's contract through the mocking roster |
    | Java | _(contract-testing-java not yet provided)_ | NOT SUPPORTED |
    
    Adding a stack = add ONE `contract-testing-<stack>` adapter and the row here,
    with zero edits to the worker or the orchestrator.
    
    ## Generic source
    
    Both layers consume the GENERIC contract artifacts authored by the
    `contract-testing` skill (OpenAPI / `.apiexamples`
    / `.apimetadata`). The roster does not duplicate that authoring.
    
    ## Unknown value -> stop, never guess
    
    If `testing.contract.microcks` is neither `true` nor `false`, or the detected
    stack has no adapter, STOP and emit a structured blocker:
    
    ```yaml
    status: blocked
    type: invalid_contract_optin   # | unsupported_stack
    message: Could not resolve the contract-testing configuration
    context:
      microcks: "maybe"
      stack: dotnet
      source: prompt | skraft.instructions.md | default
    ```
    
    ## Contract for callers
    
    - Resolve `(stack)` + opt-in here; do not embed the decision in the worker.
    - Baseline in-process integration test is ALWAYS produced regardless of the opt-in.
    - Adding a stack = add an adapter and a row here, zero edits elsewhere.
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.