{"record":{"id":"29a935fbf98d9790","repo":"ReactiveX/rxjs","slug":"refusing-to-install-over-a-state-skill-copy-at","errorCode":null,"errorMessage":"Refusing to install over a ${state} Skill copy at ${installation.targetPath}. Use update or explicit force.","messagePattern":"Refusing to install over a (.+?) Skill copy at (.+?)\\. Use update or explicit force\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/migrate/src/skill-install.ts","lineNumber":121,"sourceCode":"export async function inspectSkillInstallation(options: SkillInstallOptions): Promise<SkillInstallationInspection> {\n  const installation = await resolveInstallation(options);\n  const state = await installationState(installation);\n  const provenance = state === 'absent' ? undefined : await tryReadProvenance(installation.provenancePath);\n  return {\n    state,\n    targetPath: installation.targetPath,\n    provenancePath: installation.provenancePath,\n    ...(provenance ? { provenance } : {}),\n    canonicalIntegrity: installation.provenance,\n  };\n}\n\nexport async function installSkill(options: SkillInstallOptions): Promise<SkillInstallResult> {\n  const installation = await resolveInstallation(options);\n  const state = await installationState(installation);\n  if (state === 'current') return resultFor('install', installation, state, state, false);\n  if (state !== 'absent' && !options.force) {\n    throw new Error(`Refusing to install over a ${state} Skill copy at ${installation.targetPath}. Use update or explicit force.`);\n  }\n  await replaceInstallation(installation);\n  return resultFor('install', installation, state, 'current', true);\n}\n\nexport async function updateSkill(options: SkillInstallOptions): Promise<SkillInstallResult> {\n  const installation = await resolveInstallation(options);\n  const state = await installationState(installation);\n  if (state === 'current') return resultFor('update', installation, state, state, false);\n  if (state === 'modified' && !options.force) {\n    throw new Error(`Refusing to overwrite a locally modified Skill copy at ${installation.targetPath} without explicit force.`);\n  }\n  await replaceInstallation(installation);\n  return resultFor('update', installation, state, 'current', true);\n}\n\nexport async function removeSkill(options: SkillInstallOptions): Promise<SkillInstallResult> {\n  const installation = await resolveInstallation(options);","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/ReactiveX/rxjs/blob/54796b38a57e6309f9861e174737479bb3f63f61/packages/migrate/src/skill-install.ts#L103-L139","documentation":"Thrown by installSkill when the target skill path already contains a copy whose state is not 'absent' (stale or locally modified) and --force was not passed. It prevents silently clobbering a user's local edits on install; the message tells you to use update instead or force explicitly.","triggerScenarios":"Running rxjs-migrate-skill install when a previous skill copy exists that doesn't match the canonical digest (edited by hand or from an older version), without --force.","commonSituations":"Re-running install after manually tweaking SKILL.md, or after upgrading @rxjs/migrate changed the canonical skill content.","solutions":["Run rxjs-migrate-skill update instead, which is the intended path for existing copies","If local changes are disposable, rerun install with --force","Diff the installed copy against the canonical one to see what would be overwritten"],"exampleFix":"# before\nrxjs-migrate-skill install --harness claude\n# after\nrxjs-migrate-skill update --harness claude\n# or, discarding local edits:\nrxjs-migrate-skill install --harness claude --force","handlingStrategy":"try-catch","validationCode":"import { stat } from 'node:fs/promises';\nconst exists = await stat(targetSkillPath).then(() => true).catch(() => false);","typeGuard":null,"tryCatchPattern":"try { installSkill(opts); } catch (e) { if (e instanceof Error && e.message.startsWith('Refusing to install')) { await updateSkill(opts); } else throw e; }","preventionTips":["Prefer 'update' for existing installs","Only use --force when local edits are disposable"],"tags":["cli","skill-install","safety-guard","overwrite-protection"],"backgroundTag":"refusing-overwrite-modified-file","analyzedSha":"54796b38a57e6309f9861e174737479bb3f63f61","analyzedAt":"2026-08-28T10:21:27.410Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}