Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fd89fe4

Browse files
committed
refactor(@angular/cli): rewrite best-practices MCP tool description for clarity
The description for the `onpush-zoneless-migration` MCP tool is rewritten to use a structured format with `<Purpose>`, `<Use Cases>`, and `<Operational Notes>` tags.
1 parent eb93e31 commit fd89fe4

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

‎packages/angular/cli/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.ts

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,33 @@ import { createSourceFile, getImportSpecifier } from './ts_utils';
2323
export const ZONELESS_MIGRATION_TOOL = declareTool({
2424
name: 'onpush-zoneless-migration',
2525
title: 'Plan migration to OnPush and/or zoneless',
26-
description:
27-
'**Required tool for migrating Angular components to OnPush change detection or zoneless.**' +
28-
' This tool orchestrates the entire migration process, including running prerequisite migrations' +
29-
' for signal inputs and queries. Use this tool as the first step before making any manual changes' +
30-
' to adopt `ChangeDetectionStrategy.OnPush` or `provideZonelessChangeDetection`.',
26+
description: `
27+
<Purpose>
28+
Analyzes Angular code and provides a step-by-step, iterative plan to migrate it to \`OnPush\`
29+
change detection, a prerequisite for a zoneless application. This tool identifies the next single
30+
most important action to take in the migration journey.
31+
</Purpose>
32+
<Use Cases>
33+
* **Step-by-Step Migration:** Running the tool repeatedly to get the next instruction for a full
34+
migration to \`OnPush\`.
35+
* **Pre-Migration Analysis:** Checking a component or directory for unsupported \`NgZone\` APIs that
36+
would block a zoneless migration.
37+
* **Generating Component Migrations:** Getting the exact instructions for converting a single
38+
component from the default change detection strategy to \`OnPush\`.
39+
</Use Cases>
40+
<Operational Notes>
41+
* **Execution Model:** This tool **DOES NOT** modify code. It **PROVIDES INSTRUCTIONS** for a
42+
single action at a time. You **MUST** apply the changes it suggests, and then run the tool
43+
again to get the next step.
44+
* **Iterative Process:** The migration process is iterative. You must call this tool repeatedly,
45+
applying the suggested fix after each call, until the tool indicates that no more actions are
46+
needed.
47+
* **Relationship to \`modernize\`:** This tool is the specialized starting point for the zoneless/OnPush
48+
migration. For other migrations (like signal inputs), you should use the \`modernize\` tool first,
49+
as the zoneless migration may depend on them as prerequisites.
50+
* **Input:** The tool can operate on either a single file or an entire directory. Provide the
51+
absolute path.
52+
</Operational Notes>`,
3153
isReadOnly: true,
3254
isLocalOnly: true,
3355
inputSchema: {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /