feat: prompt user to generate repo-intel in skill#9
Conversation
Prompt user when repo-intel.json is missing instead of silently skipping doc-drift detection.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the Highlights
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds a pre-check to prompt the user for generating repo-intel. The implementation is a good step, but I have a couple of suggestions for improvement. First, the logic for determining the state directory is duplicated and doesn't handle all cases (like the AI_STATE_DIR environment variable); it would be better to use the centralized function for this. Second, the error handling for repo-intel generation is too broad and silent; it should log errors to inform the user if something goes wrong after they've opted in.
| const stateDir = ['.claude', '.opencode', '.codex'] | ||
| .find(d => fs.existsSync(path.join(cwd, d))) || '.claude'; |
There was a problem hiding this comment.
This implementation for determining the stateDir is a simplified version of the logic in lib/platform/state-dir.js. It is incorrect as it does not respect the AI_STATE_DIR environment variable, which can lead to inconsistent behavior.
To fix this and avoid code duplication, please use the centralized getStateDir function from lib/platform/state-dir.js.
| const stateDir = ['.claude', '.opencode', '.codex'] | |
| .find(d => fs.existsSync(path.join(cwd, d))) || '.claude'; | |
| const stateDir = require('../../lib/platform/state-dir').getStateDir(cwd); |
| } catch (e) { | ||
| // Binary not available - proceed without | ||
| } |
There was a problem hiding this comment.
The catch block is too broad and silently ignores all errors, including failures in file system operations like mkdirSync or writeFileSync. If generating the repo-intel.json file fails after the user has opted in, they should be notified. The comment is also misleading as this block will catch any error within the try block, not just the binary being unavailable.
| } catch (e) { | |
| // Binary not available - proceed without | |
| } | |
| } catch (e) { | |
| // The operation to generate repo-intel failed. This can be due to the | |
| // binary not being available or a file system error. Proceeding without. | |
| console.error(`Failed to generate repo-intel: ${e.message}`); | |
| } |
Summary
Test plan