learn-anything
CLAUDE.md468 starsChanged 6 months agoMITView on GitHub
Learn Anything is a CLI tool (learn-anything) that generates skill and command files for AI coding assistants, turning them into interactive learning tutors. It supports 30+ AI tools (Claude Code, Cursor, Gemini CLI, Codex, Copilot, Windsurf, etc.) and outputs localized files in en and zh-CN. The generated skills implement 6 learning workflows: topic (initialize a subject), explain (recursive Socratic deep-dive), practice (TDD-style exercises), review (spaced repetition), status (knowledge map visualization), and quiz (two-stage generation and grading).
In this repositoryOne other file it gives its agents.
- AGENTS.mdAGENTS.md
The file
We split this CLAUDE.md into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 64
Templates are locale-aware: every template getter takes locale: SupportedLocale and pulls strings from i18n.
- Very specific: line 67
Interactive by default: when no --tools flag is passed and stdin/stdout are TTYs, learn-anything init shows an interactive checkbox prompt …
- Very specific: line 71
Add an entry to AI_TOOLS in packages/cli/src/core/config.ts with the tool's skillsDir path.
- Very specific: line 72
If the tool has custom command file conventions, create an adapter in packages/cli/src/core/command-generation/adapters/ and register it in …
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.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
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
Learn Anything is a CLI tool (learn-anything) that generates skill and command files for AI coding assistants, turning them into interactive learning tutors. It supports 30+ AI tools (Claude Code, Cursor, Gemini CLI, Codex, Copilot, Windsurf, etc.) and outputs localized files in en and zh-CN.
The generated skills implement 6 learning workflows: topic (initialize a subject), explain (recursive Socratic deep-dive), practice (TDD-style exercises), review (spaced repetition), status (knowledge map visualization), and quiz (two-stage generation and grading).
Commands
pnpm build # Compile TypeScript via tsc (runs node build.js in each package)
pnpm dev # tsc --watch (all packages)
pnpm test # Run all tests once (vitest run) across all packages
pnpm test:watch # Run tests in watch mode (vitest) across all packages
pnpm lint # ESLint on packages/
# Per-package commands:
pnpm -F learn-anything-cli build # Build only the CLI package
pnpm -F learn-anything-cli test # Test only the CLI packageArchitecture (monorepo)
packages/
cli/ # Published as `learn-anything-cli`
src/
cli/index.ts # Commander.js CLI: `learn-anything init [path]` and `learn-anything update [path]`
core/
init.ts # InitCommand — orchestrates tool detection, interactive selection,
# skill generation, and command generation
config.ts # AI_TOOLS array (30+ tools with skillsDir mappings), LEARN_DIR
command-generation/ # Adapter pattern: each tool has an adapter that knows its file format
# and directory conventions (Claude → .claude/commands/, YAML frontmatter;
# Gemini → .gemini/commands/, TOML; Codex → ~/.codex/prompts/)
types.ts # CommandContent, ToolCommandAdapter, GeneratedCommand interfaces
registry.ts # CommandAdapterRegistry — maps tool IDs → adapters
generator.ts # generateCommand / generateCommands — applies adapter to content
adapters/ # claude.ts, cursor.ts, codex.ts, gemini.ts
templates/
types.ts # SkillTemplate, CommandTemplate interfaces
skill-templates.ts # Re-exports all 6 workflow template getters
workflows/ # learn-topic.ts, learn-explain.ts, learn-practice.ts,
# learn-review.ts, learn-status.ts, learn-quiz.ts
# Each exports getXxxSkillTemplate(locale) and getXxxCommandTemplate(locale)
shared/
skill-generation.ts # Aggregates templates; generateSkillContent() writes YAML frontmatter
i18n/
index.ts # getMessages(locale), detectSystemLocale(), resolveLocale()
types.ts # LocaleMessages, SkillsMessages, CLIMessages, InitMessages types
locales/
en.ts, zh-CN.ts # Top-level locale messages (CLI strings, init messages)
skills/{en,zh-CN}/ # Per-workflow skill/command content (topic.ts, explain.ts, etc.)
utils/
file-system.ts # ensureDir, writeFile, fileExists, dirExists, removeDir
interactive.ts # isInteractive() — checks process.stdin/stdout.isTTY
gui/ # Placeholder for future GUI (private, not published)Key Patterns
- Templates are locale-aware: every template getter takes
locale: SupportedLocaleand pulls strings from i18n. The same template produces different content forenvszh-CN. - Adapter pattern for multi-tool output: adding support for a new AI tool means creating a new adapter in
command-generation/adapters/that implementsToolCommandAdapter(specifying file path conventions and file format) and registering it. - Shared data in
./.learn/: the CLI creates./.learn/topics/in the project directory for learning state that stays with the project. - Interactive by default: when no
--toolsflag is passed and stdin/stdout are TTYs,learn-anything initshows an interactive checkbox prompt (via@inquirer/prompts) with detected tools pre-selected.
Adding a new AI tool
- Add an entry to
AI_TOOLSinpackages/cli/src/core/config.tswith the tool'sskillsDirpath. - If the tool has custom command file conventions, create an adapter in
packages/cli/src/core/command-generation/adapters/and register it inpackages/cli/src/core/command-generation/adapters/index.tsandregistry.ts.
Does 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.

