Avoid implicit type coercion

SkillWeb & browsing

Type-coercion is a skill for AI agents that reviews JavaScript code and spots places where values get compared across different types by mistake. It inspects both source code and the browser execution path, so fixes target the real bottleneck or bug.

Available today. Use it from your connected AI after setup.

Have the JavaScript code you want reviewed available, such as scripts, client components, or bundles.

Then ask your AI: use the Avoid implicit type coercion skill

What your AI can do with it

  • Review scripts, client components, and bundles for implicit type coercion
  • Inspect runtime behavior related to Avoid implicit type coercion
  • Examine the browser execution path alongside source code
  • Identify comparisons across different types made by mistake
  • Help target fixes at the real bottleneck or bug

Getting started

  1. Have the JavaScript code you want reviewed available, such as scripts, client components, or bundles.
  2. Add the type-coercion skill to your agent's setup.
  3. Ask the agent to review the code or runtime behavior for implicit type coercion issues.

What this skill tells your AI

The instructions your AI receives, as published by thedaviddias/front-end-checklist in skills/type-coercion/SKILL.md and read by ahel’s review.

JavaScript's implicit type coercion produces results that look like bugs to anyone who doesn't know the exact coercion rules. == comparisons with mixed types silently convert values in ways that fail to catch genuine errors. Explicit conversions make code intent clear and catch real type mismatches at the point where they occur.

Quick Reference

  • Always use === and !== instead of == and !=
  • Convert types explicitly with Number(), String(), Boolean(), parseInt()
  • Be careful with + operator — it concatenates strings but adds numbers
  • Use Array.isArray() instead of typeof for array checks

Check

Find all uses of == and != (non-strict equality) in this file. Also look for implicit type conversions from + operator and other coercion traps.

Fix

Replace all == with === and != with !==. Add explicit type conversions where mixed types are intentionally compared.

Explain

Explain JavaScript's implicit type coercion rules, why == is problematic, and how to write safe type comparisons.

Code Review

Review scripts, client components, and browser execution paths related to Avoid implicit type coercion. Flag exact imports, event handlers, runtime side effects, or blocking operations that violate the rule, and state how the change should be verified in the browser.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/en/rules/javascript/type-coercion

Signals

GitHub stars
74k
Forks
7k
Last commit
Aug 2026

Questions

What does type-coercion do?
It helps an agent review JavaScript code and spot places where values get compared across different types by mistake, covering both source code and browser execution behavior.
When should it be used?
Use it when reviewing scripts, client components, bundles, or runtime behavior related to implicit type coercion.
Does it look at runtime behavior or just source code?
Both. It inspects source code and the browser execution path so fixes target the real bottleneck or bug.
Advanced
Item type
skill
Key
type-coercion
Source
github.com/thedaviddias/front-end-checklist