Selection bridge
Resolve references such as "this", "this selection", "the selected code", "what I highlighted", or "the current VS Code selection" when Codex is running in a terminal beside a local or remote VS Code workspace. Use this skill before interpreting deictic references to editor selections; it reads the file/range pointer that the co-located Selection Bridge VS Code extension publishes to a registry file, then reads the referenced saved file content from disk if needed.From its SKILL.md
npx -y skills add aqzi/SelectionBridge --skill selection-bridgeAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
3 things to look at
- 26 days oldThe repository was created 26 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.6 KB, 624 tokens by cl100k_base, as published. Nobody here has run it
Selection Bridge
Overview
Use this skill to resolve editor-relative language from a terminal session. The paired VS Code extension publishes a pointer to the selected location only: file URI/path, workspace folder, line/character ranges, selection direction, dirty state, and timestamps. It never publishes selected text. The pointer lives in a registry file under the user's home directory; the resolver only reads files and never opens a network connection. For a remote workspace, run the agent and install this skill in the same remote execution environment and user account as the workspace extension. A terminal opened from that remote VS Code window is the reliable default.
Workflow
-
Run the resolver before interpreting "this". Do this silently; do not mention that this skill or the resolver is being used unless resolution fails.
node skills/selection-bridge/scripts/resolve-selection-bridge.js --jsonIf this skill has been installed outside the project repo, run the
scripts/resolve-selection-bridge.jsbundled with this skill. -
If running the resolver is blocked because the execution tool lacks permission to run it or to read the registry directory in the user's home, do not show that first failure to the user. Request permission through the tool's permission mechanism, then rerun the exact same resolver command. If the retry succeeds, continue silently. If the user denies permission, say only that permission is required to run Selection Bridge.
-
For any other
ok: falseresult, reporterror.messagefollowed byerror.recoveryexactly when recovery is present. Do not add a generic troubleshooting checklist or invent alternative recovery steps. -
If
pointer.kindisselection, readpointer.document.pathfrom disk and use the returned zero-based ranges to extract the selected code locally. Respect multiple selections in order. Answer the user's question directly from the selected content; do not preface the answer with file paths, line numbers, or a statement that a selection was resolved unless those details are directly relevant to the answer. -
If
pointer.kindiscursor, use the cursor location only when the user's request can reasonably refer to the nearby symbol or block. Otherwise ask the user to select text. -
Treat pointer and file validation failures as resolver failures; the resolver provides the exact recovery instruction.
Rules
- Do not ask VS Code for selected text content.
- Do not announce skill usage or pointer resolution during normal successful operation.
- Do not say where the selected text came from unless the user asks or location is necessary for the answer.
- Treat all line and character coordinates as zero-based.
- Prefer the resolver's cwd-based match. Honor
SELECTION_BRIDGE_INSTANCEwhen it is set. - Do not guess across multiple matching VS Code windows.
- Treat
pointer.document.pathand workspace folder paths as paths in the extension host's execution environment. A remote agent in the same environment can read them directly. - Use normal file-reading tools after resolving the pointer; the extension is only the locator.
What ships with it: 2 files
19.8 KB alongside SKILL.md, 1 of them executable
agents/
- openai.yaml212 B
scripts/
- resolve-selection-bridge.jsruns19.6 KB