用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/mastra-ai/mastra --skill smoke-test命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Triage a Factory work item's issue — trace history, understand architecture, diagnose root cause, then advance the stage
Review open mastra-ai/mastra GitHub issues, identify direct @mastra/core bugs, and apply the @mastra/core label. Use when auditing issues for core ownership, labeling direct core bugs, or periodically reconciling the @mastra/core issue label.
Re-review a pull request after a push — reconcile the previous review against the new commits, look for new defects the push introduced, then a fresh pass over the whole PR, and finish with a verdict on the PR
正在显示 SKILL.md
| 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> --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.
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 | Use the package-manager-specific command from Step 1 in <directory> |
| Install Deps | Automatic during creation |
| Set Env Vars | Check global env first, then .env, ask user only if needed |
| Start Server | cd <directory>/<name> && <pm> 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 |
--empty or --template <template> only when a different starting point is required--llm, --no-git, --timeout) so creation stays non-interactive; use the package-manager-specific initializer help command documented in Step 1 instead of assuming legacy flags