/claude-toolkit:ci-cd-pipelinefrom claude-toolkit
Extends Laravel Kickoff's GitHub Actions CI with CD pipelines, Docker containerisation, secret management, and failure notifications. Generates Dockerfiles, docker-compose.yml, and VPS deployment configs.
Ships in claude-toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Continuous deployment pipelines, Docker containerisation, and deployment automation for Laravel projects. Built on top of Laravel Kickoff's existing GitHub Actions CI and /bin scripts.
| Command | Description |
|---|---|
/ci extend | Extend Kickoff's CI with CD pipeline (staging + production deploy) |
/ci docker | Generate Dockerfile, docker-compose.yml, and .dockerignore for Laravel |
/ci deploy | Deployment configs for VPS via SSH or container registry |
/ci secrets | Secret management guidance for GitHub Actions and deployment |
Laravel Kickoff projects ship with these CI/CD foundations already configured:
| Tool | Workflow Step | Purpose |
|---|---|---|
| Pint | pint --test | Code style enforcement |
| PHPStan / Larastan | phpstan analyse | Static analysis |
| Rector | rector --dry-run | Automated refactoring checks |
| Pest | php artisan test | Test suite execution |
| Script | Purpose |
|---|---|
bin/deploy.sh | Pull latest code, install deps, run migrations, restart services |
bin/backup.sh | Database dump + file backup before deployments |
bin/setup.sh | First-time server setup (packages, permissions, cron, queue) |
This skill extends the baseline — it does not replace it. All CI steps remain; CD steps are added after successful CI.
/ci extend — Add CD Pipeline to Existing CIRead the existing .github/workflows/ directory. Identify:
Ask the user:
develop -> staging, main -> production)Create or extend .github/workflows/deploy.yml with:
name: Deploy
on:
push:
branches:
- main
- develop
concurrency:
group: deploy-${{ github.ref }}
cancel-in-progress: false
jobs:
ci:
uses: ./.github/workflows/ci.yml
deploy-staging:
needs: ci
if: github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/checkout@v4
- name: Deploy to staging
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.STAGING_HOST }}
username: ${{ secrets.STAGING_USER }}
key: ${{ secrets.STAGING_SSH_KEY }}
script: |
cd /var/www/staging
bash bin/backup.sh
bash bin/deploy.sh
deploy-production:
needs: ci
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v4
- name: Deploy to production
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.PRODUCTION_HOST }}
username: ${{ secrets.PRODUCTION_USER }}
key: ${{ secrets.PRODUCTION_SSH_KEY }}
script: |
cd /var/www/production
bash bin/backup.sh
bash bin/deploy.sh
notify-failure:
needs: [deploy-staging, deploy-production]
if: failure()
runs-on: ubuntu-latest
steps:
- name: Notify on failure
uses: slackapi/slack-github-action@v2
with:
webhook: ${{ secrets.SLACK_WEBHOOK }}
webhook-type: incoming-webhook
payload: |
{
"text": "Deployment failed for ${{ github.repository }} on ${{ github.ref_name }}\nCommit: ${{ github.sha }}\nWorkflow: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
Advise the user to configure GitHub Environment protection:
| Environment | Rules |
|---|---|
| staging | No approval required, deploy on push to develop |
| production | Require 1 reviewer approval, deploy on push to main |
Support these notification channels:
| Channel | Action | Secret Required |
|---|---|---|
| Slack | slackapi/slack-github-action@v2 | SLACK_WEBHOOK |
| Telegram | appleboy/telegram-action@master | TELEGRAM_TOKEN, TELEGRAM_TO |
| Built-in GitHub notifications | None (configure in repo settings) |
Always add notification as a separate job that runs if: failure() on the deployment jobs.
/ci docker — Docker Setup for LaravelAsk the user:
Read references/docker-laravel.md for complete templates.
For development:
docker-compose.yml — app, database, redis, meilisearch, mailpitDockerfile.dev — PHP + extensions + Node for asset buildingFor production:
Dockerfile — multi-stage build (composer install, npm build, final slim image)docker-compose.prod.yml — app + nginx, external database assumed.dockerignore — exclude dev files, tests, node_modules, .gitIf the user wants CI to build and push Docker images, generate:
name: Docker Build & Push
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ github.ref_name }}
ghcr.io/${{ github.repository }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
/ci deploy — Deployment ConfigurationsAsk:
Leverage Kickoff's /bin scripts. Read references/kickoff-bin-scripts.md for integration patterns.
deploy.sh enhancement for CD:
#!/bin/bash
set -e
APP_DIR=${APP_DIR:-/var/www/app}
cd "$APP_DIR"
echo "==> Starting deployment..."
# Maintenance mode
php artisan down --retry=60
# Pull latest
git pull origin "$BRANCH"
# Install dependencies
composer install --no-dev --optimize-autoloader --no-interaction
npm ci && npm run build
# Migrate
php artisan migrate --force
# Cache
php artisan config:cache
php artisan route:cache
php artisan view:cache
php artisan event:cache
php artisan icons:cache
# Restart queue workers
php artisan queue:restart
# Clear maintenance mode
php artisan up
echo "==> Deployment complete!"
For Docker deployments on VPS:
#!/bin/bash
set -e
IMAGE=${IMAGE:-ghcr.io/org/app:latest}
echo "==> Pulling latest image..."
docker pull "$IMAGE"
echo "==> Running migrations..."
docker run --rm --env-file .env "$IMAGE" php artisan migrate --force
echo "==> Restarting services..."
docker compose -f docker-compose.prod.yml up -d --remove-orphans
echo "==> Cleaning up old images..."
docker image prune -f
For projects that need zero-downtime without containers:
#!/bin/bash
set -e
APP_DIR="/var/www/app"
RELEASES_DIR="$APP_DIR/releases"
SHARED_DIR="$APP_DIR/shared"
RELEASE="$(date +%Y%m%d%H%M%S)"
CURRENT="$APP_DIR/current"
# Create release directory
mkdir -p "$RELEASES_DIR/$RELEASE"
cd "$RELEASES_DIR/$RELEASE"
# Clone
git clone --depth 1 --branch "$BRANCH" "$REPO_URL" .
# Link shared resources
ln -sf "$SHARED_DIR/.env" .env
ln -sf "$SHARED_DIR/storage" storage
# Install
composer install --no-dev --optimize-autoloader --no-interaction
npm ci && npm run build
# Migrate
php artisan migrate --force
# Cache
php artisan config:cache
php artisan route:cache
php artisan view:cache
# Swap symlink (atomic)
ln -sfn "$RELEASES_DIR/$RELEASE" "$CURRENT"
# Restart
sudo systemctl reload php8.3-fpm
php artisan queue:restart
# Keep only last 5 releases
cd "$RELEASES_DIR"
ls -dt */ | tail -n +6 | xargs rm -rf
echo "==> Deployed release $RELEASE"
/ci secrets — Secret ManagementGuide the user through setting up required secrets:
| Secret | Used By | How to Get |
|---|---|---|
STAGING_HOST | SSH deploy | Server IP or hostname |
STAGING_USER | SSH deploy | SSH username (e.g., deploy) |
STAGING_SSH_KEY | SSH deploy | ssh-keygen -t ed25519 -C "github-actions" |
PRODUCTION_HOST | SSH deploy | Server IP or hostname |
PRODUCTION_USER | SSH deploy | SSH username |
PRODUCTION_SSH_KEY | SSH deploy | Separate key from staging |
SLACK_WEBHOOK | Notifications | Slack Incoming Webhook URL |
TELEGRAM_TOKEN | Notifications | BotFather token |
TELEGRAM_TO | Notifications | Chat ID |
Walk the user through:
Generate a deploy key (on local machine):
ssh-keygen -t ed25519 -C "github-actions-deploy" -f ~/.ssh/gh_deploy_key -N ""
Add public key to server:
ssh-copy-id -i ~/.ssh/gh_deploy_key.pub deploy@your-server
Add private key to GitHub:
STAGING_SSH_KEY, paste private key contentRecommend using GitHub Environments for secret scoping:
Repository Secrets (shared):
- SLACK_WEBHOOK
Staging Environment Secrets:
- STAGING_HOST
- STAGING_USER
- STAGING_SSH_KEY
Production Environment Secrets:
- PRODUCTION_HOST
- PRODUCTION_USER
- PRODUCTION_SSH_KEY
For application secrets on the server:
| Approach | When to Use |
|---|---|
.env file on server | Simple VPS deployments, file persists across deploys |
GitHub Secrets -> .env | Generate .env during CI, inject into container |
| Vault (HashiCorp) | Enterprise, multi-service, strict compliance |
| AWS SSM / GCP Secret Manager | Cloud-native deployments |
Generate .env from GitHub Secrets (for Docker deployments):
- name: Create .env file
run: |
cat <<EOF > .env
APP_NAME="${{ secrets.APP_NAME }}"
APP_ENV=production
APP_KEY="${{ secrets.APP_KEY }}"
APP_URL="${{ secrets.APP_URL }}"
DB_HOST="${{ secrets.DB_HOST }}"
DB_DATABASE="${{ secrets.DB_DATABASE }}"
DB_USERNAME="${{ secrets.DB_USERNAME }}"
DB_PASSWORD="${{ secrets.DB_PASSWORD }}"
REDIS_HOST="${{ secrets.REDIS_HOST }}"
MAIL_MAILER="${{ secrets.MAIL_MAILER }}"
EOF
Never commit .env files. Always verify .gitignore includes .env*.
The recommended pipeline architecture builds on Kickoff's existing CI:
Push to develop Push to main Push tag v*
│ │ │
▼ ▼ ▼
┌────────┐ ┌────────┐ ┌────────┐
│ CI │ │ CI │ │ CI │
│ (Pint, │ │ (Pint, │ │ (Pint, │
│PHPStan,│ │PHPStan,│ │PHPStan,│
│Rector, │ │Rector, │ │Rector, │
│ Pest) │ │ Pest) │ │ Pest) │
└───┬────┘ └───┬────┘ └───┬────┘
│ │ │
▼ ▼ ▼
┌────────┐ ┌──────────┐ ┌──────────┐
│ Deploy │ │ Deploy │ │ Docker │
│Staging │ │Production│ │Build+Push│
│via SSH │ │ via SSH │ │to Registry│
└───┬────┘ └────┬─────┘ └──────────┘
│ │
▼ ▼
┌────────┐ ┌────────┐
│ Notify │ │ Notify │
│if fail │ │if fail │
└────────┘ └────────┘
| Rationalization | Reality |
|---|---|
| "The pipeline is flaky, just re-run it" | A pipeline you re-run on reflex has stopped being a signal. Fix the flake or delete the job. |
| "I'll set continue-on-error until we clean it up" | That is deleting the gate while keeping the badge. Either the check matters or it does not. |
| "Pinning actions to a SHA is annoying to maintain" | A moving tag means a third party can change what runs against your secrets, without a PR. |
| "The secret is only echoed for debugging" | Logs are retained, forwarded and often public on the fork. That secret is now compromised. |
| "pull_request_target is the only way to get secrets on a fork PR" | It is also the way to hand an attacker your secrets. If forks need secrets, the design is wrong. |
| "Caching dependencies is premature optimisation" | It is a two-line change that halves every run. This is the cheapest win in CI. |
| "Deploy on green is risky, I'll deploy manually" | Manual deploys drift from the tested artifact. Automate the deploy; gate it on an environment approval. |
| "One big job is simpler than several" | Until it fails, and the log is 4000 lines with no indication which check broke. |
continue-on-error: true on a quality or test job@main, @master or a moving @v4pull_request_target combined with a checkout of the PR headpermissions: block (defaults to write)run: step that could be loggedcontinue-on-error)permissions: is least-privilege (contents: read baseline)pull_request_target absent, or provably not checking out untrusted code| File | Read When |
|---|---|
references/github-actions-templates.md | Generating or extending CI/CD workflows, adding matrix testing, caching, notifications |
references/docker-laravel.md | Creating Dockerfile, docker-compose.yml, .dockerignore for Laravel |
references/kickoff-bin-scripts.md | Integrating /bin deploy, backup, setup scripts with GitHub Actions CD |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub nasrulhazim/claude --plugin claude-toolkit43 skills in this plugin
/business-cardSVG business card designer that takes contact details and brand preferences, then produces 12 front design concepts with optional back designs, interactive HTML preview galleries, individual card showcases with front/back flip animation, and print-ready SVG exports with bleed area and crop marks. Supports horizontal and vertical orientations, six layout styles (minimal, corporate, creative, elegant, bold, tech), multiple color schemes, QR code placeholders, social media icons, and logo integration. Use this skill whenever the user asks to design a business card, create a name card, make visiting cards, or says "design business card", "buat kad bisnes", "create name card", "reka kad perniagaan", "design kad nama", "I need a business card for X".
/code-qualityPHP and Laravel code quality toolchain — static analysis with Larastan/PHPStan, code style enforcement with Pint, automated refactoring with Rector, baseline management for legacy codebases, and CI pipeline integration via GitHub Actions. Use this skill whenever the user asks to check code quality, fix linting errors, run static analysis, modernise PHP code, set up CI quality gates, manage PHPStan baselines, configure Pint presets, or apply Rector rules. Triggers for requests like "run quality check", "fix my code style", "analyse with larastan", "update phpstan baseline", "modernise my PHP code", "set up CI for quality", "check code quality", "pint tak jalan", "nak fix phpstan error", "setup rector", "betulkan code style", "tambah quality gate dalam CI", or "baseline phpstan untuk legacy code". Assumes Laravel Kickoff as the baseline — PHPStan, Pint, Rector, and GitHub Actions CI are already configured. This skill extends and customises that baseline.
/courseware-builderInteractive HTML courseware builder — turns any technical topic, flow, or process into a CD-Courseware-style interactive slide deck with animated diagrams, step-by-step simulation, syntax-highlighted code examples, and key points panels. Use this skill whenever the user wants to create teaching materials, interactive slides, animated flow diagrams, or step-by-step technical walkthroughs — even if they say "buatkan slides untuk topik X", "jadikan courseware", "buat interactive tutorial", or "create a lesson on X". Also triggers for "convert my diagram to interactive slides" or "build a visual walkthrough for my training".
/debuggingSystematic debugging and error recovery for Laravel and PHP projects — a five-step triage that goes reproduce, localise, reduce, fix, guard. Covers reading a stack trace properly, bisecting with git, isolating a failure to the smallest reproducer, telling a symptom apart from a root cause, and closing every fix with a regression test. Includes Laravel-specific traps: N+1 masked as a timeout, queue jobs failing silently on the wrong connection, cache and config caches serving stale values, Livewire state desync, and eloquent/model events firing in unexpected order. Use this skill whenever the user reports something broken, failing, flaky, slow-then-erroring, or behaving differently in production than locally — including "this test is flaky", "why is this failing", "debug this error", "it works locally but not on staging", "find the root cause", "this exception makes no sense", "the queue job never runs", "bisect this regression", "kenapa error ni", "tolong debug", "test ni kejap pass kejap fail", "cari punca sebenar", "jalan kat local tapi tak jalan kat production", or "job queue tak jalan". Pairs with kickoff-pest-testing for the regression test and log-monitor for production-log-driven investigations.
/deploy-appDeploys a Kickoff-based Laravel application to its host by running `bin/deploy` over SSH, then verifies the release and knows what each way it can stop means. Use this skill whenever the user asks to deploy an app, push the latest code to production, check what commit production is running, bring a site back up after a failed deploy, or roll back — "deploy latest", "deploy the app", "tolong deploy", "deploy latest dulu", "push to production", "apa commit dekat production", "site down after deploy", "keluarkan maintenance mode", "rollback production", "kenapa 503". Covers the deploy command and its flags, the post-deploy verification checklist, the recovery path for each failure mode, and the production traps that have already cost time. Does NOT cover provisioning a new host from bare metal (`bin/provision-host`), CI/CD pipeline design (`ci-cd-pipeline`), or writing deploy operations.
/design-patternsPHP and Laravel design pattern advisor — suggests, implements, refactors, and reviews design patterns in your codebase. Use this skill whenever the user asks about which pattern to use, wants to refactor code to follow a pattern, needs a pattern implemented, or wants a code review focused on architecture and patterns. Triggers for requests like "suggest a pattern for this", "refactor this to use repository pattern", "implement the action pattern", "review my code architecture", "which pattern should I use here", "is this a good use of singleton", "how do I decouple this", "tolong suggest pattern", "refactor guna pattern", "review architecture code ni", "pattern mana sesuai untuk ni", "nak implement strategy pattern", or "code ni dah jadi god controller, macam mana nak fix". Covers GoF patterns adapted for PHP/Laravel, Laravel-specific patterns (Actions, Services, DTOs, Value Objects, Query Scopes, Form Requests, API Resources), SOLID principles, and anti-pattern detection. Works with cleaniquecoders/laravel-action for the Action pattern.
Other plugins' skills for the same job