{"record":{"id":"2aa8ea06662c36ff","repo":"affaan-m/ECC","slug":"missing-value-for-argname","errorCode":null,"errorMessage":"Missing value for ${argName}","messagePattern":"Missing value for (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/skills-health.js","lineNumber":29,"sourceCode":"Options:\n  --json                  Emit machine-readable JSON\n  --skills-root <path>    Override curated skills root\n  --learned-root <path>   Override learned skills root\n  --imported-root <path>  Override imported skills root\n  --home <path>           Override home directory for learned/imported skill roots\n  --runs-file <path>      Override skill run JSONL path\n  --now <timestamp>       Override current time for deterministic reports\n  --dashboard             Show rich health dashboard with charts\n  --panel <name>          Show only a specific panel (success-rate, failures, amendments, versions)\n  --warn-threshold <n>    Decline sensitivity threshold (default: 0.1)\n  --help                  Show this help text\n`);\n}\n\nfunction requireValue(argv, index, argName) {\n  const value = argv[index + 1];\n  if (!value || value.startsWith('--')) {\n    throw new Error(`Missing value for ${argName}`);\n  }\n\n  return value;\n}\n\nfunction parseArgs(argv) {\n  const options = {};\n\n  for (let index = 0; index < argv.length; index += 1) {\n    const arg = argv[index];\n\n    if (arg === '--json') {\n      options.json = true;\n      continue;\n    }\n\n    if (arg === '--help' || arg === '-h') {\n      options.help = true;","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/skills-health.js#L11-L47","documentation":"skills-health.js's requireValue helper validates that an option passed on the command line is followed by a value. If the next argv element is missing (end of arguments) or is itself another flag (starts with '--'), it throws \"Missing value for <argName>\". This prevents flags from silently consuming the wrong token or producing undefined options.","triggerScenarios":"Running `node scripts/skills-health.js --panel` with nothing after the flag, or `--panel --json` where the next token is another flag; parseArgs delegates to requireValue which throws.","commonSituations":"Typing a flag and forgetting its value; copy-pasting a command where the value was on the next line; shell variable holding the value expanding to empty; scripting with optional values that were omitted.","solutions":["Pass the expected value directly after the flag, e.g. `--panel my-panel`.","Check the shell variable that supplies the value is non-empty before invoking the script.","Read scripts/skills-health.js parseArgs to confirm which flags require values."],"exampleFix":"// before\nnode scripts/skills-health.js --panel\n// after\nnode scripts/skills-health.js --panel overview","handlingStrategy":"validation","validationCode":"const args = ['--panel', 'overview'];\nfor (let i = 0; i < args.length; i++) {\n  if (args[i] === '--panel' && (!args[i + 1] || args[i + 1].startsWith('--'))) {\n    throw new Error('Missing value for --panel');\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  runHealthScript(args);\n} catch (e) {\n  if (e.message.startsWith('Missing value for')) {\n    console.error(`Usage error: ${e.message}`);\n    process.exitCode = 1;\n  } else throw e;\n}","preventionTips":["Always place the value immediately after its flag in command lines and scripts.","Quote and default shell variables: `--panel \"${PANEL:-overview}\"`.","Test wrapper commands with --help first to confirm which flags take values."],"tags":["cli","argument-parsing","missing-value"],"backgroundTag":"missing-cli-argument","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}