Skip to content

Commit aa62dd4

Browse files
authored
Merge pull request #4 from storybookjs/improve-ui-instructions
Improve UI Instructions, run more often, link more often
2 parents 4002b9e + 3ee6f84 commit aa62dd4

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/tools/get-ui-building-instructions.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
22
import { GET_STORY_URLS_TOOL_NAME } from "./get-story-urls";
33

44
const INSTRUCTIONS = `
5-
# Writing User Interfaces
5+
# Writing User Interfaces Components
66
7-
When writing UI, prefer breaking larger components up into smaller parts.
7+
When writing UI components, prefer breaking larger components up into smaller parts.
88
99
ALWAYS write a Storybook story for any component written. If editing a component, ensure appropriate changes have been made to stories for that component.
1010
@@ -31,20 +31,23 @@ const INSTRUCTIONS = `
3131
};
3232
\`\`\`
3333
34-
ALWAYS provide story links after any modification to stories files, including updates to existing stories.
35-
Even later in a session when modifying stories that have already been linked to previously.
36-
Use the ${GET_STORY_URLS_TOOL_NAME} tool and provide links in the format \`[Story Name](<story_url_from_tool>)\`
34+
ALWAYS provide story links after any changes to stories files, including changes to existing stories.
35+
After changing any UI components, ALWAYS search for related stories that might cover the changes you've made.
36+
If you find any, provide the story links to the user. THIS IS VERY IMPORTANT, as it allows the user
37+
to visually inspect the modifications you've made.
38+
Even later in a session when changing UI components or stories that have already been linked to previously, YOU MUST PROVIDE THE LINKS AGAIN.
39+
Use the ${GET_STORY_URLS_TOOL_NAME} tool /and provide links in the format \`[Story Name](<story_url_from_tool>)\`
3740
whenever you create, modify, or update any story file.
3841
`;
3942

4043
export function registerUIBuildingTool(server: McpServer) {
4144
server.registerTool(
4245
"get_ui_building_instructions",
4346
{
44-
title: "UI Building Instructions",
45-
description: `Instructions on how to do UI development.
47+
title: "UI Component Building Instructions",
48+
description: `Instructions on how to do UI component development.
4649
47-
ALWAYS call this tool before doing any UI/frontend/React development, including but not
50+
ALWAYS call this tool before doing any UI/frontend/React/component development, including but not
4851
limited to adding or updating new components, pages, screens or layouts.`,
4952
inputSchema: {},
5053
},

0 commit comments

Comments
 (0)