[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7D2CHW0XMYEBSFZMF3ZC8YV":3,"skill-same:01M7D2CHW0XMYEBSFZMF3ZC8YV":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":14,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M7D2CHW0XMYEBSFZMF3ZC8YV","deploying-to-cloud",null,"Deploys and manages Laravel applications on Laravel Cloud using the `cloud` CLI. Use when the user wants to deploy an app, ship to Cloud, create or manage applications, environments, databases, caches, object storage, queues, domains, instances, background processes, secrets, compute, scheduled tasks, or Laravel Cloud infrastructure; or check billing, usage, or spend. Triggers on deployment, shipping, Cloud management, environment setup, database provisioning, billing or usage queries, the `cloud` CLI, and Laravel Cloud deployment troubleshooting.","itsmejay18\u002FAI-Skills-for-My-Development-Stack","itsmejay18","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F167779943?v=4","01M7CZRFC6DDZA5V2CX8WDSZED","Jay Jemino Ababon ","01M7CZRFCVRNW1SFHSQXEJ3CQN",0,"MIT","https:\u002F\u002Fgithub.com\u002Fitsmejay18\u002FAI-Skills-for-My-Development-Stack\u002Fblob\u002Fmain\u002F15-DevOps-CICD-Deployment\u002Fdeploying-to-cloud\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: deploying-to-cloud\ndescription: \"Deploys and manages Laravel applications on Laravel Cloud using the `cloud` CLI. Use when the user wants to deploy an app, ship to Cloud, create or manage applications, environments, databases, caches, object storage, queues, domains, instances, background processes, secrets, compute, scheduled tasks, or Laravel Cloud infrastructure; or check billing, usage, or spend. Triggers on deployment, shipping, Cloud management, environment setup, database provisioning, billing or usage queries, the `cloud` CLI, and Laravel Cloud deployment troubleshooting.\"\nlicense: MIT\nmetadata:\n  author: laravel\n---\n# Deploying with Laravel Cloud\n\nUse the [Laravel Cloud documentation](https:\u002F\u002Fcloud.laravel.com\u002Fdocs\u002Fllms.txt) for detailed, current feature behavior. Use the Cloud CLI for Cloud operations rather than guessing dashboard or API workflows. Install it in the project and invoke it as `.\u002Fvendor\u002Fbin\u002Fcloud` by default; use a globally installed `cloud` command only as a fallback. Commands below are written as `cloud` for brevity; run them as `.\u002Fvendor\u002Fbin\u002Fcloud` unless falling back to the global installation.\n\n## Application Setup\n\n- Laravel Cloud deploys from GitHub, GitLab, or Bitbucket. A new Laravel application requires PHP 8.2 or later, Laravel 9 or later, a connected Git provider, and a deployment region.\n- Cloud creates environments for applications. Use separate production, staging, and preview environments; each environment has its own compute, resources, and deployment settings.\n- Keep application compute and attached resources in the same region where possible.\n- Cloud builds a Docker image using the selected PHP version, runs the configured build and deploy commands, and switches traffic to a successful deployment with zero downtime. Push-to-deploy is enabled by default, and manual deployments and deploy hooks are also available.\n\n## Build and Deploy\n\n- A typical Laravel build command is `composer install --no-dev && npm run build`.\n- Run optimization and cache-building commands during the build, not during deployment. A typical deploy command is `php artisan migrate --force`.\n- Build and deploy commands have a 15-minute timeout. Deploy commands run immediately before the release becomes live, and filesystem changes made by deploy commands are not persisted.\n- Do not add `php artisan queue:restart`, `php artisan horizon:terminate`, `php artisan optimize:clear`, or `php artisan storage:link` to deploy commands. Cloud handles worker restarts and process management; deploy filesystem changes are not persistent.\n- After changing environment settings, attached resources, or linked secrets, redeploy the environment for the changes to take effect.\n\n## Configuration and Resources\n\n- Attached databases, caches, and object storage inject their connection variables automatically. Custom environment variables take precedence over injected values.\n- Use Secrets Manager for encrypted organization-level values shared across environments. Secret values cannot be read after creation; redeploy affected environments after creating, updating, linking, unlinking, or deleting a secret.\n- Environment filesystems are ephemeral and are not shared between replicas. Use a database or Laravel Valkey for persistent cache and sessions, and Laravel Cloud Object Storage for persistent files. Do not rely on local files surviving a deployment.\n\n### Object Storage and File Visibility\n\n- Laravel Cloud Object Storage is backed by Cloudflare R2. R2 applies visibility at the bucket level; a bucket cannot contain a mix of private and public objects.\n- For private files, always use `Storage::disk()` with no arguments, such as `Storage::disk()->put(...)`, so Laravel uses the environment's default disk. Do not pass a disk name for private\u002Fdefault storage. Attach a private Cloud bucket as the environment's default disk.\n- For public files, use the named public disk: `Storage::disk('public')->put(...)`. Attach a second Cloud bucket configured as public and give it the `public` disk name.\n- Applications that use both private and public files therefore need two Cloud Object Storage buckets attached to the environment: a private default bucket and a public bucket named `public`.\n- Do not set per-file or Flysystem `visibility: 'public'` configuration for Cloud Object Storage. R2 does not support per-object ACL headers and rejects those requests; select the bucket visibility when creating the bucket.\n- Private buckets are not internet-accessible, but Laravel can generate temporary public URLs with `Storage::temporaryUrl(...)`. Public buckets expose all objects through their Cloud-provided public URL.\n- Install the S3 Flysystem adapter before using Cloud Object Storage: `composer require league\u002Fflysystem-aws-s3-v3 \"^3.0\" --with-all-dependencies`.\n\n## Queues and Scheduling\n\n- Managed queues are the recommended queue option. They provision dedicated workers and autoscale based on queued work.\n- Managed queues require a supported recent Laravel version and `aws\u002Faws-sdk-php`; check the current Cloud documentation before changing dependencies.\n- Enable the scheduler on an App or Worker cluster to run `php artisan schedule:run` every minute. When an environment has multiple replicas, use Laravel's `onOneServer` for tasks that must run once.\n- Only Flex compute sizes can scale to zero. Scale-to-zero environments wake for Laravel scheduled tasks and queued jobs, but long-running jobs may be interrupted when the sleep timeout is reached. Use managed queues for workloads that must not be interrupted.\n\n## Domains and Storage\n\n- Each environment receives a `laravel.cloud` domain after its first successful deployment. Cloud automatically verifies custom domains and provisions SSL after the required DNS records are configured.\n- Do not use the ephemeral filesystem for persistent uploads, generated files, cache, or session data. Use the appropriate Cloud resource instead.\n\n## Cloud CLI\n\n### Setup\n\n```shell\ncomposer require --dev laravel\u002Fcloud-cli\n.\u002Fvendor\u002Fbin\u002Fcloud auth -n\n```\n\nIf a project-local installation is not available, install the CLI globally with `composer global require laravel\u002Fcloud-cli` and invoke it as `cloud`.\n\n`cloud auth` opens a browser. If a browser is unavailable, set `LARAVEL_CLOUD_TOKEN` in the environment. It overrides any saved token and writes nothing to disk. To save a token instead, run `cloud auth:token --add --token=\u003Ctoken> -n` or pipe it with `echo \"$TOKEN\" | cloud auth:token --add -n`.\n\n### Commands\n\nCommands follow a CRUD pattern: `resource:list`, `resource:get`, `resource:create`, `resource:update`, `resource:delete`.\n\nAvailable resources: `application`, `environment`, `instance`, `database-cluster`, `database`, `cache`, `bucket`, `domain`, `websocket-cluster`, `background-process`, `secret`, `command`, `deployment`.\n\nSome resources have additional commands (e.g., `domain:verify`, `database:open`, `instance:sizes`, `cache:types`). Discover these via `cloud -h`.\n\nNever hardcode command signatures. Always run `cloud \u003Ccommand> -h` to discover options at runtime.\n\n### CLI Flags\n\n- Always add `-n` to every command to prevent the CLI from hanging.\n- Never use `-q` or `--silent`; they suppress all output.\n\nFlag combos per operation:\n- Read (`:list`, `:get`) → `--json -n`\n- Create (`:create`) → `--json -n`\n- Update (`:update`) → `--json -n --force`\n- Delete (`:delete`) → `-n --force` (no `--json`)\n- Environment variables → `-n --force`\n- Deploy or ship → `-n` with all options passed explicitly (no `--json`)\n\n### Deployment Workflow\n\nDetermine the task and follow the matching path:\n\n- First deployment: inspect `cloud ship -h`, then run `cloud ship -n` with all required values.\n\n- Existing application:\n  ```shell\n  cloud deploy {app_name} {environment} -n --open\n  cloud deploy:monitor -n\n  ```\n\n- Environment variables: `cloud environment:variables -n --force`\n\n- Secrets: `echo \"$VALUE\" | cloud secret:create --name=NAME --json -n`, then `cloud environment-secret:attach`\n\n- Provision infrastructure: `cloud \u003Cresource>:create --json -n`\n\n- Monorepo (application in a subdirectory): add `--root-directory=\u003Csubdir>` to `cloud ship` or `cloud application:create`.\n\n- Custom domain: `cloud domain:create --json -n`, then `cloud domain:verify -n`.\n\n- Repository defaults: `cloud repo:config {application} -n` sets repository-local application and organization defaults. Pass `--organization=\u003Cid|name|slug>` when the user has multiple organizations.\n\nFor multi-step operations, see [reference\u002Fchecklists.md](reference\u002Fchecklists.md).\n\n- If the user's needs are unclear, ask before running anything.\n\n### When a Command Fails\n\n1. Read the error output.\n2. Check the resource status with `:list --json -n` or `:get --json -n`.\n3. For authentication errors, run `cloud auth -n`.\n4. Fix the issue and rerun the command.\n5. If the same error occurs after one fix, stop and ask the user rather than repeating the operation.\n\nAlways run `cloud deploy:monitor -n` after every deploy. If it fails, inspect the deployment status and logs and show the user what went wrong before attempting a fix.\n\n### Subagent Delegation\n\nDelegate high-output operations to subagents using the Task tool to keep the main context window small. Only the summary returns; verbose output stays in the subagent's context.\n\nDelegate these to a subagent:\n- `cloud deploy:monitor -n` — deployment logs can be very long\n- `cloud deployment:get --json -n` — full deployment details\n- `cloud \u003Cresource>:list --json -n` — listing many resources produces large JSON\n- `cloud command:run` — when output may be long\n- `cloud usage --detailed --json -n` — the payload includes details for every database, cache, bucket, websocket, and application\n- Fetching docs from https:\u002F\u002Fcloud.laravel.com\u002Fdocs\u002Fllms.txt via `WebFetch`\n\nKeep in the main context:\n- Short commands like `:create`, `:delete`, `:update` — output is small\n- `cloud deploy -n` — you need the deployment ID immediately\n- Any command where you need the result for the next step right away\n\n### Rules\n\nFollow these rules:\n- Flag selection — always use the documented combos above\n- Deploy sequence — deploy then monitor, never skip monitoring\n- Destructive commands — always confirm with the user first, show the command and wait for approval. This includes deleting applications, environments, databases, caches, buckets, domains, or secrets.\n- Error loop — diagnose, fix once, ask user if it fails again\n\nUse judgment for:\n- Instance sizes, regions, cluster types — ask the user if not specified\n- Which resources to provision — based on what the user describes\n- Order of provisioning — no strict sequence required\n- How to present output — summarize, show raw, or extract fields based on context\n\n### Secrets\n\nSecrets are encrypted values shared across the organization and attached to environments. The CLI encrypts values locally, so plaintext never reaches the API.\n\n```shell\ncloud secret:list --json -n\necho \"$VALUE\" | cloud secret:create --name=STRIPE_KEY --json -n\ncloud environment-secret:attach {environment} {secretId} -n\ncloud environment-secret:list {environment} --json -n\n```\n\nPipe the value in. `--value=` works, but leaves the plaintext in shell history and the process list.\n\n`secret:update`, `secret:delete`, and `environment-secret:attach` take secret IDs, not names — names are not unique. Read IDs from `cloud secret:list --json -n`.\n\nThere is no `secret:get`, and no way to detach a secret from a single environment. `secret:delete` removes it and detaches it everywhere.\n\nSecrets need the `sodium` PHP extension. No other command does.\n\nRedeploy affected environments after creating, updating, attaching, or deleting a secret.\n\n### Remote Access\n\n#### Tinker (v0.2.0 or later)\n\nRun PHP code directly in a Cloud environment:\n\n```shell\ncloud tinker {environment} --code='Your PHP code here' --timeout=60 -n\n```\n\n- `--code` — PHP code to execute (required in non-interactive mode)\n- `--timeout` — maximum number of seconds to wait for output (default: 60)\n\nThe code must explicitly output results using `echo`, `dump`, or similar; expressions alone produce no output.\n\nAlways pass `--code` and `-n` to avoid interactive prompts.\n\n#### Remote Commands\n\nRun shell commands on a Cloud environment:\n\n```shell\ncloud command:run {environment} --cmd='your command here' -n\n```\n\n- `--cmd` — the command to run (required in non-interactive mode)\n- `--no-monitor` — skip real-time output streaming\n- `--copy-output` — copy output to clipboard\n\nReview past commands:\n\n- `cloud command:list {environment} --json -n` — list command history\n- `cloud command:get {commandId} --json -n` — get details and output of a specific command\n\n### Billing and Usage\n\nView billing and usage for the current organization:\n\n```shell\ncloud usage --json -n\n```\n\n- `--period=current|previous|1|2|3` — Billing period (default: `current`; `1`, `2`, and `3` are one, two, and three periods back, respectively). Other values return an error.\n- `--environment=\u003Cid>` — filter usage to a single environment\n- `--detailed` — include per-application, per-resource, and per-add-on breakdowns\n- `--json` — machine-readable output (always pair with `-n`)\n\nCommon queries:\n\n- Current spend: `cloud usage --json -n | jq '.currentSpendCents'`\n- Last month's bill: `cloud usage --period=previous --json -n`\n- One environment, full breakdown: `cloud usage --environment=\u003Cid> --detailed --json -n`\n\nAll amounts are in cents. Keys are camelCase at every level (e.g., `currentSpendCents`, `bandwidth.allowanceBytes`, `databases[].totalCents`, `applications[].totalCostCents`).\n\n### Config\n\n1. Environment: `LARAVEL_CLOUD_TOKEN` — an API token, taking precedence over any saved one (empty counts as unset)\n2. Global: `~\u002F.config\u002Fcloud\u002Fconfig.json` — auth tokens and preferences\n3. Repo-local: `.cloud\u002Fconfig.json` — app and environment defaults (set by `cloud repo:config {application} -n`)\n4. CLI arguments override both config files\n\nPass the application to `repo:config`. Without it, the command must prompt and fails under `-n` when the organization has more than one application. Deploy commands do not need these defaults; pass the application and environment to them directly.\n\nUsing multiple organizations requires multiple stored API tokens. Commands read `organization_id` from `.cloud\u002Fconfig.json` to select one and fail if it is not set. Set it with `cloud repo:config {application} --organization=\u003Cid|name|slug> -n`.\n\n`LARAVEL_CLOUD_TOKEN` holds one token, so it picks the organization on its own. Naming a different one with `--organization` fails rather than falling back to the token's organization.\n\n## Documentation\n\nLaravel Cloud documentation: https:\u002F\u002Fcloud.laravel.com\u002Fdocs\u002Fllms.txt\n\nWhen the user asks how something works or needs an explanation of a Laravel Cloud feature, fetch the docs from the URL above using `WebFetch` and use it to provide accurate answers.\n\n## When Stuck\n\n- Fetch https:\u002F\u002Fcloud.laravel.com\u002Fdocs\u002Fllms.txt for official documentation\n- Run `cloud \u003Ccommand> -h` for any command's options\n- Run `cloud -h` to discover commands\n\n## Verification\n\n1. Confirm the target application and environment before changing or deploying anything.\n2. Check staged environment changes and required resources before deployment.\n3. Monitor every deployment to completion with `cloud deploy:monitor -n`.\n4. For production changes, verify the application URL, logs, queues, scheduled tasks, and relevant resource health.\n","# Deploying with Laravel Cloud\n\nUse the [Laravel Cloud documentation](https:\u002F\u002Fcloud.laravel.com\u002Fdocs\u002Fllms.txt) for detailed, current feature behavior. Use the Cloud CLI for Cloud operations rather than guessing dashboard or API workflows. Install it in the project and invoke it as `.\u002Fvendor\u002Fbin\u002Fcloud` by default; use a globally installed `cloud` command only as a fallback. Commands below are written as `cloud` for brevity; run them as `.\u002Fvendor\u002Fbin\u002Fcloud` unless falling back to the global installation.\n\n## Application Setup\n\n- Laravel Cloud deploys from GitHub, GitLab, or Bitbucket. A new Laravel application requires PHP 8.2 or later, Laravel 9 or later, a connected Git provider, and a deployment region.\n- Cloud creates environments for applications. Use separate production, staging, and preview environments; each environment has its own compute, resources, and deployment settings.\n- Keep application compute and attached resources in the same region where possible.\n- Cloud builds a Docker image using the selected PHP version, runs the configured build and deploy commands, and switches traffic to a successful deployment with zero downtime. Push-to-deploy is enabled by default, and manual deployments and deploy hooks are also available.\n\n## Build and Deploy\n\n- A typical Laravel build command is `composer install --no-dev && npm run build`.\n- Run optimization and cache-building commands during the build, not during deployment. A typical deploy command is `php artisan migrate --force`.\n- Build and deploy commands have a 15-minute timeout. Deploy commands run immediately before the release becomes live, and filesystem changes made by deploy commands are not persisted.\n- Do not add `php artisan queue:restart`, `php artisan horizon:terminate`, `php artisan optimize:clear`, or `php artisan storage:link` to deploy commands. Cloud handles worker restarts and process management; deploy filesystem changes are not persistent.\n- After changing environment settings, attached resources, or linked secrets, redeploy the environment for the changes to take effect.\n\n## Configuration and Resources\n\n- Attached databases, caches, and object storage inject their connection variables automatically. Custom environment variables take precedence over injected values.\n- Use Secrets Manager for encrypted organization-level values shared across environments. Secret values cannot be read after creation; redeploy affected environments after creating, updating, linking, unlinking, or deleting a secret.\n- Environment filesystems are ephemeral and are not shared between replicas. Use a database or Laravel Valkey for persistent cache and sessions, and Laravel Cloud Object Storage for persistent files. Do not rely on local files surviving a deployment.\n\n### Object Storage and File Visibility\n\n- Laravel Cloud Object Storage is backed by Cloudflare R2. R2 applies visibility at the bucket level; a bucket cannot contain a mix of private and public objects.\n- For private files, always use `Storage::disk()` with no arguments, such as `Storage::disk()->put(...)`, so Laravel uses the environment's default disk. Do not pass a disk name for private\u002Fdefault storage. Attach a private Cloud bucket as the environment's default disk.\n- For public files, use the named public disk: `Storage::disk('public')->put(...)`. Attach a second Cloud bucket configured as public and give it the `public` disk name.\n- Applications that use both private and public files therefore need two Cloud Object Storage buckets attached to the environment: a private default bucket and a public bucket named `public`.\n- Do not set per-file or Flysystem `visibility: 'public'` configuration for Cloud Object Storage. R2 does not support per-object ACL headers and rejects those requests; select the bucket visibility when creating the bucket.\n- Private buckets are not internet-accessible, but Laravel can generate temporary public URLs with `Storage::temporaryUrl(...)`. Public buckets expose all objects through their Cloud-provided public URL.\n- Install the S3 Flysystem adapter before using Cloud Object Storage: `composer require league\u002Fflysystem-aws-s3-v3 \"^3.0\" --with-all-dependencies`.\n\n## Queues and Scheduling\n\n- Managed queues are the recommended queue option. They provision dedicated workers and autoscale based on queued work.\n- Managed queues require a supported recent Laravel version and `aws\u002Faws-sdk-php`; check the current Cloud documentation before changing dependencies.\n- Enable the scheduler on an App or Worker cluster to run `php artisan schedule:run` every minute. When an environment has multiple replicas, use Laravel's `onOneServer` for tasks that must run once.\n- Only Flex compute sizes can scale to zero. Scale-to-zero environments wake for Laravel scheduled tasks and queued jobs, but long-running jobs may be interrupted when the sleep timeout is reached. Use managed queues for workloads that must not be interrupted.\n\n## Domains and Storage\n\n- Each environment receives a `laravel.cloud` domain after its first successful deployment. Cloud automatically verifies custom domains and provisions SSL after the required DNS records are configured.\n- Do not use the ephemeral filesystem for persistent uploads, generated files, cache, or session data. Use the appropriate Cloud resource instead.\n\n## Cloud CLI\n\n### Setup\n\n```shell\ncomposer require --dev laravel\u002Fcloud-cli\n.\u002Fvendor\u002Fbin\u002Fcloud auth -n\n```\n\nIf a project-local installation is not available, install the CLI globally with `composer global require laravel\u002Fcloud-cli` and invoke it as `cloud`.\n\n`cloud auth` opens a browser. If a browser is unavailable, set `LARAVEL_CLOUD_TOKEN` in the environment. It overrides any saved token and writes nothing to disk. To save a token instead, run `cloud auth:token --add --token=\u003Ctoken> -n` or pipe it with `echo \"$TOKEN\" | cloud auth:token --add -n`.\n\n### Commands\n\nCommands follow a CRUD pattern: `resource:list`, `resource:get`, `resource:create`, `resource:update`, `resource:delete`.\n\nAvailable resources: `application`, `environment`, `instance`, `database-cluster`, `database`, `cache`, `bucket`, `domain`, `websocket-cluster`, `background-process`, `secret`, `command`, `deployment`.\n\nSome resources have additional commands (e.g., `domain:verify`, `database:open`, `instance:sizes`, `cache:types`). Discover these via `cloud -h`.\n\nNever hardcode command signatures. Always run `cloud \u003Ccommand> -h` to discover options at runtime.\n\n### CLI Flags\n\n- Always add `-n` to every command to prevent the CLI from hanging.\n- Never use `-q` or `--silent`; they suppress all output.\n\nFlag combos per operation:\n- Read (`:list`, `:get`) → `--json -n`\n- Create (`:create`) → `--json -n`\n- Update (`:update`) → `--json -n --force`\n- Delete (`:delete`) → `-n --force` (no `--json`)\n- Environment variables → `-n --force`\n- Deploy or ship → `-n` with all options passed explicitly (no `--json`)\n\n### Deployment Workflow\n\nDetermine the task and follow the matching path:\n\n- First deployment: inspect `cloud ship -h`, then run `cloud ship -n` with all required values.\n\n- Existing application:\n  ```shell\n  cloud deploy {app_name} {environment} -n --open\n  cloud deploy:monitor -n\n  ```\n\n- Environment variables: `cloud environment:variables -n --force`\n\n- Secrets: `echo \"$VALUE\" | cloud secret:create --name=NAME --json -n`, then `cloud environment-secret:attach`\n\n- Provision infrastructure: `cloud \u003Cresource>:create --json -n`\n\n- Monorepo (application in a subdirectory): add `--root-directory=\u003Csubdir>` to `cloud ship` or `cloud application:create`.\n\n- Custom domain: `cloud domain:create --json -n`, then `cloud domain:verify -n`.\n\n- Repository defaults: `cloud repo:config {application} -n` sets repository-local application and organization defaults. Pass `--organization=\u003Cid|name|slug>` when the user has multiple organizations.\n\nFor multi-step operations, see [reference\u002Fchecklists.md](reference\u002Fchecklists.md).\n\n- If the user's needs are unclear, ask before running anything.\n\n### When a Command Fails\n\n1. Read the error output.\n2. Check the resource status with `:list --json -n` or `:get --json -n`.\n3. For authentication errors, run `cloud auth -n`.\n4. Fix the issue and rerun the command.\n5. If the same error occurs after one fix, stop and ask the user rather than repeating the operation.\n\nAlways run `cloud deploy:monitor -n` after every deploy. If it fails, inspect the deployment status and logs and show the user what went wrong before attempting a fix.\n\n### Subagent Delegation\n\nDelegate high-output operations to subagents using the Task tool to keep the main context window small. Only the summary returns; verbose output stays in the subagent's context.\n\nDelegate these to a subagent:\n- `cloud deploy:monitor -n` — deployment logs can be very long\n- `cloud deployment:get --json -n` — full deployment details\n- `cloud \u003Cresource>:list --json -n` — listing many resources produces large JSON\n- `cloud command:run` — when output may be long\n- `cloud usage --detailed --json -n` — the payload includes details for every database, cache, bucket, websocket, and application\n- Fetching docs from https:\u002F\u002Fcloud.laravel.com\u002Fdocs\u002Fllms.txt via `WebFetch`\n\nKeep in the main context:\n- Short commands like `:create`, `:delete`, `:update` — output is small\n- `cloud deploy -n` — you need the deployment ID immediately\n- Any command where you need the result for the next step right away\n\n### Rules\n\nFollow these rules:\n- Flag selection — always use the documented combos above\n- Deploy sequence — deploy then monitor, never skip monitoring\n- Destructive commands — always confirm with the user first, show the command and wait for approval. This includes deleting applications, environments, databases, caches, buckets, domains, or secrets.\n- Error loop — diagnose, fix once, ask user if it fails again\n\nUse judgment for:\n- Instance sizes, regions, cluster types — ask the user if not specified\n- Which resources to provision — based on what the user describes\n- Order of provisioning — no strict sequence required\n- How to present output — summarize, show raw, or extract fields based on context\n\n### Secrets\n\nSecrets are encrypted values shared across the organization and attached to environments. The CLI encrypts values locally, so plaintext never reaches the API.\n\n```shell\ncloud secret:list --json -n\necho \"$VALUE\" | cloud secret:create --name=STRIPE_KEY --json -n\ncloud environment-secret:attach {environment} {secretId} -n\ncloud environment-secret:list {environment} --json -n\n```\n\nPipe the value in. `--value=` works, but leaves the plaintext in shell history and the process list.\n\n`secret:update`, `secret:delete`, and `environment-secret:attach` take secret IDs, not names — names are not unique. Read IDs from `cloud secret:list --json -n`.\n\nThere is no `secret:get`, and no way to detach a secret from a single environment. `secret:delete` removes it and detaches it everywhere.\n\nSecrets need the `sodium` PHP extension. No other command does.\n\nRedeploy affected environments after creating, updating, attaching, or deleting a secret.\n\n### Remote Access\n\n#### Tinker (v0.2.0 or later)\n\nRun PHP code directly in a Cloud environment:\n\n```shell\ncloud tinker {environment} --code='Your PHP code here' --timeout=60 -n\n```\n\n- `--code` — PHP code to execute (required in non-interactive mode)\n- `--timeout` — maximum number of seconds to wait for output (default: 60)\n\nThe code must explicitly output results using `echo`, `dump`, or similar; expressions alone produce no output.\n\nAlways pass `--code` and `-n` to avoid interactive prompts.\n\n#### Remote Commands\n\nRun shell commands on a Cloud environment:\n\n```shell\ncloud command:run {environment} --cmd='your command here' -n\n```\n\n- `--cmd` — the command to run (required in non-interactive mode)\n- `--no-monitor` — skip real-time output streaming\n- `--copy-output` — copy output to clipboard\n\nReview past commands:\n\n- `cloud command:list {environment} --json -n` — list command history\n- `cloud command:get {commandId} --json -n` — get details and output of a specific command\n\n### Billing and Usage\n\nView billing and usage for the current organization:\n\n```shell\ncloud usage --json -n\n```\n\n- `--period=current|previous|1|2|3` — Billing period (default: `current`; `1`, `2`, and `3` are one, two, and three periods back, respectively). Other values return an error.\n- `--environment=\u003Cid>` — filter usage to a single environment\n- `--detailed` — include per-application, per-resource, and per-add-on breakdowns\n- `--json` — machine-readable output (always pair with `-n`)\n\nCommon queries:\n\n- Current spend: `cloud usage --json -n | jq '.currentSpendCents'`\n- Last month's bill: `cloud usage --period=previous --json -n`\n- One environment, full breakdown: `cloud usage --environment=\u003Cid> --detailed --json -n`\n\nAll amounts are in cents. Keys are camelCase at every level (e.g., `currentSpendCents`, `bandwidth.allowanceBytes`, `databases[].totalCents`, `applications[].totalCostCents`).\n\n### Config\n\n1. Environment: `LARAVEL_CLOUD_TOKEN` — an API token, taking precedence over any saved one (empty counts as unset)\n2. Global: `~\u002F.config\u002Fcloud\u002Fconfig.json` — auth tokens and preferences\n3. Repo-local: `.cloud\u002Fconfig.json` — app and environment defaults (set by `cloud repo:config {application} -n`)\n4. CLI arguments override both config files\n\nPass the application to `repo:config`. Without it, the command must prompt and fails under `-n` when the organization has more than one application. Deploy commands do not need these defaults; pass the application and environment to them directly.\n\nUsing multiple organizations requires multiple stored API tokens. Commands read `organization_id` from `.cloud\u002Fconfig.json` to select one and fail if it is not set. Set it with `cloud repo:config {application} --organization=\u003Cid|name|slug> -n`.\n\n`LARAVEL_CLOUD_TOKEN` holds one token, so it picks the organization on its own. Naming a different one with `--organization` fails rather than falling back to the token's organization.\n\n## Documentation\n\nLaravel Cloud documentation: https:\u002F\u002Fcloud.laravel.com\u002Fdocs\u002Fllms.txt\n\nWhen the user asks how something works or needs an explanation of a Laravel Cloud feature, fetch the docs from the URL above using `WebFetch` and use it to provide accurate answers.\n\n## When Stuck\n\n- Fetch https:\u002F\u002Fcloud.laravel.com\u002Fdocs\u002Fllms.txt for official documentation\n- Run `cloud \u003Ccommand> -h` for any command's options\n- Run `cloud -h` to discover commands\n\n## Verification\n\n1. Confirm the target application and environment before changing or deploying anything.\n2. Check staged environment changes and required resources before deployment.\n3. Monitor every deployment to completion with `cloud deploy:monitor -n`.\n4. For production changes, verify the application URL, logs, queues, scheduled tasks, and relevant resource health.\n",{"name":5,"license":15,"metadata":24,"description":7},{"author":25},"laravel","main","30954af1dcd1a74b63f05deb2e2c41e5ecae4a82","15-DevOps-CICD-Deployment\u002Fdeploying-to-cloud","https:\u002F\u002Fgithub.com\u002Fitsmejay18\u002FAI-Skills-for-My-Development-Stack","https:\u002F\u002Fgithub.com\u002Fitsmejay18","2026-09-18 16:06:36",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add itsmejay18\u002FAI-Skills-for-My-Development-Stack --skill deploying-to-cloud",{"tool":38,"command":39},"bunx","bunx skills add itsmejay18\u002FAI-Skills-for-My-Development-Stack --skill deploying-to-cloud",{"tool":41,"command":42},"pnpm","pnpm dlx skills add itsmejay18\u002FAI-Skills-for-My-Development-Stack --skill deploying-to-cloud","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fitsmejay18\u002FAI-Skills-for-My-Development-Stack\u002Fblob\u002Fmain\u002F15-DevOps-CICD-Deployment\u002Fdeploying-to-cloud\u002FSKILL.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"reference\u002Fchecklists.md","REFERENCE","参考文档",1871,"https:\u002F\u002Fgithub.com\u002Fitsmejay18\u002FAI-Skills-for-My-Development-Stack\u002Fblob\u002Fmain\u002F15-DevOps-CICD-Deployment\u002Fdeploying-to-cloud\u002Freference\u002Fchecklists.md",[53,60,67,74,81,88],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7D2RKBHPZ3E1RNN5DWHT550","vectorization","Design, implement, optimize, and review SIMD code in .NET. USE FOR: vectorizing scalar loops with TensorPrimitives, Vector64\u002F128\u002F256\u002F512, or platform hardware intrinsics; reviewing existing SIMD code, including Vector\u003CT>, for contract equivalence, tail handling, memory safety, portability, fallbacks, and measured performance. DO NOT USE FOR: performance work unrelated to SIMD or vectorization.","https:\u002F\u002Fgithub.com\u002Fitsmejay18\u002FAI-Skills-for-My-Development-Stack\u002Fblob\u002Fmain\u002F20-Performance-Optimization\u002Fvectorization\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7D2RDJ7RN3QK8GJR0QTER1D","resolve-project-references","Guide for interpreting ResolveProjectReferences time in MSBuild performance summaries. Activate when ResolveProjectReferences appears as the most expensive target and developers are trying to optimize it directly. Explains that the reported time includes wait time for dependent project builds and is misleading. Guides users to focus on task self-time instead. Do not activate for general build performance -- use build-perf-diagnostics instead.","https:\u002F\u002Fgithub.com\u002Fitsmejay18\u002FAI-Skills-for-My-Development-Stack\u002Fblob\u002Fmain\u002F20-Performance-Optimization\u002Fresolve-project-references\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M7D2R1H2GTNZYHG9YRX3JDQW","optimizing-ef-core-queries","Optimize and improve the performance of slow Entity Framework Core (EF Core) queries: make them generate less SQL, make fewer database round-trips, and return results faster. Use whenever an EF Core or DbContext query or data-access path is slow or should be made faster — whether or not EF Core owns the database schema. For EF Core, not Dapper or raw ADO.NET.","https:\u002F\u002Fgithub.com\u002Fitsmejay18\u002FAI-Skills-for-My-Development-Stack\u002Fblob\u002Fmain\u002F20-Performance-Optimization\u002Foptimizing-ef-core-queries\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M7D2QREG04W1YT0NEBHEW5C9","microbenchmarking","Activate this skill when BenchmarkDotNet (BDN) is involved in the task — creating, running, configuring, or reviewing BDN benchmarks. Also activate when microbenchmarking .NET code would be useful and BenchmarkDotNet is the likely tool. Consider activating when answering a .NET performance question requires measurement and BenchmarkDotNet may be needed. Covers microbenchmark design, BDN configuration and project setup, how to run BDN microbenchmarks efficiently and effectively, and using BDN for side-by-side performance comparisons. Do NOT use for profiling\u002Ftracing .NET code (dotnet-trace, PerfView), production telemetry, or load\u002Fstress testing (Crank, k6).","https:\u002F\u002Fgithub.com\u002Fitsmejay18\u002FAI-Skills-for-My-Development-Stack\u002Fblob\u002Fmain\u002F20-Performance-Optimization\u002Fmicrobenchmarking\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M7D2QGE175XWPZVACVH2868Z","incremental-build","Guide for optimizing MSBuild incremental builds. USE FOR: builds slower than expected on subsequent runs, 'nothing changed but it rebuilds anyway', diagnosing why targets re-execute unnecessarily, fixing broken no-op builds. Covers 8 common causes: missing Inputs\u002FOutputs on custom targets, volatile properties in output paths (timestamps\u002FGUIDs), file writes outside tracked Outputs, missing FileWrites registration, glob changes, Visual Studio Fast Up-to-Date Check (FUTDC) issues. Key diagnostic: look for 'Building target completely' vs 'Skipping target' in binlog. DO NOT USE FOR: first-time build slowness (use build-perf-baseline), parallelism issues (use build-parallelism), evaluation-phase slowness (use eval-performance), non-MSBuild build systems.","https:\u002F\u002Fgithub.com\u002Fitsmejay18\u002FAI-Skills-for-My-Development-Stack\u002Fblob\u002Fmain\u002F20-Performance-Optimization\u002Fincremental-build\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M7D2Q1DQTC6K49R73WQTTPSB","eval-performance","Guide for diagnosing and improving MSBuild project evaluation performance. USE FOR: builds slow before any compilation starts, high evaluation time in binlog analysis, expensive glob patterns walking large directories (node_modules, .git, bin\u002Fobj), deep import chains (>20 levels), preprocessed output >10K lines indicating heavy evaluation, property functions with file I\u002FO ($([System.IO.File]::ReadAllText(...))), multiple evaluations per project. Covers the 5 MSBuild evaluation phases, glob optimization via DefaultItemExcludes, import chain analysis with \u002Fpp preprocessing. DO NOT USE FOR: compilation-time slowness (use build-perf-diagnostics), incremental build issues (use incremental-build), non-MSBuild build systems.","https:\u002F\u002Fgithub.com\u002Fitsmejay18\u002FAI-Skills-for-My-Development-Stack\u002Fblob\u002Fmain\u002F20-Performance-Optimization\u002Feval-performance\u002FSKILL.md",[],[]]