learn-something
AGENTS.md6 starsChanged 3 months agoMITView on GitHub
Code/file conventions live in CONVENTIONS.md — formatting, naming, failure philosophy, test patterns, workflow checklist. Read it before editing; keep it in sync when conventions change. Contains Part A (instruction) + Part B (schema contract): Pedagogy, Content Structure, Content Creation Protocol, Study Protocol, CLI, Cost Model, Integration, Trigger Behavior, Quality Rules, Schema Reference. Learner-facing subset of SKILL.md Part A5. Keep in sync — this is the quick reference learners use during study sessions. Thin bash wrapper (9 lines). Delegates all logic…
- Deletes or force-pushes
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- learn-somethingSkill
The file
We split this AGENTS.md into the rules it gives an agent
9 rules. About 0 are common, 1 is distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 157
Keep time budgets: Every module ≤ 1.5h (hard cap, all levels.
- Very specific: line 166
CLI: Add cmd_<name>(topic: str, ...) in learn.py, register via app.command('name')(cmd_name) (typer).
- Very specific: line 167
Docs: Update SKILL.md Part A6 (CLI) and AGENTS.md CLI table.
- Very specific: line 168
Study flow: If affected, update SKILL.md Part A5 + study-protocol.md.
- Very specific: line 169
Content flow: If affected, update SKILL.md Part A3/A4.
- Very specific: line 170
Cost: If it adds API calls, verify < $0.10/course (SKILL.md A7).
- Very specific: line 171
Schema: If new data type, add JSON Schema to learn-something-schema/schemas/, TypeScript type to types/, validator to …
- Very specific: line 172
Tests: Add 2+ tests in tests/test_learn.py (happy path + error case).
- Very specific: line 173
Quality gate: If adding/removing a quality check, update _quality_checks() in learn.py + SKILL.md Part B5 table + content-verify.md.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Learn Something — Agent Modification Guide
Code/file conventions live in CONVENTIONS.md — formatting, naming, failure philosophy, test patterns, workflow checklist. Read it before editing; keep it in sync when conventions change.
Skill Structure
learn-something/
├── SKILL.md # Frontmatter metadata + main instruction body
├── study-protocol.md # Learner-facing protocol reference
├── README.md # General documentation
├── LICENSE # MIT
├── AGENTS.md # This file — agent modification guide
├── learn-something-schema/ # Shared JSON schemas (Phase 1)
│ ├── package.json
│ ├── schemas/ # JSON Schema files (deck, card, quiz, question, cloze_question, cloze_quiz, cumulative_question, cumulative_quiz, syllabus, stats, feedback)
│ ├── types/ # TypeScript type definitions
│ └── validate/ # Python + TypeScript validators
├── scripts/
│ ├── learn.sh # Thin bash wrapper → delegates to learn.py
│ ├── learn.py # Python CLI (FSRS, quiz engine, all commands)
│ ├── fsrs.py # FSRS-6 algorithm (replaces FSRS-5/SM-2)
│ ├── quality.py # Quality-gate checks (rules 1-17 + statistical) used by validate
│ ├── enrich.py # LLM-based lesson enrichment (cloze/predict/error/diagram/mindmap)
│ ├── render_diagrams.py # Mermaid → PNG renderer (mmdc CLI or mermaid.ink API) + shared render_source()
│ ├── migrate_courses.py # Normalize legacy/invalid course YAML to canonical shapes (idempotent, --apply)
│ ├── mermaidcheck.py # Shared mmdc validator (fail-fast; NO regex fallback) + safe_mode advisory lint
│ ├── checksyntax.py # Generation-stage lesson.md lint: fences, mermaid (mmdc), code blocks
│ ├── quizbalance.py # Generation-stage quiz.yaml answer re-lettering (balanced sheets)
│ ├── epub.py # EPUB 3 generator (zero-dep + optional extras)
│ └── pdf.py # PDF generator (zero-dep + optional engines)
└── tests/
├── run.sh # Test runner
├── test_learn.py # CLI tests
├── test_fsrs.py # FSRS algorithm tests
├── test_epub.py # EPUB generator tests
└── test_workstreams.py # quizbalance / mermaidcheck / doctor-internals tests
└── templates/
├── syllabus.yaml # 20-module course skeleton
├── module.md # Lesson structure (concrete-first, cloze/predict/error/diagram/mindmap)
├── quiz.yaml # MCQ template (4 options, difficulty 1-3)
└── cloze.yaml # Cloze template (fill-in-blank, difficulty 1-3)Key Modification Points
SKILL.md frontmatter
---
name: learn-something
description: >
Structured learning framework...
Trigger: "I want to learn [topic]", ...
---name: must match directory name (learn-something)description: first sentence is summary. Remaining lines = trigger phrases.- Trigger phrases: space-separated quotes. Each trigger activates skill.
SKILL.md body
Contains Part A (instruction) + Part B (schema contract): Pedagogy, Content Structure, Content Creation Protocol, Study Protocol, CLI, Cost Model, Integration, Trigger Behavior, Quality Rules, Schema Reference.
- Part A3/A4 (Content Creation Protocol): defines LLM behavior during course creation. Modify if changing AI creation flow. Includes 17 content quality rules now: concrete-first, cloze, predict, error-spotting, dual coding, mindmap, module size cap, human-readable title, etc.
- Part A5 (Study Protocol): defines session types and FSRS rules. Mirror changes into
study-protocol.md. - Part A6 (Trigger Behavior): defines first-response behavior. Modify if changing entry flow.
study-protocol.md
Learner-facing subset of SKILL.md Part A5. Keep in sync — this is the quick reference learners use during study sessions.
scripts/learn.sh
Thin bash wrapper (9 lines). Delegates all logic to learn.py.
scripts/learn.py
Python CLI. Key subsystems:
| Function | Purpose | ||
fsrs_update() | FSRS-6 algorithm: stability, difficulty, lapses, state, algorithm_version, desired_retention, learning_step. 4-level rating (1-4). States: New/Learning/Review/Relearning. | ||
cmd_init | Create subject directory, copy syllabus template. Flags: `--depth survey | standard | deep, --pretest` |
cmd_start | Show subject overview + module list | ||
cmd_create_module | Create module from template. Flag: --name. module_id must match NN-name (e.g., 01-intro) | ||
cmd_create_cloze | Create cloze.yaml from template for a module | ||
cmd_quiz | Parse YAML, shuffle, display MCQs, update SRS deck. Flags: --adaptive, --weak-only | ||
cmd_cloze | Cloze (fill-in-blank) quiz. Parse cloze.yaml, display prompts, update SRS deck. Flags: --adaptive, --weak-only | ||
cmd_cumulative_quiz | Cross-module quiz: 8-10 questions (MCQ/cloze/T/F). Flag: --modules X-Y | ||
cmd_explain | Feynman technique prompt with gap detection guide | ||
cmd_review | FSRS review: due cards, scoring, interval calc | ||
cmd_blurting | Brain-dump before review. Compares user recall to lesson key terms | ||
cmd_enrich | Add cloze/predict/error/diagram/mindmap/cloze-quiz enrichments to existing lessons via LLM. Flags: --types, --dry-run, `--render-mode api | local | off` |
cmd_fsrs_predict | Show avg stability, difficulty, retention per topic | ||
cmd_stats | Card counts, due today, mastery rate, avg ease, session history | ||
cmd_export | Export deck to CSV for Anki import | ||
cmd_rate | Rate module clarity (1-5 stars), save to feedback.json. Flag: --comment | ||
cmd_flag | Report content error (wrong/outdated/confusing). Flag: --detail | ||
cmd_feedback | Aggregate feedback: avg ratings, flag counts, suggest modules | ||
cmd_analytics | Retention analytics: mastery breakdown, session history, weak modules | ||
cmd_forecast | Forgetting forecast: cards due now/week/month | ||
cmd_study_plan | Optimal study session: due + weak cards, skip mastered | ||
cmd_epub | Generate EPUB book from all modules + quizzes. Flags: --mermaid, --description | ||
cmd_epub_regen | Regenerate EPUB from cached book.md. Flags: --mermaid, --description | ||
cmd_epub_verify | Validate EPUB structure | ||
cmd_epub_list_themes | List available EPUB themes | ||
cmd_pdf | Generate PDF from all modules + quizzes. Flags: --engine, --title, --author | ||
cmd_pdf_regen | Regenerate PDF from cached book.md. Flags: --engine, --title, --author | ||
cmd_sync | Export deck to Reader directory (~/.coursereader/subjects/). Flag: --reader-path | ||
cmd_sync_pull | Import deck from Reader directory. Flag: --reader-path | ||
cmd_validate | Full quality gate: Pass 1 _schema_errors (deck/quiz/cloze/cumulative/syllabus/feedback vs JSON Schema + module dir naming), Pass 2 _content_syntax_errors (markdown + mermaid via mmdc — hard prerequisite, no fallback), Pass 3-4 _quality_checks (rules 15-17 + statistical). Rule 15 (mindmap) ERR; rule 16 (size) and rule 17 (H1 title) WARN-only — threshold via --max-chars N (default 12,000), time budget is the real cap. Exit 1 on any ERR | ||
cmd_render_diagrams | Render ```mermaid blocks in lesson.md to PNG. Flags: `--render-mode api | local, --scale N` | |
cmd_mindmap | Generate/regenerate Mermaid mindmap for a module via LLM (auto-runs basic mermaid check after write) | ||
cmd_balance_quiz | Generation-stage: re-letter quiz.yaml answer positions to balanced no-3-run spread. Deterministic per topic-module (idempotent), backup .bak. Flags: none | ||
cmd_checksyntax | Generation-stage: lint a module's lesson.md — fence balance, mermaid blocks (shared mermaidcheck.py), code blocks via interpreters (python3 py_compile / node --check / bash -n). Flag: `--render api | local | off` (smoke render) |
FSRS-6 Algorithm (fsrs_update())
- Replaces FSRS-5. Uses 19-parameter model from py-fsrs v6.
- Quality mapping: 0-2→Again(1), 3→Hard(2), 4-5→Good(3); explicit
ratingarg (1-4) takes precedence. - Initial stability S0 = W[rating-1], difficulty D0 = W[4] - exp(W[5] * (rating - 3)) + 1
- Retrievability: R = (1 + FACTOR * t / S) ^ DECAY
- Short-term (elapsed < 1d) vs long-term (elapsed >= 1d) stability updates
- Per-card
desired_retention(default 0.9) drives interval viat = S/factor * (r^(1/decay) - 1) - States: New → Learning (Again/Hard) → Review → Relearning (lapse) → Review
- Old SM-2 and FSRS-5 cards auto-migrate via
_migrate_card()(lazy, on first update) - See
fsrs.pyfor full parameter constants W[0..18] and DECAY = -W[17]
Quiz Engine (cmd_quiz)
- Uses Python3 with
yamllibrary. - Options shuffled per question, keys remapped (A-D → a-d).
- Each quiz attempt updates SRS deck with FSRS-6 intervals.
- Falls back to raw display if
yamlunavailable. - Adaptive mode: weighted by ease, difficulty ramp, streak skip.
templates/
| Template | Purpose | Key constraints |
syllabus.yaml | 20-module default skeleton | time_hours per module ≤ 1.5 (hard cap, all levels), prerequisites form DAG. Level → module count: beginner ~25-30 (0.5-0.75h each), intermediate ~15-20 (1-1.5h), advanced ~20-30 (1-1.5h, open questions) |
module.md | Lesson structure | Must include: Real-World Example → Core Content (with Think, Cloze, Predict, Mermaid per section) → Why This Matters → Key Takeaways → Common Misconception → Spot the Mistake → Feynman Explain → Reframe → Drill |
quiz.yaml | MCQ format | 4 options, 1 correct, difficulty 1-3, tags per category |
Content Quality Rules
The 17 content quality rules are the single source of truth in SKILL.md → Part A4 (with automated checks). Do NOT duplicate the rule table here — if rules change, edit SKILL.md only.
Modification Rules
- Keep pedagogy alignment: Any new feature must fit Marva Collins (rigor/repetition), Feynman (explain-simply), or Desirable Difficulties (spacing/interleaving). Tag new features with which theory they serve.
- Keep cost model: Powered by DeepSeek V4 Flash. Content creation stays ~$0.10/course max. Study sessions stay $0.
- Keep time budgets: Every module ≤ 1.5h (hard cap, all levels; depth via more modules + open questions). Subject ≤ 40h guideline (deep courses may exceed; schema allows 200h).
- Keep FSRS-6 correct: Stability/difficulty formulas match py-fsrs v6. 19 params, 4-level rating,
DECAY = -W[17]. Do not change W parameters without testing against known FSRS implementations. - Keep trigger behavior: On trigger, enter content creation mode immediately — never generate full course in one shot unless user explicitly asks.
- Keep template constraints: MCQ = exactly 4 options, 1 correct. Module must include Feynman + Reframe sections.
- Keep sync: Changes to study protocol in SKILL.md must be mirrored in
study-protocol.md. Changes to deck schema must sync between CLI and Reader. - Keep backward compat: CLI flags and file structure (syllabus.yaml, modules/NN-name/lesson.md, modules/NN-name/quiz.yaml, srs/deck.json) are public API. Breaking changes need migration path.
Adding Features
- CLI: Add
cmd_<name>(topic: str, ...)inlearn.py, register viaapp.command('name')(cmd_name)(typer). - Docs: Update SKILL.md Part A6 (CLI) and AGENTS.md CLI table.
- Study flow: If affected, update SKILL.md Part A5 +
study-protocol.md. - Content flow: If affected, update SKILL.md Part A3/A4.
- Cost: If it adds API calls, verify < $0.10/course (SKILL.md A7).
- Schema: If new data type, add JSON Schema to
learn-something-schema/schemas/, TypeScript type totypes/, validator tovalidate/python/validate.py. - Tests: Add 2+ tests in
tests/test_learn.py(happy path + error case). - Quality gate: If adding/removing a quality check, update
_quality_checks()inlearn.py+ SKILL.md Part B5 table +content-verify.md.
Testing
# Lint first (gate — runs automatically at the top of tests/run.sh)
ruff check --output-format=concise scripts/ tests/
# Create test directory
mkdir test-course && cd test-course
# Initialize
../scripts/learn.sh init python
# Create test module
../scripts/learn.sh create-module python 01-intro
# Run quiz
../scripts/learn.sh quiz python 01-intro
# Run review
../scripts/learn.sh review python
# Check stats (includes session history)
../scripts/learn.sh stats python
# Export to Anki CSV
../scripts/learn.sh export python
# Test diagram rendering
../scripts/learn.sh enrich python 01-intro --types diagram --render-mode off
../scripts/learn.sh render-diagrams python 01-intro --render-mode api
# Cleanup
cd .. && rm -rf test-courseDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

