Implement the following plan:
Plan: Number 01-foundations scripts + commit all changes
Context
All 7 01-foundations/ scripts are implemented and validated. The user wants numeric prefixes on filenames so ls output reveals the learning order. This plan covers: (1) renaming files, (2) updating all references, (3) committing everything in logical groups.
Rename Map
| Current | New | Learning concept |
|---|
microtokenizer.py | 01_microtokenizer.py | Text → numbers |
microembedding.py | 02_microembedding.py | Meaning → geometry |
microgpt.py | 03_microgpt.py | Sequences → predictions |
micrornn.py | 04_micrornn.py | Pre-attention sequence modeling |
microrag.py | 05_microrag.py | Retrieval-augmented generation |
microdiffusion.py | 06_microdiffusion.py | Data from noise |
microvae.py | 07_microvae.py | Compressed generative representations |
Files requiring reference updates
Documentation (external references to filenames)
01-foundations/README.md — Script table (7 rows), learning path block, future candidates note
README.md (root) — Example command, learning path block, Karpathy attribution
docs/implementation.md — Directory tree, 7 section headers, phase table, cross-references (~25 occurrences)
docs/autograd-interface.md — micrornn.py extension table, microvae KL clamping note
.claude/CLAUDE.md — Example command, phase table, architectural patterns, attribution
CONTRIBUTING.md — microgpt references (×2)
Source code (internal cross-references)
01-foundations/03_microgpt.py (after rename) — Line 7: Karpathy's microgpt.py (keep as-is, refers to Karpathy's file not ours), Lines 117-118: micrornn, microlora references
01-foundations/04_micrornn.py (after rename) — Line 24: microgpt's Adam reference
Rules
- References to Karpathy's original
microgpt.py stay unchanged (it's his file, not ours)
- References to future scripts (
microlora, microdpo, microppo, micromoe, microattention, microbeam, microquant, microkv, microflash) stay unchanged (not yet implemented, will get numbered when their sections are built)
- Only rename references to the 7 files that actually exist in
01-foundations/
Commit Strategy (4 sequential commits)
Commit 1: feat(foundations): implement GPT, RNN, embedding, RAG, diffusion, and VAE scripts
Files: 6 new scripts (microgpt.py, micrornn.py, microembedding.py, microrag.py, microdiffusion.py, microvae.py)
Rationale: The implementation work — all new script files in one commit since they were developed as a coordinated batch.
Commit 2: docs: fix safe_log graph disconnection in autograd spec
Files: docs/autograd-interface.md
Rationale: The safe_log fix is a standalone doc correction — the old example had a gradient-severing bug.
Commit 3: refactor(foundations): add numeric prefixes to script filenames for learning order
Files: 7 git mv operations (rename all scripts), plus all reference updates in:
01-foundations/README.md
README.md
docs/implementation.md
docs/autograd-interface.md
.claude/CLAUDE.md
CONTRIBUTING.md
- Internal .py cross-references (microgpt.py line 117-118, micrornn.py line 24)
Rationale: Pure rename + reference update, isolated from implementation changes.
Commit 4: docs: update implementation.md formatting and README status
Files: docs/implementation.md (markdown table formatting), 01-foundations/README.md (status Planned→Complete already done, heading Planned Scripts→Scripts already done)
Rationale: Formatting-only doc changes.
Execution Steps
- Stage and commit the 6 new .py files (Commit 1)
- Stage and commit autograd-interface.md (Commit 2)
git mv all 7 scripts to numbered names
- Update all .md and .py references (find-and-replace)
- Stage everything and commit (Commit 3)
- Stage and commit remaining doc formatting (Commit 4)
Verification
After all commits:
ls 01-foundations/*.py shows numbered order
git log --oneline shows 4 clean commits
python 01-foundations/03_microgpt.py runs (spot-check one renamed script)
grep -r "microgpt.py" docs/ returns only Karpathy references or numbered versions
If you need specific details from before exiting plan mode (like exact code snippets, error messages, or content you generated), read the full transcript at: /Users/druk/.REDACTED.jsonl
If this plan can be broken down into multiple independent tasks, consider using the TeamCreate tool to create a team and parallelize the work.