-
Notifications
You must be signed in to change notification settings - Fork 8
Add AI coding skills prompt to cli-config schematic with conditional agent selection #1502
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
Open
Copilot
wants to merge
27
commits into
master
Choose a base branch
from
copilot/add-ai-coding-instructions
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
e1b6a03
Initial plan
Copilot 53f2a41
Initial plan for adding AI coding skills prompt to ng-add schematic
Copilot d85905e
Add AI coding skills prompt to cli-config schematic
Copilot 7d653a5
Improve error logging in fetchSkillContent
Copilot 9d2c441
Revert previous implementation per updated requirements
Copilot 7e585b9
Implement AI skills with agent selection from node_modules
Copilot 56be65b
Address code review: improve null safety in copySkillFile and addAISk…
Copilot c294c77
Remove tracked d.ts build artifact
Copilot 2dd0a82
Add .agents/skills/ option for VS Code Agents
Copilot 9c8e4b2
Switch to InquirerWrapper-based prompting and revert yarn.lock
Copilot cd601c0
Extract AGENT_CHOICES constant and use robust label-to-key mapping
Copilot 53e73f5
Merge branch 'master' of https://github.com/IgniteUI/igniteui-cli int…
Marina-L-Stoyanova fa67f32
feat: add AI skills integration to project setup
Marina-L-Stoyanova b9967bd
fix: remove unused webcomponents package from upgradeable packages an…
Marina-L-Stoyanova c6c401d
fix(PackageManager): improve stdio handling during package installati…
Marina-L-Stoyanova 189cef8
fix(PackageManager): simplify stdio handling in npm install calls
Marina-L-Stoyanova 16dd25b
Potential fix for pull request finding
Marina-L-Stoyanova cd6cc33
feat: implement ScopedTree utility and refactor skill file handling i…
Marina-L-Stoyanova f966f2e
Merge branch 'copilot/add-ai-coding-instructions' of https://github.c…
Marina-L-Stoyanova 3f44921
Potential fix for pull request finding
Marina-L-Stoyanova d2eb93f
Merge remote-tracking branch 'origin/master' into copilot/add-ai-codi…
damyanpetev 9dfe26a
fix(): address comments
Marina-L-Stoyanova 7469211
Merge branch 'copilot/add-ai-coding-instructions' of https://github.c…
Marina-L-Stoyanova bc8d895
fix: update addAISkills condition and correct package name in tests
Marina-L-Stoyanova 15bb3c2
fix: add directory option to CliConfigOptions interface
Marina-L-Stoyanova 2a8c381
fix: add filter to avoid overwriting existing AI skills files
Marina-L-Stoyanova ff9e6f5
feat: refactor AI skills handling and improve copyAISkillsToProject f…
Marina-L-Stoyanova File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/schema", | ||
| "$id": "igniteui-angular-cli-config", | ||
| "title": "Ignite UI for Angular CLI Config Options Schema", | ||
| "type": "object", | ||
| "properties": { | ||
| "addAISkills": { | ||
| "type": "boolean", | ||
| "description": "Add AI coding skills for your IDE", | ||
| "default": true, | ||
| "x-prompt": "Would you like to add AI coding skills for your IDE?" | ||
| }, | ||
| "aiSkillsTargets": { | ||
| "type": "array", | ||
| "description": "AI agent targets for skill files", | ||
| "items": { | ||
| "type": "string", | ||
| "enum": ["copilot", "claude", "cursor", "agents", "custom"] | ||
| }, | ||
| "x-prompt": { | ||
| "message": "Which AI coding assistant(s) would you like to add skills for?", | ||
| "type": "list", | ||
| "multiselect": true, | ||
| "items": [ | ||
| { "value": "copilot", "label": "GitHub Copilot (.github/copilot-instructions.md)" }, | ||
| { "value": "claude", "label": "Claude (CLAUDE.md)" }, | ||
| { "value": "cursor", "label": "Cursor (.cursor/skills/)" }, | ||
| { "value": "agents", "label": "VS Code Agents (.agents/skills/)" }, | ||
| { "value": "custom", "label": "Add custom path" } | ||
| ] | ||
| } | ||
| }, | ||
| "aiSkillsCustomPath": { | ||
| "type": "string", | ||
| "description": "Custom path for AI skill files", | ||
| "x-prompt": { | ||
| "message": "Enter the custom path for AI skill files:", | ||
| "type": "input" | ||
| } | ||
| } | ||
| }, | ||
| "required": [] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Not sure Angular's pre-defined prompts work like step-by-step without some connection, pretty likely this will prompt all 3 in sequence
addAISkills?
aiSkillsTargets?
aiSkillsCustomPath?
regardless of answers, which is not what we intend, no?
If this works though, might belong on the main
ng addschematic as well, since those will be passed here.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.
Actually, @copilot do you have any information if those prompts will actually depend on each other?
And if this configuration doesn't do it, is there an option that will?
Do not make changes, just provide review information.
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.
Angular's
x-promptinschema.jsondoes not support conditional/dependent prompts. All properties withx-promptare prompted sequentially regardless of previous answers. So yes, the user would be asked all three questions (addAISkills?,aiSkillsTargets?,aiSkillsCustomPath?) in sequence even if they answer "no" to the first one.The Angular schematics
schema.jsonspec has no built-in mechanism for conditional prompts (noif/when/dependsOnsupport). To make prompts conditional, the logic would need to move into the schematic's TypeScript code itself — for example, by removing thex-promptfromaiSkillsTargetsandaiSkillsCustomPathin the schema and instead using programmatic prompting (e.g., via@angular-devkit/schematics'sSchematicContextor a custom prompt library) inside theindex.tsrule function, only whenaddAISkillsistrue.That said, the current implementation guards the actual file operations: even if all prompts fire, no files are written unless
addAISkills !== falseANDaiSkillsTargetshas selections. So the behavior is correct, just the UX is suboptimal with extra prompts shown unnecessarily.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.
In that case, @copilot can you attempt an alternative implementation with the prompt implementation used in the project internally - see the prompting used by the ng-new schematic and the SchematicsPromptSession and getUserInput setup. Make that in a separate PR;
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.
I'm unable to create separate PRs — I can only make changes within this current PR branch. If you'd like me to implement the alternative approach using
SchematicsPromptSessionandgetUserInput(as used by the ng-new schematic) here in this PR instead of the currentx-promptschema approach, I can do that. Otherwise, a separate PR with that alternative would need to be created manually or by re-invoking me on a new branch/issue.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.
@copilot Okay, sure update the implementation in this PR and also please remove the extra changes in .gitignore and yarn.lock
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.
Implemented in
9c8e4b2andcd601c0. The prompting now usesInquirerWrapperwith conditional, step-by-step flow:InquirerWrapper.confirm()— "Would you like to add AI coding skills for your IDE?" (only whenaddAISkillsnot pre-specified)InquirerWrapper.checkbox()— Agent target selection (only whenaiSkillsTargetsnot pre-specified)InquirerWrapper.input()— Custom path input (only when "custom" selected and path not pre-specified)Also removed the
yarn.lockchanges. Kept the single.gitignoreline (/packages/**/*.d.ts) sincetsconfig.jsonhasdeclaration: trueand these build artifacts would otherwise be committed.