{"record":{"id":"87482e3bb245147c","repo":"Fission-AI/OpenSpec","slug":"no-openspec-directory-found-run-openspec-init-f","errorCode":null,"errorMessage":"No OpenSpec directory found. Run 'openspec init' first.","messagePattern":"No OpenSpec directory found\\. Run 'openspec init' first\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/core/update.ts","lineNumber":136,"sourceCode":"  private readonly force: boolean;\n\n  constructor(options: UpdateCommandOptions = {}) {\n    this.force = options.force ?? false;\n  }\n\n  /**\n   * Refreshes OpenSpec skills and commands for all configured tools,\n   * regenerating artifacts according to the effective profile and delivery mode.\n   *\n   * @param projectPath - Path to the project root containing the openspec directory\n   */\n  async execute(projectPath: string): Promise<void> {\n    const resolvedProjectPath = path.resolve(projectPath);\n    const openspecPath = path.join(resolvedProjectPath, OPENSPEC_DIR_NAME);\n\n    // 1. Check openspec directory exists\n    if (!await FileSystemUtils.directoryExists(openspecPath)) {\n      throw new Error(`No OpenSpec directory found. Run 'openspec init' first.`);\n    }\n\n    // 2. Migrate OpenSpec-managed skills left in renamed tool directories\n    // (e.g. .kimi -> .kimi-code) so they stay detected and get refreshed,\n    // then perform the one-time profile migration if needed before any\n    // legacy upgrade generation.\n    for (const migration of migrateLegacyToolDirs(resolvedProjectPath)) {\n      if (hasMovableContent(migration)) {\n        console.log(chalk.dim(`Migrated ${describeLegacyMigration(migration)}: ${migration.from} → ${migration.to}`));\n      }\n      this.reportKeptInPlace(migration);\n    }\n    const declinedMigrations = await this.offerConsentedLegacyMigrations(resolvedProjectPath);\n\n    // Use detected tool directories to preserve existing opsx skills/commands.\n    const detectedTools = getAvailableTools(resolvedProjectPath);\n    migrateIfNeededShared(resolvedProjectPath, detectedTools);\n","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/update.ts#L118-L154","documentation":"Error \"No OpenSpec directory found. Run 'openspec init' first.\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/update.ts:136 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"}