Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计未展示

gitlab-ciGitLab CI 工具

Agent Skill

用于围绕 GitLab 项目、Merge Request、Issue、分支、流水线和代码审查流程提供辅助能力。它适合让 Agent 查询项目状态、整理提交差异、辅助检查合并请求或汇总 CI 结果。使用时需要确认项目权限、访问 token 和目标分支范围;涉及合并、推送、改工单或触发流水线时,应先预览影响并核对团队流程。

总安装

210

周安装

9

GitHub Stars

公开资料未说明

下载量

73
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:gitlab-ci(GitLab CI 工具)
来源仓库:https://github.com/simon-jarillo/prueba-skills
仓库路径:skills/gitlab-ci
安装命令:
npx skills add simon-jarillo/prueba-skills --skill "gitlab-ci"
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add simon-jarillo/prueba-skills --skill "gitlab-ci"

简介

用于 GitLab 项目管理和 Merge Request 审查流程。

  • 支持查询项目状态、提交差异与 CI 流水线结果。
  • 可辅助检查合并请求并汇总构建反馈信息。gitlab-ci 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 操作前需确认项目权限与目标分支保护规则。
  • 通过 npx 命令从指定仓库路径安装 gitlab-ci 技能。

SKILL.md

name
gitlab-ci
description
GitLab CI/CD pipelines for automated testing, building, and deployment. Use when configuring GitLab pipelines, setting up stages, defining jobs, working with runners, implementing deployment strategies, or creating reusable pipeline templates.

GitLab CI/CD

Complete CI/CD automation with GitLab pipelines, stages, and runners.

Basic Pipeline Structure

stages:
  - build
  - test
  - deploy

variables:
  NODE_VERSION: "20"

build:
  stage: build
  image: node:${NODE_VERSION}
  script:
    - npm ci
    - npm run build
  artifacts:
    paths:
      - dist/
    expire_in: 1 hour

test:
  stage: test
  image: node:${NODE_VERSION}
  script:
    - npm ci
    - npm run test
  coverage: '/All files[^|]*\|[^|]*\s+([\d\.]+)/'

deploy:
  stage: deploy
  script:
    - npm run deploy
  only:
    - main

Pipeline Configuration

Stages

stages:
  - build
  - test
  - security
  - deploy
  - cleanup

default:
  image: node:20
  before_script:
    - npm ci
  cache:
    key: ${CI_COMMIT_REF_SLUG}
    paths:
      - node_modules/

Job Structure

job_name:
  stage: test
  image: node:20
  variables:
    NODE_ENV: test
  before_script:
    - npm ci
  script:
    - npm run test
  after_script:
    - npm run cleanup
  rules:
    - if: '$CI_COMMIT_BRANCH == "main"'
  artifacts:
    reports:
      junit: test-results.xml
  cache:
    paths:
      - node_modules/

Rules and Conditions

Basic Rules

deploy_production:
  stage: deploy
  script: npm run deploy:prod
  rules:
    - if: '$CI_COMMIT_BRANCH == "main"'
      when: manual
    - if: '$CI_COMMIT_TAG'
      when: on_success
    - when: never

deploy_staging:
  stage: deploy
  script: npm run deploy:staging
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
    - if: '$CI_COMMIT_BRANCH == "develop"'

Complex Rules

build:
  rules:
    # Run on MR
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
      changes:
        - src/**/*
        - package.json
    # Run on main branch
    - if: '$CI_COMMIT_BRANCH == "main"'
    # Run on tags
    - if: '$CI_COMMIT_TAG'
    # Manual on other branches
    - when: manual
      allow_failure: true

Angular/TypeScript Pipeline

image: node:20

stages:
  - install
  - lint
  - test
  - build
  - deploy

variables:
  npm_config_cache: "$CI_PROJECT_DIR/.npm"
  CYPRESS_CACHE_FOLDER: "$CI_PROJECT_DIR/.cache/Cypress"

cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
    - .npm/
    - .cache/
    - node_modules/

install:
  stage: install
  script:
    - npm ci
  artifacts:
    paths:
      - node_modules/
    expire_in: 1 day

lint:
  stage: lint
  dependencies:
    - install
  script:
    - npm run lint
    - npm run format:check

test:unit:
  stage: test
  dependencies:
    - install
  script:
    - npm run test:ci
  coverage: '/Lines\s*:\s*(\d+\.\d+)%/'
  artifacts:
    reports:
      junit: test-results/junit.xml
      coverage_report:
        coverage_format: cobertura
        path: coverage/cobertura-coverage.xml
    paths:
      - coverage/

test:e2e:
  stage: test
  dependencies:
    - install
  script:
    - npm run e2e:ci
  artifacts:
    when: on_failure
    paths:
      - cypress/screenshots/
      - cypress/videos/
    expire_in: 7 days

build:
  stage: build
  dependencies:
    - install
  script:
    - npm run build -- --configuration production
  artifacts:
    paths:
      - dist/
    expire_in: 1 week

deploy:staging:
  stage: deploy
  dependencies:
    - build
  script:
    - npm run deploy:staging
  environment:
    name: staging
    url: https://staging.example.com
  rules:
    - if: '$CI_COMMIT_BRANCH == "develop"'

deploy:production:
  stage: deploy
  dependencies:
    - build
  script:
    - npm run deploy:production
  environment:
    name: production
    url: https://example.com
  rules:
    - if: '$CI_COMMIT_BRANCH == "main"'
      when: manual
  only:
    - main

Docker Build Pipeline

stages:
  - build
  - test
  - release

variables:
  DOCKER_DRIVER: overlay2
  DOCKER_TLS_CERTDIR: "/certs"
  IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG

build:
  stage: build
  image: docker:24
  services:
    - docker:24-dind
  before_script:
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
  script:
    - docker build -t $IMAGE_TAG .
    - docker push $IMAGE_TAG

test:
  stage: test
  image: $IMAGE_TAG
  script:
    - npm run test

release:
  stage: release
  image: docker:24
  services:
    - docker:24-dind
  before_script:
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
  script:
    - docker pull $IMAGE_TAG
    - docker tag $IMAGE_TAG $CI_REGISTRY_IMAGE:latest
    - docker push $CI_REGISTRY_IMAGE:latest
  rules:
    - if: '$CI_COMMIT_BRANCH == "main"'

Artifacts

Upload Artifacts

build:
  script:
    - npm run build
  artifacts:
    name: "$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA"
    paths:
      - dist/
      - coverage/
    reports:
      junit: test-results.xml
      coverage_report:
        coverage_format: cobertura
        path: coverage/cobertura-coverage.xml
    expire_in: 1 week
    when: on_success

Download Artifacts

deploy:
  dependencies:
    - build
  script:
    - ls dist/  # Artifacts from build job

Cache

Global Cache

cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
    - node_modules/
    - .npm/
  policy: pull-push

Job-specific Cache

install:
  cache:
    key: dependencies-$CI_COMMIT_REF_SLUG
    paths:
      - node_modules/
    policy: push

test:
  cache:
    key: dependencies-$CI_COMMIT_REF_SLUG
    paths:
      - node_modules/
    policy: pull

Environments

deploy:staging:
  stage: deploy
  script: ./deploy.sh staging
  environment:
    name: staging
    url: https://staging.example.com
    on_stop: stop:staging
    auto_stop_in: 1 week

stop:staging:
  stage: deploy
  script: ./cleanup.sh staging
  environment:
    name: staging
    action: stop
  when: manual

deploy:production:
  stage: deploy
  script: ./deploy.sh production
  environment:
    name: production
    url: https://example.com
  when: manual
  only:
    - main

Templates and Includes

Using Templates

include:
  - template: Security/SAST.gitlab-ci.yml
  - template: Security/Dependency-Scanning.gitlab-ci.yml
  - local: '.gitlab/ci/build.yml'
  - remote: 'https://gitlab.com/my-group/ci-templates/-/raw/main/node.yml'

# Or from project
include:
  - project: 'my-group/ci-templates'
    file: '/templates/node.yml'

Creating Templates

# .gitlab/ci/build.yml
.build_template:
  stage: build
  image: node:20
  script:
    - npm ci
    - npm run build
  artifacts:
    paths:
      - dist/

# Use in main .gitlab-ci.yml
build:app:
  extends: .build_template
  variables:
    APP_NAME: frontend

build:admin:
  extends: .build_template
  variables:
    APP_NAME: admin

Parallel Jobs

test:unit:
  parallel:
    matrix:
      - NODE_VERSION: ["18", "20", "22"]
        OS: ["ubuntu", "alpine"]
  image: node:${NODE_VERSION}-${OS}
  script:
    - npm run test

Monorepo (Nx) Pipeline

stages:
  - setup
  - affected

variables:
  NX_BRANCH: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
  NX_BASE: origin/$NX_BRANCH

setup:
  stage: setup
  script:
    - npm ci
  cache:
    key: $CI_COMMIT_REF_SLUG
    paths:
      - node_modules/
  artifacts:
    paths:
      - node_modules/

affected:lint:
  stage: affected
  dependencies:
    - setup
  script:
    - npx nx affected -t lint --base=$NX_BASE --head=HEAD --parallel=3
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'

affected:test:
  stage: affected
  dependencies:
    - setup
  script:
    - npx nx affected -t test --base=$NX_BASE --head=HEAD --parallel=3 --coverage
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'

affected:build:
  stage: affected
  dependencies:
    - setup
  script:
    - npx nx affected -t build --base=$NX_BASE --head=HEAD --parallel=3
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'

Security Scanning

include:
  - template: Security/SAST.gitlab-ci.yml
  - template: Security/Secret-Detection.gitlab-ci.yml
  - template: Security/Dependency-Scanning.gitlab-ci.yml

# Custom security job
security:npm:audit:
  stage: test
  script:
    - npm audit --production
  allow_failure: true

Variables

Predefined Variables

deploy:
  script:
    - echo "Branch: $CI_COMMIT_BRANCH"
    - echo "SHA: $CI_COMMIT_SHA"
    - echo "Tag: $CI_COMMIT_TAG"
    - echo "Pipeline ID: $CI_PIPELINE_ID"
    - echo "Project: $CI_PROJECT_NAME"

Custom Variables

variables:
  DEPLOY_SITE: "https://example.com"
  API_VERSION: "v2"
  
deploy:
  variables:
    DEPLOY_ENV: production
  script:
    - echo "Deploying to $DEPLOY_SITE"

Pages Deployment

pages:
  stage: deploy
  script:
    - npm run build
    - mv dist/ public/
  artifacts:
    paths:
      - public
  rules:
    - if: '$CI_COMMIT_BRANCH == "main"'

Review Apps

review:
  stage: deploy
  script:
    - ./deploy-review.sh
  environment:
    name: review/$CI_COMMIT_REF_SLUG
    url: https://$CI_COMMIT_REF_SLUG.review.example.com
    on_stop: stop_review
    auto_stop_in: 1 week
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'

stop_review:
  stage: deploy
  script:
    - ./cleanup-review.sh
  environment:
    name: review/$CI_COMMIT_REF_SLUG
    action: stop
  when: manual
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'

Best Practices

  1. Use cache effectively - Speed up pipelines
  2. Artifact expiration - Save storage costs
  3. Parallel jobs - Reduce pipeline duration
  4. Rules over only/except - More flexible conditions
  5. Templates for reusability - DRY pipelines
  6. Environment management - Proper deployment tracking
  7. Security scanning - Built-in templates
  8. Resource optimization - Cancel redundant pipelines

Troubleshooting

Debug Pipeline

debug:
  script:
    - echo "CI_COMMIT_BRANCH=$CI_COMMIT_BRANCH"
    - echo "CI_PIPELINE_SOURCE=$CI_PIPELINE_SOURCE"
    - env | sort

Cancel Redundant Pipelines

workflow:
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
    - if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
      when: never
    - if: '$CI_COMMIT_BRANCH'

Resources

  • GitLab CI Docs: https://docs.gitlab.com/ee/ci
  • Pipeline Reference: https://docs.gitlab.com/ee/ci/yaml
  • CI/CD Examples: https://docs.gitlab.com/ee/ci/examples

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

40.54%
按下载量换算30

Codex

27.27%
按下载量换算20

github-copilot

16.96%
按下载量换算12

Gemini CLI

6.94%
按下载量换算5

安全审计

暂无安全审计结果可展示。

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills