Add AI coding skills prompt to cli-config schematic with agent selection#1502
Add AI coding skills prompt to cli-config schematic with agent selection#1502
Conversation
Co-authored-by: zdrawku <11193764+zdrawku@users.noreply.github.com>
- Add schema.json with addAISkills boolean option (default: true, with x-prompt) - Update collection.json to reference cli-config schema - Implement addAISkillsFiles() that fetches content from remote URL and creates .github/copilot-instructions.md and CLAUDE.md - Skip creation if files already exist (log info message) - Handle fetch failures gracefully (log warning) - Add 6 unit tests covering opt-in, opt-out, default behavior, existing file preservation, and fetch failure - Update .gitignore to exclude *.d.ts build artifacts from packages Co-authored-by: zdrawku <11193764+zdrawku@users.noreply.github.com>
Co-authored-by: zdrawku <11193764+zdrawku@users.noreply.github.com>
|
@copilot I have changed entirely the instructions in the issue, plase discard these changes and start a new implementation based on the new issue description: OverviewExtend the Background
Requirements
Acceptance Criteria
References
|
Discard URL-based fetch approach in favor of new requirements: - Copy skill files from node_modules/igniteui-angular/skills/ - Support agent selection (Copilot, Claude, Cursor, Custom path) - Multi-select prompt for target agents Co-authored-by: zdrawku <11193764+zdrawku@users.noreply.github.com>
New implementation based on updated requirements: - schema.json with addAISkills boolean, aiSkillsTargets multi-select (copilot, claude, cursor, custom), and aiSkillsCustomPath - Copy skill files from node_modules/igniteui-angular/skills/ - Agent-specific destinations: Copilot→.github/, Claude→CLAUDE.md, Cursor→.cursor/skills/, Custom→user-specified path - Skip existing files with informational logging - 12 new unit tests covering all agent targets, opt-in/out, existing file preservation, custom path, multi-target, and FEED_ANGULAR - Update .gitignore for *.d.ts build artifacts Co-authored-by: zdrawku <11193764+zdrawku@users.noreply.github.com>
…illsFiles Co-authored-by: zdrawku <11193764+zdrawku@users.noreply.github.com>
... Discarded the previous URL-fetch implementation and reimplemented based on your updated requirements in
The companion change in igniteui-angular will need:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: zdrawku <11193764+zdrawku@users.noreply.github.com>
|
Besides:
Shouldn't we have a forth option for general .agents?
I guess the whole AGENTS.md and .agents/ directory will become standard at some point? |
@copilot can you address that, we should add an option for general .agents also (.agents/skills/ - for other Agents) |
Add "agents" as a new agent target that maps to .agents/skills/ directory, alongside copilot, claude, cursor, and custom options. Includes tests for agents target and existing file preservation. Co-authored-by: zdrawku <11193764+zdrawku@users.noreply.github.com>
Added
Tests added for the new target and existing file preservation. |
There was a problem hiding this comment.
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 add schematic as well, since those will be passed here.
There was a problem hiding this comment.
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.
Angular's x-prompt in schema.json does not support conditional/dependent prompts. All properties with x-prompt are 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.json spec has no built-in mechanism for conditional prompts (no if/when/dependsOn support). To make prompts conditional, the logic would need to move into the schematic's TypeScript code itself — for example, by removing the x-prompt from aiSkillsTargets and aiSkillsCustomPath in the schema and instead using programmatic prompting (e.g., via @angular-devkit/schematics's SchematicContext or a custom prompt library) inside the index.ts rule function, only when addAISkills is true.
That said, the current implementation guards the actual file operations: even if all prompts fire, no files are written unless addAISkills !== false AND aiSkillsTargets has selections. So the behavior is correct, just the UX is suboptimal with extra prompts shown unnecessarily.
Yeah, the standard for that is bullsh- (╯°□°)╯︵ ┻━┻ |



Extends the
cli-configschematic to optionally scaffold AI coding assistant instruction files into the user's project duringng add, copying skill files fromnode_modules/igniteui-angular/skills/to agent-specific destinations based on user selection.Changes
cli-config/schema.json— New schema with:addAISkillsboolean (default: true,x-promptfor interactive confirmation)aiSkillsTargetsmulti-select array for agent selection (Copilot, Claude, Cursor, VS Code Agents, Custom path)aiSkillsCustomPathstring for user-specified custom destinationcollection.json— Wire schema to cli-config schematic entrycli-config/index.ts:CliConfigOptionsinterface withaddAISkills,aiSkillsTargets,aiSkillsCustomPath.github/copilot-instructions.md, Claude →CLAUDE.md, Cursor →.cursor/skills/, VS Code Agents →.agents/skills/, Custom → user-specified pathcopySkillFile()copies from source to destination, skips existing files with informational loggingaddAISkillsFiles()reads all files fromnode_modules/igniteui-angular/skills/and copies to each selected agent's destinationCliConfigOptions; AI skills rule included whenaddAISkillsis notfalseand targets are providedcli-config/index_spec.ts— 14 new tests: each agent target (copilot, claude, cursor, agents), multi-target, custom path, custom path missing, opt-in, opt-out, existing file preservation (copilot, claude, cursor, agents), FEED_ANGULAR package support.gitignore— Exclude*.d.tsbuild artifacts from packagesCompanion change needed
The igniteui-angular repo needs:
addAISkills,aiSkillsTargets, andaiSkillsCustomPathproperties added to itsng-add/schema.jsonto surface the prompts and pass through to this schematicskills/directory in the packageOriginal prompt
This section details on the original issue you should resolve
<issue_title>Prompt to add AI coding assistant instructions (copilot-instructions.md / CLAUDE.md) during ng add</issue_title>
<issue_description>### Overview
Extend the
ng add igniteui-angularschematic to optionally scaffold AI coding assistant instruction files into the user's project. During installation, the schematic should prompt the user: "Would you like to add AI coding skills for your IDE?" and upon confirmation, write the appropriate instruction files to the project root. This leverages the natural Angularng addworkflow to give new users zero-friction access to AI-assisted development with Ignite UI for Angular.Background
igniteui-angularpackage already has anng-addschematic that currently handles dependency installation, CSS reset setup, and optional HammerJS configuration viaschema.jsonprompts..github/copilot-instructions.mdinigniteui-angularalready contains comprehensive Ignite UI / Angular coding best practices, examples, and style guidance that AI agents (GitHub Copilot, Claude, etc.) consume automatically when present in a project.Requirements
Add a new prompt to the
ng-addschema:Add an
addAISkills(or similar) boolean property with anx-promptinschema.json:Write AI instruction files to the user's project when confirmed:
.github/copilot-instructions.md— for GitHub CopilotCLAUDE.md— for Anthropic Claude / Claude Codehttps://raw.githubusercontent.com/IgniteUI/igniteui-angular/main/.github/copilot-instructions.md) at install time.Do not overwrite existing files:
If
.github/copilot-instructions.mdorCLAUDE.mdalready exist in the target project, skip writing (or merge/append) and log an informational message.Ensure
.github/directory is created if it doesn't already exist when writingcopilot-instructions.md.Unit tests:
index.spec.tsusingSchematicTestRunner,UnitTestTree).More info for Copilot:
Acceptance Criteria
ng add igniteui-angularprompts the user: "Would you like to add AI coding skills for your IDE?".github/copilot-instructions.mdandCLAUDE.mdare written to the project root with Ignite UI for Angular–specific AI instructions.trueto encourage adoption (orfalseif the team prefers opt-in).UX Flow
References
ng-addschematic:projects/igniteui-angular/schematics/ng-add/.github/copilot-instructions.mdpackages/ng-schematics/src/collection.json</issue_description><agent_instructions>Follow the issue description fo...
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.