Skip to content
Skillv1.0.0

spec

Use `JsonRpcHelpers`. This provides a more consistent and readable way to assert on response status and body content: - Prefer `post_jsonrpc_request` over `post` when sending JSON-RPC requests, as it

by wilsonsilva(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from wilsonsilva/jsonrpc-middleware (spec/AGENTS.md). Install upstream with npx skills add wilsonsilva/jsonrpc-middleware --skill spec. Copyright stays with the author.

AGENTS.md

Testing Best Practices

Use JsonRpcHelpers. This provides a more consistent and readable way to assert on response status and body content:

  • Prefer post_jsonrpc_request over post when sending JSON-RPC requests, as it automatically sets the correct headers and formats the request body
  • Prefer post_raw_request over post when you need to send a raw JSON string, as it avoids unnecessary parsing and re-encoding
  • Prefer expect_status over expect(last_response.status)
  • Prefer expect_json over expect(last_response.body)
  • Prefer expect_empty_response_body over expect(last_response.body).to be_empty

Antipatterns

  • Do not use allow_any_instance_of

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/wilsonsilva-jsonrpc-middleware-spec/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

wilsonsilva-jsonrpc-middleware-spec.ocm.jsonjson
{
  "ocm": "1",
  "id": "wilsonsilva-jsonrpc-middleware-spec",
  "kind": "skill",
  "name": "spec",
  "description": "Use `JsonRpcHelpers`. This provides a more consistent and readable way to assert on response status and body content: - Prefer `post_jsonrpc_request` over `post` when sending JSON-RPC requests, as it automatically sets the correct headers and formats the request body - Prefer `post_raw_request` over `post` when you need to send a raw JSON string, as it avoids unnecessary parsing and re-encoding - Prefer `expect_status` over `expect(last_response.status)` - Prefer `expect_json` over `expect(last_response.body)` - Prefer `expect_empty_response_body` over `expect(last_response.body).to be_empty`",
  "publisher": "wilsonsilva",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "github-agents"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Use `JsonRpcHelpers`. This provides a more consistent and readable way to assert on response status and body content: - Prefer `post_jsonrpc_request` over `post` when sending JSON-RPC requests, as it automatically sets the correct headers and formats the request body - Prefer `post_raw_request` over `post` when you need to send a raw JSON string, as it avoids unnecessary parsing and re-encoding - Prefer `expect_status` over `expect(last_response.status)` - Prefer `expect_json` over `expect(last_response.body)` - Prefer `expect_empty_response_body` over `expect(last_response.body).to be_empty`"
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github-agents",
      "repository": "https://github.com/wilsonsilva/jsonrpc-middleware",
      "path": "spec/AGENTS.md",
      "ref": "fd8f57909da496dbad12f457f2d6304aa4963e5e",
      "url": "https://github.com/wilsonsilva/jsonrpc-middleware/blob/fd8f57909da496dbad12f457f2d6304aa4963e5e/spec/AGENTS.md",
      "key": "wilsonsilva/jsonrpc-middleware/spec/AGENTS.md"
    }
  },
  "instructions": "# AGENTS.md\n\n## Testing Best Practices\n\nUse `JsonRpcHelpers`. This provides a more consistent and readable way to assert on response status and body content:\n- Prefer `post_jsonrpc_request` over `post` when sending JSON-RPC requests, as it automatically sets the correct headers and formats the request body\n- Prefer `post_raw_request` over `post` when you need to send a raw JSON string, as it avoids unnecessary parsing and re-encoding\n- Prefer `expect_status` over `expect(last_response.status)`\n- Prefer `expect_json` over `expect(last_response.body)`\n- Prefer `expect_empty_response_body` over `",
  "cost": {
    "context_tokens": 173
  }
}

Fetch it by URL: GET /api/v1/registry/wilsonsilva-jsonrpc-middleware-spec/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.