Get a practice exercise. Use /tutor:exercise for an exercise on the current topic, or /tutor:exercise [difficulty] where difficulty can be basic, intermediate, advanced, or challenge.
Generates practice exercises with files, tests, and hints tailored to your learning progress and language.
/plugin marketplace add netsirius/tutor-plugin/plugin install tutor@tutor-pluginsThe user wants to practice with an exercise.
Before generating any content, read .tutor/config.json and check the learning_language field. ALL content (descriptions, instructions, hints, feedback) MUST be presented in the student's chosen language.
ALL exercises MUST be generated as physical files. The student works directly in these files. Claude's role in chat is ONLY to:
NEVER present exercise content only in chat. Always create files first.
Read .tutor/progress.json to know:
Read .tutor/config.json to get the learning language
Determine the difficulty:
CREATE the exercise as files in lessons/[module]/exercises/:
lessons/02-ownership/exercises/ex01_move_semantics/
├── README.md # Exercise description and objectives
├── Cargo.toml # Project configuration
├── src/
│ └── main.rs # Starter code with todo!() markers
├── tests/
│ └── tests.rs # Automated tests to validate solution
└── HINTS.md # Progressive hints (student reads when stuck)
In chat, tell the student:
Exercise created!
📁 Location: lessons/[module]/exercises/ex01_[name]/
📖 Read README.md for instructions
✏️ Write your solution in src/main.rs
🧪 Run `cargo test` to check your solution
💡 If stuck, check HINTS.md (try without hints first!)
Wait for student to work on the exercise
When they ask for review or run tests, evaluate and update progress
// =============================================================================
// Exercise: [Descriptive Title]
// Difficulty: ★★ (Intermediate)
// Topic: [Curriculum topic]
// Estimated time: 20 minutes
// =============================================================================
//
// DESCRIPTION:
// [Clear explanation of the problem to solve]
//
// EXAMPLE:
// Input: [example]
// Expected output: [result]
//
// INSTRUCTIONS:
// 1. Implement the function [name]
// 2. Make sure to handle [special case]
// 3. Run `cargo test` to verify
//
// HINTS (only if you get stuck):
// Hint 1: [soft hint]
// Hint 2: [more direct hint]
// Hint 3: [almost the solution]
// =============================================================================
fn main() {
// Your code here
todo!("Implement the solution")
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_basic_case() {
// Test for the simplest case
}
}
# Exercise: [Descriptive Title]
**Difficulty:** ★★ (Intermediate)
**Topic:** [Curriculum topic]
**Estimated time:** 20 minutes
## Objective
[What the student will learn/practice]
## Description
[Clear explanation of the problem to solve]
## Example
**Input:**
[example input]
**Expected Output:**
[expected result]
## Instructions
1. Open `src/main.rs`
2. Implement the function `[name]`
3. Make sure to handle [special case]
4. Run `cargo test` to verify your solution
## Success Criteria
- [ ] All tests pass
- [ ] Code handles edge cases
- [ ] [Other criteria]
## When You're Done
Tell Claude: "I finished the exercise" for review and feedback.
# Hints for: [Exercise Name]
Try to solve without hints first! Only read when stuck.
---
## Hint 1 (Gentle nudge)
[Soft hint about approach]
---
## Hint 2 (More direction)
[More specific guidance]
---
## Hint 3 (Almost the answer)
[Very direct hint, almost solution]
DO in chat:
lessons/02-ownership/exercises/ex01_move/"cargo test in the exercise directory to check your solution"DON'T in chat:
.tutor/progress.json