portal
它能做什么
这项技能说明如何在一台保持开机的已配对电脑上继续编码会话。适合需要长时间运行或远程测试工作持续进行的开发者。
适用场景
- ✓当你合上主笔记本电脑后,工作仍必须继续运行的时候。
- ✓当你需要在另一台独立机器上进行远程测试的时候。
- ✓当定时任务应在自托管电脑上而不是你自己的电脑上运行的时候。
技能链接
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/portal/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把我当前的编码会话转移到我的常开电脑上,这样我离开时它仍能继续运行。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体将你当前代码的快照保存到一个新分支,已配对的电脑获取该精确版本并在那里继续。机密值在本地加载,绝不会在消息中发送。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Portal
Portal moves a local coding session to a paired computer while keeping the relay as the control plane and the paired computer as the execution residence. The Code Agents chat list supports moving one local chat or all eligible local and worktree chats in one handoff.
Workflow
- Select
Portalfor the coding session and keep the source folder as a Git repository with anoriginremote. - Snapshot the current working tree, including dirty tracked and untracked
code, into a unique
portal/<timestamp>-<id>branch. Do not switch, reset, stash, or overwrite the source checkout. - Queue the run for a paired active host. The run metadata must identify the
host, handoff id, branch, commit, and
envPolicy: "load-local". - On the paired host, fetch the exact commit into a detached Portal worktree under its local Agent-Native store. Preserve an existing dirty worktree and create a new one instead of overwriting it.
- Load the paired host's current local environment files immediately before starting the runner. Never put environment values, tokens, or secrets in relay metadata, prompts, transcripts, or status messages.
Existing chat transfer
Use Move to Portal for one chat or Move local chats to Portal for the bulk
handoff. The transfer stops a local runner before snapshotting, pushes the
current worktree without changing the source checkout, and imports the full
text transcript into the same run id on the paired computer. The target gets a
continuation turn rather than replaying the original prompt. Chats waiting for
local approval are skipped because approval state is computer-local and cannot
be reconstructed safely.
Binary attachment bodies are not relayed. Their names, text, and an explicit omission marker remain in the transcript context. Oversized or otherwise unsafe context fails visibly so the source chat can be retried instead of being silently truncated.
Execution residence
Treat metadata.executionResidence as authoritative for where the run is
executing. It should report kind: "portal", host id and label, handoff id,
source commit, remote workspace path once prepared, and environment file names
without values. Follow-ups and stops must target the same host and remote run.
Verification
Before saying Portal is ready, verify the relay has a paired host, the host is heartbeating, the exact handoff commit was fetched, the detached worktree is clean, and the run metadata reports the remote workspace. For an existing chat, also verify the target transcript contains the imported event count and the continuation turn. A queued command is not proof that the remote runner started; inspect the remote result or event readback.
Operator recovery
When a host is present but a handoff stalls:
- Confirm the connector's
relayUrlis the same deployment origin used for pairing. A device paired against another origin can return401with a fresh-looking token because the row is in a different database. - After repairing a pairing, restart the connector. It reads
remote-device.jsononce at startup and will not adopt a new token or relay URL in an existing process. - Confirm the host is heartbeating and connected, then retry one bounded run. Read the remote result and transcript; enqueue success alone is not proof.
- Keep tokens and environment values out of logs, prompts, metadata, and transcripts. Report source, published-runtime, and live-relay evidence separately.
Don't
- Do not copy
.envcontents or credentials to the source branch or relay. - Do not treat the primary laptop's cwd or environment as the remote cwd.
- Do not report Portal complete from a local push alone; confirm remote execution residence and runner state.
Related skills
external-agents- relay and external-agent boundaries.a2a-protocol- idempotent cross-agent task lifecycle.concurrent-agents- preserve shared checkouts and peer work.reliable-mutations- verify durable handoff state.
常见问题
转移会话会改动我原来的文件夹吗?
不会。技能说明源代码检出目录不会被切换、重置或覆盖。
我的机密值会发送到另一台电脑吗?
不会。环境值在已配对的电脑上加载,绝不会放入中继元数据或提示词中。
项目需要满足什么条件?
需要一个带有 origin 远程仓库的 Git 仓库。
详情
作者的原始描述
Continue a coding session on a paired always-on computer. Use when work must survive closing the primary laptop, needs remote computer-use testing, or should run on a scheduled/self-hosted execution host.
repo: BuilderIO/agent-native
热度
- GitHub 星标
- 7.6k
- 排名
- #13173
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …