{"record":{"id":"b8f359cff77cd442","repo":"Fission-AI/OpenSpec","slug":"language-does-not-overwrite-an-existing-openspec","errorCode":null,"errorMessage":"--language does not overwrite an existing OpenSpec config. Add the language instruction to its context field instead.","messagePattern":"--language does not overwrite an existing OpenSpec config\\. Add the language instruction to its context field instead\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/core/init.ts","lineNumber":1081,"sourceCode":"    if (!hasConfig) {\n      try {\n        FileSystemUtils.assertProjectArtifactPath(projectPath, configPath);\n      } catch (error) {\n        const reason = error instanceof Error ? `: ${error.message}` : '';\n        throw new Error(`Cannot create openspec/config.yaml for --language${reason}`);\n      }\n      if (!(await FileSystemUtils.canWriteFile(configPath))) {\n        throw new Error(\n          'Cannot create openspec/config.yaml for --language: the destination is not writable.'\n        );\n      }\n      return;\n    }\n\n    const existingContext = readProjectConfig(projectPath)?.context;\n    if (existingContext?.includes(languageContext)) return;\n\n    throw new Error(\n      '--language does not overwrite an existing OpenSpec config. ' +\n      'Add the language instruction to its context field instead.'\n    );\n  }\n\n  private async createConfig(openspecPath: string, extendMode: boolean): Promise<'created' | 'exists' | 'skipped'> {\n    const configPath = path.join(openspecPath, 'config.yaml');\n    const configYmlPath = path.join(openspecPath, 'config.yml');\n    const configYamlExists = fs.existsSync(configPath);\n    const configYmlExists = fs.existsSync(configYmlPath);\n\n    if (configYamlExists || configYmlExists) {\n      return 'exists';\n    }\n\n\n    try {\n      const yamlContent = serializeConfig({","sourceCodeStart":1063,"sourceCodeEnd":1099,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/init.ts#L1063-L1099","documentation":"Error \"--language does not overwrite an existing OpenSpec config. Add the language instruction to its context field instead.\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/init.ts:1081 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"}