Skip to content

Commit 1524262

Browse files
committed
refactor(@angular/cli): rewrite best-practices MCP tool description for clarity
The description for the `get_best_practices` MCP tool is rewritten to use a structured format with `<Purpose>`, `<Use Cases>`, and `<Operational Notes>` tags. This change makes the tool's purpose and mandatory nature clearer and more actionable for an AI model, ensuring it understands the importance of adhering to the official Angular Best Practices Guide. (cherry picked from commit 33835d9)
1 parent 44c20a5 commit 1524262

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

packages/angular/cli/src/commands/mcp/tools/best-practices.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,21 @@ import { declareTool } from './tool-registry';
1313
export const BEST_PRACTICES_TOOL = declareTool({
1414
name: 'get_best_practices',
1515
title: 'Get Angular Coding Best Practices Guide',
16-
description:
17-
'You **MUST** use this tool to retrieve the Angular Best Practices Guide ' +
18-
'before any interaction with Angular code (creating, analyzing, modifying). ' +
19-
'It is mandatory to follow this guide to ensure all code adheres to ' +
20-
'modern standards, including standalone components, typed forms, and ' +
21-
'modern control flow. This is the first step for any Angular task.',
16+
description: `
17+
<Purpose>
18+
Retrieves the official Angular Best Practices Guide. This guide contains the essential rules and conventions
19+
that **MUST** be followed for any task involving the creation, analysis, or modification of Angular code.
20+
</Purpose>
21+
<Use Cases>
22+
* As a mandatory first step before writing or modifying any Angular code to ensure adherence to modern standards.
23+
* To learn about key concepts like standalone components, typed forms, and modern control flow syntax (@if, @for, @switch).
24+
* To verify that existing code aligns with current Angular conventions before making changes.
25+
</Use Cases>
26+
<Operational Notes>
27+
* The content of this guide is non-negotiable and reflects the official, up-to-date standards for Angular development.
28+
* You **MUST** internalize and apply the principles from this guide in all subsequent Angular-related tasks.
29+
* Failure to adhere to these best practices will result in suboptimal and outdated code.
30+
</Operational Notes>`,
2231
isReadOnly: true,
2332
isLocalOnly: true,
2433
factory: () => {

0 commit comments

Comments
 (0)