External Tool Contract
Required CLI tools, tool runtimes, and how agents report tool blockers
External tools are part of the Harness operating baseline. They let agents choose the right evidence path without renegotiating the environment.
Where Required Tools Come From
A repository's required tools come from three sources:
| Source | Tools | Installed by |
|---|---|---|
The tools Registry Item in pack-core | agent-browser, opensrc, portless, skills | hi tools ensure |
The requiresTools field of installed skills | debug-agent (from debug-agent and debugging-phase), clawpatch (from bug-discovery-phase and bug-resolution-phase), both in the debug Pack; earshot, uv, ffmpeg, ffprobe, python3, and node from the optional video Pack | hi tools ensure for earshot and the npm tools; the operator for the rest |
The repository manager chosen at hi init | the provider CLI, such as gh | the operator, by hand |
hi init records the provider CLI in the settings requiredTools and keeps tools that are already listed there. hi tools ensure reads the settings requiredTools plus the requiredTools of every installed Registry Item. Each catalog tool has one kind:
| Kind | Tools | hi tools ensure |
|---|---|---|
npm-global | agent-browser, opensrc, portless, skills, debug-agent, clawpatch | Installs with Bun, pnpm, or npm at the catalog install target (for example opensrc@latest). |
uv | earshot | Runs uv tool install at the full 40-character pinned SHA. It skips the install when the uv receipt rev equals the pin, and reinstalls at the pin when it differs. |
check-only | uv, ffmpeg, ffprobe, python3 (>= 3.11), node (>= 22), and provider CLIs (gh, glab, az) | Never installs. Fails when the tool is not on PATH, or names the minimum and found version when it is too old. |
An unknown tool id fails as having no install metadata; the Baseline publisher rejects a skill whose requiresTools names a tool outside the catalog. Deselecting a Pack never uninstalls its tools. hi update prints the required tools and the hi tools ensure hint. hi check reports the settings tools that are not on PATH as missingTools; it never changes status for them.
No tool manifest file exists. The retired .devpunks/required-tools.json is gone.
skills
skills makes shared workflow and implementation skill contracts installable and updateable. Harness guidance can assume the relevant skill entrypoints exist instead of pasting every workflow contract into prompts. The Baseline itself installs its skills into .agents/skills/<id>; skills covers skill work outside the Baseline.
skills lsopensrc
opensrc makes dependency and curated example source inspection repeatable when package behavior shapes a decision.
Official docs come first. Source inspection matters when docs are stale, vague, or too abstract for the implementation question. Agents are good at reading code, following real call paths, and comparing examples against the repo in front of them. Cloning or locating source gives the agent concrete behavior to inspect instead of relying on memory of how a library is supposed to work.
opensrc path --cwd . <package>
opensrc path <owner>/<repo>The tool catalog requires opensrc >=0.7.2.
Repo-local opensrc/*.md files are source guide cards, not cloned source. hi init and hi update copy one card, opensrc/<id>.md, for each source guide that a selected Pack carries, and build the opensrc/README.md index. A card tells the agent which package command to run, which fallback repository lookup to use, and where to start reading after opensrc returns the cache path. The source itself stays in the global ~/.opensrc cache unless the operator explicitly chooses a different cache root.
The CLI never invents concrete opensrc repositories. After an install, the handoff tells the agent to find the core libraries whose source behavior matters, read opensrc/<package>.md when it exists, and then run opensrc path --cwd . <package>.
agent-browser
agent-browser turns routed and interactive web validation into observable browser evidence. For pages, forms, dashboards, auth flows, or visual states, the harness should prefer observing the running app over inferring behavior from a successful build. See Validation Gates for when browser evidence is required.
agent-browser open <url>
agent-browser snapshotportless
portless provides stable *.localhost origins and avoids raw port collisions across worktrees.
Use portless local subdomains in examples, callback URLs, allowed origins, CORS, and app-to-app proxy targets. Raw localhost:<port> values are acceptable as transient command output, but stable docs and generated guidance should prefer the portless baseline.
portless run <cmd>
portless get <name>
portless compose up -d
portless compose down
portless doctorportless run detects linked git worktrees and prefixes the route with the last branch segment, so each worktree gets its own origin.
portless compose (portless 0.16+) gives each Docker Compose service that publishes an HTTP port its own https://<service>.<project>.localhost route on a stable loopback port. Database, cache, and UDP ports keep their published ports, so connection strings do not change. Use portless compose up, not plain docker compose up: a plain run recreates containers with their original ports and breaks the routes. Service labels portless.enable, portless.name, and portless.ports control routing. A routed service runs one container only.
Run portless doctor first when a portless URL does not load.
debug-agent
debug-agent supports runtime evidence workflows when logs, repros, traces, screenshots, or timing matter. It belongs in Debugging when validation or review exposes a runtime failure and the agent needs evidence before patching. The debug-agent skill starts the log server in daemon mode before any instrumentation:
npx debug-agent --daemonThe skill's final step stops the server that the session started, on every exit, including a blocked one. It leaves a reused server running, deletes the session log file, and checks that the endpoint no longer connects.
clawpatch
clawpatch supports AFK static bug discovery, durable finding ledgers, report generation, triage, and selected-finding revalidation. It belongs in Massive Bug Hunt And Fix.
Discovery runs keep state in the repository and use read-oriented commands. clawpatch fix --finding and clawpatch open-pr are explicit mutation paths; bug-discovery-phase blocks them by default.
By default, ClawPatch inherits the current agent or launcher provider. Add --provider or --model only when the operator explicitly selects an override.
clawpatch doctor --root "$REPO" --state-dir "$REPO/.clawpatch"
clawpatch init --root "$REPO" --state-dir "$REPO/.clawpatch"
clawpatch map --root "$REPO" --state-dir "$REPO/.clawpatch"
clawpatch review --root "$REPO" --state-dir "$REPO/.clawpatch" --limit "$LIMIT" --jobs "$JOBS"
clawpatch report --root "$REPO" --state-dir "$REPO/.clawpatch" --output "$REPORT" --plainUse clawpatch ci instead of review for CI-shaped discovery, and clawpatch revalidate --finding after a fix.
Tool Runtimes
A Tool Runtime is a pinned, machine-level runtime that a Pack provisions. It is not a PATH tool. Today there is one: typegraph-runtime, a dependency of the typescript Pack only.
- Its Registry Item pins the exact
typegraph-mcpmanifest and lockfile. It needs Node>=22.18andnpm. - After it writes the Installed Record,
hi updaterunsnpm ciinto${XDG_DATA_HOME:-~/.local/share}/hi-tools/typegraph-mcp/<version>. That directory is never pruned. hi updatediscovers and load-probes the Compiler Projects, then writes one[mcp_servers.typegraph_<project>]entry per passing project inside the fenced# BEGIN hi typegraphblock of the Authored.codex/config.toml. Without the Pack, it removes only that block.- An unavailable runtime is reported with its reason; the update status stays
applied. hi checkadds asemanticReadssection only whentypegraph-runtimeis installed. It never changesstatus.
Codex agents get five semantic reads: ts_find_symbol, ts_definition, ts_references, ts_type_info, and ts_module_exports. Start a new session after a tsconfig, dependency, or branch change. Semantic reads never replace format, lint, or typecheck evidence. See the Codex TypeScript semantic reads runbook.
Failure Reporting
Tool absence is part of the evidence trail. If a required tool is unavailable, the agent records the exact blocker or limitation and the validation path it affected.
The agent should not silently replace browser validation with a guess, skip source inspection when package behavior is central, claim portless-compatible setup when only a raw port was tested, or treat ClawPatch findings as proven runtime root causes without runtime evidence.
Done Signal
Tool usage is complete when required tools were checked or used for the relevant surface, unavailable tools were reported as blockers, and hi check shows no missingTools that the run depended on.