Deploy skill for Claude Code
Deploy skill for Claude Code
The pc-deploy skill is a Claude Code skill that automates the entire deployment process. It detects your project type, creates or updates the application on Ploi Cloud, deploys it, monitors the deployment, and automatically fixes common failures.
What it does
When you run /pc-deploy from your project directory, the skill will:
- Check for a git repository, or fall back to source upload mode
- Detect your project type (Laravel, Node.js, WordPress, PHP, Statamic, Craft CMS)
- Extract PHP/Node versions and required extensions
- Detect services needed from your dependencies (databases, caches)
- Create or update the application on Ploi Cloud
- Configure build commands, init commands, and settings
- Deploy and monitor progress
- Auto-fix failures (up to 5 retries)
- Report the live URL when done
Installation
All tools — auto-detects your AI harness and installs to the right location:
npx skills add ploicloud/skill
Claude Code — install globally so it's available in all projects:
git clone https://github.com/ploicloud/skill ~/.claude/skills/pc-deploy
Manual — clone into your project's .claude/skills/ directory:
git clone https://github.com/ploicloud/skill .claude/skills/pc-deploy
Requirements
- A git repository with a remote URL (GitHub, GitLab, or Bitbucket), or a project directory without a git repo (deployed via source upload)
- The Ploi Cloud MCP server connected (see Getting started)
If the skill detects a git repository with a remote URL, it deploys from git. If no git repo or remote is found, it automatically switches to upload mode — creating a tar.gz archive of your project and uploading it to Ploi Cloud. See Deploying with source upload for more about upload-based deployments.
Usage
From your project directory in Claude Code, type:
/pc-deploy
The skill will handle everything automatically. You can also trigger it naturally:
"Deploy this project to Ploi Cloud"
Supported project types
| Type | Detection | Default build command |
|---|---|---|
| Laravel | composer.json with laravel/framework |
composer install --no-dev --optimize-autoloader && npm install && npm run build |
| Statamic | composer.json with statamic/cms |
composer install --no-dev --optimize-autoloader && npm install && npm run build |
| Craft CMS | composer.json with craftcms/cms |
composer install --no-dev --optimize-autoloader |
| WordPress | wp-config.php |
None (pre-built) |
| PHP | composer.json (generic) |
composer install --no-dev --optimize-autoloader |
| Node.js | package.json |
npm install && npm run build |
Service detection
The skill automatically detects services your application needs from its dependencies:
| Dependency | Service created |
|---|---|
mysql2, Prisma with MySQL |
MySQL |
pg, postgres, Prisma with PostgreSQL |
PostgreSQL |
mongodb, mongoose |
MongoDB |
predis/predis, ext-redis, redis, ioredis |
Redis |
php-amqplib, amqplib |
RabbitMQ |
Auto-fix capabilities
When a deployment fails, the skill analyzes the error and applies fixes automatically:
| Error | Fix applied |
|---|---|
| Out of memory (OOMKilled) | Increases memory allocation |
| Missing PHP extension | Adds the extension to PHP config |
| Build failure | Adjusts build commands |
| Health check failure | Changes the health check path |
| Missing environment variable | Adds the required secret |
The skill retries up to 5 times, escalating fixes as needed (e.g., memory: 1Gi → 2Gi → 4Gi).
Step-by-step walkthrough
Here's what a typical deployment looks like:
- Git check — the skill reads your git remote URL and current branch
- Project scan — reads
composer.jsonorpackage.jsonto detect type and dependencies - Existing app check — searches your Ploi Cloud applications for a matching repo
- Create/update — creates the app if new, or updates settings if it exists
- Services — creates any needed database or cache services
- Secrets — adds required environment variables from
.env.example - Deploy — triggers the deployment
- Monitor — polls every 15 seconds for up to 10 minutes
- Fix — if something fails, applies a fix and redeploys
- Report — shows the live URL and summary