ReactiveX/rxjs · error · Error

--harness requires codex, claude, or cursor

Error message

--harness requires codex, claude, or cursor

What it means

Thrown by parseSkillArguments when --harness is missing a value or the value is not one of the supported harness identifiers (codex, claude, cursor).

Source

Thrown at packages/migrate/src/skill-cli.ts:84

  }
  throw new Error('Cannot locate the canonical Skill shipped by @rxjs/migrate.');
}

function parseSkillArguments(argv: readonly string[]): ParsedSkillCliOptions {
  const action = argv[0];
  if (action !== 'check' && action !== 'install' && action !== 'update' && action !== 'remove') {
    throw new Error(
      'Usage: rxjs-migrate-skill <check|install|update|remove> --harness <codex|claude|cursor> [--project-root <dir>] [--force]'
    );
  }
  let harness: SkillHarness | undefined;
  let projectRoot = process.cwd();
  let force = false;
  for (let index = 1; index < argv.length; index++) {
    const argument = argv[index];
    if (argument === '--harness') {
      const value = argv[++index];
      if (!value || !skillHarnesses.includes(value as SkillHarness)) throw new Error('--harness requires codex, claude, or cursor');
      harness = value as SkillHarness;
    } else if (argument === '--project-root') {
      const value = argv[++index];
      if (!value) throw new Error('--project-root requires a directory');
      projectRoot = value;
    } else if (argument === '--force') {
      force = true;
    } else {
      throw new Error(`Unknown option: ${String(argument)}`);
    }
  }
  if (!harness) throw new Error('--harness is required');
  return { action, harness, projectRoot, force };
}

function writeJson(stream: Pick<NodeJS.WriteStream, 'write'>, value: unknown): void {
  stream.write(`${JSON.stringify(value, null, 2)}\n`);
}

View on GitHub (pinned to 54796b38a5)

Solutions

  1. Pass one of the exact values: codex, claude, or cursor
  2. Quote and double-check the value for typos
  3. If you need another harness, check the package's adapter list and supported version

Example fix

# before
rxjs-migrate-skill check --harness windsurf
# after
rxjs-migrate-skill check --harness claude
Defensive patterns

Strategy: validation

Validate before calling

const harnesses = ['codex','claude','cursor'];
if (!harnesses.includes(value)) throw new TypeError(`harness must be one of ${harnesses.join('|')}`);

Type guard

const isHarness = (v: string): v is 'codex'|'claude'|'cursor' => ['codex','claude','cursor'].includes(v);

Prevention

When it happens

Trigger: Running with --harness alone at the end of the command, --harness windsurf (unsupported), or a typo like '--harness cluade'.

Common situations: Expecting support for other agent harnesses; forgetting the value; trailing-flag truncation in scripts.

Related errors


AI-assisted analysis of ReactiveX/rxjs@54796b38a5 (2026-08-28). Data as JSON: /api/errors/4e010bb26dc5aa6b. Report an issue: GitHub.