error-injection-tester
Test application resilience by injecting failures: offline mode, blocked resources, API error responses (500/403/timeout), JS exceptions, localStorage quota exceeded, and slow network (3G). Captures app response to each failure including error UI, console errors, and graceful degradation.
What this skill does
# Error Injection Tester
Systematically inject failures into a running web application to evaluate its
resilience, error handling UI, and graceful degradation behavior. Each injection
is isolated, documented with screenshots, and console output is captured.
## When to Use
- Verifying error boundaries and fallback UI render correctly.
- Testing offline/network-failure behavior before shipping a PWA.
- Ensuring API error responses produce user-friendly messages.
- Checking that third-party resource failures do not break the page.
- Validating storage quota handling for localStorage-heavy apps.
- Simulating slow networks to test loading states and timeouts.
## Prerequisites
- **Playwright MCP server** connected and responding (all `mcp__playwright__browser_*` tools available).
- **Chromium-based browser** required for CDP network emulation and blocked URLs.
- Target page must be loaded before injections begin.
## Workflow
### Step 1 -- Navigate and Establish Baseline
```
browser_navigate({ url: "<target_url>" })
```
```
browser_take_screenshot({ type: "png", filename: "error-injection-baseline.png" })
```
```
browser_console_messages({ level: "error" })
```
### Step 2 -- Test Offline Mode
Simulate a complete network disconnection.
```javascript
browser_run_code({
code: `async (page) => {
const client = await page.context().newCDPSession(page);
await client.send('Network.enable');
await client.send('Network.emulateNetworkConditions', {
offline: true,
latency: 0,
downloadThroughput: 0,
uploadThroughput: 0
});
return 'Network set to offline';
}`
})
```
Trigger an action that requires network (e.g., click a button, navigate):
```javascript
browser_evaluate({
function: `() => {
// Attempt a fetch to trigger offline behavior
fetch(window.location.href).catch(err => {
window.__offlineError = err.message;
});
return 'Fetch attempted while offline';
}`
})
```
```
browser_wait_for({ time: 3 })
```
```
browser_take_screenshot({ type: "png", filename: "error-injection-offline.png" })
```
```
browser_console_messages({ level: "error" })
```
Restore network:
```javascript
browser_run_code({
code: `async (page) => {
const client = await page.context().newCDPSession(page);
await client.send('Network.emulateNetworkConditions', {
offline: false,
latency: 0,
downloadThroughput: -1,
uploadThroughput: -1
});
return 'Network restored';
}`
})
```
### Step 3 -- Test Blocked Resources (CSS/JS/Images)
Block specific resource types and reload to see degraded rendering.
```javascript
browser_run_code({
code: `async (page) => {
const client = await page.context().newCDPSession(page);
await client.send('Network.enable');
await client.send('Network.setBlockedURLs', {
urls: ['*.css', '*.js']
});
await page.reload({ waitUntil: 'domcontentloaded' });
return 'CSS and JS blocked, page reloaded';
}`
})
```
```
browser_take_screenshot({ type: "png", filename: "error-injection-no-css-js.png" })
```
```
browser_console_messages({ level: "error" })
```
Unblock and test image blocking:
```javascript
browser_run_code({
code: `async (page) => {
const client = await page.context().newCDPSession(page);
await client.send('Network.setBlockedURLs', {
urls: ['*.png', '*.jpg', '*.jpeg', '*.webp', '*.gif', '*.svg', '*.avif']
});
await page.reload({ waitUntil: 'domcontentloaded' });
return 'Images blocked, page reloaded';
}`
})
```
```
browser_take_screenshot({ type: "png", filename: "error-injection-no-images.png" })
```
Clear blocked URLs:
```javascript
browser_run_code({
code: `async (page) => {
const client = await page.context().newCDPSession(page);
await client.send('Network.setBlockedURLs', { urls: [] });
await page.reload({ waitUntil: 'load' });
return 'Blocks cleared, page reloaded';
}`
})
```
### Step 4 -- Inject API Error Responses (500, 403, Timeout)
Intercept API calls and return error responses.
**500 Internal Server Error:**
```javascript
browser_run_code({
code: `async (page) => {
await page.route('**/api/**', route => {
route.fulfill({
status: 500,
contentType: 'application/json',
body: JSON.stringify({ error: 'Internal Server Error', message: 'Injected 500 by error-injection-tester' })
});
});
return 'API routes intercepted with 500 responses';
}`
})
```
Trigger an API call (click a button or interact with the page using
`browser_snapshot` + `browser_click`), then capture the result:
```
browser_wait_for({ time: 3 })
```
```
browser_take_screenshot({ type: "png", filename: "error-injection-api-500.png" })
```
```
browser_console_messages({ level: "error" })
```
**403 Forbidden:**
```javascript
browser_run_code({
code: `async (page) => {
await page.unrouteAll();
await page.route('**/api/**', route => {
route.fulfill({
status: 403,
contentType: 'application/json',
body: JSON.stringify({ error: 'Forbidden', message: 'Injected 403 by error-injection-tester' })
});
});
return 'API routes intercepted with 403 responses';
}`
})
```
```
browser_wait_for({ time: 3 })
```
```
browser_take_screenshot({ type: "png", filename: "error-injection-api-403.png" })
```
**Timeout (30-second hang):**
```javascript
browser_run_code({
code: `async (page) => {
await page.unrouteAll();
await page.route('**/api/**', route => {
// Never respond -- simulates a timeout
// The route will hang until navigation or unroute
});
return 'API routes intercepted with infinite hang (timeout simulation)';
}`
})
```
```
browser_wait_for({ time: 10 })
```
```
browser_take_screenshot({ type: "png", filename: "error-injection-api-timeout.png" })
```
Clean up routes:
```javascript
browser_run_code({
code: `async (page) => {
await page.unrouteAll();
return 'All route intercepts removed';
}`
})
```
### Step 5 -- Inject JavaScript Exceptions
Test that error boundaries catch unhandled errors.
```javascript
browser_evaluate({
function: `() => {
// Inject unhandled error
window.__errorsCaught = [];
const origHandler = window.onerror;
window.onerror = (msg, src, line, col, err) => {
window.__errorsCaught.push({ msg, src, line, col });
if (origHandler) origHandler(msg, src, line, col, err);
};
// Throw in a timeout to simulate async error
setTimeout(() => {
throw new Error('Injected error: Component render failure simulation');
}, 100);
// Throw in a promise to test unhandled rejection
Promise.reject(new Error('Injected unhandled promise rejection'));
return 'JS exceptions injected';
}`
})
```
```
browser_wait_for({ time: 2 })
```
```
browser_take_screenshot({ type: "png", filename: "error-injection-js-error.png" })
```
```
browser_console_messages({ level: "error" })
```
```javascript
browser_evaluate({
function: `() => {
return {
errorsCaught: window.__errorsCaught || [],
errorBoundaryVisible: !!document.querySelector('[class*="error"], [class*="fallback"], [role="alert"]')
};
}`
})
```
### Step 6 -- Inject localStorage Quota Exceeded
Simulate storage quota being exceeded.
```javascript
browser_evaluate({
function: `() => {
const results = { filled: false, error: null };
try {
// Fill localStorage with large data
const chunk = 'x'.repeat(1024 * 1024); // 1MB chunks
for (let i = 0; i < 20; i++) {
try {
localStorage.setItem('__quota_test_' + i, chunk);
} catch (e) {
results.filled = true;
results.error = e.message;
results.itemsBeforeQuota = i;
break;
}
}
// If we didn't hit quota naturally, override setItem
if (!results.filled) {
const origSetItem = localStorage.setItem.bind(localStorage);
localStorage.setRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.