-
Notifications
You must be signed in to change notification settings - Fork 8
feat(ai-config): add AI agent skills copy functionality #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
Merged
Merged
Changes from all commits
Commits
Show all changes
47 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 a44105e
feat: implement add-skills command to copy AI coding skills to the pr…
Marina-L-Stoyanova 6323f9a
fix: remove ProjectConfig check from add-skills command handler
Marina-L-Stoyanova 9196837
update: add add-skills schematic to copy AI coding skills to the project
Marina-L-Stoyanova 9ac4215
Merge branch 'master' of https://github.com/IgniteUI/igniteui-cli int…
Marina-L-Stoyanova a3f5051
Merge branch 'master' into copilot/add-ai-coding-instructions
kdinev 3535d83
test: update ng-new schematic tests to include cli-config validation
Marina-L-Stoyanova 9af78b6
Merge branch 'copilot/add-ai-coding-instructions' of https://github.c…
Marina-L-Stoyanova 3c0af57
fix: remove redundant package installation in completeAndRun method
Marina-L-Stoyanova 4ce9572
Merge branch 'master' into copilot/add-ai-coding-instructions
kdinev ae9c6f8
Update packages/ng-schematics/src/ng-new/index_spec.ts
kdinev 43b3293
fix: update expectedCliConfig type and initialize collection to null
Marina-L-Stoyanova 7be137b
Merge branch 'master' into copilot/add-ai-coding-instructions
damyanpetev aa33257
Merge branch 'master' into copilot/add-ai-coding-instructions
damyanpetev 209c805
chore: revert resolve to fs change to origin
damyanpetev 3fb05fe
refactor: roll skill copy under ai-config command
damyanpetev 56915ae
refactor: drop extra config check and copy wrapper
damyanpetev d54b7e8
test: fix
damyanpetev d879d95
chore: cleanup non-functional leftovers
damyanpetev fe299fa
fix: always copy skill files
damyanpetev 48a8bd4
docs: update changelog
damyanpetev 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
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,83 @@ | ||
| import * as path from "path"; | ||
| import { App } from "./App"; | ||
| import { IFileSystem, FS_TOKEN } from "../types/FileSystem"; | ||
| import { ProjectConfig } from "./ProjectConfig"; | ||
| import { Util } from "./Util"; | ||
| import { NPM_ANGULAR, NPM_REACT, resolvePackage, UPGRADEABLE_PACKAGES } from "../update/package-resolve"; | ||
|
|
||
| const CLAUDE_SKILLS_DIR = ".claude/skills"; | ||
|
|
||
| /** | ||
| * Returns the list of 'skills/' directory paths found in installed | ||
| * Ignite UI packages that are relevant to the project's detected framework. | ||
| */ | ||
| function resolveSkillsRoots(): string[] { | ||
| const fs = App.container.get<IFileSystem>(FS_TOKEN); | ||
| const roots: string[] = []; | ||
|
|
||
| let framework: string | null = null; | ||
| try { | ||
| if (ProjectConfig.hasLocalConfig()) { | ||
| framework = ProjectConfig.getConfig().project?.framework?.toLowerCase() ?? null; | ||
| } | ||
| } catch { /* config not readable – fall through to scan all */ } | ||
|
|
||
| const allPkgKeys = Object.keys(UPGRADEABLE_PACKAGES); | ||
| let candidates: string[]; | ||
| if (framework === "angular") { | ||
| candidates = [NPM_ANGULAR]; | ||
| } else if (framework === "react") { | ||
| candidates = [NPM_REACT]; | ||
| } else if (framework === "webcomponents") { | ||
| candidates = allPkgKeys.filter(k => k.startsWith("igniteui-webcomponents")); | ||
| } else { | ||
| candidates = allPkgKeys; | ||
| } | ||
|
|
||
| for (const pkg of candidates) { | ||
| const resolved = resolvePackage(pkg as keyof typeof UPGRADEABLE_PACKAGES); | ||
| const skillsRoot = `node_modules/${resolved}/skills`; | ||
| if (fs.directoryExists(skillsRoot) && !roots.includes(skillsRoot)) { | ||
| roots.push(skillsRoot); | ||
| } | ||
| } | ||
|
|
||
| return roots; | ||
| } | ||
|
|
||
| /** | ||
| * Copies skill files from the installed Ignite UI package(s) into .claude/skills/. | ||
| * Works with both real FS (CLI) and virtual Tree FS (schematics) through IFileSystem. | ||
| */ | ||
| export function copyAISkillsToProject(): "copied" | "no-source" { | ||
| const fs = App.container.get<IFileSystem>(FS_TOKEN); | ||
| const skillsRoots = resolveSkillsRoots(); | ||
|
|
||
| if (!skillsRoots.length) { | ||
| return "no-source"; | ||
| } | ||
|
|
||
| const multiRoot = skillsRoots.length > 1; | ||
| let copied = false; | ||
|
|
||
| for (const skillsRoot of skillsRoots) { | ||
| const rawPaths = fs.glob(skillsRoot, "**/*"); | ||
| const pkgDirName = multiRoot ? path.basename(path.dirname(skillsRoot)) : ""; | ||
|
|
||
| for (const p of rawPaths) { | ||
| // Normalize to posix and strip leading '/' so path.posix.relative works | ||
| // across both FsFileSystem (relative paths) and NgTreeFileSystem (tree-rooted paths) | ||
| const normP = p.replace(/\\/g, "/").replace(/^\//, ""); | ||
| const normRoot = skillsRoot.replace(/\\/g, "/").replace(/^\//, ""); | ||
| const rel = path.posix.relative(normRoot, normP); | ||
| const dest = multiRoot | ||
| ? `${CLAUDE_SKILLS_DIR}/${pkgDirName}/${rel}` | ||
| : `${CLAUDE_SKILLS_DIR}/${rel}`; | ||
|
|
||
| fs.writeFile(dest, fs.readFile(p)); | ||
| Util.log(`${Util.greenCheck()} Created ${dest}`); | ||
| copied = true; | ||
| } | ||
| } | ||
| return copied ? "copied" : "no-source"; | ||
| } | ||
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.