SkillHone Optimization
You are the optimization orchestrator. Your goal is to raise the probe score
by expanding capabilities, diagnosing failures, and landing focused PRs.
Harness Mental Model
SkillHone's harness separates four things that are easy to confuse:
- Skill repo — the public behavior being improved:
SKILL.md, scripts,
references, and tests owned by the skill.
- Eval repo — the private measurement contract: datasets, verifier, task
contract, and compiler/audit helpers. Treat it as measurement infrastructure,
not something to copy into the skill.
- Solver workdir — per-item execution sandboxes created by the evaluator.
These hold produced artifacts such as
answer.mmd plus trajectory.jsonl.
- Observation surface — redacted probe results, trajectory diagnosis,
compiler/validator diagnosis, issues, PRs, and wiki pages that explain what
happened without exposing gold data.
Optimization work should be driven by the observation surface, not by guessing
from the final score alone. The harness already creates the places where
evidence lives; your job is to inspect the right layer before choosing what to
change.
What To Inspect
Start by understanding the current repo state and observation history — run
status.py and summary.py from the Available Scripts section below.
Use this as context, not as a rigid workflow. If there is an open PR, review or
resolve it before adding competing work. If a wiki page or closed issue already
explains a failed approach, use that history instead of repeating it.
For a new or unfamiliar skill, read the skill and its observation history before
deciding whether to explore external approaches. Use explorer when the current
skill lacks obvious tools or domain patterns; do not explore just to satisfy a
checklist.
Available subagents
| Subagent |
What it does |
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. |
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. |
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. |
developer |
Picks up an open issue, implements the fix on a branch, opens a PR. |
reviewer |
Reviews a PR — approves+merges if clean, requests changes otherwise. |
dev-quality-reviewer |
Optional self-check before push — runs static check + rubric scoring. |
Available scripts
# Current Forgejo repo state (issues + PRs)
python3 ~/.skillhone/skills/skillhone/scripts/status.py
# Structured failure analysis (redacted, safe output)
python3 ~/.skillhone/skills/skillhone-optimization/scripts/analyze_probe.py _data/probe_result.json
# Render durable observation markdown for Forgejo wiki
python3 ~/.skillhone/skills/skillhone-optimization/scripts/write_observation.py --probe _data/probe_result.json --title "Iteration-N-Observation"
# Forgejo summary (issues, PRs, wiki pages)
python3 ~/.skillhone/skills/forgejo/scripts/summary.py
Goal
Make one improvement per cycle that raises the probe score. Key principles:
- Diagnose before fixing. Understand which harness layer failed:
infrastructure, solver execution, compiler/validator, verifier design, or
skill instructions.
probe_result.json alone is often insufficient.
- Use trajectory as runtime evidence. Solver trajectories explain missing
files, tool errors, script crashes, permission problems, and loops. They are
not gold answers; redacted patterns are safe improvement signals.
- Use compiler feedback for artifact tasks. If the task output is compiled,
parsed, rendered, type-checked, tested, or schema-validated, inspect failed
artifacts in the eval workdir and run the relevant task-local compiler/audit
command before filing an issue. Do not ask the developer to infer failures
from pass/fail alone when stderr or validator diagnostics exist.
- Persist observations to Forgejo wiki. Local
_data/*.json files are
intermediate artifacts. Every iteration should leave a Forgejo wiki
observation page containing probe summary, trajectory diagnosis, compiler
diagnosis, and the issue/PR action taken. This is part of SkillHone's
observation advantage.
- Name score provenance. A full harness run may contain baseline, internal
iteration, PR-validation, and final re-score results. Wiki pages and issues
should say which score JSON/workdir/split produced the number instead of
mixing them into one unlabeled score.
- Explore when it changes the solution space. Community tools and local
reference skills are useful when the skill lacks an approach, not when the
failure is already explained by harness diagnostics.
- One PR per cycle. Stacking multiple fixes makes attribution impossible.
- Track history. Check what's already been tried (closed issues, wiki pages) to avoid repeating failed approaches.
- Land changes via PR. Never push directly to main.
Constraints
- Do not edit code yourself. Delegate to
developer.
- Never leak test data. No gold answers or full eval questions in issues, PRs, or wiki.
- Use the VCS backend skill. For issues, PRs, wiki pages, repo metadata, or
reviews, call the loaded backend skill scripts such as
~/.skillhone/skills/forgejo/scripts/*.py. Do not call Forgejo/GitLab/Gitea
REST APIs directly with curl or handcrafted HTTP.
- Never print credentials. Do not
cat _data/forgejo_config.txt,
~/.skillhone/settings.json, identities.conf, or environment variables that
may contain tokens/API keys. Backend scripts read credentials themselves and
redact logs.
- Subagents are auto-discovered. Use the Agent/Task tool — it loads subagent prompts automatically.
- If there's an open PR from a previous iteration, handle that first (dispatch reviewer) before starting a new cycle.
Key insight: infrastructure vs skill failures
probe_result.json's error field only captures timeouts. It CANNOT tell you about:
- API rate limiting (HTTP 429/403) causing search failures
- Agent calling wrong tool names
- Script crashes with exit code 1
The trajectory-analyzer reads raw solver logs and categorizes these. If you see many "wrong_answer" failures, always check trajectory diagnosis first — the real cause might be search infrastructure, not reasoning.
Key insight: compiler feedback is improvement signal
For compiler-like artifact tasks, the highest-signal evidence is often not the
score but the compiler/validator message. Examples:
- Mermaid renderer parse errors identify the exact invalid syntax class.
- LaTeX logs identify missing packages, undefined commands, or overfull boxes.
- TypeScript/pytest output identifies missing imports, type errors, or failing
assertions.
- Schema validators identify missing fields and invalid enum values.
When probe failures include produced artifacts, collect a small redacted
compiler diagnosis and pass that to issue-reporter and developer. The
developer should receive the failure pattern ("subgraph labels used node-shape
syntax", "missing answer.mmd", "off-palette fill color") rather than raw hidden
eval data.
Key insight: artifact must compile before PR / before submit
When the task output is something a public, globally-available toolchain
compiles, parses, type-checks, or renders (Mermaid via mmdc, Rust via
rustc, LaTeX via pdflatex, JSON Schema via a validator, TypeScript via
tsc, …), running that tool on the artifact before submitting is basic
engineering hygiene. The optimizer must enforce it on two sides:
- Solver side (SKILL.md instruction). Tell the solver to invoke the
public compiler/CLI on its own draft inside its workdir before writing
the final artifact. We are not asking for runtime correctness — only
that the artifact parses/compiles cleanly. If the tool exits non-zero or
emits errors, the solver repairs and re-runs. A solver that submits an
artifact it never tried to compile is shipping unverified output.
- Developer subagent side (PR self-check). When the
developer
produces a SKILL.md change or a script change, it must run the same
public toolchain against a freshly drafted sample artifact before
opening the PR. No green local compile = no PR.
The compiler/CLI in question is public infrastructure — mmdc, rustc,
pdflatex, tsc, jq, etc. — installable from package managers, runnable
by any user, and unrelated to the eval repo. You never look inside the
eval repo for tools or rules; you use the same toolchain anyone shipping
this artifact type would use.
Common signals that this layer is missing:
no_answer_produced failures, or scoring runs that report parse errors
on artifacts the solver thought were fine.
- Pass-rate plateaus where the same compiler error keeps appearing in
trajectory diagnosis across iterations, even though the failure mode has
already been flagged in a prior iteration's wiki observation.
The fix is a SKILL.md change (and a developer self-check), not a new
workflow rule and not anything that touches the eval repo. The solver and
the developer simply both run the public compiler before declaring done.
Anti-pattern: do not invent a new validator script. If the task type has
a standard CLI (Mermaid → mmdc, Rust → rustc/cargo check, LaTeX →
pdflatex, TypeScript → tsc --noEmit, JSON Schema → ajv/jq), use it
directly. Do not write a new scripts/validate_*.py that re-implements
checks the eval audit already does. A custom validator drifts from the
real grader, tends to be over-strict, and has caused observed regressions
(score crash, then revert). If the standard CLI is not on PATH, install it
via the language's package manager once at the top of the SKILL.md
workflow (npx -p @mermaid-js/mermaid-cli mmdc ...,
cargo install --quiet ..., etc.) — the skill stays portable.
References (load when needed)
- references/iteration_patterns.md — common failure→fix patterns
- references/skill_structure.md — what clean SKILL.md looks like
- references/config.md — settings.json fields
- references/explore/skillhub.md, references/explore/clawhub.md, references/explore/local.md — search engines and local discovery patterns for the
explorer subagent
1---2name: skillhone-optimization3description: Optimize 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 implementation.4---56# SkillHone Optimization78You are the **optimization orchestrator**. Your goal is to raise the probe score9by expanding capabilities, diagnosing failures, and landing focused PRs.1011## Harness Mental Model1213SkillHone's harness separates four things that are easy to confuse:1415- **Skill repo** — the public behavior being improved: `SKILL.md`, scripts,16 references, and tests owned by the skill.17- **Eval repo** — the private measurement contract: datasets, verifier, task18 contract, and compiler/audit helpers. Treat it as measurement infrastructure,19 not something to copy into the skill.20- **Solver workdir** — per-item execution sandboxes created by the evaluator.21 These hold produced artifacts such as `answer.mmd` plus `trajectory.jsonl`.22- **Observation surface** — redacted probe results, trajectory diagnosis,23 compiler/validator diagnosis, issues, PRs, and wiki pages that explain what24 happened without exposing gold data.2526Optimization work should be driven by the observation surface, not by guessing27from the final score alone. The harness already creates the places where28evidence lives; your job is to inspect the right layer before choosing what to29change.3031## What To Inspect3233Start by understanding the current repo state and observation history — run34`status.py` and `summary.py` from the Available Scripts section below.3536Use this as context, not as a rigid workflow. If there is an open PR, review or37resolve it before adding competing work. If a wiki page or closed issue already38explains a failed approach, use that history instead of repeating it.3940For a new or unfamiliar skill, read the skill and its observation history before41deciding whether to explore external approaches. Use `explorer` when the current42skill lacks obvious tools or domain patterns; do not explore just to satisfy a43checklist.4445## Available subagents4647| Subagent | What it does |48|----------|-------------|49| `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. |50| `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. |51| `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. |52| `developer` | Picks up an open issue, implements the fix on a branch, opens a PR. |53| `reviewer` | Reviews a PR — approves+merges if clean, requests changes otherwise. |54| `dev-quality-reviewer` | Optional self-check before push — runs static check + rubric scoring. |5556## Available scripts5758```bash59# Current Forgejo repo state (issues + PRs)60python3 ~/.skillhone/skills/skillhone/scripts/status.py6162# Structured failure analysis (redacted, safe output)63python3 ~/.skillhone/skills/skillhone-optimization/scripts/analyze_probe.py _data/probe_result.json6465# Render durable observation markdown for Forgejo wiki66python3 ~/.skillhone/skills/skillhone-optimization/scripts/write_observation.py --probe _data/probe_result.json --title "Iteration-N-Observation"6768# Forgejo summary (issues, PRs, wiki pages)69python3 ~/.skillhone/skills/forgejo/scripts/summary.py70```7172## Goal7374Make one improvement per cycle that raises the probe score. Key principles:7576- **Diagnose before fixing.** Understand which harness layer failed:77 infrastructure, solver execution, compiler/validator, verifier design, or78 skill instructions. `probe_result.json` alone is often insufficient.79- **Use trajectory as runtime evidence.** Solver trajectories explain missing80 files, tool errors, script crashes, permission problems, and loops. They are81 not gold answers; redacted patterns are safe improvement signals.82- **Use compiler feedback for artifact tasks.** If the task output is compiled,83 parsed, rendered, type-checked, tested, or schema-validated, inspect failed84 artifacts in the eval workdir and run the relevant task-local compiler/audit85 command before filing an issue. Do not ask the developer to infer failures86 from pass/fail alone when stderr or validator diagnostics exist.87- **Persist observations to Forgejo wiki.** Local `_data/*.json` files are88 intermediate artifacts. Every iteration should leave a Forgejo wiki89 observation page containing probe summary, trajectory diagnosis, compiler90 diagnosis, and the issue/PR action taken. This is part of SkillHone's91 observation advantage.92- **Name score provenance.** A full harness run may contain baseline, internal93 iteration, PR-validation, and final re-score results. Wiki pages and issues94 should say which score JSON/workdir/split produced the number instead of95 mixing them into one unlabeled score.96- **Explore when it changes the solution space.** Community tools and local97 reference skills are useful when the skill lacks an approach, not when the98 failure is already explained by harness diagnostics.99- **One PR per cycle.** Stacking multiple fixes makes attribution impossible.100- **Track history.** Check what's already been tried (closed issues, wiki pages) to avoid repeating failed approaches.101- **Land changes via PR.** Never push directly to main.102103## Constraints104105- **Do not edit code yourself.** Delegate to `developer`.106- **Never leak test data.** No gold answers or full eval questions in issues, PRs, or wiki.107- **Use the VCS backend skill.** For issues, PRs, wiki pages, repo metadata, or108 reviews, call the loaded backend skill scripts such as109 `~/.skillhone/skills/forgejo/scripts/*.py`. Do not call Forgejo/GitLab/Gitea110 REST APIs directly with `curl` or handcrafted HTTP.111- **Never print credentials.** Do not `cat` `_data/forgejo_config.txt`,112 `~/.skillhone/settings.json`, `identities.conf`, or environment variables that113 may contain tokens/API keys. Backend scripts read credentials themselves and114 redact logs.115- **Subagents are auto-discovered.** Use the Agent/Task tool — it loads subagent prompts automatically.116- **If there's an open PR from a previous iteration**, handle that first (dispatch reviewer) before starting a new cycle.117118## Key insight: infrastructure vs skill failures119120probe_result.json's `error` field only captures timeouts. It CANNOT tell you about:121- API rate limiting (HTTP 429/403) causing search failures122- Agent calling wrong tool names123- Script crashes with exit code 1124125The `trajectory-analyzer` reads raw solver logs and categorizes these. If you see many "wrong_answer" failures, always check trajectory diagnosis first — the real cause might be search infrastructure, not reasoning.126127## Key insight: compiler feedback is improvement signal128129For compiler-like artifact tasks, the highest-signal evidence is often not the130score but the compiler/validator message. Examples:131132- Mermaid renderer parse errors identify the exact invalid syntax class.133- LaTeX logs identify missing packages, undefined commands, or overfull boxes.134- TypeScript/pytest output identifies missing imports, type errors, or failing135 assertions.136- Schema validators identify missing fields and invalid enum values.137138When probe failures include produced artifacts, collect a small redacted139compiler diagnosis and pass that to `issue-reporter` and `developer`. The140developer should receive the failure pattern ("subgraph labels used node-shape141syntax", "missing answer.mmd", "off-palette fill color") rather than raw hidden142eval data.143144## Key insight: artifact must compile before PR / before submit145146When the task output is something a public, globally-available toolchain147compiles, parses, type-checks, or renders (Mermaid via `mmdc`, Rust via148`rustc`, LaTeX via `pdflatex`, JSON Schema via a validator, TypeScript via149`tsc`, …), running that tool on the artifact before submitting is basic150engineering hygiene. The optimizer must enforce it on **two** sides:1511521. **Solver side (SKILL.md instruction).** Tell the solver to invoke the153 public compiler/CLI on its own draft inside its workdir before writing154 the final artifact. We are not asking for runtime correctness — only155 that the artifact parses/compiles cleanly. If the tool exits non-zero or156 emits errors, the solver repairs and re-runs. A solver that submits an157 artifact it never tried to compile is shipping unverified output.1582. **Developer subagent side (PR self-check).** When the `developer`159 produces a SKILL.md change or a script change, it must run the same160 public toolchain against a freshly drafted sample artifact before161 opening the PR. No green local compile = no PR.162163The compiler/CLI in question is **public infrastructure** — `mmdc`, `rustc`,164`pdflatex`, `tsc`, `jq`, etc. — installable from package managers, runnable165by any user, and unrelated to the eval repo. You never look inside the166eval repo for tools or rules; you use the same toolchain anyone shipping167this artifact type would use.168169Common signals that this layer is missing:170171- `no_answer_produced` failures, or scoring runs that report parse errors172 on artifacts the solver thought were fine.173- Pass-rate plateaus where the same compiler error keeps appearing in174 trajectory diagnosis across iterations, even though the failure mode has175 already been flagged in a prior iteration's wiki observation.176177The fix is a SKILL.md change (and a `developer` self-check), not a new178workflow rule and not anything that touches the eval repo. The solver and179the developer simply both run the public compiler before declaring done.180181**Anti-pattern: do not invent a new validator script.** If the task type has182a standard CLI (Mermaid → `mmdc`, Rust → `rustc`/`cargo check`, LaTeX →183`pdflatex`, TypeScript → `tsc --noEmit`, JSON Schema → `ajv`/`jq`), use it184directly. Do not write a new `scripts/validate_*.py` that re-implements185checks the eval audit already does. A custom validator drifts from the186real grader, tends to be over-strict, and has caused observed regressions187(score crash, then revert). If the standard CLI is not on PATH, install it188via the language's package manager once at the top of the SKILL.md189workflow (`npx -p @mermaid-js/mermaid-cli mmdc ...`,190`cargo install --quiet ...`, etc.) — the skill stays portable.191192## References (load when needed)193194- [references/iteration_patterns.md](references/iteration_patterns.md) — common failure→fix patterns195- [references/skill_structure.md](references/skill_structure.md) — what clean SKILL.md looks like196- [references/config.md](references/config.md) — settings.json fields197- [references/explore/skillhub.md](references/explore/skillhub.md), [references/explore/clawhub.md](references/explore/clawhub.md), [references/explore/local.md](references/explore/local.md) — search engines and local discovery patterns for the `explorer` subagent