{"record":{"id":"d7b3a5e1b992edc3","repo":"ReactiveX/rxjs","slug":"project-root-requires-a-directory","errorCode":null,"errorMessage":"--project-root requires a directory","messagePattern":"--project-root requires a directory","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/migrate/src/skill-cli.ts","lineNumber":88,"sourceCode":"function parseSkillArguments(argv: readonly string[]): ParsedSkillCliOptions {\n  const action = argv[0];\n  if (action !== 'check' && action !== 'install' && action !== 'update' && action !== 'remove') {\n    throw new Error(\n      'Usage: rxjs-migrate-skill <check|install|update|remove> --harness <codex|claude|cursor> [--project-root <dir>] [--force]'\n    );\n  }\n  let harness: SkillHarness | undefined;\n  let projectRoot = process.cwd();\n  let force = false;\n  for (let index = 1; index < argv.length; index++) {\n    const argument = argv[index];\n    if (argument === '--harness') {\n      const value = argv[++index];\n      if (!value || !skillHarnesses.includes(value as SkillHarness)) throw new Error('--harness requires codex, claude, or cursor');\n      harness = value as SkillHarness;\n    } else if (argument === '--project-root') {\n      const value = argv[++index];\n      if (!value) throw new Error('--project-root requires a directory');\n      projectRoot = value;\n    } else if (argument === '--force') {\n      force = true;\n    } else {\n      throw new Error(`Unknown option: ${String(argument)}`);\n    }\n  }\n  if (!harness) throw new Error('--harness is required');\n  return { action, harness, projectRoot, force };\n}\n\nfunction writeJson(stream: Pick<NodeJS.WriteStream, 'write'>, value: unknown): void {\n  stream.write(`${JSON.stringify(value, null, 2)}\\n`);\n}\n\nfunction messageFor(error: unknown): string {\n  return error instanceof Error ? error.message : String(error);\n}","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/ReactiveX/rxjs/blob/54796b38a57e6309f9861e174737479bb3f63f61/packages/migrate/src/skill-cli.ts#L70-L106","documentation":"Thrown by parseSkillArguments when --project-root is passed without a following value (e.g. it is the last token), so projectRoot would be undefined.","triggerScenarios":"Ending the command with --project-root and no directory, or shell-quoting mistakes that swallow the value.","commonSituations":"Script templates where the root variable is empty: --project-root \"$ROOT\" with ROOT unset expands to nothing.","solutions":["Supply the directory: --project-root /path/to/project","In scripts, guard that the variable is non-empty before passing the flag","Omit the flag to default to the current working directory"],"exampleFix":"# before\nrxjs-migrate-skill check --harness claude --project-root\n# after\nrxjs-migrate-skill check --harness claude --project-root ./my-project","handlingStrategy":"validation","validationCode":"if (!process.env.PROJECT_ROOT) { delete argvEntry; } // only pass --project-root when the value exists","typeGuard":"const isNonEmpty = (s: string | undefined): s is string => !!s && s.length > 0;","tryCatchPattern":null,"preventionTips":["Set default values for script variables","Quote CLI arguments in CI scripts"],"tags":["cli","arguments","validation"],"backgroundTag":"missing-cli-option-value","analyzedSha":"54796b38a57e6309f9861e174737479bb3f63f61","analyzedAt":"2026-08-28T10:21:27.410Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}