fuzz-test-design
Use when designing fuzz, property, randomized, or corpus-based tests and replaying failures. Triggers:
What this skill does
# Testing Fuzzing Use this skill when the work calls for fuzz tests, property tests, randomized scenario tests, model-based tests, or replayable failure reduction. The goal is not "more random tests"; it is to expose input classes and state transitions that example tests miss, then turn each useful failure into a deterministic regression. ## Operating Rules 1. Start with the target boundary. Identify the parser, serializer, validator, protocol handler, state machine, scheduler, allocator, CLI surface, API contract, or workflow being stressed. 2. State the risk. Name the defect class the randomized test is meant to find: panic, crash, data loss, invalid state transition, auth bypass, resource blow-up, nontermination, incorrect round trip, incompatible decode, or divergent implementation behavior. 3. Define the oracle before the generator. Random input without a verdict function creates noise. 4. Record every random seed, corpus path, command, timeout, and environment detail needed to reproduce a failure. 5. Minimize failures before fixing them. Keep the minimized case as a regression test and, when useful, as a seed corpus entry. ## Oracle Selection Choose one or more oracles that can be evaluated automatically: - Invariant oracle: properties that must always hold, such as sorted output, balance conservation, monotonic counters, valid UTF-8, authorization boundaries, or schema validity. - Round-trip oracle: encode/decode, parse/print/parse, serialize/deserialize, import/export, or normalize/idempotence checks. - Metamorphic oracle: transformed input should preserve or predictably transform output, such as reordering independent records or adding irrelevant whitespace. - Differential oracle: compare independent implementations, old and new code paths, optimized and reference versions, or local and remote validators. - Stateful model oracle: compare command sequences against a small model of allowed states and transitions. - Safety oracle: the target must not panic, crash, leak secrets, hang, exhaust memory, corrupt state, or accept invalid privileged actions. If no strong oracle exists, build a smoke oracle first: no crash, bounded runtime, valid error shape, and deterministic replay. Mark it as weak and add a follow-up to improve it. ## Test Design Workflow 1. Inventory target inputs. List public input types, file formats, request bodies, CLI args, environment variables, stored records, message frames, generated code, and internal command sequences. 2. Partition the input space. Cover valid inputs, invalid inputs, edge cases, boundary sizes, nested structures, duplicate fields, unknown versions, missing fields, mixed encodings, extreme numbers, time zones, concurrency interleavings, and resource limits. 3. Choose the testing style. Use property tests for pure or mostly deterministic functions. Use coverage-guided fuzzing for parsers, decoders, protocol handlers, and unsafe boundaries. Use randomized scenario tests for workflows, schedulers, stores, and state machines. Use model-based tests when command ordering matters. 4. Build generators deliberately. Prefer structured generators over raw bytes when the target consumes structured data. Mix valid and invalid cases. Keep constraints narrow enough to reach meaningful code and broad enough to discover missed classes. Add shrinking or minimization support where the framework allows it. 5. Seed the corpus. Include hand-picked examples, historical incidents, production-shaped fixtures, boundary cases, minimized regressions, and small representative valid files. Deduplicate corpus entries and avoid committing large or sensitive data. 6. Run in layers. Start with short local runs to validate the harness, then increase iterations, coverage time, input size, and parallelism. Keep each command replayable with an explicit seed or corpus artifact. 7. Triage each failure. Classify it as product bug, test bug, oracle bug, generator bug, environment flake, or resource-budget issue. Do not merge randomized tests that fail without a replay path. 8. Convert discoveries into durable tests. Add a focused regression test for every real bug. Add the minimized input to the corpus only when it improves future discovery or protects a format boundary. ## Corpus Management Keep corpora small, intentional, and reproducible. - Store source-controlled seeds under an existing test fixture or fuzz corpus convention for the project. - Put large generated corpora in CI artifacts or external storage, not in the normal source tree. - Name corpus entries by behavior or issue when possible, not by random hashes alone. - Scrub secrets, customer data, credentials, and host-specific paths. - Add corpus entries only after deduplication and minimization. - Preserve replay commands next to failure reports or in test comments when the framework does not embed them. ## Minimization And Replay Every useful randomized failure needs a path back to determinism: - Capture seed, framework version, command, target, timeout, platform, and corpus revision. - Minimize the input with the framework shrinker, reducer, or a manual delta-debugging loop. - Re-run the minimized input at least twice before changing production code. - Add a deterministic regression that does not depend on broad random search. - Keep the broad fuzz/property harness after the regression lands; the regression guards the found bug, the harness searches for the next class. ## CI Budget Use budgets that match the gate: - Pull request smoke: fixed seed or checked-in corpus, short timeout, deterministic replay, low parallelism, no network dependency. - Main branch or nightly: longer duration, coverage growth, corpus refresh, sanitizer builds where applicable, artifact upload for failures and new corpus candidates. - Release hardening: targeted longer runs on high-risk parsers, migration paths, compatibility boundaries, unsafe code, concurrency-sensitive state machines, and security-relevant validators. Randomized tests in CI must have bounded runtime, stable replay, and failure artifacts. If a harness is valuable but too expensive for pull requests, wire a small smoke target into PR CI and move the deep run to a scheduled gate. ## Output Format Return or commit the smallest useful set of artifacts: - Target and risk summary. - Oracle matrix with property, verdict, and expected failure signal. - Generator strategy and corpus policy. - Commands, seeds, iteration counts, timeouts, and CI budgets. - Failure triage with minimized replay command when a failure is found. - Deterministic regression tests for confirmed bugs. - Residual risk and recommended next fuzzing budget. ## Completion Checklist - The oracle is explicit. - The generator covers valid, invalid, and boundary-shaped inputs. - Seeds and corpus entries are small, scrubbed, and justified. - Every discovered failure has a minimized replay path. - Confirmed bugs have deterministic regression tests. - CI runs are bounded and split between pull-request smoke and deeper scheduled fuzzing when needed.
Related 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.