跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
开发与测试

create-pipeline-v1

Generate Harness v1 simplified Pipeline YAML using the new concise syntax with flat structure, ${{ }} expressions, script field, and action steps. Supports CI stages (run, run-test, background), CD stages (service/environment with action steps for K8s, Helm, ECS), approval (stage-level and inline), parallel execution, matrix/for/while strategies, caching, volumes, and templates. Use when asked for a v1 pipeline, simplified pipeline, new pipeline format, or when user specifically requests v1 syntax. Do NOT use for v0/standard pipelines (use create-pipeline). Trigger phrases: v1 pipeline, simplified pipeline, new pipeline format, create v1, modern pipeline syntax.

harness · 已有 AI 审核记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add harness/harness-skills --skill create-pipeline-v1

技能说明


name: create-pipeline-v1 description: >- Generate Harness v1 simplified Pipeline YAML using the new concise syntax with flat structure, ${{ }} expressions, script field, and action steps. Supports CI stages (run, run-test, background), CD stages (service/environment with action steps for K8s, Helm, ECS), approval (stage-level and inline), parallel execution, matrix/for/while strategies, caching, volumes, and templates. Use when asked for a v1 pipeline, simplified pipeline, new pipeline format, or when user specifically requests v1 syntax. Do NOT use for v0/standard pipelines (use create-pipeline). Trigger phrases: v1 pipeline, simplified pipeline, new pipeline format, create v1, modern pipeline syntax. metadata: author: Harness version: 3.1.0 mcp-server: harness-mcp-v2 license: Apache-2.0 compatibility: Requires Harness MCP v2 server (harness-mcp-v2)

Create Pipeline v1

Generate Harness v1 simplified Pipeline YAML and optionally push to Harness via MCP.

Alpha: This skill is currently in internal testing only.

Instructions

  1. Confirm v1 format - User must specifically want v1 syntax. Default to v0 (/create-pipeline) if unclear.
  2. Clarify requirements - Pipeline type (CI, CD, or both), language/framework, deployment target
  3. Consult the spec reference - Use references/v1-spec-schema.md for the complete v1 schema, step types, action catalog, and examples
  4. Select native actions - Always prefer native action and template steps over run: steps. Consult references/native-actions.md for the full mapping. Key rules:
    • Docker build/push → use template: uses: buildAndPushToDocker / buildAndPushToECR / buildAndPushToGAR (never run: docker build && docker push)
    • K8s deploy → use action: uses: kubernetes-rolling-deploy or template: uses: k8sRollingDeployStep (never run: kubectl apply)
    • Helm deploy → use action: uses: helm-deploy or template: uses: helmDeployBasicStep (never run: helm upgrade --install)
    • ECS deploy → use template: uses: ecsBluegreenDeployStep (never run: aws ecs update-service)
    • Terraform → use template: uses: terraformStep (never run: terraform apply)
    • Security scanning → use native STO templates (gitleaksStep, banditStep, sbomOrchestrationStep)
    • Uploads → use template: uses: uploadArtifactsToS3 / uploadArtifactsToGCS (never run: aws s3 cp)
    • Approvals → use approval: uses: harness or approval: uses: jira (never polling scripts)
    • Ticketing → use action: uses: jira-create / snow-create (never run: curl)
    • HTTP requests → use action: uses: http or template: uses: httpStep (never run: curl)
    • Use run: steps only for custom build/test/lint commands with no native equivalent
  5. Generate v1 YAML using flat structure, ${{ }} expressions, script field for run steps, and action/template steps for deployments
  6. Optionally create via MCP using harness_create with resource_type pipeline

v1 Key Differences from v0

v0 Syntaxv1 Syntax
<+variable> expressions${{ variable }} expressions
type: CI / type: Deployment stage typesFlat stages -- no type field
command: field in Run stepsscript: field in run: steps
Native steps (K8sRollingDeploy, HelmDeploy)Action steps (action: uses: kubernetes-rolling-deploy)
failureStrategies:on-failure:
HarnessApproval step typeapproval: uses: harness (stage-level or inline)
Deep nesting (spec: execution: steps:)Flat structure (steps:)
strategy: matrix: under stage specstrategy: matrix: directly on stage or step

Pipeline Structure

pipeline:
  name: My Pipeline
  repo:                          # optional: repository config
    connector: account.github
    name: myorg/my-repo
  clone:                         # optional: clone config
    depth: 1
  on:                            # optional: event triggers
  - push:
      branches: [main]
  env:                           # optional: global env vars
    NODE_ENV: production
  inputs:                        # optional: pipeline inputs
    branch:
      type: string
      default: main
  stages:
  - name: build
    steps:
    - run:
        script: go build

No version:, kind:, or spec: wrapper -- pipeline: is the root key.

Stages

Stages have no type field. Their purpose is determined by their keys.

CI Stage

- name: build
  runtime: cloud
  platform:
    os: linux
    arch: arm
  cache:
    path: node_modules
    key: npm.${{ branch }}
  steps:
  - run:
      script: npm ci

Deployment Stage

- name: deploy
  service: my-service
  environment: staging
  steps:
  - action:
      uses: kubernetes-rolling-deploy
      with:
        dry-run: false

Approval (stage-level)

- approval:
    uses: harness
    with:
      timeout: 30m
      message: "Approve deployment?"
      groups: [admins, ops]
      min-approvers: 1

Step Types

Run Step

Uses script: field (not command: or run:).

# long syntax
- run:
    script: npm test

# short syntax
- run: npm test

# with container
- run:
    container: node:18
    script: npm test

# with shell and env
- run:
    shell: bash
    script: |
      npm ci
      npm test
    env:
      NODE_ENV: test

# with output variables
- id: build
  run:
    script: echo "TAG=v1" >> $HARNESS_OUTPUT
    output: [TAG]

Run Test Step

- run-test:
    container: maven
    script: mvn test
    report:
      type: junit
      path: target/surefire-reports/*.xml
    splitting:
      concurrency: 4

Action Step

Actions replace v0 native steps. See references/v1-spec-schema.md for the full action catalog.

# Kubernetes deploy
- action:
    uses: kubernetes-rolling-deploy
    with:
      dry-run: false

# Helm deploy
- action:
    uses: helm-deploy
    with:
      
阅读完整来源 ↗