Smoke Test
Create a Mastra project using create-mastra and smoke test the studio in Chrome using Chrome MCP server
- Skill ID
- mastra-ai/mastra/smoke-test
- Publisher
- mastra-ai
- Repository
- mastra
- Installs
- 0
- Files
- 1
- Synced
- Sep 23, 2026
Open any RiverX project, open the Skills panel in the chat, and search for this identifier. The files are fetched from the source repository at install time.
mastra-ai/mastra/smoke-testInstalls these files- SKILL.md
What this skill tells the agent
Smoke Test Skill
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.
Usage
/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>]Parameters
| 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 |
Examples
# 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 openaiStep 0: Parameter Validation (MUST RUN FIRST)
CRITICAL: Before proceeding, parse the ARGUMENTS and validate:
- Parse arguments from the ARGUMENTS string provided above
- Check required parameters:
--directoryor-d: REQUIRED - fail if missing--nameor-n: REQUIRED - fail if missing--tagor-t: REQUIRED - fail if missing
- Apply defaults for optional parameters:
--pmor-p: Default tonpmif not provided--llmor-l: Default toopenaiif not provided
- Validate values:
pmmust be one of:npm,yarn,pnpm,bunllmmust be one of:openai,anthropic,groq,google,cerebras,mistraldirectorymust exist (or will be created)nameshould 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.
Prerequisites
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.
Execution Steps
Step 1: Create the Mastra Project
Run the create-mastra command with explicit parameters to avoid interactive prompts:
# For npm
npx create-mastra@<tag> <project-name> --no-git --llm <llmProvider> --timeout 120000
# For yarn
yarn dlx create-mastra@<tag> <project-name> --no-git --llm <llmProvider> --timeout 120000
# For pnpm
pnpm create mastra@<tag> <project-name> --no-git --llm <llmProvider> --timeout 120000
# For bun
bunx create-mastra@<tag> <project-name> --no-git --llm <llmProvider> --timeout 120000-c/--components and -e/--example were removed and must not be used. -l/--llm is still supported and is the flag used above. Use the managed template by default, --empty for a deliberately empty project, or --template <template> for a specific template. If a flag is rejected, inspect the initializer's help rather than retrying a legacy command: npm create mastra@<tag> -- --help, npx create-mastra@<tag> --help, pnpm create mastra@<tag> --help, yarn dlx create-mastra@<tag> --help, or bunx create-mastra@<tag> --help.
Wait for the installation to complete. This may take 1-2 minutes depending on network speed.
Step 2: Verify Project Structure
After creation, verify the project has:
package.jsonwith mastra dependenciessrc/mastra/index.tsexporting a Mastra instance.envfile (may need to be created)
Step 2.5: Add Browser Agent for Browser Testing
To test browser functionality, add a browser-enabled agent:
- Install browser packages:
<pm> add @mastra/stagehand
# or for deterministic browser automation:
<pm> add @mastra/agent-browser- Create browser-agent.ts in
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,
}),
});- Update index.ts to register the browser agent:
import { browserAgent } from './agents/browser-agent';
// In Mastra config:
agents: { weatherAgent, browserAgent },Step 3: Configure Environment Variables
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
- If set globally, the project will inherit it - no
.envfile needed - Skip to Step 4
- Check project `.env` file: If not set globally, check if
.envexists in the project and contains the key
- Ask user only if needed: If the key is not available globally or in
.env:
- Ask the user for the API key
- Create the
.envfile with the provided key
Only check for the ONE key matching the selected provider - don't check for all providers.
Step 4: Start the Development Server
Navigate to the project directory and start the dev server:
cd <directory>/<project-name>
<packageManager> run devThe server typically starts on http://localhost:4111. Wait for the server to be ready before proceeding.
Step 5: Smoke Test the Studio
Use the Chrome browser automation tools to test the Mastra Studio.
5.1 Initial Setup
- Get browser context using
tabs_context_mcp - Create a new tab using
tabs_create_mcp - Navigate to
http://localhost:4111
5.2 Test Checklist
Perform the following smoke tests using the Chrome automation tools:
Navigation & Basic Loading
- [ ] Studio loads successfully (page contains "Mastra Studio" or shows agents list)
- [ ] Take a screenshot of the home page
Agents Page (/agents)
- [ ] Navigate to agents page
- [ ] Verify at least one agent is listed (the example agent from
--default) - [ ] Take a screenshot
Agent Detail (/agents/<agentId>/chat)
- [ ] Click on an agent to view details
- [ ] Verify the agent overview panel loads
- [ ] Verify model settings panel is visible
- [ ] Take a screenshot
Agent Chat
- [ ] Send a test message to the agent (e.g., "What's the weather in Tokyo?")
- [ ] Wait for response
- [ ] Verify response appears in the chat
- [ ] Take a screenshot of the conversation
Browser Agent (/agents/browser-agent/chat) - if browser agent was added
- [ ] Navigate to the browser-agent
More from mastra-ai
Use this skill in a project
Open any RiverX project, search the Skills panel for mastra-ai/mastra/smoke-test, and install it in one click.
