Overview
CircleCI uses YAML-based .circleci/config.yml for CI/CD pipelines. Orbs provide reusable packages of jobs, commands, and executors. Workflows orchestrate jobs with dependency graphs.
Capabilities
- Job and workflow orchestration with dependency graphs
- Orbs for reusable CI components
- Workspace persistence between jobs
- Context-based secret management
- Dynamic config with setup workflows
- Matrix/parameterized builds
When to Use
Trigger phrases:
"circleci config"
"CircleCI configuration — workflows, jobs, orbs, caching, contexts, dynamic confi"
GitHub/GitLab repos needing fast CI/CD
Projects benefiting from orb ecosystem
Need matrix builds across multiple environments
Teams wanting managed CI with minimal setup
When NOT to Use
- Task is outside your authorization scope
- You need to implement controls (use implementing-* skills)
- Task is about analysis, not action (use analyzing-* skills)
- You don't have access to target systems
- Task requires compliance expertise (consult professionals)
- Task is about defense, not offense (use defensive skills)
Pseudo Code
The circleci-config workflow follows a standard pipeline pattern.
Core flow:
# circleci-config primary flow
input = prepare(raw_data)
result = process(input, config={caching, circleci, config, configuration, contexts})
validate(result)
deliver(result)
Error handling:
on error:
log(error_details)
retry_with_backoff(max=3)
if still_failing: alert_and_escalate()
Basic Pipeline
# .circleci/config.yml
version: 2.1
orbs:
node: circleci/node@6
docker: circleci/docker@25
jobs:
test:
executor:
name: node/default
tag: '20'
steps:
- checkout
- node/install-packages
- run: npm test
- run: npm run lint
build-and-push:
docker:
- image: cimg/base:current
steps:
- checkout
- setup_remote_docker:
version: default
- run: docker build -t $DOCKERHUB_USERNAME/app:$CIRCLE_SHA1 .
- run: echo $DOCKERHUB_PASS | docker login -u $DOCKERHUB_USERNAME --password-stdin
- run: docker push $DOCKERHUB_USERNAME/app:$CIRCLE_SHA1
workflows:
build-test-deploy:
jobs:
- test
- build-and-push:
context: docker-creds
requires:
- test
filters:
branches:
only: main
Matrix Builds
jobs:
test:
parameters:
node-version:
type: string
os:
type: executor
executor: << parameters.os >>
steps:
- checkout
- run: nvm use << parameters.node-version >>
- run: npm test
workflows:
matrix-test:
jobs:
- test:
matrix:
parameters:
node-version: ['18', '20', '22']
os: [linux, macos]
Dynamic Config
# .circleci/config.yml
setup: true
orbs:
path-filtering: circleci/path-filtering@1
workflows:
setup:
jobs:
- path-filtering/filter:
mapping: |
backend/.* backend-changed true
frontend/.* frontend-changed true
Common Patterns
- Caching:
save_cache/restore_cache with checksum keys
- Workspaces: persist files between jobs with
persist_to_workspace
- Contexts: share environment variables across projects
- Orbs: circleci/node, circleci/docker, circleci/aws-cli (install via
circleci orb pack)
How to Use
- Define infrastructure as code (Terraform, CloudFormation, Pulumi)
- Review changes through PR process before applying
- Configure monitoring and alerting for critical paths
- Set up secrets management (Vault, AWS Secrets Manager, etc.)
- Document runbooks for deployment, rollback, and incident response
- Test disaster recovery procedures regularly
Red Flags
- Infrastructure changes without review: Unreviewed changes cause outages — use PRs for infra code
- No rollback strategy: Every deployment needs a tested rollback plan before it runs
- Secrets in configuration files: Secrets in YAML/JSON get committed to version control
- Missing monitoring and alerting: Without monitoring, outages go undetected until users report them
- No documentation for runbooks: Without runbooks, on-call engineers waste time re-discovering procedures
Verification
Process
- Analyze the task requirements
- Apply domain expertise
- Verify output quality
Anti-Rationalization Table
| Rationalization |
Reality |
| "Manual deployments are fine" |
Manual deployments are error-prone and不可 repeatable. Automate. |
| "We do not need monitoring" |
Without monitoring, you are flying blind. Add observability from day one. |
| "Infrastructure as code is overkill" |
IaC enables reproducibility, version control, and disaster recovery. |
1---2name: circleci-config3description: Use when circleCI configuration — workflows, jobs, orbs, caching, contexts,4 dynamic config. Use when working with circleci config.5domain: devops6author: oyi777license: Apache-2.08subdomain: devops9tags:10- ci-cd11- circleci12- config13- devops14- infrastructure15- workflow16version: 1.0.017category: devops18metadata:19 source: https://skillmd.com/skills/oyi77/circleci-config20---21222324## Overview2526CircleCI uses YAML-based `.circleci/config.yml` for CI/CD pipelines. Orbs provide reusable packages of jobs, commands, and executors. Workflows orchestrate jobs with dependency graphs.2728## Capabilities2930- Job and workflow orchestration with dependency graphs31- Orbs for reusable CI components32- Workspace persistence between jobs33- Context-based secret management34- Dynamic config with setup workflows35- Matrix/parameterized builds3637## When to Use38**Trigger phrases:**39- "circleci config"40- "CircleCI configuration — workflows, jobs, orbs, caching, contexts, dynamic confi"414243- GitHub/GitLab repos needing fast CI/CD44- Projects benefiting from orb ecosystem45- Need matrix builds across multiple environments46- Teams wanting managed CI with minimal setup4748## When NOT to Use4950- Task is outside your authorization scope51- You need to implement controls (use implementing-* skills)52- Task is about analysis, not action (use analyzing-* skills)53- You don't have access to target systems54- Task requires compliance expertise (consult professionals)55- Task is about defense, not offense (use defensive skills)565758## Pseudo Code5960The circleci-config workflow follows a standard pipeline pattern.6162Core flow:63```64# circleci-config primary flow65input = prepare(raw_data)66result = process(input, config={caching, circleci, config, configuration, contexts})67validate(result)68deliver(result)69```7071Error handling:72```73on error:74 log(error_details)75 retry_with_backoff(max=3)76 if still_failing: alert_and_escalate()77```787980### Basic Pipeline81```yaml82# .circleci/config.yml83version: 2.18485orbs:86 node: circleci/node@687 docker: circleci/docker@258889jobs:90 test:91 executor:92 name: node/default93 tag: '20'94 steps:95 - checkout96 - node/install-packages97 - run: npm test98 - run: npm run lint99100 build-and-push:101 docker:102 - image: cimg/base:current103 steps:104 - checkout105 - setup_remote_docker:106 version: default107 - run: docker build -t $DOCKERHUB_USERNAME/app:$CIRCLE_SHA1 .108 - run: echo $DOCKERHUB_PASS | docker login -u $DOCKERHUB_USERNAME --password-stdin109 - run: docker push $DOCKERHUB_USERNAME/app:$CIRCLE_SHA1110111workflows:112 build-test-deploy:113 jobs:114 - test115 - build-and-push:116 context: docker-creds117 requires:118 - test119 filters:120 branches:121 only: main122```123124### Matrix Builds125```yaml126jobs:127 test:128 parameters:129 node-version:130 type: string131 os:132 type: executor133 executor: << parameters.os >>134 steps:135 - checkout136 - run: nvm use << parameters.node-version >>137 - run: npm test138139workflows:140 matrix-test:141 jobs:142 - test:143 matrix:144 parameters:145 node-version: ['18', '20', '22']146 os: [linux, macos]147```148149### Dynamic Config150```yaml151# .circleci/config.yml152setup: true153orbs:154 path-filtering: circleci/path-filtering@1155156workflows:157 setup:158 jobs:159 - path-filtering/filter:160 mapping: |161 backend/.* backend-changed true162 frontend/.* frontend-changed true163```164165## Common Patterns166167- **Caching**: `save_cache`/`restore_cache` with checksum keys168- **Workspaces**: persist files between jobs with `persist_to_workspace`169- **Contexts**: share environment variables across projects170- **Orbs**: circleci/node, circleci/docker, circleci/aws-cli (install via `circleci orb pack`)171172## How to Use1731741. Define infrastructure as code (Terraform, CloudFormation, Pulumi)1752. Review changes through PR process before applying1763. Configure monitoring and alerting for critical paths1774. Set up secrets management (Vault, AWS Secrets Manager, etc.)1785. Document runbooks for deployment, rollback, and incident response1796. Test disaster recovery procedures regularly180181## Red Flags182183- **Infrastructure changes without review**: Unreviewed changes cause outages — use PRs for infra code184- **No rollback strategy**: Every deployment needs a tested rollback plan before it runs185- **Secrets in configuration files**: Secrets in YAML/JSON get committed to version control186- **Missing monitoring and alerting**: Without monitoring, outages go undetected until users report them187- **No documentation for runbooks**: Without runbooks, on-call engineers waste time re-discovering procedures188189## Verification190191- [ ] Skill output matches expected behavior192193## Process1941951. Analyze the task requirements1962. Apply domain expertise1973. Verify output quality198199## Anti-Rationalization Table200201| Rationalization | Reality |202|---|---|203| "Manual deployments are fine" | Manual deployments are error-prone and不可 repeatable. Automate. |204| "We do not need monitoring" | Without monitoring, you are flying blind. Add observability from day one. |205| "Infrastructure as code is overkill" | IaC enables reproducibility, version control, and disaster recovery. |