Agent Skill · Harness

optimize-pipeline

Optimize Harness CI/CD pipeline performance via MCP. Configure parallel test execution with Test Intelligence, design multi-layer caching strategies, analyze pipeline bottlenecks with stage-level timing breakdowns, optimize cache hit rates, and design monorepo CI pipelines with selective builds. Use when asked to speed up pipelines, improve cache hit rates, set up parallel testing, optimize build times, or configure monorepo builds. Do NOT use for creating new pipelines (use create-pipeline instead) or debugging failures (use debug-pipeline instead). Trigger phrases: pipeline speed, slow pipeline, cache hit rate, parallel tests, test intelligence, build optimization, caching strategy, monorepo pipeline, pipeline bottleneck, build speed.

Provider: Harness Path in repo: skills/optimize-pipeline/SKILL.md

Skill body

Optimize Pipeline

Analyze and optimize Harness CI/CD pipeline performance through parallel testing, caching, bottleneck analysis, and monorepo strategies.

Instructions

Step 1: Establish Scope

Confirm the service, pipeline, and current performance baseline.

Call MCP tool: harness_list
Parameters:
  resource_type: "pipeline"
  org_id: "<organization>"
  project_id: "<project>"

Get recent execution timing data:

Call MCP tool: harness_list
Parameters:
  resource_type: "execution"
  org_id: "<organization>"
  project_id: "<project>"
  pipeline_id: "<pipeline_identifier>"

Step 2: Identify the Optimization Task

Determine which optimization the user needs:

  1. Parallel Testing with Test Intelligence – Split tests across runners and skip unchanged tests
  2. Caching Strategy – Multi-layer dependency, build output, and test result caching
  3. Pipeline Bottleneck Analysis – Stage-level timing breakdown with recommendations
  4. Cache Hit Rate Improvement – Diagnose and fix low cache hit rates
  5. Monorepo CI Pipeline – Selective builds triggered by changed paths

Step 3: Configure Parallel Testing with Test Intelligence

Gather from the user:

Design the parallel test strategy:

Configuration:

Step 4: Design Caching Strategy

Gather from the user:

Design multi-layer caching:

Layer 1 – Dependencies:

Layer 2 – Build outputs:

Layer 3 – Test results:

Set cache TTL (recommended 7-14 days) with fallback strategy.

Step 5: Analyze Pipeline Bottlenecks

Pull execution data and break down by stage:

Call MCP tool: harness_get
Parameters:
  resource_type: "execution"
  resource_id: "<execution_id>"
  org_id: "<organization>"
  project_id: "<project>"

For each stage, identify:

Produce a prioritized optimization list ranked by time savings.

Step 6: Design Monorepo CI Pipeline

Gather from the user:

Design selective builds:

Examples

Performance Notes

Troubleshooting

Test Intelligence Not Skipping Tests

Cache Misses on Every Build

Monorepo Building Everything

Skill frontmatter

metadata: {"author"=>"Harness", "version"=>"1.0.0", "mcp-server"=>"harness-mcp-v2"} license: Apache-2.0 compatibility: Requires Harness MCP v2 server (harness-mcp-v2)