docs/styleguides/GUIDE_QUICKSTART.md
This styleguide covers the "Quickstart" page type found in docs/src/content/en/guides/. A quickstart guide gets the reader from zero to a working result as fast as possible. It focuses on one specific integration or setup scenario (e.g. "Mastra + Next.js") and produces a tangible outcome the reader can see and interact with.
Also read and follow the general STYLEGUIDE.md for tone, readability, and formatting rules that apply to all documentation.
---
title: '$TECHNOLOGY | $CATEGORY'
description: '$VERB with Mastra and $TECHNOLOGY'
---
# $ACTION_ORIENTED_TITLE
One sentence explaining what you'll build and what technologies you'll use. Link to external docs for technologies the reader may not know.
## Before you begin
- Prerequisite 1 (e.g. API key, link to where to get one)
- Prerequisite 2 (e.g. Node.js version)
## Create a new $TECHNOLOGY app (optional)
Brief context sentence.
```bash npm2yarn
npx create-something@latest my-project
```
One sentence explaining what the command did.
## Initialize Mastra
Brief context sentence.
```bash npm2yarn
npx mastra@latest init
```
Explain what was created and which files matter for the next steps.
## $STEP_3
Brief context sentence.
```bash npm2yarn
npm install @mastra/package@latest
```
## $STEP_N
Brief context sentence explaining what this code does.
```typescript title="src/path/to/file.ts"
// Complete, working code the reader can copy
```
One to two sentences explaining the key parts of the code. Focus on the "why" — the reader can see the "what" in the code itself.
## Test your $THING
Numbered steps to verify everything works:
1. Run the app with `npm run dev`
2. Open http://localhost:3000
3. Try doing X. You should see Y
## Next steps
Congratulations message (one sentence).
From here, you can extend the project:
- [Link to deeper docs](/docs/category/page)
- [Link to related guide](/guides/category/page)
- [Link to deployment](/guides/deployment/page)
"$TECHNOLOGY | $CATEGORY" in frontmatter (e.g. "Next.js | Frameworks"). No packages field — quickstarts aren't tied to a single package.title attributes for file paths so the reader knows where to put the code.<Steps> component: Quickstarts use H2 headings as steps, not the <Steps> MDX component. The H2 headings provide better navigation and allow longer content per step.npm2yarn on all install commands: Always add the npm2yarn flag to bash blocks containing npm install or npx commands.See next-js.mdx for the gold-standard implementation of this template.
Key structural elements from that guide:
# Integrate Mastra in your Next.js project ← action-oriented H1
One-sentence summary + technologies used
## Before you begin ← prerequisites
## Create a new Next.js app (optional) ← optional step marked in heading
## Initialize Mastra ← step: setup
## Install AI SDK UI & AI Elements ← step: dependencies
## Create a chat route ← step: backend code
## Create a chat page ← step: frontend code
## Test your agent ← verification
## Next steps ← links forward