affaan-m/ECC · error

Missing value for

Error message

Missing value for ${argName}

What it means

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.

Solutions

  1. Pass the expected value directly after the flag, e.g. `--panel my-panel`.
  2. Check the shell variable that supplies the value is non-empty before invoking the script.
  3. Read scripts/skills-health.js parseArgs to confirm which flags require values.

Example fix

// before
node scripts/skills-health.js --panel
// after
node scripts/skills-health.js --panel overview
Defensive patterns

Strategy: validation

Validate before calling

const args = ['--panel', 'overview'];
for (let i = 0; i < args.length; i++) {
  if (args[i] === '--panel' && (!args[i + 1] || args[i + 1].startsWith('--'))) {
    throw new Error('Missing value for --panel');
  }
}

Try / catch

try {
  runHealthScript(args);
} catch (e) {
  if (e.message.startsWith('Missing value for')) {
    console.error(`Usage error: ${e.message}`);
    process.exitCode = 1;
  } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "no subcommand specified" and "... is required": CLI errors when a required argument is missing — this error's family across 13 libraries.

Related errors


AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/2aa8ea06662c36ff. Report an issue: GitHub.

Appendix: source

Thrown at scripts/skills-health.js:29

Options:
  --json                  Emit machine-readable JSON
  --skills-root <path>    Override curated skills root
  --learned-root <path>   Override learned skills root
  --imported-root <path>  Override imported skills root
  --home <path>           Override home directory for learned/imported skill roots
  --runs-file <path>      Override skill run JSONL path
  --now <timestamp>       Override current time for deterministic reports
  --dashboard             Show rich health dashboard with charts
  --panel <name>          Show only a specific panel (success-rate, failures, amendments, versions)
  --warn-threshold <n>    Decline sensitivity threshold (default: 0.1)
  --help                  Show this help text
`);
}

function requireValue(argv, index, argName) {
  const value = argv[index + 1];
  if (!value || value.startsWith('--')) {
    throw new Error(`Missing value for ${argName}`);
  }

  return value;
}

function parseArgs(argv) {
  const options = {};

  for (let index = 0; index < argv.length; index += 1) {
    const arg = argv[index];

    if (arg === '--json') {
      options.json = true;
      continue;
    }

    if (arg === '--help' || arg === '-h') {
      options.help = true;

View on GitHub (pinned to 8321021c54)