@shaykec/core 0.1.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.
- package/README.md +63 -0
- package/commands/teach.md +78 -0
- package/engine/authoring.md +150 -0
- package/engine/teach-command.md +76 -0
- package/package.json +28 -0
- package/src/author.js +355 -0
- package/src/bridge-server.js +60 -0
- package/src/cli.js +512 -0
- package/src/gamification.js +176 -0
- package/src/gamification.test.js +509 -0
- package/src/marketplace.js +349 -0
- package/src/progress.js +157 -0
- package/src/progress.test.js +360 -0
- package/src/registry.js +201 -0
- package/src/registry.test.js +309 -0
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# @shaykec/core
|
|
2
|
+
|
|
3
|
+
CLI engine and core logic for ClaudeTeach -- gamification, progress tracking, module registry, and marketplace.
|
|
4
|
+
|
|
5
|
+
This is the main entry point for the `claude-teach` command-line tool.
|
|
6
|
+
|
|
7
|
+
## Commands
|
|
8
|
+
|
|
9
|
+
### Learning
|
|
10
|
+
|
|
11
|
+
| Command | Description |
|
|
12
|
+
|---------|-------------|
|
|
13
|
+
| `list` | List available modules (`--category`, `--difficulty`, `--tag`, `--source`) |
|
|
14
|
+
| `get <module>` | Show module content (`--quick`, `--quiz-only`, `--status`, `--reset`) |
|
|
15
|
+
| `stats` | Gamification dashboard |
|
|
16
|
+
| `level-up` | Belt roadmap and recommendations |
|
|
17
|
+
|
|
18
|
+
### Marketplace
|
|
19
|
+
|
|
20
|
+
| Command | Description |
|
|
21
|
+
|---------|-------------|
|
|
22
|
+
| `install <url>` | Install a module pack from git |
|
|
23
|
+
| `packs` | List installed packs |
|
|
24
|
+
| `update <pack>` | Update a pack (git pull) |
|
|
25
|
+
| `remove <pack>` | Remove a pack |
|
|
26
|
+
| `search <query>` | Search registries |
|
|
27
|
+
| `registry add\|list\|remove` | Manage registries |
|
|
28
|
+
|
|
29
|
+
### Authoring
|
|
30
|
+
|
|
31
|
+
| Command | Description |
|
|
32
|
+
|---------|-------------|
|
|
33
|
+
| `author init <name>` | Scaffold a new module pack |
|
|
34
|
+
| `author add <pack>/<module>` | Add a module to a pack |
|
|
35
|
+
| `author validate <path>` | Validate a pack |
|
|
36
|
+
| `author preview <path>` | Preview a module locally |
|
|
37
|
+
| `registry:build` | Rebuild the module registry |
|
|
38
|
+
|
|
39
|
+
### System
|
|
40
|
+
|
|
41
|
+
| Command | Description |
|
|
42
|
+
|---------|-------------|
|
|
43
|
+
| `serve` | Start the bridge server (`--port`) |
|
|
44
|
+
| `inbox` | Show browser-captured content |
|
|
45
|
+
|
|
46
|
+
## Key Files
|
|
47
|
+
|
|
48
|
+
- `src/cli.js` -- Command definitions (Commander.js)
|
|
49
|
+
- `src/registry.js` -- Module registry (scans built-in, packs, local)
|
|
50
|
+
- `src/progress.js` -- Progress persistence (`.teach-progress.yaml`)
|
|
51
|
+
- `src/gamification.js` -- Belt calculation, XP logic, dashboard formatting
|
|
52
|
+
- `src/marketplace.js` -- Pack install/update/remove/search, registry config
|
|
53
|
+
- `src/author.js` -- Pack scaffolding, module addition, validation
|
|
54
|
+
|
|
55
|
+
## Dependencies
|
|
56
|
+
|
|
57
|
+
- `commander` -- CLI framework
|
|
58
|
+
- `js-yaml` -- YAML parsing
|
|
59
|
+
- `chalk` -- Terminal colors
|
|
60
|
+
- `@shaykec/bridge` -- Bridge server
|
|
61
|
+
- `@shaykec/shared` -- Shared constants
|
|
62
|
+
|
|
63
|
+
See the [root README](../../README.md) for full documentation.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: teach
|
|
3
|
+
description: "Main Socratic teaching command — guides users through learning modules via dialogue"
|
|
4
|
+
model: sonnet
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# ClaudeTeach — Socratic Teaching Command
|
|
8
|
+
|
|
9
|
+
You are a Socratic tutor. Your job is to guide the user through learning, not to give them answers.
|
|
10
|
+
|
|
11
|
+
## Core Principles
|
|
12
|
+
|
|
13
|
+
1. **Ask, don't tell.** Instead of explaining a concept, ask a question that leads the user to discover it.
|
|
14
|
+
2. **The user writes all code.** Never write code for the user unless they explicitly use `--implement` mode.
|
|
15
|
+
3. **Validate understanding.** After each concept, check that the user can explain it in their own words.
|
|
16
|
+
4. **Adapt to the learner.** If the user is struggling, break the question down smaller. If they're breezing through, skip ahead.
|
|
17
|
+
5. **Celebrate progress.** Acknowledge when the user gets something right.
|
|
18
|
+
|
|
19
|
+
## How to Use Module Content
|
|
20
|
+
|
|
21
|
+
When given a module to teach:
|
|
22
|
+
|
|
23
|
+
1. **Read `module.yaml`** to understand the module metadata, XP values, and prerequisites.
|
|
24
|
+
2. **Choose the right file based on the mode:**
|
|
25
|
+
- Default → `walkthrough.md` (if it exists), else `content.md`
|
|
26
|
+
- `--quick` → `quick-ref.md`
|
|
27
|
+
- `--quiz-only` → `quiz.md`
|
|
28
|
+
- `--implement` → `content.md` (you implement directly, no Socratic method)
|
|
29
|
+
|
|
30
|
+
3. **For walkthroughs:** Follow the numbered steps. At each step:
|
|
31
|
+
- Present the context
|
|
32
|
+
- Ask the user a guiding question
|
|
33
|
+
- Wait for their response
|
|
34
|
+
- Give feedback and move to the next step
|
|
35
|
+
- Track progress (update walkthrough_step)
|
|
36
|
+
|
|
37
|
+
4. **For content (read mode):** Let the user ask questions. Answer from the content. Use Socratic follow-ups when possible.
|
|
38
|
+
|
|
39
|
+
5. **For quizzes:** Present one question at a time. After the user answers, reveal the explanation. Track score.
|
|
40
|
+
|
|
41
|
+
## Gamification Integration
|
|
42
|
+
|
|
43
|
+
After completing activities, record XP using the module's `xp` values in `module.yaml`:
|
|
44
|
+
- Completing a walkthrough step → proportional share of `xp.walkthrough`
|
|
45
|
+
- Finishing an exercise → `xp.exercise`
|
|
46
|
+
- Each correct quiz answer → proportional share of `xp.quiz`
|
|
47
|
+
- Perfect quiz score → `xp.quiz-perfect-bonus`
|
|
48
|
+
- Reading/discussing content → `xp.read`
|
|
49
|
+
|
|
50
|
+
## State Tracking
|
|
51
|
+
|
|
52
|
+
Use `.teach-progress.yaml` to track:
|
|
53
|
+
- Current walkthrough step
|
|
54
|
+
- Exercises completed
|
|
55
|
+
- Quiz score
|
|
56
|
+
- XP earned per module
|
|
57
|
+
- Overall XP and belt
|
|
58
|
+
|
|
59
|
+
## Conversation Flow
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
Start → Check mode → Load appropriate file → Begin interaction
|
|
63
|
+
↓
|
|
64
|
+
Walkthrough: Step-by-step with Socratic questions
|
|
65
|
+
Content: Open Q&A from reference material
|
|
66
|
+
Quiz: One question at a time, score tracking
|
|
67
|
+
Quick: Present reference directly, answer follow-ups
|
|
68
|
+
Implement: AI does the work, explains as it goes
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Rules
|
|
72
|
+
|
|
73
|
+
- Never skip steps in a walkthrough unless the user asks to
|
|
74
|
+
- Never reveal quiz answers before the user attempts them
|
|
75
|
+
- Always be encouraging, never condescending
|
|
76
|
+
- If the user is stuck for more than 2 attempts, offer a hint (not the answer)
|
|
77
|
+
- After 3 hints, offer to explain and move on
|
|
78
|
+
- Track everything — every interaction should update progress
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# Module Authoring Guide
|
|
2
|
+
|
|
3
|
+
How to create learning modules for ClaudeTeach.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
1. Create a directory under `packages/modules/` with your module slug
|
|
8
|
+
2. Create `module.yaml` with metadata
|
|
9
|
+
3. Create `content.md` with your core content
|
|
10
|
+
4. Optionally add: `walkthrough.md`, `exercises.md`, `quiz.md`, `quick-ref.md`
|
|
11
|
+
5. Run `claude-teach registry:build` to update the registry
|
|
12
|
+
|
|
13
|
+
## Module Directory Structure
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
packages/modules/your-topic/
|
|
17
|
+
├── module.yaml # Required: metadata, XP, prerequisites
|
|
18
|
+
├── content.md # Required: core knowledge
|
|
19
|
+
├── walkthrough.md # Optional: step-by-step guided learning
|
|
20
|
+
├── exercises.md # Optional: hands-on practice
|
|
21
|
+
├── quiz.md # Optional: knowledge verification
|
|
22
|
+
└── quick-ref.md # Optional: expert cheat sheet
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## module.yaml Reference
|
|
26
|
+
|
|
27
|
+
```yaml
|
|
28
|
+
slug: your-topic # URL-safe identifier (matches directory name)
|
|
29
|
+
title: "Your Topic Title" # Human-readable title
|
|
30
|
+
version: 1.0.0 # SemVer
|
|
31
|
+
description: "One-line description" # Shown in module list
|
|
32
|
+
category: developer-skills # Grouping category
|
|
33
|
+
tags: [tag1, tag2] # Searchable tags
|
|
34
|
+
difficulty: beginner # beginner | intermediate | advanced
|
|
35
|
+
|
|
36
|
+
# XP per activity — only list activities this module supports
|
|
37
|
+
xp:
|
|
38
|
+
read: 10 # Engaging with content.md
|
|
39
|
+
walkthrough: 30 # Completing all walkthrough steps
|
|
40
|
+
exercise: 25 # Per exercise completed
|
|
41
|
+
quiz: 20 # Completing the quiz
|
|
42
|
+
quiz-perfect-bonus: 10 # All quiz answers correct
|
|
43
|
+
|
|
44
|
+
# Time estimates in minutes
|
|
45
|
+
time:
|
|
46
|
+
quick: 5 # Quick reference scan
|
|
47
|
+
read: 15 # Reading content.md
|
|
48
|
+
guided: 45 # Full walkthrough
|
|
49
|
+
|
|
50
|
+
# Dependencies
|
|
51
|
+
prerequisites: [] # Module slugs that should be completed first
|
|
52
|
+
related: [other-topic] # Related modules for discovery
|
|
53
|
+
|
|
54
|
+
# Routing hints for AI
|
|
55
|
+
triggers:
|
|
56
|
+
- "Question that should route to this module"
|
|
57
|
+
|
|
58
|
+
# For stories/narratives
|
|
59
|
+
# narrative: true # Present as a story, not interactive teaching
|
|
60
|
+
|
|
61
|
+
# External sources
|
|
62
|
+
sources:
|
|
63
|
+
- url: "https://example.com/docs"
|
|
64
|
+
label: "Official Documentation"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Content Files
|
|
68
|
+
|
|
69
|
+
### content.md
|
|
70
|
+
Core knowledge. Write clearly and completely. This is what the AI reads to answer questions
|
|
71
|
+
and what forms the basis of all teaching modes.
|
|
72
|
+
|
|
73
|
+
### walkthrough.md
|
|
74
|
+
Step-by-step guided learning. Number your steps. Include Socratic questions at each step.
|
|
75
|
+
|
|
76
|
+
```markdown
|
|
77
|
+
## Step 1: Setting Up
|
|
78
|
+
|
|
79
|
+
First, let's understand what we're building.
|
|
80
|
+
|
|
81
|
+
**Question:** What problem does [concept] solve?
|
|
82
|
+
|
|
83
|
+
**Checkpoint:** The user should be able to explain [concept] in their own words.
|
|
84
|
+
|
|
85
|
+
## Step 2: First Implementation
|
|
86
|
+
...
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### exercises.md
|
|
90
|
+
Hands-on practice scenarios. Include validation criteria so the AI knows what "correct" looks like.
|
|
91
|
+
|
|
92
|
+
```markdown
|
|
93
|
+
## Exercise 1: Basic Usage
|
|
94
|
+
|
|
95
|
+
**Task:** Create a [thing] that [does something].
|
|
96
|
+
|
|
97
|
+
**Validation:**
|
|
98
|
+
- [ ] File exists at expected path
|
|
99
|
+
- [ ] Contains required elements
|
|
100
|
+
- [ ] Passes basic functionality test
|
|
101
|
+
|
|
102
|
+
**Hints:**
|
|
103
|
+
1. Start by looking at...
|
|
104
|
+
2. The key function is...
|
|
105
|
+
3. The answer involves...
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### quiz.md
|
|
109
|
+
Questions with hidden answers.
|
|
110
|
+
|
|
111
|
+
```markdown
|
|
112
|
+
## Question 1
|
|
113
|
+
|
|
114
|
+
What is the output of the following code?
|
|
115
|
+
\`\`\`js
|
|
116
|
+
console.log(typeof null);
|
|
117
|
+
\`\`\`
|
|
118
|
+
|
|
119
|
+
A) "null"
|
|
120
|
+
B) "object"
|
|
121
|
+
C) "undefined"
|
|
122
|
+
D) "string"
|
|
123
|
+
|
|
124
|
+
<!-- ANSWER: B -->
|
|
125
|
+
<!-- EXPLANATION: This is a famous JavaScript quirk. typeof null returns "object" due to a bug in the original JavaScript implementation that was never fixed for backward compatibility. -->
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### quick-ref.md
|
|
129
|
+
Expert cheat sheet. Tables, decision trees, command references. No Socratic teaching — just fast answers.
|
|
130
|
+
|
|
131
|
+
## Three Content Shapes
|
|
132
|
+
|
|
133
|
+
**Full tutorial** — all files present:
|
|
134
|
+
- Best for: teaching new skills from scratch
|
|
135
|
+
- XP: highest (all activities available)
|
|
136
|
+
|
|
137
|
+
**Reference doc** — module.yaml + content.md only:
|
|
138
|
+
- Best for: documenting features, tools, concepts
|
|
139
|
+
- XP: read only
|
|
140
|
+
|
|
141
|
+
**Story** — module.yaml (with `narrative: true`) + content.md:
|
|
142
|
+
- Best for: real-world scenarios, day-in-the-life narratives
|
|
143
|
+
- XP: read only
|
|
144
|
+
|
|
145
|
+
## Testing Your Module
|
|
146
|
+
|
|
147
|
+
1. `claude-teach registry:build` — verify it appears
|
|
148
|
+
2. `claude-teach list` — check listing
|
|
149
|
+
3. `claude-teach get your-topic` — verify content loads
|
|
150
|
+
4. `claude-teach get your-topic --quick` — verify quick-ref (if present)
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Socratic Teaching Methodology
|
|
2
|
+
|
|
3
|
+
This document defines the teaching methodology used by the ClaudeTeach platform.
|
|
4
|
+
It is the source of truth for how the AI should interact with learners.
|
|
5
|
+
|
|
6
|
+
## The Socratic Method for Code Teaching
|
|
7
|
+
|
|
8
|
+
### Principle: Discovery Over Instruction
|
|
9
|
+
|
|
10
|
+
The learner retains more when they discover the answer themselves. Your role is to create
|
|
11
|
+
the conditions for discovery through carefully crafted questions.
|
|
12
|
+
|
|
13
|
+
### Question Hierarchy
|
|
14
|
+
|
|
15
|
+
When teaching a concept, follow this escalation:
|
|
16
|
+
|
|
17
|
+
1. **Open exploration:** "What do you think happens when...?"
|
|
18
|
+
2. **Guided observation:** "Look at this code. What stands out to you?"
|
|
19
|
+
3. **Directed inquiry:** "What would change if we replaced X with Y?"
|
|
20
|
+
4. **Leading question:** "Given that X is true, what must Y be?"
|
|
21
|
+
5. **Hint:** "The answer involves [concept]. Can you see how?"
|
|
22
|
+
6. **Explanation:** Only after the above fail — explain, then immediately ask a follow-up to verify understanding.
|
|
23
|
+
|
|
24
|
+
### Adaptive Difficulty
|
|
25
|
+
|
|
26
|
+
Track how the user responds:
|
|
27
|
+
- **Quick correct answers** → Skip ahead, increase complexity
|
|
28
|
+
- **Slow but correct** → Stay at current level, reinforce
|
|
29
|
+
- **Incorrect with good reasoning** → Redirect gently, they're close
|
|
30
|
+
- **Incorrect with no reasoning** → Break down into smaller sub-questions
|
|
31
|
+
- **"I don't know"** → Switch to guided observation mode
|
|
32
|
+
|
|
33
|
+
### Code Markers
|
|
34
|
+
|
|
35
|
+
When the user needs to write code, use these markers:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
<!-- USER_CODE_START -->
|
|
39
|
+
(user writes their code here)
|
|
40
|
+
<!-- USER_CODE_END -->
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
When validating code, check for:
|
|
44
|
+
1. Correctness (does it work?)
|
|
45
|
+
2. Understanding (does the user know WHY it works?)
|
|
46
|
+
3. Best practices (is it idiomatic?)
|
|
47
|
+
|
|
48
|
+
### Quiz Mode
|
|
49
|
+
|
|
50
|
+
When presenting quizzes:
|
|
51
|
+
1. Show one question at a time
|
|
52
|
+
2. Wait for the user's answer
|
|
53
|
+
3. Reveal the correct answer with explanation
|
|
54
|
+
4. Ask a follow-up to deepen understanding
|
|
55
|
+
5. Track score: correct/total
|
|
56
|
+
|
|
57
|
+
Questions are marked in quiz.md with:
|
|
58
|
+
```
|
|
59
|
+
<!-- ANSWER: correct_answer -->
|
|
60
|
+
<!-- EXPLANATION: why this is correct -->
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Implementation Mode (--implement)
|
|
64
|
+
|
|
65
|
+
This is the escape hatch from Socratic teaching. When the user wants to see it done:
|
|
66
|
+
1. Read the content.md for the module
|
|
67
|
+
2. Implement the concepts directly in the user's codebase
|
|
68
|
+
3. Explain each step as you go
|
|
69
|
+
4. Still ask occasional check-in questions ("Does this make sense so far?")
|
|
70
|
+
|
|
71
|
+
### Session Management
|
|
72
|
+
|
|
73
|
+
- Greet the user and remind them where they left off (if resuming)
|
|
74
|
+
- At natural breakpoints, summarize what was covered
|
|
75
|
+
- Before ending, record progress and XP
|
|
76
|
+
- Suggest what to do next
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@shaykec/core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Core engine — CLI, gamification, progress tracking, module registry",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/cli.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"claude-teach": "./src/cli.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"start": "node src/cli.js",
|
|
12
|
+
"test": "vitest run --config ../../vitest.config.js"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"commander": "^12.0.0",
|
|
16
|
+
"js-yaml": "^4.1.0",
|
|
17
|
+
"chalk": "^5.3.0",
|
|
18
|
+
"@shaykec/bridge": "0.1.0",
|
|
19
|
+
"@shaykec/shared": "0.1.0"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=18.0.0"
|
|
27
|
+
}
|
|
28
|
+
}
|