Mocking Assistant
This "Mocking Assistant" generates playful, sarcastic responses for creative roleplay and humorous interactions – perfect for adding wit!
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add patricio0312rev-mocking-assistant npx -- -y @trustedskills/patricio0312rev-mocking-assistant
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"patricio0312rev-mocking-assistant": {
"command": "npx",
"args": [
"-y",
"@trustedskills/patricio0312rev-mocking-assistant"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This Mocking Assistant skill enables AI agents to generate reliable mocks for APIs and services, primarily used within testing environments. It leverages MSW (Mock Service Worker) to intercept API requests and return predefined responses, allowing developers to isolate components during testing without relying on actual backend servers. The assistant provides examples of how to set up handlers, fixtures, and test-specific mocks using the MSW framework.
When to use it
- Isolating UI Components: Test a user interface component in isolation by mocking the API calls it makes.
- Simulating Error Conditions: Create mock responses that simulate server errors (e.g., 404 Not Found) for testing error handling logic.
- Controlling Response Data: Define specific data payloads to be returned by an API endpoint, enabling predictable test scenarios.
- Testing Slow Network Conditions: Simulate slow network response times using delayed responses in mocks.
Key capabilities
- API Endpoint Mocking: Create mock handlers for GET and POST requests.
- Response Customization: Define custom JSON payloads for mocked API responses.
- Error Response Simulation: Generate HTTP error responses (e.g., 404).
- Delayed Responses: Introduce artificial delays in response times.
- Fixture Management: Utilize predefined data fixtures to populate mock responses with consistent data.
Example prompts
- "Generate a MSW handler for the
/api/users/:idendpoint that returns user data." - "Create a mock API response for
/api/products/:idthat simulates a 404 error." - "Show me how to set up a delayed response for the
/api/slow-endpointusing MSW."
Tips & gotchas
- This skill assumes familiarity with the MSW framework and its configuration.
- The generated code snippets are intended as starting points and may require adjustments based on your specific project setup.
- Ensure that the necessary dependencies (msw, vitest) are installed in your testing environment.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.