Time: ~30 min · Difficulty: Beginner
analyze-patterns.mjs reads its flags positionally (args.indexOf('--min-threshold')) with no validation at all: a mistyped flag is ignored, and --min-threshold abc silently becomes the default — the same silent-wrong-answer family #2982 closed for four other CLIs. Mirror that work: validateFlags for the names, requireFlagValue with isNonNegativeInt/isPositiveInt (both already exported from lib/cli-flags.mjs) for the values, plus a row in tests/cli-flag-validation.test.mjs.
Acceptance: unknown flags and unusable values exit 2 naming the flag; valid invocations behave exactly as before. (Note: #2983 touches lib/cli-flags.mjs and merges shortly — rebase over it if you collide.)
Time: ~30 min · Difficulty: Beginner
analyze-patterns.mjsreads its flags positionally (args.indexOf('--min-threshold')) with no validation at all: a mistyped flag is ignored, and--min-threshold abcsilently becomes the default — the same silent-wrong-answer family #2982 closed for four other CLIs. Mirror that work:validateFlagsfor the names,requireFlagValuewithisNonNegativeInt/isPositiveInt(both already exported fromlib/cli-flags.mjs) for the values, plus a row intests/cli-flag-validation.test.mjs.Acceptance: unknown flags and unusable values exit 2 naming the flag; valid invocations behave exactly as before. (Note: #2983 touches lib/cli-flags.mjs and merges shortly — rebase over it if you collide.)