PreventionPatterns

Document common JavaScript/TypeScript bug patterns and their fixes.

8|Updated Mar 28, 2024
One-click install
npx skills add https://github.com/joncrangle/.dotfiles --skill preventionpatterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: PreventionPatterns
Source: https://github.com/joncrangle/.dotfiles/tree/main/dot_config/opencode/skills/prevention-patterns
Command: npx skills add https://github.com/joncrangle/.dotfiles --skill preventionpatterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Known bug patterns and their fixes help prevent regressions by surfacing recurring issues early and guiding consistent remediation.

Core Features & Use Cases

  • Pattern catalog: categorize common frontend, backend, and general code health issues with clear fixes.
  • Guided remediation: provides concrete actions to fix identified patterns in real projects.
  • Use Case: When reviewing a new feature, consult the catalog to ensure patterns like stale closures, missing dependencies, or unsafe data handling are addressed.

Quick Start

Scan your codebase for the listed patterns and apply the corresponding fixes to prevent regression.

Frequently Asked Questions about PreventionPatterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What are common bug patterns and how do they help prevent code regressions?

Bug patterns are recurring code health issues like stale closures or unsafe data handling. Documenting these patterns and their fixes helps prevent regressions by surfacing issues early and guiding consistent remediation during code reviews.

How do I scan my JavaScript or TypeScript codebase for known bug patterns?

To scan for known bug patterns, review your JavaScript or TypeScript codebase against a categorized catalog of frontend and backend issues, then apply the corresponding concrete fixes to resolve identified regressions and improve overall code quality.

Does this regression prevention approach apply to both frontend and backend code reviews?

Yes, regression prevention applies to both frontend and backend code reviews. It categorizes common issues across JavaScript and TypeScript projects, ensuring patterns like missing dependencies are consistently addressed during general code health reviews.

When should I document bug patterns to prevent regressions in my project?

You should document bug patterns when reviewing new features or addressing code quality issues. Creating a structured catalog of known problems and their fixes ensures consistent remediation and prevents the same regressions from recurring.

What is the best way to fix recurring frontend bug patterns like stale closures?

The best way to fix recurring frontend bug patterns like stale closures is to consult a structured pattern catalog. It provides concrete remediation actions to apply directly to your JavaScript or TypeScript codebase to prevent regression.

Why do missing dependencies cause regressions and how can I prevent them?

Missing dependencies cause regressions by introducing unstable code behavior. You can prevent them by identifying these bug patterns during code reviews and applying the documented concrete fixes to ensure safe data handling and code health.