Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Offline Test Rewriter: hermetic tests, no network

    1

    Sandboxed validators such as AgentHarness run every test command with **no network**, so these tests fail every time there.

    $12

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Offline Test Rewriter: hermetic tests, no network

    Offline Test Rewriter: hermetic tests, no network

    Example session with this skill installed

    Our gate runs tests without network and tests/test_weather.py plus src/geo.test.ts fail there. Make them pass offline without losing coverage.

    • Read your context and instructions
    • Compiled the offline test rewriter

    Example session (illustrative).

    1. Detect.
    pytest --disable-socket --allow-unix-socket raised SocketBlockedError in 6 tests:

    • 4 in test_weather.py call api.weather.example through requests.
    • 2 in test_reports.py were a surprise: boto3 probes the EC2 metadata endpoint for credentials.

    With nock.disableNetConnect() in jest.setup.ts, 3 tests in src/geo.test.ts failed with NetConnectNotAllowedError for nominatim.openstreetmap.org.

    2. Make it injectable.
    WeatherClient hardcoded its base URL. It now takes base_url with the old value as default. geocode() now takes a baseUrl option.

    3. Rewrite.

    Weather: 3 tests now use @responses.activate with explicit 200, 429 and malformed-JSON cases. The 429 case was previously untested. The forecast test, which needs a 40 KB payload, uses a pytest-recording cassette with filter_headers=["authorization"] and --record-mode=none in CI.

    Reports: set AWS_EC2_METADATA_DISABLED=true and fake credentials in a fixture, and wrapped the tests in moto's @mock_aws.

    • Geo: msw setupServer with onUnhandledRequest: "error" and saved JSON fixtures for the 3 cases.

    4. Secrets check.
    The grep over tests/cassettes turned up an appid= query param in an old cassette. Added filter_query_parameters=["appid"] and re-recorded. Flagged the key for rotation, because it is in git history.

    5. Opt-in live test.
    Kept one real call, test_live_forecast_schema, behind RUN_INTEGRATION=1.

    6. Verify.
    unshare -r -n sh -c 'ip link set lo up && pytest && npx jest' passed: 0 network calls, 9 tests rewritten, 1 gated. Coverage unchanged, plus the new 429 path.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    The problem. Tests that call real APIs fail in sandboxes, in hermetic CI and offline. They also break on rate limits and vendor outages, and often need real credentials checked in somewhere. Sandboxed validators such as AgentHarness run every test command with no network, so these tests fail every time there. Coding agents usually respond by loosening the sandbox or adding retries. Both are wrong.

    What the agent does with this skill.

    • Detects network use. Runs the suite with the network actually cut (unshare -n on Linux, docker --network none) and adds call-site guards: pytest-socket --disable-socket, pytest-recording --block-network, nock.disableNetConnect(), msw onUnhandledRequest: "error". It also hunts hidden calls: cloud SDK metadata probes, runtime model downloads, telemetry, token refresh.
    • Picks the right double for each test. Request mocks for exact assertions and error paths (responses, pytest-httpx, respx, moto, msw, nock, Go httptest, Rust wiremock/mockito). Recorded cassettes for large payloads (VCR.py, pytest-recording, Polly.js, go-vcr), replay-only in CI. Local fakes for stateful services. Testcontainers for real databases, noting that it needs Docker and image pulls.
    • Makes the code injectable. If the base URL or client is hardcoded, it makes it injectable first, because that hardcoding is the real defect.
    • Keeps secrets out of fixtures. Filters headers and query parameters at record time, redacts token bodies, then greps and runs gitleaks before commit. It flags any leaked secret for rotation.
    • Handles contract drift on purpose. Recordings are refreshed deliberately and reviewed like code. A small set of live checks moves behind RUN_INTEGRATION, go test -tags integration or #[ignore].

    Who it's for. Teams adopting sandboxed or hermetic CI, AgentHarness users whose gate blocks on network-dependent tests, and anyone tired of tests that fail when a vendor has a bad day.

    Requirements. Any agent that supports SKILL.md (Claude Code, Cursor, Codex CLI, and others) with shell access to run tests. The agent proposes the mocking library that fits your HTTP client and asks before adding dependencies. Testcontainers needs a running Docker daemon. unshare needs Linux with unprivileged user namespaces.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Testing & Debugging.

    Library-specific version constraints apply, such as Nock 15+ ESM requirements. Testcontainers require Docker access. Some cloud SDKs require specific env vars to disable metadata probes.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 17 days ago

    Accounts
    Example
    Software
    Your project's test runner
    Mocking
    orrecording library
    Python

    Test runners include pytest, Jest, Vitest, go test and cargo test; libraries include responses, msw, nock and WireMock.

    Permissions

    Terminal / Shell
    Network Access
    Write Files
    Environment Variables

    Allowed Hosts

    api.example.test
    Listed17 days ago

    What's inside

    Frequently Asked Questions

    They can, so the skill manages drift on purpose. Recordings are refreshed deliberately (delete, re-record, review the diff) and never re-recorded automatically. A small set of live tests stays behind an opt-in flag, so you can run them on a schedule.

    Whatever fits your HTTP client: responses (requests), pytest-httpx or respx (httpx), aioresponses, moto (AWS), VCR.py or pytest-recording, msw or nock (Node), Polly.js, Go `httptest` or go-vcr, and the Rust wiremock or mockito crates. It asks before adding a dependency.

    Yes, with caveats. It suggests Testcontainers when real database semantics matter, but Testcontainers needs Docker and image pulls. In a no-network sandbox those tests usually belong in the integration tier, or need pre-pulled images. Where your SQL is portable, it can use an embedded alternative instead.

    It scrubs at record time (header, query-parameter and body filters), then verifies with a grep and gitleaks before commit. If a real secret was already committed, it tells you to rotate it, because deleting the file does not clean git history.

    No. The skill works in any repo and any CI. AgentHarness is one reason it matters: its sandbox runs tests with no network, so network-dependent tests block the gate until they are made hermetic.

    New in Testing & Debugging