[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F0CEMJYSJ3P5VGZW9E2N53":3,"skill-same:01M7F0CEMJYSJ3P5VGZW9E2N53":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":14,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7F0CEMJYSJ3P5VGZW9E2N53","gitlab-ci-patterns",null,"Build GitLab CI\u002FCD pipelines with multi-stage workflows, caching, and distributed runners for scalable automation. Use when implementing GitLab CI\u002FCD, optimizing pipeline performance, or setting up automated testing and deployment.","shotcowboystyle\u002Fag-skills","shotcowboystyle","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F62471?v=4","01M7EZTCFCZJ6K3MYW8BPM4X6R","Curtis Blanton","01M7EZTCG1S5M04J90A931X9BX",0,"MIT","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fcicd-automation\u002Fskills\u002Fgitlab-ci-patterns\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: gitlab-ci-patterns\ndescription: Build GitLab CI\u002FCD pipelines with multi-stage workflows, caching, and distributed runners for scalable automation. Use when implementing GitLab CI\u002FCD, optimizing pipeline performance, or setting up automated testing and deployment.\nlast_verified: 2026-10-20\n---\n\n# GitLab CI Patterns\n\nPipeline patterns for building, testing, scanning and deploying with GitLab CI\u002FCD.\n\n## Rules that keep examples runnable\n\n1. **Use `rules:`**, not `only:`\u002F`except:` (deprecated, and they can't be mixed with `rules:`).\n2. **Override tool-image entrypoints.** `hashicorp\u002Fterraform`, `aquasec\u002Ftrivy` and\n   similar images set `ENTRYPOINT` to the tool, so the runner's shell script fails. Add\n   `entrypoint: [\"\"]`.\n3. **Keep `before_script` inside a template.** A top-level `before_script` runs in every\n   job, including ones that use a different image.\n4. **Secrets never reach the command line.** Use `--password-stdin`, masked and protected\n   variables, and `id_tokens` (JWT) for Vault or cloud auth. Cluster access goes through\n   the GitLab agent for Kubernetes, not a stored token.\n5. **Scans that must block don't set `allow_failure: true`.**\n6. Confirm with the user before adding jobs that deploy or run `terraform apply`.\n\n## Basic pipeline\n\n```yaml\nstages: [build, test, deploy]\n\nbuild:\n  stage: build\n  image: node:24\n  script:\n    - npm ci\n    - npm run build\n  cache:\n    key: { files: [package-lock.json] }\n    paths: [.npm\u002F]\n  variables:\n    npm_config_cache: .npm\n  artifacts:\n    paths: [dist\u002F]\n    expire_in: 1 hour\n\ntest:\n  stage: test\n  image: node:24\n  script:\n    - npm ci\n    - npm run lint\n    - npm test\n  coverage: '\u002FLines\\s*:\\s*(\\d+\\.\\d+)%\u002F'\n  artifacts:\n    reports:\n      coverage_report:\n        coverage_format: cobertura\n        path: coverage\u002Fcobertura-coverage.xml\n\ndeploy:\n  stage: deploy\n  image:\n    name: alpine\u002Fk8s:1.37.1 # bitnami\u002Fkubectl left the free catalog\n    entrypoint: [\"\"]\n  script:\n    - kubectl config use-context my-group\u002Fmy-agent-project:production\n    - kubectl apply -f k8s\u002F\n    - kubectl rollout status deployment\u002Fmy-app --timeout=5m\n  environment:\n    name: production\n    url: https:\u002F\u002Fapp.example.com\n  rules:\n    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH\n```\n\n`kubectl config use-context \u003Cagent-project-path>:\u003Cagent-name>` works once a GitLab agent\nfor Kubernetes is installed in the cluster and authorizes this project. The runner gets\na short-lived kubeconfig; no cluster token is stored in CI variables.\n\n## Docker build and push\n\n```yaml\nbuild-image:\n  stage: build\n  image: docker:29\n  services: [docker:29-dind]\n  variables:\n    DOCKER_TLS_CERTDIR: \"\u002Fcerts\"\n  before_script:\n    - printf '%s' \"$CI_REGISTRY_PASSWORD\" | docker login -u \"$CI_REGISTRY_USER\" --password-stdin \"$CI_REGISTRY\"\n  script:\n    - docker build -t \"$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA\" .\n    - docker push \"$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA\"\n  rules:\n    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH\n    - if: $CI_COMMIT_TAG\n```\n\n## Multi-environment deployment\n\n```yaml\n.deploy:\n  stage: deploy\n  image:\n    name: alpine\u002Fk8s:1.37.1\n    entrypoint: [\"\"]\n  before_script:\n    - kubectl config use-context \"my-group\u002Fmy-agent-project:$KUBE_AGENT\"\n  script:\n    - kubectl apply -f k8s\u002F -n \"$CI_ENVIRONMENT_NAME\"\n    - kubectl rollout status deployment\u002Fmy-app -n \"$CI_ENVIRONMENT_NAME\" --timeout=5m\n\ndeploy:staging:\n  extends: .deploy\n  variables: { KUBE_AGENT: staging }\n  environment: { name: staging, url: https:\u002F\u002Fstaging.example.com }\n  rules:\n    - if: $CI_COMMIT_BRANCH == \"develop\"\n\ndeploy:production:\n  extends: .deploy\n  variables: { KUBE_AGENT: production }\n  environment: { name: production, url: https:\u002F\u002Fapp.example.com }\n  rules:\n    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH\n      when: manual\n```\n\nMark `production` as a protected environment so only allowed users can run the job.\n\n## Terraform pipeline\n\n```yaml\nstages: [validate, plan, apply]\n\nvariables:\n  TF_ROOT: ${CI_PROJECT_DIR}\u002Fterraform\n\n.terraform:\n  image:\n    name: hashicorp\u002Fterraform:1.16\n    entrypoint: [\"\"]\n  before_script:\n    - cd \"$TF_ROOT\"\n    - terraform init -input=false\n\nvalidate:\n  extends: .terraform\n  stage: validate\n  before_script:\n    - cd \"$TF_ROOT\"\n    - terraform init -backend=false -input=false\n  script:\n    - terraform fmt -check\n    - terraform validate\n\nplan:\n  extends: .terraform\n  stage: plan\n  script:\n    - terraform plan -input=false -out=tfplan\n  artifacts:\n    paths: [terraform\u002Ftfplan]\n    access: developer # the plan file can hold sensitive values\n    expire_in: 1 day\n\napply:\n  extends: .terraform\n  stage: apply\n  needs: [plan]\n  script:\n    - terraform apply -input=false tfplan\n  environment: { name: production }\n  rules:\n    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH\n      when: manual\n```\n\n## Security scanning (blocking)\n\n```yaml\ninclude:\n  - template: Jobs\u002FSAST.gitlab-ci.yml\n  - template: Jobs\u002FDependency-Scanning.gitlab-ci.yml\n  - template: Jobs\u002FSecret-Detection.gitlab-ci.yml\n\ntrivy-image:\n  stage: test\n  needs: [build-image]\n  image:\n    name: aquasec\u002Ftrivy:0.76.0\n    entrypoint: [\"\"]\n  variables:\n    TRIVY_USERNAME: $CI_REGISTRY_USER\n    TRIVY_PASSWORD: $CI_REGISTRY_PASSWORD\n  script:\n    - trivy image --exit-code 1 --severity HIGH,CRITICAL \"$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA\"\n```\n\n`--exit-code 1` fails the job on a finding; adding `allow_failure: true` would turn that\nback into a warning. For TruffleHog, see `secrets-management`.\n\n## Caching\n\n```yaml\nbuild:\n  cache:\n    - key: { files: [package-lock.json] } # changes only when deps change\n      paths: [.npm\u002F]\n      policy: pull-push\n\nlint:\n  cache:\n    - key: { files: [package-lock.json] }\n      paths: [.npm\u002F]\n      policy: pull # read-only; don't re-upload\n```\n\n## Dynamic child pipelines\n\n```yaml\ngenerate-pipeline:\n  stage: build\n  script:\n    - python generate_pipeline.py > child-pipeline.yml\n  artifacts:\n    paths: [child-pipeline.yml]\n\ntrigger-child:\n  stage: deploy\n  trigger:\n    include:\n      - artifact: child-pipeline.yml\n        job: generate-pipeline\n    strategy: depend\n```\n\n## Related Skills\n\n- `github-actions-templates` - For GitHub Actions\n- `deployment-pipeline-design` - For architecture\n- `secrets-management` - For secrets handling\n","# GitLab CI Patterns\n\nPipeline patterns for building, testing, scanning and deploying with GitLab CI\u002FCD.\n\n## Rules that keep examples runnable\n\n1. **Use `rules:`**, not `only:`\u002F`except:` (deprecated, and they can't be mixed with `rules:`).\n2. **Override tool-image entrypoints.** `hashicorp\u002Fterraform`, `aquasec\u002Ftrivy` and\n   similar images set `ENTRYPOINT` to the tool, so the runner's shell script fails. Add\n   `entrypoint: [\"\"]`.\n3. **Keep `before_script` inside a template.** A top-level `before_script` runs in every\n   job, including ones that use a different image.\n4. **Secrets never reach the command line.** Use `--password-stdin`, masked and protected\n   variables, and `id_tokens` (JWT) for Vault or cloud auth. Cluster access goes through\n   the GitLab agent for Kubernetes, not a stored token.\n5. **Scans that must block don't set `allow_failure: true`.**\n6. Confirm with the user before adding jobs that deploy or run `terraform apply`.\n\n## Basic pipeline\n\n```yaml\nstages: [build, test, deploy]\n\nbuild:\n  stage: build\n  image: node:24\n  script:\n    - npm ci\n    - npm run build\n  cache:\n    key: { files: [package-lock.json] }\n    paths: [.npm\u002F]\n  variables:\n    npm_config_cache: .npm\n  artifacts:\n    paths: [dist\u002F]\n    expire_in: 1 hour\n\ntest:\n  stage: test\n  image: node:24\n  script:\n    - npm ci\n    - npm run lint\n    - npm test\n  coverage: '\u002FLines\\s*:\\s*(\\d+\\.\\d+)%\u002F'\n  artifacts:\n    reports:\n      coverage_report:\n        coverage_format: cobertura\n        path: coverage\u002Fcobertura-coverage.xml\n\ndeploy:\n  stage: deploy\n  image:\n    name: alpine\u002Fk8s:1.37.1 # bitnami\u002Fkubectl left the free catalog\n    entrypoint: [\"\"]\n  script:\n    - kubectl config use-context my-group\u002Fmy-agent-project:production\n    - kubectl apply -f k8s\u002F\n    - kubectl rollout status deployment\u002Fmy-app --timeout=5m\n  environment:\n    name: production\n    url: https:\u002F\u002Fapp.example.com\n  rules:\n    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH\n```\n\n`kubectl config use-context \u003Cagent-project-path>:\u003Cagent-name>` works once a GitLab agent\nfor Kubernetes is installed in the cluster and authorizes this project. The runner gets\na short-lived kubeconfig; no cluster token is stored in CI variables.\n\n## Docker build and push\n\n```yaml\nbuild-image:\n  stage: build\n  image: docker:29\n  services: [docker:29-dind]\n  variables:\n    DOCKER_TLS_CERTDIR: \"\u002Fcerts\"\n  before_script:\n    - printf '%s' \"$CI_REGISTRY_PASSWORD\" | docker login -u \"$CI_REGISTRY_USER\" --password-stdin \"$CI_REGISTRY\"\n  script:\n    - docker build -t \"$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA\" .\n    - docker push \"$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA\"\n  rules:\n    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH\n    - if: $CI_COMMIT_TAG\n```\n\n## Multi-environment deployment\n\n```yaml\n.deploy:\n  stage: deploy\n  image:\n    name: alpine\u002Fk8s:1.37.1\n    entrypoint: [\"\"]\n  before_script:\n    - kubectl config use-context \"my-group\u002Fmy-agent-project:$KUBE_AGENT\"\n  script:\n    - kubectl apply -f k8s\u002F -n \"$CI_ENVIRONMENT_NAME\"\n    - kubectl rollout status deployment\u002Fmy-app -n \"$CI_ENVIRONMENT_NAME\" --timeout=5m\n\ndeploy:staging:\n  extends: .deploy\n  variables: { KUBE_AGENT: staging }\n  environment: { name: staging, url: https:\u002F\u002Fstaging.example.com }\n  rules:\n    - if: $CI_COMMIT_BRANCH == \"develop\"\n\ndeploy:production:\n  extends: .deploy\n  variables: { KUBE_AGENT: production }\n  environment: { name: production, url: https:\u002F\u002Fapp.example.com }\n  rules:\n    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH\n      when: manual\n```\n\nMark `production` as a protected environment so only allowed users can run the job.\n\n## Terraform pipeline\n\n```yaml\nstages: [validate, plan, apply]\n\nvariables:\n  TF_ROOT: ${CI_PROJECT_DIR}\u002Fterraform\n\n.terraform:\n  image:\n    name: hashicorp\u002Fterraform:1.16\n    entrypoint: [\"\"]\n  before_script:\n    - cd \"$TF_ROOT\"\n    - terraform init -input=false\n\nvalidate:\n  extends: .terraform\n  stage: validate\n  before_script:\n    - cd \"$TF_ROOT\"\n    - terraform init -backend=false -input=false\n  script:\n    - terraform fmt -check\n    - terraform validate\n\nplan:\n  extends: .terraform\n  stage: plan\n  script:\n    - terraform plan -input=false -out=tfplan\n  artifacts:\n    paths: [terraform\u002Ftfplan]\n    access: developer # the plan file can hold sensitive values\n    expire_in: 1 day\n\napply:\n  extends: .terraform\n  stage: apply\n  needs: [plan]\n  script:\n    - terraform apply -input=false tfplan\n  environment: { name: production }\n  rules:\n    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH\n      when: manual\n```\n\n## Security scanning (blocking)\n\n```yaml\ninclude:\n  - template: Jobs\u002FSAST.gitlab-ci.yml\n  - template: Jobs\u002FDependency-Scanning.gitlab-ci.yml\n  - template: Jobs\u002FSecret-Detection.gitlab-ci.yml\n\ntrivy-image:\n  stage: test\n  needs: [build-image]\n  image:\n    name: aquasec\u002Ftrivy:0.76.0\n    entrypoint: [\"\"]\n  variables:\n    TRIVY_USERNAME: $CI_REGISTRY_USER\n    TRIVY_PASSWORD: $CI_REGISTRY_PASSWORD\n  script:\n    - trivy image --exit-code 1 --severity HIGH,CRITICAL \"$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA\"\n```\n\n`--exit-code 1` fails the job on a finding; adding `allow_failure: true` would turn that\nback into a warning. For TruffleHog, see `secrets-management`.\n\n## Caching\n\n```yaml\nbuild:\n  cache:\n    - key: { files: [package-lock.json] } # changes only when deps change\n      paths: [.npm\u002F]\n      policy: pull-push\n\nlint:\n  cache:\n    - key: { files: [package-lock.json] }\n      paths: [.npm\u002F]\n      policy: pull # read-only; don't re-upload\n```\n\n## Dynamic child pipelines\n\n```yaml\ngenerate-pipeline:\n  stage: build\n  script:\n    - python generate_pipeline.py > child-pipeline.yml\n  artifacts:\n    paths: [child-pipeline.yml]\n\ntrigger-child:\n  stage: deploy\n  trigger:\n    include:\n      - artifact: child-pipeline.yml\n        job: generate-pipeline\n    strategy: depend\n```\n\n## Related Skills\n\n- `github-actions-templates` - For GitHub Actions\n- `deployment-pipeline-design` - For architecture\n- `secrets-management` - For secrets handling\n",{"name":5,"description":7,"last_verified":24},1792454400000,"main","f846d9a97082ff30d613b55a085cef425d822473","plugins\u002Fcicd-automation\u002Fskills\u002Fgitlab-ci-patterns","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle","https:\u002F\u002Fshotcowboystyle.github.io","Building smarter with AI, automation & modern tools. Exploring how far one person can go without a big team using today’s AI.","2026-11-10 04:58:27",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add shotcowboystyle\u002Fag-skills --skill gitlab-ci-patterns",{"tool":39,"command":40},"bunx","bunx skills add shotcowboystyle\u002Fag-skills --skill gitlab-ci-patterns",{"tool":42,"command":43},"pnpm","pnpm dlx skills add shotcowboystyle\u002Fag-skills --skill gitlab-ci-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fcicd-automation\u002Fskills\u002Fgitlab-ci-patterns\u002FSKILL.md",true,[],[48,54,61,68,75,82],{"skillNo":49,"name":50,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":19},"01M7F1YRY5S5QRJ1V0BJS130QX","no-description","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fno-description\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7F1Y9BV2FJNQJ3NB32JS5CM","good-skill","Fixture skill that satisfies every rule.","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fgood-skill\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7F1XXBQ3NQRXZSS0KAGAR9V","broken-link","Links to a reference file that does not exist.","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fbroken-link\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7F1XBX4R46NR9W0HXQ7XCDX","Bad_Name","Name violates the kebab-case rule and does not match the directory.","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fbad-name\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7F1WNAF8WNEQ7S5HKT5VK0D","skill-authoring","Write, review, and validate portable agent skills in SKILL.md format. Use when creating a new skill, editing an existing one, or asked whether a skill follows the Agent Skills spec.","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Fskills\u002Fskill-authoring\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7F1W30TC0XFNSF7YBRGETK2","weigh-bags","Record scale readings for each bag — empty (tare), outbound, current, final — and reconcile them against the itemised inventory to find unaccounted weight. Use when the user gives a bag weight, says how heavy something is, weighs their luggage, or asks how close to the limit they are. Appends to bags.yaml and runs scripts\u002Freconcile.py.","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftravel-packing-assistant\u002Fskills\u002Fweigh-bags\u002FSKILL.md",[],[]]