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
- 最近更新
- 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
- 参考文档agents/openai.yaml313 B
- 资产文件assets/icon.svg1.7 KB
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. IfoldTextis not yet known, inspect withread,rg, or ast-grep and widen the anchor until it remains unique under the tolerant matcher. - Syntax-shaped discovery or codemod -> ast-grep through
execwhen it is a direct argv invocation. Inspect bounded matches and normally perform the final mutation through guardededit; usebashonly 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_filewhen 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/.diffartifact ->bashwithgit apply --check -- "$patch" && git apply -- "$patch". Use--3wayonly when the user explicitly requests merge-style recovery; never add fuzzy/custom patch recovery automatically. - Literal search or ordinary repository inspection ->
exec; prefer directrgargv, then focusedread. For broad/noisy matches, preferrg -lbefore reading selected files. Usefdfor simple filename lookup,findfor complex filesystem predicates, andjqfor JSON. - Known or guessable symbol definition -> Dev
execwithrg, then focusedread. - Repository exploration -> Dev
execwithrgand focusedread; 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". Uselist_projects/index_statuswhen readiness is unknown. If the active repository is absent or stale enough that graph retrieval can miss current code, runindex_repository; usefastwhen structural graph/search is sufficient, andmoderateorfullwhen similarity/semantic edges materially help the question. Re-runningindex_repositoryto refresh/rebuild derived graph state is normal retrieval setup. Then select focused graph tools such assearch_graph,query_graph,trace_path,get_architecture,search_code, orget_code_snippetas 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 usetool_batchwith structured per-call arguments. Do not recreate same-tool batching withbash, CLI loops, background jobs,jq, temporary files, or repeatedtool_callinvocations whentool_batchcan express the work. If downstream tools differ or calls depend on earlier results, use separatetool_callinvocations instead oftool_batch. If the exact tool schema is not already known, loadtool_schemaonce; if the action itself is unknown, use selectivetool_list(server=..., query=...)first. Reuse loaded schemas. When Agent Browser applies, preserve its selectedbrowser-fastvsbrowser-devtoolsroute andbrowser_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/destructivetool_calltoserver="browser-devtools"is blocked or unreliable, retry only throughfallback_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-onlytool_list(server="dev")andtool_schema(server="dev", tool=<same operation>)to inspect that recovery route before dispatch; Dev must still remain rejected by ordinarytool_call/tool_batch. The fallback'sreadOnlyHintis transport metadata, not a claim that the selected downstream operation is side-effect free. - Short-RPC execution only -> direct Dev
execwith literal argv and no shell quoting; use Devbashonly 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 providertimeout_secondsdoes not extend connector lifetime. - Long noninteractive command (install, build, test suite) -> Dev
execwithdetach:true, then Devwaitwith{kind:"file_exists", path:<exit_path>}, then readlog_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"withterminal_open. Observe it with Devwaitusingterminal_exit,terminal_output, or another readiness condition across short RPCs, then useterminal_readfor incremental/final output. Do not first start the same command through directexec/bashand 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, callterminal_openwithpresent:true. When human input is needed later, callterminal_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 installedwsl-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 nativetimercondition for time-based conditions and do not implement polling/sleep loops withexecorbash. - 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 Devexec,bash, or ad hoc PowerShell.
Authority and observability
- For connected-WSL repository, Git, process, timestamp, or filesystem facts,
wsl-web-harnessis 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
exechealth probe against the intended repository when a direct argv command can establish it; usebashonly 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, usefallback_dispatchfor 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_listwhen 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)omitscursorand 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
cursoris a recovery/replay/resynchronization control only; do not use explicit cursors for ordinary progress checks.
Durable wait and RPC boundary
waitis a durable named condition/timer wait, not cron. It never initiates a new ChatGPT/model turn: apendingresult preserves local wait state only, and an active current or successor model turn must explicitly resume the same wait by name. Arm it withname + condition; later resume the same wait withnameonly. Usecancel=trueonly 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. Keeptimeout_secondsstrictly later than the timer target because the durable safety deadline wins ties. - The durable deadline is independent of any one MCP/RPC call:
timeout_secondsdefaults 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_secondsbounds only onewaitinvocation. The current Pi Dev policy is default 10 seconds, maximum 45 seconds. Apendingreturn 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/bashrouting 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 +
waitis mandatory:terminal_openonce, observe with durablewaitacross short calls, thenterminal_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 thepersistent-agent-loopSkill when installed; keep this router focused on choosing primitives.
Preserve the boundaries
- File count alone never changes existing-text mutation away from
edit; usewriteonly for creation andfile_opsonly 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/execfor immediate verification. After the final related file mutation, usereview_changesonce when an aggregate working-tree status/line-count/patch review is useful; narrow withpathswhen unrelated dirty work exists. Keep exact Git history/ref/index questions on directexecGit commands instead of treatingreview_changesas a general Git replacement. - Never use
exec/bash/raw tmux/wsl-termto 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_yieldis 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
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.
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.
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.
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?").
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.
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.