devcoach 0.7.4 → 0.8.1

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.
@@ -0,0 +1,51 @@
1
+ # devcoach — Dynamic calibration
2
+
3
+ Read this file after a `log_lesson` where `total_lessons % 10 == 0` (check
4
+ `total_lessons` in `devcoach://rate-limit`), then run the four steps below.
5
+
6
+ ## Step 1 — Fetch the window
7
+
8
+ Call `get_lessons()` (default `limit=10`, newest first) to get the last 10 lessons.
9
+ Read `devcoach://profile` for the current knowledge map.
10
+
11
+ ## Step 2 — Per-topic signal analysis
12
+
13
+ Group the 10 lessons by `topic_id`. For each topic that appeared:
14
+
15
+ | Signal | Condition | Action |
16
+ |---|---|---|
17
+ | Consistent mastery | All feedback `know`, no `dont_know` | `update_knowledge(topic, +1)` if confidence < 9 |
18
+ | Persistent gap | 2+ lessons on same topic, any `dont_know` | `update_knowledge(topic, -1)` if confidence > 1 |
19
+ | Recurring topic | 3+ lessons on same topic, mixed or no feedback | no confidence change — note in notebook |
20
+ | New topic | `topic_id` absent from `devcoach://profile` | `add_topic` — see Step 3 |
21
+
22
+ Apply at most **one** `update_knowledge` call per topic per calibration run.
23
+ Never call `update_knowledge` on a topic with confidence 10 (already mastered).
24
+
25
+ ## Step 3 — New topic discovery
26
+
27
+ For each lesson whose `topic_id` is not in `devcoach://profile`:
28
+ - 2+ lessons share this `topic_id` in the window → call `add_topic(topic_id, confidence=5)`;
29
+ assign it to the same group as the closest related existing topic, or `"Other"` if unclear.
30
+ - Only 1 lesson on this `topic_id` → note under **Open hypotheses** in the notebook; do not add yet.
31
+
32
+ ## Step 4 — Update the coaching notebook
33
+
34
+ Read `devcoach://notebook`. Merge findings into the relevant sections and save the
35
+ complete revised markdown via `update_notebook`:
36
+
37
+ - **Recurring patterns** — append any `topic_id` that appeared 3+ times, with its count
38
+ and whether feedback was positive, negative, or absent.
39
+ - **Recommended focus** — replace or append topics that had 2+ `dont_know` in the window.
40
+ - **Open hypotheses** — add single-occurrence new topics not yet in the profile;
41
+ remove hypotheses confirmed (topic added) or disproved (not seen in 20+ subsequent lessons).
42
+
43
+ Always update `_Last updated` to the current ISO timestamp.
44
+ Never delete prior entries — integrate new observations alongside existing ones.
45
+
46
+ Notebook observations can **raise or lower** the effective teaching angle
47
+ independently of the numeric score:
48
+
49
+ - "User absorbs theory but struggles to apply it" → favour worked examples over concepts
50
+ - "User tends to over-engineer" → anchor the lesson to concrete failure modes
51
+ - "Hypothesis: low confidence stems from bad early habits, not ignorance" → teach correction, not introduction
@@ -0,0 +1,132 @@
1
+ # devcoach — Onboarding flow
2
+
3
+ Read this file when `devcoach://onboarding` reports `knowledge_ready: false` or
4
+ `notebook_ready: false`, or when the user explicitly asks to (re-)initialise their
5
+ profile ("setup devcoach", "redo onboarding", "reset my topics").
6
+
7
+ The onboarding flow runs inline, immediately before delivering a lesson, whenever
8
+ it is needed. There is no separate session startup phase — this makes the skill
9
+ robust to context compaction and plan-mode transitions.
10
+
11
+ Check `knowledge_ready` and `notebook_ready` from `devcoach://onboarding` independently
12
+ — each step can run alone:
13
+
14
+ ```
15
+ knowledge_ready = false → run Steps 1–3 (topic collection + complete_onboarding)
16
+ notebook_ready = false → run Step 4 (notebook initialisation)
17
+ both ready → proceed normally
18
+ ```
19
+
20
+ This means a user who restores from backup has their knowledge automatically, so
21
+ only Step 4 runs. On-demand re-setup ("redo onboarding", "reset my topics") always
22
+ re-runs Steps 1–3 regardless of `knowledge_ready`.
23
+
24
+ ## Step 1 — Ask how to set up (always ask; never pick for the user)
25
+
26
+ Present a single choice using the client's question UI (e.g. AskUserQuestion in
27
+ Claude Code). Offer exactly three options and mark **Automatic** as recommended:
28
+
29
+ - **Automatic (Recommended)** — detect the tech stack from this project and build a
30
+ profile from it.
31
+ - **Guided** — a step-by-step conversation to map knowledge, confidence levels, and
32
+ topic groups (thorough, interactive).
33
+ - **Import backup** — restore knowledge, lessons, and settings from an existing
34
+ backup file.
35
+
36
+ Do **not** default to Automatic silently — surface the choice and wait for the user's
37
+ answer before proceeding.
38
+
39
+ **If Import backup:** ask for the file path and call `restore` (CLI) with it. Restore
40
+ brings back knowledge entries automatically — no further DB steps needed. Re-read
41
+ `devcoach://onboarding` after restore; if `knowledge_ready` is now true, skip to
42
+ Step 4. If `notebook_ready` is also true, proceed normally.
43
+
44
+ ## Step 2 — Collect topics for the chosen mode
45
+
46
+ **Automatic mode:**
47
+ - Read `devcoach://onboarding` and present a merged topic list: `detected_stack`
48
+ (auto-detected from project files) enriched with relevant entries from
49
+ `default_topics` (the project's default knowledge map).
50
+ - Show each topic with its suggested confidence. Ask the user to confirm, adjust,
51
+ or remove each: *"Looks right? Or enter 1–10 to change it."*
52
+ - After the list, ask: *"Anything else I missed? List any tools, languages,
53
+ frameworks, or practices you work with regularly."* — add each with a confidence.
54
+
55
+ **Guided mode:**
56
+ - Have a free-form conversation: *"Tell me about the technologies you work with
57
+ day-to-day. For each one I'll ask how confident you are:
58
+ 1–3 = still learning · 4–6 = comfortable · 7–9 = strong · 10 = expert."*
59
+ - Use `default_topics` as a domain checklist: probe areas the user hasn't mentioned
60
+ (languages, frameworks, databases, infrastructure, version control, CI/CD, testing,
61
+ architecture patterns, etc.). Keep probing until the user says they're done.
62
+
63
+ ## Step 3 — Propose groups and save
64
+
65
+ Once the full topic list is agreed:
66
+ - **Suggest logical groups** based on what was collected. Examples:
67
+ Languages, Backend, Frontend, Databases, DevOps, Version Control, Testing.
68
+ These names emerge from the conversation — there is no fixed list.
69
+ - Show the proposed grouping: *"Here's how I'd organise these — does this look
70
+ right? Any changes?"*
71
+ - When confirmed, call the MCP tool `complete_onboarding`, including the personalized
72
+ `notebook` markdown you compose in Step 4 (so the profile and notebook are saved
73
+ together):
74
+ ```json
75
+ {
76
+ "topics": { "lang_a": 7, "tool_b": 8, "practice_c": 7 },
77
+ "groups": { "Languages": ["lang_a"], "DevOps": ["tool_b"], "Version Control": ["practice_c"] },
78
+ "notebook": "# devcoach — Coaching Notebook\n_Last updated: …_\n\n## Observations\n…"
79
+ }
80
+ ```
81
+ - Do not deliver a lesson in this turn — the rate-limit clock starts after onboarding.
82
+
83
+ **Rule:** Never ask about groups during topic collection. Propose them only in
84
+ Step 3 after all topics are known.
85
+
86
+ ### Step 3b — Show the setup summary
87
+
88
+ After saving (or after a restore), show the user a concise summary of what was set up:
89
+ - The topics with their confidences, organised under their groups.
90
+
91
+ Then tell the user **how to change any of it later**, across all three surfaces:
92
+ - **In chat** — just ask, e.g. *"set my Python confidence to 7"*, *"add Rust at 4"*,
93
+ or *"redo onboarding"*. (Backed by the `update_knowledge`, `add_topic`, and
94
+ `add_group` tools.)
95
+ - **CLI** — `devcoach profile` to view; `devcoach knowledge-add <topic> <0-10>
96
+ [--group <Group>]` to add/update; `devcoach knowledge-remove <topic>` to remove;
97
+ `devcoach group-add` / `devcoach group-assign` to organise groups.
98
+ - **UI** — `devcoach ui` (web dashboard at http://localhost:7860), or ask me to open
99
+ it (the `open_ui` tool).
100
+
101
+ ## Step 4 — Compose the coaching notebook (pass it to `complete_onboarding`)
102
+
103
+ Do **not** write `learning-state.md` yourself — compose its full markdown and pass it
104
+ as the `notebook` field of the `complete_onboarding` call in Step 3. The tool saves it
105
+ to `~/.devcoach/learning-state.md` atomically with the profile (so it is never empty
106
+ and never created before the user finishes).
107
+
108
+ Make it **personalized**: draw on everything you know about *this* user — not only this
109
+ onboarding conversation, but how they work across **all their projects** (languages and
110
+ tools they reach for, recurring habits, strengths, and gaps you have observed elsewhere).
111
+ Generic boilerplate is a failure; write specific, real notes. Use this structure:
112
+
113
+ ```markdown
114
+ # devcoach — Coaching Notebook
115
+ _Last updated: [ISO timestamp]_
116
+
117
+ ## Observations
118
+ [Specific, real notes about this user: background, how they work across their
119
+ projects, confidence style, gaps. Personalized — never generic.]
120
+
121
+ ## Recurring patterns
122
+ [Patterns you have noticed in how they build, debug, or structure work.]
123
+
124
+ ## Recommended focus
125
+ [Topics the user flagged as priorities or areas of uncertainty.]
126
+
127
+ ## Open hypotheses
128
+ [Things to watch for and confirm in future sessions.]
129
+ ```
130
+
131
+ If re-onboarding or returning, fold prior notes into the markdown you pass —
132
+ `complete_onboarding` overwrites the file with exactly what you provide.