Agent skill

Generate Microcks Openapi Samples

by SebastienDegodez in SebastienDegodez/copilot-instructions

A skill your agent uses when creating OpenAPI mock examples for Microcks, setting up request/response routing with dispatchers, or mapping request fields to mock responses

Apache-2.0Auto-check passedBackend & APIs

Install Generate Microcks Openapi Samples

skills CLI
$ npx skills add SebastienDegodez/copilot-instructions --skill generate-microcks-openapi-samples -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install SebastienDegodez/copilot-instructions generate-microcks-openapi-samples --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/SebastienDegodez/copilot-instructions.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/generate-microcks-openapi-samples .claude/skills/generate-microcks-openapi-samples && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
generate-microcks-openapi-samples
GitHub stars
198
Token cost
~2.5k tokens
SKILL.md length
837 words
Files
6 (incl. references)
Skills in repo
19
Repo updated
First seen
Licence
Apache-2.0

At a glance

A skill your agent uses when creating OpenAPI mock examples for Microcks, setting up request/response routing with dispatchers, or mapping request fields to mock responses

  • Works in 5 steps: Understand Your API from OpenAPI Contract → Design Realistic Scenarios → Create APIExamples File → …
  • Creating OpenAPI mock examples for Microcks
  • SKILL.md covers When to Use, Core Pattern, Quick Reference and Implementation Steps, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Generate Microcks Openapi Samples is an agent skill from SebastienDegodez/copilot-instructions. Use when creating OpenAPI mock examples for Microcks, setting up request/response routing with dispatchers, or mapping request fields to mock responses

Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including reference files (for example `examples/01-cities-json-body.md`, `examples/02-auth-js.md` and `examples/03-orders-groovy-optional.md`).

It sits in Backend & APIs, covering OpenAPI specifications. It works with OpenAPI. The repository describes itself as: A comprehensive codebase of best practices, coding rules, and workflow automation for AI-assisted development with GitHub Copilot. Includes DDD, Clean Architecture, testing… The licence is Apache-2.0.

When your agent uses it

  • Creating OpenAPI mock examples for Microcks
  • Setting up request/response routing with dispatchers
  • Mapping request fields to mock responses

Example prompts

  • “/generate-microcks-openapi-samples”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Understand Your API from OpenAPI Contract
  2. Design Realistic Scenarios
  3. Create APIExamples File
  4. Configure Smart Routing
  5. Validate and Deploy

What it can do on your machine

Read from SKILL.md and the folder at commit 0f0dccf. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are yaml).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • microcks.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Generate Microcks Openapi Samples loads about 2.5k tokens when it runs, and up to ~5.2k if it reads all its reference files. Until then it costs about 46 tokens; SKILL.md has 837 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~46
When it runs · the whole SKILL.md, loaded when a task matches
~2.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from SebastienDegodez/copilot-instructions at commit 0f0dccf, republished under its Apache-2.0 licence (© SebastienDegodez). 837 words, ~2,549 tokens.

Download SKILL.mdSave it as .claude/skills/generate-microcks-openapi-samples/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
generate-microcks-openapi-samples
description
Use when creating OpenAPI mock examples for Microcks, setting up request/response routing with dispatchers, or mapping request fields to mock responses

Generate Microcks OpenAPI Examples

Generate realistic, schema-compliant OpenAPI examples (request/response pairs) for Microcks mocks. All examples must be concrete and directly usable—no placeholders or generic values.

When to Use

Use when:

  • Building mock APIs with Microcks using realistic request/response examples
  • Creating test data that matches real-world API behavior (not generic placeholders)
  • Setting up multiple response scenarios for API testing (happy path, errors, edge cases)
  • Configuring smart request routing (dispatching) based on request content
  • Migrating from live APIs to mock endpoints while maintaining realistic behavior
  • Creating reproducible test fixtures with concrete data

Don't use when:

  • Modifying the OpenAPI contract file itself (examples go in separate metadata files)
  • Creating mock data without an OpenAPI schema as source of truth
  • Using generic/placeholder values (defeats purpose of realistic mocking)
  • Static mock responses without routing logic

Core Pattern

1. Start with OpenAPI contract (what API operations exist?)
2. Design realistic scenarios (happy path, errors, edge cases)
3. Create request/response example pairs (concrete data, no placeholders)
4. Define smart routing rules (which scenario matches which request?)
5. Deploy both example data + routing rules to Microcks

Quick Reference

DecisionOption
Few scenarios?Use JSON_BODY dispatcher (fast, simple field matching)
Complex routing logic?Use JS dispatcher (modern, recommended for Microcks 1.13+)
Existing Groovy code?Use GROOVY dispatcher (only if explicitly needed or migrating legacy)
Starting fresh?See examples/README.md for complete copy-paste workflows
All dispatcher details?See references/dispatchers-reference.md for syntax & operators

Implementation Steps

Step 1: Understand Your API from OpenAPI Contract

Before generating examples, gather:

  1. All operations (GET /users, POST /users, etc.)
  2. Request structure (required fields, data types, enums)
  3. Response structure (status codes, body schema)
  4. Which requests should match which responses (routing logic)
Step 2: Design Realistic Scenarios

For each operation, create 3-5 meaningful examples:

  • Happy path: Valid request → success response (200, 201, etc.)
  • Error case: Invalid request → error response (400, 401, 404, etc.)
  • Edge cases: Boundary values, large arrays, null fields, etc.

Key: Use CONCRETE data from real-world usage, not templates like <email>, {placeholder}.

Step 3: Create APIExamples File

Create a file named <contract-name>.apiexamples.yaml:

yaml
apiVersion: mocks.microcks.io/v1alpha1
kind: APIExamples
metadata:
  name: <Same as OpenAPI contract name>
  version: <Same version as OpenAPI contract>
operations:
  <HTTP METHOD> <operation path>:
    <Example Name 1>:
      request:
        headers:
          Content-Type: application/json
        body: |-
          { "concrete": "value" }
      response:
        status: 200
        body: |-
          { "concrete": "response value" }
    <Example Name 2>:
      request:
        headers:
          Content-Type: application/json
        body: |-
          { "concrete": "different value" }
      response:
        status: 200
        body: |-
          { "concrete": "different response" }

CRITICAL RULES:

  • No placeholders: All values must be concrete and realistic (not {{ placeholder }}, ..., or <TBD>)
  • Match schema: Every example field must comply with OpenAPI schema types, enums, required fields, and constraints
  • Example names are identifiers: Names like BEST_CITY, DEFAULT_CITY, INVALID_INPUT are referenced by dispatcher rules
  • YAML format strict: Use |- for multi-line strings; validate syntax with yamllint
Step 4: Configure Smart Routing

Create a separate file named <contract-name>.apimetadata.yaml to define dispatcher rules that route requests to the correct example.

For JSON_BODY dispatcher (simple field matching):

yaml
operations:
  <HTTP METHOD> <operation path>:
    dispatcher: JSON_BODY
    dispatcherRules: |
      {
        "exp": "/fieldName",
        "op": "equals",
        "cases": {
          "value1": "EXAMPLE_NAME_1",
          "value2": "EXAMPLE_NAME_2",
          "default": "DEFAULT_EXAMPLE"
        }
      }

For JS SCRIPT dispatcher (complex multi-field logic, recommended):

yaml
operations:
  <HTTP METHOD> <operation path>:
    dispatcher: JS
    dispatcherRules: |
      const req = JSON.parse(mockRequest.getRequestContent());
      if (req.field1 === "value1" && req.field2 > 10) {
        return "EXAMPLE_NAME_1";
      }
      return "DEFAULT_EXAMPLE";

To use GROOVY dispatcher (legacy or if explicitly needed):

yaml
operations:
  <HTTP METHOD> <operation path>:
    dispatcher: GROOVY
    dispatcherRules: |
      import java.util.regex.*;
      def jsonSlurper = new groovy.json.JsonSlurper();
      def req = jsonSlurper.parseText(mockRequest.getRequestContent());
      
      if (req.field1 == "value1" && req.field2 > 10) {
        return "EXAMPLE_NAME_1"
      }
      return "DEFAULT_EXAMPLE"

For complete dispatcher reference, syntax details, and operators, see references/dispatchers-reference.md.

Step 5: Validate and Deploy
  1. Syntax check: Validate all YAML files with yamllint or online validator
  2. Schema compliance: Ensure every field matches OpenAPI schema (type, enum, required, etc.)
  3. Dispatcher mapping: Verify every example name in APIExamples appears in dispatcher cases
  4. Consistency: Example names must be identical across APIExamples and APIMetadata
  5. Deploy: Upload both .apiexamples.yaml and .apimetadata.yaml files to Microcks

Common Mistakes

Mistake 1: Placeholder Values in Examples
yaml
# ❌ BAD: Placeholder value
response:
  body: |-
    { "city": "<city-name>", "rating": 5 }

# ✅ GOOD: Concrete value
response:
  body: |-
    { "city": "Paris", "rating": 8 }

Why? Microcks returns examples as-is. Users expect real data, not templates.

Mistake 2: Dispatcher Cases Don't Match Example Names
yaml
# ❌ BAD: Dispatcher references "BEST", but example is named "BEST_CITY"
cases:
  "Dunkirk": "BEST"

# ✅ GOOD:
cases:
  "Dunkirk": "BEST_CITY"

Microcks fails silently or returns wrong example.

Show full SKILL.md (334 more words)Show less
Mistake 3: JSON Pointer Path Incorrect
yaml
# ❌ BAD: Path doesn't match request structure
"exp": "/user_city"  # But request is { "city": "Paris" }

# ✅ GOOD:
"exp": "/city"
Mistake 4: Missing Default Case
yaml
# ❌ BAD: No default, Microcks returns 404 for unknown requests
"cases": {
  "Paris": "GOOD_CITY",
  "Dunkirk": "BEST_CITY"
}

# ✅ GOOD: Always include default
"cases": {
  "Paris": "GOOD_CITY",
  "Dunkirk": "BEST_CITY",
  "default": "DEFAULT_CITY"
}
Mistake 5: Mixing YAML and JSON Syntax
yaml
# ❌ BAD: Invalid YAML (unquoted colons, inconsistent quotes)
body: |-
  { "key": value }  # Missing quotes around value

# ✅ GOOD: Valid JSON within YAML
body: |-
  { "key": "value" }

Red Flags: Avoid These Rationalization Traps

❌ "Templates are faster than concrete data"

Wrong. Microcks returns examples AS-IS. If you use <email> instead of alice@example.com, users receive the literal placeholder in their tests.

Reality: Concrete data takes same time to write and is immediately usable.

❌ "Keep Groovy for consistency with our other dispatchers"

Wrong. Dispatcher choice should be based on requirement complexity, not on sunk cost.

Decision matrix:

  • Simple field routing? Use JSON_BODY (even if you have 10 Groovy dispatchers elsewhere)
  • Complex multi-field logic? Use JS (modern, recommended for Microcks 1.13+)
  • Existing Groovy codebase? Only if explicitly required or migrating legacy

Reality: "Consistency" that keeps you on a worse technology is technical debt, not architecture.

❌ "One example is good enough"

Wrong. One example ≠ realistic mocking. Microcks routes requests based on dispatcher rules. One example = one scenario.

Need minimum 3:

  • Happy path (200, 201)
  • Error case (400, 401, 404, etc.)
  • Edge case (boundary values, empty arrays, etc.)
❌ "I'll add dispatching rules later"

Wrong. Without dispatcher rules, all requests hit the first example. Your mock isn't mocking—it's static.

Reality: APIExamples + APIMetadata (dispatcher rules) are equally critical. Both must exist before testing.


Examples

For real-world, copy-paste-ready examples covering:

  • Cities API with JSON_BODY dispatcher (recommended starting point)
  • Authorization API with JavaScript SCRIPT dispatcher (recommended for complex logic)
  • Orders API with Groovy SCRIPT dispatcher (legacy, optional)

See examples/README.md for index and quick navigation.

Key Constraints

  • Never edit OpenAPI contract: Examples go in separate .apiexamples.yaml only
  • Concrete values only: No {{ }}, <>, placeholders, or generic values
  • Schema compliance: All examples must validate against OpenAPI schema
  • Names must match: Example names in APIExamples must appear in dispatcher cases
  • YAML validation: Strict YAML syntax; indent consistently (2 spaces)
  • JSON format: Request/response bodies must be valid JSON; use |- for multi-line

Resources

© SebastienDegodez, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (references) in skills/generate-microcks-openapi-samples of SebastienDegodez/copilot-instructions.

  • SKILL.md
  • examples/01-cities-json-body.md
  • examples/02-auth-js.md
  • examples/03-orders-groovy-optional.md
  • examples/README.md
  • references/dispatchers-reference.md

Open the folder on GitHubat commit 0f0dccf

Compare with similar skills

Generate Microcks Openapi Samples next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Generate Microcks Openapi Samples compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Generate Microcks Openapi Samples this skillSebastienDegodez/copilot-instructions198—~2.5kAutomated safety check: PassApache-2.0
ToolJet Marketplace Plugin BuilderToolJet/ToolJet41k—~2.1kAutomated safety check: PassAGPL-3.0
Step Partsearthtojake/text-to-cad18k1 repos~1.5kAutomated safety check: PassMIT
API DesignerJeffallan/claude-skills12k2 repos~2kAutomated safety check: PassMIT
OpenAPI to MCP Servermcp-use/mcp-use11k—~5.2kAutomated safety check: PassApache-2.0
Use Yaakmountain-loop/yaak19k—~1.9kAutomated safety check: PassMIT

Similar skills

  • Turns an API description, such as an OpenAPI file or a Postman collection, into a connector plugin for ToolJet's marketplace and checks it with the repo's validator.

    41k GitHub stars~2.1k tokensUpdated today
    Backend & APIsAuto-check passed
  • Step Parts

    earthtojake/text-to-cad

    Find, evaluate, and download common purchasable CAD parts from step.parts, including named off-the-shelf actuators, servos, motors, electronics boards, connectors, screws, bolts, nuts, washers…

    18k GitHub starsUsed in 1 repo~1.5k tokens
    Backend & APIsAuto-check passed
  • API Designer

    Jeffallan/claude-skills

    Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.

    12k GitHub starsUsed in 2 repos~2k tokens
    Backend & APIsAuto-check passed
  • OpenAPI to MCP Server

    mcp-use/mcp-use

    Turns an OpenAPI or Swagger spec into an MCP server with the mcp-use TypeScript SDK, mapping each operation to a tool, wiring auth, testing and deploying.

    11k GitHub stars~5.2k tokensUpdated today
    Backend & APIsAuto-check passed
  • Use Yaak

    mountain-loop/yaak

    A skill your agent uses when the user mentions Yaak, a Yaak workspace, or the yaak command, or asks to call, hit, or smoke test HTTP/REST endpoints, save or organize API requests for reuse or manual…

    19k GitHub stars~1.9k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Old Coder API Design

    AmazingAng/old-coder

    Reviews or designs an HTTP/JSON API's endpoints, auth, pagination, versioning and deprecations, guarding against inventing a bespoke interface or silently breaking consumers.

    749 GitHub starsUsed in 1 repo~3.4k tokens
    Backend & APIsAuto-check passed

More from SebastienDegodez/copilot-instructions

All 19 skills in this repo
  • Setup Husky Dotnet

    SebastienDegodez/copilot-instructions

    A skill your agent uses when configuring Git hooks in .NET projects before team commits occur, to enforce commit message standards and code formatting automatically

    198 GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed
  • Clean Architecture Dotnet

    SebastienDegodez/copilot-instructions

    A skill your agent uses when domain logic leaks into API/Infrastructure, project references violate layer boundaries, or you need to decide between CQS (always), CQRS bus (complex domains), and DDD…

    198 GitHub stars~5.1k tokensUpdated yesterday
    Auto-check passed
  • Outside In TDD

    SebastienDegodez/copilot-instructions

    A skill your agent uses when writing tests from the outside-in, defining behavior before code, or any feature where tests should start from observable business behavior and let internal design emerge

    198 GitHub stars~1.8k tokensUpdated yesterday
    Auto-check passed
  • Creating Dotnet MCP Servers

    SebastienDegodez/copilot-instructions

    A skill your agent uses when building Model Context Protocol (MCP) servers in .NET, configuring tools, transports (SSE/stdio), JSON serialization for AOT, or testing MCP endpoints

    198 GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed
  • Analyzing Code

    SebastienDegodez/copilot-instructions

    A skill your agent uses when understanding project composition by language, measuring code change impact, or generating code statistics for CI/CD metrics

    198 GitHub stars~1k tokensUpdated yesterday
    Auto-check passed
  • Extracting Code Structure

    SebastienDegodez/copilot-instructions

    A skill your agent uses when listing all methods, functions, or classes in a file, exploring unfamiliar code, getting API overviews, or deciding what to read selectively without loading entire files

    198 GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Generate Microcks Openapi Samples

What does Generate Microcks Openapi Samples do?

A skill your agent uses when creating OpenAPI mock examples for Microcks, setting up request/response routing with dispatchers, or mapping request fields to mock responses. Generate Microcks Openapi Samples is an agent skill from SebastienDegodez/copilot-instructions.

When should I use Generate Microcks Openapi Samples?

Generate Microcks Openapi Samples fits situations like: creating OpenAPI mock examples for Microcks; setting up request/response routing with dispatchers; mapping request fields to mock responses.

How do I install Generate Microcks Openapi Samples in Claude Code?

Run `npx skills add SebastienDegodez/copilot-instructions --skill generate-microcks-openapi-samples -a claude-code`. Or copy the skill folder (skills/generate-microcks-openapi-samples in SebastienDegodez/copilot-instructions) into .claude/skills/generate-microcks-openapi-samples in your project. Claude Code loads it when a task matches its description.

How do I install Generate Microcks Openapi Samples in Codex?

Run `npx skills add SebastienDegodez/copilot-instructions --skill generate-microcks-openapi-samples -a codex`. Or copy the skill folder (skills/generate-microcks-openapi-samples in SebastienDegodez/copilot-instructions) into .agents/skills/generate-microcks-openapi-samples in your project. Codex loads it when a task matches its description.

Can I use Generate Microcks Openapi Samples in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add SebastienDegodez/copilot-instructions --skill generate-microcks-openapi-samples -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/generate-microcks-openapi-samples, .gemini/skills/generate-microcks-openapi-samples, .github/skills/generate-microcks-openapi-samples and .opencode/skills/generate-microcks-openapi-samples in your project.

What does Generate Microcks Openapi Samples need to run?

SKILL.md names no scripts, command-line tools or credentials: Generate Microcks Openapi Samples is instructions for the agent only.

Does Generate Microcks Openapi Samples access the network?

SKILL.md names 1 domain. As links in the text: microcks.io. This is read from the text; nothing was executed.

Is Generate Microcks Openapi Samples safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Generate Microcks Openapi Samples use?

Generate Microcks Openapi Samples is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Generate Microcks Openapi Samples use?

About 2.5k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.6k tokens, read only when the agent opens those files.

What are the alternatives to Generate Microcks Openapi Samples?

Skills that share tags, products or a category with Generate Microcks Openapi Samples: ToolJet Marketplace Plugin Builder (ToolJet/ToolJet, 41k stars), Step Parts (earthtojake/text-to-cad, 18k stars), API Designer (Jeffallan/claude-skills, 12k stars) and OpenAPI to MCP Server (mcp-use/mcp-use, 11k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Generate Microcks Openapi Samples?

SebastienDegodez (a GitHub user) maintains it in SebastienDegodez/copilot-instructions, which has 198 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on October 6, 2026.

Source: SebastienDegodez/copilot-instructions on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.