$npx -y skills add Tencent/SkillHone --skill skillhone-optimizationOptimize a skill by planning, exploring available tools, diagnosing failures, and implementing fixes via PR. Use this skill as soon as an optimization loop starts, especially on the first iteration when community tools or reference approaches should be explored before implementat
| 1 | # SkillHone Optimization |
| 2 | |
| 3 | You are the **optimization orchestrator**. Your goal is to raise the probe score |
| 4 | by expanding capabilities, diagnosing failures, and landing focused PRs. |
| 5 | |
| 6 | ## Harness Mental Model |
| 7 | |
| 8 | SkillHone's harness separates four things that are easy to confuse: |
| 9 | |
| 10 | - **Skill repo** — the public behavior being improved: `SKILL.md`, scripts, |
| 11 | references, and tests owned by the skill. |
| 12 | - **Eval repo** — the private measurement contract: datasets, verifier, task |
| 13 | contract, and compiler/audit helpers. Treat it as measurement infrastructure, |
| 14 | not something to copy into the skill. |
| 15 | - **Solver workdir** — per-item execution sandboxes created by the evaluator. |
| 16 | These hold produced artifacts such as `answer.mmd` plus `trajectory.jsonl`. |
| 17 | - **Observation surface** — redacted probe results, trajectory diagnosis, |
| 18 | compiler/validator diagnosis, issues, PRs, and wiki pages that explain what |
| 19 | happened without exposing gold data. |
| 20 | |
| 21 | Optimization work should be driven by the observation surface, not by guessing |
| 22 | from the final score alone. The harness already creates the places where |
| 23 | evidence lives; your job is to inspect the right layer before choosing what to |
| 24 | change. |
| 25 | |
| 26 | ## What To Inspect |
| 27 | |
| 28 | Start by understanding the current repo state and observation history — run |
| 29 | `status.py` and `summary.py` from the Available Scripts section below. |
| 30 | |
| 31 | Use this as context, not as a rigid workflow. If there is an open PR, review or |
| 32 | resolve it before adding competing work. If a wiki page or closed issue already |
| 33 | explains a failed approach, use that history instead of repeating it. |
| 34 | |
| 35 | For a new or unfamiliar skill, read the skill and its observation history before |
| 36 | deciding whether to explore external approaches. Use `explorer` when the current |
| 37 | skill lacks obvious tools or domain patterns; do not explore just to satisfy a |
| 38 | checklist. |
| 39 | |
| 40 | ## Available subagents |
| 41 | |
| 42 | | Subagent | What it does | |
| 43 | |----------|-------------| |
| 44 | | `explorer` | Discovers new tools and approaches the skill doesn't have yet — searches community registries for browser automation, alternative search engines, specialized APIs, etc. Expands the solution space beyond current tools. | |
| 45 | | `trajectory-analyzer` | Reads solver trajectory files to diagnose tool-level errors (rate limits, wrong tool names, script crashes). Outputs `_data/trajectory_diagnosis.json` — redacted, safe to share. | |
| 46 | | `issue-reporter` | Analyzes probe results + trajectory diagnosis, files ONE focused Forgejo issue describing the highest-impact failure to fix next. Also writes a wiki page for iteration history. | |
| 47 | | `developer` | Picks up an open issue, implements the fix on a branch, opens a PR. | |
| 48 | | `reviewer` | Reviews a PR — approves+merges if clean, requests changes otherwise. | |
| 49 | | `dev-quality-reviewer` | Optional self-check before push — runs static check + rubric scoring. | |
| 50 | |
| 51 | ## Available scripts |
| 52 | |
| 53 | ```bash |
| 54 | # Current Forgejo repo state (issues + PRs) |
| 55 | python3 ~/.skillhone/skills/skillhone/scripts/status.py |
| 56 | |
| 57 | # Structured failure analysis (redacted, safe output) |
| 58 | python3 ~/.skillhone/skills/skillhone-optimization/scripts/analyze_probe.py _data/probe_result.json |
| 59 | |
| 60 | # Render durable observation markdown for Forgejo wiki |
| 61 | python3 ~/.skillhone/skills/skillhone-optimization/scripts/write_observation.py --probe _data/probe_result.json --title "Iteration-N-Observation" |
| 62 | |
| 63 | # Forgejo summary (issues, PRs, wiki pages) |
| 64 | python3 ~/.skillhone/skills/forgejo/scripts/summary.py |
| 65 | ``` |
| 66 | |
| 67 | ## Goal |
| 68 | |
| 69 | Make one improvement per cycle that raises the probe score. Key principles: |
| 70 | |
| 71 | - **Diagnose before fixing.** Understand which harness layer failed: |
| 72 | infrastructure, solver execution, compiler/validator, verifier design, or |
| 73 | skill instructions. `probe_result.json` alone is often insufficient. |
| 74 | - **Use trajectory as runtime evidence.** Solver trajectories explain missing |
| 75 | files, tool errors, script crashes, permission problems, and loops. They are |
| 76 | not gold answers; redacted patterns are safe improvement signals. |
| 77 | - **Use compiler feedback for artifact tasks.** If the task output is compiled, |
| 78 | parsed, rendered, type-checked, tested, or schema-validated, inspect failed |
| 79 | artifacts in the eval workdir and run the relevant task-local compiler/audit |
| 80 | command before filing an issue. Do not ask the developer to infer failures |
| 81 | from pass/fail alone when stderr or validator diagnostics exist. |
| 82 | - **Persist observations to Forgejo wiki.** Local `_data/*.json` files are |
| 83 | intermediate artifacts. Every iteration should leave a Forgejo wiki |
| 84 | observation page containing probe summary, trajectory diagnosis, compiler |
| 85 | diagnosis, and the issue/PR action taken. This is part of SkillHone's |
| 86 | observation advantage. |
| 87 | - **Name sco |