{"record":{"id":"0afa3ae71d8007fe","repo":"Fission-AI/OpenSpec","slug":"change-name-already-exists-at-changedir","errorCode":null,"errorMessage":"Change '${name}' already exists at ${changeDir}","messagePattern":"Change '(.+?)' already exists at (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/utils/change-utils.ts","lineNumber":167,"sourceCode":"    // Try to read from project config\n    try {\n      const config = readProjectConfig(projectRoot);\n      schemaName = config?.schema ?? defaultSchema;\n    } catch {\n      // If config read fails, use default\n      schemaName = defaultSchema;\n    }\n  }\n\n  // Validate the resolved schema\n  validateSchemaName(schemaName, projectRoot);\n\n  // Build the change directory path\n  const changeDir = path.join(options.changesDir ?? path.join(projectRoot, 'openspec', 'changes'), name);\n\n  // Check if change already exists\n  if (await FileSystemUtils.directoryExists(changeDir)) {\n    throw new Error(`Change '${name}' already exists at ${changeDir}`);\n  }\n\n  const schema = resolveSchema(schemaName, projectRoot);\n  const skipsSpecs = !schema.artifacts.some(artifact =>\n    isSpecsArtifactPath(artifact.generates)\n  );\n\n  // Creating a change may scaffold or complete the root itself (an\n  // implicit root, or a config-only/incomplete clone). Never leave a\n  // half-root behind that doctor immediately calls unhealthy: ensure\n  // specs/ and changes/archive/ exist, and write a config only when\n  // none exists. The config records the PROJECT default schema, never\n  // a one-change --schema override.\n  const openspecDir = path.join(projectRoot, 'openspec');\n\n  // Create the directory (including parent directories if needed)\n  await FileSystemUtils.createDirectory(changeDir);\n  await FileSystemUtils.createDirectory(path.join(openspecDir, 'specs'));","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/utils/change-utils.ts#L149-L185","documentation":"Error \"Change '${name}' already exists at ${changeDir}\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/utils/change-utils.ts:167 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6926ccb18afa4ff621112813e9968334576ee11a","analyzedAt":"2026-08-25T12:29:45.729Z","schemaVersion":2},"datasetVersion":"2026-08-25T16:17:27.014Z"}