Optimize pipeline

From harness/harness-ai · View interactive version

Optimize pipeline is an AI agent skill from the GitHub repository harness/harness-ai. 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

How to use this skill

Skill file

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

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.