For domain-specific languages: operator overloading, make Python look like math/domain notation, expression builders.
Library of realistic adversarial attack vectors and anti-patterns to avoid. Contains examples of valid attacks and subtle gaming patterns to reject.
For iteration with errors: catch exceptions during exploration, skip invalid cases, continue to next attempt.
For pathfinding and search: shortest path, maze solving, game AI, route planning, graph traversal, BFS/DFS, Dijkstra, A* problems.
For cross-cutting concerns: add behavior without modifying functions, caching, timing, logging, validation wrappers.
For probability and counting: permutations, combinations, sample spaces, Monte Carlo simulation, brute-force enumeration, card/dice problems.
For cross-version support: try/except imports, optional dependencies, graceful degradation across Python versions.
For complex behavior: build from tiny functions, chain transformations, make code read like a pipeline of operations.
For hot loop optimization: repeated formula evaluation, regex patterns, expression compilation. Transform string to callable once, call many times.
Provides heuristics for identifying incomplete or broken documentation. Use when validating README setup instructions, testing onboarding flows, or auditing documentation quality.
For rule-based systems: store rules as data, easier to add/modify than if-elif chains, simplification tables, configuration.
For persistent state: closures capture outer variables, alternative to classes for simple state, factory functions that remember context.
For counting and frequency: histograms, most common elements, vote tallying, neighbor counting, word frequencies, distribution analysis.
Analyze completed parallel workflows for lessons learned. Use when: reviewing workflow execution quality, identifying process improvements, evaluating skill effectiveness,…
For long functions: break into smaller pieces, extract helper functions, reduce nesting, improve testability and readability.
Principles and patterns for writing error messages that help users recover. Use when auditing, writing, or improving error messages in code.
For example-driven development: test cases as specifications, input/output pairs, documentation through examples.
For search with undo: explicit decision stack, backtracking when paths fail, depth-first exploration with state restoration.
For functional operations: named functions for operators, cleaner than lambdas for arithmetic, building interpreter environments.
For test co-location: tests in same file as code, run with main, tests as documentation and examples.
For graph exploration: frontier collection with configurable pop order, BFS/DFS/random via strategy change.
Execute focused implementation tasks in a parallel workflow. Use when: working on assigned files in a worktree, making checkpoint commits, signaling dependencies or blockers,…
For complex state: encapsulate multiple interacting variables, stateful algorithms, backtracking search state.
Manage parallel Claude Code workstreams using git worktrees. Use when: splitting large tasks across multiple workers, coordinating parallel development, monitoring worker…
For computational geometry: convex hull, point enclosure, polygon operations. Uses monotone chain algorithm with stack-based turn detection.
For grouping and auto-initialization: adjacency lists, grouping by key, multi-maps, nested structures without KeyError handling.
For result reporting: tabular output, aligned columns, statistics summaries, human-readable reports.
For memory efficiency: large sequences, infinite streams, early termination possible, pipeline processing without materializing all data.
For sparse data: infinite grids, large spaces with few active elements, membership testing, set operations on coordinates or states.
For performance work: measure before changing, profile to find bottlenecks, compare before and after.
For combinatorial iteration: permutations, combinations, cartesian products, without storing all results in memory.
For ordered processing: A* search, Dijkstra, event simulation, task scheduling. Efficient min/max extraction with heap-based queue.
For comparison: display before/after, multiple solutions, diffs side by side for visual comparison.
For generic algorithms: strategy pattern, callbacks, configurable behavior. Pass functions as parameters to customize algorithm behavior.
For constraint satisfaction: Sudoku, scheduling, N-queens, logic puzzles, SAT-like problems, assignment problems. Uses propagate-then-search pattern.
For symbolic computation: ASTs, mathematical expressions, code that manipulates code structure, expression transformations.
For text processing: extract numbers, words, structured data from messy text using regex patterns, parsing utilities.
For dynamic programming: overlapping subproblems, recursive solutions with repeated computations, memoization to avoid redundant work.
For interpreters: separate lexing from parsing, token stream to AST, structured text processing in stages.
For writing clean functions: start with docstring, iterate until code matches docstring exactly, achieve docstring-code isomorphism.
For inline callbacks: anonymous one-liner functions, key functions for sorting, trivial transformations as dict values.
For 2D debugging: visualize grid/board state, show puzzle progress, make algorithm behavior visible.
For flexible parsing: try multiple type conversions in order, graceful fallback from specific to general types.
For two-sided matching: hospital-resident, stable marriage, college admissions. Gale-Shapley algorithm for stable matching with preferences.
Knowledge for extracting local Claude Code components and publishing to plugin marketplaces. Use when helping users package skills, agents, hooks into shareable plugins.
For input validation: check format and constraints before processing, fail fast with clear errors, defensive parsing.
For static relationships: graph structure, grid neighbors, constraint peers. Calculate once at module load, reference throughout program.
For solution checking: independent verification that result is correct, separate from how it was computed.
For 2D grid problems: mazes, board games, tile maps, pixel grids, coordinate systems, cellular automata, flood fill. Uses dict-based Grid class pattern.
For boundary conditions: empty collections, zero values, recursive base cases, null checks, prevent crashes at edges.
For new modules: define type aliases as vocabulary, make code self-documenting, create domain-specific language feel.
For graceful failure: return None or False instead of exceptions, let caller decide how to handle failure.
For data structure validation: test lengths, relationships, constraints that must hold, verify setup is correct.
For NP-hard optimization: TSP, scheduling, assignment problems. Uses greedy construction + local improvement (2-opt, hill climbing).
Analyze code to identify explicit contracts, implicit usage patterns, and realistic boundary conditions. Contains concrete formulas for calculating input realism limits.
For tree/maze generation: spanning trees, random mazes, graph coverage. Uses frontier-based exploration with configurable traversal order.
For heterogeneous data: pattern matching on type/structure, interpreter eval loops, handling different expression types.
For constraint problems: eliminate impossibilities before guessing, reduce search space through inference, fail fast on contradictions.
For data transformation: list/dict/set comprehensions, chained filtering and mapping, creating lookup structures concisely.
For performance reporting: timing wrappers, throughput calculations, profiling summaries.