Purpose & When-To-Use
Trigger conditions:
- New project needs CI/CD pipeline from scratch
- Migrating between CI/CD platforms
- Standardizing pipeline configurations across projects
- Adding missing stages (security, testing) to existing pipeline
- Tech stack change requires pipeline updates
Use this skill when you need a complete, platform-optimized CI/CD pipeline configuration file with build, test, security, and deploy stages.
Pre-Checks
Before execution, verify:
- Time normalization:
NOW_ET = 2025-10-26T01:33:56-04:00 (NIST/time.gov semantics, America/New_York)
- Input schema validation:
platform is one of: github-actions, gitlab-ci, jenkins, azure-devops
tech_stack contains valid language identifiers
stages object specifies at minimum: build and test configurations
- Source freshness: All cited sources accessed on
NOW_ET; verify documentation links current
- Platform access: Confirm target platform is available and licensed
Abort conditions:
- Platform is proprietary/undocumented with no public API reference
- Tech stack language not supported by target platform
- Conflicting stage requirements (e.g., parallel and sequential for same stage)
Procedure
Tier 1 (Fast Path, ≤2k tokens)
Token budget: ≤2k tokens
Scope: Generate basic CI/CD pipeline for common tech stacks with standard build, test, and deploy stages.
Steps:
Analyze inputs and select template (300 tokens):
- Determine platform format (YAML for GitHub Actions/GitLab, Groovy for Jenkins, YAML for Azure DevOps)
- Identify language-specific runners and dependencies
- Map stages to platform constructs (jobs, stages, steps)
Generate pipeline configuration (1700 tokens):
- Build stage: Install dependencies, compile/build artifacts
- Test stage: Run unit and integration tests with coverage
- Security stage: SAST scan, dependency vulnerability check
- Deploy stage: Push to registry or deploy to target environment
- Include dependency caching for performance
- Add matrix builds for multi-version testing if applicable
- Output pipeline file with inline comments
- Generate setup guide with required secrets and variables
Decision point: If requirements include multi-environment deployments, advanced security gates, or custom integrations → escalate to T2.
Tier 2 (Extended Analysis, ≤6k tokens)
Token budget: ≤6k tokens
Scope: Multi-environment pipelines with advanced security, approval gates, and performance optimization.
Steps:
Design multi-environment pipeline (2000 tokens):
- Configure environment-specific stages (dev, staging, production)
- Implement promotion gates with manual approvals
- Add environment-specific variables and secret management
- Configure conditional execution based on branch patterns
- GitHub Actions (accessed 2025-10-26T01:33:56-04:00): Use environments with protection rules
- GitLab CI (accessed 2025-10-26T01:33:56-04:00): Implement environment-specific jobs with deployment strategies
- Jenkins (accessed 2025-10-26T01:33:56-04:00): Use input steps for approvals and parameters for environments
- Azure DevOps (accessed 2025-10-26T01:33:56-04:00): Configure deployment stages with approval gates
Generate optimized configuration (4000 tokens):
- Advanced caching strategies (layer caching, dependency caching, build caching)
- Parallel job execution for independent stages
- Security hardening:
- SAST with SonarQube or Semgrep
- SCA with Snyk or Dependabot integration
- Secret scanning with git-secrets or TruffleHog
- Container image scanning with Trivy
- Testing integration:
- Unit, integration, and e2e test suites
- Code coverage reporting with quality gates (minimum 80%)
- Performance benchmarking
- Artifact management:
- Build artifact storage and versioning
- Container image tagging strategies
- Retention policies
- Notifications and reporting:
- Slack/Teams notifications for failures
- Status badges and dashboards
- Metrics collection (build time, success rate)
Sources cited (accessed 2025-10-26T01:33:56-04:00):
Tier 3 (Deep Dive, ≤12k tokens)
Token budget: ≤12k tokens
Scope: Enterprise-grade pipelines with compliance automation, custom plugins, and advanced orchestration.
Steps:
Enterprise compliance integration (4000 tokens):
- Policy-as-code validation (OPA, Sentinel) in pipeline
- Compliance artifact generation (SBOM, attestations, audit logs)
- Regulatory gate enforcement (SOC2, HIPAA, FedRAMP requirements)
- Signed commits and artifact signing with Cosign/Sigstore
Advanced orchestration (4000 tokens):
- Cross-pipeline dependencies and triggers
- Dynamic pipeline generation based on repository changes
- Custom plugin/action development for specialized tasks
- Pipeline-as-code templating and reusability patterns
- Multi-repository coordination (monorepo strategies)
Performance and reliability optimization (4000 tokens):
- Pipeline performance profiling and bottleneck analysis
- Retry logic and failure recovery strategies
- Resource optimization (runner sizing, autoscaling)
- Pipeline observability (metrics, logs, traces)
- Chaos engineering for pipeline resilience testing
Additional sources (accessed 2025-10-26T01:33:56-04:00):
Decision Rules
Platform selection guidance:
- GitHub Actions: GitHub-hosted projects, generous free tier, extensive marketplace
- GitLab CI: GitLab projects, integrated security scanning, robust Kubernetes support
- Jenkins: On-premise requirements, maximum flexibility, legacy system integration
- Azure DevOps: Microsoft ecosystem, enterprise compliance features
Stage configuration:
- Build: Always include dependency locking and caching
- Test: Fail fast on test failures; generate coverage reports
- Security: Block on critical vulnerabilities; allow warnings
- Deploy: Require manual approval for production
Escalation conditions:
- Custom compliance requirements not covered by standard tools
- Novel platform or unsupported tech stack combination
- Requirements exceed T3 scope (multi-cloud orchestration, custom tooling development)
Abort conditions:
- Platform limitations prevent required security controls
- Missing critical information and stakeholder unavailable
- Conflicting requirements (e.g., "zero approval gates" with "manual production approval")
Output Contract
Required outputs:
{
"pipeline_config": {
"type": "object",
"properties": {
"platform": "string (github-actions|gitlab-ci|jenkins|azure-devops)",
"file_path": "string (.github/workflows/ci.yml, .gitlab-ci.yml, Jenkinsfile)",
"content": "string (complete pipeline configuration)",
"language": "string (yaml|groovy)"
}
},
"setup_guide": {
"type": "markdown",
"properties": {
"secrets_required": ["array of secret names and descriptions"],
"variables_required": ["array of variable names and defaults"],
"setup_steps": "string (step-by-step setup instructions)"
}
}
}
Quality guarantees:
- Pipeline configuration is syntactically valid for target platform
- All secrets referenced but never hardcoded
- Required stages (build, test) are present and properly configured
- Caching is enabled for dependencies to improve performance
- Error handling and failure notifications configured
Examples
Example: GitHub Actions pipeline for Node.js application
# .github/workflows/ci.yml
name: CI Pipeline
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm run lint
- run: npm test -- --coverage
- run: npm run build
security-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
severity: 'CRITICAL,HIGH'
Quality Gates
Token budgets:
- T1: ≤2k tokens (basic single-environment pipeline)
- T2: ≤6k tokens (multi-environment with advanced security)
- T3: ≤12k tokens (enterprise compliance and orchestration)
Safety checks:
- No hardcoded secrets in generated configurations
- All external actions/dependencies pinned to specific versions
- Security scanning stages fail on critical vulnerabilities
- Minimum test coverage threshold enforced
Auditability:
- All pipeline runs logged with timestamps and triggering actor
- Approval gates record approver identity
- Generated configurations include inline documentation
Determinism:
- Same inputs produce identical pipeline configuration
- Dependency versions locked (package-lock.json, requirements.txt)
- Build environments use versioned base images
Resources
Official Documentation (accessed 2025-10-26T01:33:56-04:00):
Best Practices (accessed 2025-10-26T01:33:56-04:00):
Templates (in repository /resources/):
- GitHub Actions templates for Python, Node.js, Go, Java
- GitLab CI templates with security scanning
- Jenkins declarative pipeline examples
Source: williamzujkowski/cognitive-toolworks — distributed by TomeVault.
1---2name: cicd-pipeline-generator-23description: Setup instructions and required secrets Use when this capability is needed.4---56## Purpose & When-To-Use78**Trigger conditions:**910- New project needs CI/CD pipeline from scratch11- Migrating between CI/CD platforms12- Standardizing pipeline configurations across projects13- Adding missing stages (security, testing) to existing pipeline14- Tech stack change requires pipeline updates1516**Use this skill when** you need a complete, platform-optimized CI/CD pipeline configuration file with build, test, security, and deploy stages.1718---1920## Pre-Checks2122**Before execution, verify:**23241. **Time normalization**: `NOW_ET = 2025-10-26T01:33:56-04:00` (NIST/time.gov semantics, America/New_York)252. **Input schema validation**:26 - `platform` is one of: `github-actions`, `gitlab-ci`, `jenkins`, `azure-devops`27 - `tech_stack` contains valid language identifiers28 - `stages` object specifies at minimum: build and test configurations293. **Source freshness**: All cited sources accessed on `NOW_ET`; verify documentation links current304. **Platform access**: Confirm target platform is available and licensed3132**Abort conditions:**3334- Platform is proprietary/undocumented with no public API reference35- Tech stack language not supported by target platform36- Conflicting stage requirements (e.g., parallel and sequential for same stage)3738---3940## Procedure4142### Tier 1 (Fast Path, ≤2k tokens)4344**Token budget**: ≤2k tokens4546**Scope**: Generate basic CI/CD pipeline for common tech stacks with standard build, test, and deploy stages.4748**Steps:**49501. **Analyze inputs and select template** (300 tokens):51 - Determine platform format (YAML for GitHub Actions/GitLab, Groovy for Jenkins, YAML for Azure DevOps)52 - Identify language-specific runners and dependencies53 - Map stages to platform constructs (jobs, stages, steps)54552. **Generate pipeline configuration** (1700 tokens):56 - **Build stage**: Install dependencies, compile/build artifacts57 - **Test stage**: Run unit and integration tests with coverage58 - **Security stage**: SAST scan, dependency vulnerability check59 - **Deploy stage**: Push to registry or deploy to target environment60 - Include dependency caching for performance61 - Add matrix builds for multi-version testing if applicable62 - Output pipeline file with inline comments63 - Generate setup guide with required secrets and variables6465**Decision point**: If requirements include multi-environment deployments, advanced security gates, or custom integrations → escalate to T2.6667---6869### Tier 2 (Extended Analysis, ≤6k tokens)7071**Token budget**: ≤6k tokens7273**Scope**: Multi-environment pipelines with advanced security, approval gates, and performance optimization.7475**Steps:**76771. **Design multi-environment pipeline** (2000 tokens):78 - Configure environment-specific stages (dev, staging, production)79 - Implement promotion gates with manual approvals80 - Add environment-specific variables and secret management81 - Configure conditional execution based on branch patterns82 - **GitHub Actions** (accessed 2025-10-26T01:33:56-04:00): Use environments with protection rules83 - **GitLab CI** (accessed 2025-10-26T01:33:56-04:00): Implement environment-specific jobs with deployment strategies84 - **Jenkins** (accessed 2025-10-26T01:33:56-04:00): Use input steps for approvals and parameters for environments85 - **Azure DevOps** (accessed 2025-10-26T01:33:56-04:00): Configure deployment stages with approval gates86872. **Generate optimized configuration** (4000 tokens):88 - Advanced caching strategies (layer caching, dependency caching, build caching)89 - Parallel job execution for independent stages90 - Security hardening:91 - SAST with SonarQube or Semgrep92 - SCA with Snyk or Dependabot integration93 - Secret scanning with git-secrets or TruffleHog94 - Container image scanning with Trivy95 - Testing integration:96 - Unit, integration, and e2e test suites97 - Code coverage reporting with quality gates (minimum 80%)98 - Performance benchmarking99 - Artifact management:100 - Build artifact storage and versioning101 - Container image tagging strategies102 - Retention policies103 - Notifications and reporting:104 - Slack/Teams notifications for failures105 - Status badges and dashboards106 - Metrics collection (build time, success rate)107108**Sources cited** (accessed 2025-10-26T01:33:56-04:00):109110- **GitHub Actions**: https://docs.github.com/en/actions/deployment/targeting-different-environments111- **GitLab CI/CD**: https://docs.gitlab.com/ee/ci/yaml/112- **Jenkins Pipeline**: https://www.jenkins.io/doc/book/pipeline/syntax/113- **Azure DevOps Pipelines**: https://learn.microsoft.com/en-us/azure/devops/pipelines/114115---116117### Tier 3 (Deep Dive, ≤12k tokens)118119**Token budget**: ≤12k tokens120121**Scope**: Enterprise-grade pipelines with compliance automation, custom plugins, and advanced orchestration.122123**Steps:**1241251. **Enterprise compliance integration** (4000 tokens):126 - Policy-as-code validation (OPA, Sentinel) in pipeline127 - Compliance artifact generation (SBOM, attestations, audit logs)128 - Regulatory gate enforcement (SOC2, HIPAA, FedRAMP requirements)129 - Signed commits and artifact signing with Cosign/Sigstore1301312. **Advanced orchestration** (4000 tokens):132 - Cross-pipeline dependencies and triggers133 - Dynamic pipeline generation based on repository changes134 - Custom plugin/action development for specialized tasks135 - Pipeline-as-code templating and reusability patterns136 - Multi-repository coordination (monorepo strategies)1371383. **Performance and reliability optimization** (4000 tokens):139 - Pipeline performance profiling and bottleneck analysis140 - Retry logic and failure recovery strategies141 - Resource optimization (runner sizing, autoscaling)142 - Pipeline observability (metrics, logs, traces)143 - Chaos engineering for pipeline resilience testing144145**Additional sources** (accessed 2025-10-26T01:33:56-04:00):146147- **SLSA Framework**: https://slsa.dev/spec/v1.0/148- **Sigstore**: https://www.sigstore.dev/149- **OWASP CI/CD Security**: https://owasp.org/www-project-top-10-ci-cd-security-risks/150151---152153## Decision Rules154155**Platform selection guidance:**156157- **GitHub Actions**: GitHub-hosted projects, generous free tier, extensive marketplace158- **GitLab CI**: GitLab projects, integrated security scanning, robust Kubernetes support159- **Jenkins**: On-premise requirements, maximum flexibility, legacy system integration160- **Azure DevOps**: Microsoft ecosystem, enterprise compliance features161162**Stage configuration:**163164- **Build**: Always include dependency locking and caching165- **Test**: Fail fast on test failures; generate coverage reports166- **Security**: Block on critical vulnerabilities; allow warnings167- **Deploy**: Require manual approval for production168169**Escalation conditions:**170171- Custom compliance requirements not covered by standard tools172- Novel platform or unsupported tech stack combination173- Requirements exceed T3 scope (multi-cloud orchestration, custom tooling development)174175**Abort conditions:**176177- Platform limitations prevent required security controls178- Missing critical information and stakeholder unavailable179- Conflicting requirements (e.g., "zero approval gates" with "manual production approval")180181---182183## Output Contract184185**Required outputs:**186187```json188{189 "pipeline_config": {190 "type": "object",191 "properties": {192 "platform": "string (github-actions|gitlab-ci|jenkins|azure-devops)",193 "file_path": "string (.github/workflows/ci.yml, .gitlab-ci.yml, Jenkinsfile)",194 "content": "string (complete pipeline configuration)",195 "language": "string (yaml|groovy)"196 }197 },198 "setup_guide": {199 "type": "markdown",200 "properties": {201 "secrets_required": ["array of secret names and descriptions"],202 "variables_required": ["array of variable names and defaults"],203 "setup_steps": "string (step-by-step setup instructions)"204 }205 }206}207```208209**Quality guarantees:**210211- Pipeline configuration is syntactically valid for target platform212- All secrets referenced but never hardcoded213- Required stages (build, test) are present and properly configured214- Caching is enabled for dependencies to improve performance215- Error handling and failure notifications configured216217---218219## Examples220221**Example: GitHub Actions pipeline for Node.js application**222223```yaml224# .github/workflows/ci.yml225name: CI Pipeline226on:227 push:228 branches: [main, develop]229 pull_request:230 branches: [main]231232jobs:233 build-and-test:234 runs-on: ubuntu-latest235 steps:236 - uses: actions/checkout@v4237 - uses: actions/setup-node@v4238 with:239 node-version: '20'240 cache: 'npm'241 - run: npm ci242 - run: npm run lint243 - run: npm test -- --coverage244 - run: npm run build245246 security-scan:247 runs-on: ubuntu-latest248 steps:249 - uses: actions/checkout@v4250 - uses: aquasecurity/trivy-action@master251 with:252 scan-type: 'fs'253 severity: 'CRITICAL,HIGH'254```255256---257258## Quality Gates259260**Token budgets:**261262- **T1**: ≤2k tokens (basic single-environment pipeline)263- **T2**: ≤6k tokens (multi-environment with advanced security)264- **T3**: ≤12k tokens (enterprise compliance and orchestration)265266**Safety checks:**267268- No hardcoded secrets in generated configurations269- All external actions/dependencies pinned to specific versions270- Security scanning stages fail on critical vulnerabilities271- Minimum test coverage threshold enforced272273**Auditability:**274275- All pipeline runs logged with timestamps and triggering actor276- Approval gates record approver identity277- Generated configurations include inline documentation278279**Determinism:**280281- Same inputs produce identical pipeline configuration282- Dependency versions locked (package-lock.json, requirements.txt)283- Build environments use versioned base images284285---286287## Resources288289**Official Documentation** (accessed 2025-10-26T01:33:56-04:00):290291- GitHub Actions: https://docs.github.com/en/actions292- GitLab CI/CD: https://docs.gitlab.com/ee/ci/293- Jenkins Documentation: https://www.jenkins.io/doc/294- Azure DevOps Pipelines: https://learn.microsoft.com/en-us/azure/devops/pipelines/295296**Best Practices** (accessed 2025-10-26T01:33:56-04:00):297298- DORA Metrics: https://dora.dev/research/299- CI/CD Security: https://owasp.org/www-project-top-10-ci-cd-security-risks/300- Software Supply Chain: https://slsa.dev/301302**Templates** (in repository `/resources/`):303304- GitHub Actions templates for Python, Node.js, Go, Java305- GitLab CI templates with security scanning306- Jenkins declarative pipeline examples307308---309> Source: [williamzujkowski/cognitive-toolworks](https://github.com/williamzujkowski/cognitive-toolworks) — distributed by [TomeVault](https://tomevault.io).310<!-- tomevault:4.0:skill_md:2026-06-16 -->