一键导入
smoke-test
Create a Mastra project using create-mastra and smoke test the studio in Chrome using Chrome MCP server
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create a Mastra project using create-mastra and smoke test the studio in Chrome using Chrome MCP server
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
React performance optimization guidelines from Mastra Engineering. This skill should be used when writing, reviewing, or refactoring React code to ensure optimal performance patterns. Triggers on tasks involving React components, data fetching, bundle optimization, or performance improvements.
Default process for handling open-ended tasks that touch files, the shell, or the web.
Process for answering research questions using the web and saving findings into the workspace.
Smoke test Mastra projects locally or deploy to staging/production. Tests Studio UI, agents, tools, workflows, traces, memory, and more. Supports both local development and cloud deployments.
Documentation guidelines for Mastra. This skill should be used when writing or editing documentation for Mastra. Triggers on tasks involving documentation creation or updates.
Use when breaking a large, complex, messy, or hard-to-review pull request into multiple smaller PRs; planning stacked PRs; extracting independent changes from a branch; splitting mixed refactor and behavior changes; managing drift after review feedback; rebasing follow-up PRs as earlier PRs change; or preserving original branch intent while shipping incrementally.
| name | smoke-test |
| description | Create a Mastra project using create-mastra and smoke test the studio in Chrome using Chrome MCP server |
| model | claude-opus-4-5 |
Creates a new Mastra project using create-mastra@<tag> and performs smoke testing of the Mastra Studio in Chrome.
This skill is for Claude Code with Chrome MCP server. For MastraCode with built-in browser tools, use mastracode-smoke-test instead.
/smoke-test --directory <path> --name <project-name> --tag <version> [--pm <package-manager>] [--llm <provider>]
/smoke-test -d <path> -n <project-name> -t <version> [-p <package-manager>] [-l <provider>]
| Parameter | Short | Description | Required | Default |
|---|---|---|---|---|
--directory | -d | Parent directory where project will be created | Yes | - |
--name | -n | Project name (will be created as subdirectory) | Yes | - |
--tag | -t | Version tag for create-mastra (e.g., latest, alpha, 0.10.6) | Yes | - |
--pm | -p | Package manager: npm, yarn, pnpm, or bun | No | npm |
--llm | -l | LLM provider: openai, anthropic, groq, google, cerebras, mistral | No | openai |
# Minimal (required params only)
/smoke-test -d ~/projects -n my-test-app -t latest
# Full specification
/smoke-test --directory ~/projects --name my-test-app --tag alpha --pm pnpm --llm anthropic
# Using short flags
/smoke-test -d ./projects -n smoke-test-app -t 0.10.6 -p bun -l openai
CRITICAL: Before proceeding, parse the ARGUMENTS and validate:
--directory or -d: REQUIRED - fail if missing--name or -n: REQUIRED - fail if missing--tag or -t: REQUIRED - fail if missing--pm or -p: Default to npm if not provided--llm or -l: Default to openai if not providedpm must be one of: npm, yarn, pnpm, bunllm must be one of: openai, anthropic, groq, google, cerebras, mistraldirectory must exist (or will be created)name should be a valid directory name (no spaces, special chars)If validation fails: Stop and show usage help with the missing/invalid parameters.
If -h or --help is passed: Show this usage information and stop.
This skill requires the Chrome MCP server (Claude-in-Chrome) for browser automation. Ensure it's configured and running.
The Chrome MCP server provides tools like tabs_create_mcp, tabs_context_mcp, navigate_mcp, click_mcp, type_mcp, and screenshot_mcp.
Run the create-mastra command with explicit parameters to avoid interactive prompts:
# For npm
npx create-mastra@<tag> <project-name> -c agents,tools,workflows,scorers -l <llmProvider> -e
# For yarn
yarn create mastra@<tag> <project-name> -c agents,tools,workflows,scorers -l <llmProvider> -e
# For pnpm
pnpm create mastra@<tag> <project-name> -c agents,tools,workflows,scorers -l <llmProvider> -e
# For bun
bunx create-mastra@<tag> <project-name> -c agents,tools,workflows,scorers -l <llmProvider> -e
Flags explained:
-c agents,tools,workflows,scorers - Include all components-l <provider> - Set the LLM provider-e - Include example codeBeing explicit with all parameters ensures the CLI runs non-interactively.
Wait for the installation to complete. This may take 1-2 minutes depending on network speed.
After creation, verify the project has:
package.json with mastra dependenciessrc/mastra/index.ts exporting a Mastra instance.env file (may need to be created)To test browser functionality, add a browser-enabled agent:
<pm> add @mastra/stagehand
# or for deterministic browser automation:
<pm> add @mastra/agent-browser
src/mastra/agents/:import { Agent } from '@mastra/core/agent';
import { Memory } from '@mastra/memory';
import { StagehandBrowser } from '@mastra/stagehand';
export const browserAgent = new Agent({
id: 'browser-agent',
name: 'Browser Agent',
instructions: `You are a helpful assistant that can browse the web to find information.`,
model: '<provider>/<model>', // e.g., 'openai/gpt-4o'
memory: new Memory(),
browser: new StagehandBrowser({
headless: false,
}),
});
import { browserAgent } from './agents/browser-agent';
// In Mastra config:
agents: { weatherAgent, browserAgent },
Based on the selected LLM provider, check for the required API key:
| Provider | Required Environment Variable |
|---|---|
| openai | OPENAI_API_KEY |
| anthropic | ANTHROPIC_API_KEY |
| groq | GROQ_API_KEY |
GOOGLE_GENERATIVE_AI_API_KEY | |
| cerebras | CEREBRAS_API_KEY |
| mistral | MISTRAL_API_KEY |
Check in this order:
Check global environment first: Run echo $<ENV_VAR_NAME> to see if the key is already set globally
.env file neededCheck project .env file: If not set globally, check if .env exists in the project and contains the key
Ask user only if needed: If the key is not available globally or in .env:
.env file with the provided keyOnly check for the ONE key matching the selected provider - don't check for all providers.
Navigate to the project directory and start the dev server:
cd <directory>/<project-name>
<packageManager> run dev
The server typically starts on http://localhost:4111. Wait for the server to be ready before proceeding.
Use the Chrome browser automation tools to test the Mastra Studio.
tabs_context_mcptabs_create_mcphttp://localhost:4111Perform the following smoke tests using the Chrome automation tools:
Navigation & Basic Loading
Agents Page (/agents)
--default)Agent Detail (/agents/<agentId>/chat)
Agent Chat
Browser Agent (/agents/browser-agent/chat) - if browser agent was added
Tools Page (/tools)
Tool Execution (/tools/get-weather)
Workflows Page (/workflows)
Workflow Execution (/workflows/weather-workflow)
Settings Page (/settings)
Observability Page (/observability)
Scorers Page (/evaluation?tab=scorers)
/evaluation?tab=scorers (NOT /scorers - that route doesn't exist)Additional Pages (verify load only)
/templates) - Gallery of starter templates/request-context) - JSON editor/processors) - Empty state OK/mcps) - Empty state OKAfter completing all tests, provide a summary:
| Step | Action |
|---|---|
| Create Project | cd <directory> && npx create-mastra@<tag> <name> -c agents,tools,workflows,scorers -l <provider> -e |
| Install Deps | Automatic during creation |
| Set Env Vars | Check global env first, then .env, ask user only if needed |
| Start Server | cd <directory>/<name> && npm run dev |
| Studio URL | http://localhost:4111 |
Server won't start
.env has required API key<pm> install to reinstall dependenciesBrowser can't connect
Agent chat fails
Browser agent fails
pnpm exec playwright install chromium| Feature | Route |
|---|---|
| Agents | /agents |
| Workflows | /workflows |
| Tools | /tools |
| Evaluation | /evaluation |
| Scorers | /evaluation?tab=scorers |
| Observability | /observability/traces |
| Logs | /observability/logs |
| MCP Servers | /mcps |
| Processors | /processors |
| Templates | /templates |
| Request Context | /request-context |
| Settings | /settings |
-e flag includes example agents, making smoke testing meaningful-c, -l, -e) to ensure non-interactive execution