AGENT SKILL

mcp-harness-router

Use when a request involves inspecting, changing, importing, reviewing, building, debugging, running, waiting, or invoking a private logical MCP server on the connected personal WSL/Linux machine, including repository/file/process work, Codebase Memory repository intelligence, ChatGPT file ingress, working-tree review, or interactive human terminal input such as sudo/password prompts.

License 许可
MIT
所属仓库
ham-zax/webharness
最近更新
2026-11-15
Stars
★ 0
Forks
0

01 前言 Front Matter

name
mcp-harness-router
description
Use when a request involves inspecting, changing, importing, reviewing, building, debugging, running, waiting, or invoking a private logical MCP server on the connected personal WSL/Linux machine, including repository/file/process work, Codebase Memory repository intelligence, ChatGPT file ingress, working-tree review, or interactive human terminal input such as sudo/password prompts.

02 资源文件 2

03 SKILL.md 正文

MCP Harness Router

Route by the information or mutation semantics, not by file count, connector-call count, or habit. Keep this skill limited to tool selection; do not prescribe Git, planning, testing, review, or implementation methodology.

When Superpowers Web Adapter also applies, let Superpowers control engineering workflow and use this skill only to choose between direct Dev primitives, Local logical servers, and Dev wait. When Agent Browser also applies, let it choose the logical browser server and browser_target; preserve that choice and use this skill only to route the selected private Browser action through Local.

Route the task

  • Focused contents of a known file/range -> read.
  • Existing-text mutation in one or more files -> edit. If oldText is not yet known, inspect with read, rg, or ast-grep and widen the anchor until it remains unique under the tolerant matcher.
  • Syntax-shaped discovery or codemod -> ast-grep through exec when it is a direct argv invocation. Inspect bounded matches and normally perform the final mutation through guarded edit; use bash only when the ast-grep workflow genuinely needs shell syntax, and use ast-grep bulk rewrite only when the transformation is deterministic and every bounded match is intentionally changed.
  • New standalone text file -> write.
  • Native ChatGPT attached/generated file ingress -> import_file when exposed. Import directly to the intended WSL destination; do not substitute base64, shell downloads, or invented host paths. The operation is create-only, so choose a new destination whose parent already exists.
  • Move or delete an existing regular file -> file_ops.
  • Existing authoritative .patch/.diff artifact -> bash with git apply --check -- "$patch" && git apply -- "$patch". Use --3way only when the user explicitly requests merge-style recovery; never add fuzzy/custom patch recovery automatically.
  • Literal search or ordinary repository inspection -> exec; prefer direct rg argv, then focused read. For broad/noisy matches, prefer rg -l before reading selected files. Use fd for simple filename lookup, find for complex filesystem predicates, and jq for JSON.
  • Known or guessable symbol definition -> Dev exec with rg, then focused read.
  • Repository exploration -> Dev exec with rg and focused read; use the configured Codebase Memory logical server when indexed relationships are needed.
  • Repository knowledge-graph, architecture, dependency/boundary, multi-hop relationship, trace-path, or graph-oriented impact questions -> Local server="codebase-memory-mcp". Use list_projects/index_status when readiness is unknown. If the active repository is absent or stale enough that graph retrieval can miss current code, run index_repository; use fast when structural graph/search is sufficient, and moderate or full when similarity/semantic edges materially help the question. Re-running index_repository to refresh/rebuild derived graph state is normal retrieval setup. Then select focused graph tools such as search_graph, query_graph, trace_path, get_architecture, search_code, or get_code_snippet as the question requires.
  • Codebase Memory exists to improve search recall and reduce code the model can miss. Creating, syncing, refreshing, or rebuilding its index for the active repository is therefore allowed when it materially improves repository intelligence, including for convenience. Do not refuse indexing merely because it mutates derived analysis state. Still verify consequential edit locations and current file contents with Dev before mutation. Do not clear/delete an index, delete a CBM project, create/update ADRs, ingest traces, or perform unrelated persistent graph mutations unless the active task specifically requires those destructive or product-state changes.
  • Private logical MCP capability -> Local. One ordinary known downstream call -> tool_call(server=..., tool=..., arguments=...). Several independent calls to the same public {server, tool} -> always use tool_batch with structured per-call arguments. Do not recreate same-tool batching with bash, CLI loops, background jobs, jq, temporary files, or repeated tool_call invocations when tool_batch can express the work. If downstream tools differ or calls depend on earlier results, use separate tool_call invocations instead of tool_batch. If the exact tool schema is not already known, load tool_schema once; if the action itself is unknown, use selective tool_list(server=..., query=...) first. Reuse loaded schemas. When Agent Browser applies, preserve its selected browser-fast vs browser-devtools route and browser_target; never rewrite the browser backend here.
  • Writable-operation fallback -> fallback_dispatch(server=<logical owner>, tool=<same operation>, arguments=<same arguments>) when a ChatGPT/OpenAI client or platform issue makes the normal writable MCP action unavailable, blocked, missing, or unreliable. Treat this as the WebHarness/OpenAi-preferred recovery route for the same already-authorized operation. Preserve the exact logical owner, operation, arguments, and intended authority; fallback dispatch does not create new permission, authorize a stronger action, or bypass Terminal human ownership. Personal WebHarness exposes Terminal, Host, Browser, and owner-added MCPs as ordinary Local servers and mirrors only Dev behind the hidden fallback route. For example, if an ordinary writable/destructive tool_call to server="browser-devtools" is blocked or unreliable, retry only through fallback_dispatch(server="browser-devtools", tool=<same operation>, arguments=<same arguments>); Browser DevTools needs no hidden mirror because it already lives inside Local. If the outer Dev catalog/schema path is also unavailable, use read-only tool_list(server="dev") and tool_schema(server="dev", tool=<same operation>) to inspect that recovery route before dispatch; Dev must still remain rejected by ordinary tool_call/tool_batch. The fallback's readOnlyHint is transport metadata, not a claim that the selected downstream operation is side-effect free.
  • Short-RPC execution only -> direct Dev exec with literal argv and no shell quoting; use Dev bash only when shell syntax such as pipes, redirects, substitutions, variables, loops, or compound commands is actually required. Route a direct call only when completion is expected comfortably inside the model-facing connector window; use 45 seconds as the routing target, not as a protocol guarantee. A larger provider timeout_seconds does not extend connector lifetime.
  • Long noninteractive command (install, build, test suite) -> Dev exec with detach:true, then Dev wait with {kind:"file_exists", path:<exit_path>}, then read log_path. Jobs do not survive a WebHarness service restart.
  • Mandatory long-command path -> when a long command needs a PTY or human visibility, may prompt for input, or must survive MCP/provider restart, use Local server="terminal" with terminal_open. Observe it with Dev wait using terminal_exit, terminal_output, or another readiness condition across short RPCs, then use terminal_read for incremental/final output. Do not first start the same command through direct exec/bash and then duplicate it in Terminal after a transport timeout.
  • Human visibility or input in a durable PTY, including sudo/password/MFA or manual TUI interaction -> Local server="terminal" collaborative presentation/handoff. If the human should watch from the start, call terminal_open with present:true. When human input is needed later, call terminal_yield: it reuses an attached designated frontend or launches the configured personal frontend on the exact tmux PTY, then gives the human control. If frontend launch fails with no attachment attempt still settling, give the installed wsl-term attach <session> fallback; never ask the user to send a secret through chat.
  • Readiness, output, process exit, file/HTTP/systemd condition, or elapsed/absolute timer condition -> wait; use its native timer condition for time-based conditions and do not implement polling/sleep loops with exec or bash.
  • Explicitly confirmed Windows-host sleep, optionally with a timezone-qualified scheduled wake -> Local tool_call(server="host", tool="pc_sleep", arguments=...); use it only after a direct user request and do not substitute Dev exec, bash, or ad hoc PowerShell.

Authority and observability

  • For connected-WSL repository, Git, process, timestamp, or filesystem facts, wsl-web-harness is authoritative. ChatGPT container/Python, Files, and public web are different environments and are not diagnostic substitutes for the WSL machine.
  • Diagnose with an explicit four-layer model: presentation layer -> MCP proxy/harness transport -> WSL process/filesystem -> repository state. Evidence at one layer does not silently determine the next layer. A generic proxy/status message does not override a successful concrete harness invocation; likewise, an MCP transport response does not by itself prove the underlying shell command exited successfully.
  • Distinguish three model-visible states: observable success, observable tool/provider error, and UNOBSERVABLE presentation. A hidden, redacted, skipped, or otherwise opaque UI result is not evidence that the underlying command succeeded and is not evidence that it failed.
  • When WSL observability becomes uncertain, perform at most one bounded exec health probe against the intended repository when a direct argv command can establish it; use bash only if the compact probe genuinely needs shell composition. Prefer a small observable repository summary rather than a broad diagnostic dump. If a normal writable MCP call itself is the failed boundary, use fallback_dispatch for the same authorized operation after establishing that failure instead of silently changing the operation. Do not invent image/file/base64/HTTP/alternate-filesystem visibility probes.
  • Discover/load concrete downstream MCP schemas through Local once per session/profile and reuse them. Use logical server names only; never search for _1mcp_ qualified names, generated inner-config paths, or internal MCP function names on the public web.
  • Do not claim verified, green, committed, or equivalent repository state from inferred or hidden output. Obtain a small observable WSL result first.

Terminal observation discipline

  • Use terminal_list when session identity/ownership is initially unknown, at an explicit ownership handoff, or after an unexpected lifecycle event. Do not repeatedly relist stable sessions before every interaction.
  • Normal terminal_read(name) omits cursor and consumes only unread transcript output from the broker-owned model cursor.
  • terminal_read(name, snapshot:true) inspects the current tmux screen/TUI without advancing transcript state.
  • An explicit Terminal cursor is a recovery/replay/resynchronization control only; do not use explicit cursors for ordinary progress checks.

Durable wait and RPC boundary

  • wait is a durable named condition/timer wait, not cron. It never initiates a new ChatGPT/model turn: a pending result preserves local wait state only, and an active current or successor model turn must explicitly resume the same wait by name. Arm it with name + condition; later resume the same wait with name only. Use cancel=true only for explicit cancellation.
  • Use {kind:"timer", after_seconds:N} for relative timer conditions or {kind:"timer", at:"<timezone-qualified instant>"} for absolute timer conditions. Do not fake elapsed time with an impossible file/process condition. Keep timeout_seconds strictly later than the timer target because the durable safety deadline wins ties.
  • The durable deadline is independent of any one MCP/RPC call: timeout_seconds defaults to 300 seconds and supports 1..86400 seconds. Resuming the same name preserves the original absolute deadline and source baseline; it does not restart the timer.
  • hold_seconds bounds only one wait invocation. The current Pi Dev policy is default 10 seconds, maximum 45 seconds. A pending return leaves the named wait durable; other reasoning/tool work can happen before resuming it. Hold expiry is not cancellation and does not change the durable deadline.
  • The 45-second hold cap matches the direct exec/bash routing target so one wait hold stays comfortably inside the connector/RPC window; this is operational guidance, not a protocol guarantee.
  • For any command whose runtime is uncertain or may approach that boundary, Terminal + wait is mandatory: terminal_open once, observe with durable wait across short calls, then terminal_read. Never use a larger direct Dev timeout as a substitute, and never auto-replay a command in Terminal after an ambiguous direct-call timeout. For long-lived missions that must survive repeated waits and user steering, use the persistent-agent-loop Skill when installed; keep this router focused on choosing primitives.

Preserve the boundaries

  • File count alone never changes existing-text mutation away from edit; use write only for creation and file_ops only for regular-file move/delete.
  • Do not manufacture a patch artifact from routine model-authored edits just to use Git's patch engine.
  • After a mutation, use read/exec for immediate verification. After the final related file mutation, use review_changes once when an aggregate working-tree status/line-count/patch review is useful; narrow with paths when unrelated dirty work exists. Keep exact Git history/ref/index questions on direct exec Git commands instead of treating review_changes as a general Git replacement.
  • Never use exec/bash/raw tmux/wsl-term to bypass Terminal human ownership.
  • Keep background-only Terminal work headless. Use terminal_open(..., present:true) only when the human should watch the exact PTY from the start; do not launch a GUI merely because a durable session exists.
  • Reuse an already attached designated human frontend instead of opening duplicates. terminal_yield is the normal model-to-human handoff: reuse the designated frontend when present, otherwise launch the configured personal frontend on the exact tmux PTY before yielding.
  • Prefer bounded evidence over dumping large search or process output into model context.
  • A hard stop requires authoritative evidence such as a concrete MCP/provider failure that remains after one bounded recovery attempt, required WSL permission/access failure, human ownership blocking a required mutation, unrecoverable repository state, or a protected decision that needs the user. Awkward or opaque presentation alone is recoverable tooling uncertainty, not a hard stop.
  • If a preferred primitive is not exposed in the active profile, choose among the tools that actually exist; never invent a missing tool.

04 同仓库更多 Skills

ham-zax
ham-zax/webharness

x-content

Create, rewrite, critique, select formats for, discover opportunities for, and learn from X/Twitter content and X Articles for a technical AI-native developer/builder account. Use when turning ideas, source posts, releases, benchmarks, results, conversations, authenticated For You or creator-watch opportunities, or project evidence into an Original, Quote, Thread, Reply, or Article; reviewing article titles/outlines/visual briefs/launch hooks; improving drafts; choosing additive contributions from live X context; or learning from own-account outcomes. Own content intelligence only; compose with agent-browser for live X state and Growth OS for discovery provenance, approvals, measurement, and publication.

★ 0
ham-zax
ham-zax/webharness

writing-plans

Create detailed implementation plans for multi-step software work before editing code. Use when requirements or a specification must become concrete file-level tasks, interfaces, acceptance criteria, risks, rollout, or explicitly required validation. Default to no test creation, test modification, test execution, TDD, regression-test, or coverage work unless the user, authoritative specification, or mandatory repository policy explicitly requires testing.

★ 0
ham-zax
ham-zax/webharness

systematic-debugging

Root-cause debugging for concrete technical failures including bugs, failing builds or tests, integration issues, performance regressions, and unexpected behavior. Use before proposing or implementing a repair when diagnosis is required. Reproduce the symptom, trace the responsible owner, maintain one leading causal hypothesis, and falsify it with the smallest direct evidence. Compose with Causal Coding for source mutation; testing is opt-in and requires independent authorization.

★ 0
ham-zax
ham-zax/webharness

skill-creator

Guide for creating and updating high-quality skills by translating workflows, conventions, and reusable processes into well-structured skills. Includes context, use case examples and spec for skills. Use this skill whenever a user asks to create, update, edit, improve, package, or troubleshoot a skill, and also for conversational questions about skills in ChatGPT (e.g., "What are skills?", "What can I use skills for?", "What are the best skill use cases for me?", "Where can I find my skills?").

★ 0
ham-zax
ham-zax/webharness

reflexion

Self-refinement, multi-perspective critique, verification, and durable lesson curation adapted from NeoLabHQ Reflexion. Use when the user asks to reflect, self-review, critique, double-check, verify and improve prior work, run a rigorous review, memorize lessons, or says "then reflect" after a coding, analysis, or writing task. Supports repository-aware evidence gathering and works without subagents or Claude hooks.

★ 0
ham-zax
ham-zax/webharness

ponytail

Enforce Ponytail's lazy-senior-developer approach for coding, fixing, refactoring, design, dependency choices, and explicit Ponytail modes such as review, audit, debt, gain, and help. Prefer YAGNI, existing code, standard library, native platform features, existing dependencies, low reader load, and the smallest correct diff. For source mutation, keep Causal Coding authoritative for scope, testing authorization, verification cadence, and stopping. On connected WSL/Linux targets, compose with MCP Harness Router and use `wsl-web-harness` for authoritative repository work.

★ 0