ReactiveX/rxjs · error · Error

Invalid Skill installation provenance.

Error message

Invalid Skill installation provenance.

What it means

Thrown by parseProvenance when the provenance JSON file (written next to an installed skill) does not match the expected schema: digest string, files array, adapter of 'agents'|'claude', compatibleHarnesses array, and targetPath string. It detects tampered, corrupted, or version-incompatible provenance metadata.

Source

Thrown at packages/migrate/src/skill-install.ts:285

    await rm(stageParent, { recursive: true, force: true });
  }
}

function parseProvenance(source: string): SkillInstallProvenance {
  const value = JSON.parse(source) as Partial<SkillInstallProvenance>;
  if (
    value.installSchemaVersion !== skillInstallSchemaVersion ||
    value.schemaVersion !== skillIntegritySchemaVersion ||
    value.packageName !== '@rxjs/migrate' ||
    typeof value.packageVersion !== 'string' ||
    value.digestAlgorithm !== 'sha256' ||
    typeof value.digest !== 'string' ||
    !Array.isArray(value.files) ||
    (value.adapter !== 'agents' && value.adapter !== 'claude') ||
    !Array.isArray(value.compatibleHarnesses) ||
    typeof value.targetPath !== 'string'
  ) {
    throw new Error('Invalid Skill installation provenance.');
  }
  return value as SkillInstallProvenance;
}

async function readProvenance(path: string): Promise<SkillInstallProvenance> {
  return parseProvenance(await readFile(path, 'utf8'));
}

async function tryReadProvenance(path: string): Promise<SkillInstallProvenance | undefined> {
  try {
    return await readProvenance(path);
  } catch {
    return undefined;
  }
}

function sameContent(left: SkillIntegrity, right: SkillIntegrity): boolean {
  return (

View on GitHub (pinned to 54796b38a5)

Solutions

  1. Delete the installed skill copy and its metadata, then reinstall with rxjs-migrate-skill install --force
  2. Upgrade @rxjs/migrate so reader and writer schemas match
  3. Avoid editing the provenance/metadata files under the installed skill directory

Example fix

# before: check fails on old provenance
rxjs-migrate-skill check --harness claude
# after
rm -rf .claude/skills/rxjs-migrate
rxjs-migrate-skill install --harness claude
Defensive patterns

Strategy: type-guard

Validate before calling

const p = JSON.parse(raw);
const valid = typeof p.digest === 'string' && Array.isArray(p.files) && ['agents','claude'].includes(p.adapter) && Array.isArray(p.compatibleHarnesses) && typeof p.targetPath === 'string';

Type guard

const isSkillProvenance = (v: unknown): v is SkillInstallProvenance =>
  !!v && typeof v === 'object' && typeof (v as any).digest === 'string' && Array.isArray((v as any).files) && ['agents','claude'].includes((v as any).adapter) && Array.isArray((v as any).compatibleHarnesses) && typeof (v as any).targetPath === 'string';

Try / catch

try { await readProvenance(path); } catch (e) { if (e instanceof Error && e.message === 'Invalid Skill installation provenance.') { /* wipe and reinstall skill */ } throw e; }

Prevention

When it happens

Trigger: readProvenance loading a .provenance file that was hand-edited, truncated, partially written, or produced by an older/newer incompatible @rxjs/migrate version (e.g. a new adapter id).

Common situations: Upgrading across versions that changed the schema; users editing hidden metadata files; disk corruption or interrupted writes.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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