canary-lab-portify
Use when making a Canary Lab feature concurrency-ready — "portify <feature>", "make the ports injectable", "why can't these run concurrently", "undo the portification" — through the portify MCP tools (start/submit_external_portify, get_portify, save_portify, cancel_portify, remove_portification, list_portify_status).
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 4
- Forks
- 0
01 前言 Front Matter
- name
- canary-lab-portify
- type
- skill
- description
- Use when making a Canary Lab feature concurrency-ready — "portify <feature>", "make the ports injectable", "why can't these run concurrently", "undo the portification" — through the portify MCP tools (start/submit_external_portify, get_portify, save_portify, cancel_portify, remove_portification, list_portify_status).
03 SKILL.md 正文
Canary Lab — Portify (Concurrency-Readiness)
User input through MCP 2.0
Use the native Canary connector in the requesting chat so SDK 2.0 elicitation
(input_required) reaches the human there. Do not substitute a shell MCP client,
answer a form yourself, or recreate the question in chat. Existing explicit
instructions and autopilot choices still apply without another ask.
Form decisions have one shared record. The native form links to the same approval
in Canary Notifications, also surfaced above the Flight page. On needs-input
with approvalId and reviewUrl, show that link and call wait_for_approval with
the ID; repeat on still_waiting. The human answers once in either surface.
A browser answer resolves the server decision; some clients keep their native
form visible until the human dismisses it. Dismissal then returns the stored
result. Client decline/cancel alone does not represent a human decision.
Without an approvalId, leave needs-input pending after decline/cancel, stale
input, or an unfinished UI action; do not automatically retry or repeat the
question. Setup/reconnection can use chat while MCP is unavailable. Never collect
passwords, API keys, or access tokens in chat or form elicitation; use the returned
Canary UI URL for secret entry.
MCP Invocation
Setup and the plugin expose one public Canary Lab MCP tool: exec (usually
rendered as mcp__Canary_Lab__exec). Every
Canary Lab tool name below is the exact command value, not a separate public
tool. For a feature-scoped command, replace both placeholders in this shape:
{"command":"<exact_tool_name>","arguments":{"feature":"<feature_name>"}}
This is the envelope shape, not every command's complete schema. Add the
fields that command declares inside arguments; call describe_tool when a
field is uncertain.
Never invent a wrapper verb such as learn or call, embed JSON in a command
string, or turn arguments into flags. Keep fields such as confirm: true inside
arguments. Use list_tools, search_tools, or describe_tool as the
command when discovery is needed. A deliberately selected focused or full
profile still exposes atomic tools for debugging; the setup-installed path is
compact + exec.
This client edits the listeners in a scratch worktree; Canary Lab verifies
with a concurrent double-boot and owns the verdict. These tools arrive via
the Canary Lab MCP server. If this client is already connected (the plugin
connects with compact), skip this step. To configure the same connection
manually: npx canary-lab mcp --profile compact. Portify makes a feature's ports injectable so it can boot
concurrently (benchmark arms / parallel runs). The
double-boot verify is the success predicate — Canary Lab owns the verdict.
Arguments
An invocation argument (/canary-lab-portify <suite> — the Getting Started
guide's "Enable Parallel Runs" card emits exactly this shape) is a suite
(feature) name in the connected workspace — start the loop on it directly.
The demo's "start two copies / confirm both work" step IS the double-boot
Canary runs automatically for declared injection, or on submit after edits — do not try to boot two copies yourself (those tools
are not in this profile); your job is the edits, then relaying the proof.
Workspace Bootstrap
- Find the LIVE server first: read
~/.canary-lab/active-servers.json, which recordsprojectRoot,portandpidfor every UI that registered. A stopped server's entry LINGERS — the file is only rewritten when the next server registers — so an entry is a candidate, not proof: the health check below is what confirms it. One entry → that is your server and itsport. Several → take the one whoseprojectRootis the workspace the user means. None → fall back to~/.canary-lab/workspaces.json(Windows:%USERPROFILE%\.canary-lab\workspaces.json): one workspace → use it, several → ask which, none → ask the user to runnpx canary-lab setup. Do NOT start from a guessed port. - Then CONFIRM it is the right server:
curl -s http://127.0.0.1:<port>/mcp/healthand check thatprojectRootis the workspace you intended. A healthy response does not settle the question on its own — a stale UI left behind by a demo or a tarball smoke test answers a port just as convincingly as the right one, and that is how a flight ends up running in someone's throwaway workspace.projectRootmatches what you intended → continue and tell the user which workspace. It names a DIFFERENT workspace → this is the wrong server; go back to step 1 rather than adopting it. It is under a temp directory (/tmp,/private/var/folders,%TEMP%) → never auto-select it; those are throwaway demo workspaces, so use one only when the user names it explicitly. Only when no live server serves the workspace you want does one need starting. - If the health check fails, start
npx canary-lab uifrom the workspace in a visible long-running terminal; if this client cannot run long-lived commands, ask the user to runnpx canary-lab uifrom the workspace and confirm when it's up. - A healthy
/mcp/healthmeans the server is live. On the setup-installedcompactprofile, atomic names such asget_feature_coverageare deliberately absent fromtools/list; onlyexecis public. Callexecwith{"command":"list_tools","arguments":{}}before concluding the connection is missing. Only an unknown-tool error forexecmeans this session is not connected — ask the user to runnpx canary-lab setup --forceand reconnect/restart the client, then retry. Never drive/mcpwith a hand-written HTTP/JSON-RPC client (curl included; the health check above is the only direct HTTP use): a custom client bypasses client detection and reconnect handling.
Portify Loop
- Port-ify it YOURSELF (no local agent):
start_external_portify(feature)sets up scratch worktree(s) and returnstargets[](edit paths) +configPath+ instructions. If status isverifying, POLLget_portifybefore editing or submitting: Canary is checking declared injection. Otherwise edit the listeners IN PLACE to read an injected port, declare the matchingportsslots in the config, thensubmit_external_portify(workflowId)— Canary boots the stack twice concurrently to verify. After submit, pollget_portify(workflowId)every ~15s until status isready-to-saveorediting. Oneditingthe double-boot FAILED andget_portifycarries aprompt— the retry playbook — next toverification.failureDetail: follow it (abaseline-boot-failedverdict means the app's own SOLO boot is broken, so ports are NOT the blocker;concurrency-failuremeans some listener still binds a hardcoded port — very often a NON-HTTP one: gRPC, WebSocket, raw TCP, a metrics/admin port — or the two boots race on a shared build dir), fix the worktree, andsubmit_external_portifyagain; re-edit + re-submit is unbounded. Onready-to-savecallsave_portify(workflowId, confirm: true)— UNLESS the human wants a CHANGE first, in which case callrevise_external_portify(workflowId, feedback): it reopens the SAME verified worktree ateditingand returns apromptrestating the constraints, so your prior edits survive. Nevercancel_portifyto make a change — that discards verified work and you start from scratch.get_portify(workflowId)also re-reads status + the verification result on demand (diff omitted by default;includeDiff: trueinlines it).cancel_portify(workflowId, confirm: true)discards it. After saving, relay the proof: theverificationonget_portifyrecords the concurrent double-boot that passed — tell the user both copies booted concurrently (that is the "confirm both work" evidence), not just that an overlay was saved. - One workflow PER FEATURE (a second start on the same feature is a 409). A 409 saying a verified review is "parked awaiting save/cancel" means an earlier workflow (a GUI session, or one that survived a server restart) already verified this feature and is waiting for its save/cancel decision — the error names its
workflowId:get_portifyit, show the user its diff/verification, then callreview_portify(workflowId)to elicit save, revise, or discard; follow its chosen command. Only ask in chat when elicitation is unavailable; never start a second workflow around it. DIFFERENT features port-ify concurrently up to a resource cap, so to portify several features at once, if your client supports subagents, fan out a subagent per feature — otherwise portify features one at a time. At capacitystart_external_portifyreturns a 429 — pollget_portifyon an in-flight workflow (orlist_portify_status) until one saves/cancels, then retry. The GUI shows each live on the suite's Flight page (Parallel readiness stage) — that view is read-only while this client drives; the user monitors there, you act here.list_portify_statusshows which features are portified. Ifstart_external_portifyreturnstype: "getting_started_busy", a Getting Started demo already owns the workspace — follow the active target it returns; do not start another workflow. Within ONE feature that has multiple repos, FAN OUT the per-repo edits: one subagent per repo in a single parallel round (up to 5 at once), each editing only its own worktree path. Then do the SHARED files yourself, once — the feature config and the envsets are single files every repo's slots land in, so concurrent writers clobber each other — and submit once. Treat a subagent that reports nothing as unfinished, not as a repo with no listeners: the double-boot catches a missed listener only when it binds eagerly and dies loudly on the clash. - Already env-driven? If the repo ALREADY reads injected ports (e.g. it was portified for another feature, or the listeners are committed env-driven), no source edit is needed — if the matching
portsslots already declare injection, Canary starts verification immediately; POLLget_portify. Otherwise declare the slots andsubmit_external_portify. The double-boot still verifies the concurrent boot, and save records an EMPTY overlay (a no-op at run time). An empty diff is only rejected when the boot also fails (the listeners genuinely don't read the injected ports yet). - Borrowed start: if ANOTHER feature already saved an overlay for the same app, Canary pre-applies that patch into your scratch worktree at setup, and the returned
instructionslist the exactportsslots that feature declared. START from that list rather than re-deriving it from the diff — then check it against the start command(s) THIS feature boots and add a slot for any listener they expose that the list misses (a differently-booted stack can bind a port the other feature never did). If this feature ALREADY declares every listed slot there is nothing to edit at all: Canary starts the double-boot itself, the instructions say so, and you POLLget_portifyinstead of submitting (submit 409s while that boot is in flight). Otherwise review the edits, declare the slots, then submit. The borrowed lines are captured into THIS feature's own overlay, so it stays self-contained. - Saving captures the verified edits as an EPHEMERAL OVERLAY under
features/<feature>/portify/— nothing committed or merged, so the product repo stays pristine; each run applies the overlay into a fresh per-run worktree (disjoint ports) before boot and reverse-applies at teardown. If the overlay later stops applying (the repo moved under it), the run fails loudly asking you to re-portify (start_external_portify, or the GUI). - Undo it:
remove_portification(feature, confirm: true)reverts the feature config (the declaredportsslots +${port.x}health-check rewrites, restored from the snapshot saved with the overlay) and deletes the overlay, so the feature is no longer portified. Re-runstart_external_portify(or the GUI) to redo.
Guardrails
- If a full Flight starts while this standalone workflow is active, the Flight adopts this same workflow when it reaches Parallel setup; do not start a replacement.
- Keep the same
session_idfor the whole conversation. - Edit only inside the returned scratch worktree paths — never the user's checked-out product repo.
- A FLIGHT can hand you a portify workflow via an
external-workcheckpoint carrying aworkflowId: drive this same loop against it, but STOP atready-to-save, re-callget_flight, and answer withrespond_flight_checkpoint(flightId, choice: "submit")— the flight owns the save/review decision. If that re-check carriescheckpoint.data.takeoverRequestedAt, stop the workflow work and release withchoice: "run-internally"instead — do not submit. Neversave_portifyorcancel_portifya flight-owned workflow. The flight will wait on you indefinitely — a parked hand-off has no deadline — so do not end your turn with it open; after 45 minutes with noget_flightcontact the read reportshandOffIdleon it. - Use
review_portifyonly when a standalone review needs a user decision; do not ask again when the user already authorized the action. Flight-owned reviews userespond_flight_checkpointinstead. - Save/cancel/remove are confirm-gated; pass the confirmation only when the user asked for that action.
04 同仓库更多 Skills
off-by-one
暂无简介
multi-failure-cascade
暂无简介
broken-delete-contract
暂无简介
canary-lab
Use when the user wants Canary Lab to take a product repo end to end — "test this app", "onboard this repo", "run a flight", "evaluate what I just built" — through the flight pipeline (start_flight / get_flight / respond_flight_checkpoint over MCP). One conducted pipeline continues a configured suite or takes bare repo(s) to a green, covered, healed run and publishes a downloadable Report; Parallel setup continues as Canary-owned background work. Use a focused skill only when the user asks for that single capability without asking for a Flight or /canary-lab.
canary-lab-verify
Use when verifying a Canary Lab feature against a RUNNING target — a deployed environment ("verify checkout on staging", "run the saved verify config", "check the deployed app") or a locally booted app ("verify a running app") — through the verify MCP tools (list/get/create/update_verification_config, boot_services, execute_verification, get_verification_result). No heal loop. For run + heal use canary-lab-run; for end-to-end onboarding use canary-lab (flight).
canary-lab-run
Use when running or healing an EXISTING Canary Lab feature locally — "run <feature>", "fix the failing run", "rerun 7cvh", "drive the heal loop" — through the repair MCP tools (start_run, wait_for_heal_task, signal_run, get_heal_context, pause_run, cancel_heal, abort_run). Fix failing runs by editing app/service code, not tests. For end-to-end onboarding of a new repo use canary-lab (flight); for deployed-environment checks use canary-lab-verify.