Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/schematics/angular/ai-config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ const AGENTS_MD_CFG: ContextFileInfo = {

const AI_TOOLS: { [key in Exclude<Tool, Tool.None>]: ContextFileInfo[] } = {
['claude-code']: [
AGENTS_MD_CFG,
{
type: ContextFileType.BestPracticesMd,
name: 'CLAUDE.md',
directory: '.',
},
{
type: ContextFileType.McpConfig,
name: '.mcp.json',
Expand Down
10 changes: 5 additions & 5 deletions packages/schematics/angular/ai-config/index_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ describe('AI Config Schematic', () => {
workspaceTree = await schematicRunner.runSchematic('workspace', workspaceOptions);
});

it('should create Angular MCP server config and AGENTS.md for Claude Code', async () => {
it('should create Angular MCP server config and CLAUDE.md for Claude Code', async () => {
const tree = await runAiConfigSchematic([ConfigTool.ClaudeCode]);
expect(tree.exists('AGENTS.md')).toBeTruthy();
expect(tree.exists('CLAUDE.md')).toBeTruthy();
expect(tree.exists('.mcp.json')).toBeTruthy();
});

Expand Down Expand Up @@ -89,17 +89,17 @@ describe('AI Config Schematic', () => {

it('should omit best practices creation, if the file already exists', async () => {
const customContent = 'custom user content';
workspaceTree.create('AGENTS.md', customContent);
workspaceTree.create('CLAUDE.md', customContent);

const messages: string[] = [];
const loggerSubscription = schematicRunner.logger.subscribe((x) => messages.push(x.message));

try {
const tree = await runAiConfigSchematic([ConfigTool.ClaudeCode]);

expect(tree.readContent('AGENTS.md')).toBe(customContent);
expect(tree.readContent('CLAUDE.md')).toBe(customContent);
expect(messages).toContain(
`Skipping configuration file for 'ClaudeCode' at './AGENTS.md' because it already exists.\n` +
`Skipping configuration file for 'ClaudeCode' at './CLAUDE.md' because it already exists.\n` +
'This is to prevent overwriting a potentially customized file. ' +
'If you want to regenerate it with Angular recommended defaults, please delete the existing file and re-run the command.\n' +
'You can review the latest recommendations at https://angular.dev/ai/develop-with-ai.\n',
Expand Down
6 changes: 3 additions & 3 deletions packages/schematics/angular/ai-config/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "Angular AI Config File Options Schema",
"type": "object",
"additionalProperties": false,
"description": "Generates AI configuration files for Angular projects. This schematic creates AGENTS.md file and Angular MCP server configuration, improving the quality of AI-generated code and suggestions.",
"description": "Generates AI configuration files for Angular projects. This schematic creates instruction files (e.g. AGENTS.md, CLAUDE.md) and Angular MCP server configuration, improving the quality of AI-generated code and suggestions.",
"properties": {
"tool": {
"type": "array",
Expand All @@ -20,7 +20,7 @@
},
{
"value": "claude-code",
"label": "Claude Code [ `AGENTS.md` + Angular MCP server config ]"
"label": "Claude Code [ `CLAUDE.md` + Angular MCP server config ]"
},
{
"value": "cursor",
Expand All @@ -40,7 +40,7 @@
}
]
},
"description": "Specifies which AI tools to generate configuration files (AGENTS.md, MCP server config) for.",
"description": "Specifies which AI tools to generate configuration files (AGENTS.md, CLAUDE.md, MCP server config) for.",
"items": {
"type": "string",
"enum": ["none", "claude-code", "cursor", "gemini-cli", "open-ai-codex", "vscode"]
Expand Down
2 changes: 1 addition & 1 deletion packages/schematics/angular/ng-new/index_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ describe('Ng New Schematic', () => {

const tree = await schematicRunner.runSchematic('ng-new', options);
const files = tree.files;
expect(files).toContain('/bar/AGENTS.md');
expect(files).toContain('/bar/CLAUDE.md');
expect(files).toContain('/bar/.mcp.json');
expect(files).toContain('/bar/.gemini/GEMINI.md');
expect(files).toContain('/bar/.gemini/settings.json');
Expand Down