Blob: .opencode/commands/compat-flag.md
description: Look up a compatibility flag, or list all flags if no argument given subtask: true
Look up compatibility flag: $ARGUMENTS
If no argument is provided (empty or blank), list all compatibility flags:
Use the
compat-date-attool (no arguments) to get the full list of flags with their enable dates, categories, and annotations. This is faster and more accurate than manually reading the capnp file.For each flag, also extract a one-line summary from the comment in
src/workerd/io/compatibility-date.capnp.Output a summary table grouped by category (streams, nodejs, containers, general, etc.):
Flag Enable date Description flag_name2025-01-15 Brief description Include the total count of compatibility flags.
If an argument is provided, look up that specific flag:
Use the
compat-date-attool withflag: "<argument>"to get the flag's metadata (enable/disable names, enable date, annotations). Then read the capnp source for the comment.Extract flag metadata from the tool output and capnp definition:
- Field name and number
$compatEnableFlagname$compatDisableFlagname (if present)$compatEnableDate(if set)- Whether it has
$experimentalannotation - The comment block describing the flag
Find C++ usage sites. Search for the getter (e.g.,
getTextDecoderReplaceSurrogates()) across the codebase:grep -rn "getTextDecoderReplaceSurrogates\|text_decoder_replace_surrogates" src/Find tests. Search for the snake_case flag name in
.wd-testand test.jsfiles:grep -rn "text_decoder_replace_surrogates" src/ --include='*.wd-test' --include='*-test.js' --include='*-test.ts'Output:
- Flag: enable name / disable name
- Enable date: date or "not set (must be explicitly enabled)"
- Description: from the capnp comment
- Usage sites: file:line list of where the flag is checked in C++
- Tests: file:line list of tests that exercise this flag
- Annotations: experimental, neededByFl, impliedByAfterDate, etc.
- If the flag is not found, suggest checking for typos and list flags with similar names