codewhale.history 2.8.7 → 2.8.8
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 +10 -5
- package/package.json +1 -1
- package/skills/teach-me/SKILL.md +145 -12
package/README.md
CHANGED
|
@@ -78,8 +78,11 @@ Git already has your back.
|
|
|
78
78
|
|
|
79
79
|
### `//teach-me`
|
|
80
80
|
An interactive code-teaching quiz that randomly selects real snippets from your
|
|
81
|
-
current project
|
|
82
|
-
|
|
81
|
+
current project. Two modes across five difficulty levels:
|
|
82
|
+
|
|
83
|
+
- **Passive** (default): Explain what the code does and how it works.
|
|
84
|
+
- **Interactive**: Lines are removed from the file — you restore the missing
|
|
85
|
+
logic, then say `done` for the model to verify your work.
|
|
83
86
|
|
|
84
87
|
**Triggers:** `teach me` · `quiz me` · `test my knowledge` · `code quiz` ·
|
|
85
88
|
`drill me`
|
|
@@ -90,6 +93,7 @@ onboarding to a new codebase or sharpening your language skills.
|
|
|
90
93
|
|----------|---------|-------------|
|
|
91
94
|
| Language | `teach me python` | Restrict to Python, TypeScript, Rust, Go, Java… |
|
|
92
95
|
| Level | `teach me level 3` or `teach me l3` | Set difficulty 1–5 (default: 3) |
|
|
96
|
+
| Mode | `teach me interactive` | Reconstruction mode — you restore missing lines |
|
|
93
97
|
| Scope | `teach me services/` | Narrow to a specific file or folder |
|
|
94
98
|
| Concept | `teach me decorators` | Target: decorators, async, generators, context managers, comprehensions, error handling, type hints, threading |
|
|
95
99
|
|
|
@@ -104,10 +108,11 @@ onboarding to a new codebase or sharpening your language skills.
|
|
|
104
108
|
| 5 | 25–55 | Metaclasses, complex async patterns, multi-threading, architectural glue |
|
|
105
109
|
|
|
106
110
|
**Mid-round commands:** `hint` (get a nudge) · `skip` (see the answer) ·
|
|
107
|
-
`next` (draw a new snippet) · `level N` · `easier` · `harder` ·
|
|
111
|
+
`next` (draw a new snippet) · `level N` · `easier` · `harder` ·
|
|
112
|
+
`interactive` · `passive` · `done` (verify restoration) · `stop`
|
|
108
113
|
|
|
109
|
-
**At the end** you get a session summary: rounds completed, files covered,
|
|
110
|
-
you're strong on, what to review, and a suggested next level.
|
|
114
|
+
**At the end** you get a session summary: rounds completed, mode, files covered,
|
|
115
|
+
what you're strong on, what to review, and a suggested next level.
|
|
111
116
|
|
|
112
117
|
## Requirements
|
|
113
118
|
- Node.js (for the `codewhale-history` command)
|
package/package.json
CHANGED
package/skills/teach-me/SKILL.md
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: teach-me
|
|
3
|
-
description: Interactive code-teaching quiz. Selects random snippets from the current project and quizzes the user on application logic and language semantics. Triggered by 'teach me', 'quiz me', 'test my knowledge', 'code quiz', or 'drill me'. Supports difficulty levels 1–5.
|
|
3
|
+
description: Interactive code-teaching quiz. Selects random snippets from the current project and quizzes the user on application logic and language semantics. Triggered by 'teach me', 'quiz me', 'test my knowledge', 'code quiz', or 'drill me'. Supports difficulty levels 1–5 and two modes: passive (explain) and interactive (reconstruct).
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Teach Me — Interactive Code Quiz
|
|
7
7
|
|
|
8
8
|
An interactive teaching session that randomly selects code snippets from the
|
|
9
|
-
current project
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
current project. Two modes:
|
|
10
|
+
|
|
11
|
+
- **Passive** (default): presents code, asks the user to explain it, and
|
|
12
|
+
provides constructive feedback on **application logic** (what the code
|
|
13
|
+
accomplishes) and **language mechanics** (syntax and semantics).
|
|
14
|
+
- **Interactive**: removes lines from the file; the user restores them and
|
|
15
|
+
says `done`; the model diffs against the original and gives feedback.
|
|
12
16
|
|
|
13
17
|
## Session Trigger
|
|
14
18
|
|
|
@@ -32,7 +36,16 @@ Optionally followed by modifiers:
|
|
|
32
36
|
`teach me error handling`, `teach me type hints`, `teach me threading`
|
|
33
37
|
|
|
34
38
|
Modifiers combine freely: `teach me decorators level 4`,
|
|
35
|
-
`teach me async services/`, `teach me generators l2
|
|
39
|
+
`teach me async services/`, `teach me generators l2`,
|
|
40
|
+
`teach me level 2 interactive`, `teach me interactive decorators`
|
|
41
|
+
|
|
42
|
+
Two modes are available, orthogonal to difficulty:
|
|
43
|
+
|
|
44
|
+
- **`passive`** (default) — You explain what the code does and how it works.
|
|
45
|
+
- **`interactive`** — Lines are removed from the file; you restore the missing
|
|
46
|
+
logic. When done, say `done` or `check my work` and the model verifies.
|
|
47
|
+
|
|
48
|
+
Switch modes mid-session with `interactive` or `passive`.
|
|
36
49
|
|
|
37
50
|
If no level is specified, default to **level 3** and adjust based on
|
|
38
51
|
performance across rounds.
|
|
@@ -112,13 +125,76 @@ match, relax the filter and note the fallback to the user).
|
|
|
112
125
|
| `type hints` | `:` type annotation in function signatures or variable assignments |
|
|
113
126
|
| `threading` | `Thread(`, `Lock(`, `Queue(`, or `threading.` |
|
|
114
127
|
|
|
128
|
+
### 2b. Interactive Mode — Reconstruction
|
|
129
|
+
|
|
130
|
+
When mode is `interactive`, each round follows a different flow from passive
|
|
131
|
+
explanation. The model removes lines from the file and the user restores them.
|
|
132
|
+
|
|
133
|
+
#### Lines Removed by Level
|
|
134
|
+
|
|
135
|
+
| Level | Snippet lines | Lines removed |
|
|
136
|
+
|-------|--------------|---------------|
|
|
137
|
+
| 1 | 5–15 | 1 |
|
|
138
|
+
| 2 | 8–20 | 1–2 |
|
|
139
|
+
| 3 | 12–30 | 1–2 |
|
|
140
|
+
| 4 | 18–45 | 2–3 |
|
|
141
|
+
| 5 | 25–55 | 2–3 |
|
|
142
|
+
|
|
143
|
+
#### Lines to Remove — Selection Heuristic
|
|
144
|
+
|
|
145
|
+
- **Remove:** assignment statements, conditional branches, loop bodies, return
|
|
146
|
+
statements, function calls — lines that carry semantic weight and that
|
|
147
|
+
downstream lines depend on. Removing them should break the function.
|
|
148
|
+
- **Never remove:** imports, blank lines, closing braces/brackets/parens,
|
|
149
|
+
decorator lines, function/class signatures, docstrings, comments.
|
|
150
|
+
- Replace each removed span with a single placeholder comment:
|
|
151
|
+
`# ... N lines removed ...`
|
|
152
|
+
- After removing lines from the file, **save the original lines** in memory for
|
|
153
|
+
later diffing against the user's restoration.
|
|
154
|
+
|
|
155
|
+
#### Interactive Mode Per-Round Flow
|
|
156
|
+
|
|
157
|
+
1. **Select** a snippet using the standard rules (section 2).
|
|
158
|
+
2. **Save** the original lines in memory.
|
|
159
|
+
3. **Remove** 1–3 lines from the actual file on disk using `edit_file`.
|
|
160
|
+
4. **Present** the gapped snippet with the placeholder and the original line
|
|
161
|
+
numbers.
|
|
162
|
+
5. **Instruct:** "Open `<file>`, restore the missing logic at the gap.
|
|
163
|
+
Say `done` or `check my work` when ready."
|
|
164
|
+
6. **Wait.** Do not evaluate, hint, or proceed until the user signals
|
|
165
|
+
completion.
|
|
166
|
+
7. **Re-read** the file. Diff the user's restored lines against the saved
|
|
167
|
+
original.
|
|
168
|
+
8. **Feedback** (see Interactive Evaluation below). Offer to restore the
|
|
169
|
+
original if the user wants to undo.
|
|
170
|
+
|
|
171
|
+
#### Interactive Mode Presentation Format
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
---
|
|
175
|
+
## Round N — Level X · interactive · concept | `path/to/file.py` (lines A–B)
|
|
176
|
+
|
|
177
|
+
```python
|
|
178
|
+
48 risk_amount = capital * (risk_per_trade / 100)
|
|
179
|
+
49 # ... 2 lines removed ...
|
|
180
|
+
50 return max(shares, 0)
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
⚠️ **Interactive — Reconstruction.** 2 lines have been removed (originally
|
|
184
|
+
lines 49–50). Open `path/to/file.py`, find the placeholder, and restore the
|
|
185
|
+
missing logic. When you're done, say **`done`** or **`check my work`**.
|
|
186
|
+
|
|
187
|
+
Type `hint` for a clue, `skip` to see the answer, or `stop` to end.
|
|
188
|
+
---
|
|
189
|
+
```
|
|
190
|
+
|
|
115
191
|
### 3. Presentation — Show the Snippet
|
|
116
192
|
|
|
117
193
|
For each round, present the snippet with its filename:
|
|
118
194
|
|
|
119
195
|
```
|
|
120
196
|
---
|
|
121
|
-
## Round N — Level X · concept | `path/to/file.py` (lines A–B)
|
|
197
|
+
## Round N — Level X · [interactive|passive] · concept | `path/to/file.py` (lines A–B)
|
|
122
198
|
|
|
123
199
|
```python
|
|
124
200
|
42 def calculate_position_size(
|
|
@@ -135,8 +211,8 @@ For each round, present the snippet with its filename:
|
|
|
135
211
|
53 return max(shares, 0)
|
|
136
212
|
```
|
|
137
213
|
|
|
138
|
-
**Your turn:** Explain what this code does (application logic)
|
|
139
|
-
works (syntax and semantics). Include any edge cases you notice.
|
|
214
|
+
**Your turn:** (Passive mode) Explain what this code does (application logic)
|
|
215
|
+
AND how it works (syntax and semantics). Include any edge cases you notice.
|
|
140
216
|
|
|
141
217
|
Type `hint` for a clue, `skip` to see the answer, or `stop` to end.
|
|
142
218
|
---
|
|
@@ -147,6 +223,7 @@ Guidelines:
|
|
|
147
223
|
- Strip only excessive blank lines; keep natural spacing
|
|
148
224
|
- Show the function/class signature with its decorators
|
|
149
225
|
- Show the filename and line range in the header
|
|
226
|
+
- The mode tag (`· interactive` or `· passive`) always appears in the header
|
|
150
227
|
- The `· concept` portion only appears when a concept is targeted; omit it during free-play rounds
|
|
151
228
|
- If the snippet depends on one obvious external type or constant, include a
|
|
152
229
|
brief inline note
|
|
@@ -178,6 +255,46 @@ Evaluate across two dimensions, scaled to the current difficulty level.
|
|
|
178
255
|
| 4 | Generator mechanics (`yield`), `async`/`await` internals, descriptor protocol, closures, threading primitives |
|
|
179
256
|
| 5 | Coroutine internals, metaclass programming, GIL implications, memory model, `__slots__`, MRO, weak references |
|
|
180
257
|
|
|
258
|
+
#### C. Interactive Mode Evaluation
|
|
259
|
+
|
|
260
|
+
When mode is `interactive`, evaluation is a diff between the user's restored
|
|
261
|
+
lines and the saved original:
|
|
262
|
+
|
|
263
|
+
| Outcome | Criteria | Feedback |
|
|
264
|
+
|---------|----------|----------|
|
|
265
|
+
| **Exact match** | Lines match character-for-character | ✅ Perfect. Note what the lines do and why they matter. |
|
|
266
|
+
| **Semantic match** | Same logic, different variable names or formatting | ✅ Good — logic is correct. Note the stylistic difference. |
|
|
267
|
+
| **Partial match** | Some lines correct, some missing/wrong | Point out which line(s) are correct and which need work. Treat as strike 1 or 2 depending on how much is missing. |
|
|
268
|
+
| **No match** | Lines are absent or entirely wrong | Strike-1 nudge toward the missing logic. |
|
|
269
|
+
|
|
270
|
+
Do not use the standard three-strikes verbal pipeline for interactive mode.
|
|
271
|
+
Instead, use targeted hints about what the missing lines should compute:
|
|
272
|
+
|
|
273
|
+
**Strike 1** — Category nudge:
|
|
274
|
+
```
|
|
275
|
+
Not quite. Think about what calculation happens between [visible line above
|
|
276
|
+
the gap] and [visible line below the gap].
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
**Strike 2** — Near-explicit hint:
|
|
280
|
+
```
|
|
281
|
+
You need to [specific operation — e.g., "divide risk_amount by price_risk
|
|
282
|
+
and guard against division by zero"].
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
**Strike 3** — Reveal the original lines and move to the next round:
|
|
286
|
+
```
|
|
287
|
+
Here's what was removed:
|
|
288
|
+
```python
|
|
289
|
+
49 price_risk = abs(entry_price - stop_loss)
|
|
290
|
+
50 if price_risk == 0:
|
|
291
|
+
51 return 0
|
|
292
|
+
52 shares = int(risk_amount / price_risk)
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
After strike 3, restore the original lines in the file and proceed to the
|
|
296
|
+
next round automatically (no "another round?" prompt).
|
|
297
|
+
|
|
181
298
|
#### Weighted Evaluation for Targeted Concepts
|
|
182
299
|
|
|
183
300
|
When a concept is targeted (e.g., `teach me decorators`), bias the
|
|
@@ -256,15 +373,19 @@ nailed everything at-level, say so and highlight the nuance they caught.
|
|
|
256
373
|
| `level N` / `lN` (e.g. `level 5`, `l2`) | Adjust difficulty for subsequent rounds. |
|
|
257
374
|
| `easier` | Decrease level by 1 (minimum 1). |
|
|
258
375
|
| `harder` | Increase level by 1 (maximum 5). |
|
|
259
|
-
| `
|
|
376
|
+
| `interactive` | Switch to interactive (reconstruction) mode for subsequent rounds. |
|
|
377
|
+
| `passive` | Switch to passive (explanation) mode for subsequent rounds. |
|
|
378
|
+
| `done` / `check my work` | (Interactive mode only) Signal that missing lines have been restored. Triggers verification. |
|
|
379
|
+
| `stop` / `end` | End session. Deliver summary. |
|
|
260
380
|
|
|
261
381
|
### 5. Loop — Keep Going
|
|
262
382
|
|
|
263
383
|
After a successful evaluation or a `next` skip, ask:
|
|
264
|
-
"Another round? (yes / no / level N / stop)"
|
|
384
|
+
"Another round? (yes / no / level N / interactive / passive / stop)"
|
|
265
385
|
|
|
266
386
|
After a strike-3 reveal, do **not** ask — proceed directly to the next
|
|
267
|
-
round with:
|
|
387
|
+
round with:
|
|
388
|
+
"Round N+1 — Level X · [mode] | `file.py`"
|
|
268
389
|
|
|
269
390
|
### End-of-Session Summary
|
|
270
391
|
|
|
@@ -274,7 +395,7 @@ When the user says `stop`:
|
|
|
274
395
|
## Session Summary
|
|
275
396
|
|
|
276
397
|
Rounds completed: 5
|
|
277
|
-
Level played: 3
|
|
398
|
+
Level played: 3 · Mode: passive
|
|
278
399
|
Files covered:
|
|
279
400
|
- services/position_sizer.py (rounds 1, 4)
|
|
280
401
|
- agents/news_agent.py (round 2)
|
|
@@ -316,12 +437,24 @@ criteria for the Mechanics axis:
|
|
|
316
437
|
do not squeeze in another round.
|
|
317
438
|
- **Stay in teaching mode.** Do not fix bugs, refactor, or edit code during a
|
|
318
439
|
teaching session unless the user explicitly asks to switch modes.
|
|
440
|
+
- **Interactive mode file edits.** The model MAY remove lines from files to set
|
|
441
|
+
up reconstruction exercises. The model MUST NOT add or modify lines — only
|
|
442
|
+
the user restores code. After the session ends, offer to restore any
|
|
443
|
+
remaining gapped files.
|
|
444
|
+
- **Restore on session end.** When the session ends, check whether any files
|
|
445
|
+
still contain `# ... N lines removed ...` placeholders from interactive mode.
|
|
446
|
+
If so, offer to restore the original lines.
|
|
319
447
|
|
|
320
448
|
## Verification
|
|
321
449
|
|
|
322
450
|
After each round, confirm:
|
|
323
451
|
- The snippet was actually read from the file (not hallucinated)
|
|
324
452
|
- The line numbers match the source
|
|
453
|
+
- The mode was correctly announced in the round header
|
|
325
454
|
- The feedback accurately describes what the code does
|
|
326
455
|
- No secrets or PII were exposed
|
|
327
456
|
- The strike count was tracked correctly
|
|
457
|
+
- (Interactive mode) The original lines were saved before the edit
|
|
458
|
+
- (Interactive mode) The file was re-read before evaluating the user's restoration
|
|
459
|
+
- (Interactive mode) Feedback accurately describes any differences from the original
|
|
460
|
+
- (Interactive mode) Gapped files were restored or the user was offered restoration on session end
|