← 返回
未分类

Tutorial Docs

Tutorial patterns for documentation - learning-oriented guides that teach through guided doing. Use when writing a tutorial, learning guide, getting-started...
教程模式——面向学习的指南,通过引导式实践教学。用于编写教程、学习指南、入门指南等。
anderskev anderskev 来源
未分类 clawhub v1.1.3 3 版本 99823.9 Key: 无需
★ 0
Stars
📥 567
下载
💾 2
安装
3
版本
#latest

概述

Tutorial Documentation Skill

This skill provides patterns for writing effective tutorials following the Diataxis framework. Tutorials are learning-oriented content where the reader learns by doing under the guidance of a teacher.

Purpose & Audience

Target readers:

  • Complete beginners with no prior experience
  • Users who want to learn, not accomplish a specific task
  • People who need a successful first experience with the product
  • Learners who benefit from guided, hands-on practice

Tutorials are NOT:

  • How-To guides (which help accomplish specific tasks)
  • Explanations (which provide understanding)
  • Reference docs (which describe the system)

Core Principles (Diataxis Framework)

1. Learn by Doing, Not by Reading

Tutorials teach through action, not explanation. The reader should be doing something at every moment.

AvoidPrefer
---------------
"REST APIs use HTTP methods to...""Run this command to make your first API call:"
"Authentication is important because...""Add your API key to authenticate:"
"The dashboard contains several sections...""Click Create Project in the dashboard."

2. Deliver Visible Results at Every Step

After each action, tell readers exactly what they should see. This confirms success and builds confidence.

Run the development server:

npm run dev


You should see:

> Local: http://localhost:3000

> Ready in 500ms


Open http://localhost:3000 in your browser. You should see a welcome page with "Hello, World!" displayed.

3. One Clear Path, Minimize Choices

Tutorials should not offer alternatives. Pick one way and guide the reader through it completely.

AvoidPrefer
---------------
"You can use npm, yarn, or pnpm...""Install the dependencies:"
"There are several ways to configure...""Create a config file:"
"Optionally, you might want to..."[Omit optional steps entirely]

4. The Teacher Takes Responsibility

If the reader fails, the tutorial failed. Anticipate problems and prevent them. Never blame the reader.

<Warning>
Make sure you're in the project directory before running this command.
If you see "command not found", return to Step 2 to verify the installation.
</Warning>

5. Permit Repetition to Build Confidence

Repeating similar actions in slightly different contexts helps cement learning. Don't try to be efficient.

Tutorial Template

Use this structure for all tutorials:

---
title: "Build your first [thing]"
description: "Learn the basics of [product] by building a working [thing]"
---

# Build Your First [Thing]

In this tutorial, you'll build a [concrete deliverable]. By the end, you'll have a working [thing] that [does something visible].

<Note>
This tutorial takes approximately [X] minutes to complete.
</Note>

## What you'll build

[Screenshot or diagram of the end result]

A [brief description of the concrete deliverable] that:
- [Visible capability 1]
- [Visible capability 2]
- [Visible capability 3]

## Prerequisites

Before starting, make sure you have:

- [Minimal requirement 1 - link to install guide if needed]
- [Minimal requirement 2]

<Tip>
New to [prerequisite]? [Link to external resource] has a quick setup guide.
</Tip>

## Step 1: [Set up your project]

[First action - always start with something that produces visible output]

[command]


You should see:

[expected output]


[Brief confirmation of what this means]

## Step 2: [Create your first thing]

[Next action with clear instruction]

[code to add or modify]


Save the file. You should see [visible change].

<Note>
[Optional tip to prevent common mistakes]
</Note>

## Step 3: [Continue building]

[Continue with more steps, each producing visible output]

## Step 4: [Add the final piece]

[Bring it together with a final step]

You should now see [final visible result].

[Screenshot of completed project]

## What you've learned

In this tutorial, you:

- [Concrete skill 1 - what they can now do]
- [Concrete skill 2]
- [Concrete skill 3]

## Next steps

Now that you have a working [thing], you can:

- **[Tutorial 2 title]** - Continue learning by [next learning goal]
- **[How-to guide]** - Learn how to [specific task] with your [thing]
- **[Concepts page]** - Understand [concept] in more depth

Writing Principles

Title Conventions

  • Start with action outcomes: "Build your first...", "Create a...", "Deploy your..."
  • Focus on what they'll make, not what they'll learn
  • Be concrete: "Build a chat application" not "Learn about real-time messaging"

Step Structure

  1. Lead with the action - don't explain before doing
  2. Show exactly what to type or click - no ambiguity
  3. Confirm success after every step - "You should see..."
  4. Keep steps small - one visible change per step

Managing Prerequisites

Tutorials are for beginners, so minimize prerequisites:

## Prerequisites

- A computer with macOS, Windows, or Linux
- A text editor (we recommend VS Code)
- 15 minutes of time

<Tip>
You don't need any programming experience. This tutorial explains everything as we go.
</Tip>

The "You should see" Pattern

This is the most important pattern in tutorial writing. Use it constantly:

Click **Save**. You should see a green checkmark appear next to the filename.

Run the test:

npm test


You should see:

PASS src/app.test.js

✓ renders welcome message (23ms)

Tests: 1 passed, 1 total

Handling Errors Gracefully

Anticipate failures and guide readers back on track:

<Warning>
If you see "Module not found", make sure you saved the file from Step 2.
Return to Step 2 and verify the import statement matches exactly.
</Warning>

Components for Tutorials

Frame Component for Screenshots

Show what success looks like:

<Frame caption="Your completed dashboard should look like this">
  ![Dashboard screenshot](/images/tutorial-dashboard.png)
</Frame>

Steps Component for Procedures

For numbered sequences within a step:

<Steps>
  <Step title="Open the settings panel">
    Click the gear icon in the top right corner.
  </Step>
  <Step title="Find the API section">
    Scroll down to **Developer Settings**.
  </Step>
  <Step title="Generate a key">
    Click **Create New Key** and copy the value shown.
  </Step>
</Steps>

Callouts for Guidance

<Note>
Don't worry if the colors look different on your screen.
We'll customize the theme in the next step.
</Note>

<Warning>
Make sure to save the file before continuing.
The next step won't work without this change.
</Warning>

<Tip>
You can press Cmd+S (Mac) or Ctrl+S (Windows) to save quickly.
</Tip>

Code with Highlighted Lines

Draw attention to what matters:

function App() {

return (

Hello, World!

Welcome to your first app.

);

}

Example Tutorial

See references/example-weather-api.md for a complete example tutorial demonstrating all principles above. The example builds a weather dashboard that fetches real API data.

Checklist for Tutorials

Before publishing, verify:

  • [ ] Title describes what they'll build, not what they'll learn
  • [ ] Introduction shows the concrete end result
  • [ ] Prerequisites are minimal (beginners don't have much)
  • [ ] Every step produces visible output
  • [ ] "You should see" appears after each significant action
  • [ ] No choices offered - one clear path only
  • [ ] No explanations of why things work (save for docs)
  • [ ] Potential failures are anticipated with recovery guidance
  • [ ] "What you've learned" summarizes concrete skills gained
  • [ ] Next steps guide to continued learning
  • [ ] Pre-publish gates (below) completed in order—not only self-reviewed

Pre-publish gates

Run these in order. Start the next gate only after the previous pass is satisfied.

  1. Draft artifact — The tutorial exists at a concrete path (file, branch, or CMS location). Pass: the artifact opens without guesswork.
  1. Observable outcomesPass: every procedural step states what the reader should see next (command output, UI change, or named file)—not only what to do.
  1. Single pathPass: aside from prerequisite install links, the body does not branch into equivalent alternatives (“npm or yarn…”) unless you split into separate tutorials.
  1. Independent run — Someone who did not write the draft follows the tutorial from a clean starting point. Pass: each step matches its promised outcome; any mismatch is fixed in the doc before publish (see “The Teacher Takes Responsibility” above).

When to Use Tutorial vs Other Doc Types

User's mindsetDoc typeExample
----------------------------------
"I want to learn"Tutorial"Build your first chatbot"
"I want to do X"How-To"How to configure SSO"
"I want to understand"Explanation"How our caching works"
"I need to look up Y"Reference"API endpoint reference"

Tutorial vs How-To: Key Differences

AspectTutorialHow-To
--------------------------
PurposeLearning through doingAccomplishing a specific task
AudienceComplete beginnersUsers with some experience
StructureLinear journey with one pathSteps to achieve a goal
ChoicesNone - one prescribed wayMay show alternatives
ExplanationsMinimal - action over theoryMinimal - focus on steps
SuccessReader learns and gains confidenceReader completes their task
LengthLonger, more hand-holdingShorter, more direct

Related Skills

版本历史

共 3 个版本

  • v1.1.3 当前
    2026-06-01 20:51 安全 安全
  • v1.1.2
    2026-05-03 05:32 安全 安全
  • v1.1.0
    2026-03-31 03:53 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

education

Thinking Partner

itsflow
通过提问探索复杂问题的协作思考伙伴
★ 48 📥 9,869
education

Language Learning Tutor

chipagosfinest
AI语言导师,通过对话、词汇练习、语法课程、抽认卡及沉浸式练习,助您学习任意语言。适用于学习新语言、练词汇、学语法、翻译、会话练习、旅行准备、习语俚语或改善发音。支持包括中、英、日、韩、法、德、西等在内的100多种语言。
★ 28 📥 8,828
dev-programming

Vitest Testing

anderskev
Vitest 测试框架模式与最佳实践。适用于编写单元测试、集成测试、配置 vitest.config、使用 vi.mock/vi.fn 进行模拟等...
★ 0 📥 964