Catalogue / deploy-server
deploy-server
MITSignedUse when a user wants to deploy a locally developed app, website, API, or service to a server or VPS they administer, including first-time deployment, SSH access setup for deployment, and updating an existing deployment. Matches requests such as 把本地项目部署到服务器、上线、更新服务器上的服务.--- name: deploy-server description: >- Use when a user wants to deploy a locally developed app, website, API, or service to a server or VPS they administer, including first-time deployment, SSH access setup for deployment, and updating an existing deployment. Matches requests such as 把本地项目部署到服务器、上线、更新服务器上的服务. ---
Deploy to a Server
Take the project from the local workspace to a verified running service on the user's authorized server. Use the user's language, explain the next action in plain words, and do the work directly where access and scope permit.
Work at the user's level
- Default to guided execution. If the user says they're new, only knows their server IP or password, or just asks to get an app online, say what you will do and what they need to do now. Explain unfamiliar terms when they affect that action (e.g. “SSH is how I connect to your server”). Don't ask them to choose Docker, a web server, or a Linux distribution when the project or server can answer that for you.
- Use a concise technical track when the user supplies a target alias, Compose file, release procedure, or other concrete deployment constraints. Follow those instructions, skip definitions, and report the exact target, result, and relevant evidence. Expand only where the user asks or a decision is needed. A user may be technical about their app but new to servers; adapt per step without asking them to pick a skill level.
- Ask at the point of need. Reuse answers and inspect the workspace before asking. For a blocked step, say what happened, give one immediate action (one ready-to-copy command if necessary), say what success looks like, and tell them what to report back. Prefer doing authorized work over handing them a checklist. For decisions only the user can make, translate the tradeoff into an outcome: “Should anyone with the link be able to open it, or only people on your private network?” Skip that question when the desired audience is already clear.
1. Find the deployment target
- Inspect the project's README, deployment configuration and build/start commands. Identify the intended release, existing deployment method, environment variable names, persistent data, and how to check that the app works. Do not print secret values.
- Reuse the target from the request or project. Prefer its existing SSH alias and OpenSSH settings (user, port, identity, agent, jump host); don't override them with defaults. If there is no clear target, ask for just the SSH alias, server IP, or hostname. Ask for a port only if it is nonstandard or needed to resolve a connection problem.
- If a beginner doesn't know where to find the address, direct them to their hosting dashboard's server details and ask for the public IP shown there (or the private address/SSH alias for a private target). Do not assume that the first host in local SSH configuration is the intended server.
- Probe the selected target with a harmless noninteractive command, for example
ssh -o BatchMode=yes -o ConnectTimeout=10 prod-web true. Run it with a bounded deadline and without an interactive terminal. For a bare IP or hostname, honor an explicit or configured login; if neither exists, userootas the stated default instead of implicitly trying the local username. Keep normal host-key verification enabled. A successful probe means no password or onboarding questions are needed.
2. First connection: handle the actual SSH error
| Observation | Next action | | --- | --- | | Existing access works | Continue to deployment; detect the server OS after login. | | Unknown host key | Explain that SSH is asking whether this is the right server. Show the offered SHA256 fingerprint and have the user compare it with a trusted provider console or administrator before accepting it interactively. If a previously known fingerprint changed, resolve that mismatch before proceeding. | | Timeout, connection refused, DNS failure, or unreachable jump host | Say that login has not started. Check the endpoint, port, and route first; ask only for a missing detail such as the provider's SSH port if needed. Don't ask for a password. | | Permission denied or an existing key cannot be used | Check the intended account, configured identity and agent access. If existing access still fails and the server offers password authentication, actively ask the user for that account's SSH password as described below. |
Once a first login reaches authentication, ask only for missing details needed to continue. Use root if no account was specified or configured, but if the provider shows a login name, use that instead. Treat Linux as the default and detect the actual OS after login rather than asking the user to identify it unless it blocks the next step. If password authentication is available, actively ask for the password in the same turn using the appropriate input method below. Don't ask the user to repeat known details or configure a key before the first login.
> 服务器没有接受已有的免密登录。接下来需要输入 <登录名>@<服务器地址> 的服务器密码。请只在我打开的安全输入窗口或终端的密码提示里输入,别发到聊天里。
- If the user already logs in interactively with a key, help them make that key available through their SSH agent and repeat the probe. If the host does not accept password login for the chosen account, use the provider's documented login or console to get the correct account or register a public key; don't enable password or root login to get past the error.
- If the runtime has a dedicated secret-input mechanism that passes the password directly to SSH without exposing it to the conversation or logs, open that prompt for one login attempt. Otherwise use the terminal handoff below. Never request a private key or put a password in chat, command arguments, environment variables, files, or logs. If login rejects the password, report the failure and ask the user to check the account or retry with the correct password; don't guess or retry automatically.
- Continue in the authenticated session if the agent can use it. If the user and agent share a machine and local account, create a private temporary directory and run
ssh -M -S <socket> -fN <target>with the resolved connection options in a dedicated user-visible terminal when supported. Verify that the password prompt appeared before telling the user where to type. Otherwise give one ready-to-copy command with the actual socket and destination filled in. Tell beginners that typing shows no characters, to press Enter, and to tell you when the command returns without an error. Confirm the handoff withssh -S <socket> -O check <target>. Keep the session available for key setup and as a fallback until finished; close it withssh -S <socket> -O exit <target>and remove the private directory when done. While remote access is unavailable, continue useful local preparation.
3. Set up key-based login after the first password login
- Choose the key. Prefer the public key for the identity already configured for this target. Ensure the corresponding private key can be used locally (e.g. unlocked in the SSH agent). If no suitable key exists, offer to generate a new one at an unused path and configure the matching local identity for this target without overriding existing keys or unrelated SSH settings. Keep the private key local.
- Authorize the change. After successful password login, proactively ask for permission to install the selected public key. Show the exact SSH account and host, the key fingerprint, and explain that the change lets this local key log in without the server password next time. If the user declines, continue the deployment using the authenticated session and report that key-based login was not configured.
- Example for a beginner: “要不要帮你设置下次不用再输服务器密码?我只会把这台电脑的一把公钥添加到
<登录名>@<服务器地址>,不替换现有的登录方式。公钥指纹是<指纹>。不同意也可以继续这次部署。”
- Install the public key. Use the authenticated session to register only that public key, or guide the user through
ssh-copy-id -i <public-key> <target>with the resolved connection options if they authenticated in a terminal the agent cannot share. Use the target's existing key management method; on standard Linux OpenSSH, add the key once to that account'sauthorized_keys, preserving all existing entries, ownership, and restrictive permissions. Do not changesshdsettings, disable password login, or remove existing keys. - Prove a fresh login. Run
ssh -T -o BatchMode=yes -o ControlPath=none -o PreferredAuthentications=publickey -o ConnectTimeout=10 <target> trueusing the intended identity and the usual target settings.ControlPath=noneprevents the password-authenticated session from making this check pass. If it succeeds, use the verified key-based login for deployment and tell the user what to reuse next time. If it fails, diagnose within the authorized scope; keep the password session available and report separately whether deployment succeeded and whether key-based login was verified.
4. Deploy and verify
- Preflight. Read the actual OS and architecture, available disk space, relevant runtimes, ports, and current app state before writing. Linux is an onboarding default, not a reason to assume
apt, systemd, or Docker. Reuse the project's deployment and the server's service conventions. If none exists, choose the simplest compatible option: existing Compose setup for a containerized app; existing web server for static output; a supported service manager for a long-running process. - Stage and release. Summarize the target, selected release, and any downtime or database changes before applying them. Build with project-defined commands and transfer only needed files, excluding credentials, development-only files, and local data. Keep server-side configuration and persistent data intact. For updates, identify a recoverable prior version before switching; follow the project's backup and migration procedure. Keep app privileges minimal even if the SSH login is
root. Configure public access only to the extent requested; don't expose a database or internal port just to get a successful check. - Set up the public entry point. For a web app or HTTP API the user wants online for public access, follow the procedure below. Skip this step for internal-only deployments, non-HTTP services, or a deployment with no requested public exposure.
- Verify the requested access. Check service state, recent logs, and an application-level smoke test. Then request the exact user-facing URL from outside the server for public access, or from an intended internal client for internal-only access. Verify the response belongs to the deployed app (a known page or endpoint, not just HTTP 200 from a default site), and check redirects for the actual browser URL. For internal-only, check that port bindings and ingress do not expose the app publicly. If you lack the required vantage point, report local health and reachability separately. If verification fails, diagnose and fix within scope, or restore the last known working release when safe; don't blindly reverse database migrations.
- Hand over. Put the exact verified, clickable URL first (including the scheme and any path), and tell the user they can open it in their browser. For an API, link a usable endpoint or docs if available and label it as an API. If public access is blocked, say the app is running but not publicly reachable, name the failing layer and give one concrete next action. For technical users, include the release, checks and relevant log/update/rollback commands. Include the key-login result when configured.
Configure a public web address
Preview shortened. The full SKILL.md is in the pack.
| File | Size | SHA-256 |
|---|---|---|
| SKILL.md | 15.4 kB | 1b9b1fd85a88 |
| SKILVAULT_SOURCE.json | 1.1 kB | d3c9bbda193e |
| THIRD_PARTY_NOTICES.md | 1.1 kB | ea88a7f66849 |
Published verbatim from the pinned commit. Nothing is rewritten.
| Version | Pinned commit | Signed | |
|---|---|---|---|
| 0.1.0 Current | 2ad3ec7fc4b3 | 28 Nov 2026 |
Locking a skill to one version needs Pro.