-
-
Notifications
You must be signed in to change notification settings - Fork 28
[#1639] Added AI agentic instructions selection to the installer. #1722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,4 +5,4 @@ | |
|
|
||
| /.gitattributes export-ignore | ||
| /.github/FUNDING.yml export-ignore | ||
| /.vortex export-ignore | ||
| /.vortex export-ignore | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,40 @@ | ||||||||||||||||||||||||||||||||||||||||
| <?php | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| declare(strict_types=1); | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| namespace DrevOps\VortexInstaller\Prompts\Handlers; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| class AiCodeInstructions extends AbstractHandler { | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| const NONE = 'none'; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| const CLAUDE = 'claude'; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||
| * {@inheritdoc} | ||||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||||
| public function discover(): null|string|bool|array { | ||||||||||||||||||||||||||||||||||||||||
| if (!$this->isInstalled()) { | ||||||||||||||||||||||||||||||||||||||||
| return NULL; | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| if (is_readable($this->dstDir . '/CLAUDE.md')) { | ||||||||||||||||||||||||||||||||||||||||
| return self::CLAUDE; | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| return self::NONE; | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||
| * {@inheritdoc} | ||||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||||
| public function process(): void { | ||||||||||||||||||||||||||||||||||||||||
| $v = $this->getResponseAsString(); | ||||||||||||||||||||||||||||||||||||||||
| $t = $this->tmpDir; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| if ($v !== self::CLAUDE) { | ||||||||||||||||||||||||||||||||||||||||
| @unlink($t . '/CLAUDE.md'); | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+31
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Improve error handling and variable naming. The process logic is correct but can be enhanced:
public function process(): void {
- $v = $this->getResponseAsString();
- $t = $this->tmpDir;
+ $response = $this->getResponseAsString();
+ $tmpDir = $this->tmpDir;
- if ($v !== self::CLAUDE) {
- @unlink($t . '/CLAUDE.md');
+ if ($response !== self::CLAUDE) {
+ $file = $tmpDir . '/CLAUDE.md';
+ if (file_exists($file)) {
+ unlink($file);
+ }
}
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Add class-level documentation
The class lacks a docblock describing its purpose and functionality. Consider adding documentation explaining that this handler manages AI code assistant instruction preferences.
📝 Committable suggestion
🤖 Prompt for AI Agents