Query browser compatibility data for web features using the caniuse CLI tool.
Before querying, verify caniuse-cli is installed:
bash
which caniuse || echo "NOT_INSTALLED"
If not installed, tell the user:
caniuse-cli is not installed. Install it with:
bash
npm install -g @bramus/caniuse-cli
Run the caniuse command with the feature name:
bash
caniuse <feature-name>
Feature name formats:
caniuse viewport-unitscaniuse "viewport units"caniuse @propertyCommon feature name mappings (user term → caniuse query):
:has() selector → css-has:where() selector → css-where:is() selector → css-matches-pseudocss-container-queries (size) or css-container-queries-style (style)css-nestingsubgridcss-aspect-ratioflexbox-gapcss-gridflexboxJS/API features:
es6-moduleasync-functionsmdn-javascript_operators_optional_chainingfetchserviceworkerswebgpuAfter running the command:
Show the compatibility table as returned by caniuse
Highlight key findings:
Call out important notes if the output includes numbered notes (these often contain critical info about prefixes, flags, or partial implementations)
Give practical advice based on the results:
If caniuse returns "Nothing was found":
Check the mapping table above — many features have specific caniuse names (e.g., :has() → css-has)
Try common prefixes:
css- prefix (e.g., css-grid, css-variables)mdn- prefix for JS featuresTry variations:
:has() → has or css-hascontainer-queriesIf still not found, tell the user:
This feature might not be in the caniuse database, or uses a different name. Check https://caniuse.com to find the correct feature name.