codewhale.history 2.8.1 → 2.8.3

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 CHANGED
@@ -38,10 +38,78 @@ codewhale-tools-install -p <target-path> # specific workspace
38
38
  ```
39
39
 
40
40
  ## After install
41
- - **`//tools`** — lists every tool available in the current session
42
- - **`//history`** — lists all chat sessions for the current workspace with cost totals
43
- - **`//snapshot`** toggle pre-edit file backups (`on`, `off`, `status`)
44
- - **`//teach-me`** interactive code quiz that tests your knowledge of the current codebase
41
+
42
+ ### `//tools`
43
+ Lists every tool available in the current session, grouped by category (File I/O,
44
+ Search, Git, Sub-agents, Shell, Planning, etc.), with a brief description of what
45
+ each tool does. Read-only — no files touched.
46
+
47
+ **`//tools help`** or **`//tools readme`** — displays this full README inside any
48
+ CodeWhale session, so you can always reference the command docs without leaving
49
+ the terminal.
50
+
51
+ ### `//history`
52
+ Lists all chat sessions for the current workspace. Each session row shows:
53
+
54
+ - **Date/time** — when the session was created
55
+ - **Title** — session title
56
+ - **Messages** — message count for that session
57
+ - **Tokens** — tokens consumed (with thousands separators)
58
+ - **Cost** — session cost in USD (to 4 decimal places)
59
+ - **Model** — which model was used
60
+
61
+ A **TOTAL** row at the bottom summarizes the number of sessions, total messages,
62
+ total tokens, and total cost across all sessions.
63
+
64
+ ### `//snapshot`
65
+ Toggle pre-edit file backups: `//snapshot on`, `//snapshot off`,
66
+ `//snapshot status`.
67
+
68
+ **Why you'll want this:** Snapshot is designed for folders that are **not** Git
69
+ repos — especially folders full of Office documents (`.docx`, `.pptx`, `.xlsx`,
70
+ `.pdf`) that an AI agent is about to edit. Before every file modification,
71
+ snapshot saves a timestamped copy into `_snapshots/` so you can always get back
72
+ to the pre-AI version:
73
+
74
+ ```
75
+ report.docx → _snapshots/report.2026-06-21_14-30-00.docx
76
+ ```
77
+
78
+ If the workspace already has a `.git` directory, snapshot politely declines —
79
+ Git already has your back.
80
+
81
+ ### `//teach-me`
82
+ An interactive code-teaching quiz that randomly selects real snippets from your
83
+ current project and quizzes you on what they do and how they work. Great for
84
+ onboarding to a new codebase or sharpening your language skills.
85
+
86
+ **Triggers:** `teach me` · `quiz me` · `test my knowledge` · `code quiz` ·
87
+ `drill me`
88
+
89
+ **Modifiers (combine freely):**
90
+
91
+ | Modifier | Example | What it does |
92
+ |----------|---------|-------------|
93
+ | Language | `teach me python` | Restrict to Python, TypeScript, Rust, Go, Java… |
94
+ | Level | `teach me level 3` or `teach me l3` | Set difficulty 1–5 (default: 3) |
95
+ | Scope | `teach me services/` | Narrow to a specific file or folder |
96
+ | Concept | `teach me decorators` | Target: decorators, async, generators, context managers, comprehensions, error handling, type hints, threading |
97
+
98
+ **Difficulty levels:**
99
+
100
+ | Level | Line range | What you'll face |
101
+ |-------|-----------|------------------|
102
+ | 1 | 5–15 | Straight-line logic, `if`/`else`, basic function calls |
103
+ | 2 | 8–20 | Loops, list/dict operations, simple `try`/`except` |
104
+ | 3 | 12–30 | Comprehensions, decorators, `with` statements, multiple branches |
105
+ | 4 | 18–45 | Generators, `async`/`await`, descriptors, threading, closures |
106
+ | 5 | 25–55 | Metaclasses, complex async patterns, multi-threading, architectural glue |
107
+
108
+ **Mid-round commands:** `hint` (get a nudge) · `skip` (see the answer) ·
109
+ `next` (draw a new snippet) · `level N` · `easier` · `harder` · `stop`
110
+
111
+ **At the end** you get a session summary: rounds completed, files covered, what
112
+ you're strong on, what to review, and a suggested next level.
45
113
 
46
114
  ## Requirements
47
115
  - Node.js (for the `codewhale-history` command)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codewhale.history",
3
- "version": "2.8.1",
3
+ "version": "2.8.3",
4
4
  "description": "CodeWhale utility commands: session history, tool listing, file snapshot, interactive code quiz — global install",
5
5
  "bin": {
6
6
  "codewhale-history": "./_list_sessions.js",
@@ -13,6 +13,9 @@ When the user types `//tools`, enumerate every tool available to the model in th
13
13
  3. For each tool, provide the name and a one-line description of what it does
14
14
  4. Present as a readable terminal-friendly list
15
15
 
16
+ ### `//tools help` / `//tools readme`
17
+ When the user types `//tools help` or `//tools readme`, read and display the full tools README from `~/.codewhale/tools-readme.md`. This file is copied during install and contains detailed docs for all four commands: `//tools`, `//history`, `//snapshot`, and `//teach-me`.
18
+
16
19
  ## Notes
17
20
  - Read-only — no files modified or state changed
18
21
  - The tool list is dynamic per-session — do not hardcode it
package/tools-install.js CHANGED
@@ -70,6 +70,17 @@ if (fs.existsSync(instructionsSource)) {
70
70
  console.log(' WARNING: instructions.md not found.');
71
71
  }
72
72
 
73
+ // ── 2b. Copy README for //tools help ───────────────────
74
+ const readmeSource = path.join(sourceDir, 'README.md');
75
+ const readmeDest = path.join(os.homedir(), '.codewhale', 'tools-readme.md');
76
+
77
+ if (fs.existsSync(readmeSource)) {
78
+ fs.copyFileSync(readmeSource, readmeDest);
79
+ console.log(' Copied README.md for //tools help.');
80
+ } else {
81
+ console.log(' WARNING: README.md not found.');
82
+ }
83
+
73
84
  // ── 3. Verify ──────────────────────────────────────────
74
85
  console.log('[3/3] Verifying installation...');
75
86
  let errors = 0;
@@ -79,7 +90,8 @@ const checklist = {
79
90
  'tools skill': path.join(skillsDest, 'tools', 'tools-skill', 'SKILL.md'),
80
91
  'snapshot skill': path.join(skillsDest, 'snapshot', 'SKILL.md'),
81
92
  'teach-me skill': path.join(skillsDest, 'teach-me', 'SKILL.md'),
82
- 'workspace instructions': instructionsDest
93
+ 'workspace instructions': instructionsDest,
94
+ 'tools readme': readmeDest
83
95
  };
84
96
 
85
97
  for (const [name, filePath] of Object.entries(checklist)) {