From jaan-to
Generates CI/CD workflows, Dockerfiles, and deployment configs from tech.md tech stack definitions. Use when scaffolding infrastructure for new projects.
npx claudepluginhub parhumm/jaan-to --plugin jaan-toThis skill is limited to using the following tools:
> Generate CI/CD workflows, Dockerfiles, and deployment configs from tech.md — you can't ship what you can't deploy.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Generate CI/CD workflows, Dockerfiles, and deployment configs from tech.md — you can't ship what you can't deploy.
$JAAN_CONTEXT_DIR/tech.md - Tech stack context (CRITICAL -- determines framework, services, deployment target)
#current-stack, #frameworks, #constraints, #versioning$JAAN_CONTEXT_DIR/config.md - Project configuration$JAAN_TEMPLATES_DIR/jaan-to-devops-infra-scaffold.template.md - Output template$JAAN_LEARN_DIR/jaan-to-devops-infra-scaffold.learn.md - Past lessons (loaded in Pre-Execution)${CLAUDE_PLUGIN_ROOT}/docs/extending/language-protocol.md - Language resolution protocol${CLAUDE_PLUGIN_ROOT}/docs/research/74-dev-cicd-infra-scaffold-generation.md - Research referenceUpstream Artifacts: $ARGUMENTS
Accepts file paths or descriptions:
$JAAN_CONTEXT_DIR/tech.md)/jaan-to:backend-scaffold)/jaan-to:frontend-scaffold)/jaan-to:detect-dev)MANDATORY — Read and execute ALL steps in: ${CLAUDE_PLUGIN_ROOT}/docs/extending/pre-execution-protocol.md
Skill name: devops-infra-scaffold
Execute: Step 0 (Init Guard) → A (Load Lessons) → B (Resolve Template) → C (Offer Template Seeding)
Also read context files if available:
$JAAN_CONTEXT_DIR/tech.md -- Know the tech stack for framework-specific infrastructure generation$JAAN_CONTEXT_DIR/config.md -- Project configurationRead and apply language protocol: ${CLAUDE_PLUGIN_ROOT}/docs/extending/language-protocol.md
Override field for this skill: language_devops-infra-scaffold
Language exception: Generated code output (Dockerfiles, YAML workflows, shell scripts, .env files, deployment configs) is NOT affected by this setting and remains in English/code.
ultrathink
Use extended reasoning for:
Read and parse all available inputs:
tech.md -- Extract from #current-stack:
backend-scaffold output -- Extract:
frontend-scaffold output -- Extract:
detect-dev output (optional) -- Extract:
Present input summary:
INPUT SUMMARY
-------------
Tech Stack: {framework} + {database} + {cache}
Package Manager: {package_manager}
Monorepo: {monorepo_tool or "no"}
Backend Entry: {entry_point}
Frontend Build: {build_tool / output_mode}
Existing CI/CD: {found / none}
Sources Found: {list}
Sources Missing: {list with fallback suggestions}
AskUserQuestion for items not derivable from inputs:
Based on tech stack + decisions, plan the complete infrastructure scaffold:
INFRASTRUCTURE PLAN
===================
CI/CD PLATFORM: {platform}
DEPLOYMENT: {target}
REGISTRY: {registry}
ENVIRONMENTS: {list}
OUTPUT STRUCTURE
----------------
{id}-{slug}/
+-- {id}-{slug}.md # Infrastructure guide
+-- ci/
| +-- ci.yml # CI workflow (lint, type-check, test, build)
| +-- cd.yml # CD workflow (deploy to environments)
| +-- health-check.yml # Health monitoring (cron, 15-min interval)
| +-- secret-rotation-reminder.yml # Secret rotation reminder (quarterly)
+-- docker/
| +-- Dockerfile.backend # Multi-stage backend build
| +-- Dockerfile.frontend # Multi-stage frontend build
| +-- docker-compose.yml # Full-stack dev environment
| +-- docker-compose.prod.yml # Production overrides
| +-- .dockerignore # Build context exclusions
+-- config/
| +-- .env.example # All variables with safe defaults
| +-- .env.test # Test environment variables
| +-- .env.production.example # Production template (no secrets)
| +-- next.config.standalone.ts # Next.js standalone config (if Next.js detected)
+-- deploy/
| +-- {platform}.yml # Platform-specific config
| +-- migration.sh # Database migration script
+-- {id}-{slug}-readme.md # Setup + deployment instructions
PIPELINE STAGES
---------------
CI: {stage_list}
CD: {stage_list}
Docker Stages: {stage_list}
Services: {service_list}
Report any conflicts or missing information.
Use AskUserQuestion:
Do NOT proceed to Phase 2 without explicit approval.
All files in $JAAN_OUTPUTS_DIR/devops/infra-scaffold/{id}-{slug}/:
{id}-{slug}/
+-- {id}-{slug}.md # Main doc (infrastructure guide)
+-- ci/
| +-- ci.yml # GitHub Actions CI workflow
| +-- cd.yml # GitHub Actions CD workflow
| +-- health-check.yml # Health monitoring (cron, 15-min interval)
| +-- secret-rotation-reminder.yml # Secret rotation reminder (quarterly)
+-- docker/
| +-- Dockerfile.backend # Multi-stage backend Dockerfile
| +-- Dockerfile.frontend # Multi-stage frontend Dockerfile
| +-- docker-compose.yml # Development docker-compose
| +-- docker-compose.prod.yml # Production overrides (optional)
| +-- .dockerignore # Build context exclusions
+-- config/
| +-- .env.example # All env vars with safe defaults
| +-- .env.test # Test environment config
| +-- .env.production.example # Production template (no secrets)
| +-- next.config.standalone.ts # Next.js standalone config (if Next.js detected)
+-- deploy/
| +-- {platform}.yml # Deployment platform config
| +-- migration.sh # Database migration script
+-- {id}-{slug}-readme.md # Setup + deployment instructions
Generate GitHub Actions CI workflow with these stages:
dorny/paths-filter@v3 for monorepo path filteringtsc --noEmit (TypeScript), PHPStan (PHP), go vet (Go)pnpm audit / npm auditCaching strategy:
actions/setup-node@v4 (or equivalent)actions/cache@v4 (Next.js .next/cache, TypeScript tsbuildinfo)docker/build-push-action@v5 with cache-from: type=ghaKey patterns from research:
fail-fast: false for matrix buildsretention-days: 1 for ephemeral build artifactsWhen tech.md #current-stack indicates pnpm as package manager, check the project's package.json for a packageManager field:
packageManager field exists (e.g., "packageManager": "pnpm@9.x.x"): Use pnpm/action-setup@v4 without the version parameter — the action reads version from package.json automatically. Explicit version causes ERR_PNPM_BAD_PM_VERSION.packageManager field is absent: Use pnpm/action-setup@v4 with explicit version parameter.Applies to both ci.yml and cd.yml.
Generate deployment workflow triggered on:
main -- Deploy to productiondevelop -- Deploy to staging (if configured)Stages:
Environment protection:
Generate these stages ONLY if relevant config/spec is detected in the project. Each stage checks tool availability using npx --no-install (npm tools) or direct --version (binary tools). Never use bare npx (auto-installs). Never use which.
Glob for *.yaml/*.json matching OpenAPI patterns (openapi:, swagger:). If found:
- name: API Spec Lint (Spectral)
run: npx --no-install @stoplight/spectral-cli lint api.yaml --ruleset .spectral.yaml
.spectral.yaml existsIf project has a baseline OpenAPI spec (e.g., api.yaml tracked in git):
- name: API Breaking Changes (oasdiff)
uses: oasdiff/oasdiff-action@{pinned-sha}
with:
base: api.yaml
revision: api.yaml
fail-on: ERR
oasdiff/oasdiff-action pinned to immutable commit SHA (never @latest).oasdiff breaking --fail-on ERR base.yaml head.yamlGlob for mutation configs: stryker.config.*, infection.json5, .mutmut-cache. If found:
# PR: incremental (changed files only)
- name: Mutation Testing (Incremental)
if: github.event_name == 'pull_request'
run: npx stryker run --incremental
# Nightly: full run
- name: Mutation Testing (Full)
if: github.event_name == 'schedule'
run: npx stryker run
If OpenAPI spec detected AND deployment target configured:
- name: API Fuzz Testing (Schemathesis)
run: schemathesis run --url ${{ vars.API_URL }} api.yaml --stateful=links
Each stage above MUST include a preflight check before execution:
npx --no-install @stoplight/spectral-cli --version for Spectraloasdiff --version for oasdiff (binary, not npm)npx --no-install stryker --version for StrykerJS (adapt per stack)schemathesis --version for SchemathesisIf tool unavailable: skip stage with explicit comment in generated workflow, never silently omit.
Platform conditional: Skip this step when CI platform is GitLab CI.
Generate a scheduled health monitoring workflow:
*/15 * * * *) + workflow_dispatch for manual testingcurl with 30s timeout against configurable endpointsvars.API_URL, vars.WEB_URL) — not secretsactions/github-script (pinned by SHA) creates issue with incident labelincident label before creating — skip if duplicate existsPlatform conditional: Skip this step when CI platform is GitLab CI.
Generate a quarterly secret rotation reminder workflow:
0 9 1 1,4,7,10 * (Jan/Apr/Jul/Oct, 9 AM UTC)actions/github-script (pinned by SHA) creates issue with security + maintenance labels.env.example / .env.production.example:
Reference: See
${CLAUDE_PLUGIN_ROOT}/docs/extending/devops-infra-scaffold-reference.mdsection "Dockerfile Generation Patterns" for per-stack Dockerfile patterns (backend, frontend, .dockerignore).
When tech.md #current-stack indicates Next.js and generating Dockerfile.frontend with standalone COPY stage:
next.config.ts (or .js/.mjs) already has output: 'standalone'config/next.config.standalone.ts reference snippet showing the required configoutput: 'standalone' in next.config.ts — required for Docker multi-stage build"Full-stack development environment with:
Services (based on tech.md):
pg_isready)mysqladmin ping)redis-cli ping)Patterns from research:
condition: service_healthy for all depends_onnode_modules--profile backend, --profile full).env filedocker-compose.prod.yml (optional overlay):
Reference: See
${CLAUDE_PLUGIN_ROOT}/docs/extending/devops-infra-scaffold-reference.mdsection "Environment Config File Templates" for.env.example,.env.test, and.env.production.exampletemplates.
Generate three env config files based on the templates in the reference, customized to the detected tech stack and services from tech.md.
Based on selected deployment target:
Reference: See
${CLAUDE_PLUGIN_ROOT}/docs/extending/devops-infra-scaffold-reference.mdsection "Deployment Platform Configurations" for Vercel, Railway, Fly.io, AWS ECS configs and migration.sh.
Reference: See
${CLAUDE_PLUGIN_ROOT}/docs/extending/devops-infra-scaffold-reference.mdsection "Quality Checklist" for the full validation checklist.
Validate generated output against the quality checklist and output structure checklist in the reference. If any check fails, fix before preview.
Present generated output summary showing:
Use AskUserQuestion:
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/id-generator.sh"
SUBDOMAIN_DIR="$JAAN_OUTPUTS_DIR/devops/infra-scaffold"
mkdir -p "$SUBDOMAIN_DIR"
NEXT_ID=$(generate_next_id "$SUBDOMAIN_DIR")
slug="{project-name-slug}"
OUTPUT_FOLDER="${SUBDOMAIN_DIR}/${NEXT_ID}-${slug}"
Preview output configuration:
Output Configuration
- ID: {NEXT_ID}
- Folder:
$JAAN_OUTPUTS_DIR/devops/infra-scaffold/{NEXT_ID}-{slug}/- Main file:
{NEXT_ID}-{slug}.md
mkdir -p "$OUTPUT_FOLDER"
mkdir -p "$OUTPUT_FOLDER/ci"
mkdir -p "$OUTPUT_FOLDER/docker"
mkdir -p "$OUTPUT_FOLDER/config"
mkdir -p "$OUTPUT_FOLDER/deploy"
Write all files to respective subfolders:
{id}-{slug}.md -- Main infrastructure guide (from template)ci/ci.yml -- CI workflowci/cd.yml -- CD workflowci/health-check.yml -- Health monitoring workflow (GitHub Actions only)ci/secret-rotation-reminder.yml -- Secret rotation reminder (GitHub Actions only)docker/Dockerfile.backend -- Backend Dockerfiledocker/Dockerfile.frontend -- Frontend Dockerfiledocker/docker-compose.yml -- Dev docker-composedocker/docker-compose.prod.yml -- Production overrides (if applicable)docker/.dockerignore -- Build context exclusionsconfig/.env.example -- All env varsconfig/.env.test -- Test env varsconfig/.env.production.example -- Production templateconfig/next.config.standalone.ts -- Next.js standalone config (if Next.js detected)deploy/{platform}.yml -- Deployment configdeploy/migration.sh -- Migration script{id}-{slug}-readme.md -- Setup + deployment instructionsUpdate subdomain index:
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/index-updater.sh"
add_to_index \
"$SUBDOMAIN_DIR/README.md" \
"$NEXT_ID" \
"${NEXT_ID}-${slug}" \
"{Project Title} Infrastructure" \
"{Executive summary -- 1-2 sentences}"
Scaffold written to:
$JAAN_OUTPUTS_DIR/devops/infra-scaffold/{NEXT_ID}-{slug}/Index updated:$JAAN_OUTPUTS_DIR/devops/infra-scaffold/README.md
Infrastructure scaffold generated successfully!
Next Steps:
- Copy CI/CD workflows to
.github/workflows/- Copy Dockerfiles and docker-compose to project root
- Copy
.env.exampleto project root and create.envfrom it- Copy deployment config to project root
- Run
docker compose upto verify local development environment- Push a branch to test CI workflow
- Configure endpoint repository variables (
API_URL,WEB_URL) for health monitoring workflow- Verify
output: 'standalone'innext.config.ts(if using Next.js Docker build)- Run
/jaan-to:sec-audit-remediateto audit security of generated configs- Run
/jaan-to:learn-add devops-infra-scaffold "{feedback}"to capture lessons
Use AskUserQuestion:
If "Learn from this": Run /jaan-to:learn-add devops-infra-scaffold "{feedback}"
Reference: See
${CLAUDE_PLUGIN_ROOT}/docs/extending/devops-infra-scaffold-reference.mdsection "Multi-Stack Infrastructure Patterns" for detection table and per-stack key patterns (Node.js, PHP/Laravel, Go).
Reference: See
${CLAUDE_PLUGIN_ROOT}/docs/extending/devops-infra-scaffold-reference.mdsection "Security Best Practices" for full security checklist applied to all generated files.
tech.md + backend-scaffold + frontend-scaffold + detect-dev (optional)
|
v
devops-infra-scaffold
$JAAN_OUTPUTS_DIR pathReference: See
${CLAUDE_PLUGIN_ROOT}/docs/extending/devops-infra-scaffold-reference.mdsection "Definition of Done" for the full checklist.