-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Configure proper nx mcp and make AGENTS.md less verbose #34154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| --- | ||
| name: sandbox-rebuild | ||
| description: Propagate local source changes from a Storybook package into an existing sandbox — without regenerating the sandbox from scratch. | ||
| --- | ||
|
|
||
| ## When to use | ||
|
|
||
| Use this skill after editing source files in any `code/` package when you want to test the change in a running sandbox Storybook. This is faster than a full `yarn nx sandbox` regeneration. | ||
|
|
||
| ## Steps | ||
|
|
||
| Follow these steps **in order**. Do not skip any step, especially step 3. | ||
|
|
||
| ### 1. Compile the changed package | ||
|
|
||
| ```bash | ||
| yarn nx compile <package-name> | ||
| ``` | ||
|
|
||
| Run from the repo root (`/Users/valentinpalkovic/Projects/storybook`). Replace `<package-name>` with the NX project name (e.g. `builder-vite`, `core`, `react-vite`). | ||
|
|
||
| ### 2. Copy the compiled `dist/` into the sandbox | ||
|
|
||
| ```bash | ||
| /bin/cp -R code/<path-to-package>/dist/ ../storybook-sandboxes/<sandbox-dir>/node_modules/<npm-package-name>/dist/ | ||
| ``` | ||
|
|
||
| Always use `/bin/cp` (not bare `cp`) to avoid shell alias prompts that block execution. | ||
|
|
||
|
Comment on lines
+28
to
+29
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make The current wording implies Also applies to: 49-50 🤖 Prompt for AI Agents |
||
| **Common package mappings:** | ||
|
|
||
| | NX project name | Code path | npm package name | | ||
| | -------------------- | -------------------------------- | ------------------------------- | | ||
| | `builder-vite` | `code/builders/builder-vite` | `@storybook/builder-vite` | | ||
| | `builder-webpack5` | `code/builders/builder-webpack5` | `@storybook/builder-webpack5` | | ||
| | `core` | `code/core` | `storybook` | | ||
| | `react-vite` | `code/frameworks/react-vite` | `@storybook/react-vite` | | ||
| | `react-webpack5` | `code/frameworks/react-webpack5` | `@storybook/react-webpack5` | | ||
| | `react` | `code/renderers/react` | `@storybook/react` | | ||
| | `addon-essentials` | `code/addons/essentials` | `@storybook/addon-essentials` | | ||
| | `addon-interactions` | `code/addons/interactions` | `@storybook/addon-interactions` | | ||
| | `addon-vitest` | `code/addons/vitest` | `@storybook/addon-vitest` | | ||
|
|
||
| **Sandbox directory name** is the template name with `/` replaced by `-` (e.g. `react-vite/default-ts` → `react-vite-default-ts`). | ||
|
|
||
| ### 3. ⚠️ Delete the sandbox cache (MANDATORY) | ||
|
|
||
| ```bash | ||
| /bin/rm -rf ../storybook-sandboxes/<sandbox-dir>/node_modules/.cache | ||
| ``` | ||
|
|
||
| This step is **required** after every dist copy. Skipping it means Vite will serve stale cached output and the change will not be visible. | ||
|
|
||
| ### 4. Restart Storybook | ||
|
|
||
| Run Storybook directly from the sandbox directory (do **not** use `yarn nx dev` as that re-triggers the full sandbox chain): | ||
|
|
||
| ```bash | ||
| cd ../storybook-sandboxes/<sandbox-dir> && yarn storybook | ||
| ``` | ||
|
|
||
| ## Default sandbox | ||
|
|
||
| If no sandbox is specified, assume `react-vite/default-ts` → `react-vite-default-ts`. | ||
|
|
||
| ## Example | ||
|
|
||
| Rebuild `builder-vite` and update the `react-vite/default-ts` sandbox: | ||
|
|
||
| ```bash | ||
| # 1. Compile | ||
| yarn nx compile builder-vite | ||
|
|
||
| # 2. Copy dist | ||
| /bin/cp -R code/builders/builder-vite/dist/ ../storybook-sandboxes/react-vite-default-ts/node_modules/@storybook/builder-vite/dist/ | ||
|
|
||
| # 3. Clear cache | ||
| /bin/rm -rf ../storybook-sandboxes/react-vite-default-ts/node_modules/.cache | ||
|
|
||
| # 4. Restart | ||
| cd ../storybook-sandboxes/react-vite-default-ts && yarn storybook | ||
| ``` | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| .agents/skills/canary/SKILL.md |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| .agents/skills/github-qa-labels/SKILL.md |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| .agents/skills/pr/SKILL.md |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| .agents/skills/sandbox-rebuild/SKILL.md |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| .agents/skills/storybook-upgrade/SKILL.md |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [mcp_servers."nx-mcp"] | ||
| command = "npx" | ||
| args = ["nx", "mcp", "--project"] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: From the current Nx docs,
Remove unsupported The 🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,8 +3,8 @@ | |
| "nx": { | ||
| "command": "npx", | ||
| "args": [ | ||
| "-y", | ||
| "nx-mcp@latest" | ||
| "nx", | ||
| "mcp" | ||
| ] | ||
| }, | ||
| "wallaby": { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,4 +75,4 @@ code/core/report | |
|
|
||
| .junie | ||
| CLAUDE.local.md | ||
| .claude | ||
| .claude/settings.local.json | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,9 @@ | ||
| { | ||
| "mcpServers": { | ||
| "nx": { | ||
| "nx-mcp": { | ||
| "type": "stdio", | ||
| "command": "npx", | ||
| "args": ["-y", "nx-mcp@latest"] | ||
| "args": ["nx", "mcp"] | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ | |
| "nx": { | ||
| "type": "stdio", | ||
| "command": "npx", | ||
| "args": ["-y", "nx-mcp@latest"] | ||
| "args": ["nx", "mcp"] | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove machine-specific absolute path from instructions.
/Users/valentinpalkovic/Projects/storybookmakes the skill non-portable. Please switch to a generic instruction like “run from the repository root” and avoid user-local paths.🤖 Prompt for AI Agents