{"record":{"id":"9f317516b7c465e0","repo":"angular/angular-cli","slug":"skipping-configuration-file-for-toolname-at","errorCode":null,"errorMessage":"Skipping configuration file for '${toolName}' at '${path}' because it already exists.\nThis 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.\nYou can review the latest recommendations at https://angular.dev/ai/develop-with-ai.\n","messagePattern":"Skipping configuration file for '(.+?)' at '(.+?)' because it already exists\\.\nThis 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\\.\nYou can review the latest recommendations at https://angular\\.dev/ai/develop-with-ai\\.\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/schematics/angular/ai-config/file_utils.ts","lineNumber":136,"sourceCode":"  );\n}\n\n/**\n * Create an Angular best practices Markdown.\n * If the file exists, the configuration is skipped.\n */\nexport function addBestPracticesMarkdown({\n  tree,\n  context,\n  fileInfo,\n  tool,\n}: FileConfigurationHandlerOptions): Rule {\n  const { name, directory } = fileInfo;\n  const path = `${directory}/${name}`;\n\n  if (tree.exists(path)) {\n    const toolName = strings.classify(tool);\n    context.logger.warn(\n      `Skipping configuration file for '${toolName}' at '${path}' because it already exists.\\n` +\n        'This is to prevent overwriting a potentially customized file. ' +\n        'If you want to regenerate it with Angular recommended defaults, please delete the existing file and re-run the command.\\n' +\n        'You can review the latest recommendations at https://angular.dev/ai/develop-with-ai.\\n',\n    );\n\n    return noop();\n  }\n\n  return mergeWith(\n    apply(url('./files'), [\n      filter((path) => path.includes('__bestPracticesName__')),\n      applyTemplates({\n        ...strings,\n        bestPracticesName: name,\n      }),\n      move(directory),\n    ]),","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/schematics/angular/ai-config/file_utils.ts#L118-L154","documentation":"A warning from addBestPracticesMarkdown in packages/schematics/angular/ai-config/file_utils.ts. The ai-config schematic generates a best-practices markdown file (AI tool rules file) for the selected tool. If the target file already exists in the tree, the schematic skips generation to avoid overwriting a potentially customized file, logging this warning instead.","triggerScenarios":"Calling the ai-config schematic (via `ng g config ai-config --tool <tool>`) when `tree.exists(path)` is true for `${directory}/${name}` — i.e., the tool's config file (e.g. .windsurfrules, GEMINI.md, .claude rules file) is already present in the target directory.","commonSituations":"Re-running the generator after a prior run; having created the AI rules file manually; scaffolded repo that already ships with the file; running the schematic in an updated workspace after an Angular upgrade.","solutions":["Keep the file if you customized it; no action needed — Angular defaults are skipped intentionally.","Delete the existing file and re-run the command to regenerate with Angular recommended defaults.","Review https://angular.dev/ai/develop-with-ai and merge recommended practices into your existing file manually.","Use a different tool target in the schematic if you intended to generate a file for another tool."],"exampleFix":"# before\n$ ng g config ai-config --tool windsurf\n# Skipping configuration file for 'Windsurf' at '.windsurfrules' ...\n# after\n$ rm .windsurfrules\n$ ng g config ai-config --tool windsurf  # regenerates with defaults","handlingStrategy":"validation","validationCode":"if (!fs.existsSync(path.join(workspaceRoot, toolConfigPath))) {\n  // safe to run the ai-config schematic\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Delete or rename the AI rules file before re-running the generator if you want fresh defaults.","Back up customized AI config files so a re-run doesn't lose your edits.","Merge new Angular recommendations from https://angular.dev/ai/develop-with-ai into your existing file instead of regenerating."],"tags":["angular","schematics","ai-config","file-conflict","idempotency"],"backgroundTag":"config-already-exists","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}