harbor-harness-improvement-loop
Skill11 starsChanged 20 days agoMITView on GitHub
Analyze Harbor benchmark jobs and ATIF trajectories, identify evidence-backed weaknesses across LibrAgent builtin tools, prompts, agent guidance, execution policy, and benchmark instrumentation, then design controlled improvements and rerun comparisons. Use when analyzing Harbor or Terminal-Bench results, optimizing the harness, investigating tool-call failures or retries, auditing prompt/context efficiency, or running repeated BM → analysis → improvement cycles.
In this repository48 other files it gives its agents.
- agents.mdAGENTS.md
- .agents/skills/react-best-practices/AGENTS.mdAGENTS.md
- .agents/skills/react-native-skills/AGENTS.mdAGENTS.md
- .agents/skills/react-view-transitions/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- agent-initSkill
- agy-delegateSkill
- audit-docsSkill
- code-audit-expertSkill
- computer-diagnosisSkill
- create-builtin-toolSkill
- create-prSkill
- critique-builtin-toolSkill
- doc-auditorSkill
- docxSkill
- extract-log-debugSkill
- feature-refactor-proposalSkill
- gatekeeper-loopSkill
- i18n-language-standardsSkill
- jobs-trace-analyzerSkill
- lean-builtin-tool-auditorSkill
- libragent-qualitySkill
- libr-delegateSkill
- libr-tool-e2e-harness-loopSkill
- modular-large-file-refactorSkill
- performance-auditSkill
- pptxSkill
- vercel-react-best-practicesSkill
- vercel-react-native-skillsSkill
- vercel-react-view-transitionsSkill
- readme-showcase-syncSkill
- refactor-builtin-toolSkill
- release-managerSkill
- review-local-changesSkill
- review-pr-commentsSkill
- science-searchSkill
- setup-wizardSkill
- skill-creatorSkill
- soul-awakeningSkill
- sqlite-analyzerSkill
- sync-pending-approvalsSkill
- tool-creatorSkill
- trace-analyzerSkill
- trace-eval-loopSkill
- vitepress-doc-syncSkill
- worker-loopSkill
- x-cliSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. About 0 are common, 18 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈18
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Do not put those in findings, owning layers, hypotheses, outcome commentary, contract tables, or next-cycle.
- Distinctive: line 33
Treat reward as an outcome, not a cause.
- Distinctive: line 36
Do not claim causality from one trial unless a deterministic contract violation is visible.
- Distinctive: line 41
Never modify benchmark tasks, verifiers, official timeout/resource limits, or add task-specific prompt clues to improve scores.
- Distinctive: line 43
Do not recommend a prompt change when a schema, handler, response, or instrumentation fix is the narrower source-of-truth solution.
- Distinctive: line 45
Do not duplicate the same instruction across system prompt, assistant prompt, tool description, and result hint.
- Very specific: line 47
Ask before editing protected or git-tracked product files.
- Distinctive: line 61
If these cannot be established, analyze the run but mark cross-run conclusions as unverified.
- Distinctive: line 73
Run the bundled analyzer:
- Very specific: line 102
Check token/turn/tool-call distributions.
- Distinctive: line 104
Read references/evidence-model.md before assigning a root cause.
- Distinctive: line 109
Use the narrowest layer that can fix the observed contract:
- Distinctive: line 140
Prefer broad, repeated, high-confidence defects.
- Distinctive: line 152
add missing telemetry without changing agent behavior
- Distinctive: line 162
Run focused unit/contract tests.
- Very specific: line 163
Run focused lint or formatting checks if necessary.
- Distinctive: line 165
If the signal is positive and no regression appears, rerun the broader suite with multiple attempts.
- Distinctive: line 168
Do not call a change successful from reward alone.
- Distinctive: line 178
Write each cycle under:
- Distinctive: line 188
Use references/report-template.md.
- Distinctive: line 193
Stop and report instead of changing code when:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Harbor Harness Improvement Loop
Build a repeatable benchmark → diagnosis → smallest intervention → rerun cycle. Optimize general agent capability, not benchmark-specific shortcuts.
Analysis scope (non-negotiable)
A job in this repo is a harness test. The only question is: which tool, prompt, handler, adapter, or telemetry contract failed?
Don't care (never diagnose, compare, or narrate): model, serving engine.
Do not put those in findings, owning layers, hypotheses, outcome commentary, contract tables, or next-cycle.
Allowed output only:
- tool sequences (name, args, order, repeats)
- observations (size, hint, error contract)
- schema / handler / response / prompt / adapter / telemetry source
Reconstruct intent → tool call → observation → next tool. First divergence
is a tool-pattern class. No harness contract broken → write the pattern and
stop.
Hard rules
- Treat reward as an outcome, not a cause. Inspect trajectories and source before recommending changes.
- Separate measured fact, trace interpretation, and hypothesis.
- Do not claim causality from one trial unless a deterministic contract violation is visible. Label single-trial findings as hypotheses.
- Compare runs only when dataset/task selection, assistant, attempts, concurrency, execution mode, workspace mode, timeout/resource policy, and verifier configuration are equivalent.
- Never modify benchmark tasks, verifiers, official timeout/resource limits, or add task-specific prompt clues to improve scores.
- Do not recommend a prompt change when a schema, handler, response, or instrumentation fix is the narrower source-of-truth solution.
- Do not duplicate the same instruction across system prompt, assistant prompt, tool description, and result hint.
- Ask before editing protected or git-tracked product files. Reports and experiment
ledgers go under
.libragent/work/.
Cycle
1. Freeze the experiment contract
Record:
- job paths and git revision
- dataset, included tasks, attempts, and concurrency
- assistant ID/version, execution mode, workspace mode
- timeout/resource and verifier settings
If these cannot be established, analyze the run but mark cross-run conclusions as unverified.
2. Inventory and validate artifacts
Collect recursively:
- job
result.json - trial
verifier/reward.txt - agent
trajectory.json(ATIF) - relevant adapter/session logs when present
Run the bundled analyzer:
python .agents/skills/harbor-harness-improvement-loop/scripts/analyze_harbor_results.py \
jobs/<baseline> [jobs/<candidate>] \
--output .libragent/work/harbor-harness-cycle/summary.jsonThe script produces descriptive metrics and explicitly labels heuristic error signals. It does not establish causality.
Before interpretation, flag:
- missing or invalid trajectories
- reward without completed trajectory
- absent token data
- workspace-mode mismatch
- errors, cancelled/incomplete runs, and verifier failures
- unequal task or attempt coverage between runs
3. Analyze outcomes and traces
Analyze successful and failed trials separately. For each representative trace:
- Reconstruct the sequence: intent → tool call → observation → next tool.
- Find the first divergence from an efficient successful path (tool pattern).
- Count tool selection, invalid arguments, retries, repeated calls, oversized outputs, missing verification, premature completion, and unrecovered errors.
- Compare tool sequences with successful traces for the same task family.
- Check token/turn/tool-call distributions; do not rely on means alone.
Read references/evidence-model.md before assigning a root cause.
4. Map each symptom to the owning layer
Use the narrowest layer that can fix the observed contract:
| Symptom | Inspect first |
| Correct tool is unavailable or consistently not selected | tool exposure, name, description, input schema |
| Tool selected with invalid/missing arguments | schema required fields, enums, examples, validation error |
| Same failed action repeats | error recovery hint, state feedback, loop/escalation prompt |
| Tool succeeds but result misleads or bloats context | handler output, truncation/pagination, structured content, hints |
| Agent uses many micro-tools for one outcome | tool boundaries, consolidation, backend automation |
| Agent skips planning/verification across unrelated tools | assistant/system/workspace prompt |
| Prompt tokens grow or cache ratio degrades | stable/volatile prompt split, tool schema volume, repeated context |
| Correct actions still produce wrong workspace state | handler semantics, isolation/sync, process lifecycle |
| Metrics are missing or contradictory | Harbor adapter, Session API telemetry, aggregation script |
Inspect the actual schema, dispatcher, handler, response builder, prompt assembly,
and tests for the suspected layer. Use critique-builtin-tool,
lean-builtin-tool-auditor, or refactor-builtin-tool when the evidence points
to builtin implementation details.
5. Form and rank hypotheses
For every proposal record:
- observed evidence and affected trial count
- successful-trace counterexample check
- owning layer and inspected code paths
- mechanism: why the change should alter behavior
- expected measurable effect
- regression and benchmark-overfitting risk
- confidence: high / medium / low
Prefer broad, repeated, high-confidence defects. Keep low-confidence ideas in a backlog. Do not convert all correlations into work items.
6. Choose the smallest controlled intervention
Change one causal variable per experiment when practical. Examples:
- clarify one ambiguous schema field
- make one error response actionable and state-aware
- trim or paginate one oversized result
- hide one internal tool
- move one repeated instruction to its owning layer
- add missing telemetry without changing agent behavior
Define acceptance criteria before editing. Preserve a held-out task set to detect overfitting.
7. Implement and verify
After user approval:
- Apply the minimal change.
- Run focused unit/contract tests.
- Run focused lint or formatting checks if necessary. Never run the full
pnpm refactor:validatepipeline automatically (run only if explicitly requested by the user to avoid system resource starvation). - Rerun a small matched task slice.
- If the signal is positive and no regression appears, rerun the broader suite with multiple attempts.
Do not call a change successful from reward alone. Compare:
- task reward/pass rate and errors
- turns and total/per-task tool calls
- input/output/cache tokens
- repeated/failed calls and recovery rate
- completion integrity and workspace correctness
8. Record and continue
Write each cycle under:
.libragent/work/harbor-harness-cycle/<cycle-id>/
├── experiment.md
├── baseline-summary.json
├── candidate-summary.json
└── analysis.mdUse references/report-template.md. End each cycle with one decision: adopt, revert, iterate, or inconclusive.
Stop conditions
Stop and report instead of changing code when:
- baseline and candidate are not comparable
- telemetry is insufficient to localize the issue
- the proposed fix depends on benchmark-specific knowledge
- the only evidence is hidden reasoning text
- variance exceeds the observed difference
- the tool pattern is clear but no schema/handler/response/adapter contract is broken (report the pattern; do not invent an owner outside the harness)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

