English | 简体中文
An AI learning system based on the approach shown in How I Use AI to Learn Things.
The teaching behavior is now harness-neutral. The two core skills describe capabilities rather than Pi-specific tool names, paths, UI components, model providers, or note formats. They work with a rich agent harness when those capabilities exist and degrade to ordinary chat and Markdown when they do not.
skills/teach/— probes the learner's current edge, plans a dependency graph, and teaches from unconditional truths through motivated discovery.skills/visualize/— adds one minimal diagram when structure or geometry is clearer visually.
Both are standard SKILL.md directories. Copy either directory into the skill location recognized by your harness, or point your harness at this repository's skills/ directory. Harnesses use different discovery locations, so consult the host's skill-loading documentation.
git clone https://github.com/JinhaoGu/learn.git
# Install or link learn/skills/teach and learn/skills/visualize
# into your harness's skill directory.Install skills, native research/visual agents, and a local MCP service providing quiz grading, curated Markdown notes, and SVG/Mermaid rendering. From this clone (Node.js 22+), choose your harness and an existing project:
npm ci
node scripts/install-harness.mjs --harness claude --project /absolute/my-project --with-mcp
# --harness also accepts codex or opencodeRestart the harness, then use /teach in Claude Code, $teach in Codex, or ask
OpenCode to use the teach skill. Native question UI is used when available;
otherwise the lesson and quiz run in chat. SVG rendering is bundled; Mermaid
rendering additionally needs @mermaid-js/mermaid-cli and its browser.
See installation, feature mapping, and verification for configuration paths, optional skills-only installation, and acceptance checks. Automated checks cover installation and the MCP protocol; full model-driven teaching sessions still need verification in each chosen host/version.
The portable skills discover and use whatever the active harness exposes:
| Capability | Rich integration | Portable fallback |
|---|---|---|
| Questions | Structured user-input UI | Ask one concise question in chat |
| Knowledge checks | Interactive graded quiz | Present options in chat, then grade the reply |
| Fact checking | Search tools or a research subagent | Search directly; disclose uncertainty if browsing is unavailable |
| Visuals | Diagram/image tools plus render inspection | Mermaid source, SVG, or a compact text representation |
| Lesson notes | A configured note-writing tool | Authorized Markdown file, or keep the lesson in chat |
| Delegation | Specialist subagents | Perform the work in the main agent |
Missing optional capabilities never prevent the core teaching workflow from running.
This repository originated as a Pi project configuration, so the following files remain as an optional enhanced adapter:
extensions/ask-user-question.ts— structured preference and direction questionsextensions/quiz.ts— graded questions with instant feedbackextensions/md-log.ts— curated Markdown/Obsidian lesson notesextensions/skill-stats.ts— persistent skill invocation countersextensions/visual-tools/— Mermaid and SVG authoring/rendering toolsagents/— Pi-specific researcher and visual-maker definitions
To use that adapter, clone the repository as the project's .pi directory and satisfy the Pi extension dependencies:
git clone https://github.com/JinhaoGu/learn.git .piThe portable skills do not require these extensions or agent definitions. Other harnesses can provide equivalent capabilities under any names; the skills adapt to what is actually available.
After loading the Pi adapter, run:
/skill-stats
/skill-stats teach
The counter records explicit /skill:name commands and automatic SKILL.md reads. Repeated reads of the same skill in one agent turn count once. Statistics start after this extension is installed and are stored locally in ~/.pi/agent/skill-usage.jsonl; prompts and lesson content are never recorded.
The teaching philosophy is portable; extension implementations are not. A TUI popup, event hook, or tool-registration API necessarily belongs to a specific host. Rather than pretending those APIs are universal, the skills specify the behavior and fallback contract while each harness supplies its own optional adapter.