expert-mentor 0.6.2__tar.gz

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.
Files changed (47) hide show
  1. expert_mentor-0.6.2/.github/workflows/ci.yml +44 -0
  2. expert_mentor-0.6.2/.github/workflows/release.yml +77 -0
  3. expert_mentor-0.6.2/CHANGELOG.md +72 -0
  4. expert_mentor-0.6.2/CONTRIBUTING.md +51 -0
  5. expert_mentor-0.6.2/LICENSE +21 -0
  6. expert_mentor-0.6.2/MANIFEST.in +12 -0
  7. expert_mentor-0.6.2/Makefile +59 -0
  8. expert_mentor-0.6.2/PKG-INFO +189 -0
  9. expert_mentor-0.6.2/README.md +158 -0
  10. expert_mentor-0.6.2/SKILL.md +294 -0
  11. expert_mentor-0.6.2/bin/mentor +28 -0
  12. expert_mentor-0.6.2/docs/agensi-listing.md +70 -0
  13. expert_mentor-0.6.2/docs/commands.md +141 -0
  14. expert_mentor-0.6.2/docs/configuration.md +81 -0
  15. expert_mentor-0.6.2/docs/development.md +86 -0
  16. expert_mentor-0.6.2/docs/diagrams.md +98 -0
  17. expert_mentor-0.6.2/docs/getting-started.md +79 -0
  18. expert_mentor-0.6.2/docs/index.md +51 -0
  19. expert_mentor-0.6.2/docs/learning.md +99 -0
  20. expert_mentor-0.6.2/docs/providers.md +112 -0
  21. expert_mentor-0.6.2/docs/skill.md +73 -0
  22. expert_mentor-0.6.2/examples/contract-law.openai.json +15 -0
  23. expert_mentor-0.6.2/examples/cpp.google.transcript.formatted.md +90 -0
  24. expert_mentor-0.6.2/examples/cpp.google.transcript.md +73 -0
  25. expert_mentor-0.6.2/examples/generic-fallback.prompt.txt +139 -0
  26. expert_mentor-0.6.2/examples/macroeconomics.anthropic.json +12 -0
  27. expert_mentor-0.6.2/examples/quantum-computing.prompt.md +155 -0
  28. expert_mentor-0.6.2/examples/rust.ollama.Modelfile +35 -0
  29. expert_mentor-0.6.2/pyproject.toml +60 -0
  30. expert_mentor-0.6.2/references/fields.md +64 -0
  31. expert_mentor-0.6.2/references/pedagogy.md +90 -0
  32. expert_mentor-0.6.2/references/providers.md +132 -0
  33. expert_mentor-0.6.2/scripts/expert_mentor.egg-info/PKG-INFO +189 -0
  34. expert_mentor-0.6.2/scripts/expert_mentor.egg-info/SOURCES.txt +45 -0
  35. expert_mentor-0.6.2/scripts/expert_mentor.egg-info/dependency_links.txt +1 -0
  36. expert_mentor-0.6.2/scripts/expert_mentor.egg-info/entry_points.txt +3 -0
  37. expert_mentor-0.6.2/scripts/expert_mentor.egg-info/top_level.txt +4 -0
  38. expert_mentor-0.6.2/scripts/expert_mentor.py +1843 -0
  39. expert_mentor-0.6.2/scripts/mentor_cards.py +188 -0
  40. expert_mentor-0.6.2/scripts/mentor_memory.py +271 -0
  41. expert_mentor-0.6.2/scripts/mentor_runtime.py +488 -0
  42. expert_mentor-0.6.2/setup.cfg +4 -0
  43. expert_mentor-0.6.2/templates/cards_prompt.md +33 -0
  44. expert_mentor-0.6.2/templates/compact_prompt.md +34 -0
  45. expert_mentor-0.6.2/templates/curriculum_prompt.md +63 -0
  46. expert_mentor-0.6.2/templates/mentor_system_prompt.md +132 -0
  47. expert_mentor-0.6.2/templates/review_prompt.md +40 -0
@@ -0,0 +1,44 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ name: test (Python ${{ matrix.python-version }})
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ python-version: ["3.8", "3.10", "3.12"]
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - uses: actions/setup-python@v5
19
+ with:
20
+ python-version: ${{ matrix.python-version }}
21
+
22
+ - name: Run self-test suite
23
+ run: python scripts/selftest.py
24
+
25
+ - name: Health check
26
+ run: python scripts/expert_mentor.py doctor
27
+
28
+ - name: Generate a sample prompt
29
+ run: python scripts/expert_mentor.py --field "quantum computing" --level beginner > /dev/null
30
+
31
+ package:
32
+ name: build & install
33
+ runs-on: ubuntu-latest
34
+ steps:
35
+ - uses: actions/checkout@v4
36
+ - uses: actions/setup-python@v5
37
+ with:
38
+ python-version: "3.12"
39
+ - name: Install the package
40
+ run: pip install .
41
+ - name: Verify console entry point
42
+ run: mentor version
43
+ - name: Verify bundled resources resolve after install
44
+ run: mentor fields
@@ -0,0 +1,77 @@
1
+ name: Release
2
+
3
+ # Publishes to PyPI using Trusted Publishing (OIDC) — no API token stored.
4
+ #
5
+ # One-time setup on PyPI:
6
+ # https://pypi.org/manage/account/publishing/
7
+ # Add a "pending publisher" with:
8
+ # PyPI project name: expert-mentor
9
+ # Owner: <your GitHub username or org>
10
+ # Repository name: <this repo>
11
+ # Workflow name: release.yml
12
+ # Environment name: pypi
13
+ #
14
+ # Then publish by pushing a tag: git tag v0.5.0 && git push origin v0.5.0
15
+
16
+ on:
17
+ push:
18
+ tags:
19
+ - "v*"
20
+
21
+ permissions:
22
+ contents: read
23
+
24
+ jobs:
25
+ build:
26
+ name: Build distributions
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ - uses: actions/setup-python@v5
31
+ with:
32
+ python-version: "3.12"
33
+ - name: Build sdist and wheel
34
+ run: |
35
+ python -m pip install --upgrade build
36
+ python -m build
37
+ - name: Check the distributions
38
+ run: |
39
+ python -m pip install --upgrade twine
40
+ python -m twine check dist/*
41
+ - uses: actions/upload-artifact@v4
42
+ with:
43
+ name: dist
44
+ path: dist/
45
+
46
+ publish:
47
+ name: Publish to PyPI
48
+ needs: build
49
+ runs-on: ubuntu-latest
50
+ environment:
51
+ name: pypi
52
+ url: https://pypi.org/p/expert-mentor
53
+ permissions:
54
+ id-token: write # required for Trusted Publishing
55
+ steps:
56
+ - uses: actions/download-artifact@v4
57
+ with:
58
+ name: dist
59
+ path: dist/
60
+ - uses: pypa/gh-action-pypi-publish@release/v1
61
+
62
+ github-release:
63
+ name: Create GitHub Release
64
+ needs: build
65
+ runs-on: ubuntu-latest
66
+ permissions:
67
+ contents: write
68
+ steps:
69
+ - uses: actions/checkout@v4
70
+ - uses: actions/download-artifact@v4
71
+ with:
72
+ name: dist
73
+ path: dist/
74
+ - name: Create release
75
+ env:
76
+ GH_TOKEN: ${{ github.token }}
77
+ run: gh release create "${GITHUB_REF_NAME}" dist/* --generate-notes
@@ -0,0 +1,72 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project
5
+ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.6.2] - 2026-10-31
10
+
11
+ ### Added
12
+ - Live sessions for Google/Gemini (`mentor run --provider google`), on par with
13
+ Anthropic, OpenAI, Ollama, and llama.cpp.
14
+ - `mentor skill` — install the Claude Code / opencode skill from the CLI
15
+ itself, so a `pip`/`pipx` install gets it too, not just a git checkout.
16
+ - `examples/cpp.google.transcript.md` — a live Gemini tutoring transcript.
17
+
18
+ ### Fixed
19
+ - `google`'s default model was the retired `gemini-2.5-pro`; now the rolling
20
+ `gemini-flash-latest` alias.
21
+
22
+ ### Changed
23
+ - `install.sh` now calls `mentor skill` instead of duplicating its symlink logic.
24
+
25
+ ## [0.6.1] - 2026-09-12
26
+
27
+ ### Changed
28
+ - Package the README as the PyPI long description and ship `docs/` in the sdist.
29
+ - Add a `MANIFEST.in` so documentation is included in source distributions.
30
+
31
+ ## [0.6.0] - 2026-09-12
32
+
33
+ ### Added
34
+ - Spaced-repetition flashcards: `mentor cards` (add / generate / list / remove)
35
+ and `mentor quiz` with an SM-2-lite scheduler (`scripts/mentor_cards.py`,
36
+ `templates/cards_prompt.md`).
37
+ - `mentor run --history-turns N` caps how many past turns are kept in context.
38
+
39
+ ### Fixed
40
+ - Include `mentor_cards` in the packaged modules so the installed wheel runs.
41
+
42
+ ## [0.5.0] - 2026-09-12
43
+
44
+ ### Added
45
+ - Persistent learner memory and session transcripts (`mentor learners`,
46
+ `mentor progress`, `mentor sessions`, `mentor transcript`).
47
+ - Model-assisted progress review: `mentor review [--apply]`.
48
+ - Packaging (`pyproject.toml`, console entry points), CI, and a
49
+ Trusted-Publishing release workflow.
50
+ - Config file: `mentor config`.
51
+ - Colored, TTY-aware health output and `--quiet`.
52
+
53
+ ### Changed
54
+ - Provider-native handling for Claude (prompt caching, extended thinking, XML
55
+ shaping) and ChatGPT (developer role, `max_completion_tokens`,
56
+ `reasoning_effort`, usage reporting).
57
+ - Live sessions for Anthropic, OpenAI, Ollama, and llama.cpp with retry/backoff.
58
+ - Model catalog and live discovery: `mentor models --refresh`.
59
+
60
+ ## [0.1.0] - 2026-09-11
61
+
62
+ ### Added
63
+ - Initial release: provider-aware expert-mentor prompt generation, curated field
64
+ profiles, curriculum and compact templates, one-command installer, and the
65
+ `SKILL.md` agent skill.
66
+
67
+ [Unreleased]: https://github.com/voidstackloop/expert-mentor/compare/v0.6.2...HEAD
68
+ [0.6.2]: https://github.com/voidstackloop/expert-mentor/compare/v0.6.1...v0.6.2
69
+ [0.6.1]: https://github.com/voidstackloop/expert-mentor/compare/v0.6.0...v0.6.1
70
+ [0.6.0]: https://github.com/voidstackloop/expert-mentor/releases/tag/v0.6.0
71
+ [0.5.0]: https://github.com/voidstackloop/expert-mentor/releases
72
+ [0.1.0]: https://github.com/voidstackloop/expert-mentor/releases
@@ -0,0 +1,51 @@
1
+ # Contributing
2
+
3
+ Thanks for helping improve expert-mentor. This project is intentionally small,
4
+ dependency-free, and easy to run locally.
5
+
6
+ ## Setup
7
+
8
+ ```bash
9
+ git clone https://github.com/voidstackloop/expert-mentor
10
+ cd expert-mentor
11
+ ./install.sh # or run in place with ./bin/mentor
12
+ make doctor
13
+ ```
14
+
15
+ ## Before you open a PR
16
+
17
+ ```bash
18
+ make test # 99+ assertions, no third-party deps
19
+ ```
20
+
21
+ - Add a test for any non-trivial change (see `scripts/selftest.py`).
22
+ - Keep the code **standard library only** at runtime.
23
+ - Follow the existing style; `ruff` config is in `pyproject.toml` (line length 120).
24
+ - Update `README.md` / `docs/` when behaviour changes, and add a `CHANGELOG.md`
25
+ entry under `Unreleased`.
26
+
27
+ ## Good first contributions
28
+
29
+ - **Add a field profile** — see `references/fields.md`; append to
30
+ `references/fields.json`.
31
+ - **Add a provider adapter** — streaming backends live in
32
+ `scripts/mentor_runtime.py`; payload builders are pure and unit-tested.
33
+ - **Improve a prompt** — `templates/*.md`.
34
+ - **Fix an example** — `examples/` is regenerated from the CLI.
35
+
36
+ ## Commit messages
37
+
38
+ Use a short imperative subject and explain the *why* in the body. Reference an
39
+ issue if there is one.
40
+
41
+ ## Pull requests
42
+
43
+ 1. Fork and branch from `main`.
44
+ 2. Make the change with tests.
45
+ 3. Ensure `make test` passes and CI is green.
46
+ 4. Open the PR with a clear description of the change and its motivation.
47
+
48
+ ## Reporting issues
49
+
50
+ Include your OS, Python version (`mentor version`), the exact command, and the
51
+ full output. `mentor doctor` output is helpful too.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 expert-mentor contributors
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.
@@ -0,0 +1,12 @@
1
+ include README.md
2
+ include CHANGELOG.md
3
+ include CONTRIBUTING.md
4
+ include LICENSE
5
+ include SKILL.md
6
+ include Makefile
7
+ recursive-include docs *.md
8
+ recursive-include templates *.md
9
+ recursive-include references *.md *.json
10
+ recursive-include examples *
11
+ recursive-include bin *
12
+ recursive-include .github *.yml
@@ -0,0 +1,59 @@
1
+ PYTHON ?= python3
2
+
3
+ .PHONY: help install uninstall test demo curriculum fields providers doctor dist skill-zip bundles clean
4
+
5
+ help:
6
+ @echo "expert-mentor"
7
+ @echo ""
8
+ @echo " make install install the 'mentor' command and link the skill"
9
+ @echo " make uninstall remove the command and skill links"
10
+ @echo " make test run the self-test suite"
11
+ @echo " make doctor check the local setup"
12
+ @echo " make fields list curated field profiles"
13
+ @echo " make providers list supported providers"
14
+ @echo " make demo generate a sample prompt to stdout"
15
+ @echo " make curriculum generate a sample curriculum prompt to stdout"
16
+ @echo " make dist build sdist + wheel into dist/ (needs 'build')"
17
+ @echo " make skill-zip package SKILL.md + supporting files for marketplace submission"
18
+ @echo " make bundles build all provider bundles into bundles/"
19
+ @echo " make clean remove __pycache__ and build artifacts"
20
+
21
+ install:
22
+ @chmod +x install.sh uninstall.sh bin/mentor scripts/*.py
23
+ @./install.sh
24
+
25
+ uninstall:
26
+ @chmod +x uninstall.sh
27
+ @./uninstall.sh
28
+
29
+ test:
30
+ @$(PYTHON) scripts/selftest.py
31
+
32
+ doctor:
33
+ @$(PYTHON) scripts/expert_mentor.py doctor
34
+
35
+ fields:
36
+ @$(PYTHON) scripts/expert_mentor.py --list-fields
37
+
38
+ providers:
39
+ @$(PYTHON) scripts/expert_mentor.py --list-providers
40
+
41
+ demo:
42
+ @$(PYTHON) scripts/expert_mentor.py --field "quantum computing" --level beginner
43
+
44
+ curriculum:
45
+ @$(PYTHON) scripts/expert_mentor.py curriculum --field "Rust" --level intermediate
46
+
47
+ dist:
48
+ @$(PYTHON) -m pip install --quiet --upgrade build
49
+ @$(PYTHON) -m build
50
+ @echo "artifacts in dist/ — publish with: python -m twine upload dist/*"
51
+
52
+ skill-zip:
53
+ @$(PYTHON) scripts/build_skill_zip.py
54
+
55
+ bundles:
56
+ @$(PYTHON) scripts/build_bundles.py
57
+
58
+ clean:
59
+ @rm -rf scripts/__pycache__ build dist *.egg-info scripts/*.egg-info
@@ -0,0 +1,189 @@
1
+ Metadata-Version: 2.4
2
+ Name: expert-mentor
3
+ Version: 0.6.2
4
+ Summary: Turn any LLM (Claude, ChatGPT, Gemini, Ollama, llama.cpp) into a professional teacher for any field.
5
+ Author: expert-mentor contributors
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/voidstackloop/expert-mentor
8
+ Project-URL: Repository, https://github.com/voidstackloop/expert-mentor
9
+ Project-URL: Issues, https://github.com/voidstackloop/expert-mentor/issues
10
+ Project-URL: Changelog, https://github.com/voidstackloop/expert-mentor/releases
11
+ Project-URL: PyPI, https://pypi.org/project/expert-mentor/
12
+ Keywords: llm,mentor,tutor,education,claude,chatgpt,ollama,prompt
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Education
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.8
21
+ Classifier: Programming Language :: Python :: 3.9
22
+ Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
25
+ Classifier: Topic :: Education
26
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
27
+ Requires-Python: >=3.8
28
+ Description-Content-Type: text/markdown
29
+ License-File: LICENSE
30
+ Dynamic: license-file
31
+
32
+ # expert-mentor
33
+
34
+ **Turn any LLM — Claude, ChatGPT, Gemini, or a local Ollama / llama.cpp model — into a professional teacher for any field.**
35
+
36
+ `expert-mentor` generates a calibrated expert-mentor system prompt for a field and
37
+ level, runs the tutoring session directly, remembers what you've mastered across
38
+ sessions, and reviews your progress from the transcript.
39
+
40
+ ![Generating a Rust mentor prompt](docs/images/terminal-prompt-rust.png)
41
+
42
+ <details>
43
+ <summary>More screenshots and diagrams</summary>
44
+
45
+ ![How a field becomes a mentor session](docs/images/diagram-flow.svg)
46
+ ![Curated field profiles](docs/images/terminal-fields.png)
47
+ ![Supported providers](docs/images/terminal-providers.png)
48
+ ![mentor doctor](docs/images/terminal-doctor.png)
49
+
50
+ More in [docs/diagrams.md](docs/diagrams.md).
51
+ </details>
52
+
53
+ MIT licensed · Python 3.8+ · zero runtime dependencies
54
+
55
+ ---
56
+
57
+ ## Why
58
+
59
+ Most "tutor" prompts are a persona and a vibe. This one is a system: a teaching
60
+ contract grounded in learning science (retrieval practice, spacing,
61
+ scaffolding), provider-native request handling, and a persistent learner model.
62
+ The mentor teaches to the standard a real senior practitioner would recognise —
63
+ one concept at a time, checking understanding, and never fabricating sources.
64
+
65
+ ## Highlights
66
+
67
+ - **Provider-native prompts** — XML-shaped, prompt-cached system blocks for
68
+ Claude; `developer` role, `max_completion_tokens`, and `reasoning_effort` for
69
+ ChatGPT reasoning models; correct handling for Gemini, Ollama, and llama.cpp.
70
+ - **Live tutoring sessions** over Anthropic, OpenAI, Ollama, and llama.cpp —
71
+ standard library only, no runtime dependencies.
72
+ - **Persistent learner memory** — mastered / shaky / misconceptions / open
73
+ questions, injected into every future session.
74
+ - **Model-assisted review** — turn a session transcript into an updated profile.
75
+ - **Spaced repetition** — generate flashcards from a session and review them with
76
+ an SM-2-lite scheduler (`mentor cards` / `mentor quiz`).
77
+ - **Curriculum design** — a structured, sequenced multi-week plan for any field.
78
+ - **Usable as an agent skill** — ships with `SKILL.md` for Claude Code / opencode.
79
+
80
+ ## Install
81
+
82
+ No install needed — run it in place from this folder:
83
+
84
+ ```bash
85
+ python3 scripts/expert_mentor.py --field "quantum computing" --level beginner
86
+ ```
87
+
88
+ Want a `mentor` command on your PATH and the skill linked into Claude Code /
89
+ opencode? Run the installer once from inside this folder:
90
+
91
+ ```bash
92
+ ./install.sh
93
+ ```
94
+
95
+ ## Quick start
96
+
97
+ ```bash
98
+ # Generate a system prompt for a field
99
+ mentor --field "quantum computing" --level beginner
100
+
101
+ # Run a live tutoring session (local model)
102
+ mentor run --field "Rust" --provider ollama --model qwen2.5:7b
103
+
104
+ # Run with Claude, remembering progress between sessions
105
+ mentor run --field "Rust" --provider claude --remember
106
+
107
+ # Build a curriculum
108
+ mentor curriculum --field "Rust" --duration "6 weeks, 5h/week"
109
+ ```
110
+
111
+ ## Live sessions
112
+
113
+ ```bash
114
+ # Claude — system prompt is cached and XML-shaped; optional extended thinking
115
+ mentor run --field "contract law" --provider claude --model claude-sonnet-5 --thinking
116
+
117
+ # ChatGPT — reasoning effort, developer role, usage reported per turn
118
+ mentor run --field "Rust" --provider chatgpt --model gpt-5.6 --reasoning-effort high
119
+
120
+ # Local — Ollama or a llama.cpp / LM Studio server
121
+ mentor run --field "music theory" --provider ollama --host http://localhost:11434
122
+ ```
123
+
124
+ Credentials come from the environment or a `.env` file
125
+ (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`). See
126
+ [docs/providers.md](docs/providers.md).
127
+
128
+ ## Remembering a learner
129
+
130
+ ```bash
131
+ # Persist progress automatically (named from the field)
132
+ mentor run --field "Rust" --provider claude --remember
133
+
134
+ # Inspect or curate the profile
135
+ mentor learners
136
+ mentor progress rust --add-mastered ownership --add-shaky lifetimes --goal "ship idiomatic Rust"
137
+
138
+ # Assess the last session and update the profile
139
+ mentor review rust --apply
140
+
141
+ # Turn the session into flashcards and review them over time
142
+ mentor cards rust --generate
143
+ mentor quiz rust
144
+ ```
145
+
146
+ Profiles, transcripts, prompts, and cards live under
147
+ `~/.config/expert-mentor/` as plain JSON/markdown you can read and edit.
148
+
149
+ ## Commands
150
+
151
+ | Command | Purpose |
152
+ |---------|---------|
153
+ | `mentor --field F [...]` | generate a teaching prompt |
154
+ | `mentor run [NAME]` | live tutoring session (cloud or local) |
155
+ | `mentor save/show/saved` | store and reuse mentor prompts |
156
+ | `mentor curriculum` | sequenced multi-week curriculum prompt |
157
+ | `mentor models` | list / discover Claude & ChatGPT models |
158
+ | `mentor fields` / `providers` | curated field profiles / providers |
159
+ | `mentor learners` / `progress` / `sessions` / `transcript` / `review` | learner memory & assessment |
160
+ | `mentor cards` / `quiz` | spaced-repetition flashcards |
161
+ | `mentor config` | saved defaults |
162
+ | `mentor doctor` | health check |
163
+ | `mentor skill` | install the Claude Code / opencode skill |
164
+ | `mentor interactive` | build a profile by answering prompts |
165
+
166
+ Full reference: [docs/commands.md](docs/commands.md).
167
+
168
+ ## Documentation
169
+
170
+ - [Getting started](docs/getting-started.md)
171
+ - [Command reference](docs/commands.md)
172
+ - [Providers & credentials](docs/providers.md)
173
+ - [How the mentor teaches](docs/learning.md)
174
+ - [Configuration](docs/configuration.md)
175
+ - [Using it as an agent skill](docs/skill.md)
176
+ - [Development](docs/development.md)
177
+
178
+ ## Requirements
179
+
180
+ Python 3.8+. No third-party runtime dependencies. A local [Ollama](https://ollama.com)
181
+ or llama.cpp server is optional (for offline use).
182
+
183
+ ## Contributing
184
+
185
+ See [CONTRIBUTING.md](CONTRIBUTING.md). Run `make test` before opening a PR.
186
+
187
+ ## License
188
+
189
+ [MIT](LICENSE) © expert-mentor contributors.
@@ -0,0 +1,158 @@
1
+ # expert-mentor
2
+
3
+ **Turn any LLM — Claude, ChatGPT, Gemini, or a local Ollama / llama.cpp model — into a professional teacher for any field.**
4
+
5
+ `expert-mentor` generates a calibrated expert-mentor system prompt for a field and
6
+ level, runs the tutoring session directly, remembers what you've mastered across
7
+ sessions, and reviews your progress from the transcript.
8
+
9
+ ![Generating a Rust mentor prompt](docs/images/terminal-prompt-rust.png)
10
+
11
+ <details>
12
+ <summary>More screenshots and diagrams</summary>
13
+
14
+ ![How a field becomes a mentor session](docs/images/diagram-flow.svg)
15
+ ![Curated field profiles](docs/images/terminal-fields.png)
16
+ ![Supported providers](docs/images/terminal-providers.png)
17
+ ![mentor doctor](docs/images/terminal-doctor.png)
18
+
19
+ More in [docs/diagrams.md](docs/diagrams.md).
20
+ </details>
21
+
22
+ MIT licensed · Python 3.8+ · zero runtime dependencies
23
+
24
+ ---
25
+
26
+ ## Why
27
+
28
+ Most "tutor" prompts are a persona and a vibe. This one is a system: a teaching
29
+ contract grounded in learning science (retrieval practice, spacing,
30
+ scaffolding), provider-native request handling, and a persistent learner model.
31
+ The mentor teaches to the standard a real senior practitioner would recognise —
32
+ one concept at a time, checking understanding, and never fabricating sources.
33
+
34
+ ## Highlights
35
+
36
+ - **Provider-native prompts** — XML-shaped, prompt-cached system blocks for
37
+ Claude; `developer` role, `max_completion_tokens`, and `reasoning_effort` for
38
+ ChatGPT reasoning models; correct handling for Gemini, Ollama, and llama.cpp.
39
+ - **Live tutoring sessions** over Anthropic, OpenAI, Ollama, and llama.cpp —
40
+ standard library only, no runtime dependencies.
41
+ - **Persistent learner memory** — mastered / shaky / misconceptions / open
42
+ questions, injected into every future session.
43
+ - **Model-assisted review** — turn a session transcript into an updated profile.
44
+ - **Spaced repetition** — generate flashcards from a session and review them with
45
+ an SM-2-lite scheduler (`mentor cards` / `mentor quiz`).
46
+ - **Curriculum design** — a structured, sequenced multi-week plan for any field.
47
+ - **Usable as an agent skill** — ships with `SKILL.md` for Claude Code / opencode.
48
+
49
+ ## Install
50
+
51
+ No install needed — run it in place from this folder:
52
+
53
+ ```bash
54
+ python3 scripts/expert_mentor.py --field "quantum computing" --level beginner
55
+ ```
56
+
57
+ Want a `mentor` command on your PATH and the skill linked into Claude Code /
58
+ opencode? Run the installer once from inside this folder:
59
+
60
+ ```bash
61
+ ./install.sh
62
+ ```
63
+
64
+ ## Quick start
65
+
66
+ ```bash
67
+ # Generate a system prompt for a field
68
+ mentor --field "quantum computing" --level beginner
69
+
70
+ # Run a live tutoring session (local model)
71
+ mentor run --field "Rust" --provider ollama --model qwen2.5:7b
72
+
73
+ # Run with Claude, remembering progress between sessions
74
+ mentor run --field "Rust" --provider claude --remember
75
+
76
+ # Build a curriculum
77
+ mentor curriculum --field "Rust" --duration "6 weeks, 5h/week"
78
+ ```
79
+
80
+ ## Live sessions
81
+
82
+ ```bash
83
+ # Claude — system prompt is cached and XML-shaped; optional extended thinking
84
+ mentor run --field "contract law" --provider claude --model claude-sonnet-5 --thinking
85
+
86
+ # ChatGPT — reasoning effort, developer role, usage reported per turn
87
+ mentor run --field "Rust" --provider chatgpt --model gpt-5.6 --reasoning-effort high
88
+
89
+ # Local — Ollama or a llama.cpp / LM Studio server
90
+ mentor run --field "music theory" --provider ollama --host http://localhost:11434
91
+ ```
92
+
93
+ Credentials come from the environment or a `.env` file
94
+ (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`). See
95
+ [docs/providers.md](docs/providers.md).
96
+
97
+ ## Remembering a learner
98
+
99
+ ```bash
100
+ # Persist progress automatically (named from the field)
101
+ mentor run --field "Rust" --provider claude --remember
102
+
103
+ # Inspect or curate the profile
104
+ mentor learners
105
+ mentor progress rust --add-mastered ownership --add-shaky lifetimes --goal "ship idiomatic Rust"
106
+
107
+ # Assess the last session and update the profile
108
+ mentor review rust --apply
109
+
110
+ # Turn the session into flashcards and review them over time
111
+ mentor cards rust --generate
112
+ mentor quiz rust
113
+ ```
114
+
115
+ Profiles, transcripts, prompts, and cards live under
116
+ `~/.config/expert-mentor/` as plain JSON/markdown you can read and edit.
117
+
118
+ ## Commands
119
+
120
+ | Command | Purpose |
121
+ |---------|---------|
122
+ | `mentor --field F [...]` | generate a teaching prompt |
123
+ | `mentor run [NAME]` | live tutoring session (cloud or local) |
124
+ | `mentor save/show/saved` | store and reuse mentor prompts |
125
+ | `mentor curriculum` | sequenced multi-week curriculum prompt |
126
+ | `mentor models` | list / discover Claude & ChatGPT models |
127
+ | `mentor fields` / `providers` | curated field profiles / providers |
128
+ | `mentor learners` / `progress` / `sessions` / `transcript` / `review` | learner memory & assessment |
129
+ | `mentor cards` / `quiz` | spaced-repetition flashcards |
130
+ | `mentor config` | saved defaults |
131
+ | `mentor doctor` | health check |
132
+ | `mentor skill` | install the Claude Code / opencode skill |
133
+ | `mentor interactive` | build a profile by answering prompts |
134
+
135
+ Full reference: [docs/commands.md](docs/commands.md).
136
+
137
+ ## Documentation
138
+
139
+ - [Getting started](docs/getting-started.md)
140
+ - [Command reference](docs/commands.md)
141
+ - [Providers & credentials](docs/providers.md)
142
+ - [How the mentor teaches](docs/learning.md)
143
+ - [Configuration](docs/configuration.md)
144
+ - [Using it as an agent skill](docs/skill.md)
145
+ - [Development](docs/development.md)
146
+
147
+ ## Requirements
148
+
149
+ Python 3.8+. No third-party runtime dependencies. A local [Ollama](https://ollama.com)
150
+ or llama.cpp server is optional (for offline use).
151
+
152
+ ## Contributing
153
+
154
+ See [CONTRIBUTING.md](CONTRIBUTING.md). Run `make test` before opening a PR.
155
+
156
+ ## License
157
+
158
+ [MIT](LICENSE) © expert-mentor contributors.