portpilot-assistant
PortPilot Assistant
Translate natural language into portpilot commands with safe defaults.
Workflow
- Classify intent into one of:
scan,who,pick,doctor,free,init,config. - Resolve target port/range/path from user text; if absent, apply defaults.
- For the first
portpilotcall in a new session, run one permission bootstrap to avoid repeated prompts (details below). - Execute read actions directly (
scan,who,pick,doctor). - For write actions (
free,init --force,config migrate), require explicit confirmation and show details. - Return concise conclusion first, then command output details.
Intent mapping
- 帮我选个端口 / pick a port:
portpilot pick --range 3000-3999 --count 1 --lease-ms 20000 --json
- 扫描当前端口 / scan current used ports:
portpilot scan --protocol both --json
- 查看 3000 端口 / check port 3000:
portpilot who 3000 --json
- 释放 3000 端口 / free port 3000:
- First
portpilot who 3000 --json, then confirm, thenportpilot free 3000 --yes --json
- First
- 扫描冲突 / run doctor:
portpilot doctor --json
- 初始化配置 / init port config:
portpilot init --dry-run --json(default preview)
Safety policy
- Read actions run automatically.
- Write actions require confirmation.
- Confirmation payload must include:
port,pid,command,cwd,startTime,action. - If dependency failure occurs, run
portpilot doctor --preflight --jsonand return install/fix commands.
Permission bootstrap (one-time)
- On the first
portpilotaction in a new session, proactively run one lightweight bootstrap command (portpilot doctor --json) with escalation. - Resolve bundled CLI absolute path first (path-independent):
- Preferred:
$CODEX_HOME/skills/portpilot-assistant/assets/portpilot/bin/portpilot.js - Fallback for repo-local usage:
<repo>/.claude/skills/portpilot-assistant/assets/portpilot/bin/portpilot.js
- Preferred:
- In that one-time escalation request, set:
sandbox_permissions: require_escalatedprefix_rule: ["node", "<resolved-portpilot-cli-absolute-path>"]
- Explain that this is a one-time approval to avoid repeated prompts for future
portpilotcommands. - After approval, run requested commands normally without escalation.
- If bootstrap was not done (or approval was denied), and a read action fails with permission errors (
Operation not permitted/ netlink denied /lsofdenied), rerun once with escalation. - Write actions still require explicit user confirmation before execution.
Execution notes
- Run bundled CLI from this skill first:
assets/portpilot/bin/portpilot.js. - Fallback to npx only if bundled CLI is missing:
npx -y portpilot-cli@1 .... - Always pass
--jsonfor machine-readable parsing in skill scripts.
More from lingengyuan/my-skills
wechat-archiver
Archives WeChat Official Account articles to knowledge base with auto-generated structured notes. Use when users provide WeChat article URLs (mp.weixin.qq.com) or mention archiving/saving WeChat articles. Combines wechat2md scraper and note-creator for complete workflow.
21md2wechat
Converts Markdown to WeChat Official Account HTML using AI-themed layouts and optionally one-click publishes to the draft box. Use when formatting Markdown for WeChat or uploading drafts with WECHAT_APPID/WECHAT_SECRET set in an env file.
9note-creator
Orchestrates creation of structured Obsidian notes with markdown, canvas diagrams, and table bases. Use when users ask to create notes, save knowledge, or document concepts in their Obsidian vault. Delegates to specialized format skills.
9sync_to_github
Automate git commit and push. Use when user says "sync to github", "commit and push", "push my changes", "save to git", "submit my work", or invokes /sync_to_github. Stages all changes, generates a commit message, commits, and pushes to remote.
7obsidian-markdown
Create and edit Obsidian Flavored Markdown with wikilinks, embeds, callouts, properties, and other Obsidian-specific syntax. Use when working with .md files in Obsidian, or when the user mentions wikilinks, callouts, frontmatter, tags, embeds, or Obsidian notes.
7json-canvas
Create and edit JSON Canvas files (.canvas) with nodes, edges, groups, and connections. Use when working with .canvas files, creating visual canvases, mind maps, flowcharts, or when the user mentions Canvas files in Obsidian.
6