src/orchestrator/skills/deployment-infrastructure/SKILL.md
Configures deployment pipelines, manages environment variables, schedules cron jobs, applies security headers, implements caching strategies. Use when working with Docker, Vercel, AWS, Dockerfile, nginx.conf, or platform deployment configs.
npx skillsauth add monkilabs/opencastle deployment-infrastructureInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
See deployment-config.md for full architecture, env vars, cron jobs, caching headers.
.env (defaults, committed) → .env.local (git-ignored) → .env.production / .env.preview → Platform-injected (highest).
import { z } from 'zod';
const envSchema = z.object({
DATABASE_URL: z.string().url(),
API_SECRET: z.string().min(32),
PUBLIC_SITE_URL: z.string().url(),
CRON_SECRET: z.string().min(16),
NODE_ENV: z.enum(['development', 'production', 'test']).default('development'),
});
export const env = envSchema.parse(process.env);
Prefix: PUBLIC_*/NEXT_PUBLIC_* (browser-safe), SECRET_*/*_SECRET (server-only). SCREAMING_SNAKE_CASE. Gitignore .env.local, .env.*.local.
Branch deployment: main → Production (auto) | feature/*, fix/* → Preview (auto)
Stages (in order): Install (--frozen-lockfile), Lint, Test (unit + integration + coverage), Build (production build), Deploy
Cron auth:
export async function GET(request: Request) {
const authHeader = request.headers.get('authorization');
if (authHeader !== `Bearer ${process.env.CRON_SECRET}`)
return new Response('Unauthorized', { status: 401 });
return Response.json({ ok: true });
}
| Asset Type | Cache-Control Header |
|---|---|
| Hashed static assets (JS, CSS) | public, max-age=31536000, immutable |
| Images / fonts | public, max-age=31536000, immutable |
| Favicon / manifest | public, max-age=86400 |
| HTML pages (SSG) | public, max-age=0, must-revalidate |
| API responses | private, no-cache |
| Prerendered pages (ISR) | public, s-maxage=3600, stale-while-revalidate=86400 |
Apply via framework headers() config or CDN rules.
Load security-hardening skill for full CSP inventory, header configuration.
git diff since last tag; verify no draft PRs
curl -sI https://example.com | grep -E 'HTTP|Strict' — smoke-test production URLs; monitor error rates
Prefer platform rollback (promote last good deploy). Fallback: git revert -m 1 HEAD Prefer platform rollback (promote last good deploy). Fallback: git revert -m 1 HEAD && git push.Prefer platform rollback (promote last good deploy). Fallback: git revert -m 1 HEAD && git push. git push.
curl -sI) → 3. Confirm 200 + correct behavior → 4. If still broken, escalate| Anti-Pattern | Fix |
|---|---|
| Hardcoding secrets | Env vars + Zod startup validation |
| Skipping preview deployments | Deploy every branch to preview |
| Cache-Control: no-store everywhere | Per-asset cache durations (see table) |
| Disabling security headers "temporarily" | Keep strict; document exceptions |
| Builds without --frozen-lockfile | Always use --frozen-lockfile in CI |
development
Defines 10 sequential validation gates: secret scanning, lint/test/build checks, blast radius analysis, dependency auditing, browser testing, cache management, regression checks, smoke tests. Use when running pre-deploy validation or CI checks, CI/CD pipelines, deployment pipeline validation, pre-merge checks, continuous integration, or pull request validation.
development
Generates test plans, writes unit/integration/E2E test files, identifies coverage gaps, flags common testing anti-patterns. Use when writing tests, creating test suites, planning test strategies, mocking dependencies, measuring code coverage, or test planning.
development
Provides model routing rules, validates delegation prerequisites, supplies cost tracking templates, defines dead-letter queue formats for Team Lead orchestration. Load when assigning tasks to agents, choosing model tiers, starting delegation session, running multi-agent workflow, delegating work, choosing which model to use, or assigning tasks.
testing
Saves, restores session state including task progress, file changes, delegation history. Use when saving progress, resuming interrupted work, picking up where you left off, or checkpointing current work.