Skip to content

feat(@angular-devkit/schematics): add schematics to generate ai context files. #30763

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JeanMeche
Copy link
Member

@JeanMeche JeanMeche commented Jul 22, 2025

  • ng generate config ai to prompt support tools.
  • ng generate config ai --tool=gemini to specify the tool.
  • ng new --ai-config=gemini`

Supported ai tools: gemini, claude, copilot, windsurf, cursor.

@JeanMeche JeanMeche force-pushed the generate-ai-file branch 2 times, most recently from 70ae7ec to 288dcfd Compare July 22, 2025 16:53
throw new SchematicsException(`Project name "${options.project}" doesn't not exist.`);
}

// Keep this file in sync with the one presented here https://angular.dev/ai/develop-with-ai
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should do something automatted or document it on the FW side, since when there is a change there, a PR needs to be opened here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's handle that as a follow-up when we have a better picture what we need to sync (we might have multiple schematics).

@JeanMeche JeanMeche marked this pull request as ready for review July 29, 2025 13:36
@dgp1130 dgp1130 added action: review The PR is still awaiting reviews from at least one requested reviewer target: minor This PR is targeted for the next minor release labels Jul 31, 2025
@dgp1130 dgp1130 requested a review from clydin July 31, 2025 04:16
@JeanMeche JeanMeche force-pushed the generate-ai-file branch 2 times, most recently from 3dc7023 to 5ae2b77 Compare August 1, 2025 12:11
@JeanMeche JeanMeche removed the request for review from AndrewKushnir August 1, 2025 12:12
"x-prompt": "Which type of configuration file would you like to create?",
"$default": {
"$source": "argv",
"index": 0
}
},
"tool": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a multi-select prompt?
We could still default to having them all selected. Would need to change the type to a string array though. But it's probably unlikely that everyone would want all available tools when not specifying the option. Especially since the option may not be known to even exist.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentionned by @alan-agius4 here, the prompt would show for the others options. Or do you have an alternative in mind ?

@JeanMeche JeanMeche force-pushed the generate-ai-file branch 2 times, most recently from 048a5d7 to 19858e9 Compare August 4, 2025 14:16
Comment on lines +112 to +113
expect(files).toContain('/bar/.gemini/GEMINI.md');
expect(tree.readContent('/bar/.gemini/GEMINI.md')).toMatch(/^You are an expert in TypeScript/);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dgp1130 Is this the location we would want or the workspace root ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think bar is the workspace root in this context and is probably right, unless @clydin sees something off.

const configOptions: ConfigOptions = {
project: options.name,
type: ConfigType.Ai,
tool: options.aiConfig as unknown as AiTool,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why I couldn't get the enums to match. It works fine for the packageManager above for example. (Yes I also tried with removing "none" from the enum here in ng-new).

…xt files.

* `ng generate config ai` to prompt support tools.
* `ng generate config ai --tool=gemini` to specify the tool.

Supported ai tools: gemini, claude, copilot, windsurf, cursor.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: review The PR is still awaiting reviews from at least one requested reviewer area: @angular-devkit/schematics detected: feature PR contains a feature commit target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants