learn-anything-cli 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  const SKILL_NAME = 'learn-anything-practice';
2
- const SKILL_DESCRIPTION = 'Master concepts through hands-on practice. Coding topics get real project files to edit in your IDE; conceptual topics get chat-based discussion. Dual-mode: Project Mode + Chat Mode.';
2
+ const SKILL_DESCRIPTION = 'Master concepts through hands-on practice. Coding topics get real project files to edit in your IDE; conceptual topics get chat-based discussion. Dual-mode (Project Mode + Chat Mode).';
3
3
  const INSTRUCTIONS = `Always respond in the same language the user uses.
4
4
  If the user speaks Chinese, explain all concepts, examples, and guidance in Chinese.
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "learn-anything-cli",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "AI-powered recursive learning system with Socratic method and TDD practice",
5
5
  "keywords": [
6
6
  "learn-anything-cli",
@@ -40,35 +40,17 @@
40
40
  "!dist/**/*.map"
41
41
  ],
42
42
  "scripts": {
43
- "build": "node build.js",
43
+ "build": "tsc",
44
44
  "dev": "tsc --watch",
45
45
  "dev:cli": "pnpm build && node bin/learn-anything.js",
46
46
  "test": "vitest run",
47
47
  "test:watch": "vitest",
48
- "lint": "eslint src/",
49
- "format": "prettier --write .",
50
- "format:check": "prettier --check .",
51
- "prepublishOnly": "pnpm run build",
52
- "prepare": "husky"
48
+ "lint": "echo 'Lint from root'",
49
+ "prepublishOnly": "pnpm run build"
53
50
  },
54
51
  "engines": {
55
52
  "node": ">=20.0.0"
56
53
  },
57
- "devDependencies": {
58
- "@commitlint/cli": "^21.0.2",
59
- "@commitlint/config-conventional": "^21.0.2",
60
- "@eslint/js": "^10.0.1",
61
- "@types/mdast": "^4.0.4",
62
- "@types/node": "^24.2.0",
63
- "eslint": "^9.39.2",
64
- "eslint-config-prettier": "^10.1.8",
65
- "husky": "^9.1.7",
66
- "lint-staged": "^17.0.7",
67
- "prettier": "^3.8.3",
68
- "typescript": "^5.9.3",
69
- "typescript-eslint": "^8.50.1",
70
- "vitest": "^3.2.4"
71
- },
72
54
  "dependencies": {
73
55
  "@inquirer/prompts": "^7.8.0",
74
56
  "chalk": "^5.5.0",
@@ -78,14 +60,5 @@
78
60
  "unified": "^11.0.5",
79
61
  "yaml": "^2.8.2",
80
62
  "zod": "^4.0.17"
81
- },
82
- "lint-staged": {
83
- "*.{ts,js,mjs}": [
84
- "eslint --fix",
85
- "prettier --write"
86
- ],
87
- "*.{json,md,yml,yaml}": [
88
- "prettier --write"
89
- ]
90
63
  }
91
64
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 ChenChenyaqi
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/README.md DELETED
@@ -1,104 +0,0 @@
1
- # Learn Anything
2
-
3
- [English](./README.md) | [中文](./README.zh-CN.md)
4
-
5
- AI-powered recursive learning system — turns your AI coding assistant into an interactive tutor using the Socratic method and TDD-style exercises.
6
-
7
- Generate skill and command files for **30+ AI tools** (Claude Code, Cursor, Gemini CLI, Codex, Copilot, Windsurf, etc.), then use slash commands to systematically master any technical topic.
8
-
9
- ## Quick Start
10
-
11
- ```bash
12
- # Initialize in your project (interactive — select your AI tools)
13
- npx learn-anything-cli init
14
-
15
- # Or specify tools directly
16
- npx learn-anything-cli init --tools claude
17
-
18
- # Chinese terminal output
19
- npx learn-anything-cli init --lang zh-CN
20
-
21
- # Or install globally
22
- npm install -g learn-anything-cli
23
- learn-anything init
24
- ```
25
-
26
- ### Context7 Integration (Optional)
27
-
28
- When running `init` or `update`, you'll be prompted to enable **Context7** for documentation verification. When enabled, the AI will fetch official documentation and verify its explanations against authoritative sources — improving teaching accuracy.
29
-
30
- If you haven't set up Context7 yet, run `npx ctx7 setup` or visit the [Context7 docs](https://context7.com/docs/resources/all-clients) for your specific AI tool.
31
-
32
- After init, your AI assistant gains five learning commands:
33
-
34
- | Command | What it does |
35
- | -------------------------------- | ------------------------------------------------------------ |
36
- | `/learn:topic <topic-name>` | Initialize a topic, generate a knowledge map, track progress |
37
- | `/learn:explain <concept-name>` | Recursive Socratic deep-dive into a concept |
38
- | `/learn:practice <concept-name>` | TDD-style coding exercises with Socratic feedback |
39
- | `/learn:review [topic-name]` | Review progress, spaced repetition recommendations |
40
- | `/learn:status [topic-name]` | Visualize learning state as a knowledge map heatmap |
41
-
42
- ## Learning Workflows
43
-
44
- ### `/learn:topic <topic-name>` — Initialize a Topic
45
-
46
- The AI creates a learning state file (`state.json`) and generates a knowledge map (`knowledge-map.md`) via `render.mjs`, then presents the landscape for you to choose your own path.
47
-
48
- ### `/learn:explain <concept-name>` — Recursive Deep Dive
49
-
50
- The AI assesses your level (beginner → advanced), explains the concept with analogies and code examples, identifies deeper sub-topics, and lets you choose how deep to go. Every session is recorded for spaced repetition.
51
-
52
- ### `/learn:practice <concept-name>` — TDD-Style Exercises
53
-
54
- The AI generates a test-driven exercise at the right difficulty (beginner / intermediate / challenge), provides structured Socratic feedback, and updates your mastery status. Edge cases, security, and code quality are all covered.
55
-
56
- ### `/learn:review [topic-name]` — Progress Review
57
-
58
- Analyzes your learning data: mastery heatmap, spaced repetition priority scoring, concept relationship analysis (blocking / orphan concepts). Generates a personalized next-step plan.
59
-
60
- ### `/learn:status [topic-name]` — Visualize State
61
-
62
- Renders a knowledge map heatmap with status icons, practice counts, and confidence scores for every concept.
63
-
64
- ## Supported AI Tools
65
-
66
- Manage, Amazon Q Developer, Antigravity, Auggie, Bob Shell, Claude Code, Cline, Codex, ForgeCode, CodeBuddy Code, Continue, CoStrict, Crush, Cursor, Factory Droid, Gemini CLI, GitHub Copilot, iFlow, Junie, Kilo Code, Kiro, OpenCode, Pi, Qoder, Lingma, Qwen Code, RooCode, Trae, Windsurf, and AGENTS.md-compatible assistants.
67
-
68
- ```bash
69
- # Update skill files to latest version (detects existing tools automatically)
70
- npx learn-anything-cli update
71
- ```
72
-
73
- ## How It Works
74
-
75
- ```
76
- Your Project/
77
- ├── .claude/commands/learn/ # Slash commands (learn:topic, learn:explain, ...)
78
- ├── .claude/skills/ # Skill files with full workflow instructions
79
- ├── .cursor/commands/ # Cursor-specific command format
80
- ├── .gemini/commands/learn/ # Gemini TOML-format commands
81
- ├── .learn/ # Your learning data (knowledge maps, progress)
82
- │ └── topics/
83
- │ └── javascript/
84
- │ ├── state.json # Learning data (single source of truth)
85
- │ ├── knowledge-map.md # Auto-generated by render.mjs from state.json
86
- │ └── sessions/
87
- └── ...
88
- ```
89
-
90
- Each AI tool gets tool-appropriate file formats (YAML frontmatter for Claude, TOML for Gemini, etc.) via an adapter pattern.
91
-
92
- ## Development
93
-
94
- ```bash
95
- pnpm install
96
- pnpm build # Compile TypeScript
97
- pnpm test # Run tests
98
- pnpm dev # Watch mode
99
- pnpm dev:cli # Build and run CLI locally
100
- ```
101
-
102
- ## License
103
-
104
- MIT
package/README.zh-CN.md DELETED
@@ -1,102 +0,0 @@
1
- # Learn Anything
2
-
3
- AI 驱动的递归学习系统 — 将你的 AI 编程助手变成交互式导师,使用苏格拉底式教学法和 TDD 风格练习。
4
-
5
- 为 **30+ 种 AI 工具**(Claude Code、Cursor、Gemini CLI、Codex、Copilot、Windsurf 等)生成 skill 和 command 文件,通过斜杠命令系统性掌握任何技术主题。
6
-
7
- ## 快速开始
8
-
9
- ```bash
10
- # 在项目中初始化(交互模式 — 选择你的 AI 工具)
11
- npx learn-anything-cli init
12
-
13
- # 直接指定工具
14
- npx learn-anything-cli init --tools claude
15
-
16
- # 中文终端输出
17
- npx learn-anything-cli init --lang zh-CN
18
-
19
- # 或者全局安装
20
- npm install -g learn-anything-cli
21
- learn-anything init
22
- ```
23
-
24
- ### Context7 集成(可选)
25
-
26
- 在执行 `init` 或 `update` 时,会提示是否启用 **Context7** 文档验证。启用后,AI 会获取官方文档并对照权威来源验证其教学内容——提高教学准确性。
27
-
28
- 如果你还没有配置 Context7,运行 `npx ctx7 setup` 或访问 [Context7 文档](https://context7.com/docs/resources/all-clients) 查看你使用的 AI 工具的配置方式。
29
-
30
- 初始化后,你的 AI 助手获得五个学习命令:
31
-
32
- | 命令 | 功能 |
33
- | -------------------------------- | -------------------------------------- |
34
- | `/learn:topic <topic-name>` | 初始化主题,生成知识图谱,跟踪学习进度 |
35
- | `/learn:explain <concept-name>` | 递归式苏格拉底深度学习一个概念 |
36
- | `/learn:practice <concept-name>` | TDD 风格编码练习,获得苏格拉底式反馈 |
37
- | `/learn:review [topic-name]` | 回顾学习进度,基于间隔重复推荐下一步 |
38
- | `/learn:status [topic-name]` | 可视化学习状态,展示知识图谱热力图 |
39
-
40
- ## 学习工作流
41
-
42
- ### `/learn:topic <topic-name>` — 初始化主题
43
-
44
- AI 创建学习状态文件(`state.json`),并通过 `render.mjs` 生成知识图谱(`knowledge-map.md`),展示知识全景让你自主选择学习路径。
45
-
46
- ### `/learn:explain <concept-name>` — 递归式深度学习
47
-
48
- AI 评估你的水平(初级 → 高级),用类比和代码示例讲解概念,识别更深层的子话题,让你自主决定深入程度。每次学习会话都会被记录用于间隔重复。
49
-
50
- ### `/learn:practice <concept-name>` — TDD 风格练习
51
-
52
- AI 生成合适难度的测试驱动练习题(入门 / 进阶 / 挑战),提供结构化的苏格拉底式反馈,并更新你的掌握状态。涵盖边界情况、安全性和代码质量。
53
-
54
- ### `/learn:review [topic-name]` — 进度回顾
55
-
56
- 分析学习数据:掌握度热力图、间隔重复优先级评分、概念关系分析(阻塞概念 / 孤立概念)。生成个性化的下一步学习计划。
57
-
58
- ### `/learn:status [topic-name]` — 可视化状态
59
-
60
- 为每个概念渲染带状态图标、练习次数和信心分数的知识图谱热力图。
61
-
62
- ## 支持的 AI 工具
63
-
64
- Manage、Amazon Q Developer、Antigravity、Auggie、Bob Shell、Claude Code、Cline、Codex、ForgeCode、CodeBuddy Code、Continue、CoStrict、Crush、Cursor、Factory Droid、Gemini CLI、GitHub Copilot、iFlow、Junie、Kilo Code、Kiro、OpenCode、Pi、Qoder、Lingma、Qwen Code、RooCode、Trae、Windsurf 及兼容 AGENTS.md 的助手。
65
-
66
- ```bash
67
- # 更新技能文件到最新版本(自动检测已有工具目录)
68
- npx learn-anything-cli update
69
- ```
70
-
71
- ## 工作原理
72
-
73
- ```
74
- 你的项目/
75
- ├── .claude/commands/learn/ # 斜杠命令(learn:topic、learn:explain...)
76
- ├── .claude/skills/ # 包含完整工作流指令的 skill 文件
77
- ├── .cursor/commands/ # Cursor 专用命令格式
78
- ├── .gemini/commands/learn/ # Gemini TOML 格式命令
79
- ├── .learn/ # 你的学习数据(知识图谱、进度)
80
- │ └── topics/
81
- │ └── javascript/
82
- │ ├── state.json # 学习数据(唯一数据源)
83
- │ ├── knowledge-map.md # 由 render.mjs 从 state.json 自动生成
84
- │ └── sessions/
85
- └── ...
86
- ```
87
-
88
- 每个 AI 工具通过适配器模式获得对应格式的文件(Claude 用 YAML frontmatter,Gemini 用 TOML 等)。
89
-
90
- ## 开发
91
-
92
- ```bash
93
- pnpm install
94
- pnpm build # 编译 TypeScript
95
- pnpm test # 运行测试
96
- pnpm dev # 监听模式
97
- pnpm dev:cli # 本地构建并运行 CLI
98
- ```
99
-
100
- ## 许可证
101
-
102
- MIT