$npx -y skills add SJTU-IPADS/SkVM --skill skvm-jitTrigger skvm jit-optimize with post-task evidence so it generates a reviewable optimization proposal for a skill. Use after finishing a task that was driven by any skill (not just SkVM-compiled ones) when the outcome was a failure, was partial, or the skill's instructions clear
| 1 | # SkVM JIT Optimize Trigger |
| 2 | |
| 3 | When you finish a task that was driven by a skill, and the skill's own instructions appear to have caused problems, collect a short structured record of what happened and invoke `skvm jit-optimize`. The optimizer reads that evidence, proposes improvements to the skill's files, and stores them as a **proposal** you can inspect with `skvm proposals show <id>`. |
| 4 | |
| 5 | This skill is not a human review workflow. Its job is to turn task evidence into a concrete optimization run. |
| 6 | |
| 7 | This works for **any** skill the host harness can load — it does not need to have been produced by SkVM's compiler. `jit-optimize` only needs the skill folder on disk; it does not require SkVM-specific artifacts. |
| 8 | |
| 9 | ## When to trigger |
| 10 | |
| 11 | Run this skill **only** when both of the following hold: |
| 12 | |
| 13 | 1. The task you just completed was driven by a skill that the harness loaded from disk (not an ad-hoc user instruction). |
| 14 | 2. At least one of the following is true: |
| 15 | - the task **failed** or ended **partial**, and a clearer skill would plausibly have avoided it |
| 16 | - you observed a concrete problem in the skill's instructions: ambiguity, a missing step, an incorrect claim, a confusing ordering, or an unnecessary detour the skill forced you into |
| 17 | |
| 18 | Do **not** run this skill when: |
| 19 | |
| 20 | - the task succeeded and the skill read cleanly — silent passes are fine, the optimizer does not need "nothing to report" submissions |
| 21 | - the failure was purely user-side (typo in the prompt, missing credentials, network failure) and no change to the skill would have helped |
| 22 | - the task did not use a skill at all, or used only a trivial one-shot instruction |
| 23 | - you are running inside `skvm bench` or any other SkVM-orchestrated flow — bench owns its own optimization loop, do not double-submit |
| 24 | |
| 25 | ## Step 1: Locate the skill directory |
| 26 | |
| 27 | The skill directory contains a `SKILL.md` file. You need the absolute path to pass as `--skill=<dir>` in Step 3. |
| 28 | |
| 29 | Each agent harness installs skills in well-known locations. Read `adapter-skill-paths.md` (sibling file in this skill's directory) and look up the section matching the harness you are currently running inside — it lists the search order for Claude Code, opencode, openclaw, hermes, jiuwenclaw, and bare-agent. Probe the listed paths in order and pick the first one that contains a `SKILL.md` for the skill name you are looking for. |
| 30 | |
| 31 | If none of the listed paths contains the skill, or the reference file marks your harness as "confirm with user", ask the user for the path — do not guess. |
| 32 | |
| 33 | ## Step 2: Prepare optimizer input |
| 34 | |
| 35 | Pick **one** of the two formats below. Save it anywhere (e.g. a temp file); you'll pass its path as `--logs=<path>` in Step 3. |
| 36 | |
| 37 | ### Format A — Simple optimization report (preferred for one-off observations) |
| 38 | |
| 39 | Save as `report.json`: |
| 40 | |
| 41 | ```json |
| 42 | { |
| 43 | "task": "<what the user asked, one or two sentences>", |
| 44 | "outcome": "pass" | "fail" | "partial", |
| 45 | "issues": [ |
| 46 | "short description of each problem you hit", |
| 47 | "another problem" |
| 48 | ], |
| 49 | "skill_feedback": "concrete suggestion for how the SKILL.md could be clearer or more correct" |
| 50 | } |
| 51 | ``` |
| 52 | |
| 53 | Keep `issues` focused on things the **skill's instructions** could prevent or clarify. Do not include issues that were purely user-side (typos in the prompt, missing credentials, network failures). |
| 54 | |
| 55 | The JSON key is still named `skill_feedback` because that is the current report schema consumed by `jit-optimize`; treat it as an optimization hint for the engine, not as human-directed feedback. |
| 56 | |
| 57 | When `outcome` is `fail` or `partial`, the optimizer treats the issues and `skill_feedback` as failure reasons attached to a synthetic "agent-reported" criterion. When `outcome` is `pass`, the report still enters the optimizer but with no failures, letting it notice what worked well. |
| 58 | |
| 59 | ### Format B — Conversation log (preferred when the full turn-by-turn trace is informative) |
| 60 | |
| 61 | Save as `conv-log.jsonl`, one JSON object per line: |
| 62 | |
| 63 | ```jsonl |
| 64 | {"type":"request","ts":"<iso8601>","text":"<user prompt>"} |
| 65 | {"type":"response","ts":"<iso8601>","text":"<your reply or summary of the step>"} |
| 66 | {"type":"tool","ts":"<iso8601>","text":"<tool call summary>","toolCalls":[...]} |
| 67 | ``` |
| 68 | |
| 69 | Only include entries that matter for diagnosing the skill's quality. Redact secrets. |
| 70 | |
| 71 | ## Step 3: Run jit-optimize |
| 72 | |
| 73 | ```bash |
| 74 | skvm jit-optimize --detach \ |
| 75 | --skill=<skill-directory> \ |
| 76 | --task-source=log \ |
| 77 | --logs=<path-to-report.json-or-conv-log.jsonl> \ |
| 78 | --target-model=<id-the-task-ran-on> \ |
| 79 | --optimizer-model=openrou |