Scenario to cloud

From Vrooli/Vrooli · View interactive version

Scenario to cloud is an AI agent skill from the GitHub repository Vrooli/Vrooli. Use `scenario-to-cloud` to deploy a scenario to an existing VPS and operate that deployment.

How to use this skill

Skill file

Tools focus: Scenario to Cloud

Use scenario-to-cloud to deploy a scenario to an existing VPS and operate that deployment.


**1. When to Use This Tool**

| Goal | Command |

|------|---------|

| Resolve existing deployment by selector | scenario-to-cloud deployment resolve --domain <domain> --scenario <id> |

| Deploy/redeploy only when required (manifest path) | scenario-to-cloud redeploy cloud-manifest.json --if-needed --preflight --wait |

| Deploy/redeploy only when required (existing deployment by selector) | scenario-to-cloud redeploy --domain <domain> --scenario <id> --if-needed --preflight --wait |

| Force immediate redeploy on existing deployment (operator override) | scenario-to-cloud redeploy --domain <domain> --scenario <id> --force-run --preflight --wait |

| Validate deployment health by selector or id | scenario-to-cloud deployment health --domain <domain> --scenario <id> |

| Read deployment logs | scenario-to-cloud inspect logs <deployment-id> |

| Verify SSH access safely (agent mode) | scenario-to-cloud ssh bootstrap <host> --user root --non-interactive |

Scope boundaries:


**2. Core Workflow**

Prerequisites

Minimum required inputs:

Derived at runtime:

Additional required input when no deployment exists:

Input contract (fast decision)

Quick Path: Existing Deployment (Domain + Scenario Only)

Use this when a deployment likely already exists and you only have:

scenario-to-cloud deployment resolve --domain {{DOMAIN}} --scenario {{SCENARIO_NAME}} --json
VPS_HOST_FROM_RESOLVE=$(scenario-to-cloud deployment resolve --domain {{DOMAIN}} --scenario {{SCENARIO_NAME}} --json | jq -r '.deployment.host')
scenario-to-cloud ssh bootstrap "$VPS_HOST_FROM_RESOLVE" --user root --non-interactive
scenario-to-cloud deployment health --domain {{DOMAIN}} --scenario {{SCENARIO_NAME}} --json
scenario-to-cloud redeploy --domain {{DOMAIN}} --scenario {{SCENARIO_NAME}} --if-needed --preflight --wait

Operator override (only when a human explicitly requests immediate execution):

scenario-to-cloud redeploy --domain {{DOMAIN}} --scenario {{SCENARIO_NAME}} --force-run --preflight --wait
Step 1: Resolve deployment state first (selector-first)

Preferred selector-first path when domain is known:

scenario-to-cloud deployment resolve \
  --domain {{DOMAIN}} \
  --scenario {{SCENARIO_NAME}} \
  --json

Extract deployment.host and deployment.id from this output for later commands.

Step 2: Check SSH bootstrap readiness (agent-safe)
scenario-to-cloud ssh bootstrap {{VPS_HOST_FROM_RESOLVE}} --user root --non-interactive

If this fails:

Then run health by selector:

scenario-to-cloud deployment health \
  --domain {{DOMAIN}} \
  --scenario {{SCENARIO_NAME}} \
  --json

This command resolves deployment ID first, then returns health/freshness.

If no deployment exists for the selector, it fails with a "no deployment found" error.

Use --host {{VPS_HOST}} selectors only when a domain selector is unavailable.

Agent gating rule:

ssh_key_auth decision table:

| ssh_key_auth status | Deployment exists? | Action |

|---|---|---|

| pass | Yes/No | Continue to health/redeploy path |

| warn with unknown | Yes | Continue to deployment health; allow one redeploy attempt |

| warn with unknown | No | Stop and hand off interactive bootstrap command |

| fail | Yes/No | Stop and hand off interactive bootstrap command |

Step 3: Decision tree (always converge to desired state)
flowchart TD
  A[deployment health by selector] --> B{deployment found?}
  B -->|no| C[create+validate manifest]
  C --> D[redeploy --if-needed --preflight --wait]
  B -->|yes| E{health=healthy AND freshness=current?}
  E -->|yes| F[no-op]
  E -->|no| G{health=stopped AND freshness=current?}
  G -->|yes| H[start deployment]
  G -->|no| I[redeploy/execute existing deployment]
  D --> J[deployment health id]
  F --> J
  H --> J
  I --> J

Identifier rule (canonical):

Environment naming rule (canonical):

If deployment exists and needs convergence, use selector-only quick path (no local manifest required):

scenario-to-cloud redeploy \
  --domain {{DOMAIN}} \
  --scenario {{SCENARIO_NAME}} \
  --if-needed --preflight --wait

Equivalent explicit ID path:

DEPLOYMENT_ID=$(scenario-to-cloud deployment resolve \
  --domain {{DOMAIN}} \
  --scenario {{SCENARIO_NAME}} \
  --json | jq -r '.deployment.id')

scenario-to-cloud deployment execute "$DEPLOYMENT_ID" --preflight --wait
scenario-to-cloud deployment health "$DEPLOYMENT_ID" --json

If deployment is missing, create one in a persistent scenario path:

scenario-to-cloud manifest init \
  --scenario {{SCENARIO_NAME}} \
  --domain {{DOMAIN}} \
  --host {{VPS_HOST}} \
  --out scenarios/{{SCENARIO_NAME}}/.vrooli/cloud/manifest.prod.json

scenario-to-cloud manifest validate \
  scenarios/{{SCENARIO_NAME}}/.vrooli/cloud/manifest.prod.json

manifest init may emit a placeholder host when --host is omitted, so always set --host {{VPS_HOST}} before deploy/redeploy.

Default convergence command:

scenario-to-cloud redeploy \
  scenarios/{{SCENARIO_NAME}}/.vrooli/cloud/manifest.prod.json \
  --if-needed --preflight --wait

If health=stopped and freshness=current, start the existing deployment:

scenario-to-cloud deployment start <deployment-id>
scenario-to-cloud deployment health <deployment-id>
Step 4: Verify and triage
scenario-to-cloud deployment health <deployment-id>
scenario-to-cloud inspect logs <deployment-id> --tail 200

Convergence safety rule for --if-needed:

scenario-to-cloud deployment health --domain {{DOMAIN}} --scenario {{SCENARIO_NAME}} --json
curl -I https://{{DOMAIN}}/health

**3. Troubleshooting & Edge Cases**

Use this section for long-tail deployment failures and manual recovery/handoff paths.

  1. Run health first:
scenario-to-cloud deployment health --domain {{DOMAIN}} --scenario {{SCENARIO_NAME}}
  1. Run the exact recommendation commands from the output.
  2. Check logs for errors:
scenario-to-cloud inspect logs <deployment-id> --level error --since 1h
  1. If history or logs are empty and failure happened during preflight, inspect structured preflight diagnostics:
scenario-to-cloud deployment get <deployment-id> --json

Review preflight_result.checks and follow each failing check's hint first.

  1. If preflight failed, run this remediation order before retry:
# A) Inspect failing preflight checks first (including owning processes)
scenario-to-cloud deployment get <deployment-id> --json

# B) Port conflicts (80/443) only when owner is unexpected
scenario-to-cloud preflight fix-ports \
  --domain {{DOMAIN}} \
  --scenario {{SCENARIO_NAME}} \
  --port 80 --port 443

# C) Disk pressure triage (selector-first; no manual SSH assembly)
scenario-to-cloud preflight disk-usage \
  --domain {{DOMAIN}} \
  --scenario {{SCENARIO_NAME}}

# D) Disk cleanup with actionable per-action diagnostics
scenario-to-cloud preflight disk-cleanup \
  --domain {{DOMAIN}} \
  --scenario {{SCENARIO_NAME}} \
  --action apt_clean \
  --action journal_vacuum

# E) Re-check deployment diagnostics and identify unresolved failing checks
scenario-to-cloud deployment get <deployment-id> --json

Do not run fix-ports when expected edge services (for example caddy) are the owners of 80/443; follow the preflight hint for that check instead.

If a failing check is a hard infrastructure requirement (for example RAM below minimum policy), stop and hand off the infrastructure fix before retrying deployment.

  1. Retry convergence:
scenario-to-cloud deployment execute <deployment-id> --preflight --wait
scenario-to-cloud deployment health <deployment-id> --json
Hard Blocker Handoff (When Preflight Cannot Converge)

If preflight fails on hard infrastructure requirements (for example RAM below policy), stop and report:

For disk-space hard blockers specifically:


**4. Requirements Source of Truth**

Do not duplicate VPS requirements in this skill.

Use the scenario command that returns canonical policy used by runtime preflight:

scenario-to-cloud preflight requirements
scenario-to-cloud preflight requirements --json

**5. If You Need More Commands**

Use built-in group help:

scenario-to-cloud manifest help
scenario-to-cloud deployment help
scenario-to-cloud preflight help
scenario-to-cloud ssh help
scenario-to-cloud inspect help
scenario-to-cloud edge help

Use these only when the core workflow is insufficient.


**6. Guardrails**

Do:

Do NOT:


**7. Output Expectations**

After a successful deployment:

May create/update:

Must not:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.