Skip to content

shuolsure/code-learning-tutorial-skill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Learning Tutorial Skill

License: MIT

A comprehensive skill for creating interactive web tutorials that help programming beginners learn codebases from scratch.

📖 Overview

This skill provides a proven 11-stage methodology for transforming complex codebases into beginner-friendly interactive tutorials. Based on real-world experience creating the Nanobot Tutorial, this skill guides you through every step of creating an effective learning experience.

🎯 What This Skill Does

  • Analyzes codebases to identify key concepts and learning paths
  • Creates interactive web tutorials with navigation, search, and progress tracking
  • Implements Socratic teaching methods to encourage critical thinking
  • Visualizes code relationships through diagrams and knowledge graphs
  • Demonstrates real execution flows with step-by-step scenarios
  • Deploys tutorials online for easy access

🚀 Quick Start

Prerequisites

  • Basic knowledge of HTML, CSS, and JavaScript
  • A codebase you want to create a tutorial for
  • Git installed on your system
  • GitHub account (for deployment)

Installation

  1. Clone this repository:
git clone https://github.com/shuolsure/code-learning-tutorial-skill.git
  1. Copy the SKILL.md file to your Trae skills directory:
mkdir -p .trae/skills/code-learning-tutorial
cp code-learning-tutorial-skill/SKILL.md .trae/skills/code-learning-tutorial/
  1. Restart Trae or reload skills

Usage

Simply tell Trae:

"我想为这个项目创建一个初学者教程"
"Create a beginner tutorial for this codebase"
"帮我创建一个代码学习教程"

The skill will guide you through all 11 stages automatically!

📚 The 11-Stage Methodology

Stage 1: Project Understanding & Overview

Analyze the project and create a high-level overview explaining what it does and why.

Stage 2: Code Annotation & Line-by-Line Explanation

Add detailed comments to all core files, explaining every line in simple terms.

Stage 3: Design Details & Architecture Deep Dive

Explain architectural choices and design rationale behind decisions.

Stage 4: Create Interactive Web Tutorial Structure

Build the HTML structure with navigation, search, and progress tracking.

Stage 5: Add Source Code Viewers

Implement modal dialogs for viewing code with syntax highlighting.

Stage 6: Interactive Folder Structure

Create visual folder trees with click-to-view functionality.

Stage 7: Socratic Teaching Method

Use thought-provoking questions to guide learning and critical thinking.

Stage 8: Method Introduction & Relationships

Create method hierarchies and knowledge graphs showing relationships.

Stage 9: Run Demo & Execution Flow

Show how code actually runs with step-by-step execution diagrams.

Stage 10: UI/UX Optimization

Ensure the tutorial is visually appealing and works on all devices.

Stage 11: Deployment & Publishing

Deploy the tutorial to GitHub Pages for online access.

🌟 Features

  • Beginner-Friendly: Assumes no prior knowledge
  • Interactive: Click, explore, and discover
  • Visual: Diagrams, flowcharts, and visualizations
  • Socratic: Questions guide learning
  • Comprehensive: Covers all aspects of the codebase
  • Deployable: Easy online access via GitHub Pages
  • Mobile-Responsive: Works on all devices

📁 File Structure

A typical tutorial created with this skill includes:

tutorial/
├── index.html              # Main page
├── css/
│   ├── style.css          # Main styles
│   ├── components.css     # Component styles
│   └── responsive.css     # Mobile styles
├── js/
│   ├── tutorial.js        # Core functionality
│   ├── code-data.js       # Code explanations
│   ├── methods-data.js    # Method documentation
│   ├── demo-data.js       # Demo scenarios
│   ├── demo-flow.js       # Flow diagram renderer
│   └── demo-controller.js # Demo interactions
└── assets/
    ├── images/            # Diagrams
    └── icons/             # Icons

🎨 Example Tutorials

Nanobot Tutorial

URL: https://shuolsure.github.io/nanobot-weblearn/

Features:

  • 4 core feature modules with detailed explanations
  • Method pyramid structure and knowledge graph
  • 4 interactive demo scenarios
  • Complete code explanations with Socratic method
  • Mobile-responsive design

Screenshots:

  • Project Overview
  • Core Features
  • System Architecture
  • Method Relationships
  • Run Demo

🛠️ Tools & Libraries

Recommended for Syntax Highlighting

Recommended for Diagrams

  • Mermaid.js - Flowcharts and sequence diagrams
  • D3.js - Custom interactive visualizations
  • SVG - For simple diagrams

Recommended for Search

Recommended for Deployment

📋 Best Practices

For Beginners

  1. Start simple - don't overwhelm with details
  2. Use analogies to explain complex concepts
  3. Make it visual with diagrams and charts
  4. Keep it interactive - let learners explore
  5. Show basics first, details on demand

For Code Explanation

  1. Explain every line, even imports
  2. Focus on "why" not just "what"
  3. Provide concrete usage examples
  4. Highlight common patterns

For Socratic Teaching

  1. Ask before telling
  2. Provide hints before answers
  3. Link to related concepts
  4. Use practical examples

⚠️ Common Pitfalls to Avoid

  1. Too Technical Too Soon: Start with basics, add complexity gradually
  2. No Code Examples: Always show actual code when explaining concepts
  3. Passive Learning: Make it interactive, not just reading
  4. Poor UI/UX: Test on different devices and screen sizes
  5. Missing Deployment: Make sure it's accessible online
  6. No Progress Tracking: Let learners know how far they've come
  7. Broken Links: Verify all code links and references work

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

👨‍💻 Author

shuolsure

🙏 Acknowledgments

  • Inspired by the need to make code learning accessible to everyone
  • Based on real-world experience creating the Nanobot Tutorial
  • Thanks to all contributors and users who provide feedback

📊 Success Metrics

A successful tutorial created with this skill should:

  • ✅ Be understandable by complete beginners
  • ✅ Explain all core concepts with code examples
  • ✅ Use Socratic method to encourage thinking
  • ✅ Provide interactive exploration
  • ✅ Show real execution scenarios
  • ✅ Be accessible online
  • ✅ Work on mobile devices
  • ✅ Have clear navigation and search

🔗 Links


Transform complex code into an enjoyable learning journey! 🚀

About

A comprehensive skill for creating interactive web tutorials that help programming beginners learn codebases from scratch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors