Smoke Test Skill
Creates a new Mastra project using
and performs smoke testing of the Mastra Studio in Chrome.
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 |
|---|
| | Parent directory where project will be created | Yes | - |
| | Project name (will be created as subdirectory) | Yes | - |
| | Version tag for create-mastra (e.g., , , ) | Yes | - |
| | Package manager: , , , or | No | |
| | LLM provider: , , , , , | No | |
Examples
sh
# 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
Step 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:
- or : REQUIRED - fail if missing
- or : REQUIRED - fail if missing
- or : REQUIRED - fail if missing
- Apply defaults for optional parameters:
- or : Default to if not provided
- or : Default to if not provided
- Validate values:
- must be one of: , , ,
- must be one of: , , , , ,
- must exist (or will be created)
- should be a valid directory name (no spaces, special chars)
If validation fails: Stop and show usage help with the missing/invalid parameters.
If or is passed: Show this usage information and stop.
Prerequisites
This skill requires the Claude-in-Chrome MCP server for browser automation. Ensure it's configured and running.
Execution Steps
Step 1: Create the Mastra Project
Run the create-mastra command with explicit parameters to avoid interactive prompts:
sh
# 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
- - Set the LLM provider
- - Include example code
Being 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.
Step 2: Verify Project Structure
After creation, verify the project has:
- with mastra dependencies
- exporting a Mastra instance
- file (may need to be created)
Step 2.5: Add Agent Network for Network Mode Testing
To enable Network mode testing, add an agent network configuration:
- Create activity-agent.ts in :
typescript
import { Agent } from '@mastra/core/agent';
import { Memory } from '@mastra/memory';
export const activityAgent = new Agent({
id: 'activity-agent',
name: 'Activity Agent',
instructions: `You are a helpful activity planning assistant that suggests activities based on weather conditions.`,
model: '<provider>/<model>', // e.g., 'openai/gpt-4o'
memory: new Memory(),
});
- Create planner-network.ts in :
typescript
import { Agent } from '@mastra/core/agent';
import { Memory } from '@mastra/memory';
import { weatherAgent } from './weather-agent';
import { activityAgent } from './activity-agent';
export const plannerNetwork = new Agent({
id: 'planner-network',
name: 'Planner Network',
instructions: `You are a coordinator that manages weather and activity agents.`,
model: '<provider>/<model>',
agents: { weatherAgent, activityAgent }, // This makes it a network agent
memory: new Memory(), // Memory is REQUIRED for network agents
});
- Update index.ts to register the new agents:
typescript
import { activityAgent } from './agents/activity-agent';
import { plannerNetwork } from './agents/planner-network';
// In Mastra config:
agents: { weatherAgent, activityAgent, plannerNetwork },
Note: Network mode requires
property (sub-agents) and
(mandatory).
Step 3: Configure Environment Variables
Based on the selected LLM provider, check for the required API key:
| Provider | Required Environment Variable |
|---|
| openai | |
| anthropic | |
| groq | |
| google | GOOGLE_GENERATIVE_AI_API_KEY
|
| cerebras | |
| mistral | |
Check in this order:
-
Check global environment first: Run
to see if the key is already set globally
- If set globally, the project will inherit it - no file needed
- Skip to Step 4
-
Check project file: If not set globally, check if
exists in the project and contains the key
-
Ask user only if needed: If the key is not available globally or in
:
- Ask the user for the API key
- Create the file 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:
sh
cd <directory>/<project-name>
<packageManager> run dev
The server typically starts on
. 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
- Create a new tab using
- Navigate to
5.2 Test Checklist
Perform the following smoke tests using the Chrome automation tools:
Navigation & Basic Loading
Agent Chat
Network Mode (
/agents/planner-network/chat
)
Workflow Execution (
/workflows/weatherWorkflow
)
Scorer Detail (use direct URL navigation)
Additional Pages (verify load only)
5.3 Report Results
After completing all tests, provide a summary:
- Total tests passed/failed
- Any errors encountered
- Screenshots captured
- Recommendations for issues found
Quick Reference
| 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 , ask user only if needed |
| Start Server | cd <directory>/<name> && npm run dev
|
| Studio URL | |
Troubleshooting
Server won't start
- Verify has required API key
- Check if port 4111 is available
- Try to reinstall dependencies
Browser can't connect
- Wait a few seconds for server to fully start
- Check terminal for server ready message
- Verify no firewall blocking localhost
Agent chat fails
- Verify API key is valid
- Check server logs for errors
- Ensure LLM provider API is accessible
Studio Routes
| Feature | Route |
|---|
| Agents | |
| Workflows | |
| Tools | |
| Scorers | |
| Observability | |
| MCP Servers | |
| Processors | |
| Templates | |
| Request Context | |
| Settings | |
Notes
- The flag includes example agents, making smoke testing meaningful
- If the user doesn't specify an LLM provider, default to OpenAI as it's most common
- Take screenshots at each major step for documentation/debugging
- Keep the dev server running in the background during testing
- Always use explicit flags (, , ) to ensure non-interactive execution
- Network mode requires the property AND in the Agent constructor
- Scorer detail pages may have issues with browser automation but work manually
- Observability traces appear automatically after running agents or workflows