greprag 5.42.3 → 5.43.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,58 @@
1
+ # Skill-Fix Conventions
2
+
3
+ **Status:** SHIPPED leg of the skill-tuning reflex (`docs/mechanic-skill-tuning.md`). The portable recipe set the reflex applies when a skill exhibits friction. Ships **with greprag** (bundled into the mechanic skill package, mirrored to `~/.claude/skills/mechanic/docs/`) so the fixer works for any user — it does **not** depend on `/skill-optimize` being installed. `/skill-optimize` remains the richer interactive tool; this is the minimal portable subset the reflex carries.
4
+
5
+ ## What this is for
6
+
7
+ The skill-tuning reflex injects a directive when a skill under break-in loads. The old directive said "watch your execution, emit a SELF-TUNING block, propose a fix" — vague (it pointed at the *run*, not the *skill*) and propose-only (no edit ever landed). This doc replaces that with **six locatable skill defects**, each mapped to one concrete edit. The reflex's loop is: **detect a defined friction → locate it in the skill's SKILL.md → apply the fix per the matching recipe → show the diff for one accept/revert.**
8
+
9
+ A friction that doesn't match one of the six below is **not auto-fixable** — log it (`greprag fix log "<obs>" --scope skill:<name>`) and keep working. Do not invent edits outside these recipes.
10
+
11
+ ## The two edit primitives (skill-optimize vocabulary)
12
+
13
+ Every fix below resolves to one of two inline forms:
14
+
15
+ - **Convention A — one-liner + link.** Reference material (facts, recipes, paths). Inline: one sentence naming what the linked doc holds + the path.
16
+ - **Convention B — loud trigger + inline rule + link.** A proactive-fire rule with no external trigger. Three parts: (1) interrogative intent-catch — `ABOUT TO <do X>?` names the *moment*, not the topic; (2) hard stop — `STOP —`; (3) the inline rule, complete enough to comply without opening the link. A flat `IMPORTANT: do Y` reads as wallpaper and gets skipped — the interrogative + hard stop is what catches the model mid-generation.
17
+
18
+ ## The six frictions → six fixes
19
+
20
+ Each: **signature** (how it shows up in the run) · **location** (where it lives in SKILL.md) · **fix** (the exact edit).
21
+
22
+ ### 1. mis-route
23
+ - **Signature:** the skill fired for a task outside its lane, OR you reached for it by an obvious phrase and it didn't trigger.
24
+ - **Location:** the `description` / `Use when:` trigger list, or the `NOT for:` boundary.
25
+ - **Fix:** add the missing trigger phrase to `Use when:` (verbatim, the phrase you'd actually type), OR add/sharpen a `NOT for:` line naming the lane it wrongly claimed. One phrase per defect — don't pad the list.
26
+
27
+ ### 2. wrong-altitude
28
+ - **Signature:** the skill did work it should have delegated (implemented inline when it should hand to a chip; drafted when it should route to a leaf), or the reverse.
29
+ - **Location:** the handoff / out-of-scope / "Related skills" section.
30
+ - **Fix:** add a handoff line or out-of-scope row naming the correct delegate and the trigger to route there (`X → hand to /<delegate>`).
31
+
32
+ ### 3. flattened-relay
33
+ - **Signature:** the skill made you summarize/paraphrase content that should pass through verbatim (or forced verbatim where a summary was wanted).
34
+ - **Location:** the output-shape / relay rule.
35
+ - **Fix:** add a Convention-B rule pinning relay fidelity — `ABOUT TO SUMMARIZE <X>? STOP — relay it verbatim; <why>.`
36
+
37
+ ### 4. wallpaper-rule
38
+ - **Signature:** a real rule in the skill got skipped because it's a flat `IMPORTANT:`/prose imperative the model read as decoration.
39
+ - **Location:** the rule's existing inline form.
40
+ - **Fix:** rewrite that rule in place to Convention B (interrogative intent-catch + `STOP —` + the inline rule). Same content, fingerprint that catches the model in the act. Don't add a new rule — convert the existing one.
41
+
42
+ ### 5. stale-reference
43
+ - **Signature:** a path, command, or name in the skill 404'd, errored, or pointed at a renamed/removed thing.
44
+ - **Location:** the reference itself (a path, a command, a product/feature name).
45
+ - **Fix:** repoint to the live path/name. Verify the new target exists before writing it (`test -f`, or confirm the rename in `docs/naming.md` for greprag surfaces). If the reference is wholly dead, remove it.
46
+
47
+ ### 6. missing-rule
48
+ - **Signature:** you hit a gotcha mid-run that the skill should have warned about but doesn't.
49
+ - **Location:** absent — a gap.
50
+ - **Fix:** add a new Convention-B proactive-fire rule at the spot in SKILL.md where the agent would meet the gotcha. Keep it to the interrogative + hard stop + one-line rule; link a doc only if a full procedure exists.
51
+
52
+ ## Guardrails
53
+
54
+ - **One friction, one edit.** If a run surfaced two defects, make two separate edits, each shown for its own accept/revert. Never batch.
55
+ - **Apply + show diff.** Make the edit, then show the unified diff and stop for one accept/revert. (This is the operator-chosen gate; the Mechanic "always confirm" rule still holds.)
56
+ - **Bundled skills:** if the target is a greprag bundled skill, author the edit at `packages/cli/skill/<name>/` — never the `~/.claude/skills/<name>/` install artifact (it's overwritten on the next `init`). See greprag `CLAUDE.md`.
57
+ - **Line budget:** a fix must not grow SKILL.md without adding a real proactive-fire rule or per-task step. Converting wallpaper → Convention B is net-neutral or smaller; mis-route adds at most one line.
58
+ - **Out of taxonomy → log, don't improvise.** Anything not matching the six is `greprag fix log`-only.