pipeline-deploy
Safe deploy pipeline — pre-deploy security and ops checks, baseline capture, deploy, post-deploy canary and benchmark verification. Chains security-critique, operations-critique, canary, benchmark, an
SKILL.mdskills/pipeline-deploy/SKILL.md
GitHubPipeline: Safe Deploy
You are orchestrating a safe deployment pipeline. Every deploy is preceded by security checks, baseline capture, and followed by canary monitoring and performance benchmarking.
Input Parameters
Collect before starting:
- target:
railway|vercel(required) - production-url: The live production URL to monitor (required for baseline/canary/benchmark)
- environment:
production|staging(default:production)
Pipeline State
Create a tracker at .gstack/pipeline-deploy-{date}.md.
## Pipeline: Safe Deploy
Started: {timestamp}
Target: {target}
URL: {production-url}
Environment: {environment}
| # | Stage | Status | Gate | Notes |
|---|-------|--------|------|-------|
| 1 | PRE-DEPLOY | pending | — | — |
| 2 | BASELINE | pending | — | — |
| 3 | DEPLOY | pending | — | — |
| 4 | VERIFY | pending | — | — |
| 5 | REPORT | pending | — | — |
Stage 1: PRE-DEPLOY CHECKS (parallel)
Run security and operations critiques as parallel subagents:
1a: Security check
Dispatch a subagent to invoke /security-critique on the current branch diff:
- Focus on: secrets exposure, auth changes, new API endpoints, dependency vulnerabilities
- Scope: only changed files (
git diff main...HEAD --name-only)
1b: Operations check
Dispatch a subagent to invoke /operations-critique:
- Focus on: Dockerfile changes, CI/CD pipeline changes, infra config changes, env var changes
- Scope: only changed infra files
Gate: No Critical findings from either critique. High findings are warnings (noted but not blocking).
If Critical findings exist:
- Report them to the user
- Ask: "Critical issues found. Deploy anyway? (yes/no)"
- If no → STOP pipeline, update tracker → BLOCKED
- If yes → note the override in tracker, proceed
On pass: Update tracker → PASS.
Stage 2: BASELINE CAPTURE (parallel)
Capture the current production state before deploying:
2a: Canary baseline
Invoke /canary --baseline {production-url} to capture:
- Console error count per page
- Page load times
- Screenshots of key pages
2b: Performance baseline
Invoke /benchmark --baseline {production-url} to capture:
- Core Web Vitals (LCP, FID, CLS)
- Resource sizes and counts
- Load time per page
Both run as parallel subagents. Their outputs are saved to .gstack/canary-reports/baselines/ and .gstack/benchmark-reports/baselines/.
Gate: Baselines captured successfully. If production URL is unreachable, warn user and ask whether to skip baselines.
Stage 3: DEPLOY
Based on the target:
Railway
Invoke /railway-deploy:
- Links project if not linked
- Sets environment variables from
.envor.env.example - Runs
--dry-runbefore applying - Triggers build
- Waits for deployment to complete
- Runs HTTP health check on the production URL
Vercel
Invoke /vercel-deploy:
- Links project if not linked
- Configures environment variables
- Deploys (preview or production based on environment parameter)
- Waits for deployment to complete
Gate: Deployment successful. Health check passes (HTTP 200 on production URL).
If deployment fails:
- Report the error and deployment logs
- Update tracker → BLOCKED
- Do NOT proceed to verification — the old version is still live
On pass: Wait 30 seconds for the deployment to stabilize, then proceed.
Stage 4: VERIFY (parallel)
Run post-deploy verification as parallel subagents:
4a: Canary monitoring
Invoke /canary {production-url} --duration 5m:
- Monitors for new console errors
- Checks page load times against baseline
- Takes periodic screenshots
- Reports: HEALTHY / DEGRADED / BROKEN
4b: Performance benchmark
Invoke /benchmark {production-url} --diff:
- Compares current metrics against Stage 2 baseline
- Reports: regressions, improvements, unchanged
Gate:
- Canary verdict must be HEALTHY. DEGRADED triggers a warning. BROKEN triggers rollback discussion.
- Benchmark must show no REGRESSION (>50% slower or >500ms absolute increase).
If BROKEN or REGRESSION:
- Report the specific failures with evidence
- Ask: "Rollback to previous version? (yes/no/monitor-longer)"
- If rollback → provide the rollback command but do NOT execute without user confirmation
- If monitor-longer → re-run canary with --duration 10m
Stage 5: REPORT
Produce the deploy report:
## Deploy Report
Target: {target}
URL: {production-url}
Environment: {environment}
Date: {timestamp}
### Pre-Deploy
- Security: {grade} — {critical/high/medium/low counts}
- Operations: {grade} — {critical/high/medium/low counts}
- Overrides: {any critical findings overridden}
### Deployment
- Status: {SUCCESS/FAILED}
- Build time: {duration}
- Health check: {HTTP status}
### Post-Deploy Verification
- Canary: {HEALTHY/DEGRADED/BROKEN}
- Console errors: {baseline} → {current}
- Load time: {baseline} → {current}
- Benchmark: {PASS/WARNING/REGRESSION}
- LCP: {baseline} → {current}
- CLS: {baseline} → {current}
### Before/After Screenshots
{links to canary screenshots}
Persist
- Save report to
.gstack/deploy-reports/deploy-{target}-{date}.md
Final Pipeline Report
## Pipeline Report: Safe Deploy
Target: {target} | URL: {production-url}
Run: {timestamp}
Duration: {total elapsed}
| # | Stage | Skill(s) | Result | Gate | Duration |
|---|-------|----------|--------|------|----------|
| 1 | PRE-DEPLOY | security-critique, operations-critique | {result} | {gate} | {time} |
| 2 | BASELINE | canary, benchmark | {result} | Captured | {time} |
| 3 | DEPLOY | {deploy skill} | {result} | HTTP {status} | {time} |
| 4 | VERIFY | canary, benchmark | {result} | {verdict} | {time} |
| 5 | REPORT | — | PASS | Saved | {time} |
Overall: {PASS / PASS_WITH_WARNINGS / BLOCKED / ROLLBACK_RECOMMENDED}