codewhale.history 2.9.1 → 2.9.2
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 +17 -8
- package/package.json +1 -1
- package/skills/teach-me/SKILL.md +54 -40
package/README.md
CHANGED
|
@@ -78,13 +78,22 @@ 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.
|
|
81
|
+
current project. Two independent dimensions across five difficulty levels:
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
- **
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
**Response mode** (how you answer):
|
|
84
|
+
- **Passive** (default) — Describe your answer in the console.
|
|
85
|
+
- **Interactive** (`teach me interactive`) — Edit the actual file, say `done`.
|
|
86
|
+
|
|
87
|
+
**Content theme** (what it's about):
|
|
88
|
+
- **Standard** (default) — Code comprehension or line reconstruction.
|
|
89
|
+
- **SOLID** (`teach me solid`) — Anti-pattern detection and design restoration.
|
|
90
|
+
|
|
91
|
+
| Trigger | Response | Theme | What happens |
|
|
92
|
+
|---------|----------|-------|-------------|
|
|
93
|
+
| `teach me` | passive | standard | Present code; you explain it |
|
|
94
|
+
| `teach me interactive` | interactive | standard | Lines removed; you restore them |
|
|
95
|
+
| `teach me solid` | passive | solid | Degraded code; you describe fixes |
|
|
96
|
+
| `teach me solid interactive` | interactive | solid | Degraded code; you edit to fix it |
|
|
88
97
|
|
|
89
98
|
**Triggers:** `teach me` · `quiz me` · `test my knowledge` · `code quiz` ·
|
|
90
99
|
`drill me`
|
|
@@ -95,8 +104,8 @@ current project. Three modes across five difficulty levels:
|
|
|
95
104
|
|----------|---------|-------------|
|
|
96
105
|
| Language | `teach me python` | Restrict to Python, TypeScript, Rust, Go, Java… |
|
|
97
106
|
| Level | `teach me level 3` or `teach me l3` | Set difficulty 1–5 (default: 3) |
|
|
98
|
-
|
|
|
99
|
-
|
|
|
107
|
+
| Response | `teach me interactive` | Edit the file instead of describing |
|
|
108
|
+
| Theme | `teach me solid` | Anti-pattern detection — fix degraded design |
|
|
100
109
|
| Scope | `teach me services/` | Narrow to a specific file or folder |
|
|
101
110
|
| Concept | `teach me decorators` | Target: decorators, async, generators, context managers, comprehensions, error handling, type hints, threading |
|
|
102
111
|
|
package/package.json
CHANGED
package/skills/teach-me/SKILL.md
CHANGED
|
@@ -6,16 +6,25 @@ description: Interactive code-teaching quiz. Selects random snippets from the cu
|
|
|
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. Two
|
|
9
|
+
current project. Two independent dimensions combine to form each exercise:
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- **
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
**Response mode** (how you answer — mid-session commands `passive` / `interactive`):
|
|
12
|
+
- **`passive`** (default) — You describe your answer in the console.
|
|
13
|
+
- **`interactive`** — You edit the actual file, then say `done` for verification.
|
|
14
|
+
|
|
15
|
+
**Content theme** (what the exercise is about — trigger keyword `solid`):
|
|
16
|
+
- **Standard** (default) — Code comprehension or line reconstruction.
|
|
17
|
+
- **`solid`** / **`SOLID`** — Anti-pattern detection and design restoration.
|
|
18
|
+
|
|
19
|
+
| Trigger | Response | Theme | What happens |
|
|
20
|
+
|---------|----------|-------|-------------|
|
|
21
|
+
| `teach me` | passive | standard | Present code; you explain what it does and how it works |
|
|
22
|
+
| `teach me interactive` | interactive | standard | Lines removed from file; you restore them, say `done` |
|
|
23
|
+
| `teach me solid` | passive | solid | Code rewritten with anti-patterns; you describe design fixes |
|
|
24
|
+
| `teach me solid interactive` | interactive | solid | Code rewritten with anti-patterns; you edit the file to restore good design, say `done` |
|
|
25
|
+
|
|
26
|
+
Level, scope, language, and concept modifiers combine freely with any
|
|
27
|
+
combination above.
|
|
19
28
|
|
|
20
29
|
## Session Trigger
|
|
21
30
|
|
|
@@ -37,22 +46,14 @@ Optionally followed by modifiers:
|
|
|
37
46
|
`teach me decorators`, `teach me async`, `teach me generators`,
|
|
38
47
|
`teach me context managers`, `teach me comprehensions`,
|
|
39
48
|
`teach me error handling`, `teach me type hints`, `teach me threading`
|
|
49
|
+
- `teach me interactive` — edit the file (instead of describing)
|
|
50
|
+
- `teach me solid` / `teach me SOLID` — anti-pattern restoration theme
|
|
40
51
|
|
|
41
52
|
Modifiers combine freely: `teach me decorators level 4`,
|
|
42
53
|
`teach me async services/`, `teach me generators l2`,
|
|
43
54
|
`teach me level 2 interactive`, `teach me interactive decorators`,
|
|
44
|
-
`teach me solid level 3`, `teach me SOLID
|
|
45
|
-
|
|
46
|
-
Three modes are available, orthogonal to difficulty:
|
|
47
|
-
|
|
48
|
-
- **`passive`** (default) — You explain what the code does and how it works.
|
|
49
|
-
- **`interactive`** — Lines are removed from the file; you restore the missing
|
|
50
|
-
logic. When done, say `done` or `check my work` and the model verifies.
|
|
51
|
-
- **`solid`** / **`SOLID`** — Working code is rewritten with deliberate
|
|
52
|
-
anti-patterns (breaks SOLID, DRY, cohesion, abstraction). You restore good
|
|
53
|
-
design principles. When done, say `done` or `check my work`.
|
|
54
|
-
|
|
55
|
-
Switch modes mid-session with `passive`, `interactive`, or `solid`.
|
|
55
|
+
`teach me solid level 3`, `teach me SOLID`,
|
|
56
|
+
`teach me solid interactive`
|
|
56
57
|
|
|
57
58
|
If no level is specified, default to **level 3** and adjust based on
|
|
58
59
|
performance across rounds.
|
|
@@ -132,10 +133,11 @@ match, relax the filter and note the fallback to the user).
|
|
|
132
133
|
| `type hints` | `:` type annotation in function signatures or variable assignments |
|
|
133
134
|
| `threading` | `Thread(`, `Lock(`, `Queue(`, or `threading.` |
|
|
134
135
|
|
|
135
|
-
### 2b. Interactive
|
|
136
|
+
### 2b. Interactive (Standard) — Line Reconstruction
|
|
136
137
|
|
|
137
|
-
When mode is `interactive
|
|
138
|
-
explanation. The model removes lines from the
|
|
138
|
+
When response mode is `interactive` (and theme is standard), each round follows
|
|
139
|
+
a different flow from passive explanation. The model removes lines from the
|
|
140
|
+
file and the user restores them.
|
|
139
141
|
|
|
140
142
|
#### Lines Removed by Level
|
|
141
143
|
|
|
@@ -211,13 +213,19 @@ Type `hint` for a clue, `skip` to see the answer, or `stop` to end.
|
|
|
211
213
|
---
|
|
212
214
|
```
|
|
213
215
|
|
|
214
|
-
### 2c. SOLID
|
|
216
|
+
### 2c. SOLID Theme — Anti-Pattern Reconstruction
|
|
215
217
|
|
|
216
|
-
When
|
|
217
|
-
deliberately anti-pattern-ridden — breaking SOLID principles, DRY, cohesion,
|
|
218
|
+
When content theme is `solid` (or `SOLID`), the model rewrites working code to
|
|
219
|
+
be deliberately anti-pattern-ridden — breaking SOLID principles, DRY, cohesion,
|
|
218
220
|
and abstraction — while keeping the code functional. The user must restore
|
|
219
221
|
good design.
|
|
220
222
|
|
|
223
|
+
SOLID theme works with both response modes:
|
|
224
|
+
- **passive + solid** (`teach me solid`): User describes design fixes in console.
|
|
225
|
+
- **interactive + solid** (`teach me solid interactive`): User edits the file.
|
|
226
|
+
|
|
227
|
+
The per-round flow below covers both; where they differ, both variants are noted.
|
|
228
|
+
|
|
221
229
|
#### Scope by Level
|
|
222
230
|
|
|
223
231
|
| Level | Scope | Anti-patterns introduced |
|
|
@@ -250,7 +258,7 @@ anti-patterns appropriate to the language and scope:
|
|
|
250
258
|
- God object — one class/method that knows and does everything
|
|
251
259
|
- Shotgun surgery — one change requires touching many files/methods
|
|
252
260
|
|
|
253
|
-
#### SOLID
|
|
261
|
+
#### SOLID Theme Per-Round Flow
|
|
254
262
|
|
|
255
263
|
0. **Snapshot git state.** Run `git status --porcelain <file>` before touching it.
|
|
256
264
|
1. **Select** a snippet using the standard rules (section 2). For levels 3–5,
|
|
@@ -262,14 +270,20 @@ anti-patterns appropriate to the language and scope:
|
|
|
262
270
|
4. **Present** the deconstructed code. State the scope, the number of
|
|
263
271
|
anti-patterns introduced, but do NOT name or annotate them — the user must
|
|
264
272
|
find them.
|
|
265
|
-
5. **Instruct
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
+
5. **Instruct** (depends on response mode):
|
|
274
|
+
- *Interactive:* "Open `<file>`, fix the [N] anti-patterns. Say `done`."
|
|
275
|
+
- *Passive:* "Describe how you'd improve this code — what anti-patterns do
|
|
276
|
+
you see, and how would you fix them?"
|
|
277
|
+
6. **Wait.** Do not evaluate until the user signals completion (`done` or answer).
|
|
278
|
+
7. **Evaluate** (depends on response mode):
|
|
279
|
+
- *Interactive:* Re-read the file. Compare against saved original.
|
|
280
|
+
- *Passive:* Evaluate the user's description against the anti-patterns
|
|
281
|
+
that were introduced. No file re-read needed.
|
|
282
|
+
8. **Feedback** (see SOLID Evaluation below).
|
|
283
|
+
9. **Restore.** After feedback, `git checkout -- <file>` for a byte-perfect
|
|
284
|
+
reset. If pre-existing uncommitted changes (step 0), warn the user. For
|
|
285
|
+
passive mode, no file was modified by the user, but the deconstructed
|
|
286
|
+
code the model wrote must still be restored.
|
|
273
287
|
|
|
274
288
|
#### Thinking Suppression (SOLID Mode)
|
|
275
289
|
|
|
@@ -281,7 +295,7 @@ original code or the specific anti-patterns chosen in your reasoning.
|
|
|
281
295
|
|
|
282
296
|
```
|
|
283
297
|
---
|
|
284
|
-
## Round N — Level X · solid | `path/to/file.py` (lines A–B)
|
|
298
|
+
## Round N — Level X · passive · solid | `path/to/file.py` (lines A–B)
|
|
285
299
|
|
|
286
300
|
```python
|
|
287
301
|
42 class ReportGenerator:
|
|
@@ -320,7 +334,7 @@ For each round, present the snippet with its filename:
|
|
|
320
334
|
|
|
321
335
|
```
|
|
322
336
|
---
|
|
323
|
-
## Round N — Level X · [interactive
|
|
337
|
+
## Round N — Level X · [passive|interactive] · [concept|solid] | `path/to/file.py` (lines A–B)
|
|
324
338
|
|
|
325
339
|
```python
|
|
326
340
|
42 def calculate_position_size(
|
|
@@ -349,8 +363,8 @@ Guidelines:
|
|
|
349
363
|
- Strip only excessive blank lines; keep natural spacing
|
|
350
364
|
- Show the function/class signature with its decorators
|
|
351
365
|
- Show the filename and line range in the header
|
|
352
|
-
- The mode tag (`·
|
|
353
|
-
- The `·
|
|
366
|
+
- The response mode tag (`· passive` or `· interactive`) always appears in the header
|
|
367
|
+
- The theme/concept tag (`· solid` for SOLID theme, or `· decorators` etc. for targeted concept) appears when applicable; omit during free-play standard rounds
|
|
354
368
|
- If the snippet depends on one obvious external type or constant, include a
|
|
355
369
|
brief inline note
|
|
356
370
|
- **Before presenting, scan for secrets.** Redact API keys, tokens, passwords,
|