New: Earn 20% as an AgentAlley affiliate. Share your link and earn on every sale you refer. Join now New: Earn 20% as an affiliate. Join now

From Scratch

From scratch

by dotslashsimran · MIT license · ★ 546 on GitHub

From scratch cover

Learn how something really works by building the smallest working version of it from scratch, Karpathy style, one small step at a time, with the user predicting what each step will do before running it. Works for ML and AI ideas…

---
name: from-scratch
description: Learn how something really works by building the smallest working version of it from scratch, Karpathy style, one small step at a time, with the user predicting what each step will do before running it. Works for ML and AI ideas (attention, tokenizers, backprop, RAG, agents), systems (a database, an HTTP server, git, a shell) and anything else that can be coded. Use when the user says "teach me how X works", "build X from scratch", "I want to really understand X", "explain X from first principles", or "implement X without the library".
---

# From scratch

Reading about a thing gives you the words. Building it gives you the understanding. The fastest way to really get attention, a tokenizer, a vector database or git is to write the smallest version that works, in plain code, and watch it run.

The goal is understanding, not a finished library. Small and readable beats complete.

## 1. Find the core

Ask one question first: what does the user already know? (For example: "Comfortable with Python and numpy? Seen matrix multiplication before?") Then name, in one or two sentences, **the one mechanism that makes the thing work**. Examples:
- Attention: every token scores every other token, and takes a weighted average of their values.
- Git: files are stored by the hash of their contents, and a commit is a file that points at a tree and a parent.
- RAG: turn text into vectors, find the nearest ones to the question, paste them into the prompt.

Overview

Reading about a thing gives you the words. Building it gives you the understanding. The fastest way to really get attention, a tokenizer, a vector database or git is to write the smallest version that works, in plain code, and watch it run.

Manual install (npx, ZIP)
Claude Codenpx skills add dotslashsimran/simcraft --skill from-scratch -g -a claude-code
Claude Code (degit)npx degit dotslashsimran/simcraft/skills/learning/from-scratch#main ~/.claude/skills/from-scratch
Claude.ai / desktopZip the folder and upload it under Settings → Capabilities → Skills.
Codex, Cursor, other agentsPoint them at SKILL.md. The other files are plain text.

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • SKILL.md3.6 KB
Read SKILL.md here
dotslashsimran/main1 file shown
SKILL.md
Show the full text53 lines

From scratch

Reading about a thing gives you the words. Building it gives you the understanding. The fastest way to really get attention, a tokenizer, a vector database or git is to write the smallest version that works, in plain code, and watch it run.

The goal is understanding, not a finished library. Small and readable beats complete.

1. Find the core

Ask one question first: what does the user already know? (For example: "Comfortable with Python and numpy? Seen matrix multiplication before?") Then name, in one or two sentences, the one mechanism that makes the thing work. Examples:

  • Attention: every token scores every other token, and takes a weighted average of their values.
  • Git: files are stored by the hash of their contents, and a commit is a file that points at a tree and a parent.
  • RAG: turn text into vectors, find the nearest ones to the question, paste them into the prompt.

Everything that isn't the core (speed, edge cases, config, error handling) is left out on purpose. Say what's left out and why.

2. Plan the build

Break it into 4 to 8 steps. Each step adds one idea and ends with something that runs and prints a result. Target the whole thing at under 200 lines, one file, standard library or numpy only unless the idea needs more. Show the step list, then start step 1.

3. Each step

  1. Say the idea in two or three plain sentences.
  2. Ask for a prediction before running anything: "What do you think this prints?" or "Which word will get the highest score?" Wrong guesses are where the learning happens, so wait for one.
  3. Write the code for that step only. Short functions, honest variable names, a comment only where the why isn't obvious.
  4. Run it and show the real output. Use tiny inputs (3 tokens, 2 files, a 4-word vocabulary) so every number can be checked by eye.
  5. Compare with the prediction. If it was wrong, explain what they missed, in one or two sentences.

Never write two steps at once. The user can say "faster" to combine steps.

4. Check against the real thing

When the toy works, run the same input through the real library or tool (PyTorch attention, real git, a real tokenizer) and show that the answers match, or explain exactly why they differ. This is what turns "I made a toy" into "I know how it works".

5. Lock it in

End with:

  • A one-paragraph explanation in the user's words: ask them to explain it back first, then tidy what they wrote rather than replacing it.
  • Three questions that test the core idea, answers hidden until they try. (The teach-back skill can take it from here.)
  • Where the real version is more complicated, as a short list, so they know what they skipped.

Keep the code file. It's their reference implementation.

Rules

  • Never paste a big finished implementation. The steps are the lesson.
  • No magic: if a line uses something they haven't seen, either explain it in one sentence or replace it with something simpler.
  • Run every line of code you show. Never show output you didn't get.
1---
2name: from-scratch
3description: Learn how something really works by building the smallest working version of it from scratch, Karpathy style, one small step at a time, with the user predicting what each step will do before running it. Works for ML and AI ideas (attention, tokenizers, backprop, RAG, agents), systems (a database, an HTTP server, git, a shell) and anything else that can be coded. Use when the user says "teach me how X works", "build X from scratch", "I want to really understand X", "explain X from first principles", or "implement X without the library".
4---
5 
6# From scratch
7 
8Reading about a thing gives you the words. Building it gives you the understanding. The fastest way to really get attention, a tokenizer, a vector database or git is to write the smallest version that works, in plain code, and watch it run.
9 
10The goal is understanding, not a finished library. Small and readable beats complete.
11 
12## 1. Find the core
13 
14Ask one question first: what does the user already know? (For example: "Comfortable with Python and numpy? Seen matrix multiplication before?") Then name, in one or two sentences, **the one mechanism that makes the thing work**. Examples:
15- Attention: every token scores every other token, and takes a weighted average of their values.
16- Git: files are stored by the hash of their contents, and a commit is a file that points at a tree and a parent.
17- RAG: turn text into vectors, find the nearest ones to the question, paste them into the prompt.
18 
19Everything that isn't the core (speed, edge cases, config, error handling) is left out on purpose. Say what's left out and why.
20 
21## 2. Plan the build
22 
23Break it into 4 to 8 steps. Each step adds one idea and ends with something that runs and prints a result. Target the whole thing at **under 200 lines**, one file, standard library or numpy only unless the idea needs more. Show the step list, then start step 1.
24 
25## 3. Each step
26 
271. **Say the idea** in two or three plain sentences.
282. **Ask for a prediction** before running anything: "What do you think this prints?" or "Which word will get the highest score?" Wrong guesses are where the learning happens, so wait for one.
293. **Write the code** for that step only. Short functions, honest variable names, a comment only where the why isn't obvious.
304. **Run it** and show the real output. Use tiny inputs (3 tokens, 2 files, a 4-word vocabulary) so every number can be checked by eye.
315. **Compare with the prediction.** If it was wrong, explain what they missed, in one or two sentences.
32 
33Never write two steps at once. The user can say "faster" to combine steps.
34 
35## 4. Check against the real thing
36 
37When the toy works, run the same input through the real library or tool (PyTorch attention, real git, a real tokenizer) and show that the answers match, or explain exactly why they differ. This is what turns "I made a toy" into "I know how it works".
38 
39## 5. Lock it in
40 
41End with:
42- A **one-paragraph explanation in the user's words**: ask them to explain it back first, then tidy what they wrote rather than replacing it.
43- **Three questions** that test the core idea, answers hidden until they try. (The `teach-back` skill can take it from here.)
44- **Where the real version is more complicated**, as a short list, so they know what they skipped.
45 
46Keep the code file. It's their reference implementation.
47 
48## Rules
49 
50- Never paste a big finished implementation. The steps are the lesson.
51- No magic: if a line uses something they haven't seen, either explain it in one sentence or replace it with something simpler.
52- Run every line of code you show. Never show output you didn't get.
53 
View all files on GitHub →

Details

License
MIT
Stars on the repo
★ 546
Checked
Source
dotslashsimran/simcraft ↗
Creator
dotslashsimran · 9 listings
View creator

Similar skills

See all →

More from dotslashsimran

Clean Audiodotslashsimran/simcraft · by dotslashsimranClean up voice audio in a video: rumble, electrical hum, background noise and hiss, muddy or harsh tone, sharp S sounds, uneven volume, and loudness for YouTube/Instagram/TikTok. Measures the audio first, picks the strongest cleanup that doesn't make the words less clear, and keeps lip sync exact. Use when the user says "clean up the audio", "fix the sound", "remove background noise", "remove hum", "my audio is too quiet/loud", "make it sound better", or after a rough cut.★ 546 GitHub starsImage Gendotslashsimran/simcraft · by dotslashsimranGenerate images with the user's own API keys (Google Gemini "Nano Banana" or OpenAI gpt-image). Use when asked to generate, create or make an image, illustration, icon, cut-out, sticker, thumbnail, texture, mockup or visual asset, to edit an image, or to make several images that stay consistent (same character or object). Also used by the vox-explainer skill for collage cut-outs.★ 546 GitHub starsPerspective Illusiondotslashsimran/simcraft · by dotslashsimranMake a looping illustrated 3D video in the Japanese perspective-illusion style (e.g. @garments__) of any place, such as a street, crossing, station, shop aisle, room, park or rooftop. A clean line-art scene squashed flat by a telephoto lens opens into deep perspective with dolly zooms, swings round to corner views that first read flat and then turn 3D, and objects quietly swap depth while the view is flat. Use when asked for a perspective or optical-illusion video, a "dolly zoom" or "flat to 3D" loop, an isometric-looking illustrated scene that turns out to be 3D, or to recreate one of these clips.★ 546 GitHub starsRepo Timelapsedotslashsimran/simcraft · by dotslashsimranTurn a git repo's history into a video of the project growing. Files appear as a living treemap coloured by language that grows with the code, glows when touched and fades on delete, with a date, a lines-of-code counter, commit messages typing in as captions and an activity sparkline. 16:9 or 9:16, dark or light. Use when the user says "timelapse of my repo", "visualise git history", "build in public video", "show how the project grew", "animate my commits", or wants a video of a codebase evolving.★ 546 GitHub starsReverse Engineer a Videodotslashsimran/simcraft · by dotslashsimranBreak down a reference or viral video clip so it can be remade. Finds every cut and dissolve, times each shot, measures pacing, works out the camera move in each shot (static, pan, tilt, zoom or push in, roll, handheld shake, with speed), finds beats and loudness jumps and checks whether the cuts land on them, and reads on-screen text and speech when the tools are installed. Makes a contact sheet, a timeline strip, breakdown.md with a beat map and a remake plan, and breakdown.json. Also makes side-by-side or stacked comparison videos of a remake against the reference. Use when the user says "break down this video", "reverse engineer this clip", "how was this edited", "shot list from this video", "why does this go viral", "recreate/remake this video", "what camera moves are in this", "do the cuts hit the beat", or "compare my remake with the original".★ 546 GitHub starsRough Cut: Trim the Fatdotslashsimran/simcraft · by dotslashsimranTrim the fat from raw talking footage. Turns raw video into a tight first cut by removing dead air, ums and uhs, stutters, false starts and bad takes (keeping the last good take), then checks the result by listening to it again. Use when the user says "rough cut", "first cut", "trim the fat", "cut the pauses", "remove the ums", "cut my retakes", "make it snappy", or hands over raw footage to edit.★ 546 GitHub stars