zig-tutor

Teaches Zig programming concepts through beginner-friendly explanations in Japanese.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Learning Zig is hard for beginners because concepts like slices, allocators, error unions, and illegal behavior differ sharply from other languages, and compiler errors can be cryptic. This Skill turns the AI into a patient Zig tutor that explains not just the correct code, but why the code works and how Zig thinks. ## Core Features & Use Cases - Beginner-Focused Explanations: Answers in Japanese with conclusion-first structure, minimal runnable code examples, and step-by-step breakdowns of how the code works. - Error and Panic Diagnosis: Explains compile errors and runtime panics in a structured order (what happens, why, where, how to fix, and how to avoid it next time), including build-mode differences between Debug, ReleaseSafe, and ReleaseFast. - Zig Mental Models: Teaches Zig-specific thinking such as slices as pointer-plus-length, errors as values, explicit allocators, comptime evaluation, and the std.Io interface introduced in Zig 0.16. - Use Case: A beginner asks why printAge("42") fails with "error union is ignored". The tutor explains that errors are values in Zig, shows the try fix, and explains who is responsible for handling the failure. ## Quick Start Ask the tutor to explain a Zig concept or error message in beginner-friendly Japanese, for example by requesting an explanation of the difference between arrays and slices.

Frequently Asked Questions about zig-tutor

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

FAQPage Schema
How do I learn Zig as a beginner with an AI tutor?▼

Invoke the zig-tutor skill and ask questions in natural language. It responds in Japanese with a short conclusion, a minimal runnable code example, an explanation of how the code works, and the reasoning behind Zig's design, building understanding step by step.

How to understand Zig compile errors like error union is ignored?▼

The tutor explains errors in a fixed order: what is happening, why the compiler complains, where the problem is, how to fix it, and how to avoid it. For error unions, it teaches that Zig errors are values and shows fixes using try, catch, or if.

Does the Zig tutor support the latest Zig 0.16 release?▼

Yes, it assumes Zig 0.16.0 by default, covering std.Io, pub fn main(init: std.process.Init), and unmanaged std.ArrayList. For existing projects it reads minimum_zig_version from build.zig.zon and labels version-specific APIs.

What is the difference between arrays, slices, and pointers in Zig?▼

Arrays are fixed-size values, slices are a pointer plus a length, and pointers reference single elements. The tutor compares these with ASCII memory diagrams and explains when to choose each, such as passing []const u8 to functions.

When should I not use the zig-tutor skill?▼

Do not use it for implementation, refactoring, or code-review deliverables, since those are explicitly out of scope. It is designed for learning and explanation; once you switch to a production coding task, a different skill fits better.