rust-tutor

Teaches Rust concepts to beginners through explanations, examples, and compiler error walkthroughs.

Updated Jul 4, 2023
One-click install
npx skills add https://github.com/kohdice/dotfiles --skill rust-tutor-kohdice
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rust-tutor
Source: https://github.com/kohdice/dotfiles/tree/main/config/agents/skills/rust-tutor
Command: npx skills add https://github.com/kohdice/dotfiles --skill rust-tutor-kohdice

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Learning Rust's ownership, borrowing, and type system is notoriously difficult for beginners, and generic answers often skip the reasoning behind compiler errors. This Skill turns the AI into a persistent Rust tutor that explains not just what code does, but why Rust is designed that way. ## Core Features & Use Cases - Beginner-Friendly Explanations: Breaks down ownership, borrowing, lifetimes, traits, generics, and iterators with minimal runnable code examples and ASCII mental-model diagrams. - Structured Error Walkthroughs: Explains compile errors step by step—what is happening, why Rust rejects the code, where the problem is, and how to fix it. - Concept Comparisons: Contrasts commonly confused pairs like String vs &str, Option vs null, match vs if let, and Box vs Rc vs Arc, with guidance on when to choose each. - Use Case: A beginner hits a "borrow of moved value" error and asks why. The tutor explains the ownership move, shows a minimal fix using a reference, and adds a short column on Rust's memory design. ## Quick Start Ask the rust-tutor skill to explain why your Rust code fails to compile and walk you through the ownership concepts behind the error.

Frequently Asked Questions about rust-tutor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I learn Rust ownership and borrowing as a beginner?▼

Ask the tutor about the specific concept or error you are stuck on. It explains ownership moves and borrows with minimal code examples, ASCII diagrams of before/after states, and the reasoning behind Rust's safety rules.

How to understand Rust compiler errors like borrow of moved value?▼

The tutor explains compile errors in a fixed order: what is happening, why Rust raises the error, where the problematic code is, how to fix it, and how to avoid it next time. It never just paraphrases the error message.

What is the difference between String and &str in Rust?▼

String owns its heap-allocated text data, while &str is a borrowed reference to string data. The tutor covers this and similar pairs like Option vs null and Box vs Rc vs Arc, including when to choose each.

Does this skill write or refactor Rust code for me?▼

No. The skill explicitly excludes implementation, refactoring, and review deliverables. It explains concepts and shows minimal fixes to your code so you learn to write Rust yourself.

Which Rust version and edition do the examples target?▼

Examples assume Rust 1.98.x and the 2024 edition when no baseline is specified. For existing projects, the tutor follows the project's edition, MSRV, and pinned toolchain, labeling newer features with their required version.

What language does the Rust tutor respond in?▼

The tutor always responds in Japanese, as specified in its instructions. Explanations, code commentary, and columns are all written for Japanese-speaking Rust beginners.