Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .agents/skills/canary/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: canary
description: Triggers a canary release for a Storybook PR. Use when the user wants to publish a canary version, create a pre-release, or test a PR via npm.
allowed-tools: Bash
---

# Publish Canary Release
Expand Down
1 change: 0 additions & 1 deletion .agents/skills/github-qa-labels/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: github-qa-labels
description: Label GitHub issues and PRs found during QA testing. Use when organizing QA findings with proper labels.
allowed-tools: Bash
---

# GitHub QA Labels
Expand Down
1 change: 0 additions & 1 deletion .agents/skills/pr/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: pr
description: Creates a pull request following Storybook conventions. Use when creating PRs, opening pull requests, or submitting changes for review.
allowed-tools: Bash, Read
---

# Create Pull Request
Expand Down
82 changes: 82 additions & 0 deletions .agents/skills/sandbox-rebuild/SKILL.md
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`).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove machine-specific absolute path from instructions.

/Users/valentinpalkovic/Projects/storybook makes 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
Verify each finding against the current code and only fix it if needed.

In @.agents/skills/sandbox-rebuild/SKILL.md at line 20, The instruction text in
SKILL.md currently contains a machine-specific absolute path
("/Users/valentinpalkovic/Projects/storybook"); replace that path with a generic
phrase such as "run from the repository root" and keep the existing placeholder
guidance for "<package-name>" (examples: "builder-vite", "core", "react-vite")
so the line reads something like: run from the repository root and replace
"<package-name>" with the NX project name — this removes the user-local path and
makes the skill portable.


### 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Make /bin/* guidance explicitly POSIX-only and add a Windows fallback.

The current wording implies /bin/cp and /bin/rm are universal, but these paths are not available in typical Windows shells. Please scope this to Linux/macOS shells and add Windows-safe alternatives.

Also applies to: 49-50

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/skills/sandbox-rebuild/SKILL.md around lines 28 - 29, Update the
guidance text that currently recommends using “/bin/cp” and “/bin/rm” so it
explicitly states those paths are POSIX-only (Linux/macOS shells) and will not
exist on Windows, and add Windows-safe alternatives: for cmd.exe use “copy” and
“del”, for PowerShell use “Copy-Item” and “Remove-Item”, or recommend using
cross-platform tooling (e.g., Node fs, rsync, or a platform-aware script) as a
fallback; change the literal occurrences of “/bin/cp” and “/bin/rm” and the
adjacent guidance lines to reflect this POSIX-only note plus the Windows
alternatives.

**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
```
1 change: 0 additions & 1 deletion .agents/skills/storybook-upgrade/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: storybook-upgrade
description: Upgrade Storybook to a specific version (canary or release). Use this when upgrading Storybook packages in an external app, reproduction, or test project.
allowed-tools: Bash
---

# Storybook Upgrade
Expand Down
1 change: 0 additions & 1 deletion .claude/skills/canary/SKILL.md

This file was deleted.

1 change: 1 addition & 0 deletions .claude/skills/canary/SKILL.md
1 change: 0 additions & 1 deletion .claude/skills/github-qa-labels/SKILL.md

This file was deleted.

1 change: 1 addition & 0 deletions .claude/skills/github-qa-labels/SKILL.md
1 change: 0 additions & 1 deletion .claude/skills/pr/SKILL.md

This file was deleted.

1 change: 1 addition & 0 deletions .claude/skills/pr/SKILL.md
1 change: 1 addition & 0 deletions .claude/skills/sandbox-rebuild/SKILL.md
1 change: 0 additions & 1 deletion .claude/skills/storybook-upgrade/SKILL.md

This file was deleted.

1 change: 1 addition & 0 deletions .claude/skills/storybook-upgrade/SKILL.md
3 changes: 3 additions & 0 deletions .codex/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[mcp_servers."nx-mcp"]
command = "npx"
args = ["nx", "mcp", "--project"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

What are the valid CLI options for nx mcpin current Nx docs, and does--project require an explicit value?

💡 Result:

From the current Nx docs, nx mcp supports these CLI options: [workspacePath] (alias -w), --transport <type>, --port <port> (alias -p), --tools <patterns...> (alias -t), --minimal / --no-minimal, --disableTelemetry, --debugLogs, and --help. [1]

--project is not a valid option for nx mcp in the current docs, so it doesn’t “require a value” — it’s simply unsupported for this command. [1]


Remove unsupported --project flag from nx mcp invocation.

The --project flag is not a valid option for nx mcp according to Nx documentation. This configuration will fail at startup. Remove --project to match the other MCP configs in this PR, leaving just ["nx", "mcp"].

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.codex/config.toml at line 3, Update the args array so the nx mcp invocation
does not include the unsupported flag: remove the "--project" token from the
args value (currently args = ["nx", "mcp", "--project"]) and leave it as ["nx",
"mcp"] so the MCP command matches the other configs and will start successfully.

4 changes: 2 additions & 2 deletions .cursor/mcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"nx": {
"command": "npx",
"args": [
"-y",
"nx-mcp@latest"
"nx",
"mcp"
]
},
"wallaby": {
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ code/core/report

.junie
CLAUDE.local.md
.claude
.claude/settings.local.json
5 changes: 3 additions & 2 deletions .mcp.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"]
}
}
}
2 changes: 1 addition & 1 deletion .vscode/mcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"nx": {
"type": "stdio",
"command": "npx",
"args": ["-y", "nx-mcp@latest"]
"args": ["nx", "mcp"]
}
}
}
Loading