hotmilk 0.1.13 → 0.1.14

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 (38) hide show
  1. package/AGENTS.md +3 -2
  2. package/README.md +167 -22
  3. package/agents/README.md +3 -3
  4. package/agents/coach.md +2 -1
  5. package/agents/planner.md +2 -2
  6. package/hotmilk.json +6 -0
  7. package/package.json +25 -22
  8. package/prompts/prompt-eval.md +241 -0
  9. package/prompts/tidy.md +3 -1
  10. package/prompts/translate.md +3 -1
  11. package/skills/make-docs/SKILL.md +43 -0
  12. package/skills/pioneer/SKILL.md +120 -130
  13. package/skills/pioneer/references/autoresearch-routing.md +112 -0
  14. package/skills/pioneer/references/chat-plan.md +50 -0
  15. package/skills/pioneer/references/goal-gate.md +54 -0
  16. package/skills/pioneer/references/graph-recon-gate.md +50 -0
  17. package/skills/pioneer/references/openspec-routing.md +50 -0
  18. package/skills/pioneer/references/plannotator-routing.md +81 -0
  19. package/skills/pioneer/references/prompt-eval-gate.md +38 -0
  20. package/skills/recommend-research/SKILL.md +94 -6
  21. package/skills/recommend-research/references/example-narrow.md +53 -0
  22. package/skills/recommend-research/references/scope-gate.md +46 -0
  23. package/skills/recommend-research/references/shortlist-gate.md +69 -0
  24. package/skills/recommend-research/references/verify-gate.md +73 -0
  25. package/skills/update-docs/SKILL.md +86 -0
  26. package/skills/update-docs/references/doc-inventory.md +69 -0
  27. package/skills/update-docs/references/drift-verification.md +59 -0
  28. package/src/bootstrap/extensions.ts +7 -1
  29. package/src/bootstrap/global-extension-sources.ts +10 -1
  30. package/src/bootstrap/project-trust.ts +41 -0
  31. package/src/bootstrap/session.ts +28 -1
  32. package/src/config/bundled-extensions.ts +12 -0
  33. package/src/config/hotmilk.ts +22 -0
  34. package/src/config/resolve.ts +16 -0
  35. package/src/config/runtime.ts +4 -0
  36. package/src/index.ts +4 -0
  37. package/themes/monokai.json +1 -1
  38. package/skills/empirical-prompt-tuning/SKILL.md +0 -232
@@ -1,232 +0,0 @@
1
- ---
2
- name: empirical-prompt-tuning
3
- description: "Harden prompts: fresh executor each iteration, checklist scoring, one themed delta per loop until convergence. After editing skills, AGENTS.md, CLAUDE.md, or task prompts. [Triggers: empirical prompt tuning, prompt evaluation, tune prompt, fresh agent evaluation]"
4
- ---
5
-
6
- # Empirical Prompt Tuning
7
-
8
- A prompt's quality is opaque to its author. **Dispatch a fresh agent, run the prompt, evaluate on two axes, iterate until plateau.** Do not stop before the plateau.
9
-
10
- ## Core Concept: Fresh Agent
11
-
12
- Any executor with **no authoring context** and **no memory of prior iterations**. The implementation does not matter; the absence of authoring bias does. Self re-reading never qualifies.
13
-
14
- ### Dispatch Methods (pick one)
15
-
16
- | Method | How | Notes |
17
- | ------------------------------ | -------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
18
- | **pi-subagents** (recommended) | `subagent({ agent: "assistant", task: "...", context: "fresh", model: "<model-id>", skill: false, clarify: false })` | Always set `context: "fresh"`, explicit `model`, `skill: false`, `clarify: false` |
19
- | **Claude Code Task** | `{ agent: "worker", task: "...", context: "fresh" }` | Alternative when PI unavailable |
20
- | **Separate session** | New terminal: `claude` or `pi` | Manual but reliable |
21
- | **Direct API** | POST to `/v1/messages` with empty history | For programmatic testing |
22
-
23
- **NOT fresh**: `context: "fork"` (inherits history), same session, self re-reading.
24
-
25
- For parallel scenarios, use `subagent({ tasks: [...] })` with models from the **same provider** to avoid cross-provider timeouts.
26
-
27
- ## Workflow
28
-
29
- ```
30
- 0. Static coherence check (no dispatch)
31
- 1. Baseline: stakes tier + scenarios + requirement checklists
32
- 2. Dispatch fresh agent → execute → self-report
33
- 3. Two-sided evaluation (self-report + instructor metrics)
34
- 4. Apply ONE themed delta
35
- 5. New fresh agent → re-evaluate
36
- 6. Stop at 2 consecutive clears (or 3 for high-stakes)
37
- ```
38
-
39
- ### Step 0 — Static Coherence Check
40
-
41
- Compare what the prompt **advertises** vs what the body **delivers**. Fix divergences before any dispatch.
42
-
43
- | Target type | "Advertises" source | Check |
44
- | --------------------------- | ---------------------------- | ------------------------------------------- |
45
- | Skill file | Frontmatter `description` | Triggers/use-cases match body coverage? |
46
- | CLAUDE.md section | Section heading | Heading promise matches actionable content? |
47
- | Task prompt / system prompt | Opening instruction or title | Stated goal matches the actual rules? |
48
-
49
- Skipping this causes false positives — the fresh agent silently re-interprets the body.
50
-
51
- ### Step 1 — Baseline Preparation
52
-
53
- **Choose and freeze a stakes tier** before anything else:
54
-
55
- | Stakes | Scenarios | `[critical]` tags | Stop condition | Iteration cap |
56
- | --------------------------------- | --------------------- | ----------------- | -------------------- | ------------- |
57
- | **High** (core skill, automation) | 3 (1 median + 2 edge) | ≥ 2 | 3 consecutive clears | none |
58
- | **Standard** (default) | 2 (1 median + 1 edge) | ≥ 1 | 2 consecutive clears | 5 |
59
- | **Low** (small, low-blast) | 2 (1 median + 1 edge) | ≥ 1 | ship at 80% | 3 |
60
-
61
- For each scenario, write a **requirement checklist** (3–7 items). Rules:
62
-
63
- - At least one item tagged `[critical]` — without it, success judgment is vacuous.
64
- - Fix the checklist before running. Do not adjust after seeing results.
65
- - **Translating user complaints into checklist items**: If the user says "it produces shallow output", decompose "shallow" into observable, testable criteria (e.g., "identifies at least one concrete bug", "includes line references", "provides actionable suggestions"). Each criterion becomes a checklist item. The user's complaint itself is not a valid checklist item.
66
- - `[critical]` means: if this item fails, the whole scenario fails (binary ×), regardless of other items.
67
- - Non-critical items score: ○ = 1, partial = 0.5, × = 0. Accuracy = sum / total.
68
-
69
- ### Step 2–3 — Dispatch and Execute
70
-
71
- Hand the fresh agent this contract:
72
-
73
- ```
74
- You are an executor reading <target prompt name> as a blank slate.
75
- You have no prior exposure to this prompt; treat it as newly encountered.
76
-
77
- ## Target Prompt
78
- <paste the full target prompt here>
79
-
80
- ## Scenario
81
- <one paragraph describing the situation>
82
-
83
- ## Requirement Checklist
84
- 1. [critical] <item>
85
- 2. <item>
86
- ...
87
-
88
- ## Task
89
- 1. Execute the scenario following the target prompt and produce the deliverable.
90
- 2. On completion, respond with the report below.
91
-
92
- ## Report Structure
93
- - Deliverable: <the artifact or run summary>
94
- - Requirement status: for each item, ○ / × / partial (with reason)
95
- - Ambiguities: places where wording was open to interpretation (bullets)
96
- - Discretionary fills: decisions the instructions did not specify (bullets)
97
- - Retries: how many times you redid a decision and why
98
- ```
99
-
100
- **Always paste the full prompt** in the contract (not a file path) — ensures portability across all harness types.
101
-
102
- ### Step 4 — Two-Sided Evaluation
103
-
104
- | Axis | Source | How to measure |
105
- | ----------------------- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
106
- | **Success/Failure** | Instructor | ○ only if every `[critical]` met. Binary. |
107
- | **Accuracy** | Instructor | ○/partial/× per item → percentage |
108
- | **Step count** | Environment metadata | `tool_uses` (Claude Code), tool-use blocks (API). For **text-generation targets** (no tool use): substitute with a concrete output-unit count — e.g., number of review comments, checklist items produced, or code blocks emitted. State the chosen unit once at the top of the iteration log. |
109
- | **Duration** | Environment metadata | `duration_ms` or wall-clock |
110
- | **Retry count** | Self-report | Times the agent redid a decision |
111
- | **Ambiguities** | Self-report | Qualitative — primary signal for improvement |
112
- | **Discretionary fills** | Self-report | Surfaces implicit requirements |
113
-
114
- **Weighting**: Qualitative signals (ambiguities, fills) are primary. Quantitative metrics (time, steps) are supporting. Chasing time alone makes prompts brittle.
115
-
116
- **On failure**: append one line to Ambiguities naming which `[critical]` item dropped.
117
-
118
- #### Step Count as Structure Signal
119
-
120
- Even at 100% accuracy, step-count skew across scenarios exposes structural flaws:
121
-
122
- - One scenario at 3–5× the others → the prompt lacks self-containment for that case (executor wandered).
123
- - Fix: add inline guidance or a minimal complete example.
124
-
125
- ### Step 5 — Apply ONE Delta
126
-
127
- 1. Identify the most impactful ambiguity.
128
- 2. **State which checklist item the edit satisfies** before editing — edits inferred from axis names alone rarely land.
129
- 3. Apply the minimum edit. One semantic theme per iteration. A cluster of 2–3 related micro-edits is one theme; unrelated edits go to the next iteration.
130
-
131
- #### Correction Propagation Patterns
132
-
133
- | Pattern | What happens | Lesson |
134
- | ------------------ | ------------------------------------------- | ----------------------------------------------------------- |
135
- | Conservative drift | Edit aimed at multiple axes, only one moved | Multi-axis shots usually miss |
136
- | Upside drift | One structural edit satisfied multiple axes | Information combos are naturally multi-axis |
137
- | Null drift | Edit didn't move any axis | Axis names ≠ judgment text. Tie edits to threshold wording. |
138
-
139
- ### Step 6 — Re-evaluate
140
-
141
- Dispatch a **new** fresh agent. Never reuse — it learned from the prior run. Repeat from Step 2.
142
-
143
- ### Step 7 — Stopping Criteria
144
-
145
- **Converged** when for N consecutive iterations (N = 2 standard, 3 high-stakes):
146
-
147
- - New ambiguities: 0
148
- - Accuracy gain: ≤ +3 points
149
- - Step count change: within ±10%
150
- - Duration change: within ±15%
151
-
152
- **At convergence** (all tiers): add one hold-out scenario not used in any prior iteration. If accuracy drops ≥ 15 points → overfitting. Return to scenario design. This is mandatory, not optional.
153
-
154
- **Diverged**: after 3+ iterations ambiguities aren't decreasing → the prompt's design is wrong. Stop patching, rewrite.
155
-
156
- **Resource cutoff**: ship at 80% when improvement cost exceeds prompt importance.
157
-
158
- ### Presentation Format
159
-
160
- Record each iteration as:
161
-
162
- ```
163
- ## Iteration N
164
-
165
- ### Changes (delta from previous)
166
- - <one-line edit description>
167
-
168
- ### Results
169
- | Scenario | Success | Accuracy | Steps | Duration | Retries |
170
- |---|---|---|---|---|---|
171
- | A | ○ | 90% | 4 | 20s | 0 |
172
- | B | × | 60% | 9 | 41s | 2 |
173
-
174
- ### Ambiguities (new this iteration)
175
- - <Scenario B>: [critical] item N was × — <reason>
176
- - <Scenario A>: (none new)
177
-
178
- ### Discretionary fills (new this iteration)
179
- - <Scenario B>: <what was filled>
180
-
181
- ### Next edit
182
- - <one-line minimal edit>
183
-
184
- (Convergence: X consecutive clears / Y iterations until stop)
185
- ```
186
-
187
- - Never leave an axis blank (write "0", not "—").
188
- - "None new" is explicit signal.
189
- - Steps column may be replaced with turn count in plain-chat environments — note the substitution once.
190
-
191
- ## Red Flags
192
-
193
- | Rationalization | Reality |
194
- | ------------------------------------------------ | -------------------------------------------------------------------- |
195
- | "Re-reading it myself is equivalent." | Structurally impossible to objectively view text you just wrote. |
196
- | "One scenario is enough." | Overfits. Minimum 2. |
197
- | "Zero ambiguities once, so done." | May be coincidence. Require consecutive clears. |
198
- | "Fix multiple things in one pass." | Lose attribution. One theme per iteration. |
199
- | "Metrics look good, ignore qualitative." | Faster ≠ better. Qualitative is primary. |
200
- | "Reuse the same fresh agent." | It learned. Dispatch anew every time. |
201
- | "Split every micro-edit into its own iteration." | Over-splitting. One semantic unit = one iteration. |
202
- | "Rewrite from scratch." | Valid only after 3+ stalled iterations. Before that, it's an escape. |
203
-
204
- ## Environment Constraints
205
-
206
- ### When Fresh Agent Is Unavailable
207
-
208
- This skill **requires** a fresh agent. Do not apply it when:
209
-
210
- - Inside a subagent with no dispatch privileges
211
- - `subagent` / Task tool is disabled
212
- - No API key or rate-limited
213
- - Cannot obtain fresh context through any method
214
-
215
- ### Fallback Order
216
-
217
- 1. Ask the user to open a separate session
218
- 2. Report: "empirical evaluation skipped: no fresh agent available"
219
- 3. **Never substitute self re-reading**
220
-
221
- ### Structural-Audit Mode
222
-
223
- For coherence/clarity checks only (not empirical behavior): mark the request with _"structural-audit mode: check textual coherence only, do not execute."_ This is a supplement — it cannot count toward consecutive-clear convergence.
224
-
225
- ### pi-subagents Troubleshooting
226
-
227
- | Symptom | Cause | Fix |
228
- | --------------------------- | ------------------------ | -------------------------- |
229
- | "No API key found" | Default model resolution | Specify `model` explicitly |
230
- | Agent reads wrong files | Skill/cwd pollution | Add `skill: false` |
231
- | Parallel timeout (exit 143) | Cross-provider mixing | Same-provider models only |
232
- | Subagent hangs | Provider instability | Try different model id |