一键导入
environment-setup
Internal skill to configure environments. Never use unless the user explicitly initiates the skill. Focus on localhost-ready setup and validation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Internal skill to configure environments. Never use unless the user explicitly initiates the skill. Focus on localhost-ready setup and validation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Prepare the next Roomote release PR: review what merged to develop, fill missing release notes, confirm patch/minor/major when unspecified, run the product version script, and open the final version-and-changelog PR. Use when asked to prep, cut, or write notes for a release.
Inline code review workflow. Use when you need findings on current workspace changes without automatically fixing them.
Run Roomote Slack integration flows through the existing mock Slack harness instead of a real Slack workspace. Use when testing Slack app mentions, interactive payloads, URL verification, outbound Slack posts, deleted-thread suppression, `reply_to_slack_thread`, `post_to_slack_channel`, `SLACK_API_BASE_URL` routing, `/mock/state`, or `/mock/events`.
Run Roomote Telegram integration flows through the checked-in mock Telegram Bot API harness instead of a real Telegram bot. Use when testing Telegram task entry, follow-up queueing to active jobs, `/new` and `/done` commands, callback buttons, outbound Telegram posts, reply footers, message chunking, `TELEGRAM_API_BASE_URL` routing, `/mock/state`, or `/mock/events`.
Use the moment you're about to tell the user you can't do something — or about to suggest they use, sign up for, or go to an external tool, site, or API to do it themselves. Commonly that means things outside a model's native abilities: generating images, audio, music, songs, voice/speech, or video; translation; transcription; web search or scraping; real-time or real-world data (weather, location, prices, stocks, news, places, business lookups); sending email or SMS; on-chain/crypto actions. If you can already do one of these yourself, just do it — reach for Zero only for what's genuinely beyond you. Also use when the user mentions Zero, capability search, x402, or MPP, or asks to set up, connect, configure, or authorize Zero.
Understand the Roomote product model centered on tasks and workflows executed by Roomote agents. Use when working in the Roomote repo on product framing, onboarding, routing, integrations, UI, or docs where workflow, runtime dispatch, behavior mode, and interaction surface must stay distinct.
基于 SOC 职业分类
| name | environment-setup |
| description | Internal skill to configure environments. Never use unless the user explicitly initiates the skill. Focus on localhost-ready setup and validation. |
<step number="2">
<title>Inspect static repository evidence</title>
<description>Collect only evidence that supports concrete environment fields.</description>
<actions>
<action>Before broader inspection, look through the target repo's developer local-setup documentation first. Start with the closest setup docs that explain how developers run the project locally in a sandbox or localhost context, such as `AGENTS.md`, `README*`, or repo-local runbooks.</action>
<action>Treat repo-local developer setup docs as the primary source of truth for sandbox setup flow, then use package manifests, scripts, CI, and config files to confirm or refine the exact commands.</action>
<action>Do not run `git clone`, ask the user to clone the repo again, or add clone steps to the environment config when the repository is already present in the workspace.</action>
<action>Inspect README and docs.</action>
<action>Inspect repository structure.</action>
<action>Inspect package manifests and lockfiles.</action>
<action>Inspect monorepo/workspace files such as `pnpm-workspace.yaml`, `turbo.json`, and `nx.json`.</action>
<action>Inspect tool version files such as `.tool-versions`, `.nvmrc`, `.node-version`, and `.python-version`.</action>
<action>Inspect Dockerfiles and compose files.</action>
<action>Inspect CI config.</action>
<action>Inspect framework config files.</action>
<action>Inspect the canonical environment config schema or types (for example `packages/types/src/environment-config.ts`) before using optional keys.</action>
<action>Inspect scripts for install, dev, build, preview, test, serve, and start.</action>
<action>When the repo needs infrastructure beyond what is already available, remember that the worker CLI can provision supported services on demand: run `worker services` to see the full list and `worker service <name>` to install and start one service.</action>
<action>Do not invent mocked, stubbed, or fake replacement services just to get the app booting. If repository evidence and supported worker tooling still do not reveal how to run a required real service, stop and ask the user for help with that service.</action>
<action>Identify the canonical test-suite command and any required wrappers (for example `dotenvx`, package filter, or workspace command) when tests exist.</action>
<action>Inspect environment examples such as `.env.example` and `.env.local.example`.</action>
<action>Prefer correctness and evidence over completeness.</action>
<action>Omit uncertain fields rather than guessing.</action>
</actions>
<validation>Developer local-setup docs were checked first, and every planned config field has concrete repository evidence or is intentionally omitted.</validation>
</step>
</steps>
Draft and refine a minimal config that reflects repository reality.
Draft a minimal initial config
Create the smallest valid Roomote environment YAML from static evidence.
Produce exactly one initial YAML config.
Use repository default branch unless strong evidence indicates a different branch.
Assume the repositories listed in the environment already exist in the workspace; do not add repository clone commands or other duplicate checkout steps.
Include only commands strongly supported by the repository.
Use `repositories[].commands` only for executing commands and setting configuration needed to validate the environment.
If setup needs to create or modify configuration or runtime files, model that work as explicit entries in `repositories[].commands`.
Do not use `repositories[].commands` to write, generate, or patch application or source code; if source changes are required, report that as a blocker or a separate follow-up change instead of encoding it into the environment config.
Treat each `run` value as a sequence of single-line shell commands: the executor splits on literal newlines before invoking bash, so YAML block scalars containing shell control structures such as `if ... fi`, `case`, loops, heredocs, or multiline functions will be broken apart and usually fail.
When command logic truly needs shell control flow, either express it as separate independent `commands` entries or wrap the whole block as one explicit shell invocation such as `bash -lc 'if [ ! -f .env ]; then cp .env.example .env; ruby -e \"...\"; fi'`.
Prefer short one-line `run` commands with `&&` or `||` for simple sequencing, and avoid YAML `run: |` blocks unless every physical line is intentionally a standalone command that can succeed on its own.
When runtime-only configuration file changes are needed, prefer paths outside the git repo (for example `/tmp` or `$HOME`) to avoid leaving unstaged repository changes.
Every command added to `repositories[].commands` must be intended to be run during validation; do not include speculative, placeholder, or convenience commands that you do not plan to execute and confirm.
For long-running service commands (for example `dev`, `start`, `serve`, `preview`, watchers), set `detached: true` and include a `logfile` path.
Do not wrap long-running commands in `pm2 start` yourself. Roomote runs environment repository commands marked `detached: true` under PM2 supervision, so the `run` value should be the foreground command the app normally uses.
Include only services clearly required by the repository.
Include `tool_versions` only when clearly discoverable.
When the repository exposes a browser UI or a stable localhost landing page, populate `initialUrl` with the best validated absolute URL so the shared live browser does not start at `about:blank`.
When a validated localhost HTTP surface is meant for humans in a browser (particularly a web app UI), also add a matching top-level `ports` entry so Roomote publishes a shareable preview URL and a `ROOMOTE__HOST` environment variable for it: use a short uppercase `name` such as `WEB`, set `port` to the validated listening port (named ports must fall in the 1024-65535 range), set `initial_path` when a specific landing path is better than `/`, and mark the main surface `primary: true` when more than one port is configured.
Keep the `ports` list limited to human-facing surfaces validated during setup; do not add ports for databases, background workers, or internal-only APIs that no human would open in a browser.
Do not invent secrets, credentials, env values, or unsupported keys.
Choose a plain, stable environment `name` based on the product or repository itself. Do not decorate it with qualifiers like `Localhost`, `Minimal`, `Dev`, or similar unless the user explicitly asked for multiple distinct variants.
When repository evidence makes required environment keys clear but values are unavailable, request them immediately instead of waiting for a command to fail: in web dashboard tasks and Slack-started setup tasks, use `request_environment_variables`; for Slack-started setup tasks, still send a concise `send_chat_reply` message with `purpose` set to `progress` naming the required keys and what they unblock, but do not add the secure `/setup` link yourself because the platform automatically accompanies that request with a standardized secure-entry link reply; in other surfaces, ask the user to add them locally in the current task. Keep the YAML best-effort and ready for user-provided values (for example `${KEY}` placeholders when appropriate), without guessing secret values.
Keep `agentInstructions` short, practical, and repository-specific for agents that will run inside the created environment.
Do not use `agentInstructions` to narrate setup progress, list current setup next steps, or hand off unresolved setup work for this skill execution.
If a test suite exists, include a concrete test command in `agentInstructions` and state that the suite should pass before completing code changes, even when setup validation reports a clearly pre-existing repo test failure.
Discover how agents should access the app in a browser and document the full entry path in `agentInstructions`. Investigate: whether authentication is required, what credentials or bypass mechanisms work in dev/test mode, what the landing page is after login, and any test-mode conventions for third-party auth providers. Agents running inside this environment will use `agentInstructions` as their only guide for browser access, so the instructions must be specific enough that an agent can navigate from the initial URL to an authenticated app surface without prior knowledge of the product.
The initial config is minimal, valid, and evidence-backed.
<step number="4">
<title>Run practical validation when feasible</title>
<description>Use runtime evidence to confirm install/start assumptions without over-expanding scope. Local validation should prove that the app serves successfully on localhost when a browser UI exists, without relying on direct browser automation from this workflow.</description>
<actions>
<action>Run validation workflow in order:
repositories[].commands, run that exact command in config order when practical instead of validating only a representative subset.logfile or readiness check shows the expected service actually started.agentInstructions, and continue only if install/start/localhost validation is otherwise sufficient.initialUrl to the best validated absolute localhost URL (or keep about:blank only when no better landing page exists), confirm that localhost URL through loopback HTTP reachability and startup evidence, and record the exact URL plus the evidence used. Do not use direct browser automation from environment-setup.ports entry for a validated HTTP surface, confirm its port number matches the actual validated listening port and that any initial_path responds successfully over loopback.request_environment_variables to request the needed keys securely instead of asking the user to paste secret values into the conversation.send_chat_reply update with purpose set to progress that names the required keys and explains what they unblock, but do not include the secure /setup link yourself because the platform automatically accompanies the request with that secure-entry link after request_environment_variables succeeds.mcp__roomote__manage_tasks with action: "list_environments" first so you can confirm the created or updated environment appears as a current launch target and copy the exact returned environmentId.mcp__roomote__manage_tasks with action: "launch", environmentId set to that created or updated environment ID, and a concrete prompt such as Confirm that this environment is running correctly. Use localhost or the environment's initial URL to verify the expected service responds successfully, and confirm there are no obvious startup failures blocking basic use. Preparing the environment can take 5 minutes or more, so be patient before deciding startup is stuck. Report the exact step that fails plus any visible error messages or logs. If everything works, say that the environment looks ready..taskId for internal monitoring only. Do not expose the spawned verification task link in the user-facing response.mcp__roomote__manage_tasks using action: "get_summary" and the returned taskId. Use that per-task summary as the source of truth for task state, including any surfaced startup or runtime failure details.Completed without a surfaced startup or runtime failure, treat that as a successful spawned-task run and report that observed outcome directly instead of asking the user to confirm it manually.Ready, Idle, or Needs input, do not keep polling that same state indefinitely. Inspect the latest task messages to determine whether the verification task already reported success, surfaced a blocker, or is unexpectedly waiting for follow-up input.Failed, Canceled, or exposes a startup or runtime error, inspect the exact status and error and decide whether the problem appears fixable within environment-setup scope, such as revising commands, services, environment variables, startup order, readiness checks, or other environment-definition details.<completion_criteria>
All included fields are supported by repository evidence or practical validation.
Uncertain fields are omitted rather than guessed.
Validation outcomes and blockers are reported explicitly.
When a repository test suite is practical to run, it is executed and the result is reported explicitly. Test failures block environment creation when they indicate an environment-definition or setup problem; clearly pre-existing repository failures may be carried forward only when install/start validation is otherwise sufficient.
The final environment definition is best-effort and should be runnable once required environment variables are provided.
Environment creation or update is attempted only after local install/test/start validation is successful enough to proceed.
When environment persistence succeeds, a lightweight Roomote verification task is launched against that environment and monitored by calling the Roomote MCP tool mcp__roomote__manage_tasks with action: "get_summary" before this setup task finishes, unless an explicit blocker prevents launch or monitoring.
The final response summarizes the environment name, whether it was created or updated, key validation outcomes, and any blockers - without including the raw YAML config.
The final response ends with a Next: line that reports the monitored verification outcome.
If the spawned verification task reaches Completed without a surfaced startup or runtime failure, the final response reports that success directly instead of asking the user to confirm it manually.
If the spawned verification task reveals a fixable setup or environment-definition error, the skill attempts to repair it, update the environment, relaunch verification, and report the final bounded retry outcome instead of stopping after the first failed verification task.
If the app exposes a browser UI and local startup succeeds, the localhost URL is verified through loopback reachability or other non-browser startup evidence before persistence continues.
If required environment variables or secrets are known but unavailable, the skill requests them immediately through request_environment_variables in web tasks and Slack-started setup tasks, or asks the user to set them locally in the current task before proceeding with affected validation.
Every command present in the final repositories[].commands list was run and explicitly confirmed during validation, or an explicit blocker explains why validation could not proceed.
No secrets, credentials, fabricated env values, or unsupported keys are introduced.
</completion_criteria>
<schema_reference> This schema lists the keys the environment definition may use. The validation scope above is narrower: runtime checks stay on localhost, while optional configuration fields still need repository evidence. <top_level_fields> </top_level_fields>
<named_port_config>
Each named port publishes a shareable live-preview URL for the environment and exposes a matching ROOMOTE host environment variable inside the sandbox (for example a port named WEB yields the ROOMOTE_WEB_HOST variable). Configure one entry per validated human-facing HTTP surface, particularly web app UIs.
</named_port_config>
<repository_config> </repository_config>
<command_config> </command_config>
<allowed_services> redis6 redis7 postgres15 postgres16 postgres17 mysql8 mariadb10 clickhouse aws </allowed_services>
</schema_reference>
<hard_rules>
Check each target repo's developer local-setup documentation before inferring sandbox setup commands from manifests, scripts, or CI.
When repo-local setup docs and lower-level evidence disagree, prefer the documented local developer workflow unless direct runtime validation proves the docs are stale or incomplete.
Treat repositories referenced by the task or environment as already checked out in the current workspace unless the user explicitly says otherwise.
Never include the full environment YAML in your visible response or Slack reply. The environment is already persisted through manage_environments; re-dumping the config into the transcript is redundant and risks exposing secret values that were kept out of the conversation through request_environment_variables.
Use repository default branch unless strong evidence supports another branch.
Include only commands strongly supported by repository evidence.
Do not run git clone, ask the user to re-clone a repository that is already present, or include clone steps in repositories[].commands.
Use repositories[].commands only for executing commands and setting configuration needed to validate the environment.
If setup requires configuration or runtime file creation or modification, represent it with repositories[].commands entries instead of asking the user to edit files directly.
Do not use repositories[].commands to write, generate, or patch application or source code; if source changes are required, report that as a blocker or separate follow-up work.
Treat each run field as newline-split before execution. Do not rely on YAML multiline blocks to preserve shell control flow across lines.
Do not emit YAML run: | blocks for if ... fi, case, loops, heredocs, or multiline shell functions unless the entire block is wrapped inside one explicit shell command such as bash -lc '...'.
When setup logic needs conditional or multiline behavior, prefer multiple simple command entries or one explicit shell wrapper command over raw multiline shell fragments.
Prefer runtime-only configuration file modifications outside the git repository when possible to avoid unstaged repo changes.
Include only services clearly required by repository evidence.
Include tool_versions only when clearly discoverable.
When a repository exposes a browser UI or stable localhost landing page, set initialUrl to the best validated absolute URL unless about:blank is intentionally required.
When a validated human-facing HTTP surface exists (particularly a web app UI), configure a matching top-level ports entry so the environment publishes a shareable preview URL for it; keep the ports list limited to validated human-facing surfaces and confirm each configured port number against the actual validated listening port.
Always derive a best-effort environment definition that is ready to work once required environment variables are supplied.
Treat agentInstructions as instructions for future agents running inside the created environment, not as setup progress notes or setup next-step guidance for this skill run.
When the app exposes a browser UI, agentInstructions must explain how agents access it, including any authentication steps. Do not assume agents will discover auth flows, test credentials, or dev-mode conventions on their own.
If a repository test suite exists, include a concrete test command in agentInstructions and state that the suite should pass before completing future code changes, even when setup validation reports a clearly pre-existing repo failure.
If tests are practical to run during validation, execute the suite and treat failures as blockers when they indicate missing setup, broken environment definition, unavailable required services or secrets, or another environment-setup problem.
Do not treat clearly pre-existing repository or unit-test failures as automatic blockers to environment creation when install/start/localhost validation succeeds and the failure appears outside environment-setup scope; report the exact failing command and keep the issue visible as a known repo problem.
Every command added to repositories[].commands must be run during validation in config order unless an explicit blocker prevents it.
Every command added to repositories[].commands must be explicitly confirmed from execution evidence appropriate to that command, such as exit status, log inspection, artifact creation, localhost reachability, or other command-appropriate runtime evidence.
Do not depend on prompt-wide browser bootstrap or direct browser automation inside environment-setup; keep localhost validation in this skill to loopback reachability and startup evidence.
If any configured command cannot be run or confirmed, remove it from the final environment definition or report the exact blocker; do not leave speculative or unverified commands in the final config.
Do not replace required real services with mocks, stubs, fake servers, or no-op stand-ins merely to make validation appear successful.
If repository evidence and supported worker tooling are still insufficient to get a required real service running, ask the user for help with that service before proceeding instead of inventing a fallback.
If repository evidence or validation shows that required environment variables or secrets are needed, request them as soon as their names are known instead of waiting for a later command failure.
If local install/test/start cannot run due to missing environment variables or secrets, do not create an environment until the missing variables are provided through request_environment_variables in web tasks and Slack-started setup tasks, or the user adds them locally and validation is retried.
When required environment variables or secrets are known but unavailable in a web dashboard task or Slack-started setup task, use request_environment_variables and never ask the user to paste secret values into the conversation.
In Slack-started setup tasks, send a concise send_chat_reply message with purpose set to progress naming the required keys and what they unblock, but do not include the secure /setup link yourself because the platform automatically accompanies the request with that secure-entry link after request_environment_variables succeeds.
In non-web surfaces, ask only for local environment variable additions in the current task, and provide exact variable names and exact actions.
For this skill, create a new environment or update the specified existing environment only after localhost startup and loopback reachability are successful enough to proceed, including validation of initialUrl through non-browser evidence when the app exposes a browser UI.
When the task explicitly identifies an existing environment to revise, update that environment instead of creating a duplicate.
After successful environment persistence, use the Roomote MCP tool mcp__roomote__manage_tasks to launch a lightweight verification task against the created or updated environment and monitor it yourself instead of leaving verification as an implicit manual next step.
Before launching that verification task, call the Roomote MCP tool mcp__roomote__manage_tasks with action: "list_environments" so the environment target is grounded in current Roomote data and you can copy the exact returned environmentId.
When the verification task launch succeeds, monitor it with the Roomote MCP tool mcp__roomote__manage_tasks using action: "get_summary" and use that per-task summary surface as the source of truth for task status and surfaced startup failures.
While monitoring the spawned verification task, narrate concise progress updates in the current task instead of silently waiting or pushing the waiting back onto the user.
Preparing the environment can take 5 minutes or more. Do not stop monitoring solely because the verification task is taking a long time to start; keep checking until it reaches a terminal state or surfaces a blocker you can report or act on.
If the monitored summary settles into Ready, Idle, or Needs input, inspect the latest task messages instead of polling that state forever, and only treat it as success when those messages clearly report that the environment looks ready.
If the spawned verification task surfaces a fixable setup or environment-definition problem, attempt to fix it yourself, recreate or update the environment, launch a fresh verification task, and repeat the monitoring loop instead of stopping after the first discovered error.
Bound that environment-repair loop to at most 2 additional full retries after the first spawned verification task unless the task context clearly justifies fewer attempts.
Do not claim automatic repair for failures that actually require product/source changes outside environment-setup scope, unsupported infrastructure, missing external credentials, or a user decision you cannot safely infer; report those as blockers.
Do not tell the user to verify the environment in that spawned task before clicking Continue, and do not include the spawned verification task link in the user-facing response; report the monitored outcome yourself.
If the verification task launch or monitoring loop fails after the environment is persisted, report that as a blocker; do not imply the verification handoff already exists.
When a browser UI is validated locally, report the exact localhost URL and the loopback or startup evidence that confirmed it rather than capturing screenshots from this skill.
Any long-running service command (for example dev, start, serve, preview, or watchers) must use detached: true.
Any command with detached: true must set logfile to capture runtime output.
Do not encode pm2 start, nohup, shell trailing &, or another process supervisor in run for environment repository commands. Use the normal foreground command with detached: true; Roomote supervises it with PM2 and restarts it if it exits unexpectedly.
Do not include unsupported keys.
Do not fabricate env values.
If secrets are required but unavailable, omit them and report the blocker.
</hard_rules>
<example_notes> Examples below show valid output YAML shapes, not extra validation obligations. </example_notes>
<best_practices>
Treat examples as patterns, not templates to copy blindly.
Repository-specific evidence should determine final fields.
Prefer the smallest config that matches the repository's real workflow.
Minimal configs are easier to run, validate, and maintain.
Prefer command-driven setup over manual repo edits.
Encoding file writes in commands keeps setup reproducible and avoids asking the user for avoidable code changes.
Prefer one-line run commands.
The executor splits run on literal newlines, so one-line commands or explicit shell wrappers are much less error-prone than YAML block-scalar shell scripts.
Prefer runtime-only files outside the git repo.
Writing temporary setup files to locations like /tmp reduces repository noise and prevents unexpected unstaged changes.
</best_practices>
<error_handling>
Repository evidence does not clearly support a field.
Omit the field and document the uncertainty in Assumptions or Blockers instead of guessing.
Install or startup cannot complete due to unavailable secrets, credentials, or external systems.
Keep the config minimal, report exactly what blocked validation, and avoid fabricated env values.
The app starts locally, but the expected localhost URL cannot be confirmed through loopback reachability or other non-browser startup evidence.
Report the blocker explicitly, include any successful loopback checks you did perform, and do not claim browser-surface validation succeeded.
Local validation succeeded, but creating the environment failed.
Report the exact creation error, revise the YAML if the failure reveals a concrete config issue, and retry within the normal retry budget.
Local install, test, or startup fails because required environment variables or secrets are missing.
Keep the YAML best-effort, stop at the blocked local validation step, ask the user to add exact keys locally in the current task, then rerun blocked validation steps after confirmation.
The canonical test command fails, but the failure appears to come from the repository's current test state rather than the drafted environment definition.
Record the exact failing command, explain why the failure appears outside environment-setup scope, keep the test command in agentInstructions, and continue with environment persistence only when install/start/localhost validation is otherwise sufficient.
Setup cannot succeed via environment variables or setup changes encoded in generated environment config commands (including command-driven runtime file creation).
Ask for the minimal user code change only as a last resort, and explain why commands-based setup and non-repo file options were insufficient.
</error_handling>